epicsarchiver_mgmt.command ========================== .. py:module:: epicsarchiver_mgmt.command .. autoapi-nested-parse:: Command line tool for doing mgmt operations with the archiver. Attributes ---------- .. autoapisummary:: epicsarchiver_mgmt.command.LOG epicsarchiver_mgmt.command.archiver_fqdn_option epicsarchiver_mgmt.command.archiver_fqdns_option epicsarchiver_mgmt.command.file_argument Functions --------- .. autoapisummary:: epicsarchiver_mgmt.command.validate_str_input epicsarchiver_mgmt.command.validate_file_input epicsarchiver_mgmt.command.cli epicsarchiver_mgmt.command.pause epicsarchiver_mgmt.command.abort epicsarchiver_mgmt.command.delete epicsarchiver_mgmt.command.statuses epicsarchiver_mgmt.command.rename epicsarchiver_mgmt.command.resume epicsarchiver_mgmt.command._parse_archive_requests epicsarchiver_mgmt.command.archive epicsarchiver_mgmt.command.change_type epicsarchiver_mgmt.command.change_protocol epicsarchiver_mgmt.command.repolicy epicsarchiver_mgmt.command.change_parameter epicsarchiver_mgmt.command.clear_queue epicsarchiver_mgmt.command.alias epicsarchiver_mgmt.command.add_alias epicsarchiver_mgmt.command.remove_alias epicsarchiver_mgmt.command._parse_error_to_bad_param Module Contents --------------- .. py:data:: LOG :type: logging.Logger .. py:function:: validate_str_input(ctx: click.Context, param: click.Parameter, value: str | None) -> str Check if the command input is provided. :param ctx: The click context. :type ctx: click.Context :param param: The click parameter. :type param: click.Parameter :param value: The value of the parameter. :type value: str | None :returns: The value if it is valid, otherwise raises click.BadParameter. :rtype: str | None :raises click.BadParameter: If the value is None or empty. .. py:function:: validate_file_input(ctx: click.Context, param: click.Parameter, value: io.TextIOWrapper) -> io.TextIOWrapper Check if the command input is provided. :param ctx: The click context. :type ctx: click.Context :param param: The click parameter. :type param: click.Parameter :param value: The value of the parameter. :type value: str | None :returns: The value if it is valid, otherwise raises click.BadParameter. :rtype: str | None :raises click.BadParameter: If the value is None or empty. .. py:function:: cli() -> None Command line tool for doing mgmt operations with the archiver. .. py:data:: archiver_fqdn_option .. py:data:: archiver_fqdns_option .. py:data:: file_argument .. py:function:: pause(ctx: click.Context, archiver_fqdn: list[str], file: io.TextIOWrapper) -> None Pause PVs in the archiver. ARGUMENT file csv file of what pvs to pause. Example usage: .. code-block:: console arch-mgmt pause -a archiver.example.com pvs.csv .. py:function:: abort(ctx: click.Context, archiver_fqdn: list[str], file: io.TextIOWrapper) -> None Abort PVs from the connection queue in the archiver. ARGUMENT file csv file of what pvs to abort. Example usage: .. code-block:: console arch-mgmt abort -a archiver.example.com pvs.csv .. py:function:: delete(ctx: click.Context, archiver_fqdn: list[str], file: io.TextIOWrapper) -> None Delete PVs in the archiver. ARGUMENT file csv file of what pvs to delete. Example usage: .. code-block:: console arch-mgmt delete -a archiver.example.com pvs.csv .. py:function:: statuses(ctx: click.Context, archiver_fqdn: str, file: io.TextIOWrapper, output_file: io.TextIOWrapper) -> None Get the status of PVs in the archiver. ARGUMENT file csv file of what pvs to get status. Example usage: .. code-block:: console arch-mgmt statuses -a archiver.example.com pvs.csv .. py:function:: rename(ctx: click.Context, archiver_fqdn: list[str], file: io.TextIOWrapper, and_append: bool = False, dry_run: bool = False) -> None Rename PVs in the archiver. ARGUMENT file csv file of what pvs to rename. Example file: .. code-block:: console old_pv,new_pv pv1,pv2 pv3,pv4 Example usage: .. code-block:: console arch-mgmt rename -a archiver.example.com -a archiver.example.com pvs.csv .. py:function:: resume(ctx: click.Context, archiver_fqdn: list[str], file: io.TextIOWrapper) -> None Resume Archiving PVs in the archiver. ARGUMENT file csv file of what pvs to resume. Example usage: .. code-block:: console arch-mgmt resume -a archiver.example.com pvs.csv .. py:function:: _parse_archive_requests(file: TextIO, appliance: str | None) -> list[epicsarchiver_mgmt.archiver.mgmt.ArchivePVRequest] .. py:function:: archive(ctx: click.Context, archiver_fqdn: str, dry_run: bool, appliance: str | None, file: io.TextIOWrapper) -> None Archive PVs in the archiver. ARGUMENT file csv file of what pvs to archive. The csv file should have the following format: Example: PV,policy mypv1, mypv2,1Hz mypv3,1HzSCAN Policy is optional. If not provided, the default policy will be used. You can find the options at archiver.example.com/mgmt/bpl/getPolicyList. Example usage: .. code-block:: console arch-mgmt archive -a archiver.example.com pvs.csv :raises click.BadParameter: If no PVs are found in the input file. .. py:function:: change_type(ctx: click.Context, archiver_fqdn: str, file: io.TextIOWrapper, new_type: epicsarchiver_mgmt.archiver.mgmt.ArchDbrType | None) -> None Change the type of PVs in the archiver. ARGUMENT file csv file of what pvs to change type. Example usage: .. code-block:: console arch-mgmt change-type -a archiver.example.com --new-type DBR_SCALAR_DOUBLE pvs.csv .. py:function:: change_protocol(ctx: click.Context, archiver_fqdn: str, file: io.TextIOWrapper, protocol: epicsarchiver_mgmt.archiver.mgmt.EpicsProto | None) -> None Change the protocol of PVs in the archiver. ARGUMENT file csv file of what pvs to change protocol. Example usage: .. code-block:: console arch-mgmt change-protocol -a archiver.example.com --new-protocol ca pvs.csv .. py:function:: repolicy(ctx: click.Context, archiver_fqdn: str, file: io.TextIOWrapper) -> None Re choose the policy of PVs in the archiver. ARGUMENT file csv file of what pvs to change protocol. Example usage: .. code-block:: console arch-mgmt repolicy -a archiver.example.com pvs.csv .. py:function:: change_parameter(ctx: click.Context, archiver_fqdn: str, file: io.TextIOWrapper, method: epicsarchiver_mgmt.archiver.mgmt.SamplingMethod | None, period: float | None) -> None Change the archiving parameters of PVs in the archiver. ARGUMENT file csv file of what pvs to change archiving parameters. Example usage: .. code-block:: console arch-mgmt change-parameter -a archiver.example.com --method SCAN --period 10.0 pvs.csv :raises click.BadParameter: If neither method nor period is provided. .. py:function:: clear_queue(ctx: click.Context, archiver_fqdn: str, old_time: int, queue_filter: epicsarchiver_mgmt.commands.clear_queue.QueueFilter) -> None Clear Queue of already archiving PVs in the archiver. Example usage: .. code-block:: console arch-mgmt clear-queue -a archiver.example.com .. py:function:: alias() -> None Alias PVs in the archiver. .. py:function:: add_alias(ctx: click.Context, archiver_fqdn: str, file: io.TextIOWrapper) -> None Add alias to PVs in the archiver. ARGUMENT file csv file of what pvs to alias. Example file: .. code-block:: console original_pv,alias_pv_name pv1,pv2 pv3,pv4 Example usage: .. code-block:: console arch-mgmt alias add -a archiver.example.com pvs.csv .. py:function:: remove_alias(ctx: click.Context, archiver_fqdn: str, file: io.TextIOWrapper) -> None Remove aliases to PVs in the archiver. ARGUMENT file csv file of what pvs to alias. Example file: .. code-block:: console original_pv,alias_pv_name pv1,pv2 pv3,pv4 Example usage: .. code-block:: console arch-mgmt alias remove -a archiver.example.com pvs.csv .. py:function:: _parse_error_to_bad_param(ctx: click.Context, err: epicsarchiver_mgmt.input_parsing.ParseCSVRowError) -> None Convert a ParseCSVRowError to a click.BadParameter. :param ctx: The click context. :type ctx: click.Context :param err: The error to convert. :type err: ParseCSVRowError :raises click.BadParameter: If the error is a ParseCSVRowError.