Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

Add documentation structure #18

Merged
merged 1 commit into from
Aug 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ htmlcov

.cache
.eggs

docs/_build
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,17 +120,17 @@ print "PASS!" if authen.valid else "FAIL!"

# authorize user and command
author = cli.authorize('username', arguments=[b"service=shell", b"cmd=show", b"cmdargs=version"])
print "PASS! if author.valid else "FAIL!"
print "PASS!" if author.valid else "FAIL!"

# start accounting session for command
acct = cli.account('username', TAC_PLUS_ACCT_FLAG_START, arguments=[b"service=shell", b"cmd=show", b"cmdargs=version"])
print "PASS! if acct.valid else "FAIL!"
print "PASS!" if acct.valid else "FAIL!"

# continue accounting session for another command
acct = cli.account('username', TAC_PLUS_ACCT_FLAG_WATCHDOG, arguments=[b"service=shell", b"cmd=debug", b"cmdargs=aaa"])
print "PASS! if acct.valid else "FAIL!"
print "PASS!" if acct.valid else "FAIL!"

# close accounting session
acct = cli.account('username', TAC_PLUS_ACCT_FLAG_STOP, arguments=[b"service=shell", b"cmd=exit"])
print "PASS! if acct.valid else "FAIL!"
print "PASS!" if acct.valid else "FAIL!"
```
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.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = tacacs_plus
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)
91 changes: 91 additions & 0 deletions docs/code.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
API documentation
=================

This is the tacacs_plus API documentation. It contains the documentation extracted from the docstrings of the various classes, methods, and functions in the tacacs_plus package. If you want to know what a certain function/method does, this is the place to look.

.. contents::
:depth: 2


:mod:`tacacs_plus.client` module
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

source: https://github.com/ansible/tacacs_plus/blob/master/tacacs_plus/client.py

.. autoclass:: tacacs_plus.client.TACACSClient
:members:
:private-members:
:undoc-members:


:mod:`tacacs_plus.packet` module
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

source: https://github.com/ansible/tacacs_plus/blob/master/tacacs_plus/packet.py

.. autoclass:: tacacs_plus.client.TACACSHeader
:members:
:undoc-members:


.. autoclass:: tacacs_plus.client.TACACSPacket
:members:
:undoc-members:


:mod:`tacacs_plus.authentication` module
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

source: https://github.com/ansible/tacacs_plus/blob/master/tacacs_plus/authentication.py

.. autoclass:: tacacs_plus.authentication.TACACSAuthenticationStart
:members:
:undoc-members:


.. autoclass:: tacacs_plus.authentication.TACACSAuthenticationContinue
:members:
:undoc-members:


.. autoclass:: tacacs_plus.authentication.TACACSAuthenticationReply
:members:
:undoc-members:


:mod:`tacacs_plus.authorization` module
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

source: https://github.com/ansible/tacacs_plus/blob/master/tacacs_plus/authorization.py

.. autoclass:: tacacs_plus.authorization.TACACSAuthorizationStart
:members:
:undoc-members:


.. autoclass:: tacacs_plus.authorization.TACACSAuthorizationReply
:members:
:undoc-members:


:mod:`tacacs_plus.accounting` module
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

source: https://github.com/ansible/tacacs_plus/blob/master/tacacs_plus/accounting.py

.. autoclass:: tacacs_plus.accounting.TACACSAccountingStart
:members:
:undoc-members:


.. autoclass:: tacacs_plus.accounting.TACACSAccountingReply
:members:
:undoc-members:


:mod:`tacacs_plus.flags` module
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

source: https://github.com/ansible/tacacs_plus/blob/master/tacacs_plus/flags.py

this module contains all the constant flags used to implement the tacacs+ RFC.
98 changes: 98 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# tacacs_plus documentation build configuration file, created by
# sphinx-quickstart on Mon May 15 16:59:13 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.

# 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('..'))


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

# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'

# 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'
]

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

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
source_suffix = '.rst'

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = 'tacacs_plus'
copyright = '2017, Ryan Petrello'
author = 'Ryan Petrello'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '1.0'
# The full version, including alpha/beta/rc tags.
release = 'alpha'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None

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

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True


# -- 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 = 'default'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}

# 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']
21 changes: 21 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.. tacacs_plus documentation master file, created by
sphinx-quickstart on Mon May 15 16:59:13 2017.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.

Welcome to tacacs_plus's documentation!
=======================================

.. toctree::
:maxdepth: 5
:caption: Index:

readme
code

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
Loading