Skip to content

Commit

Permalink
Dynamically generate the API description for SwaggerUI
Browse files Browse the repository at this point in the history
  • Loading branch information
dormant-user committed Jan 6, 2025
1 parent b6b78dc commit 8f8adde
Show file tree
Hide file tree
Showing 11 changed files with 202 additions and 59 deletions.
7 changes: 6 additions & 1 deletion doc_gen/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ Exceptions
Models
------

.. autoclass:: pyninja.modules.models.RoutingHandler(BaseModel)
:exclude-members: _abc_impl, model_config, model_fields, model_computed_fields

====

.. autoclass:: pyninja.modules.models.ServiceStatus(BaseModel)
:exclude-members: _abc_impl, model_config, model_fields, model_computed_fields

Expand Down Expand Up @@ -124,7 +129,7 @@ Models
====

.. automodule:: pyninja.modules.models
:exclude-members: ServiceStatus, Architecture, Session, WSSession, RateLimit, EnvConfig, session, ws_session, env, database, architecture
:exclude-members: RoutingHandler, ServiceStatus, Architecture, Session, WSSession, RateLimit, EnvConfig, session, ws_session, env, database, architecture

Payloads
--------
Expand Down
2 changes: 1 addition & 1 deletion docs/README.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />

<title>PyNinja &#8212; PyNinja documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
Expand Down
7 changes: 6 additions & 1 deletion docs/_sources/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ Exceptions
Models
------

.. autoclass:: pyninja.modules.models.RoutingHandler(BaseModel)
:exclude-members: _abc_impl, model_config, model_fields, model_computed_fields

====

.. autoclass:: pyninja.modules.models.ServiceStatus(BaseModel)
:exclude-members: _abc_impl, model_config, model_fields, model_computed_fields

Expand Down Expand Up @@ -124,7 +129,7 @@ Models
====

.. automodule:: pyninja.modules.models
:exclude-members: ServiceStatus, Architecture, Session, WSSession, RateLimit, EnvConfig, session, ws_session, env, database, architecture
:exclude-members: RoutingHandler, ServiceStatus, Architecture, Session, WSSession, RateLimit, EnvConfig, session, ws_session, env, database, architecture

Payloads
--------
Expand Down
40 changes: 31 additions & 9 deletions docs/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,14 @@ <h2 id="A">A</h2>
<li><a href="index.html#pyninja.modules.enums.APIEndpoints">APIEndpoints (class in pyninja.modules.enums)</a>
</li>
<li><a href="index.html#pyninja.modules.models.EnvConfig.apikey">apikey (pyninja.modules.models.EnvConfig attribute)</a>
</li>
<li><a href="index.html#pyninja.modules.exceptions.APIResponse">APIResponse</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pyninja.modules.exceptions.APIResponse">APIResponse</a>
<li><a href="index.html#pyninja.modules.enums.APIRouteType">APIRouteType (class in pyninja.modules.enums)</a>
</li>
<li><a href="index.html#pyninja.modules.models.RoutingHandler.Config.arbitrary_types_allowed">arbitrary_types_allowed (pyninja.modules.models.RoutingHandler.Config attribute)</a>
</li>
<li><a href="index.html#pyninja.modules.models.Architecture">Architecture (class in pyninja.modules.models)</a>
</li>
Expand Down Expand Up @@ -180,16 +184,18 @@ <h2 id="D">D</h2>
<h2 id="E">E</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pyninja.modules.models.RoutingHandler.enabled">enabled (pyninja.modules.models.RoutingHandler attribute)</a>
</li>
<li><a href="index.html#pyninja.modules.models.EnvConfig">EnvConfig (class in pyninja.modules.models)</a>
</li>
<li><a href="index.html#pyninja.modules.models.EnvConfig.Config">EnvConfig.Config (class in pyninja.modules.models)</a>
</li>
<li><a href="index.html#pyninja.executors.squire.envfile_loader">envfile_loader() (in module pyninja.executors.squire)</a>
</li>
<li><a href="index.html#pyninja.executors.auth.EPOCH">EPOCH() (in module pyninja.executors.auth)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pyninja.executors.auth.EPOCH">EPOCH() (in module pyninja.executors.auth)</a>
</li>
<li><a href="index.html#pyninja.modules.enums.APIEndpoints.error">error (pyninja.modules.enums.APIEndpoints attribute)</a>
</li>
<li><a href="index.html#pyninja.monitor.routes.error_endpoint">error_endpoint() (in module pyninja.monitor.routes)</a>
Expand Down Expand Up @@ -227,6 +233,10 @@ <h2 id="G">G</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pyninja.monitor.authenticator.generate_cookie">generate_cookie() (in module pyninja.monitor.authenticator)</a>
</li>
<li><a href="index.html#pyninja.main.generate_hyperlink">generate_hyperlink() (in module pyninja.main)</a>
</li>
<li><a href="index.html#pyninja.modules.enums.APIRouteType.get">get (pyninja.modules.enums.APIRouteType attribute)</a>
</li>
<li><a href="index.html#pyninja.features.dockerized.get_all_containers">get_all_containers() (in module pyninja.features.dockerized)</a>
</li>
Expand Down Expand Up @@ -261,10 +271,10 @@ <h2 id="G">G</h2>
<li><a href="index.html#pyninja.routes.metrics.get_cpu_utilization">get_cpu_utilization() (in module pyninja.routes.metrics)</a>
</li>
<li><a href="index.html#pyninja.main.get_desc">get_desc() (in module pyninja.main)</a>
</li>
<li><a href="index.html#pyninja.modules.enums.APIEndpoints.get_disk">get_disk (pyninja.modules.enums.APIEndpoints attribute)</a>
</li>
<li><a href="index.html#pyninja.monitor.resources.get_disk_info">get_disk_info() (in module pyninja.monitor.resources)</a>
</li>
<li><a href="index.html#pyninja.modules.enums.APIEndpoints.get_disk_utilization">get_disk_utilization (pyninja.modules.enums.APIEndpoints attribute)</a>
</li>
<li><a href="index.html#pyninja.routes.metrics.get_disk_utilization">get_disk_utilization() (in module pyninja.routes.metrics)</a>
</li>
Expand All @@ -289,11 +299,11 @@ <h2 id="G">G</h2>
<li><a href="index.html#pyninja.routes.orchestration.get_docker_volumes">get_docker_volumes() (in module pyninja.routes.orchestration)</a>
</li>
<li><a href="index.html#pyninja.monitor.config.get_expiry">get_expiry() (in module pyninja.monitor.config)</a>
</li>
<li><a href="index.html#pyninja.modules.enums.APIEndpoints.get_file">get_file (pyninja.modules.enums.APIEndpoints attribute)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pyninja.modules.enums.APIEndpoints.get_file">get_file (pyninja.modules.enums.APIEndpoints attribute)</a>
</li>
<li><a href="index.html#pyninja.routes.fullaccess.get_file">get_file() (in module pyninja.routes.fullaccess)</a>
</li>
<li><a href="index.html#pyninja.modules.enums.APIEndpoints.get_ip">get_ip (pyninja.modules.enums.APIEndpoints attribute)</a>
Expand Down Expand Up @@ -528,6 +538,8 @@ <h2 id="M">M</h2>
<li><a href="index.html#pyninja.modules.enums.APIEndpoints.monitor">monitor (pyninja.modules.enums.APIEndpoints attribute)</a>

<ul>
<li><a href="index.html#pyninja.modules.enums.APIRouteType.monitor">(pyninja.modules.enums.APIRouteType attribute)</a>
</li>
<li><a href="index.html#pyninja.modules.enums.Cookies.monitor">(pyninja.modules.enums.Cookies attribute)</a>
</li>
</ul></li>
Expand Down Expand Up @@ -574,6 +586,8 @@ <h2 id="P">P</h2>
<li><a href="index.html#pyninja.modules.models.EnvConfig.parse_api_secret">parse_api_secret() (pyninja.modules.models.EnvConfig class method)</a>
</li>
<li><a href="index.html#pyninja.modules.models.EnvConfig.parse_apikey">parse_apikey() (pyninja.modules.models.EnvConfig class method)</a>
</li>
<li><a href="index.html#pyninja.modules.enums.APIRouteType.post">post (pyninja.modules.enums.APIRouteType attribute)</a>
</li>
<li><a href="index.html#pyninja.executors.routers.post_api">post_api() (in module pyninja.executors.routers)</a>
</li>
Expand Down Expand Up @@ -798,15 +812,21 @@ <h2 id="R">R</h2>
</li>
<li><a href="index.html#pyninja.modules.models.EnvConfig.remote_execution">remote_execution (pyninja.modules.models.EnvConfig attribute)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pyninja.executors.database.remove_record">remove_record() (in module pyninja.executors.database)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pyninja.monitor.drive.report">report() (in module pyninja.monitor.drive)</a>
</li>
<li><a href="index.html#pyninja.modules.models.retrieve_library_path">retrieve_library_path() (in module pyninja.modules.models)</a>
</li>
<li><a href="index.html#pyninja.modules.enums.APIEndpoints.root">root (pyninja.modules.enums.APIEndpoints attribute)</a>
</li>
<li><a href="index.html#pyninja.modules.models.RoutingHandler.routes">routes (pyninja.modules.models.RoutingHandler attribute)</a>
</li>
<li><a href="index.html#pyninja.modules.models.RoutingHandler">RoutingHandler (class in pyninja.modules.models)</a>
</li>
<li><a href="index.html#pyninja.modules.models.RoutingHandler.Config">RoutingHandler.Config (class in pyninja.modules.models)</a>
</li>
<li><a href="index.html#pyninja.modules.models.Session.rps">rps (pyninja.modules.models.Session attribute)</a>
</li>
Expand Down Expand Up @@ -905,6 +925,8 @@ <h2 id="T">T</h2>
<li><a href="index.html#pyninja.modules.payloads.RunCommand.timeout">timeout (pyninja.modules.payloads.RunCommand attribute)</a>
</li>
<li><a href="index.html#pyninja.executors.squire.total_mountpoints_usage">total_mountpoints_usage() (in module pyninja.executors.squire)</a>
</li>
<li><a href="index.html#pyninja.modules.models.RoutingHandler.type">type (pyninja.modules.models.RoutingHandler attribute)</a>
</li>
</ul></td>
</tr></table>
Expand Down
Loading

0 comments on commit 8f8adde

Please sign in to comment.