From 4672cf974f2e3559daa269378a5ee0c20cbdc397 Mon Sep 17 00:00:00 2001 From: zhangguoqing Date: Tue, 29 Nov 2016 08:49:05 +0000 Subject: [PATCH] [docs] Add rating module introduction 1. Add the introduction of rating modules. 2. Add operating example about enable/disable and set priority for rating modules. Change-Id: I3ac6786e78fcb3246dac5f8286128101a6f88656 --- doc/source/index.rst | 13 ++++---- doc/source/rating/introduction.rst | 50 ++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 6 deletions(-) create mode 100644 doc/source/rating/introduction.rst diff --git a/doc/source/index.rst b/doc/source/index.rst index ac0e5786..8eb12646 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -10,8 +10,8 @@ Welcome to CloudKitty's developer documentation! Introduction ============ -CloudKitty is a Rating As A Service project aimed at translating Ceilometer -metrics to prices. +CloudKitty is a Rating As A Service project aimed at translating metrics +to prices. Installation ============ @@ -51,14 +51,15 @@ Modules API webapi/rating/* -Modules documentation -===================== +Rating Module Documentation +=========================== .. toctree:: :maxdepth: 1 - :glob: - rating/* + rating/introduction.rst + rating/hashmap.rst + rating/pyscripts.rst Indices and tables diff --git a/doc/source/rating/introduction.rst b/doc/source/rating/introduction.rst new file mode 100644 index 00000000..4d406fd9 --- /dev/null +++ b/doc/source/rating/introduction.rst @@ -0,0 +1,50 @@ +========================== +Rating module introduction +========================== + +There are three rating modules in Cloudkitty now, including the ``noop``, +``hashmap`` and ``pyscripts``. Only the noop rating module is just for +testing. All modules can be enabled and disabled dynamically. Cloudkitty +allows to run several rating modules simultaneously, and the user or +operator can set the priority for a module. The order in which the modules +process the data depends on their priority. The module with the highest +priority comes first. + +Enable or disable module +======================= + +Enable the hashmap rating module: + +.. code:: raw + + $ cloudkitty module-enable -n hashmap + +---------+---------+----------+ + | Module | Enabled | Priority | + +---------+---------+----------+ + | hashmap | True | 1 | + +---------+---------+----------+ + +Disable the pyscripts rating module: + +.. code:: raw + + $ cloudkitty module-disable -n pyscripts + +-----------+---------+----------+ + | Module | Enabled | Priority | + +-----------+---------+----------+ + | pyscripts | False | 1 | + +-----------+---------+----------+ + +Set priority +============ + +Set the hashmap rating module priority to 100: + +.. code:: raw + + $ cloudkitty module-set-priority -n hashmap -p 100 + +---------+---------+----------+ + | Module | Enabled | Priority | + +---------+---------+----------+ + | hashmap | True | 100 | + +---------+---------+----------+