epicsarchiver_mgmt.archiver.mgmt ================================ .. py:module:: epicsarchiver_mgmt.archiver.mgmt .. autoapi-nested-parse:: Archiver Mgmt operations module. Attributes ---------- .. autoapisummary:: epicsarchiver_mgmt.archiver.mgmt.LOG epicsarchiver_mgmt.archiver.mgmt.OperationResult epicsarchiver_mgmt.archiver.mgmt.OperationResultList Classes ------- .. autoapisummary:: epicsarchiver_mgmt.archiver.mgmt.Storage epicsarchiver_mgmt.archiver.mgmt.PutInfoType epicsarchiver_mgmt.archiver.mgmt.EpicsProto epicsarchiver_mgmt.archiver.mgmt.SamplingMethod epicsarchiver_mgmt.archiver.mgmt.ArchDbrType epicsarchiver_mgmt.archiver.mgmt.ArchivePVRequest epicsarchiver_mgmt.archiver.mgmt.ArchiverMgmt Module Contents --------------- .. py:data:: LOG :type: logging.Logger .. py:class:: Storage Bases: :py:obj:`enum.StrEnum` 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:: OperationResult .. py:data:: OperationResultList .. py:class:: EpicsProto Bases: :py:obj:`enum.StrEnum` Represents the different input protocols of the archiver appliance. .. py:attribute:: CA :value: 'CA' .. py:attribute:: PVA :value: 'PVA' .. py:method:: create_archive_request_pv_name(pv: str) -> str Return the PV name with the protocol. :param pv: The PV name. :type pv: str :returns: The PV name with the protocol. :rtype: str .. py:class:: SamplingMethod Bases: :py:obj:`enum.StrEnum` Represents the different sampling methods of the archiver appliance. .. py:attribute:: SCAN :value: 'SCAN' .. py:attribute:: MONITOR :value: 'MONITOR' .. py:class:: ArchDbrType(*args, **kwds) Bases: :py:obj:`enum.Enum` List of Dbr Types that the archiver uses. .. py:attribute:: DBR_SCALAR_STRING .. py:attribute:: DBR_SCALAR_SHORT .. py:attribute:: DBR_SCALAR_FLOAT .. py:attribute:: DBR_SCALAR_ENUM .. py:attribute:: DBR_SCALAR_BYTE .. py:attribute:: DBR_SCALAR_INT .. py:attribute:: DBR_SCALAR_DOUBLE .. py:attribute:: DBR_WAVEFORM_STRING .. py:attribute:: DBR_WAVEFORM_SHORT .. py:attribute:: DBR_WAVEFORM_FLOAT .. py:attribute:: DBR_WAVEFORM_ENUM .. py:attribute:: DBR_WAVEFORM_BYTE .. py:attribute:: DBR_WAVEFORM_INT .. py:attribute:: DBR_WAVEFORM_DOUBLE .. py:attribute:: DBR_V4_GENERIC_BYTES .. py:class:: ArchivePVRequest Information to archive a PV. .. py:attribute:: pv :type: str .. py:attribute:: samplingmethod :type: SamplingMethod | None :value: None .. py:attribute:: samplingperiod :type: float | None :value: None .. py:attribute:: controllingPV :type: str | None :value: None .. py:attribute:: policy :type: str | None :value: None .. py:attribute:: appliance :type: str | None :value: None .. py:method:: as_dict() -> dict[str, str] Return the object as a dictionary. .. py:class:: ArchiverMgmt(hostname: str = 'localhost', port: int = 17665) Bases: :py:obj:`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. :param hostname: EPICS Archiver Appliance hostname [default: localhost] :param port: EPICS Archiver Appliance management port [default: 17665] .. py:method:: 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 Archive a PV. :param pv: PV name. :type pv: str :param sampling_period: The sampling period, i.e. 1.0 is 1Hz. Defaults to None. :type sampling_period: str | None, optional :param sampling_method: The sampling method, SCAN or MONITOR. Defaults to None. :type sampling_method: SamplingMethod | None, optional :param controlling_pv: A pv to control when to archive this pv. Defaults to None. :type controlling_pv: str | None, optional :param policy: The policy, can be found at /mgmt/bpl/getPolicyList. Defaults to None. :type policy: str | None, optional :param appliance: Can specify a specific appliance. Defaults to None. :type appliance: str | None, optional :param protocol: Protocol to use. Defaults to EpicsProto.CA. :type protocol: EpicsProto, optional :returns: _description_ :rtype: OperationResultList .. py:method:: archive_pv_requests(pv_requests: list[ArchivePVRequest]) -> OperationResultList Archive a list of PVs with the given parameters. :param pv_requests: The pv requests. :type pv_requests: list[ArchivePVRequest] :returns: Result of the operation. :rtype: OperationResultList .. py:method:: pause_pv(pv: str) -> 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) -> 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) -> OperationResult Abort any pending requests for archiving this PV. :param pv: name of the pv. :returns: Status of action and description. Example: {"status":"ok","desc":"Aborted request for archiving PV PV1"} :rtype: OperationResult .. py:method:: add_alias(pv: str, alias_name: str) -> OperationResult Add an alias to a pv. :param pv: PV to add alias. :param alias_name: name of alias to add to pv. :returns: Status of action and description. :rtype: OperationResult .. py:method:: remove_alias(pv: str, alias_name: str) -> OperationResult Remove an alias to a pv. :param pv: PV to remove alias. :param alias_name: name of alias to remove from pv. :returns: Status of action and description. :rtype: OperationResult .. py:method:: delete_pv(pv: str, delete_data: bool = False) -> OperationResult 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 | None = None, samplingmethod: str | None = None) -> OperationResult 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:: rename_and_append(old: str, new: str, storage: Storage) -> OperationResult 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 :returns: Result of the operation :rtype: OperationResultList .. py:method:: change_type(pv: str, new_type: ArchDbrType) -> OperationResult 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 :returns: OperationResult .. py:method:: put_pv_type_info(pv: str, type_info: epicsarchiver_mgmt.archiver.info.TypeInfo, put_info_type: PutInfoType) -> epicsarchiver_mgmt.archiver.info.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:method:: get_policy_list() -> dict[str, str] Get the list of policies. :returns: dictionary of policies names and descriptions .. py:property:: never_connected_pvs :type: epicsarchiver_mgmt.archiver.info.InfoResultList Get the never connected PVs of the archiver. :returns: List of never connected items. :rtype: InfoResultList .. py:property:: appliances_in_cluster :type: list[dict[str, str]] Get the appliances in the cluster. :returns: List of appliances in the cluster. :rtype: InfoResultList