Tune up documentation to be more useful

The cookiecutter template includes more documentation than we
need, so remove lots of extraneous stuff and lay in the basics.

Change-Id: I6ed22f70153b00844e8de05d186ecc780debc48c
This commit is contained in:
Chris Dent 2018-12-11 12:42:50 +00:00
parent 3d038f5ccc
commit 1ae04e7d41
22 changed files with 51 additions and 328 deletions

View File

@ -13,3 +13,6 @@ submitted for review via the Gerrit tool:
Pull requests submitted through GitHub will be ignored.
Bugs should be filed on Launchpad: https://bugs.launchpad.net/nova
Developers of os-resource-classes can be found in the ``#openstack-placement``
IRC channel on the ``chat.freenode.net``.

View File

@ -2,17 +2,25 @@
os-resource-classes
===============================
**WIP**
Resource Classes for OpenStack
A list of standardized resource classes for OpenStack.
A resource class is a distinct type of inventory that exists in
a cloud environment, for example ``VCPU``, ``DISK_GB``. They are
upper case with underscores. They often include a unit in their
name.
This package provides a collection of symbols representing those
standard resource classes which are expected to be available in
any OpenStack deployment.
There also exists a concept of custom resource classes. These
are countable types that are custom to a particular environment.
The OpenStack `placement API`_ provides a way to create these. A
custom resource class always begins with a ``CUSTOM_`` prefix.
* Free software: Apache license
* Documentation: https://docs.openstack.org/os-resource-classes/latest
* Source: https://git.openstack.org/cgit/openstack/os-resource-classes
* Bugs: https://bugs.launchpad.net/nova
--------
* TODO
.. _placement API: https://developer.openstack.org/api-ref/placement/

View File

@ -1,5 +0,0 @@
====================
Administrators guide
====================
Administrators guide of os-resource-classes.

View File

@ -1,5 +0,0 @@
================================
Command line interface reference
================================
CLI reference of os-resource-classes.

View File

@ -1,5 +0,0 @@
=============
Configuration
=============
Configuration of os-resource-classes.

View File

@ -1,4 +0,0 @@
============
Contributing
============
.. include:: ../../../CONTRIBUTING.rst

View File

@ -1,9 +1,4 @@
===========================
Contributor Documentation
===========================
.. toctree::
:maxdepth: 2
contributing
============
Contributing
============
.. include:: ../../../CONTRIBUTING.rst

View File

@ -3,28 +3,19 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
===================================================
Welcome to the documentation of os_resource_classes
===================================================
===================
os-resource-classes
===================
Contents:
.. include:: ../../README.rst
.. toctree::
:maxdepth: 2
readme
install/index
library/index
contributor/index
configuration/index
cli/index
user/index
admin/index
reference/index
contributor/index
Indices and tables
==================
Search
======
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

View File

@ -1,10 +0,0 @@
2. Edit the ``/etc/os_resource_classes/os_resource_classes.conf`` file and complete the following
actions:
* In the ``[database]`` section, configure database access:
.. code-block:: ini
[database]
...
connection = mysql+pymysql://os_resource_classes:OS_RESOURCE_CLASSES_DBPASS@controller/os_resource_classes

View File

@ -1,75 +0,0 @@
Prerequisites
-------------
Before you install and configure the Resource Classes for OpenStack service,
you must create a database, service credentials, and API endpoints.
#. To create the database, complete these steps:
* Use the database access client to connect to the database
server as the ``root`` user:
.. code-block:: console
$ mysql -u root -p
* Create the ``os_resource_classes`` database:
.. code-block:: none
CREATE DATABASE os_resource_classes;
* Grant proper access to the ``os_resource_classes`` database:
.. code-block:: none
GRANT ALL PRIVILEGES ON os_resource_classes.* TO 'os_resource_classes'@'localhost' \
IDENTIFIED BY 'OS_RESOURCE_CLASSES_DBPASS';
GRANT ALL PRIVILEGES ON os_resource_classes.* TO 'os_resource_classes'@'%' \
IDENTIFIED BY 'OS_RESOURCE_CLASSES_DBPASS';
Replace ``OS_RESOURCE_CLASSES_DBPASS`` with a suitable password.
* Exit the database access client.
.. code-block:: none
exit;
#. Source the ``admin`` credentials to gain access to
admin-only CLI commands:
.. code-block:: console
$ . admin-openrc
#. To create the service credentials, complete these steps:
* Create the ``os_resource_classes`` user:
.. code-block:: console
$ openstack user create --domain default --password-prompt os_resource_classes
* Add the ``admin`` role to the ``os_resource_classes`` user:
.. code-block:: console
$ openstack role add --project service --user os_resource_classes admin
* Create the os_resource_classes service entities:
.. code-block:: console
$ openstack service create --name os_resource_classes --description "Resource Classes for OpenStack" resource classes for openstack
#. Create the Resource Classes for OpenStack service API endpoints:
.. code-block:: console
$ openstack endpoint create --region RegionOne \
resource classes for openstack public http://controller:XXXX/vY/%\(tenant_id\)s
$ openstack endpoint create --region RegionOne \
resource classes for openstack internal http://controller:XXXX/vY/%\(tenant_id\)s
$ openstack endpoint create --region RegionOne \
resource classes for openstack admin http://controller:XXXX/vY/%\(tenant_id\)s

View File

@ -1,9 +0,0 @@
===============================================
Resource Classes for OpenStack service overview
===============================================
The Resource Classes for OpenStack service provides...
The Resource Classes for OpenStack service consists of the following components:
``os_resource_classes-api`` service
Accepts and responds to end user compute API calls...

View File

@ -1,17 +1,13 @@
=========================================================
Resource Classes for OpenStack service installation guide
=========================================================
==================
Installation Guide
==================
.. toctree::
:maxdepth: 2
``os-resource-classes`` is availabe on `PyPI`_ and may be installed using
`pip`_::
get_started.rst
install.rst
verify.rst
next-steps.rst
pip install os-resource-classes
The Resource Classes for OpenStack service (os_resource_classes) provides...
See :doc:`/user/index` for how to use it once it is installed.
This chapter assumes a working setup of OpenStack following the
`OpenStack Installation Tutorial
<https://docs.openstack.org/project-install-guide/ocata/>`_.
.. _PyPI: https://pypi.org/project/os-resource-classes/
.. _pip: https://pypi.org/project/pip/

View File

@ -1,34 +0,0 @@
.. _install-obs:
Install and configure for openSUSE and SUSE Linux Enterprise
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This section describes how to install and configure the Resource Classes for OpenStack service
for openSUSE Leap 42.1 and SUSE Linux Enterprise Server 12 SP1.
.. include:: common_prerequisites.rst
Install and configure components
--------------------------------
#. Install the packages:
.. code-block:: console
# zypper --quiet --non-interactive install
.. include:: common_configure.rst
Finalize installation
---------------------
Start the Resource Classes for OpenStack services and configure them to start when
the system boots:
.. code-block:: console
# systemctl enable openstack-os_resource_classes-api.service
# systemctl start openstack-os_resource_classes-api.service

View File

@ -1,33 +0,0 @@
.. _install-rdo:
Install and configure for Red Hat Enterprise Linux and CentOS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This section describes how to install and configure the Resource Classes for OpenStack service
for Red Hat Enterprise Linux 7 and CentOS 7.
.. include:: common_prerequisites.rst
Install and configure components
--------------------------------
#. Install the packages:
.. code-block:: console
# yum install
.. include:: common_configure.rst
Finalize installation
---------------------
Start the Resource Classes for OpenStack services and configure them to start when
the system boots:
.. code-block:: console
# systemctl enable openstack-os_resource_classes-api.service
# systemctl start openstack-os_resource_classes-api.service

View File

@ -1,31 +0,0 @@
.. _install-ubuntu:
Install and configure for Ubuntu
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This section describes how to install and configure the Resource Classes for OpenStack
service for Ubuntu 14.04 (LTS).
.. include:: common_prerequisites.rst
Install and configure components
--------------------------------
#. Install the packages:
.. code-block:: console
# apt-get update
# apt-get install
.. include:: common_configure.rst
Finalize installation
---------------------
Restart the Resource Classes for OpenStack services:
.. code-block:: console
# service openstack-os_resource_classes-api restart

View File

@ -1,20 +0,0 @@
.. _install:
Install and configure
~~~~~~~~~~~~~~~~~~~~~
This section describes how to install and configure the
Resource Classes for OpenStack service, code-named os_resource_classes, on the controller node.
This section assumes that you already have a working OpenStack
environment with at least the following components installed:
.. (add the appropriate services here and further notes)
Note that installation and configuration vary by distribution.
.. toctree::
:maxdepth: 2
install-obs.rst
install-rdo.rst
install-ubuntu.rst

View File

@ -1,9 +0,0 @@
.. _next-steps:
Next steps
~~~~~~~~~~
Your OpenStack environment now includes the os_resource_classes service.
To add additional services, see
https://docs.openstack.org/project-install-guide/ocata/.

View File

@ -1,24 +0,0 @@
.. _verify:
Verify operation
~~~~~~~~~~~~~~~~
Verify operation of the Resource Classes for OpenStack service.
.. note::
Perform these commands on the controller node.
#. Source the ``admin`` project credentials to gain access to
admin-only CLI commands:
.. code-block:: console
$ . admin-openrc
#. List service components to verify successful launch and registration
of each process:
.. code-block:: console
$ openstack resource classes for openstack service list

View File

@ -1,7 +0,0 @@
========
Usage
========
To use os-resource-classes in a project::
import os_resource_classes

View File

@ -1 +0,0 @@
.. include:: ../../README.rst

View File

@ -1,5 +0,0 @@
==========
References
==========
References of os-resource-classes.

View File

@ -1,5 +1,12 @@
===========
Users guide
===========
Users guide of os-resource-classes.
=====
Usage
=====
To use ``os-resource-classes`` in a project:
.. code-block:: python
import os_resource_classes as orc
vcpu = orc.VPCU