API Config Parser¶
- File location:
Bundled implementation:
source/client/python/cfgparser.py
Cluster implementation:
cluster/app/source/python/cfgparser.py
Dataclasses¶
- class cfgparser.API¶
A dataclass for parsed API entry.
Sharing identifier, i.e. which MIME type the API entry is shared with.
- inited = multiprocessing.Value('B', False)¶
Initied flag.
- locked: multiprocessing.Lock¶
Multiprocessing runtime lock.
Functions¶
- cfgparser.parse_cmd(context: Dict[str, Any], mimetype: str, environ: Dict[str, Any])¶
Parse API of
mimetype
.- Parameters:
context – API configuration context.
mimetype (str) – MIME type of the API.
environ – Global environment variables.
- Raises:
ReportNotFoundError – If
report
section not presented incontext
.
Constants¶
- cfgparser.MEDIA_TYPE: Tuple[str]¶
('application', 'audio', # 'example', ## preserved for default API 'font', 'image', 'message', 'model', 'multipart', 'text', 'video')
Possible media types.
- cfgparser.API_LOCK: Dict[str, multiprocessing.Lock]¶
Database for multiprocessing lock.
Exceptions¶
- exception cfgparser.DefaultNotFoundError¶
- Bases:
The default fallback API for MIME type
example
not found.
- exception cfgparser.ReportNotFoundError¶
- Bases:
The
report
section not found in API.