Skip to content

Commit

Permalink
docs: initial
Browse files Browse the repository at this point in the history
  • Loading branch information
artemrys committed May 26, 2021
1 parent 73623f2 commit b9e6c09
Show file tree
Hide file tree
Showing 9 changed files with 528 additions and 94 deletions.
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)
52 changes: 52 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# 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 = 'addonfactory-ucc-generator'
copyright = '2021, Splunk, Inc.'
author = 'Splunk, Inc.'


# -- 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 = [
]

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

# 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']
41 changes: 41 additions & 0 deletions docs/how_to_use.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
How To Use
==========

Prerequisites
-------------

* :code:`globalConfig.json`
* :code:`package` folder

Example of :code:`globalConfig.json` and :code:`package` folder can be found at https://github.com/splunk/splunk-add-on-for-ucc-example.

Steps
-----

* Install :code:`splunk-add-on-ucc-framework` if it is not installed.
* Run the :code:`ucc-gen`. command.
* The final addon package will be generated, in the :code:`output` folder.

:code:`ucc-gen` supports the following params:

* :code:`source` - [optional] folder containing the app.manifest and app source.
* :code:`config` - [optional] path to the configuration file, defaults to :code:`globalConfig.json` in the parent directory of source provided.
* :code:`ta-version` - [optional] override current version of TA, default version is version specified in :code:`globalConfig.json`. Splunkbase compatible version of SEMVER will be used by default.

What ucc-gen does
-----------------

* Cleans the :code:`output` folder.
* Retrieve the package ID of addon.
* Copy UCC template directory under :code:`output/<package_ID>` directory.
* Copy :code:`globalConfig.json` file to :code:`output/<package_ID>/appserver/static/js/build` directory.
* Collect and install Addon's requirements into :code:`output/<package_ID>/lib` directory of addon's package.
* For the addon's requirements, packages are installed according to following table:

* :code:`lib/requirements.txt` - install Python2/Python3 compatible packages into :code:`output/<package_ID>/lib`
* :code:`lib/py2/requirements.txt` - install Python2 compatible packages into :code:`output/<package_ID>/lib2`
* :code:`lib/py3/requirements.txt` - install Python3 compatible packages into :code:`output/<package_ID>/lib3`

* Replace tokens in views.
* Copy addon's :code:`package/*` to :code:`output/<package_ID>/*` directory.
* If an addon requires some additional configurations in packaging than implement the steps in additional_packaging.py
23 changes: 23 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.. addonfactory-ucc-generator documentation master file, created by
sphinx-quickstart on Thu May 20 13:22:45 2021.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to addonfactory-ucc-generator's documentation!
======================================================

.. toctree::
:maxdepth: 2
:caption: Table of Contents

overview
how_to_use
troubleshooting


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

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
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
23 changes: 23 additions & 0 deletions docs/overview.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Overview
========
splunk-add-on-ucc-framework is a framework to generate UI based Splunk Add-ons.
It includes UI, Rest handler, Modular input, Oauth, Alert action templates.

What is UCC?
------------
UCC stands for Universal Configuration Console.
It is a service for generating Splunk Add-ons which is easily customizable and flexible.
UCC provides basic UI template for creating Addon's UI.
It is helpful to control the activity by using hooks and other functionalities.

Features
--------
* Generate UCC based addons for your Splunk Technology Add-ons

Installation
------------
splunk-add-on-ucc-framework can be installed via pip from PyPI:

.. code-block:: console
pip3 install splunk-add-on-ucc-framework
14 changes: 14 additions & 0 deletions docs/troubleshooting.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Troubleshooting
===============

Splunk calls your modular input only once
-----------------------------------------

In case Splunk calls your modular input only once however you are specifying an
interval within it should call your script - check :code:`use_single_instance`
variable in :code:`get_scheme` method of your modular input class. It should be
set :code:`False` so that Splunk can schedule the input accordingly.

To be able to understand that Splunk does not schedule your modular input script,
search for :code:`"index=_internal ExecProcessor"` and look for
:code:`"interval: run once"` near your script name.
Loading

0 comments on commit b9e6c09

Please sign in to comment.