epicsarchiver_mgmt.commands.rename

Rename PVs in the archiver.

Attributes

LOG

SIZE_KEY

NO_SIZE_VAL

MAX_STORAGE_MB

Exceptions

TooMuchStoredDataError

Exception for when the old PV has a lot of data stored.

Functions

rename(→ None)

Rename PVs in the archiver, runs in parallel on multiple archivers.

_parallel_execute_rename(...)

validate_size(→ None)

Validate the old PVs are not too large.

rename_and_append(→ None)

Rename and append PVs in the archiver, runs in parallel on multiple archivers.

_parallel_execute_rename_and_append(...)

Module Contents

epicsarchiver_mgmt.commands.rename.LOG: logging.Logger[source]
epicsarchiver_mgmt.commands.rename.SIZE_KEY = 'Estimated storage rate (MB/day)'[source]
epicsarchiver_mgmt.commands.rename.NO_SIZE_VAL = 'Not enough info'[source]
epicsarchiver_mgmt.commands.rename.MAX_STORAGE_MB = 1000[source]
epicsarchiver_mgmt.commands.rename.rename(archiver_fqdns: list[str], renames: collections.abc.Sequence[tuple[str, str]], *, dry_run: bool = False) None[source]

Rename PVs in the archiver, runs in parallel on multiple archivers.

Parameters:
  • archiver_fqdns (list[str]) – The urls of the archivers.

  • renames (Sequence[tuple[str, str]]) – The PVs to rename.

  • dry_run (bool) – Whether to do a dry run or not.

Raises:

RequestHTTPError – If there is an error renaming the PVs.

epicsarchiver_mgmt.commands.rename._parallel_execute_rename(archivers: list[epicsarchiver_mgmt.archiver.mgmt.ArchiverMgmt], renames: collections.abc.Sequence[tuple[str, str]]) list[epicsarchiver_mgmt.archiver.mgmt.OperationResult][source]
exception epicsarchiver_mgmt.commands.rename.TooMuchStoredDataError(pv: str, storage: float)[source]

Bases: epicsarchiver_mgmt.exceptions.BaseMgmtError

Exception for when the old PV has a lot of data stored.

pv[source]
storage[source]
epicsarchiver_mgmt.commands.rename.validate_size(archiver: epicsarchiver_mgmt.archiver.info.ArchiverMgmtInfo, pvs: collections.abc.Sequence[str], max_storage: float = MAX_STORAGE_MB) None[source]

Validate the old PVs are not too large.

Parameters:
  • archiver (ArchiverMgmt) – The archiver.

  • pvs (Sequence[str]) – The PVs to check.

  • max_storage (float) – The maximum storage allowed in MB per day.

Raises:

TooMuchStoredDataError – If the old and new PVs are the same.

epicsarchiver_mgmt.commands.rename.rename_and_append(archiver_fqdns: list[str], renames: collections.abc.Sequence[tuple[str, str]], storage: epicsarchiver_mgmt.archiver.mgmt.Storage = Storage.MTS, *, dry_run: bool = False) None[source]

Rename and append PVs in the archiver, runs in parallel on multiple archivers.

Parameters:
  • archiver_fqdns (list[str]) – The urls of the archivers.

  • renames (Sequence[tuple[str, str]]) – The PVs to rename.

  • storage (Storage) – The storage to consolidate the data first.

  • dry_run (bool) – Whether to do a dry run or not.

Raises:

RequestHTTPError – If there is an error renaming the PVs.

epicsarchiver_mgmt.commands.rename._parallel_execute_rename_and_append(archivers: list[epicsarchiver_mgmt.archiver.mgmt.ArchiverMgmt], renames: collections.abc.Sequence[tuple[str, str]], storage: epicsarchiver_mgmt.archiver.mgmt.Storage) list[epicsarchiver_mgmt.archiver.mgmt.OperationResult][source]