5. Debugpanel API Reference
5.1. lockss.debugpanel
Library and command line tool to interact with the LOCKSS 1.x DebugPanel servlet.
- class lockss.debugpanel.Node(node_reference, u, p)
Connector to a LOCKSS 1.x node.
- Parameters:
node_reference (str)
u (str)
p (str)
- DEFAULT_PROTOCOL = 'http'
- authenticate(req)
Does what is necessary to authenticate with the given
Requestobject.- Parameters:
req (Request) -- A
Requestinstance.- Return type:
None
- get_url()
Returns the full URL corresponding to this node (with protocol but no final slash).
- Returns:
The full URL corresponding to this node.
- Return type:
str
- type lockss.debugpanel.RequestUrlOpenT = Any
- lockss.debugpanel.check_substance(node, auid)
Performs the DebugPanel servlet "Check Substance" operation on the given node for the given AUID.
- Parameters:
node (Node) -- A
Nodeinstance.auid (str) -- An AUID.
- Returns:
The result of
urllib.request.urlopen.- Return type:
- Raises:
Exception -- Whatever
urllib.request.urlopenmight raise.
- lockss.debugpanel.crawl(node, auid)
Performs the DebugPanel servlet "Force Start Crawl" operation on the given node for the given AUID.
- Parameters:
node (Node) -- A
Nodeinstance.auid (str) -- An AUID.
- Returns:
The result of
urllib.request.urlopen.- Return type:
- Raises:
Exception -- Whatever
urllib.request.urlopenmight raise.
- lockss.debugpanel.crawl_plugins(node)
Performs the DebugPanel servlet "Crawl Plugins" operation on the given node.
- Parameters:
node (Node) -- A
Nodeinstance.- Returns:
The result of
urllib.request.urlopen.- Return type:
- Raises:
Exception -- Whatever
urllib.request.urlopenmight raise.
- lockss.debugpanel.deep_crawl(node, auid, depth=123)
Performs the DebugPanel servlet "Force Deep Crawl" operation on the given node for the given AUID, with the given depth (default
DEFAULT_DEPTH).- Parameters:
node (Node) -- A
Nodeinstance.auid (int) -- An AUID.
depth (int) -- A strictly positive refetch depth.
- Returns:
The result of
urllib.request.urlopen.- Return type:
- Raises:
ValueError -- If depth is negative or zero.
Exception -- Whatever
urllib.request.urlopenmight raise.
- lockss.debugpanel.disable_indexing(node, auid)
Performs the DebugPanel servlet "Disable Indexing" operation on the given node for the given AUID.
- Parameters:
node (Node) -- A
Nodeinstance.auid (str) -- An AUID.
- Returns:
The result of
urllib.request.urlopen.- Return type:
- Raises:
Exception -- Whatever
urllib.request.urlopenmight raise.
- lockss.debugpanel.node(node_reference, u, p)
DEPRECATED: Constructs a new
Nodeinstance (see theNodeconstructor); THIS FUNCTION WILL BE REMOVED IN VERSION 0.9.0.- Parameters:
node_reference (str) -- See the
Nodeconstructor.u (str) -- See the
Nodeconstructor.p (str) -- See the
Nodeconstructor.
- Returns:
See the
Nodeconstructor.- Return type:
- lockss.debugpanel.poll(node, auid)
Performs the DebugPanel servlet "Start V3 Poll" operation on the given node for the given AUID.
- Parameters:
node (Node) -- A
Nodeinstance.auid (str) -- An AUID.
- Returns:
The result of
urllib.request.urlopen.- Return type:
- Raises:
Exception -- Whatever
urllib.request.urlopenmight raise.
- lockss.debugpanel.reindex_metadata(node, auid)
Performs the DebugPanel servlet "Force Reindex Metadata" operation on the given node for the given AUID.
- Parameters:
node (Node) -- A
Nodeinstance.auid (str) -- An AUID.
- Returns:
The result of
urllib.request.urlopen.- Return type:
- Raises:
Exception -- Whatever
urllib.request.urlopenmight raise.
- lockss.debugpanel.reload_config(node)
Performs the DebugPanel servlet "Reload Config" operation on the given node.
- Parameters:
node (Node) -- A
Nodeinstance.- Returns:
The result of
urllib.request.urlopen.- Return type:
- Raises:
Exception -- Whatever
urllib.request.urlopenmight raise.
- lockss.debugpanel.validate_files(node, auid)
Performs the DebugPanel servlet "Validate Files" operation on the given node for the given AUID.
- Parameters:
node (Node) -- A
Nodeinstance.auid (str) -- An AUID.
- Returns:
The result of
urllib.request.urlopen.- Return type:
- Raises:
Exception -- Whatever
urllib.request.urlopenmight raise.
5.2. lockss.debugpanel.cli
Command line tool to interact with the LOCKSS 1.x DebugPanel servlet.
- type cli.RequestUrlOpenT = Any
- lockss.debugpanel.cli._AUID_COMMANDS = Section(AUID commands, is_sorted=False)
A subcommand section for AUID commands.
- lockss.debugpanel.cli._DEFAULT_JOB_POOL_TYPE: _JobPoolType = _JobPoolType.THREAD_POOL
The default
_JobPoolType.
- class lockss.debugpanel.cli._DebugPanelCli(ctx)
DebugPanel command line application.
- Parameters:
ctx (ExtraContext)
- _auids: list[str] | None
- _ctx: ExtraContext
- _do_auid_command(node_auid_func, **kwargs)
Performs one AUID-centric command.
- Parameters:
node_auid_func (Callable[[Node, str], RequestUrlOpenT]) -- A function that applies to a
Nodeand an AUID and returns whaturllib.request.urlopenreturns.- Return type:
None
- _do_node_command(node_func, **kwargs)
Performs one node-centric command.
- Parameters:
node_func (Callable[[Node], RequestUrlOpenT]) -- A function that applies to a
Nodeand returns whaturllib.request.urlopenreturns.- Return type:
None
- _executor: Executor | None
- _initialize_auid_operation()
Initializes for an AUID-centric operation. Fails if the list of AUIDs ends up being empty.
- Return type:
None
- _initialize_node_operation()
Initializes for a node-centric operation. Fails if the list of nodes ends up being empty.
- Return type:
None
- _nodes: list[str] | None
- check_substance()
Implementation of the
check-substancecommand.- Return type:
None
- crawl()
Implementation of the
crawlcommand.- Return type:
None
- crawl_plugins()
Implementation of the
crawl-pluginscommand.- Return type:
None
- deep_crawl()
Implementation of the
deep-crawlcommand.- Return type:
None
- disable_indexing()
Implementation of the
disable-indexingcommand.- Return type:
None
- dispatch(method, **cli_kwargs)
Initializes from the given command line options and invokes the given (bound) method.
- Parameters:
method (Callable[[], None]) -- A (bound) method.
cli_kwargs (dict[str, Any]) -- The command line arguments passed by Click Extra.
- Return type:
None
- poll()
Implementation of the
pollcommand.- Return type:
None
- reindex_metadata()
Implementation of the
reindex-metadatacommand.- Return type:
None
- reload_config()
Implementation of the
reload-configcommand.- Return type:
None
- validate_files()
Implementation of the
validate-filescommand.- Return type:
None
- class lockss.debugpanel.cli._JobPoolType(*values)
An enum of job pool types.
- PROCESS_POOL = 'process-pool'
- THREAD_POOL = 'thread-pool'
- lockss.debugpanel.cli._NODE_COMMANDS = Section(Node commands, is_sorted=False)
A subcommand section for node commands.
- class lockss.debugpanel.cli._Opts(*, node=(), nodes=(), u=None, username=None, p=None, password=None, auid=(), auids=(), depth=None, pool_size=None, pool_type=None, process_pool=False, thread_pool=False, headings=None, progress=None, table_format=None)
Data class to hold parsed command line options.
- Parameters:
node (tuple[str, ...])
nodes (tuple[Path, ...])
u (str | None)
username (str | None)
p (str | None)
password (str | None)
auid (tuple[str, ...])
auids (tuple[Path, ...])
depth (int | None)
pool_size (int | None)
pool_type (_JobPoolType | None)
process_pool (bool)
thread_pool (bool)
headings (bool | None)
progress (bool | None)
table_format (TableFormat | None)
- auid: tuple[str, ...] = ()
- auids: tuple[Path, ...] = ()
- depth: int | None = None
- headings: bool | None = None
- node: tuple[str, ...] = ()
- nodes: tuple[Path, ...] = ()
- p: str | None = None
- password: str | None = None
- pool_size: int | None = None
- pool_type: _JobPoolType | None = None
- process_pool: bool = False
- progress: bool | None = None
- table_format: TableFormat | None = None
- thread_pool: bool = False
- u: str | None = None
- username: str | None = None
- lockss.debugpanel.cli._auid_operation(decorated)
The composite AUID operation decorator.
- lockss.debugpanel.cli._auid_option_group(f)
The AUID option group: --auid/-a, --auids/-A
- Parameters:
f (F)
- Return type:
F
- lockss.debugpanel.cli._depth_option_group(f)
The depth option group: --depth/-d
- Parameters:
f (F)
- Return type:
F
- lockss.debugpanel.cli._node_operation(decorated)
The composite node operation decorator.
- lockss.debugpanel.cli._node_option_group(f)
The node option group: --node/-n, --nodes/-N, --username/-U, --password/-P
- Parameters:
f (F)
- Return type:
F
- lockss.debugpanel.cli._output_option_group(f)
The output option group: --headings/--no-headings, --progress/--no-progress, --table-format/-T
- Parameters:
f (F)
- Return type:
F
- lockss.debugpanel.cli._pool_option_group(f)
The job pool option group: --pool-size, --pool-type
- Parameters:
f (F)
- Return type:
F
- lockss.debugpanel.cli.main()
Main entry point of the module.
- Return type:
None