epicsarchiver.mgmt.archiver_mgmt_operations =========================================== .. py:module:: epicsarchiver.mgmt.archiver_mgmt_operations .. autoapi-nested-parse:: Archiver Mgmt operations module. Attributes ---------- .. autoapisummary:: epicsarchiver.mgmt.archiver_mgmt_operations.LOG epicsarchiver.mgmt.archiver_mgmt_operations.TypeInfo epicsarchiver.mgmt.archiver_mgmt_operations.OperationResult epicsarchiver.mgmt.archiver_mgmt_operations.OperationResultList Classes ------- .. autoapisummary:: epicsarchiver.mgmt.archiver_mgmt_operations.Storage epicsarchiver.mgmt.archiver_mgmt_operations.PutInfoType epicsarchiver.mgmt.archiver_mgmt_operations.ArchiverMgmtOperations Functions --------- .. autoapisummary:: epicsarchiver.mgmt.archiver_mgmt_operations.check_result Module Contents --------------- .. py:data:: LOG :type: logging.Logger .. py:class:: Storage Bases: :py:obj:`str`, :py:obj:`enum.Enum` Represents the different storage levels of the archiver appliance. .. py:attribute:: STS :value: 'STS' .. py:attribute:: MTS :value: 'MTS' .. py:attribute:: LTS :value: 'LTS' .. py:class:: PutInfoType(*args, **kwds) Bases: :py:obj:`enum.Enum` Represents the different types of put type info. .. py:attribute:: Override .. py:attribute:: CreateNew .. py:data:: TypeInfo .. py:data:: OperationResult .. py:data:: OperationResultList .. py:class:: ArchiverMgmtOperations(hostname: str = 'localhost', port: int = 17665) Bases: :py:obj:`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. :param hostname: EPICS Archiver Appliance hostname [default: localhost] :param port: EPICS Archiver Appliance management port [default: 17665] Examples: .. code-block:: python from epicsarchiver.archiver.mgmt import ArchiverMgmtOperations archappl = ArchiverMgmtOperations("archiver-01.tn.esss.lu.se") print(archappl.version) archappl.archive_pv("PVNAME") .. py:method:: archive_pv(pv: str, **kwargs: Any) -> OperationResultList Archive a PV. :param pv: name of the pv to be achived. Can be a comma separated list of names. :param \*\*kwargs: optional extra keyword arguments - samplingperiod - samplingmethod - controllingPV - policy - appliance :returns: list of submitted PVs .. py:method:: archive_pvs(pvs: OperationResultList) -> OperationResultList Archive a list of PVs. :param pvs: list of PVs (as dict) to archive :returns: list of submitted PVs .. py:method:: archive_pvs_from_files(files: list[str], appliance: str | None = None) -> OperationResultList Archive PVs from a list of files. :param files: list of files in CSV format with PVs to archive. :param appliance: optional appliance to use to archive PVs (in a cluster) :returns: list of submitted PVs .. py:method:: pause_pv(pv: str) -> OperationResultList | OperationResult Pause the archiving of a PV(s). :param pv: name of the pv. Can be a GLOB wildcards or a list of comma separated names. :returns: list of submitted PVs .. py:method:: resume_pv(pv: str) -> OperationResultList | OperationResult Resume the archiving of a PV(s). :param pv: name of the pv. Can be a GLOB wildcards or a list of comma separated names. :returns: list of submitted PVs .. py:method:: abort_pv(pv: str) -> list[str] Abort any pending requests for archiving this PV. :param pv: name of the pv. :returns: list of submitted PVs .. py:method:: add_alias(pv: str, alias_name: str) -> None Add an alias to a pv. :param pv: PV to add alias. :param alias_name: name of alias to add to pv. .. py:method:: delete_pv(pv: str, delete_data: bool = False) -> list[str] Stop archiving the specified PV. The PV needs to be paused first. :param pv: name of the pv. :param delete_data: delete the data that has already been recorded. Default to False. :returns: list of submitted PVs .. py:method:: rename_pv(pv: str, newname: str) -> OperationResult Rename this pv to a new name. The PV needs to be paused first. :param pv: name of the pv. :type pv: str :param newname: new name of the pv :type newname: str :returns: Status of action and description. Example: {"status":"ok","desc":"Successfully renamed PV PV1 to PV2"} :rtype: OperationResult .. py:method:: update_pv(pv: str, samplingperiod: float, samplingmethod: str | None = None) -> list[str] Change the archival parameters for a PV. :param pv: name of the pv. :param samplingperiod: the new sampling period in seconds. :param samplingmethod: the new sampling method [SCAN|MONITOR] :returns: list of submitted PV .. py:method:: pause_rename_resume_pv(pv: str, new: str) -> None Pause, rename and resume a PV. :param pv: name of the pv :param new: new name of the pv .. py:method:: rename_pvs_from_files(files: list[str]) -> None Rename PVs from a list of files. Each PV will be paused, renamed and resumed :param files: list of files in CSV format with PVs to rename. .. py:method:: rename_and_append(old: str, new: str, storage: Storage) -> None 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. :param old: The name of the older pv. The data for this PV will be appended to the newer PV and then deleted. :type old: str :param new: The name of the newer pv. :type new: str :param storage: The name of the store to consolidate data before appending. :type storage: Storage .. py:method:: change_type(pv: str, new_type: epicsarchiver.common.ArchDbrType) -> None Change the type of a pv to a new type. :param pv: Name of the PV :type pv: str :param new_type: New DBR_TYPE :type new_type: ArchDbrType .. py:method:: put_pv_type_info(pv: str, type_info: TypeInfo, put_info_type: PutInfoType) -> TypeInfo Put the type info for a PV. :param pv: Name of the PV :type pv: str :param type_info: Type info :type type_info: InfoResult :param put_info_type: Whether override or create new :type put_info_type: PutInfoType :returns: The updated type info :rtype: OperationResult .. py:function:: check_result(result: OperationResult | OperationResultList, default_message: str | None = None) -> bool Check a result returned by the Archiver Appliance. :param result: Input result type :type result: OperationResult | OperationResultList :param default_message: Message for the user. Defaults to None. :type default_message: str | None, optional :returns: Return True if the status is ok Return False otherwise and print the default_message or validation value :rtype: bool