epicsarchiver_mgmt.commands.clear_queue

Rearchive a pv to update the policy.

Attributes

LOG

CURRENT_STATE

DATE_FORMAT

Exceptions

OldTimeValueError

Custom exception for when old_time is required but not provided.

Classes

ArchivingState

Archiving state of a PV in the queue.

NeverConnectedPV

Response struct from never connected pvs.

QueueFilter

Filter for the queue.

Functions

get_never_connected_pvs(→ list[NeverConnectedPV])

Get Never connected pvs from archiver.

abort_pvs_in_queue(→ set[str])

Get the list of PVs that are currently being archived in the queue and abort them.

filter_queue_by_state(→ list[str])

Filter the queue by state.

clear_queue(→ None)

Clear the queue of the archiver.

Module Contents

epicsarchiver_mgmt.commands.clear_queue.LOG: logging.Logger[source]
epicsarchiver_mgmt.commands.clear_queue.CURRENT_STATE = 'currentState'[source]
class epicsarchiver_mgmt.commands.clear_queue.ArchivingState(*args, **kwds)[source]

Bases: enum.Enum

Archiving state of a PV in the queue.

START[source]

Start is the start of the archiving workflow.

ARCHIVE_REQUEST_SUBMITTED[source]

Request has been submitted to the archiver.

METAINFO_GATHERING[source]

Reading data from the PV to decide archiving policy.

UNKNOWN[source]

Unknown state.

classmethod from_str(state: str) ArchivingState[source]

Convert a string to an ArchivingState.

Parameters:

state (str) – The string to convert.

Returns:

The ArchivingState.

Return type:

ArchivingState

class epicsarchiver_mgmt.commands.clear_queue.NeverConnectedPV[source]

Response struct from never connected pvs.

request_time: datetime.datetime | None[source]
appliance: str[source]
pv_name: str[source]
current_state: ArchivingState[source]
start_of_workflow: datetime.datetime[source]
epicsarchiver_mgmt.commands.clear_queue.DATE_FORMAT = '%b/%d/%Y %H:%M:%S %Z'[source]
epicsarchiver_mgmt.commands.clear_queue.get_never_connected_pvs(archiver: epicsarchiver_mgmt.archiver.mgmt.ArchiverMgmt) list[NeverConnectedPV][source]

Get Never connected pvs from archiver.

Parameters:

archiver (ArchiverMgmt) – The archiver management instance.

Returns:

List of Never connected pvs.

Return type:

list[NeverConnectedPV]

epicsarchiver_mgmt.commands.clear_queue.abort_pvs_in_queue(pvs: list[str], archiver: epicsarchiver_mgmt.archiver.mgmt.ArchiverMgmt, chunking: int = 1000) set[str][source]

Get the list of PVs that are currently being archived in the queue and abort them.

Parameters:
  • pvs (list[str]) – List of PV names to check.

  • archiver (ArchiverMgmt) – The archiver management instance.

  • chunking (int) – Number of PVs to check in each request to the archiver.

Returns:

List of PV names that are currently being archived.

Return type:

list[str]

class epicsarchiver_mgmt.commands.clear_queue.QueueFilter(*args, **kwds)[source]

Bases: enum.Enum

Filter for the queue.

ALL[source]
START[source]
METAINFO_GATHERING[source]
ARCHIVING[source]
exception epicsarchiver_mgmt.commands.clear_queue.OldTimeValueError(queue_filter: QueueFilter)[source]

Bases: epicsarchiver_mgmt.exceptions.BaseMgmtError

Custom exception for when old_time is required but not provided.

epicsarchiver_mgmt.commands.clear_queue.filter_queue_by_state(archiver: epicsarchiver_mgmt.archiver.mgmt.ArchiverMgmt, queue_info: list[NeverConnectedPV], queue_filter: QueueFilter, old_time: datetime.timedelta | None) list[str][source]

Filter the queue by state.

Parameters:
Returns:

The filtered queue information.

Return type:

list[NeverConnectedPV]

Raises:

OldTimeValueError – If old_time is required but not provided.

epicsarchiver_mgmt.commands.clear_queue.clear_queue(archiver_fqdn: str, queue_filter: QueueFilter, old_time: datetime.timedelta | None) None[source]

Clear the queue of the archiver.

Parameters:
  • archiver_fqdn (str) – The url of the archiver.

  • queue_filter (QueueFilter) – The filter to apply.

  • old_time (timedelta | None) – The time after which a PV is considered stuck.