Repository navigation
Expand file tree
/
Copy path__init__.py
More file actions
60 lines (53 loc) · 1.59 KB
/
Copy path__init__.py
File metadata and controls
60 lines (53 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Copyright (c) 2026, René Moser <mail@renemoser.net>
# SPDX-License-Identifier: Apache-2.0
"""Generate an OpenAPI 3.2 document from the Apache CloudStack ``listApis`` endpoint.
CloudStack describes itself through ``listApis``, which returns a bespoke,
non-standard catalogue of every API command, its request parameters and its
response fields. This package translates that catalogue into an OpenAPI 3.2.0
document that can be fed to documentation browsers and client generators.
The typical entry point is :func:`build_document`::
from cloudstack_openapi import GeneratorOptions, build_document, dumps
document = build_document(apis, GeneratorOptions(server_url=url))
print(dumps(document, "yaml"))
"""
from ._types import Json, Kind, Schema
from ._version import __version__
from .document import (
OPENAPI_VERSION,
GeneratorOptions,
build_document,
build_operation,
build_parameter,
)
from .errors import CloudStackOpenAPIError, DependencyError, SourceError
from .schemas import SchemaRegistry
from .serialization import dump, dumps
from .source import (
create_client,
fetch_api_version,
fetch_listapis,
load_listapis,
probe_response_keys,
)
__all__ = [
"OPENAPI_VERSION",
"CloudStackOpenAPIError",
"DependencyError",
"GeneratorOptions",
"Json",
"Kind",
"Schema",
"SchemaRegistry",
"SourceError",
"__version__",
"build_document",
"build_operation",
"build_parameter",
"create_client",
"dump",
"dumps",
"fetch_api_version",
"fetch_listapis",
"load_listapis",
"probe_response_keys",
]