Skip to content

Commit

Permalink
Merge pull request #163 from iromli/dev-docs
Browse files Browse the repository at this point in the history
Add developer docs
  • Loading branch information
iromli authored Sep 7, 2020
2 parents d2afd1a + 85040e6 commit 1bb3fb0
Show file tree
Hide file tree
Showing 49 changed files with 440 additions and 35 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,8 @@ ENV/

*.pyz
/pygluu/kubernetes/kubernetes-client
.DS_Store
.DS_Store

docs/_build
setup.log
docs/setup.log
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
9 changes: 9 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Building Documentation
======================

To build the documentation:

pip3 install sphinx sphinx-autobuild
sphinx-autobuild . _build/html/

Visit `http://localhost:8000` in the browser.
26 changes: 26 additions & 0 deletions docs/common.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Common
~~~~~~

.. module:: pygluu.kubernetes.common

.. autofunction:: update_settings_json_file

.. autofunction:: exec_cmd

.. autofunction:: get_logger

.. autofunction:: ssh_and_remove

.. autofunction:: check_port

.. autofunction:: copy

.. autofunction:: copy_templates

.. autofunction:: check_microk8s_kube_config_file

.. autofunction:: get_supported_versions

.. autofunction:: generate_password

.. autofunction:: prompt_password
64 changes: 64 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
sys.path.insert(0, os.path.abspath('../'))


# -- Project information -----------------------------------------------------

project = 'pygluu.kubernetes'
copyright = '2020, Gluu'
author = 'Gluu'

# The full version, including alpha/beta/rc tags
release = '1.2.4'


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"sphinx.ext.autodoc",
]

autodoc_mock_imports = [
"click",
"ruamel",
"kubernetes",
"OpenSSL",
"cryptography",
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'nature'

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
11 changes: 11 additions & 0 deletions docs/helm.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Helm
~~~~

.. module:: pygluu.kubernetes.helm

.. autofunction:: register_op_client

.. autoclass:: pygluu.kubernetes.helm.Helm
:members:
:private-members:
:undoc-members:
31 changes: 31 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
.. pygluu.kubernetes documentation master file, created by
sphinx-quickstart on Sat Sep 5 01:18:38 2020.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
pygluu.kubernetes
~~~~~~~~~~~~~~~~~

.. toctree::
:maxdepth: 2

pygluu-kubernetes contains classes and functions to deploy Gluu Cloud Native Edition.

This documentation focuses on guide for developer. For user's guide, head over to https://gluu.org/docs/gluu-server/.

API Reference
=============

This part of the documentation lists the API reference of public classes and functions.

.. toctree::
:maxdepth: 2

common
helm
kubeapi
kustomize
pycert
settings
terminal
yamlparser
11 changes: 11 additions & 0 deletions docs/kubeapi.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Kubeapi
~~~~~~~

.. module:: pygluu.kubernetes.kubeapi

.. autofunction:: load_kubernetes_config

.. autoclass:: Kubernetes
:members:
:private-members:
:undoc-members:
11 changes: 11 additions & 0 deletions docs/kustomize.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Kustomize
~~~~~~~~~

.. module:: pygluu.kubernetes.kustomize

.. autofunction:: register_op_client

.. autoclass:: Kustomize
:members:
:private-members:
:undoc-members:
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
7 changes: 7 additions & 0 deletions docs/pycert.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Certificate
~~~~~~~~~~~

.. module:: pygluu.kubernetes.pycert

.. autofunction:: setup_crts
.. autofunction:: check_cert_with_private_key
11 changes: 11 additions & 0 deletions docs/settings.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Settings
~~~~~~~~

.. module:: pygluu.kubernetes.settings

.. autofunction:: unlink_settings_json

.. autoclass:: SettingsHandler
:members:
:private-members:
:undoc-members:
136 changes: 136 additions & 0 deletions docs/terminal.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
Terminal
~~~~~~~~

The ``pygluu.kubernetes.terminal`` sub-package contains functions and classes
to handle interaction with user-inputs.

.. module:: pygluu.kubernetes.terminal.common

.. autofunction:: confirm_yesno

.. autofunction:: gather_ip

.. autoclass:: pygluu.kubernetes.terminal.architecture.PromptArch
:members:
:private-members:
:undoc-members:

.. autoclass:: pygluu.kubernetes.terminal.aws.PromptAws
:members:
:private-members:
:undoc-members:

.. autoclass:: pygluu.kubernetes.terminal.backup.PromptBackup
:members:
:private-members:
:undoc-members:

.. autoclass:: pygluu.kubernetes.terminal.cache.PromptCache
:members:
:private-members:
:undoc-members:

.. autoclass:: pygluu.kubernetes.terminal.configuration.PromptConfiguration
:members:
:private-members:
:undoc-members:

.. autoclass:: pygluu.kubernetes.terminal.confirmsettings.PromptConfirmSettings
:members:
:private-members:
:undoc-members:

.. autoclass:: pygluu.kubernetes.terminal.couchbase.PromptCouchbase
:members:
:private-members:
:undoc-members:

.. autoclass:: pygluu.kubernetes.terminal.gke.PromptGke
:members:
:private-members:
:undoc-members:

.. autoclass:: pygluu.kubernetes.terminal.gluugateway.PromptGluuGateway
:members:
:private-members:
:undoc-members:

.. autoclass:: pygluu.kubernetes.terminal.helm.PromptHelm
:members:
:private-members:
:undoc-members:

.. autoclass:: pygluu.kubernetes.terminal.istio.PromptIstio
:members:
:private-members:
:undoc-members:

.. autoclass:: pygluu.kubernetes.terminal.jackrabbit.PromptJackrabbit
:members:
:private-members:
:undoc-members:

.. autoclass:: pygluu.kubernetes.terminal.ldap.PromptLdap
:members:
:private-members:
:undoc-members:

.. autoclass:: pygluu.kubernetes.terminal.license.PromptLicense
:members:
:private-members:
:undoc-members:

.. autoclass:: pygluu.kubernetes.terminal.namespace.PromptNamespace
:members:
:private-members:
:undoc-members:

.. autoclass:: pygluu.kubernetes.terminal.optionalservices.PromptOptionalServices
:members:
:private-members:
:undoc-members:

.. autoclass:: pygluu.kubernetes.terminal.persistencebackend.PromptPersistenceBackend
:members:
:private-members:
:undoc-members:

.. autoclass:: pygluu.kubernetes.terminal.postgres.PromptPostgres
:members:
:private-members:
:undoc-members:

.. autoclass:: pygluu.kubernetes.terminal.prompt.Prompt
:members:
:private-members:
:undoc-members:

.. autoclass:: pygluu.kubernetes.terminal.redis.PromptRedis
:members:
:private-members:
:undoc-members:

.. autoclass:: pygluu.kubernetes.terminal.replicas.PromptReplicas
:members:
:private-members:
:undoc-members:

.. autoclass:: pygluu.kubernetes.terminal.testenv.PromptTestEnvironment
:members:
:private-members:
:undoc-members:

.. autoclass:: pygluu.kubernetes.terminal.upgrade.PromptUpgrade
:members:
:private-members:
:undoc-members:

.. autoclass:: pygluu.kubernetes.terminal.version.PromptVersion
:members:
:private-members:
:undoc-members:

.. autoclass:: pygluu.kubernetes.terminal.volumes.PromptVolumes
:members:
:private-members:
:undoc-members:
Loading

0 comments on commit 1bb3fb0

Please sign in to comment.