Index of well-known Apdb instances.
Parameters
----------
index_path : `str`, optional
Path to the index configuration file, if not provided then the value
of ``DAX_APDB_INDEX_URI`` environment variable is used to locate
configuration file.
The index is configured from a simple YAML file whose location is
determined from ``DAX_APDB_INDEX_URI`` environment variable. The content
of the index file is a mapping of the labels to URIs in YAML format, e.g.:
.. code-block:: yaml
dev: "/path/to/config-file.yaml"
"prod/pex_config": "s3://bucket/apdb-prod.py"
"prod/yaml": "s3://bucket/apdb-prod.yaml"
The labels in the index file consists of the label name and an optional
format name separated from label by slash. `get_apdb_uri` method can
use its ``format`` argument to return either a format-specific
configuration or a label-only configuration if format-specific is not
defined.
ResourcePath lsst.dax.apdb.apdbIndex.ApdbIndex.get_apdb_uri |
( |
| self, |
|
|
str | label, |
|
|
str | None | format = None ) |
Return URI for APDB configuration file given its label.
Parameters
----------
label : `str`
Label of APDB instance.
format : `str`
Format of the APDB configuration file, arbitrary string. This can
be used to support an expected migration from pex_config to YAML
configuration for APDB, code that uses pex_config could provide
"pex_config" for ``format``. The actual key in the index is
either a slash-separated label and format, or, if that is missing,
just a label.
Returns
-------
uri : `~lsst.resources.ResourcePath`
URI for the configuration file for APDB instance.
Raises
------
FileNotFoundError
Raised if an index is defined in the environment but it
can not be found.
ValueError
Raised if the label is not found in the index.
RuntimeError
Raised if ``index_path`` is not provided and environment variable
is not set.
TypeError
Raised if the format of the index file is incorrect.