Text Blame Raw
================
Module Reference
================

.. automodule:: sponson
    :members:
    :undoc-members:
    :show-inheritance:
    :special-members: __init__

Subpackages
===========

.. toctree::

    sponson.builder
    sponson.container
    sponson.image
    sponson.publish
    sponson.systemd

Submodules
==========

sponson.cli module
------------------

.. important::

    Owing to ``sponson``'s use of `Click <http://click.pocoo.org/6/>`_,
    the documentation for this module is not automatically generated.

    Errors are therefore to be expected.

.. warning::

    ``sponson.cli`` functions should not be called directly.

    This is purely for completeness.


.. py:module:: sponson.cli


.. py:function:: sponson.cli.main()

    Create ``systemd-nspawn`` images and containers.


.. py:function:: sponson.cli.image()

    Image commands.


.. py:function:: sponson.cli.image_build(filepath, remote=None)

    Build a new image from a build file.

    :param filepath: path to configuration file.
    :type filepath: str
    :param remote: use the remote repository provided to resolve
        any source images during the build;
        if omitted, sponson tries to determine which source image to use.
    :type remote: str or None


.. py:function:: sponson.cli.image_delete(image_name, version="latest", remote=None)

    Delete an image.

    If 'version' is specified, this version of the image is deleted,
    by default whichever is marked as the latest image version.

    :param image_name: image to delete
    :type image_name: str
    :param version: version to delete, defaults to the latest version
    :type version: str
    :param remote: remote prefix for image deletion,
        if omitted defaults to the found image
    :type remote: str or None


.. py:function:: sponson.cli.image_new(image_name, remote=None, version="latest")

    Checkout an image from the OSTree repository
    to be available for containers.

    :param image_name: image to checkout
    :type image_name: str
    :param remote: remote to use for the checkout,
        defaults to the user set remote.
    :type remote: str
    :param version: version to checkout,
        defaults to the latest image.
    :type version: str


.. py:function:: sponson.cli.repo()

    OSTree repository commands.


.. py:function:: sponson.cli.remote_add(remote, url)

    Add a remote repository pointing to the given URL.

    :param remote: remote name
    :type remote: str
    :param url: URL of the remote
    :type url: str


.. py:function:: sponson.cli.remote_remove(remote)

    Remove a remote from the repository.

    :param remote: remote to remove
    :type remote: str


.. py:function:: sponson.cli.remote_pull(remote, image_name, version="latest")

    Pull an image from the given remote.

    :param remote: remote to pull the image from
    :type remote: str
    :param image_name: image to pull
    :type image_name: str
    :param version: version of the image to pull,
        defaults to the latest version
    :type version: str


.. py:function:: sponson.cli.publish()

    Publishing images commands.

.. py:function:: sponson.cli.publish_new(config)

    Create a new publishing configuration and repository.

    :param config: path to the configuration file
    :type config: str


.. py:function:: sponson.cli.publish_commit(image_commit, publish_name, branch=None, summary=None, version=None)

    Publish a specific commit to the publish repository.

    :param image_commit: specific image commit checksum
    :type image_commit: str
    :param publish_name: publish config name
    :type publish_name: str
    :param branch: publish branch name to use,
        by default uses the image name
    :type branch: str or None
    :param summary: publish summary,
        by default uses the image summary
    :type summary: str or None
    :param version: publish version,
        by default uses the image version
    :type version: str or None


.. py:function:: sponson.cli.publish_image(image_name, publish_name, image_version=None, branch=None, summary=None, version=None)

    Publish an image to the publish repository.

    :param image_name: image to publish to the repository
    :type image_name: str
    :param publish_name: publish config name
    :type publish_name: str
    :param image_version: image version to publish to the repository
    :type image_version: str or None
    :param branch: publish branch name to use,
        by default uses the image name
    :type branch: str or None
    :param summary: publish summary,
        by default uses the image summary
    :type summary: str or None
    :param version: publish version,
        by default uses the image version
    :type version: str or None


.. py:function:: sponson.cli.container()

    Container commands.


.. py:function:: sponson.cli.container_new(name, base_image, version="latest", readwrite=False)

    Create new container from an base_image.

    :param name: name of the container
    :type name: str
    :param base_image: base_image base to use
    :type base_image: str
    :param version: base_image version to use, defaults to "latest"
    :type version: str
    :param readwrite: make the container read-write
    :type readwrite: bool


.. py:function:: sponson.cli.container_clone(parent_container, name)

    Clone a new container from a parent container.

    :param parent_container: parent container name to clone from
    :type parent_container: str
    :param name: name of the new container
    :type name: str


.. py:function:: sponson.cli.container_update(name, version="latest")

    Update a container to a newer image version.

    :param name: container to update to image version.
    :type name: str
    :param version: image version to update to, defaults to "latest"
    :type version: str


.. py:function:: sponson.cli.container_delete(container_name)

    Delete a container.

    :param container_name: container to delete
    :type container_name: str


.. py:function:: sponson.cli.container_firewall(name, forwarding="remove")

    Setup the firewall for the container after it has started.

    :param name: name of the container
    :type name: str
    :param forwarding: add, delete or remove the forwarding for the container.
    :type forwarding: bool



sponson.configfile module
-------------------------

.. automodule:: sponson.configfile
    :members:
    :undoc-members:
    :show-inheritance:
    :special-members: __init__

sponson.constants module
------------------------

``sponson`` constants, such as paths, configuration defaults.

.. automodule:: sponson.constants
    :members:
    :undoc-members:
    :show-inheritance:
    :special-members: __init__

sponson.delete module
---------------------

.. automodule:: sponson.delete
    :members:
    :undoc-members:
    :show-inheritance:
    :special-members: __init__

sponson.templates module
------------------------

``sponson`` templates, such as ``systemd`` service files or
``dnsmasq`` configuration.

.. automodule:: sponson.templates
    :members:
    :undoc-members:
    :show-inheritance:
    :special-members: __init__

sponson.utils module
--------------------

.. automodule:: sponson.utils
    :members:
    :undoc-members:
    :show-inheritance:
    :special-members: __init__