Compare commits
223 Commits
0.27.0
...
newton-eol
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1c38637dff | ||
|
|
1eb2b517ef | ||
|
|
3e030618fa | ||
|
|
f823345424 | ||
|
|
19fdd1557e | ||
|
|
641989b424 | ||
|
|
8814c09087 | ||
|
|
eb4f46b703 | ||
|
|
2f33dd10c0 | ||
|
|
1a197ab801 | ||
|
|
eeb2788355 | ||
|
|
af7871831a | ||
|
|
fbd9411fd9 | ||
|
|
0a0f482f2d | ||
|
|
0873c26b17 | ||
|
|
af99b3f4eb | ||
|
|
4b20e991a1 | ||
|
|
e907cec90a | ||
|
|
9f814e6c15 | ||
|
|
5ac51efa69 | ||
|
|
0baec1cfc2 | ||
|
|
72e6564549 | ||
|
|
23092b6f84 | ||
|
|
0b276fb602 | ||
|
|
a684e70b61 | ||
|
|
414685ab53 | ||
|
|
2d8650f87a | ||
|
|
dd924dd9d5 | ||
|
|
dd5b5428db | ||
|
|
74989fe94e | ||
|
|
3b673fe9bd | ||
|
|
c1cbd9ebf4 | ||
|
|
add49f3fcb | ||
|
|
1f4a46ea5d | ||
|
|
8a38c4f479 | ||
|
|
107cc76cdb | ||
|
|
6e8dc5297e | ||
|
|
7cce4b9ed4 | ||
|
|
deb5cb3fc2 | ||
|
|
3ed44383ab | ||
|
|
720884cd55 | ||
|
|
249cd11533 | ||
|
|
f42106ca34 | ||
|
|
359debb6b0 | ||
|
|
dbcab41fae | ||
|
|
28ff52f8ba | ||
|
|
781eb64c6a | ||
|
|
45a0bda1ae | ||
|
|
190d5ae899 | ||
|
|
e4ba59e130 | ||
|
|
f238167edc | ||
|
|
77b7fae41e | ||
|
|
8c23c08776 | ||
|
|
103f541abd | ||
|
|
5fe6281e5c | ||
|
|
c61793811e | ||
|
|
ecea228c4c | ||
|
|
1fafcc5ef1 | ||
|
|
32c13d00fe | ||
|
|
a1cb142009 | ||
|
|
ab10201c72 | ||
|
|
42b45a5949 | ||
|
|
da67b246a5 | ||
|
|
6d41c23e50 | ||
|
|
7b228348a0 | ||
|
|
eb421709d9 | ||
|
|
e741728eb8 | ||
|
|
35201c8358 | ||
|
|
6be758bc5a | ||
|
|
5f205d5602 | ||
|
|
9450a7079b | ||
|
|
64f45add5f | ||
|
|
3a804ae045 | ||
|
|
638fd557dc | ||
|
|
4e3593a71d | ||
|
|
01164b0790 | ||
|
|
9933955c7d | ||
|
|
efdf6c93fc | ||
|
|
17d2d75abb | ||
|
|
2e55f4ebee | ||
|
|
196a7a5457 | ||
|
|
1f72a35896 | ||
|
|
ea01031268 | ||
|
|
6144551809 | ||
|
|
1b2672a49b | ||
|
|
27b3c5254d | ||
|
|
d69efcbd0f | ||
|
|
31de0e319f | ||
|
|
8145906798 | ||
|
|
9d2d2183f5 | ||
|
|
31c37342cd | ||
|
|
dbde1afea0 | ||
|
|
739b667cbc | ||
|
|
671c691189 | ||
|
|
32be5de2f9 | ||
|
|
cf01dad222 | ||
|
|
027ce5916c | ||
|
|
39227f6e86 | ||
|
|
cc2e805780 | ||
|
|
0a6841f510 | ||
|
|
4f8591cb02 | ||
|
|
06c6c4691b | ||
|
|
b94677c3ef | ||
|
|
5a2a94fbec | ||
|
|
553c5a6c4b | ||
|
|
5ffb7df20c | ||
|
|
61e581f45e | ||
|
|
26d84e353e | ||
|
|
b2656b92c4 | ||
|
|
52ffc2c8e2 | ||
|
|
5dee934565 | ||
|
|
0769e53f93 | ||
|
|
8db3427665 | ||
|
|
35dfa40b08 | ||
|
|
a98636cd09 | ||
|
|
107bd0be54 | ||
|
|
95917bc147 | ||
|
|
cc1f66cd6a | ||
|
|
926b790747 | ||
|
|
7d704dbeec | ||
|
|
5c08095417 | ||
|
|
65d3a4d75e | ||
|
|
6727d53072 | ||
|
|
b579a41f30 | ||
|
|
051810dfa2 | ||
|
|
8ab80894c3 | ||
|
|
6730202151 | ||
|
|
a6d0eaa4c4 | ||
|
|
2e04ba6b64 | ||
|
|
fd7c41fba2 | ||
|
|
aef1eba5df | ||
|
|
cd60336e20 | ||
|
|
8635beb045 | ||
|
|
ff1af61c1b | ||
|
|
00adcb84f6 | ||
|
|
e7a1ba7e74 | ||
|
|
1b0801a0c3 | ||
|
|
a68eb0d619 | ||
|
|
517f1d083e | ||
|
|
76a61e234a | ||
|
|
f4b631ebb3 | ||
|
|
e78610e7d1 | ||
|
|
405cde2ff9 | ||
|
|
b25ecde0db | ||
|
|
e6b4befbf4 | ||
|
|
dcf52077a4 | ||
|
|
1de00086f5 | ||
|
|
518b4c82f1 | ||
|
|
4423fdd231 | ||
|
|
b1c6ea71a4 | ||
|
|
533a4c7a34 | ||
|
|
d61c4c12d1 | ||
|
|
1d3891e1e4 | ||
|
|
f13d6dd805 | ||
|
|
81bdc51e21 | ||
|
|
ff4375337e | ||
|
|
e7bbf1d1b9 | ||
|
|
21d1610071 | ||
|
|
e34198f35c | ||
|
|
bc06a7d419 | ||
|
|
1a1d9d09f4 | ||
|
|
47ff9bb105 | ||
|
|
ca5b849f6b | ||
|
|
2272b515bf | ||
|
|
f6b1b515c4 | ||
|
|
64903ce56c | ||
|
|
86cbe4bd0c | ||
|
|
0b29a8394b | ||
|
|
ec64203bee | ||
|
|
dc01e35760 | ||
|
|
117079f81e | ||
|
|
d03e1d54bd | ||
|
|
6bdc4cac82 | ||
|
|
b4c5e2bb81 | ||
|
|
369428c313 | ||
|
|
2381a677b6 | ||
|
|
da8b24f483 | ||
|
|
d7a7b3ea54 | ||
|
|
37595e9bb7 | ||
|
|
cb693e4093 | ||
|
|
9918f59227 | ||
|
|
07c7ba9b2e | ||
|
|
73cf5a98ae | ||
|
|
80abcd6fd9 | ||
|
|
e3edc67045 | ||
|
|
b3c2d3af1f | ||
|
|
4fc3307525 | ||
|
|
77c07a466f | ||
|
|
80867703ba | ||
|
|
7b403c0d3b | ||
|
|
6f2c82316c | ||
|
|
b21193aaf2 | ||
|
|
e1a1cd79f4 | ||
|
|
019fc498ae | ||
|
|
407a505e73 | ||
|
|
488c6e3f4e | ||
|
|
28a2422ceb | ||
|
|
58b5baaeae | ||
|
|
e8fc4a1bc8 | ||
|
|
921e531adf | ||
|
|
b5cb6631cc | ||
|
|
45801cf9c5 | ||
|
|
442512cd71 | ||
|
|
2b95a4cbc4 | ||
|
|
84b12f8f1e | ||
|
|
f665d83657 | ||
|
|
5e16e032be | ||
|
|
eab47bf182 | ||
|
|
2544327979 | ||
|
|
2412df4b6c | ||
|
|
d811dd93ae | ||
|
|
cb342b45b7 | ||
|
|
1a4d5a3df3 | ||
|
|
8b8d2f01fe | ||
|
|
ca37358cac | ||
|
|
46091385d8 | ||
|
|
a457707e56 | ||
|
|
6c922b43ea | ||
|
|
5d66f66050 | ||
|
|
e7e50b3955 | ||
|
|
d9a2b8809b | ||
|
|
164a802718 | ||
|
|
dbdf690cd0 |
@@ -1,7 +1,9 @@
|
||||
[run]
|
||||
branch = True
|
||||
source = watcher
|
||||
omit = watcher/tests/*
|
||||
omit =
|
||||
watcher/tests/*
|
||||
watcher/hacking/*
|
||||
|
||||
[report]
|
||||
ignore_errors = True
|
||||
|
||||
7
.gitignore
vendored
@@ -64,3 +64,10 @@ sftp-config.json
|
||||
|
||||
cover
|
||||
/demo/
|
||||
|
||||
|
||||
# Files created by releasenotes build
|
||||
releasenotes/build
|
||||
|
||||
# Desktop Service Store
|
||||
*.DS_Store
|
||||
|
||||
@@ -2,3 +2,4 @@
|
||||
host=review.openstack.org
|
||||
port=29418
|
||||
project=openstack/watcher.git
|
||||
defaultbranch=stable/newton
|
||||
|
||||
@@ -10,10 +10,8 @@ Watcher
|
||||
|
||||
OpenStack Watcher provides a flexible and scalable resource optimization
|
||||
service for multi-tenant OpenStack-based clouds.
|
||||
Watcher provides a complete optimization loop-including everything from a
|
||||
metrics receiver, complex event processor and profiler, optimization processor
|
||||
and an action plan applier. This provides a robust framework to realize a wide
|
||||
range of cloud optimization goals, including the reduction of data center
|
||||
Watcher provides a robust framework to realize a wide range of cloud
|
||||
optimization goals, including the reduction of data center
|
||||
operating costs, increased system performance via intelligent virtual machine
|
||||
migration, increased energy efficiency-and more!
|
||||
|
||||
@@ -21,4 +19,4 @@ migration, increased energy efficiency-and more!
|
||||
* Wiki: http://wiki.openstack.org/wiki/Watcher
|
||||
* Source: https://github.com/openstack/watcher
|
||||
* Bugs: http://bugs.launchpad.net/watcher
|
||||
* Documentation: https://factory.b-com.com/www/watcher/doc/watcher/index.html
|
||||
* Documentation: http://docs.openstack.org/developer/watcher/
|
||||
|
||||
@@ -44,6 +44,9 @@ WATCHER_CONF_DIR=/etc/watcher
|
||||
WATCHER_CONF=$WATCHER_CONF_DIR/watcher.conf
|
||||
WATCHER_POLICY_JSON=$WATCHER_CONF_DIR/policy.json
|
||||
|
||||
NOVA_CONF_DIR=/etc/nova
|
||||
NOVA_CONF=$NOVA_CONF_DIR/nova.conf
|
||||
|
||||
if is_ssl_enabled_service "watcher" || is_service_enabled tls-proxy; then
|
||||
WATCHER_SERVICE_PROTOCOL="https"
|
||||
fi
|
||||
@@ -123,6 +126,8 @@ function create_watcher_conf {
|
||||
iniset $WATCHER_CONF oslo_messaging_rabbit rabbit_password $RABBIT_PASSWORD
|
||||
iniset $WATCHER_CONF oslo_messaging_rabbit rabbit_host $RABBIT_HOST
|
||||
|
||||
iniset $NOVA_CONF oslo_messaging_notifications topics "notifications,watcher_notifications"
|
||||
|
||||
configure_auth_token_middleware $WATCHER_CONF watcher $WATCHER_AUTH_CACHE_DIR
|
||||
configure_auth_token_middleware $WATCHER_CONF watcher $WATCHER_AUTH_CACHE_DIR "watcher_clients_auth"
|
||||
|
||||
|
||||
@@ -27,6 +27,9 @@ ENABLED_SERVICES+=,q-svc,q-dhcp,q-meta,q-agt,q-l3,neutron
|
||||
# Enable remote console access
|
||||
enable_service n-cauth
|
||||
|
||||
# Enable the Watcher Dashboard plugin
|
||||
enable_plugin watcher-dashboard git://git.openstack.org/openstack/watcher-dashboard
|
||||
|
||||
# Enable the Watcher plugin
|
||||
enable_plugin watcher git://git.openstack.org/openstack/watcher
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ The Watcher Dashboard can be used to interact with the Watcher system through
|
||||
Horizon in order to control it or to know its current status.
|
||||
|
||||
Please, read `the detailed documentation about Watcher Dashboard
|
||||
<https://factory.b-com.com/www/watcher/doc/watcher-dashboard/>`_.
|
||||
<http://docs.openstack.org/developer/watcher-dashboard/>`_.
|
||||
|
||||
.. _archi_watcher_database_definition:
|
||||
|
||||
@@ -150,12 +150,14 @@ This database stores all the Watcher domain objects which can be requested
|
||||
by the :ref:`Watcher API <archi_watcher_api_definition>` or the
|
||||
:ref:`Watcher CLI <archi_watcher_cli_definition>`:
|
||||
|
||||
- :ref:`Goals <goal_definition>`
|
||||
- :ref:`Strategies <strategy_definition>`
|
||||
- :ref:`Audit templates <audit_template_definition>`
|
||||
- :ref:`Audits <audit_definition>`
|
||||
- :ref:`Action plans <action_plan_definition>`
|
||||
- :ref:`Efficacy indicators <efficacy_indicator_definition>` via the Action
|
||||
Plan API.
|
||||
- :ref:`Actions <action_definition>`
|
||||
- :ref:`Goals <goal_definition>`
|
||||
- :ref:`Strategies <strategy_definition>`
|
||||
|
||||
The Watcher domain being here "*optimization of some resources provided by an
|
||||
OpenStack system*".
|
||||
@@ -169,35 +171,47 @@ This component is responsible for computing a set of potential optimization
|
||||
:ref:`Actions <action_definition>` in order to fulfill
|
||||
the :ref:`Goal <goal_definition>` of an :ref:`Audit <audit_definition>`.
|
||||
|
||||
It first reads the parameters of the :ref:`Audit <audit_definition>` from the
|
||||
associated :ref:`Audit Template <audit_template_definition>` and knows the
|
||||
:ref:`Goal <goal_definition>` to achieve.
|
||||
It first reads the parameters of the :ref:`Audit <audit_definition>` to know
|
||||
the :ref:`Goal <goal_definition>` to achieve.
|
||||
|
||||
It then selects the most appropriate :ref:`Strategy <strategy_definition>`
|
||||
depending on how Watcher was configured for this :ref:`Goal <goal_definition>`.
|
||||
Unless specified, it then selects the most appropriate :ref:`strategy
|
||||
<strategy_definition>` from the list of available strategies achieving this
|
||||
goal.
|
||||
|
||||
The :ref:`Strategy <strategy_definition>` is then dynamically loaded (via
|
||||
`stevedore <https://github.com/openstack/stevedore/>`_). The
|
||||
:ref:`Watcher Decision Engine <watcher_decision_engine_definition>` calls the
|
||||
**execute()** method of the :ref:`Strategy <strategy_definition>` class which
|
||||
generates a solution composed of a set of :ref:`Actions <action_definition>`.
|
||||
`stevedore <http://docs.openstack.org/developer/stevedore/>`_). The
|
||||
:ref:`Watcher Decision Engine <watcher_decision_engine_definition>` executes
|
||||
the strategy.
|
||||
|
||||
In order to compute the potential :ref:`Solution <solution_definition>` for the
|
||||
Audit, the :ref:`Strategy <strategy_definition>` relies on different sets of
|
||||
data:
|
||||
|
||||
- :ref:`Cluster data models <cluster_data_model_definition>` that are
|
||||
periodically synchronized through pluggable cluster data model collectors.
|
||||
These models contain the current state of various
|
||||
:ref:`Managed resources <managed_resource_definition>` (e.g., the data stored
|
||||
in the Nova database). These models gives a strategy the ability to reason on
|
||||
the current state of a given :ref:`cluster <cluster_definition>`.
|
||||
- The data stored in the :ref:`Cluster History Database
|
||||
<cluster_history_db_definition>` which provides information about the past of
|
||||
the :ref:`Cluster <cluster_definition>`.
|
||||
|
||||
Here below is a sequence diagram showing how the Decision Engine builds and
|
||||
maintains the :ref:`cluster data models <cluster_data_model_definition>` that
|
||||
are used by the strategies.
|
||||
|
||||
.. image:: ./images/sequence_architecture_cdmc_sync.png
|
||||
:width: 100%
|
||||
|
||||
The execution of a strategy then yields a solution composed of a set of
|
||||
:ref:`Actions <action_definition>` as well as a set of :ref:`efficacy
|
||||
indicators <efficacy_indicator_definition>`.
|
||||
|
||||
These :ref:`Actions <action_definition>` are scheduled in time by the
|
||||
:ref:`Watcher Planner <watcher_planner_definition>` (i.e., it generates an
|
||||
:ref:`Action Plan <action_plan_definition>`).
|
||||
|
||||
In order to compute the potential :ref:`Solution <solution_definition>` for the
|
||||
Audit, the :ref:`Strategy <strategy_definition>` relies on two sets of data:
|
||||
|
||||
- the current state of the
|
||||
:ref:`Managed resources <managed_resource_definition>`
|
||||
(e.g., the data stored in the Nova database)
|
||||
- the data stored in the
|
||||
:ref:`Cluster History Database <cluster_history_db_definition>`
|
||||
which provides information about the past of the
|
||||
:ref:`Cluster <cluster_definition>`
|
||||
|
||||
|
||||
.. _data_model:
|
||||
|
||||
Data model
|
||||
@@ -210,12 +224,10 @@ view (Goals, Audits, Action Plans, ...):
|
||||
.. image:: ./images/functional_data_model.svg
|
||||
:width: 100%
|
||||
|
||||
Here below is a class diagram representing the main objects in Watcher from a
|
||||
Here below is a diagram representing the main objects in Watcher from a
|
||||
database perspective:
|
||||
|
||||
.. image:: ./images/watcher_class_diagram.png
|
||||
:width: 100%
|
||||
|
||||
.. image:: ./images/watcher_db_schema_diagram.png
|
||||
|
||||
|
||||
.. _sequence_diagrams:
|
||||
@@ -259,6 +271,13 @@ previously created :ref:`Audit template <audit_template_definition>`:
|
||||
.. image:: ./images/sequence_create_and_launch_audit.png
|
||||
:width: 100%
|
||||
|
||||
The :ref:`Administrator <administrator_definition>` also can specify type of
|
||||
Audit and interval (in case of CONTINUOUS type). There is two types of Audit:
|
||||
ONESHOT and CONTINUOUS. Oneshot Audit is launched once and if it succeeded
|
||||
executed new action plan list will be provided. Continuous Audit creates
|
||||
action plans with specified interval (in seconds); if action plan
|
||||
has been created, all previous action plans get CANCELLED state.
|
||||
|
||||
A message is sent on the :ref:`AMQP bus <amqp_bus_definition>` which triggers
|
||||
the Audit in the
|
||||
:ref:`Watcher Decision Engine <watcher_decision_engine_definition>`:
|
||||
@@ -271,7 +290,7 @@ the Audit parameters from the
|
||||
:ref:`Watcher Database <watcher_database_definition>`. It instantiates the
|
||||
appropriate :ref:`strategy <strategy_definition>` (using entry points)
|
||||
given both the :ref:`goal <goal_definition>` and the strategy associated to the
|
||||
parent :ref:`audit template <audit_template_definition>` of the :ref:`Audit
|
||||
parent :ref:`audit template <audit_template_definition>` of the :ref:`audit
|
||||
<audit_definition>`. If no strategy is associated to the audit template, the
|
||||
strategy is dynamically selected by the Decision Engine.
|
||||
|
||||
@@ -297,9 +316,11 @@ This method finds an appropriate scheduling of
|
||||
:ref:`Actions <action_definition>` taking into account some scheduling rules
|
||||
(such as priorities between actions).
|
||||
It generates a new :ref:`Action Plan <action_plan_definition>` with status
|
||||
**RECOMMENDED** and saves it into the
|
||||
:ref:`Watcher Database <watcher_database_definition>`. The saved action plan is
|
||||
now a scheduled flow of actions.
|
||||
**RECOMMENDED** and saves it into the:ref:`Watcher Database
|
||||
<watcher_database_definition>`. The saved action plan is now a scheduled flow
|
||||
of actions to which a global efficacy is associated alongside a number of
|
||||
:ref:`Efficacy Indicators <efficacy_indicator_definition>` as specified by the
|
||||
related :ref:`goal <goal_definition>`.
|
||||
|
||||
If every step executed successfully, the
|
||||
:ref:`Watcher Decision Engine <watcher_decision_engine_definition>` updates
|
||||
@@ -308,6 +329,11 @@ the current status of the Audit to **SUCCEEDED** in the
|
||||
on the bus to inform other components that the :ref:`Audit <audit_definition>`
|
||||
was successful.
|
||||
|
||||
This internal workflow the Decision Engine follows to conduct an audit can be
|
||||
seen in the sequence diagram here below:
|
||||
|
||||
.. image:: ./images/sequence_from_audit_execution_to_actionplan_creation.png
|
||||
:width: 100%
|
||||
|
||||
.. _sequence_diagrams_launch_action_plan:
|
||||
|
||||
@@ -382,7 +408,7 @@ be one of the following:
|
||||
:ref:`Watcher Decision Engine <watcher_decision_engine_definition>`
|
||||
- **SUCCEEDED** : the :ref:`Audit <audit_definition>` has been executed
|
||||
successfully and at least one solution was found
|
||||
- **FAILED** : an error occured while executing the
|
||||
- **FAILED** : an error occurred while executing the
|
||||
:ref:`Audit <audit_definition>`
|
||||
- **DELETED** : the :ref:`Audit <audit_definition>` is still stored in the
|
||||
:ref:`Watcher database <watcher_database_definition>` but is not returned
|
||||
@@ -418,7 +444,7 @@ state may be one of the following:
|
||||
- **SUCCEEDED** : the :ref:`Action Plan <action_plan_definition>` has been
|
||||
executed successfully (i.e. all :ref:`Actions <action_definition>` that it
|
||||
contains have been executed successfully)
|
||||
- **FAILED** : an error occured while executing the
|
||||
- **FAILED** : an error occurred while executing the
|
||||
:ref:`Action Plan <action_plan_definition>`
|
||||
- **DELETED** : the :ref:`Action Plan <action_plan_definition>` is still
|
||||
stored in the :ref:`Watcher database <watcher_database_definition>` but is
|
||||
|
||||
@@ -19,12 +19,13 @@ from watcher import version as watcher_version
|
||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
|
||||
extensions = [
|
||||
'oslo_config.sphinxconfiggen',
|
||||
'oslosphinx',
|
||||
'sphinx.ext.autodoc',
|
||||
'sphinx.ext.viewcode',
|
||||
'sphinxcontrib.httpdomain',
|
||||
'sphinxcontrib.pecanwsme.rest',
|
||||
'stevedore.sphinxext',
|
||||
'wsmeext.sphinxext',
|
||||
'oslosphinx',
|
||||
'watcher.doc',
|
||||
]
|
||||
|
||||
|
||||
@@ -403,6 +403,35 @@ own storage driver using whatever technology you want.
|
||||
For more information : https://wiki.openstack.org/wiki/Gnocchi
|
||||
|
||||
|
||||
Configure Nova Notifications
|
||||
============================
|
||||
|
||||
Watcher can consume notifications generated by the Nova services, in order to
|
||||
build or update, in real time, its cluster data model related to computing
|
||||
resources.
|
||||
|
||||
Nova publishes, by default, notifications on ``notifications`` AMQP queue
|
||||
(configurable) and ``versioned_notifications`` AMQP queue (not
|
||||
configurable). ``notifications`` queue is mainly used by ceilometer, so we can
|
||||
not use it. And some events, related to nova-compute service state, are only
|
||||
sent into the ``versioned_notifications`` queue.
|
||||
|
||||
By default, Watcher listens to AMQP queues named ``watcher_notifications``
|
||||
and ``versioned_notifications``. So you have to update the Nova
|
||||
configuration file on controller and compute nodes, in order
|
||||
to Watcher receives Nova notifications in ``watcher_notifications`` as well.
|
||||
|
||||
* In the file ``/etc/nova/nova.conf``, update the section
|
||||
``[oslo_messaging_notifications]``, by redefining the list of topics
|
||||
into which Nova services will publish events ::
|
||||
|
||||
[oslo_messaging_notifications]
|
||||
driver = messaging
|
||||
topics = notifications,watcher_notifications
|
||||
|
||||
* Restart the Nova services.
|
||||
|
||||
|
||||
Workers
|
||||
=======
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ should be able to run the Watcher services by issuing these commands:
|
||||
By default, this will show logging on the console from which it was started.
|
||||
Once started, you can use the `Watcher Client`_ to play with Watcher service.
|
||||
|
||||
.. _`Watcher Client`: https://git.openstack.org/openstack/python-watcherclient.git
|
||||
.. _`Watcher Client`: https://git.openstack.org/cgit/openstack/python-watcherclient
|
||||
|
||||
Installing from packages: PyPI
|
||||
--------------------------------
|
||||
@@ -108,3 +108,54 @@ installed on your system.
|
||||
Once installed, you still need to declare Watcher as a new service into
|
||||
Keystone and to configure its different modules, which you can find described
|
||||
in :doc:`configuration`.
|
||||
|
||||
|
||||
Installing from packages: Debian (experimental)
|
||||
-----------------------------------------------
|
||||
|
||||
Experimental Debian packages are available on `Debian repositories`_. The best
|
||||
way to use them is to install them into a Docker_ container.
|
||||
|
||||
Here is single Dockerfile snippet you can use to run your Docker container:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
FROM debian:experimental
|
||||
MAINTAINER David TARDIVEL <david.tardivel@b-com.com>
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get dist-upgrade -y
|
||||
RUN apt-get install -y vim net-tools
|
||||
RUN apt-get install -yt experimental watcher-api
|
||||
|
||||
CMD ["/usr/bin/watcher-api"]
|
||||
|
||||
Build your container from this Dockerfile:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ docker build -t watcher/api .
|
||||
|
||||
To run your container, execute this command:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ docker run -d -p 9322:9322 watcher/api
|
||||
|
||||
Check in your logs Watcher API is started
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ docker logs <container ID>
|
||||
|
||||
You can run similar container with Watcher Decision Engine (package
|
||||
``watcher-decision-engine``) and with the Watcher Applier (package
|
||||
``watcher-applier``).
|
||||
|
||||
.. _Docker: https://www.docker.com/
|
||||
.. _`Debian repositories`: https://packages.debian.org/experimental/allpackages
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
142
doc/source/deploy/policy.rst
Normal file
@@ -0,0 +1,142 @@
|
||||
..
|
||||
Copyright 2016 OpenStack Foundation
|
||||
All Rights Reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
not use this file except in compliance with the License. You may obtain
|
||||
a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
License for the specific language governing permissions and limitations
|
||||
under the License.
|
||||
|
||||
Policies
|
||||
========
|
||||
|
||||
Watcher's public API calls may be restricted to certain sets of users using a
|
||||
policy configuration file. This document explains exactly how policies are
|
||||
configured and what they apply to.
|
||||
|
||||
A policy is composed of a set of rules that are used in determining if a
|
||||
particular action may be performed by the authorized tenant.
|
||||
|
||||
Constructing a Policy Configuration File
|
||||
----------------------------------------
|
||||
|
||||
A policy configuration file is a simply JSON object that contain sets of
|
||||
rules. Each top-level key is the name of a rule. Each rule
|
||||
is a string that describes an action that may be performed in the Watcher API.
|
||||
|
||||
The actions that may have a rule enforced on them are:
|
||||
|
||||
* ``strategy:get_all``, ``strategy:detail`` - List available strategies
|
||||
|
||||
* ``GET /v1/strategies``
|
||||
* ``GET /v1/strategies/detail``
|
||||
|
||||
* ``strategy:get`` - Retrieve a specific strategy entity
|
||||
|
||||
* ``GET /v1/strategies/<STRATEGY_UUID>``
|
||||
* ``GET /v1/strategies/<STRATEGY_NAME>``
|
||||
|
||||
|
||||
* ``goal:get_all``, ``goal:detail`` - List available goals
|
||||
|
||||
* ``GET /v1/goals``
|
||||
* ``GET /v1/goals/detail``
|
||||
|
||||
* ``goal:get`` - Retrieve a specific goal entity
|
||||
|
||||
* ``GET /v1/goals/<GOAL_UUID>``
|
||||
* ``GET /v1/goals/<GOAL_NAME>``
|
||||
|
||||
|
||||
* ``audit_template:get_all``, ``audit_template:detail`` - List available
|
||||
audit_templates
|
||||
|
||||
* ``GET /v1/audit_templates``
|
||||
* ``GET /v1/audit_templates/detail``
|
||||
|
||||
* ``audit_template:get`` - Retrieve a specific audit template entity
|
||||
|
||||
* ``GET /v1/audit_templates/<AUDIT_TEMPLATE_UUID>``
|
||||
* ``GET /v1/audit_templates/<AUDIT_TEMPLATE_NAME>``
|
||||
|
||||
* ``audit_template:create`` - Create an audit template entity
|
||||
|
||||
* ``POST /v1/audit_templates``
|
||||
|
||||
* ``audit_template:delete`` - Delete an audit template entity
|
||||
|
||||
* ``DELETE /v1/audit_templates/<AUDIT_TEMPLATE_UUID>``
|
||||
* ``DELETE /v1/audit_templates/<AUDIT_TEMPLATE_NAME>``
|
||||
|
||||
* ``audit_template:update`` - Update an audit template entity
|
||||
|
||||
* ``PATCH /v1/audit_templates/<AUDIT_TEMPLATE_UUID>``
|
||||
* ``PATCH /v1/audit_templates/<AUDIT_TEMPLATE_NAME>``
|
||||
|
||||
|
||||
* ``audit:get_all``, ``audit:detail`` - List available audits
|
||||
|
||||
* ``GET /v1/audits``
|
||||
* ``GET /v1/audits/detail``
|
||||
|
||||
* ``audit:get`` - Retrieve a specific audit entity
|
||||
|
||||
* ``GET /v1/audits/<AUDIT_UUID>``
|
||||
|
||||
* ``audit:create`` - Create an audit entity
|
||||
|
||||
* ``POST /v1/audits``
|
||||
|
||||
* ``audit:delete`` - Delete an audit entity
|
||||
|
||||
* ``DELETE /v1/audits/<AUDIT_UUID>``
|
||||
|
||||
* ``audit:update`` - Update an audit entity
|
||||
|
||||
* ``PATCH /v1/audits/<AUDIT_UUID>``
|
||||
|
||||
|
||||
* ``action_plan:get_all``, ``action_plan:detail`` - List available action plans
|
||||
|
||||
* ``GET /v1/action_plans``
|
||||
* ``GET /v1/action_plans/detail``
|
||||
|
||||
* ``action_plan:get`` - Retrieve a specific action plan entity
|
||||
|
||||
* ``GET /v1/action_plans/<ACTION_PLAN_UUID>``
|
||||
|
||||
* ``action_plan:delete`` - Delete an action plan entity
|
||||
|
||||
* ``DELETE /v1/action_plans/<ACTION_PLAN_UUID>``
|
||||
|
||||
* ``action_plan:update`` - Update an action plan entity
|
||||
|
||||
* ``PATCH /v1/audits/<ACTION_PLAN_UUID>``
|
||||
|
||||
|
||||
* ``action:get_all``, ``action:detail`` - List available action
|
||||
|
||||
* ``GET /v1/actions``
|
||||
* ``GET /v1/actions/detail``
|
||||
|
||||
* ``action:get`` - Retrieve a specific action plan entity
|
||||
|
||||
* ``GET /v1/actions/<ACTION_UUID>``
|
||||
|
||||
|
||||
|
||||
To limit an action to a particular role or roles, you list the roles like so ::
|
||||
|
||||
{
|
||||
"audit:create": ["role:admin", "role:superuser"]
|
||||
}
|
||||
|
||||
The above would add a rule that only allowed users that had roles of either
|
||||
"admin" or "superuser" to launch an audit.
|
||||
@@ -11,7 +11,7 @@ Watcher User Guide
|
||||
==================
|
||||
|
||||
See the
|
||||
`architecture page <https://factory.b-com.com/www/watcher/doc/watcher/architecture.html>`_
|
||||
`architecture page <http://docs.openstack.org/developer/watcher/architecture.html>`_
|
||||
for an architectural overview of the different components of Watcher and how
|
||||
they fit together.
|
||||
|
||||
@@ -39,10 +39,10 @@ named ``watcher``, or by using the `OpenStack CLI`_ ``openstack``.
|
||||
If you want to deploy Watcher in Horizon, please refer to the `Watcher Horizon
|
||||
plugin installation guide`_.
|
||||
|
||||
.. _`installation guide`: https://factory.b-com.com/www/watcher/doc/python-watcherclient
|
||||
.. _`Watcher Horizon plugin installation guide`: https://factory.b-com.com/www/watcher/doc/watcher-dashboard/deploy/installation.html
|
||||
.. _`installation guide`: http://docs.openstack.org/developer/python-watcherclient
|
||||
.. _`Watcher Horizon plugin installation guide`: http://docs.openstack.org/developer/watcher-dashboard/deploy/installation.html
|
||||
.. _`OpenStack CLI`: http://docs.openstack.org/developer/python-openstackclient/man/openstack.html
|
||||
.. _`Watcher CLI`: https://factory.b-com.com/www/watcher/doc/python-watcherclient/index.html
|
||||
.. _`Watcher CLI`: http://docs.openstack.org/developer/python-watcherclient/index.html
|
||||
|
||||
Seeing what the Watcher CLI can do ?
|
||||
------------------------------------
|
||||
@@ -99,6 +99,16 @@ or::
|
||||
|
||||
$ openstack optimize strategy list --goal-uuid <your_goal_uuid>
|
||||
|
||||
You can use the following command to check strategy details including which
|
||||
parameters of which format it supports:
|
||||
|
||||
.. code:: bash
|
||||
|
||||
$ watcher strategy show <your_strategy>
|
||||
|
||||
or::
|
||||
|
||||
$ openstack optimize strategy show <your_strategy>
|
||||
|
||||
The command to create your audit template would then be:
|
||||
|
||||
@@ -140,9 +150,29 @@ or::
|
||||
|
||||
$ openstack optimize audit create -a <your_audit_template>
|
||||
|
||||
If your_audit_template was created by --strategy <your_strategy>, and it
|
||||
defines some parameters (command `watcher strategy show` to check parameters
|
||||
format), your can append `-p` to input required parameters:
|
||||
|
||||
.. code:: bash
|
||||
|
||||
$ watcher audit create -a <your_audit_template> \
|
||||
-p <your_strategy_para1>=5.5 -p <your_strategy_para2>=hi
|
||||
|
||||
or::
|
||||
|
||||
$ openstack optimize audit create -a <your_audit_template> \
|
||||
-p <your_strategy_para1>=5.5 -p <your_strategy_para2>=hi
|
||||
|
||||
Input parameter could cause audit creation failure, when:
|
||||
|
||||
- no predefined strategy for audit template
|
||||
- no parameters spec in predefined strategy
|
||||
- input parameters don't comply with spec
|
||||
|
||||
Watcher service will compute an :ref:`Action Plan <action_plan_definition>`
|
||||
composed of a list of potential optimization :ref:`actions <action_definition>`
|
||||
(instance migration, disabling of an hypervisor, ...) according to the
|
||||
(instance migration, disabling of a compute node, ...) according to the
|
||||
:ref:`goal <goal_definition>` to achieve. You can see all of the goals
|
||||
available in section ``[watcher_strategies]`` of the Watcher service
|
||||
configuration file.
|
||||
|
||||
@@ -64,8 +64,8 @@ IRC Channel
|
||||
``#openstack-watcher`` (changelog_)
|
||||
|
||||
Weekly Meetings
|
||||
on Wednesdays at 14:00 UTC in the ``#openstack-meeting-4`` IRC
|
||||
channel (`meetings logs`_)
|
||||
on Wednesdays at 14:00 UTC on even weeks, 9:00 UTC on odd weeks, in the
|
||||
``#openstack-meeting-4`` IRC channel (`meetings logs`_)
|
||||
|
||||
.. _changelog: http://eavesdrop.openstack.org/irclogs/%23openstack-watcher/
|
||||
.. _meetings logs: http://eavesdrop.openstack.org/meetings/watcher/
|
||||
|
||||
@@ -160,7 +160,7 @@ Edit `/etc/libvirt/libvirtd.conf` to make sure the following values are set::
|
||||
|
||||
Edit `/etc/default/libvirt-bin`::
|
||||
|
||||
libvirt_opts="-d -l"
|
||||
libvirtd_opts="-d -l"
|
||||
|
||||
Restart the libvirt service::
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ To install Watcher from packaging, refer instead to Watcher `User
|
||||
Documentation`_.
|
||||
|
||||
.. _`Git Repository`: http://git.openstack.org/cgit/openstack/watcher
|
||||
.. _`User Documentation`: https://factory.b-com.com/www/watcher/doc/watcher/
|
||||
.. _`User Documentation`: http://docs.openstack.org/developer/watcher/
|
||||
|
||||
Prerequisites
|
||||
=============
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
https://creativecommons.org/licenses/by/3.0/
|
||||
|
||||
.. _implement_action_plugin:
|
||||
|
||||
==================
|
||||
Build a new action
|
||||
==================
|
||||
@@ -78,12 +80,9 @@ Here is an example showing how you can write a plugin called ``DummyAction``:
|
||||
pass
|
||||
|
||||
|
||||
This implementation is the most basic one. So if you want to have more advanced
|
||||
examples, have a look at the implementation of the actions already provided
|
||||
by Watcher like.
|
||||
To get a better understanding on how to implement a more advanced action,
|
||||
have a look at the :py:class:`~watcher.applier.actions.migration.Migrate`
|
||||
class.
|
||||
This implementation is the most basic one. So in order to get a better
|
||||
understanding on how to implement a more advanced action, have a look at the
|
||||
:py:class:`~watcher.applier.actions.migration.Migrate` class.
|
||||
|
||||
Input validation
|
||||
----------------
|
||||
@@ -115,12 +114,15 @@ tune the action to its needs. To do so, you can implement the
|
||||
def execute(self):
|
||||
assert self.config.test_opt == 0
|
||||
|
||||
def get_config_opts(self):
|
||||
return [
|
||||
@classmethod
|
||||
def get_config_opts(cls):
|
||||
return super(
|
||||
DummyAction, cls).get_config_opts() + [
|
||||
cfg.StrOpt('test_opt', help="Demo Option.", default=0),
|
||||
# Some more options ...
|
||||
]
|
||||
|
||||
|
||||
The configuration options defined within this class method will be included
|
||||
within the global ``watcher.conf`` configuration file under a section named by
|
||||
convention: ``{namespace}.{plugin_name}``. In our case, the ``watcher.conf``
|
||||
@@ -203,6 +205,9 @@ By doing so, your action will be saved within the Watcher Database, ready to be
|
||||
processed by the planner for creating an action plan which can then be executed
|
||||
by the Watcher Applier via its workflow engine.
|
||||
|
||||
At the last, remember to add the action into the weights in ``watcher.conf``,
|
||||
otherwise you will get an error when the action be referenced in a strategy.
|
||||
|
||||
|
||||
Scheduling of an action plugin
|
||||
==============================
|
||||
|
||||
@@ -71,8 +71,15 @@ structure that looks like this::
|
||||
│ └── test_thirdparty.py
|
||||
└── tox.ini
|
||||
|
||||
**Note:** You should add `python-watcher`_ as a dependency in the
|
||||
requirements.txt file::
|
||||
|
||||
# Watcher-specific requirements
|
||||
python-watcher
|
||||
|
||||
.. _cookiecutter: https://github.com/audreyr/cookiecutter
|
||||
.. _OpenStack cookiecutter: https://github.com/openstack-dev/cookiecutter
|
||||
.. _python-watcher: https://pypi.python.org/pypi/python-watcher
|
||||
|
||||
Implementing a plugin for Watcher
|
||||
=================================
|
||||
@@ -81,10 +88,13 @@ Now that the project skeleton has been created, you can start the
|
||||
implementation of your plugin. As of now, you can implement the following
|
||||
plugins for Watcher:
|
||||
|
||||
- A :ref:`goal plugin <implement_goal_plugin>`
|
||||
- A :ref:`strategy plugin <implement_strategy_plugin>`
|
||||
- An :ref:`action plugin <implement_action_plugin>`
|
||||
- A :ref:`planner plugin <implement_planner_plugin>`
|
||||
- An :ref:`action plugin <implement_strategy_plugin>`
|
||||
- A :ref:`workflow engine plugin <implement_workflow_engine_plugin>`
|
||||
- A workflow engine plugin
|
||||
- A :ref:`cluster data model collector plugin
|
||||
<implement_cluster_data_model_collector_plugin>`
|
||||
|
||||
If you want to learn more on how to implement them, you can refer to their
|
||||
dedicated documentation.
|
||||
|
||||
229
doc/source/dev/plugin/cdmc-plugin.rst
Normal file
@@ -0,0 +1,229 @@
|
||||
..
|
||||
Except where otherwise noted, this document is licensed under Creative
|
||||
Commons Attribution 3.0 License. You can view the license at:
|
||||
|
||||
https://creativecommons.org/licenses/by/3.0/
|
||||
|
||||
.. _implement_cluster_data_model_collector_plugin:
|
||||
|
||||
========================================
|
||||
Build a new cluster data model collector
|
||||
========================================
|
||||
|
||||
Watcher Decision Engine has an external cluster data model (CDM) plugin
|
||||
interface which gives anyone the ability to integrate an external cluster data
|
||||
model collector (CDMC) in order to extend the initial set of cluster data model
|
||||
collectors Watcher provides.
|
||||
|
||||
This section gives some guidelines on how to implement and integrate custom
|
||||
cluster data model collectors within Watcher.
|
||||
|
||||
|
||||
Creating a new plugin
|
||||
=====================
|
||||
|
||||
In order to create a new model, you have to:
|
||||
|
||||
- Extend the :py:class:`~.base.BaseClusterDataModelCollector` class.
|
||||
- Implement its :py:meth:`~.BaseClusterDataModelCollector.execute` abstract
|
||||
method to return your entire cluster data model that this method should
|
||||
build.
|
||||
- Implement its :py:meth:`~.Goal.notification_endpoints` abstract property to
|
||||
return the list of all the :py:class:`~.base.NotificationEndpoint` instances
|
||||
that will be responsible for handling incoming notifications in order to
|
||||
incrementally update your cluster data model.
|
||||
|
||||
First of all, you have to extend the :class:`~.BaseClusterDataModelCollector`
|
||||
base class which defines the :py:meth:`~.BaseClusterDataModelCollector.execute`
|
||||
abstract method you will have to implement. This method is responsible for
|
||||
building an entire cluster data model.
|
||||
|
||||
Here is an example showing how you can write a plugin called
|
||||
``DummyClusterDataModelCollector``:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
# Filepath = <PROJECT_DIR>/thirdparty/dummy.py
|
||||
# Import path = thirdparty.dummy
|
||||
|
||||
from watcher.decision_engine.model import model_root
|
||||
from watcher.decision_engine.model.collector import base
|
||||
|
||||
|
||||
class DummyClusterDataModelCollector(base.BaseClusterDataModelCollector):
|
||||
|
||||
def execute(self):
|
||||
model = model_root.ModelRoot()
|
||||
# Do something here...
|
||||
return model
|
||||
|
||||
@property
|
||||
def notification_endpoints(self):
|
||||
return []
|
||||
|
||||
This implementation is the most basic one. So in order to get a better
|
||||
understanding on how to implement a more advanced cluster data model collector,
|
||||
have a look at the :py:class:`~.NovaClusterDataModelCollector` class.
|
||||
|
||||
Define configuration parameters
|
||||
===============================
|
||||
|
||||
At this point, you have a fully functional cluster data model collector.
|
||||
By default, cluster data model collectors define a ``period`` option (see
|
||||
:py:meth:`~.BaseClusterDataModelCollector.get_config_opts`) that corresponds
|
||||
to the interval of time between each synchronization of the in-memory model.
|
||||
|
||||
However, in more complex implementation, you may want to define some
|
||||
configuration options so one can tune the cluster data model collector to your
|
||||
needs. To do so, you can implement the :py:meth:`~.Loadable.get_config_opts`
|
||||
class method as followed:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from oslo_config import cfg
|
||||
from watcher.decision_engine.model import model_root
|
||||
from watcher.decision_engine.model.collector import base
|
||||
|
||||
|
||||
class DummyClusterDataModelCollector(base.BaseClusterDataModelCollector):
|
||||
|
||||
def execute(self):
|
||||
model = model_root.ModelRoot()
|
||||
# Do something here...
|
||||
return model
|
||||
|
||||
@property
|
||||
def notification_endpoints(self):
|
||||
return []
|
||||
|
||||
@classmethod
|
||||
def get_config_opts(cls):
|
||||
return super(
|
||||
DummyClusterDataModelCollector, cls).get_config_opts() + [
|
||||
cfg.StrOpt('test_opt', help="Demo Option.", default=0),
|
||||
# Some more options ...
|
||||
]
|
||||
|
||||
The configuration options defined within this class method will be included
|
||||
within the global ``watcher.conf`` configuration file under a section named by
|
||||
convention: ``{namespace}.{plugin_name}`` (see section :ref:`Register a new
|
||||
entry point <register_new_cdmc_entrypoint>`). The namespace for CDMC plugins is
|
||||
``watcher_cluster_data_model_collectors``, so in our case, the ``watcher.conf``
|
||||
configuration would have to be modified as followed:
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
[watcher_cluster_data_model_collectors.dummy]
|
||||
# Option used for testing.
|
||||
test_opt = test_value
|
||||
|
||||
Then, the configuration options you define within this method will then be
|
||||
injected in each instantiated object via the ``config`` parameter of the
|
||||
:py:meth:`~.BaseClusterDataModelCollector.__init__` method.
|
||||
|
||||
|
||||
Abstract Plugin Class
|
||||
=====================
|
||||
|
||||
Here below is the abstract ``BaseClusterDataModelCollector`` class that every
|
||||
single cluster data model collector should implement:
|
||||
|
||||
.. autoclass:: watcher.decision_engine.model.collector.base.BaseClusterDataModelCollector
|
||||
:members:
|
||||
:special-members: __init__
|
||||
:noindex:
|
||||
|
||||
|
||||
.. _register_new_cdmc_entrypoint:
|
||||
|
||||
Register a new entry point
|
||||
==========================
|
||||
|
||||
In order for the Watcher Decision Engine to load your new cluster data model
|
||||
collector, the latter must be registered as a named entry point under the
|
||||
``watcher_cluster_data_model_collectors`` entry point namespace of your
|
||||
``setup.py`` file. If you are using pbr_, this entry point should be placed in
|
||||
your ``setup.cfg`` file.
|
||||
|
||||
The name you give to your entry point has to be unique.
|
||||
|
||||
Here below is how to register ``DummyClusterDataModelCollector`` using pbr_:
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
[entry_points]
|
||||
watcher_cluster_data_model_collectors =
|
||||
dummy = thirdparty.dummy:DummyClusterDataModelCollector
|
||||
|
||||
.. _pbr: http://docs.openstack.org/developer/pbr/
|
||||
|
||||
|
||||
Add new notification endpoints
|
||||
==============================
|
||||
|
||||
At this point, you have a fully functional cluster data model collector.
|
||||
However, this CDMC is only refreshed periodically via a background scheduler.
|
||||
As you may sometimes execute a strategy with a stale CDM due to a high activity
|
||||
on your infrastructure, you can define some notification endpoints that will be
|
||||
responsible for incrementally updating the CDM based on notifications emitted
|
||||
by other services such as Nova. To do so, you can implement and register a new
|
||||
``DummyEndpoint`` notification endpoint regarding a ``dummy`` event as shown
|
||||
below:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from watcher.decision_engine.model import model_root
|
||||
from watcher.decision_engine.model.collector import base
|
||||
|
||||
|
||||
class DummyNotification(base.NotificationEndpoint):
|
||||
|
||||
@property
|
||||
def filter_rule(self):
|
||||
return filtering.NotificationFilter(
|
||||
publisher_id=r'.*',
|
||||
event_type=r'^dummy$',
|
||||
)
|
||||
|
||||
def info(self, ctxt, publisher_id, event_type, payload, metadata):
|
||||
# Do some CDM modifications here...
|
||||
pass
|
||||
|
||||
|
||||
class DummyClusterDataModelCollector(base.BaseClusterDataModelCollector):
|
||||
|
||||
def execute(self):
|
||||
model = model_root.ModelRoot()
|
||||
# Do something here...
|
||||
return model
|
||||
|
||||
@property
|
||||
def notification_endpoints(self):
|
||||
return [DummyNotification(self)]
|
||||
|
||||
|
||||
Note that if the event you are trying to listen to is published by a new
|
||||
service, you may have to also add a new topic Watcher will have to subscribe to
|
||||
in the ``notification_topics`` option of the ``[watcher_decision_engine]``
|
||||
section.
|
||||
|
||||
|
||||
Using cluster data model collector plugins
|
||||
==========================================
|
||||
|
||||
The Watcher Decision Engine service will automatically discover any installed
|
||||
plugins when it is restarted. If a Python package containing a custom plugin is
|
||||
installed within the same environment as Watcher, Watcher will automatically
|
||||
make that plugin available for use.
|
||||
|
||||
At this point, you can use your new cluster data model plugin in your
|
||||
:ref:`strategy plugin <implement_strategy_plugin>` by using the
|
||||
:py:attr:`~.BaseStrategy.collector_manager` property as followed:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
# [...]
|
||||
dummy_collector = self.collector_manager.get_cluster_model_collector(
|
||||
"dummy") # "dummy" is the name of the entry point we declared earlier
|
||||
dummy_model = collector.get_latest_cluster_data_model()
|
||||
# Do some stuff with this model
|
||||
215
doc/source/dev/plugin/goal-plugin.rst
Normal file
@@ -0,0 +1,215 @@
|
||||
..
|
||||
Except where otherwise noted, this document is licensed under Creative
|
||||
Commons Attribution 3.0 License. You can view the license at:
|
||||
|
||||
https://creativecommons.org/licenses/by/3.0/
|
||||
|
||||
.. _implement_goal_plugin:
|
||||
|
||||
================
|
||||
Build a new goal
|
||||
================
|
||||
|
||||
Watcher Decision Engine has an external :ref:`goal <goal_definition>`
|
||||
plugin interface which gives anyone the ability to integrate an external
|
||||
goal which can be achieved by a :ref:`strategy <strategy_definition>`.
|
||||
|
||||
This section gives some guidelines on how to implement and integrate custom
|
||||
goals with Watcher. If you wish to create a third-party package for your
|
||||
plugin, you can refer to our :ref:`documentation for third-party package
|
||||
creation <plugin-base_setup>`.
|
||||
|
||||
|
||||
Pre-requisites
|
||||
==============
|
||||
|
||||
Before using any goal, please make sure that none of the existing goals fit
|
||||
your needs. Indeed, the underlying value of defining a goal is to be able to
|
||||
compare the efficacy of the action plans resulting from the various strategies
|
||||
satisfying the same goal. By doing so, Watcher can assist the administrator
|
||||
in his choices.
|
||||
|
||||
|
||||
Create a new plugin
|
||||
===================
|
||||
|
||||
In order to create a new goal, you have to:
|
||||
|
||||
- Extend the :py:class:`~.base.Goal` class.
|
||||
- Implement its :py:meth:`~.Goal.get_name` class method to return the
|
||||
**unique** ID of the new goal you want to create. This unique ID should
|
||||
be the same as the name of :ref:`the entry point you will declare later on
|
||||
<goal_plugin_add_entrypoint>`.
|
||||
- Implement its :py:meth:`~.Goal.get_display_name` class method to
|
||||
return the translated display name of the goal you want to create.
|
||||
Note: Do not use a variable to return the translated string so it can be
|
||||
automatically collected by the translation tool.
|
||||
- Implement its :py:meth:`~.Goal.get_translatable_display_name`
|
||||
class method to return the translation key (actually the english display
|
||||
name) of your new goal. The value return should be the same as the
|
||||
string translated in :py:meth:`~.Goal.get_display_name`.
|
||||
- Implement its :py:meth:`~.Goal.get_efficacy_specification` method to return
|
||||
the :ref:`efficacy specification <efficacy_specification_definition>` for
|
||||
your goal.
|
||||
|
||||
Here is an example showing how you can define a new ``NewGoal`` goal plugin:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
# filepath: thirdparty/new.py
|
||||
# import path: thirdparty.new
|
||||
|
||||
from watcher._i18n import _
|
||||
from watcher.decision_engine.goal.efficacy import specs
|
||||
from watcher.decision_engine.strategy.strategies import base
|
||||
|
||||
class NewGoal(base.Goal):
|
||||
|
||||
@classmethod
|
||||
def get_name(cls):
|
||||
return "new_goal" # Will be the name of the entry point
|
||||
|
||||
@classmethod
|
||||
def get_display_name(cls):
|
||||
return _("New Goal")
|
||||
|
||||
@classmethod
|
||||
def get_translatable_display_name(cls):
|
||||
return "New Goal"
|
||||
|
||||
@classmethod
|
||||
def get_efficacy_specification(cls):
|
||||
return specs.UnclassifiedStrategySpecification()
|
||||
|
||||
|
||||
As you may have noticed, the :py:meth:`~.Goal.get_efficacy_specification`
|
||||
method returns an :py:meth:`~.UnclassifiedStrategySpecification` instance which
|
||||
is provided by Watcher. This efficacy specification is useful during the
|
||||
development process of your goal as it corresponds to an empty specification.
|
||||
If you want to learn more about what efficacy specifications are used for or to
|
||||
define your own efficacy specification, please refer to the :ref:`related
|
||||
section below <implement_efficacy_specification>`.
|
||||
|
||||
|
||||
Abstract Plugin Class
|
||||
=====================
|
||||
|
||||
Here below is the abstract :py:class:`~.base.Goal` class:
|
||||
|
||||
.. autoclass:: watcher.decision_engine.goal.base.Goal
|
||||
:members:
|
||||
:noindex:
|
||||
|
||||
.. _goal_plugin_add_entrypoint:
|
||||
|
||||
Add a new entry point
|
||||
=====================
|
||||
|
||||
In order for the Watcher Decision Engine to load your new goal, the
|
||||
goal must be registered as a named entry point under the ``watcher_goals``
|
||||
entry point namespace of your ``setup.py`` file. If you are using pbr_, this
|
||||
entry point should be placed in your ``setup.cfg`` file.
|
||||
|
||||
The name you give to your entry point has to be unique and should be the same
|
||||
as the value returned by the :py:meth:`~.base.Goal.get_name` class method of
|
||||
your goal.
|
||||
|
||||
Here below is how you would proceed to register ``NewGoal`` using pbr_:
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
[entry_points]
|
||||
watcher_goals =
|
||||
new_goal = thirdparty.new:NewGoal
|
||||
|
||||
|
||||
To get a better understanding on how to implement a more advanced goal,
|
||||
have a look at the :py:class:`~.ServerConsolidation` class.
|
||||
|
||||
.. _pbr: http://docs.openstack.org/developer/pbr/
|
||||
|
||||
.. _implement_efficacy_specification:
|
||||
|
||||
Implement a customized efficacy specification
|
||||
=============================================
|
||||
|
||||
What is it for?
|
||||
---------------
|
||||
|
||||
Efficacy specifications define a set of specifications for a given goal.
|
||||
These specifications actually define a list of indicators which are to be used
|
||||
to compute a global efficacy that outlines how well a strategy performed when
|
||||
trying to achieve the goal it is associated to.
|
||||
|
||||
The idea behind such specification is to give the administrator the possibility
|
||||
to run an audit using different strategies satisfying the same goal and be able
|
||||
to judge how they performed at a glance.
|
||||
|
||||
|
||||
Implementation
|
||||
--------------
|
||||
|
||||
In order to create a new efficacy specification, you have to:
|
||||
|
||||
- Extend the :py:class:`~.EfficacySpecification` class.
|
||||
- Implement :py:meth:`~.EfficacySpecification.get_indicators_specifications`
|
||||
by returning a list of :py:class:`~.IndicatorSpecification` instances.
|
||||
|
||||
* Each :py:class:`~.IndicatorSpecification` instance should actually extend
|
||||
the latter.
|
||||
* Each indicator specification should have a **unique name** which should be
|
||||
a valid Python variable name.
|
||||
* They should implement the :py:attr:`~.EfficacySpecification.schema`
|
||||
abstract property by returning a :py:class:`~.voluptuous.Schema` instance.
|
||||
This schema is the contract the strategy will have to comply with when
|
||||
setting the value associated to the indicator specification within its
|
||||
solution (see the :ref:`architecture of Watcher
|
||||
<sequence_diagrams_create_and_launch_audit>` for more information on
|
||||
the audit execution workflow).
|
||||
|
||||
- Implement the :py:meth:`~.EfficacySpecification.get_global_efficacy` method:
|
||||
it should compute the global efficacy for the goal it achieves based on the
|
||||
efficacy indicators you just defined.
|
||||
|
||||
Here below is an example of an efficacy specification containing one indicator
|
||||
specification:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from watcher._i18n import _
|
||||
from watcher.decision_engine.goal.efficacy import base as efficacy_base
|
||||
from watcher.decision_engine.goal.efficacy import indicators
|
||||
from watcher.decision_engine.solution import efficacy
|
||||
|
||||
|
||||
class IndicatorExample(IndicatorSpecification):
|
||||
def __init__(self):
|
||||
super(IndicatorExample, self).__init__(
|
||||
name="indicator_example",
|
||||
description=_("Example of indicator specification."),
|
||||
unit=None,
|
||||
)
|
||||
|
||||
@property
|
||||
def schema(self):
|
||||
return voluptuous.Schema(voluptuous.Range(min=0), required=True)
|
||||
|
||||
|
||||
class UnclassifiedStrategySpecification(efficacy_base.EfficacySpecification):
|
||||
|
||||
def get_indicators_specifications(self):
|
||||
return [IndicatorExample()]
|
||||
|
||||
def get_global_efficacy(self, indicators_map):
|
||||
return efficacy.Indicator(
|
||||
name="global_efficacy_indicator",
|
||||
description="Example of global efficacy indicator",
|
||||
unit="%",
|
||||
value=indicators_map.indicator_example % 100)
|
||||
|
||||
|
||||
To get a better understanding on how to implement an efficacy specification,
|
||||
have a look at :py:class:`~.ServerConsolidationSpecification`.
|
||||
|
||||
Also, if you want to see a concrete example of an indicator specification,
|
||||
have a look at :py:class:`~.ReleasedComputeNodesCount`.
|
||||
@@ -11,9 +11,10 @@ Build a new planner
|
||||
===================
|
||||
|
||||
Watcher :ref:`Decision Engine <watcher_decision_engine_definition>` has an
|
||||
external :ref:`planner <planner_definition>` plugin interface which gives
|
||||
anyone the ability to integrate an external :ref:`planner <planner_definition>`
|
||||
in order to extend the initial set of planners Watcher provides.
|
||||
external :ref:`planner <watcher_planner_definition>` plugin interface which
|
||||
gives anyone the ability to integrate an external :ref:`planner
|
||||
<watcher_planner_definition>` in order to extend the initial set of planners
|
||||
Watcher provides.
|
||||
|
||||
This section gives some guidelines on how to implement and integrate custom
|
||||
planners with Watcher.
|
||||
@@ -90,8 +91,10 @@ tune the planner to its needs. To do so, you can implement the
|
||||
assert self.config.test_opt == 0
|
||||
# [...]
|
||||
|
||||
def get_config_opts(self):
|
||||
return [
|
||||
@classmethod
|
||||
def get_config_opts(cls):
|
||||
return super(
|
||||
DummyPlanner, cls).get_config_opts() + [
|
||||
cfg.StrOpt('test_opt', help="Demo Option.", default=0),
|
||||
# Some more options ...
|
||||
]
|
||||
|
||||
210
doc/source/dev/plugin/scoring-engine-plugin.rst
Normal file
@@ -0,0 +1,210 @@
|
||||
..
|
||||
Except where otherwise noted, this document is licensed under Creative
|
||||
Commons Attribution 3.0 License. You can view the license at:
|
||||
|
||||
https://creativecommons.org/licenses/by/3.0/
|
||||
|
||||
.. _implement_scoring_engine_plugin:
|
||||
|
||||
==========================
|
||||
Build a new scoring engine
|
||||
==========================
|
||||
|
||||
Watcher Decision Engine has an external :ref:`scoring engine
|
||||
<scoring_engine_definition>` plugin interface which gives anyone the ability
|
||||
to integrate an external scoring engine in order to make use of it in a
|
||||
:ref:`strategy <strategy_definition>`.
|
||||
|
||||
This section gives some guidelines on how to implement and integrate custom
|
||||
scoring engines with Watcher. If you wish to create a third-party package for
|
||||
your plugin, you can refer to our :ref:`documentation for third-party package
|
||||
creation <plugin-base_setup>`.
|
||||
|
||||
|
||||
Pre-requisites
|
||||
==============
|
||||
|
||||
Because scoring engines execute a purely mathematical tasks, they typically do
|
||||
not have any additional dependencies. Additional requirements might be defined
|
||||
by specific scoring engine implementations. For example, some scoring engines
|
||||
might require to prepare learning data, which has to be loaded during the
|
||||
scoring engine startup. Some other might require some external services to be
|
||||
available (e.g. if the scoring infrastructure is running in the cloud).
|
||||
|
||||
|
||||
Create a new scoring engine plugin
|
||||
==================================
|
||||
|
||||
In order to create a new scoring engine you have to:
|
||||
|
||||
- Extend the :py:class:`~.ScoringEngine` class
|
||||
- Implement its :py:meth:`~.ScoringEngine.get_name` method to return the
|
||||
**unique** ID of the new scoring engine you want to create. This unique ID
|
||||
should be the same as the name of :ref:`the entry point we will declare later
|
||||
on <scoring_engine_plugin_add_entrypoint>`.
|
||||
- Implement its :py:meth:`~.ScoringEngine.get_description` method to return the
|
||||
user-friendly description of the implemented scoring engine. It might contain
|
||||
information about algorithm used, learning data etc.
|
||||
- Implement its :py:meth:`~.ScoringEngine.get_metainfo` method to return the
|
||||
machine-friendly metadata about this scoring engine. For example, it could be
|
||||
a JSON formatted text with information about the data model used, its input
|
||||
and output data format, column names, etc.
|
||||
- Implement its :py:meth:`~.ScoringEngine.calculate_score` method to return the
|
||||
result calculated by this scoring engine.
|
||||
|
||||
Here is an example showing how you can write a plugin called ``NewScorer``:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
# filepath: thirdparty/new.py
|
||||
# import path: thirdparty.new
|
||||
from watcher.decision_engine.scoring import base
|
||||
|
||||
|
||||
class NewScorer(base.ScoringEngine):
|
||||
|
||||
def get_name(self):
|
||||
return 'new_scorer'
|
||||
|
||||
def get_description(self):
|
||||
return ''
|
||||
|
||||
def get_metainfo(self):
|
||||
return """{
|
||||
"feature_columns": [
|
||||
"column1",
|
||||
"column2",
|
||||
"column3"],
|
||||
"result_columns": [
|
||||
"value",
|
||||
"probability"]
|
||||
}"""
|
||||
|
||||
def calculate_score(self, features):
|
||||
return '[12, 0.83]'
|
||||
|
||||
As you can see in the above example, the
|
||||
:py:meth:`~.ScoringEngine.calculate_score` method returns a string. Both this
|
||||
class and the client (caller) should perform all the necessary serialization
|
||||
or deserialization.
|
||||
|
||||
|
||||
(Optional) Create a new scoring engine container plugin
|
||||
=======================================================
|
||||
|
||||
Optionally, it's possible to implement a container plugin, which can return a
|
||||
list of scoring engines. This list can be re-evaluated multiple times during
|
||||
the lifecycle of :ref:`Watcher Decision Engine
|
||||
<watcher_decision_engine_definition>` and synchronized with :ref:`Watcher
|
||||
Database <watcher_database_definition>` using the ``watcher-sync`` command line
|
||||
tool.
|
||||
|
||||
Below is an example of a container using some scoring engine implementation
|
||||
that is simply made of a client responsible for communicating with a real
|
||||
scoring engine deployed as a web service on external servers:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
class NewScoringContainer(base.ScoringEngineContainer):
|
||||
|
||||
@classmethod
|
||||
def get_scoring_engine_list(self):
|
||||
return [
|
||||
RemoteScoringEngine(
|
||||
name='scoring_engine1',
|
||||
description='Some remote Scoring Engine 1',
|
||||
remote_url='http://engine1.example.com/score'),
|
||||
RemoteScoringEngine(
|
||||
name='scoring_engine2',
|
||||
description='Some remote Scoring Engine 2',
|
||||
remote_url='http://engine2.example.com/score'),
|
||||
]
|
||||
|
||||
|
||||
Abstract Plugin Class
|
||||
=====================
|
||||
|
||||
Here below is the abstract :py:class:`~.ScoringEngine` class:
|
||||
|
||||
.. autoclass:: watcher.decision_engine.scoring.base.ScoringEngine
|
||||
:members:
|
||||
:special-members: __init__
|
||||
:noindex:
|
||||
|
||||
|
||||
Abstract Plugin Container Class
|
||||
===============================
|
||||
|
||||
Here below is the abstract :py:class:`~.ScoringContainer` class:
|
||||
|
||||
.. autoclass:: watcher.decision_engine.scoring.base.ScoringEngineContainer
|
||||
:members:
|
||||
:special-members: __init__
|
||||
:noindex:
|
||||
|
||||
|
||||
.. _scoring_engine_plugin_add_entrypoint:
|
||||
|
||||
Add a new entry point
|
||||
=====================
|
||||
|
||||
In order for the Watcher Decision Engine to load your new scoring engine, it
|
||||
must be registered as a named entry point under the ``watcher_scoring_engines``
|
||||
entry point of your ``setup.py`` file. If you are using pbr_, this entry point
|
||||
should be placed in your ``setup.cfg`` file.
|
||||
|
||||
The name you give to your entry point has to be unique and should be the same
|
||||
as the value returned by the :py:meth:`~.ScoringEngine.get_name` method of your
|
||||
strategy.
|
||||
|
||||
Here below is how you would proceed to register ``NewScorer`` using pbr_:
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
[entry_points]
|
||||
watcher_scoring_engines =
|
||||
new_scorer = thirdparty.new:NewScorer
|
||||
|
||||
|
||||
To get a better understanding on how to implement a more advanced scoring
|
||||
engine, have a look at the :py:class:`~.DummyScorer` class. This implementation
|
||||
is not really using machine learning, but other than that it contains all the
|
||||
pieces which the "real" implementation would have.
|
||||
|
||||
In addition, for some use cases there is a need to register a list (possibly
|
||||
dynamic, depending on the implementation and configuration) of scoring engines
|
||||
in a single plugin, so there is no need to restart :ref:`Watcher Decision
|
||||
Engine <watcher_decision_engine_definition>` every time such list changes. For
|
||||
these cases, an additional ``watcher_scoring_engine_containers`` entry point
|
||||
can be used.
|
||||
|
||||
For the example how to use scoring engine containers, please have a look at
|
||||
the :py:class:`~.DummyScoringContainer` and the way it is configured in
|
||||
``setup.cfg``. For new containers it could be done like this:
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
[entry_points]
|
||||
watcher_scoring_engine_containers =
|
||||
new_scoring_container = thirdparty.new:NewContainer
|
||||
|
||||
.. _pbr: http://docs.openstack.org/developer/pbr/
|
||||
|
||||
|
||||
Using scoring engine plugins
|
||||
============================
|
||||
|
||||
The Watcher Decision Engine service will automatically discover any installed
|
||||
plugins when it is restarted. If a Python package containing a custom plugin is
|
||||
installed within the same environment as Watcher, Watcher will automatically
|
||||
make that plugin available for use.
|
||||
|
||||
At this point, Watcher will scan and register inside the :ref:`Watcher Database
|
||||
<watcher_database_definition>` all the scoring engines you implemented upon
|
||||
restarting the :ref:`Watcher Decision Engine
|
||||
<watcher_decision_engine_definition>`.
|
||||
|
||||
In addition, ``watcher-sync`` tool can be used to trigger :ref:`Watcher
|
||||
Database <watcher_database_definition>` synchronization. This might be used for
|
||||
"dynamic" scoring containers, which can return different scoring engines based
|
||||
on some external configuration (if they support that).
|
||||
@@ -28,8 +28,8 @@ configured so that it would provide you all the metrics you need to be able to
|
||||
use your strategy.
|
||||
|
||||
|
||||
Create a new plugin
|
||||
===================
|
||||
Create a new strategy plugin
|
||||
============================
|
||||
|
||||
In order to create a new strategy, you have to:
|
||||
|
||||
@@ -53,6 +53,8 @@ Here is an example showing how you can write a plugin called ``NewStrategy``:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
# filepath: thirdparty/new.py
|
||||
# import path: thirdparty.new
|
||||
import abc
|
||||
|
||||
import six
|
||||
@@ -88,9 +90,12 @@ Here is an example showing how you can write a plugin called ``NewStrategy``:
|
||||
As you can see in the above example, the :py:meth:`~.BaseStrategy.execute`
|
||||
method returns a :py:class:`~.BaseSolution` instance as required. This solution
|
||||
is what wraps the abstract set of actions the strategy recommends to you. This
|
||||
solution is then processed by a :ref:`planner <planner_definition>` to produce
|
||||
an action plan which contains the sequenced flow of actions to be
|
||||
executed by the :ref:`Watcher Applier <watcher_applier_definition>`.
|
||||
solution is then processed by a :ref:`planner <watcher_planner_definition>` to
|
||||
produce an action plan which contains the sequenced flow of actions to be
|
||||
executed by the :ref:`Watcher Applier <watcher_applier_definition>`. This
|
||||
solution also contains the various :ref:`efficacy indicators
|
||||
<efficacy_indicator_definition>` alongside its computed :ref:`global efficacy
|
||||
<efficacy_definition>`.
|
||||
|
||||
Please note that your strategy class will expect to find the same constructor
|
||||
signature as BaseStrategy to instantiate you strategy. Therefore, you should
|
||||
@@ -98,7 +103,7 @@ ensure that your ``__init__`` signature is identical to the
|
||||
:py:class:`~.BaseStrategy` one.
|
||||
|
||||
|
||||
Create a new goal
|
||||
Strategy efficacy
|
||||
=================
|
||||
|
||||
As stated before, the ``NewStrategy`` class extends a class called
|
||||
@@ -106,126 +111,76 @@ As stated before, the ``NewStrategy`` class extends a class called
|
||||
abstract methods which are defined within the :py:class:`~.BaseStrategy` parent
|
||||
class.
|
||||
|
||||
Once you are confident in your strategy plugin, the next step is now to
|
||||
classify your goal by assigning it a proper goal. To do so, you can either
|
||||
reuse existing goals defined in Watcher. As of now, four goal-oriented abstract
|
||||
classes are defined in Watcher:
|
||||
One thing this :py:class:`~.UnclassifiedStrategy` class defines is that our
|
||||
``NewStrategy`` achieves the ``unclassified`` goal. This goal is a peculiar one
|
||||
as it does not contain any indicator nor does it calculate a global efficacy.
|
||||
This proves itself to be quite useful during the development of a new strategy
|
||||
for which the goal has yet to be defined or in case a :ref:`new goal
|
||||
<implement_goal_plugin>` has yet to be implemented.
|
||||
|
||||
- :py:class:`~.UnclassifiedStrategy` which is the one I mentioned up until now.
|
||||
- :py:class:`~.DummyBaseStrategy` which is used by :py:class:`~.DummyStrategy`
|
||||
for testing purposes.
|
||||
- :py:class:`~.ServerConsolidationBaseStrategy`
|
||||
- :py:class:`~.ThermalOptimizationBaseStrategy`
|
||||
|
||||
If none of the above actually correspond to the goal your new strategy
|
||||
achieves, you can define a brand new one. To do so, you need to:
|
||||
Define Strategy Parameters
|
||||
==========================
|
||||
|
||||
- Extend the :py:class:`~.BaseStrategy` class to make your new goal-oriented
|
||||
strategy abstract class :
|
||||
- Implement its :py:meth:`~.BaseStrategy.get_goal_name` class method to
|
||||
return the **unique** ID of the goal you want to achieve.
|
||||
- Implement its :py:meth:`~.BaseStrategy.get_goal_display_name` class method
|
||||
to return the translated display name of the goal you want to achieve.
|
||||
Note: Do not use a variable to return the translated string so it can be
|
||||
automatically collected by the translation tool.
|
||||
- Implement its :py:meth:`~.BaseStrategy.get_translatable_goal_display_name`
|
||||
class method to return the goal translation key (actually the english
|
||||
display name). The value return should be the same as the string translated
|
||||
in :py:meth:`~.BaseStrategy.get_goal_display_name`.
|
||||
For each new added strategy, you can add parameters spec so that an operator
|
||||
can input strategy parameters when creating an audit to control the
|
||||
:py:meth:`~.BaseStrategy.execute` behavior of strategy. This is useful to
|
||||
define some threshold for your strategy, and tune them at runtime.
|
||||
|
||||
Here is an example showing how you can define a new ``NEW_GOAL`` goal and
|
||||
modify your ``NewStrategy`` plugin so it now achieves the latter:
|
||||
To define parameters, just implements :py:meth:`~.BaseStrategy.get_schema` to
|
||||
return parameters spec with `jsonschema
|
||||
<http://json-schema.org/>`_ format.
|
||||
It is strongly encouraged that provide default value for each parameter, or
|
||||
else reference fails if operator specify no parameters.
|
||||
|
||||
Here is an example showing how you can define 2 parameters for
|
||||
``DummyStrategy``:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
import abc
|
||||
|
||||
import six
|
||||
|
||||
from watcher._i18n import _
|
||||
from watcher.decision_engine.strategy.strategies import base
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
class NewGoalBaseStrategy(base.BaseStrategy):
|
||||
class DummyStrategy(base.DummyBaseStrategy):
|
||||
|
||||
@classmethod
|
||||
def get_goal_name(cls):
|
||||
return "NEW_GOAL"
|
||||
|
||||
@classmethod
|
||||
def get_goal_display_name(cls):
|
||||
return _("New goal")
|
||||
|
||||
@classmethod
|
||||
def get_translatable_goal_display_name(cls):
|
||||
return "New goal"
|
||||
def get_schema(cls):
|
||||
return {
|
||||
"properties": {
|
||||
"para1": {
|
||||
"description": "number parameter example",
|
||||
"type": "number",
|
||||
"default": 3.2,
|
||||
"minimum": 1.0,
|
||||
"maximum": 10.2,
|
||||
},
|
||||
"para2": {
|
||||
"description": "string parameter example",
|
||||
"type": "string",
|
||||
"default": "hello",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
class NewStrategy(NewGoalBaseStrategy):
|
||||
|
||||
def __init__(self, config, osc=None):
|
||||
super(NewStrategy, self).__init__(config, osc)
|
||||
|
||||
def execute(self, original_model):
|
||||
self.solution.add_action(action_type="nop",
|
||||
input_parameters=parameters)
|
||||
# Do some more stuff here ...
|
||||
return self.solution
|
||||
|
||||
@classmethod
|
||||
def get_name(cls):
|
||||
return "new_strategy"
|
||||
|
||||
@classmethod
|
||||
def get_display_name(cls):
|
||||
return _("New strategy")
|
||||
|
||||
@classmethod
|
||||
def get_translatable_display_name(cls):
|
||||
return "New strategy"
|
||||
|
||||
|
||||
Define configuration parameters
|
||||
===============================
|
||||
|
||||
At this point, you have a fully functional strategy. However, in more complex
|
||||
implementation, you may want to define some configuration options so one can
|
||||
tune the strategy to its needs. To do so, you can implement the
|
||||
:py:meth:`~.Loadable.get_config_opts` class method as followed:
|
||||
You can reference parameters in :py:meth:`~.BaseStrategy.execute`:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from oslo_config import cfg
|
||||
class DummyStrategy(base.DummyBaseStrategy):
|
||||
|
||||
class NewStrategy(NewGoalBaseStrategy):
|
||||
def execute(self):
|
||||
para1 = self.input_parameters.para1
|
||||
para2 = self.input_parameters.para2
|
||||
|
||||
# [...]
|
||||
|
||||
def execute(self, original_model):
|
||||
assert self.config.test_opt == 0
|
||||
# [...]
|
||||
|
||||
def get_config_opts(self):
|
||||
return [
|
||||
cfg.StrOpt('test_opt', help="Demo Option.", default=0),
|
||||
# Some more options ...
|
||||
]
|
||||
if para1 > 5:
|
||||
...
|
||||
|
||||
|
||||
The configuration options defined within this class method will be included
|
||||
within the global ``watcher.conf`` configuration file under a section named by
|
||||
convention: ``{namespace}.{plugin_name}``. In our case, the ``watcher.conf``
|
||||
configuration would have to be modified as followed:
|
||||
Operator can specify parameters with following commands:
|
||||
|
||||
.. code-block:: ini
|
||||
.. code:: bash
|
||||
|
||||
[watcher_strategies.new_strategy]
|
||||
# Option used for testing.
|
||||
test_opt = test_value
|
||||
$ watcher audit create -a <your_audit_template> -p para1=6.0 -p para2=hi
|
||||
|
||||
Then, the configuration options you define within this method will then be
|
||||
injected in each instantiated object via the ``config`` parameter of the
|
||||
:py:meth:`~.BaseStrategy.__init__` method.
|
||||
Pls. check user-guide for details.
|
||||
|
||||
|
||||
Abstract Plugin Class
|
||||
@@ -249,16 +204,16 @@ strategy must be registered as a named entry point under the
|
||||
pbr_, this entry point should be placed in your ``setup.cfg`` file.
|
||||
|
||||
The name you give to your entry point has to be unique and should be the same
|
||||
as the value returned by the :py:meth:`~.BaseStrategy.get_id` class method of
|
||||
as the value returned by the :py:meth:`~.BaseStrategy.get_name` class method of
|
||||
your strategy.
|
||||
|
||||
Here below is how you would proceed to register ``DummyStrategy`` using pbr_:
|
||||
Here below is how you would proceed to register ``NewStrategy`` using pbr_:
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
[entry_points]
|
||||
watcher_strategies =
|
||||
dummy_strategy = thirdparty.dummy:DummyStrategy
|
||||
new_strategy = thirdparty.new:NewStrategy
|
||||
|
||||
|
||||
To get a better understanding on how to implement a more advanced strategy,
|
||||
@@ -302,7 +257,7 @@ pluggable backend.
|
||||
Finally, if your strategy requires new metrics not covered by Ceilometer, you
|
||||
can add them through a Ceilometer `plugin`_.
|
||||
|
||||
.. _`Helper`: https://github.com/openstack/watcher/blob/master/watcher/metrics_engine/cluster_history/ceilometer.py#L31
|
||||
.. _`Helper`: https://github.com/openstack/watcher/blob/master/watcher/decision_engine/cluster/history/ceilometer.py
|
||||
.. _`Ceilometer developer guide`: http://docs.openstack.org/developer/ceilometer/architecture.html#storing-the-data
|
||||
.. _`here`: http://docs.openstack.org/developer/ceilometer/install/dbreco.html#choosing-a-database-backend
|
||||
.. _`plugin`: http://docs.openstack.org/developer/ceilometer/plugins.html
|
||||
@@ -341,16 +296,15 @@ Read usage metrics using the Watcher Cluster History Helper
|
||||
|
||||
Here below is the abstract ``BaseClusterHistory`` class of the Helper.
|
||||
|
||||
.. autoclass:: watcher.metrics_engine.cluster_history.base.BaseClusterHistory
|
||||
.. autoclass:: watcher.decision_engine.cluster.history.base.BaseClusterHistory
|
||||
:members:
|
||||
:noindex:
|
||||
|
||||
|
||||
The following code snippet shows how to create a Cluster History class:
|
||||
|
||||
.. code-block:: py
|
||||
|
||||
from watcher.metrics_engine.cluster_history import ceilometer as ceil
|
||||
from watcher.decision_engine.cluster.history import ceilometer as ceil
|
||||
|
||||
query_history = ceil.CeilometerClusterHistory()
|
||||
|
||||
@@ -358,7 +312,7 @@ Using that you can now query the values for that specific metric:
|
||||
|
||||
.. code-block:: py
|
||||
|
||||
query_history.statistic_aggregation(resource_id=hypervisor.uuid,
|
||||
query_history.statistic_aggregation(resource_id=compute_node.uuid,
|
||||
meter_name='compute.node.cpu.percent',
|
||||
period="7200",
|
||||
aggregate='avg'
|
||||
|
||||
@@ -13,30 +13,64 @@ In this section we present all the plugins that are shipped along with Watcher.
|
||||
If you want to know which plugins your Watcher services have access to, you can
|
||||
use the :ref:`Guru Meditation Reports <watcher_gmr>` to display them.
|
||||
|
||||
.. _watcher_goals:
|
||||
|
||||
Goals
|
||||
=====
|
||||
|
||||
.. list-plugins:: watcher_goals
|
||||
:detailed:
|
||||
|
||||
.. _watcher_scoring_engines:
|
||||
|
||||
Scoring Engines
|
||||
===============
|
||||
|
||||
.. list-plugins:: watcher_scoring_engines
|
||||
:detailed:
|
||||
|
||||
.. _watcher_scoring_engine_containers:
|
||||
|
||||
Scoring Engine Containers
|
||||
=========================
|
||||
|
||||
.. list-plugins:: watcher_scoring_engine_containers
|
||||
:detailed:
|
||||
|
||||
.. _watcher_strategies:
|
||||
|
||||
Strategies
|
||||
==========
|
||||
|
||||
.. drivers-doc:: watcher_strategies
|
||||
.. list-plugins:: watcher_strategies
|
||||
:detailed:
|
||||
|
||||
.. _watcher_actions:
|
||||
|
||||
Actions
|
||||
=======
|
||||
|
||||
.. drivers-doc:: watcher_actions
|
||||
.. list-plugins:: watcher_actions
|
||||
:detailed:
|
||||
|
||||
.. _watcher_workflow_engines:
|
||||
|
||||
Workflow Engines
|
||||
================
|
||||
|
||||
.. drivers-doc:: watcher_workflow_engines
|
||||
.. list-plugins:: watcher_workflow_engines
|
||||
:detailed:
|
||||
|
||||
.. _watcher_planners:
|
||||
|
||||
Planners
|
||||
========
|
||||
|
||||
.. drivers-doc:: watcher_planners
|
||||
.. list-plugins:: watcher_planners
|
||||
:detailed:
|
||||
|
||||
Cluster Data Model Collectors
|
||||
=============================
|
||||
|
||||
.. list-plugins:: watcher_cluster_data_model_collectors
|
||||
:detailed:
|
||||
|
||||
1
doc/source/dev/rally_link.rst
Normal file
@@ -0,0 +1 @@
|
||||
.. include:: ../../../rally-jobs/README.rst
|
||||
@@ -99,14 +99,14 @@ The :ref:`Cluster <cluster_definition>` may be divided in one or several
|
||||
Cluster Data Model
|
||||
==================
|
||||
|
||||
.. watcher-term:: watcher.metrics_engine.cluster_model_collector.base
|
||||
.. watcher-term:: watcher.decision_engine.model.collector.base
|
||||
|
||||
.. _cluster_history_definition:
|
||||
|
||||
Cluster History
|
||||
===============
|
||||
|
||||
.. watcher-term:: watcher.metrics_engine.cluster_history.base
|
||||
.. watcher-term:: watcher.decision_engine.cluster.history.base
|
||||
|
||||
.. _controller_node_definition:
|
||||
|
||||
@@ -131,7 +131,8 @@ can potentially be hosted on a dedicated machine.
|
||||
Compute node
|
||||
============
|
||||
|
||||
Please, read `the official OpenStack definition of a Compute Node <http://docs.openstack.org/openstack-ops/content/compute_nodes.html>`_.
|
||||
Please, read `the official OpenStack definition of a Compute Node
|
||||
<http://docs.openstack.org/openstack-ops/content/compute_nodes.html>`_.
|
||||
|
||||
.. _customer_definition:
|
||||
|
||||
@@ -211,7 +212,23 @@ Here are some examples of
|
||||
- `Sahara Hadoop Cluster <http://docs.openstack.org/developer/heat/template_guide/openstack.html#OS::Sahara::Cluster>`_
|
||||
- ...
|
||||
|
||||
It can be any of the `the official list of available resource types defined in OpenStack for HEAT <http://docs.openstack.org/developer/heat/template_guide/openstack.html>`_.
|
||||
It can be any of the `the official list of available resource types defined in
|
||||
OpenStack for HEAT
|
||||
<http://docs.openstack.org/developer/heat/template_guide/openstack.html>`_.
|
||||
|
||||
.. _efficacy_indicator_definition:
|
||||
|
||||
Efficacy Indicator
|
||||
==================
|
||||
|
||||
.. watcher-term:: watcher.api.controllers.v1.efficacy_indicator
|
||||
|
||||
.. _efficacy_specification_definition:
|
||||
|
||||
Efficacy Specification
|
||||
======================
|
||||
|
||||
.. watcher-term:: watcher.decision_engine.goal.efficacy.base
|
||||
|
||||
.. _efficacy_definition:
|
||||
|
||||
@@ -234,14 +251,15 @@ to be launched).
|
||||
|
||||
For example, if the :ref:`Goal <goal_definition>` is to lower the energy
|
||||
consumption, the :ref:`Efficacy <efficacy_definition>` will be computed
|
||||
using several indicators (KPIs):
|
||||
using several :ref:`efficacy indicators <efficacy_indicator_definition>`
|
||||
(KPIs):
|
||||
|
||||
- the percentage of energy gain (which must be the highest possible)
|
||||
- the number of :ref:`SLA violations <sla_violation_definition>`
|
||||
(which must be the lowest possible)
|
||||
- the number of virtual machine migrations (which must be the lowest possible)
|
||||
|
||||
All those indicators (KPIs) are computed within a given timeframe, which is the
|
||||
All those indicators are computed within a given timeframe, which is the
|
||||
time taken to execute the whole :ref:`Action Plan <action_plan_definition>`.
|
||||
|
||||
The efficacy also enables the :ref:`Administrator <administrator_definition>`
|
||||
@@ -259,8 +277,15 @@ OpenStack should be owned by a specific :ref:`project <project_definition>`.
|
||||
In OpenStack Identity, a :ref:`project <project_definition>` must be owned by a
|
||||
specific domain.
|
||||
|
||||
Please, read `the official OpenStack definition of a Project <http://docs.openstack.org/glossary/content/glossary.html>`_.
|
||||
Please, read `the official OpenStack definition of a Project
|
||||
<http://docs.openstack.org/glossary/content/glossary.html>`_.
|
||||
|
||||
.. _scoring_engine_definition:
|
||||
|
||||
Scoring Engine
|
||||
==============
|
||||
|
||||
.. watcher-term:: watcher.api.controllers.v1.scoring_engine
|
||||
|
||||
.. _sla_definition:
|
||||
|
||||
@@ -364,4 +389,3 @@ Watcher Planner
|
||||
===============
|
||||
|
||||
.. watcher-term:: watcher.decision_engine.planner.base
|
||||
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
@startuml
|
||||
skinparam maxMessageSize 100
|
||||
|
||||
actor "Administrator"
|
||||
|
||||
== Initialization ==
|
||||
|
||||
"Administrator" -> "Decision Engine" : Start all services
|
||||
"Decision Engine" -> "Background Task Scheduler" : Start
|
||||
|
||||
activate "Background Task Scheduler"
|
||||
"Background Task Scheduler" -> "Cluster Model Collector Loader"\
|
||||
: List available cluster data models
|
||||
"Cluster Model Collector Loader" --> "Background Task Scheduler"\
|
||||
: list of BaseClusterModelCollector instances
|
||||
|
||||
loop for every available cluster data model collector
|
||||
"Background Task Scheduler" -> "Background Task Scheduler"\
|
||||
: add periodic synchronization job
|
||||
create "Jobs Pool"
|
||||
"Background Task Scheduler" -> "Jobs Pool" : Create sync job
|
||||
end
|
||||
deactivate "Background Task Scheduler"
|
||||
|
||||
hnote over "Background Task Scheduler" : Idle
|
||||
|
||||
== Job workflow ==
|
||||
|
||||
"Background Task Scheduler" -> "Jobs Pool" : Trigger synchronization job
|
||||
"Jobs Pool" -> "Nova Cluster Data Model Collector" : synchronize
|
||||
|
||||
activate "Nova Cluster Data Model Collector"
|
||||
"Nova Cluster Data Model Collector" -> "Nova API"\
|
||||
: Fetch needed data to build the cluster data model
|
||||
"Nova API" --> "Nova Cluster Data Model Collector" : Needed data
|
||||
"Nova Cluster Data Model Collector" -> "Nova Cluster Data Model Collector"\
|
||||
: Build an in-memory cluster data model
|
||||
]o<-- "Nova Cluster Data Model Collector" : Done
|
||||
deactivate "Nova Cluster Data Model Collector"
|
||||
|
||||
@enduml
|
||||
@@ -0,0 +1,44 @@
|
||||
@startuml
|
||||
|
||||
skinparam maxMessageSize 200
|
||||
|
||||
"Decision Engine" -> "Decision Engine" : Execute audit
|
||||
activate "Decision Engine"
|
||||
"Decision Engine" -> "Decision Engine" : Set the audit state to ONGOING
|
||||
|
||||
"Decision Engine" -> "Strategy selector" : Select strategy
|
||||
activate "Strategy selector"
|
||||
alt A specific strategy is provided
|
||||
"Strategy selector" -> "Strategy selector" : Load strategy and inject the \
|
||||
cluster data model
|
||||
else Only a goal is specified
|
||||
"Strategy selector" -> "Strategy selector" : select strategy
|
||||
"Strategy selector" -> "Strategy selector" : Load strategy and inject the \
|
||||
cluster data model
|
||||
end
|
||||
"Strategy selector" -> "Decision Engine" : Return loaded Strategy
|
||||
deactivate "Strategy selector"
|
||||
|
||||
"Decision Engine" -> "Strategy" : Execute the strategy
|
||||
activate "Strategy"
|
||||
"Strategy" -> "Strategy" : **pre_execute()**Checks if the strategy \
|
||||
pre-requisites are all set.
|
||||
"Strategy" -> "Strategy" : **do_execute()**Contains the logic of the strategy
|
||||
"Strategy" -> "Strategy" : **post_execute()** Set the efficacy indicators
|
||||
"Strategy" -> "Strategy" : Compute the global efficacy of the solution \
|
||||
based on the provided efficacy indicators
|
||||
"Strategy" -> "Decision Engine" : Return the solution
|
||||
deactivate "Strategy"
|
||||
|
||||
"Decision Engine" -> "Planner" : Plan the solution that was computed by the \
|
||||
strategy
|
||||
activate "Planner"
|
||||
"Planner" -> "Planner" : Store the planned solution as an action plan with its \
|
||||
related actions and efficacy indicators
|
||||
"Planner" --> "Decision Engine" : Done
|
||||
deactivate "Planner"
|
||||
"Decision Engine" -> "Decision Engine" : Update the audit state to SUCCEEDED
|
||||
|
||||
deactivate "Decision Engine"
|
||||
|
||||
@enduml
|
||||
@@ -1,31 +1,50 @@
|
||||
@startuml
|
||||
|
||||
"AMQP Bus" -> "Watcher Decision Engine" : trigger_audit(new_audit.uuid)
|
||||
"Watcher Decision Engine" -> "Watcher Database" : update audit.state = ONGOING
|
||||
"AMQP Bus" <[#blue]- "Watcher Decision Engine" : notify new audit state = ONGOING
|
||||
"Watcher Decision Engine" -> "Watcher Database" : get audit parameters(goal, ...)
|
||||
"Watcher Decision Engine" <-- "Watcher Database" : audit parameters(goal, ...)
|
||||
skinparam maxMessageSize 100
|
||||
|
||||
"AMQP Bus" -> "Decision Engine" : trigger audit
|
||||
|
||||
activate "Decision Engine"
|
||||
|
||||
"Decision Engine" -> "Database" : update audit.state = ONGOING
|
||||
"AMQP Bus" <[#blue]- "Decision Engine" : notify new audit state = ONGOING
|
||||
"Decision Engine" -> "Database" : get audit parameters (goal, strategy, ...)
|
||||
"Decision Engine" <-- "Database" : audit parameters (goal, strategy, ...)
|
||||
"Decision Engine" --> "Decision Engine"\
|
||||
: select appropriate optimization strategy (via the Strategy Selector)
|
||||
create Strategy
|
||||
"Watcher Decision Engine" -[#red]> "Strategy": select appropriate\noptimization strategy
|
||||
loop while enough data to build cluster data model
|
||||
"Watcher Decision Engine" -> "Nova API" : get resource state (host, instance, ...)
|
||||
"Watcher Decision Engine" <-- "Nova API" : resource state
|
||||
end
|
||||
"Watcher Decision Engine" -[#red]> "Watcher Decision Engine": build cluster_data_model
|
||||
"Watcher Decision Engine" -> "Strategy" : execute(cluster_data_model)
|
||||
loop while enough history data for the strategy
|
||||
"Strategy" -> "Ceilometer API": get_aggregated_metrics\n(resource_id,meter_name,period,aggregate_method)
|
||||
"Strategy" <-- "Ceilometer API": aggregated metrics
|
||||
end
|
||||
"Strategy" -> "Strategy" : compute solution to achieve goal
|
||||
"Watcher Decision Engine" <-- "Strategy" : solution = array of actions (i.e. not scheduled yet)
|
||||
create "Watcher Planner"
|
||||
"Watcher Decision Engine" -[#red]> "Watcher Planner": select appropriate actions scheduler (i.e. Planner implementation)
|
||||
"Watcher Decision Engine" -> "Watcher Planner": schedule(audit_id, solution)
|
||||
"Watcher Planner" -> "Watcher Planner": schedule actions according to\nscheduling rules/policies
|
||||
"Watcher Decision Engine" <-- "Watcher Planner": new action_plan
|
||||
"Watcher Decision Engine" -> "Watcher Database" : save new action_plan in database
|
||||
"Watcher Decision Engine" -> "Watcher Database" : update audit.state = SUCCEEDED
|
||||
"AMQP Bus" <[#blue]- "Watcher Decision Engine" : notify new audit state = SUCCEEDED
|
||||
"Decision Engine" -> "Strategy" : execute strategy
|
||||
activate "Strategy"
|
||||
"Strategy" -> "Cluster Data Model Collector" : get cluster data model
|
||||
"Cluster Data Model Collector" --> "Strategy"\
|
||||
: copy of the in-memory cluster data model
|
||||
loop while enough history data for the strategy
|
||||
"Strategy" -> "Ceilometer API" : get necessary metrics
|
||||
"Strategy" <-- "Ceilometer API" : aggregated metrics
|
||||
end
|
||||
"Strategy" -> "Strategy"\
|
||||
: compute/set needed actions for the solution so it achieves its goal
|
||||
"Strategy" -> "Strategy" : compute/set efficacy indicators for the solution
|
||||
"Strategy" -> "Strategy" : compute/set the solution global efficacy
|
||||
"Decision Engine" <-- "Strategy"\
|
||||
: solution (unordered actions, efficacy indicators and global efficacy)
|
||||
deactivate "Strategy"
|
||||
|
||||
create "Planner"
|
||||
"Decision Engine" -> "Planner" : load actions scheduler
|
||||
"Planner" --> "Decision Engine" : planner plugin
|
||||
"Decision Engine" -> "Planner" : schedule actions
|
||||
activate "Planner"
|
||||
"Planner" -> "Planner"\
|
||||
: schedule actions according to scheduling rules/policies
|
||||
"Decision Engine" <-- "Planner" : new action plan
|
||||
deactivate "Planner"
|
||||
"Decision Engine" -> "Database" : save new action plan in database
|
||||
"Decision Engine" -> "Database" : update audit.state = SUCCEEDED
|
||||
"AMQP Bus" <[#blue]- "Decision Engine" : notify new audit state = SUCCEEDED
|
||||
|
||||
deactivate "Decision Engine"
|
||||
|
||||
hnote over "Decision Engine" : Idle
|
||||
|
||||
@enduml
|
||||
|
||||
@@ -1,87 +0,0 @@
|
||||
@startuml
|
||||
|
||||
abstract class Base {
|
||||
// Timestamp mixin
|
||||
DateTime created_at
|
||||
DateTime updated_at
|
||||
|
||||
// Soft Delete mixin
|
||||
DateTime deleted_at
|
||||
Integer deleted // default = 0
|
||||
}
|
||||
|
||||
class Strategy {
|
||||
**Integer id** // primary_key
|
||||
String uuid // length = 36
|
||||
String name // length = 63, nullable = false
|
||||
String display_name // length = 63, nullable = false
|
||||
<i>Integer goal_id</i> // ForeignKey('goals.id'), nullable = false
|
||||
}
|
||||
|
||||
|
||||
class Goal {
|
||||
**Integer id** // primary_key
|
||||
String uuid // length = 36
|
||||
String name // length = 63, nullable = false
|
||||
String display_name // length = 63, nullable=False
|
||||
}
|
||||
|
||||
|
||||
class AuditTemplate {
|
||||
**Integer id** // primary_key
|
||||
String uuid // length = 36
|
||||
String name // length = 63, nullable = true
|
||||
String description // length = 255, nullable = true
|
||||
Integer host_aggregate // nullable = true
|
||||
<i>Integer goal_id</i> // ForeignKey('goals.id'), nullable = false
|
||||
<i>Integer strategy_id</i> // ForeignKey('strategies.id'), nullable = true
|
||||
JsonString extra
|
||||
String version // length = 15, nullable = true
|
||||
}
|
||||
|
||||
|
||||
class Audit {
|
||||
**Integer id** // primary_key
|
||||
String uuid // length = 36
|
||||
String type // length = 20
|
||||
String state // length = 20, nullable = true
|
||||
DateTime deadline // nullable = true
|
||||
<i>Integer audit_template_id</i> // ForeignKey('audit_templates.id') \
|
||||
nullable = false
|
||||
}
|
||||
|
||||
|
||||
class Action {
|
||||
**Integer id** // primary_key
|
||||
String uuid // length = 36, nullable = false
|
||||
<i>Integer action_plan_id</i> // ForeignKey('action_plans.id'), nullable = false
|
||||
String action_type // length = 255, nullable = false
|
||||
JsonString input_parameters // nullable = true
|
||||
String state // length = 20, nullable = true
|
||||
String next // length = 36, nullable = true
|
||||
}
|
||||
|
||||
|
||||
class ActionPlan {
|
||||
**Integer id** // primary_key
|
||||
String uuid // length = 36
|
||||
Integer first_action_id //
|
||||
<i>Integer audit_id</i> // ForeignKey('audits.id'), nullable = true
|
||||
String state // length = 20, nullable = true
|
||||
}
|
||||
|
||||
"Base" <|-- "Strategy"
|
||||
"Base" <|-- "Goal"
|
||||
"Base" <|-- "AuditTemplate"
|
||||
"Base" <|-- "Audit"
|
||||
"Base" <|-- "Action"
|
||||
"Base" <|-- "ActionPlan"
|
||||
|
||||
"Goal" <.. "Strategy" : Foreign Key
|
||||
"Goal" <.. "AuditTemplate" : Foreign Key
|
||||
"Strategy" <.. "AuditTemplate" : Foreign Key
|
||||
"AuditTemplate" <.. "Audit" : Foreign Key
|
||||
"ActionPlan" <.. "Action" : Foreign Key
|
||||
"Audit" <.. "ActionPlan" : Foreign Key
|
||||
|
||||
@enduml
|
||||
144
doc/source/image_src/plantuml/watcher_db_schema_diagram.txt
Normal file
@@ -0,0 +1,144 @@
|
||||
@startuml
|
||||
!define table(x) class x << (T,#FFAAAA) >>
|
||||
!define primary_key(x) <u>x</u>
|
||||
!define foreign_key(x) <i><u>x</u></i>
|
||||
hide methods
|
||||
hide stereotypes
|
||||
|
||||
table(goals) {
|
||||
primary_key(id: Integer)
|
||||
uuid : String[36]
|
||||
name : String[63]
|
||||
display_name : String[63]
|
||||
efficacy_specification : JSONEncodedList, nullable
|
||||
|
||||
created_at : DateTime
|
||||
updated_at : DateTime
|
||||
deleted_at : DateTime
|
||||
deleted : Integer
|
||||
}
|
||||
|
||||
|
||||
table(strategies) {
|
||||
primary_key(id: Integer)
|
||||
foreign_key(goal_id : Integer)
|
||||
uuid : String[36]
|
||||
name : String[63]
|
||||
display_name : String[63]
|
||||
parameters_spec : JSONEncodedDict, nullable
|
||||
|
||||
created_at : DateTime
|
||||
updated_at : DateTime
|
||||
deleted_at : DateTime
|
||||
deleted : Integer
|
||||
}
|
||||
|
||||
|
||||
table(audit_templates) {
|
||||
primary_key(id: Integer)
|
||||
foreign_key("goal_id : Integer")
|
||||
foreign_key("strategy_id : Integer, nullable")
|
||||
uuid : String[36]
|
||||
name : String[63], nullable
|
||||
description : String[255], nullable
|
||||
host_aggregate : Integer, nullable
|
||||
extra : JSONEncodedDict
|
||||
version : String[15], nullable
|
||||
|
||||
created_at : DateTime
|
||||
updated_at : DateTime
|
||||
deleted_at : DateTime
|
||||
deleted : Integer
|
||||
}
|
||||
|
||||
|
||||
table(audits) {
|
||||
primary_key(id: Integer)
|
||||
foreign_key("goal_id : Integer")
|
||||
foreign_key("strategy_id : Integer, nullable")
|
||||
uuid : String[36]
|
||||
audit_type : String[20]
|
||||
state : String[20], nullable
|
||||
deadline : DateTime, nullable
|
||||
interval : Integer, nullable
|
||||
parameters : JSONEncodedDict, nullable
|
||||
host_aggregate : Integer, nullable
|
||||
|
||||
created_at : DateTime
|
||||
updated_at : DateTime
|
||||
deleted_at : DateTime
|
||||
deleted : Integer
|
||||
}
|
||||
|
||||
|
||||
table(action_plans) {
|
||||
primary_key(id: Integer)
|
||||
foreign_key("audit_id : Integer, nullable")
|
||||
foreign_key("strategy_id : Integer")
|
||||
uuid : String[36]
|
||||
first_action_id : Integer
|
||||
state : String[20], nullable
|
||||
global_efficacy : JSONEncodedDict, nullable
|
||||
|
||||
created_at : DateTime
|
||||
updated_at : DateTime
|
||||
deleted_at : DateTime
|
||||
deleted : Integer
|
||||
}
|
||||
|
||||
|
||||
table(actions) {
|
||||
primary_key(id: Integer)
|
||||
foreign_key("action_plan_id : Integer")
|
||||
uuid : String[36]
|
||||
action_type : String[255]
|
||||
input_parameters : JSONEncodedDict, nullable
|
||||
state : String[20], nullable
|
||||
next : String[36], nullable
|
||||
|
||||
created_at : DateTime
|
||||
updated_at : DateTime
|
||||
deleted_at : DateTime
|
||||
deleted : Integer
|
||||
}
|
||||
|
||||
|
||||
table(efficacy_indicators) {
|
||||
primary_key(id: Integer)
|
||||
foreign_key("action_plan_id : Integer")
|
||||
uuid : String[36]
|
||||
name : String[63]
|
||||
description : String[255], nullable
|
||||
unit : String[63], nullable
|
||||
value : Numeric
|
||||
|
||||
created_at : DateTime
|
||||
updated_at : DateTime
|
||||
deleted_at : DateTime
|
||||
deleted : Integer
|
||||
}
|
||||
|
||||
table(scoring_engines) {
|
||||
primary_key(id: Integer)
|
||||
uuid : String[36]
|
||||
name : String[63]
|
||||
description : String[255], nullable
|
||||
metainfo : Text, nullable
|
||||
|
||||
created_at : DateTime
|
||||
updated_at : DateTime
|
||||
deleted_at : DateTime
|
||||
deleted : Integer
|
||||
}
|
||||
|
||||
"goals" <.. "strategies" : Foreign Key
|
||||
"goals" <.. "audit_templates" : Foreign Key
|
||||
"strategies" <.. "audit_templates" : Foreign Key
|
||||
"goals" <.. "audits" : Foreign Key
|
||||
"strategies" <.. "audits" : Foreign Key
|
||||
"action_plans" <.. "actions" : Foreign Key
|
||||
"action_plans" <.. "efficacy_indicators" : Foreign Key
|
||||
"strategies" <.. "action_plans" : Foreign Key
|
||||
"audits" <.. "action_plans" : Foreign Key
|
||||
|
||||
@enduml
|
||||
@@ -1,139 +1,600 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/PR-SVG-20010719/DTD/svg10.dtd">
|
||||
<svg width="58cm" height="28cm" viewBox="26 8 1147 549" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g>
|
||||
<rect style="fill: #ffffff" x="570" y="99" width="148.6" height="28"/>
|
||||
<rect style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" x="570" y="99" width="148.6" height="28"/>
|
||||
<text font-size="16" style="fill: #000000;text-anchor:middle;font-family:sans-serif;font-style:normal;font-weight:700" x="644.3" y="118">Audit Template</text>
|
||||
</g>
|
||||
<g>
|
||||
<rect style="fill: #ffffff" x="212" y="140" width="177.5" height="28"/>
|
||||
<rect style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" x="212" y="140" width="177.5" height="28"/>
|
||||
<text font-size="16" style="fill: #000000;text-anchor:middle;font-family:sans-serif;font-style:normal;font-weight:700" x="300.75" y="159">OpenStack Cluster</text>
|
||||
</g>
|
||||
<g>
|
||||
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 8; stroke: #000000" points="569.006,113 446,113 446,154 397.19,154 "/>
|
||||
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="409.838,149 393.838,154 409.838,159 "/>
|
||||
<text font-size="12.7998" style="fill: #000000;text-anchor:start;font-family:monospace;font-style:normal;font-weight:normal" x="448" y="130.5">Applies to</text>
|
||||
</g>
|
||||
<g>
|
||||
<rect style="fill: #ffffff" x="615" y="227" width="58.4" height="28"/>
|
||||
<rect style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" x="615" y="227" width="58.4" height="28"/>
|
||||
<text font-size="16" style="fill: #000000;text-anchor:middle;font-family:sans-serif;font-style:normal;font-weight:700" x="644.2" y="246">Audit</text>
|
||||
</g>
|
||||
<g>
|
||||
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 8; stroke: #000000" points="644.2,225.996 644.2,188.497 644.3,188.497 644.3,133.705 "/>
|
||||
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="649.3,146.353 644.3,130.353 639.3,146.353 "/>
|
||||
<text font-size="12.7998" style="fill: #000000;text-anchor:middle;font-family:monospace;font-style:normal;font-weight:normal" x="644.25" y="185.497">gets configuration from</text>
|
||||
</g>
|
||||
<g>
|
||||
<rect style="fill: #ffffff" x="916" y="9" width="50.45" height="28"/>
|
||||
<rect style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" x="916" y="9" width="50.45" height="28"/>
|
||||
<text font-size="16" style="fill: #000000;text-anchor:middle;font-family:sans-serif;font-style:normal;font-weight:700" x="941.225" y="28">Goal</text>
|
||||
</g>
|
||||
<g>
|
||||
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 8; stroke: #000000" points="644.3,97.9927 644.3,72 941.225,72 941.225,44.7125 "/>
|
||||
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="946.225,57.3599 941.225,41.3599 936.225,57.3599 "/>
|
||||
<text font-size="12.7998" style="fill: #000000;text-anchor:middle;font-family:monospace;font-style:normal;font-weight:normal" x="792.763" y="69">Achieves</text>
|
||||
</g>
|
||||
<g>
|
||||
<rect style="fill: #ffffff" x="495" y="367" width="112.45" height="28"/>
|
||||
<rect style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" x="495" y="367" width="112.45" height="28"/>
|
||||
<text font-size="16" style="fill: #000000;text-anchor:middle;font-family:sans-serif;font-style:normal;font-weight:700" x="551.225" y="386">Action Plan</text>
|
||||
</g>
|
||||
<g>
|
||||
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 8; stroke: #000000" points="644.2,256 644.2,298.5 523,298.5 523,356.295 "/>
|
||||
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="518,343.647 523,359.647 528,343.647 "/>
|
||||
<text font-size="12.7998" style="fill: #000000;text-anchor:middle;font-family:monospace;font-style:normal;font-weight:normal" x="583.6" y="295.5">Generates</text>
|
||||
</g>
|
||||
<g>
|
||||
<rect style="fill: #ffffff" x="682" y="471" width="67.45" height="28"/>
|
||||
<rect style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" x="682" y="471" width="67.45" height="28"/>
|
||||
<text font-size="16" style="fill: #000000;text-anchor:middle;font-family:sans-serif;font-style:normal;font-weight:700" x="715.725" y="490">Action</text>
|
||||
</g>
|
||||
<g>
|
||||
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="551.225,420.945 551.225,443 715.725,443 715.725,470.029 "/>
|
||||
<polygon style="fill: #000000" points="551.225,395.773 556.025,409.773 551.225,423.773 546.425,409.773 "/>
|
||||
<polygon style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="551.225,395.773 556.025,409.773 551.225,423.773 546.425,409.773 "/>
|
||||
<text font-size="12.7998" style="fill: #000000;text-anchor:middle;font-family:monospace;font-style:normal;font-weight:normal" x="633.475" y="440">is composed of</text>
|
||||
<text font-size="12.7998" style="fill: #000000;text-anchor:start;font-family:monospace;font-style:normal;font-weight:normal" x="562.225" y="407.773"></text>
|
||||
<text font-size="12.7998" style="fill: #000000;text-anchor:start;font-family:monospace;font-style:normal;font-weight:normal" x="719.725" y="466.029"></text>
|
||||
</g>
|
||||
<g>
|
||||
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="749.45,499 749.45,517 862,517 862,485 749.45,485 "/>
|
||||
<text font-size="12.7998" style="fill: #000000;text-anchor:middle;font-family:monospace;font-style:normal;font-weight:normal" x="805.725" y="514">Next action</text>
|
||||
<polygon style="fill: #000000" points="850.075,514 850.075,506 858.075,510 "/>
|
||||
<text font-size="12.7998" style="fill: #000000;text-anchor:start;font-family:monospace;font-style:normal;font-weight:normal" x="753.45" y="511"></text>
|
||||
<text font-size="12.7998" style="fill: #000000;text-anchor:start;font-family:monospace;font-style:normal;font-weight:normal" x="753.45" y="482"></text>
|
||||
</g>
|
||||
<g>
|
||||
<ellipse style="fill: #ffffff" cx="1036" cy="219" rx="6" ry="6"/>
|
||||
<ellipse style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #ff0000" cx="1036" cy="219" rx="6" ry="6"/>
|
||||
<line style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #ff0000" x1="1012" y1="231" x2="1060" y2="231"/>
|
||||
<line style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #ff0000" x1="1036" y1="225" x2="1036" y2="255"/>
|
||||
<line style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #ff0000" x1="1036" y1="255" x2="1012" y2="281"/>
|
||||
<line style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #ff0000" x1="1036" y1="255" x2="1060" y2="281"/>
|
||||
<text font-size="12.8" style="fill: #ff0000;text-anchor:middle;font-family:sans-serif;font-style:normal;font-weight:700" x="1036" y="304.9">
|
||||
<tspan x="1036" y="304.9">Administrator</tspan>
|
||||
</text>
|
||||
</g>
|
||||
<g>
|
||||
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 8; stroke: #000000" points="985.869,255 834.138,255 834.138,241 681.113,241 "/>
|
||||
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="693.76,236 677.76,241 693.76,246 "/>
|
||||
<text font-size="12.7998" style="fill: #000000;text-anchor:start;font-family:monospace;font-style:normal;font-weight:normal" x="836.138" y="245">Triggers</text>
|
||||
</g>
|
||||
<g>
|
||||
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 8; stroke: #000000" points="1038,192.993 882.3,192.993 882.3,113 725.305,113 "/>
|
||||
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="737.953,108 721.953,113 737.953,118 "/>
|
||||
<text font-size="12.7998" style="fill: #000000;text-anchor:start;font-family:monospace;font-style:normal;font-weight:normal" x="884.3" y="149.997">Defines Audit configuration in</text>
|
||||
</g>
|
||||
<g>
|
||||
<ellipse style="fill: #ffffff" cx="103" cy="28" rx="6" ry="6"/>
|
||||
<ellipse style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #ff0000" cx="103" cy="28" rx="6" ry="6"/>
|
||||
<line style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #ff0000" x1="79" y1="40" x2="127" y2="40"/>
|
||||
<line style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #ff0000" x1="103" y1="34" x2="103" y2="64"/>
|
||||
<line style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #ff0000" x1="103" y1="64" x2="79" y2="90"/>
|
||||
<line style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #ff0000" x1="103" y1="64" x2="127" y2="90"/>
|
||||
<text font-size="12.8" style="fill: #ff0000;text-anchor:middle;font-family:sans-serif;font-style:normal;font-weight:700" x="103" y="113.9">
|
||||
<tspan x="103" y="113.9">Customer</tspan>
|
||||
</text>
|
||||
</g>
|
||||
<g>
|
||||
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 8; stroke: #000000" points="137.683,64 300.75,64 300.75,133.295 "/>
|
||||
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="295.75,120.647 300.75,136.647 305.75,120.647 "/>
|
||||
<text font-size="12.7998" style="fill: #000000;text-anchor:middle;font-family:monospace;font-style:normal;font-weight:normal" x="219.217" y="61">Consumes resources</text>
|
||||
</g>
|
||||
<g>
|
||||
<rect style="fill: #ffffff" x="27" y="258" width="102.8" height="28"/>
|
||||
<rect style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" x="27" y="258" width="102.8" height="28"/>
|
||||
<text font-size="16" style="fill: #000000;text-anchor:middle;font-family:sans-serif;font-style:normal;font-weight:700" x="78.4" y="277">Resources</text>
|
||||
</g>
|
||||
<g>
|
||||
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="186.828,154 78.4,154 78.4,258 "/>
|
||||
<polygon style="fill: #000000" points="212,154 198,158.8 184,154 198,149.2 "/>
|
||||
<polygon style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="212,154 198,158.8 184,154 198,149.2 "/>
|
||||
<text font-size="12.7998" style="fill: #000000;text-anchor:middle;font-family:monospace;font-style:normal;font-weight:normal" x="145.2" y="151"></text>
|
||||
<text font-size="12.7998" style="fill: #000000;text-anchor:end;font-family:monospace;font-style:normal;font-weight:normal" x="180" y="151"></text>
|
||||
<text font-size="12.7998" style="fill: #000000;text-anchor:start;font-family:monospace;font-style:normal;font-weight:normal" x="82.4" y="254"></text>
|
||||
</g>
|
||||
<g>
|
||||
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 8; stroke: #000000" points="715.724,499 715.724,540 78.4,540 78.4,292.705 "/>
|
||||
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="83.4,305.353 78.4,289.353 73.4,305.353 "/>
|
||||
<text font-size="12.7998" style="fill: #000000;text-anchor:middle;font-family:monospace;font-style:normal;font-weight:normal" x="397.062" y="537">Modifies</text>
|
||||
</g>
|
||||
<g>
|
||||
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 8; stroke: #000000" points="1036,309.94 1036,381 614.155,381 "/>
|
||||
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="626.803,376 610.803,381 626.803,386 "/>
|
||||
<text font-size="12.7998" style="fill: #000000;text-anchor:middle;font-family:monospace;font-style:normal;font-weight:normal" x="821.725" y="378">Launches</text>
|
||||
</g>
|
||||
<g>
|
||||
<rect style="fill: #ffffff" x="1082.9" y="43.1" width="88.25" height="28"/>
|
||||
<rect style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" x="1082.9" y="43.1" width="88.25" height="28"/>
|
||||
<text font-size="16" style="fill: #000000;text-anchor:middle;font-family:sans-serif;font-style:normal;font-weight:700" x="1127.02" y="62.1">Strategy</text>
|
||||
</g>
|
||||
<g>
|
||||
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 8; stroke: #000000" points="966.45,23 1020.17,23 1020.17,57.1 1075.22,57.1 "/>
|
||||
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="1062.57,62.1 1078.57,57.1 1062.57,52.1 "/>
|
||||
<text font-size="12.7998" style="fill: #000000;text-anchor:start;font-family:monospace;font-style:normal;font-weight:normal" x="1022.17" y="37.05">uses</text>
|
||||
</g>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1146pt" height="548pt" viewBox="0 0 1146 548" version="1.1">
|
||||
<defs>
|
||||
<g>
|
||||
<symbol overflow="visible" id="glyph0-0">
|
||||
<path style="stroke:none;" d="M 0.796875 2.828125 L 0.796875 -11.28125 L 8.796875 -11.28125 L 8.796875 2.828125 Z M 1.703125 1.9375 L 7.90625 1.9375 L 7.90625 -10.390625 L 1.703125 -10.390625 Z M 1.703125 1.9375 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph0-1">
|
||||
<path style="stroke:none;" d="M 8.546875 -2.125 L 3.84375 -2.125 L 3.109375 0 L 0.078125 0 L 4.40625 -11.671875 L 7.984375 -11.671875 L 12.3125 0 L 9.28125 0 Z M 4.59375 -4.296875 L 7.796875 -4.296875 L 6.203125 -8.9375 Z M 4.59375 -4.296875 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph0-2">
|
||||
<path style="stroke:none;" d="M 1.25 -3.40625 L 1.25 -8.75 L 4.0625 -8.75 L 4.0625 -7.875 C 4.0625 -7.40625 4.054688 -6.8125 4.046875 -6.09375 C 4.046875 -5.375 4.046875 -4.894531 4.046875 -4.65625 C 4.046875 -3.957031 4.0625 -3.453125 4.09375 -3.140625 C 4.132812 -2.828125 4.203125 -2.601562 4.296875 -2.46875 C 4.410156 -2.28125 4.554688 -2.132812 4.734375 -2.03125 C 4.921875 -1.9375 5.132812 -1.890625 5.375 -1.890625 C 5.957031 -1.890625 6.414062 -2.113281 6.75 -2.5625 C 7.082031 -3.007812 7.25 -3.632812 7.25 -4.4375 L 7.25 -8.75 L 10.046875 -8.75 L 10.046875 0 L 7.25 0 L 7.25 -1.265625 C 6.832031 -0.753906 6.382812 -0.375 5.90625 -0.125 C 5.4375 0.113281 4.921875 0.234375 4.359375 0.234375 C 3.347656 0.234375 2.578125 -0.078125 2.046875 -0.703125 C 1.515625 -1.328125 1.25 -2.226562 1.25 -3.40625 Z M 1.25 -3.40625 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph0-3">
|
||||
<path style="stroke:none;" d="M 7.296875 -7.46875 L 7.296875 -12.15625 L 10.109375 -12.15625 L 10.109375 0 L 7.296875 0 L 7.296875 -1.265625 C 6.910156 -0.753906 6.484375 -0.375 6.015625 -0.125 C 5.554688 0.113281 5.023438 0.234375 4.421875 0.234375 C 3.335938 0.234375 2.445312 -0.191406 1.75 -1.046875 C 1.0625 -1.910156 0.71875 -3.019531 0.71875 -4.375 C 0.71875 -5.71875 1.0625 -6.816406 1.75 -7.671875 C 2.445312 -8.535156 3.335938 -8.96875 4.421875 -8.96875 C 5.023438 -8.96875 5.554688 -8.84375 6.015625 -8.59375 C 6.484375 -8.351562 6.910156 -7.976562 7.296875 -7.46875 Z M 5.453125 -1.8125 C 6.054688 -1.8125 6.515625 -2.03125 6.828125 -2.46875 C 7.140625 -2.90625 7.296875 -3.539062 7.296875 -4.375 C 7.296875 -5.207031 7.140625 -5.84375 6.828125 -6.28125 C 6.515625 -6.71875 6.054688 -6.9375 5.453125 -6.9375 C 4.859375 -6.9375 4.40625 -6.71875 4.09375 -6.28125 C 3.78125 -5.84375 3.625 -5.207031 3.625 -4.375 C 3.625 -3.539062 3.78125 -2.90625 4.09375 -2.46875 C 4.40625 -2.03125 4.859375 -1.8125 5.453125 -1.8125 Z M 5.453125 -1.8125 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph0-4">
|
||||
<path style="stroke:none;" d="M 1.34375 -8.75 L 4.140625 -8.75 L 4.140625 0 L 1.34375 0 Z M 1.34375 -12.15625 L 4.140625 -12.15625 L 4.140625 -9.875 L 1.34375 -9.875 Z M 1.34375 -12.15625 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph0-5">
|
||||
<path style="stroke:none;" d="M 4.40625 -11.234375 L 4.40625 -8.75 L 7.28125 -8.75 L 7.28125 -6.75 L 4.40625 -6.75 L 4.40625 -3.046875 C 4.40625 -2.640625 4.484375 -2.363281 4.640625 -2.21875 C 4.804688 -2.070312 5.128906 -2 5.609375 -2 L 7.046875 -2 L 7.046875 0 L 4.640625 0 C 3.535156 0 2.753906 -0.226562 2.296875 -0.6875 C 1.835938 -1.15625 1.609375 -1.941406 1.609375 -3.046875 L 1.609375 -6.75 L 0.21875 -6.75 L 0.21875 -8.75 L 1.609375 -8.75 L 1.609375 -11.234375 Z M 4.40625 -11.234375 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph0-6">
|
||||
<path style="stroke:none;" d=""/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph0-7">
|
||||
<path style="stroke:none;" d="M 0.078125 -11.671875 L 10.828125 -11.671875 L 10.828125 -9.390625 L 6.96875 -9.390625 L 6.96875 0 L 3.953125 0 L 3.953125 -9.390625 L 0.078125 -9.390625 Z M 0.078125 -11.671875 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph0-8">
|
||||
<path style="stroke:none;" d="M 10.078125 -4.40625 L 10.078125 -3.609375 L 3.546875 -3.609375 C 3.609375 -2.953125 3.84375 -2.457031 4.25 -2.125 C 4.65625 -1.800781 5.222656 -1.640625 5.953125 -1.640625 C 6.546875 -1.640625 7.148438 -1.722656 7.765625 -1.890625 C 8.378906 -2.066406 9.015625 -2.332031 9.671875 -2.6875 L 9.671875 -0.53125 C 9.003906 -0.28125 8.335938 -0.09375 7.671875 0.03125 C 7.015625 0.164062 6.359375 0.234375 5.703125 0.234375 C 4.117188 0.234375 2.882812 -0.164062 2 -0.96875 C 1.125 -1.78125 0.6875 -2.914062 0.6875 -4.375 C 0.6875 -5.800781 1.117188 -6.921875 1.984375 -7.734375 C 2.847656 -8.554688 4.035156 -8.96875 5.546875 -8.96875 C 6.921875 -8.96875 8.019531 -8.550781 8.84375 -7.71875 C 9.664062 -6.894531 10.078125 -5.789062 10.078125 -4.40625 Z M 7.203125 -5.328125 C 7.203125 -5.859375 7.046875 -6.285156 6.734375 -6.609375 C 6.429688 -6.941406 6.03125 -7.109375 5.53125 -7.109375 C 4.988281 -7.109375 4.546875 -6.953125 4.203125 -6.640625 C 3.867188 -6.335938 3.660156 -5.898438 3.578125 -5.328125 Z M 7.203125 -5.328125 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph0-9">
|
||||
<path style="stroke:none;" d="M 9.453125 -7.296875 C 9.804688 -7.835938 10.226562 -8.25 10.71875 -8.53125 C 11.207031 -8.820312 11.742188 -8.96875 12.328125 -8.96875 C 13.328125 -8.96875 14.085938 -8.65625 14.609375 -8.03125 C 15.140625 -7.414062 15.40625 -6.515625 15.40625 -5.328125 L 15.40625 0 L 12.59375 0 L 12.59375 -4.5625 C 12.601562 -4.632812 12.609375 -4.707031 12.609375 -4.78125 C 12.609375 -4.851562 12.609375 -4.957031 12.609375 -5.09375 C 12.609375 -5.707031 12.515625 -6.15625 12.328125 -6.4375 C 12.148438 -6.71875 11.859375 -6.859375 11.453125 -6.859375 C 10.921875 -6.859375 10.507812 -6.640625 10.21875 -6.203125 C 9.9375 -5.765625 9.789062 -5.128906 9.78125 -4.296875 L 9.78125 0 L 6.96875 0 L 6.96875 -4.5625 C 6.96875 -5.53125 6.882812 -6.15625 6.71875 -6.4375 C 6.550781 -6.71875 6.253906 -6.859375 5.828125 -6.859375 C 5.285156 -6.859375 4.867188 -6.632812 4.578125 -6.1875 C 4.285156 -5.75 4.140625 -5.125 4.140625 -4.3125 L 4.140625 0 L 1.328125 0 L 1.328125 -8.75 L 4.140625 -8.75 L 4.140625 -7.46875 C 4.484375 -7.96875 4.878906 -8.34375 5.328125 -8.59375 C 5.773438 -8.84375 6.265625 -8.96875 6.796875 -8.96875 C 7.398438 -8.96875 7.929688 -8.820312 8.390625 -8.53125 C 8.859375 -8.238281 9.210938 -7.828125 9.453125 -7.296875 Z M 9.453125 -7.296875 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph0-10">
|
||||
<path style="stroke:none;" d="M 4.140625 -1.265625 L 4.140625 3.328125 L 1.34375 3.328125 L 1.34375 -8.75 L 4.140625 -8.75 L 4.140625 -7.46875 C 4.523438 -7.976562 4.953125 -8.351562 5.421875 -8.59375 C 5.890625 -8.84375 6.429688 -8.96875 7.046875 -8.96875 C 8.117188 -8.96875 9 -8.535156 9.6875 -7.671875 C 10.382812 -6.816406 10.734375 -5.71875 10.734375 -4.375 C 10.734375 -3.019531 10.382812 -1.910156 9.6875 -1.046875 C 9 -0.191406 8.117188 0.234375 7.046875 0.234375 C 6.429688 0.234375 5.890625 0.113281 5.421875 -0.125 C 4.953125 -0.375 4.523438 -0.753906 4.140625 -1.265625 Z M 6 -6.9375 C 5.40625 -6.9375 4.945312 -6.710938 4.625 -6.265625 C 4.300781 -5.828125 4.140625 -5.195312 4.140625 -4.375 C 4.140625 -3.539062 4.300781 -2.90625 4.625 -2.46875 C 4.945312 -2.03125 5.40625 -1.8125 6 -1.8125 C 6.601562 -1.8125 7.0625 -2.03125 7.375 -2.46875 C 7.6875 -2.90625 7.84375 -3.539062 7.84375 -4.375 C 7.84375 -5.207031 7.6875 -5.84375 7.375 -6.28125 C 7.0625 -6.71875 6.601562 -6.9375 6 -6.9375 Z M 6 -6.9375 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph0-11">
|
||||
<path style="stroke:none;" d="M 1.34375 -12.15625 L 4.140625 -12.15625 L 4.140625 0 L 1.34375 0 Z M 1.34375 -12.15625 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph0-12">
|
||||
<path style="stroke:none;" d="M 5.265625 -3.9375 C 4.679688 -3.9375 4.242188 -3.835938 3.953125 -3.640625 C 3.660156 -3.441406 3.515625 -3.148438 3.515625 -2.765625 C 3.515625 -2.410156 3.628906 -2.132812 3.859375 -1.9375 C 4.097656 -1.738281 4.429688 -1.640625 4.859375 -1.640625 C 5.378906 -1.640625 5.816406 -1.828125 6.171875 -2.203125 C 6.535156 -2.578125 6.71875 -3.050781 6.71875 -3.625 L 6.71875 -3.9375 Z M 9.546875 -5 L 9.546875 0 L 6.71875 0 L 6.71875 -1.296875 C 6.34375 -0.765625 5.921875 -0.375 5.453125 -0.125 C 4.984375 0.113281 4.414062 0.234375 3.75 0.234375 C 2.84375 0.234375 2.101562 -0.03125 1.53125 -0.5625 C 0.96875 -1.09375 0.6875 -1.78125 0.6875 -2.625 C 0.6875 -3.65625 1.039062 -4.410156 1.75 -4.890625 C 2.457031 -5.367188 3.566406 -5.609375 5.078125 -5.609375 L 6.71875 -5.609375 L 6.71875 -5.828125 C 6.71875 -6.265625 6.539062 -6.585938 6.1875 -6.796875 C 5.84375 -7.003906 5.300781 -7.109375 4.5625 -7.109375 C 3.96875 -7.109375 3.410156 -7.046875 2.890625 -6.921875 C 2.378906 -6.804688 1.898438 -6.628906 1.453125 -6.390625 L 1.453125 -8.515625 C 2.054688 -8.660156 2.660156 -8.769531 3.265625 -8.84375 C 3.867188 -8.925781 4.472656 -8.96875 5.078125 -8.96875 C 6.648438 -8.96875 7.785156 -8.65625 8.484375 -8.03125 C 9.191406 -7.40625 9.546875 -6.394531 9.546875 -5 Z M 9.546875 -5 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph0-13">
|
||||
<path style="stroke:none;" d="M 6.796875 -9.703125 C 5.878906 -9.703125 5.164062 -9.363281 4.65625 -8.6875 C 4.15625 -8.007812 3.90625 -7.054688 3.90625 -5.828125 C 3.90625 -4.597656 4.15625 -3.644531 4.65625 -2.96875 C 5.164062 -2.289062 5.878906 -1.953125 6.796875 -1.953125 C 7.722656 -1.953125 8.4375 -2.289062 8.9375 -2.96875 C 9.445312 -3.644531 9.703125 -4.597656 9.703125 -5.828125 C 9.703125 -7.054688 9.445312 -8.007812 8.9375 -8.6875 C 8.4375 -9.363281 7.722656 -9.703125 6.796875 -9.703125 Z M 6.796875 -11.875 C 8.671875 -11.875 10.140625 -11.335938 11.203125 -10.265625 C 12.265625 -9.191406 12.796875 -7.710938 12.796875 -5.828125 C 12.796875 -3.941406 12.265625 -2.457031 11.203125 -1.375 C 10.140625 -0.300781 8.671875 0.234375 6.796875 0.234375 C 4.929688 0.234375 3.460938 -0.300781 2.390625 -1.375 C 1.328125 -2.457031 0.796875 -3.941406 0.796875 -5.828125 C 0.796875 -7.710938 1.328125 -9.191406 2.390625 -10.265625 C 3.460938 -11.335938 4.929688 -11.875 6.796875 -11.875 Z M 6.796875 -11.875 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph0-14">
|
||||
<path style="stroke:none;" d="M 10.140625 -5.328125 L 10.140625 0 L 7.328125 0 L 7.328125 -4.078125 C 7.328125 -4.835938 7.3125 -5.359375 7.28125 -5.640625 C 7.25 -5.929688 7.191406 -6.144531 7.109375 -6.28125 C 6.992188 -6.457031 6.84375 -6.597656 6.65625 -6.703125 C 6.46875 -6.804688 6.253906 -6.859375 6.015625 -6.859375 C 5.429688 -6.859375 4.972656 -6.628906 4.640625 -6.171875 C 4.304688 -5.722656 4.140625 -5.101562 4.140625 -4.3125 L 4.140625 0 L 1.34375 0 L 1.34375 -8.75 L 4.140625 -8.75 L 4.140625 -7.46875 C 4.566406 -7.976562 5.015625 -8.351562 5.484375 -8.59375 C 5.960938 -8.84375 6.488281 -8.96875 7.0625 -8.96875 C 8.070312 -8.96875 8.835938 -8.65625 9.359375 -8.03125 C 9.878906 -7.414062 10.140625 -6.515625 10.140625 -5.328125 Z M 10.140625 -5.328125 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph0-15">
|
||||
<path style="stroke:none;" d="M 9.59375 -11.296875 L 9.59375 -8.828125 C 8.945312 -9.117188 8.316406 -9.335938 7.703125 -9.484375 C 7.097656 -9.628906 6.523438 -9.703125 5.984375 -9.703125 C 5.265625 -9.703125 4.734375 -9.601562 4.390625 -9.40625 C 4.046875 -9.207031 3.875 -8.898438 3.875 -8.484375 C 3.875 -8.171875 3.988281 -7.925781 4.21875 -7.75 C 4.457031 -7.570312 4.878906 -7.421875 5.484375 -7.296875 L 6.765625 -7.046875 C 8.066406 -6.785156 8.988281 -6.390625 9.53125 -5.859375 C 10.082031 -5.328125 10.359375 -4.570312 10.359375 -3.59375 C 10.359375 -2.300781 9.972656 -1.335938 9.203125 -0.703125 C 8.441406 -0.078125 7.28125 0.234375 5.71875 0.234375 C 4.976562 0.234375 4.234375 0.160156 3.484375 0.015625 C 2.742188 -0.128906 2 -0.335938 1.25 -0.609375 L 1.25 -3.15625 C 2 -2.757812 2.71875 -2.457031 3.40625 -2.25 C 4.101562 -2.050781 4.773438 -1.953125 5.421875 -1.953125 C 6.078125 -1.953125 6.578125 -2.0625 6.921875 -2.28125 C 7.273438 -2.5 7.453125 -2.8125 7.453125 -3.21875 C 7.453125 -3.582031 7.332031 -3.863281 7.09375 -4.0625 C 6.863281 -4.257812 6.394531 -4.4375 5.6875 -4.59375 L 4.515625 -4.859375 C 3.347656 -5.109375 2.492188 -5.503906 1.953125 -6.046875 C 1.421875 -6.597656 1.15625 -7.335938 1.15625 -8.265625 C 1.15625 -9.421875 1.53125 -10.3125 2.28125 -10.9375 C 3.03125 -11.5625 4.109375 -11.875 5.515625 -11.875 C 6.148438 -11.875 6.804688 -11.828125 7.484375 -11.734375 C 8.160156 -11.640625 8.863281 -11.492188 9.59375 -11.296875 Z M 9.59375 -11.296875 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph0-16">
|
||||
<path style="stroke:none;" d="M 8.421875 -8.484375 L 8.421875 -6.203125 C 8.035156 -6.460938 7.648438 -6.65625 7.265625 -6.78125 C 6.890625 -6.90625 6.492188 -6.96875 6.078125 -6.96875 C 5.296875 -6.96875 4.6875 -6.738281 4.25 -6.28125 C 3.820312 -5.820312 3.609375 -5.1875 3.609375 -4.375 C 3.609375 -3.550781 3.820312 -2.910156 4.25 -2.453125 C 4.6875 -2.003906 5.296875 -1.78125 6.078125 -1.78125 C 6.515625 -1.78125 6.929688 -1.84375 7.328125 -1.96875 C 7.722656 -2.101562 8.085938 -2.296875 8.421875 -2.546875 L 8.421875 -0.265625 C 7.984375 -0.0976562 7.535156 0.0234375 7.078125 0.109375 C 6.628906 0.191406 6.179688 0.234375 5.734375 0.234375 C 4.148438 0.234375 2.910156 -0.171875 2.015625 -0.984375 C 1.128906 -1.796875 0.6875 -2.925781 0.6875 -4.375 C 0.6875 -5.8125 1.128906 -6.9375 2.015625 -7.75 C 2.910156 -8.5625 4.148438 -8.96875 5.734375 -8.96875 C 6.191406 -8.96875 6.640625 -8.925781 7.078125 -8.84375 C 7.523438 -8.757812 7.972656 -8.640625 8.421875 -8.484375 Z M 8.421875 -8.484375 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph0-17">
|
||||
<path style="stroke:none;" d="M 1.34375 -12.15625 L 4.140625 -12.15625 L 4.140625 -5.546875 L 7.359375 -8.75 L 10.609375 -8.75 L 6.34375 -4.734375 L 10.953125 0 L 7.5625 0 L 4.140625 -3.65625 L 4.140625 0 L 1.34375 0 Z M 1.34375 -12.15625 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph0-18">
|
||||
<path style="stroke:none;" d="M 10.71875 -0.640625 C 10.164062 -0.359375 9.585938 -0.144531 8.984375 0 C 8.390625 0.15625 7.769531 0.234375 7.125 0.234375 C 5.175781 0.234375 3.632812 -0.304688 2.5 -1.390625 C 1.363281 -2.484375 0.796875 -3.960938 0.796875 -5.828125 C 0.796875 -7.691406 1.363281 -9.164062 2.5 -10.25 C 3.632812 -11.332031 5.175781 -11.875 7.125 -11.875 C 7.769531 -11.875 8.390625 -11.800781 8.984375 -11.65625 C 9.585938 -11.507812 10.164062 -11.296875 10.71875 -11.015625 L 10.71875 -8.59375 C 10.164062 -8.976562 9.617188 -9.257812 9.078125 -9.4375 C 8.535156 -9.613281 7.960938 -9.703125 7.359375 -9.703125 C 6.285156 -9.703125 5.441406 -9.359375 4.828125 -8.671875 C 4.210938 -7.984375 3.90625 -7.035156 3.90625 -5.828125 C 3.90625 -4.617188 4.210938 -3.671875 4.828125 -2.984375 C 5.441406 -2.296875 6.285156 -1.953125 7.359375 -1.953125 C 7.960938 -1.953125 8.535156 -2.039062 9.078125 -2.21875 C 9.617188 -2.394531 10.164062 -2.675781 10.71875 -3.0625 Z M 10.71875 -0.640625 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph0-19">
|
||||
<path style="stroke:none;" d="M 8.1875 -8.484375 L 8.1875 -6.359375 C 7.582031 -6.609375 7 -6.796875 6.4375 -6.921875 C 5.882812 -7.046875 5.363281 -7.109375 4.875 -7.109375 C 4.34375 -7.109375 3.945312 -7.039062 3.6875 -6.90625 C 3.425781 -6.769531 3.296875 -6.566406 3.296875 -6.296875 C 3.296875 -6.066406 3.394531 -5.890625 3.59375 -5.765625 C 3.789062 -5.648438 4.140625 -5.566406 4.640625 -5.515625 L 5.140625 -5.4375 C 6.566406 -5.257812 7.523438 -4.960938 8.015625 -4.546875 C 8.515625 -4.128906 8.765625 -3.472656 8.765625 -2.578125 C 8.765625 -1.648438 8.421875 -0.945312 7.734375 -0.46875 C 7.046875 0 6.019531 0.234375 4.65625 0.234375 C 4.082031 0.234375 3.484375 0.1875 2.859375 0.09375 C 2.242188 0 1.613281 -0.140625 0.96875 -0.328125 L 0.96875 -2.453125 C 1.519531 -2.179688 2.085938 -1.976562 2.671875 -1.84375 C 3.265625 -1.707031 3.863281 -1.640625 4.46875 -1.640625 C 5.007812 -1.640625 5.414062 -1.710938 5.6875 -1.859375 C 5.96875 -2.015625 6.109375 -2.238281 6.109375 -2.53125 C 6.109375 -2.78125 6.015625 -2.96875 5.828125 -3.09375 C 5.640625 -3.21875 5.257812 -3.3125 4.6875 -3.375 L 4.203125 -3.4375 C 2.953125 -3.59375 2.078125 -3.878906 1.578125 -4.296875 C 1.078125 -4.722656 0.828125 -5.367188 0.828125 -6.234375 C 0.828125 -7.160156 1.144531 -7.847656 1.78125 -8.296875 C 2.414062 -8.742188 3.390625 -8.96875 4.703125 -8.96875 C 5.222656 -8.96875 5.765625 -8.925781 6.328125 -8.84375 C 6.898438 -8.769531 7.519531 -8.648438 8.1875 -8.484375 Z M 8.1875 -8.484375 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph0-20">
|
||||
<path style="stroke:none;" d="M 7.84375 -6.375 C 7.601562 -6.488281 7.359375 -6.570312 7.109375 -6.625 C 6.867188 -6.675781 6.628906 -6.703125 6.390625 -6.703125 C 5.671875 -6.703125 5.113281 -6.472656 4.71875 -6.015625 C 4.332031 -5.554688 4.140625 -4.894531 4.140625 -4.03125 L 4.140625 0 L 1.34375 0 L 1.34375 -8.75 L 4.140625 -8.75 L 4.140625 -7.3125 C 4.503906 -7.882812 4.914062 -8.300781 5.375 -8.5625 C 5.84375 -8.832031 6.40625 -8.96875 7.0625 -8.96875 C 7.15625 -8.96875 7.253906 -8.960938 7.359375 -8.953125 C 7.472656 -8.941406 7.632812 -8.925781 7.84375 -8.90625 Z M 7.84375 -6.375 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph0-21">
|
||||
<path style="stroke:none;" d="M 11.953125 -0.875 C 11.203125 -0.507812 10.421875 -0.234375 9.609375 -0.046875 C 8.804688 0.140625 7.976562 0.234375 7.125 0.234375 C 5.175781 0.234375 3.632812 -0.304688 2.5 -1.390625 C 1.363281 -2.484375 0.796875 -3.960938 0.796875 -5.828125 C 0.796875 -7.703125 1.375 -9.175781 2.53125 -10.25 C 3.6875 -11.332031 5.269531 -11.875 7.28125 -11.875 C 8.0625 -11.875 8.804688 -11.800781 9.515625 -11.65625 C 10.222656 -11.507812 10.894531 -11.296875 11.53125 -11.015625 L 11.53125 -8.59375 C 10.875 -8.96875 10.222656 -9.242188 9.578125 -9.421875 C 8.941406 -9.609375 8.300781 -9.703125 7.65625 -9.703125 C 6.457031 -9.703125 5.53125 -9.363281 4.875 -8.6875 C 4.226562 -8.019531 3.90625 -7.066406 3.90625 -5.828125 C 3.90625 -4.585938 4.21875 -3.628906 4.84375 -2.953125 C 5.46875 -2.285156 6.359375 -1.953125 7.515625 -1.953125 C 7.828125 -1.953125 8.113281 -1.972656 8.375 -2.015625 C 8.644531 -2.054688 8.890625 -2.117188 9.109375 -2.203125 L 9.109375 -4.46875 L 7.265625 -4.46875 L 7.265625 -6.484375 L 11.953125 -6.484375 Z M 11.953125 -0.875 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph0-22">
|
||||
<path style="stroke:none;" d="M 5.515625 -6.96875 C 4.890625 -6.96875 4.414062 -6.742188 4.09375 -6.296875 C 3.769531 -5.847656 3.609375 -5.207031 3.609375 -4.375 C 3.609375 -3.53125 3.769531 -2.882812 4.09375 -2.4375 C 4.414062 -2 4.890625 -1.78125 5.515625 -1.78125 C 6.117188 -1.78125 6.582031 -2 6.90625 -2.4375 C 7.226562 -2.882812 7.390625 -3.53125 7.390625 -4.375 C 7.390625 -5.207031 7.226562 -5.847656 6.90625 -6.296875 C 6.582031 -6.742188 6.117188 -6.96875 5.515625 -6.96875 Z M 5.515625 -8.96875 C 7.015625 -8.96875 8.1875 -8.5625 9.03125 -7.75 C 9.882812 -6.9375 10.3125 -5.8125 10.3125 -4.375 C 10.3125 -2.9375 9.882812 -1.804688 9.03125 -0.984375 C 8.1875 -0.171875 7.015625 0.234375 5.515625 0.234375 C 4.003906 0.234375 2.820312 -0.171875 1.96875 -0.984375 C 1.113281 -1.804688 0.6875 -2.9375 0.6875 -4.375 C 0.6875 -5.8125 1.113281 -6.9375 1.96875 -7.75 C 2.820312 -8.5625 4.003906 -8.96875 5.515625 -8.96875 Z M 5.515625 -8.96875 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph0-23">
|
||||
<path style="stroke:none;" d="M 1.46875 -11.671875 L 6.46875 -11.671875 C 7.945312 -11.671875 9.082031 -11.335938 9.875 -10.671875 C 10.675781 -10.015625 11.078125 -9.078125 11.078125 -7.859375 C 11.078125 -6.640625 10.675781 -5.695312 9.875 -5.03125 C 9.082031 -4.375 7.945312 -4.046875 6.46875 -4.046875 L 4.484375 -4.046875 L 4.484375 0 L 1.46875 0 Z M 4.484375 -9.484375 L 4.484375 -6.234375 L 6.140625 -6.234375 C 6.722656 -6.234375 7.171875 -6.375 7.484375 -6.65625 C 7.804688 -6.9375 7.96875 -7.335938 7.96875 -7.859375 C 7.96875 -8.378906 7.804688 -8.78125 7.484375 -9.0625 C 7.171875 -9.34375 6.722656 -9.484375 6.140625 -9.484375 Z M 4.484375 -9.484375 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph0-24">
|
||||
<path style="stroke:none;" d="M 5.75 -6.5 C 6.375 -6.5 6.820312 -6.613281 7.09375 -6.84375 C 7.375 -7.082031 7.515625 -7.46875 7.515625 -8 C 7.515625 -8.53125 7.375 -8.910156 7.09375 -9.140625 C 6.820312 -9.367188 6.375 -9.484375 5.75 -9.484375 L 4.484375 -9.484375 L 4.484375 -6.5 Z M 4.484375 -4.421875 L 4.484375 0 L 1.46875 0 L 1.46875 -11.671875 L 6.0625 -11.671875 C 7.601562 -11.671875 8.726562 -11.410156 9.4375 -10.890625 C 10.15625 -10.378906 10.515625 -9.566406 10.515625 -8.453125 C 10.515625 -7.679688 10.328125 -7.046875 9.953125 -6.546875 C 9.585938 -6.054688 9.03125 -5.691406 8.28125 -5.453125 C 8.6875 -5.359375 9.050781 -5.144531 9.375 -4.8125 C 9.707031 -4.488281 10.039062 -3.988281 10.375 -3.3125 L 12 0 L 8.796875 0 L 7.375 -2.90625 C 7.09375 -3.488281 6.800781 -3.882812 6.5 -4.09375 C 6.207031 -4.3125 5.816406 -4.421875 5.328125 -4.421875 Z M 4.484375 -4.421875 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph0-25">
|
||||
<path style="stroke:none;" d="M 7.296875 -1.484375 C 6.910156 -0.972656 6.484375 -0.597656 6.015625 -0.359375 C 5.554688 -0.117188 5.023438 0 4.421875 0 C 3.347656 0 2.460938 -0.421875 1.765625 -1.265625 C 1.066406 -2.109375 0.71875 -3.179688 0.71875 -4.484375 C 0.71875 -5.785156 1.066406 -6.851562 1.765625 -7.6875 C 2.460938 -8.53125 3.347656 -8.953125 4.421875 -8.953125 C 5.023438 -8.953125 5.554688 -8.832031 6.015625 -8.59375 C 6.484375 -8.351562 6.910156 -7.972656 7.296875 -7.453125 L 7.296875 -8.75 L 10.109375 -8.75 L 10.109375 -0.890625 C 10.109375 0.523438 9.664062 1.601562 8.78125 2.34375 C 7.894531 3.082031 6.609375 3.453125 4.921875 3.453125 C 4.367188 3.453125 3.835938 3.410156 3.328125 3.328125 C 2.816406 3.242188 2.304688 3.117188 1.796875 2.953125 L 1.796875 0.765625 C 2.285156 1.046875 2.765625 1.253906 3.234375 1.390625 C 3.703125 1.535156 4.171875 1.609375 4.640625 1.609375 C 5.554688 1.609375 6.226562 1.40625 6.65625 1 C 7.082031 0.601562 7.296875 -0.0234375 7.296875 -0.890625 Z M 5.453125 -6.9375 C 4.878906 -6.9375 4.429688 -6.722656 4.109375 -6.296875 C 3.785156 -5.867188 3.625 -5.265625 3.625 -4.484375 C 3.625 -3.679688 3.78125 -3.070312 4.09375 -2.65625 C 4.40625 -2.238281 4.859375 -2.03125 5.453125 -2.03125 C 6.035156 -2.03125 6.488281 -2.242188 6.8125 -2.671875 C 7.132812 -3.097656 7.296875 -3.703125 7.296875 -4.484375 C 7.296875 -5.265625 7.132812 -5.867188 6.8125 -6.296875 C 6.488281 -6.722656 6.035156 -6.9375 5.453125 -6.9375 Z M 5.453125 -6.9375 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph0-26">
|
||||
<path style="stroke:none;" d="M 0.203125 -8.75 L 3 -8.75 L 5.34375 -2.8125 L 7.34375 -8.75 L 10.140625 -8.75 L 6.46875 0.828125 C 6.09375 1.804688 5.660156 2.488281 5.171875 2.875 C 4.679688 3.257812 4.03125 3.453125 3.21875 3.453125 L 1.609375 3.453125 L 1.609375 1.625 L 2.484375 1.625 C 2.953125 1.625 3.296875 1.546875 3.515625 1.390625 C 3.734375 1.242188 3.898438 0.972656 4.015625 0.578125 L 4.09375 0.34375 Z M 0.203125 -8.75 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph0-27">
|
||||
<path style="stroke:none;" d="M 1.46875 -11.671875 L 9.59375 -11.671875 L 9.59375 -9.390625 L 4.484375 -9.390625 L 4.484375 -7.21875 L 9.28125 -7.21875 L 9.28125 -4.953125 L 4.484375 -4.953125 L 4.484375 -2.28125 L 9.765625 -2.28125 L 9.765625 0 L 1.46875 0 Z M 1.46875 -11.671875 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph0-28">
|
||||
<path style="stroke:none;" d="M 7.109375 -12.15625 L 7.109375 -10.328125 L 5.5625 -10.328125 C 5.164062 -10.328125 4.890625 -10.253906 4.734375 -10.109375 C 4.578125 -9.960938 4.5 -9.710938 4.5 -9.359375 L 4.5 -8.75 L 7.703125 -8.75 L 7.703125 -9.359375 C 7.703125 -10.316406 7.96875 -11.019531 8.5 -11.46875 C 9.03125 -11.925781 9.851562 -12.15625 10.96875 -12.15625 L 13.109375 -12.15625 L 13.109375 -10.328125 L 11.5625 -10.328125 C 11.164062 -10.328125 10.894531 -10.253906 10.75 -10.109375 C 10.59375 -9.960938 10.515625 -9.710938 10.515625 -9.359375 L 10.515625 -8.75 L 16.5 -8.75 L 16.5 0 L 13.6875 0 L 13.6875 -6.75 L 10.515625 -6.75 L 10.515625 0 L 7.703125 0 L 7.703125 -6.75 L 4.5 -6.75 L 4.5 0 L 1.703125 0 L 1.703125 -6.75 L 0.3125 -6.75 L 0.3125 -8.75 L 1.703125 -8.75 L 1.703125 -9.359375 C 1.703125 -10.316406 1.96875 -11.019531 2.5 -11.46875 C 3.03125 -11.925781 3.851562 -12.15625 4.96875 -12.15625 Z M 13.6875 -12.15625 L 16.5 -12.15625 L 16.5 -9.875 L 13.6875 -9.875 Z M 13.6875 -12.15625 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph0-29">
|
||||
<path style="stroke:none;" d="M 1.46875 -11.671875 L 4.484375 -11.671875 L 4.484375 0 L 1.46875 0 Z M 1.46875 -11.671875 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph1-0">
|
||||
<path style="stroke:none;" d="M 0.65625 2.296875 L 0.65625 -9.171875 L 7.15625 -9.171875 L 7.15625 2.296875 Z M 1.390625 1.578125 L 6.4375 1.578125 L 6.4375 -8.4375 L 1.390625 -8.4375 Z M 1.390625 1.578125 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph1-1">
|
||||
<path style="stroke:none;" d="M 3.90625 -8.34375 L 2.5625 -3.5 L 5.265625 -3.5 Z M 3.140625 -9.484375 L 4.6875 -9.484375 L 7.59375 0 L 6.265625 0 L 5.5625 -2.46875 L 2.25 -2.46875 L 1.5625 0 L 0.234375 0 Z M 3.140625 -9.484375 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph1-2">
|
||||
<path style="stroke:none;" d="M 2.375 -0.890625 L 2.375 2.703125 L 1.203125 2.703125 L 1.203125 -7.109375 L 2.375 -7.109375 L 2.375 -6.203125 C 2.570312 -6.554688 2.832031 -6.820312 3.15625 -7 C 3.476562 -7.1875 3.851562 -7.28125 4.28125 -7.28125 C 5.132812 -7.28125 5.804688 -6.945312 6.296875 -6.28125 C 6.785156 -5.613281 7.03125 -4.691406 7.03125 -3.515625 C 7.03125 -2.367188 6.785156 -1.460938 6.296875 -0.796875 C 5.804688 -0.140625 5.132812 0.1875 4.28125 0.1875 C 3.84375 0.1875 3.460938 0.09375 3.140625 -0.09375 C 2.816406 -0.28125 2.5625 -0.546875 2.375 -0.890625 Z M 5.8125 -3.546875 C 5.8125 -4.453125 5.664062 -5.132812 5.375 -5.59375 C 5.09375 -6.0625 4.671875 -6.296875 4.109375 -6.296875 C 3.535156 -6.296875 3.101562 -6.0625 2.8125 -5.59375 C 2.519531 -5.132812 2.375 -4.453125 2.375 -3.546875 C 2.375 -2.648438 2.519531 -1.96875 2.8125 -1.5 C 3.101562 -1.039062 3.535156 -0.8125 4.109375 -0.8125 C 4.671875 -0.8125 5.09375 -1.039062 5.375 -1.5 C 5.664062 -1.957031 5.8125 -2.640625 5.8125 -3.546875 Z M 5.8125 -3.546875 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph1-3">
|
||||
<path style="stroke:none;" d="M 4.0625 -2.578125 C 4.0625 -2.054688 4.15625 -1.660156 4.34375 -1.390625 C 4.539062 -1.117188 4.828125 -0.984375 5.203125 -0.984375 L 6.5625 -0.984375 L 6.5625 0 L 5.078125 0 C 4.378906 0 3.835938 -0.222656 3.453125 -0.671875 C 3.078125 -1.117188 2.890625 -1.753906 2.890625 -2.578125 L 2.890625 -9.03125 L 1.015625 -9.03125 L 1.015625 -9.953125 L 4.0625 -9.953125 Z M 4.0625 -2.578125 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph1-4">
|
||||
<path style="stroke:none;" d="M 1.625 -7.109375 L 4.609375 -7.109375 L 4.609375 -0.90625 L 6.9375 -0.90625 L 6.9375 0 L 1.125 0 L 1.125 -0.90625 L 3.453125 -0.90625 L 3.453125 -6.203125 L 1.625 -6.203125 Z M 3.453125 -9.875 L 4.609375 -9.875 L 4.609375 -8.390625 L 3.453125 -8.390625 Z M 3.453125 -9.875 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph1-5">
|
||||
<path style="stroke:none;" d="M 7.0625 -3.84375 L 7.0625 -3.28125 L 2 -3.28125 L 2 -3.234375 C 2 -2.460938 2.203125 -1.863281 2.609375 -1.4375 C 3.015625 -1.019531 3.582031 -0.8125 4.3125 -0.8125 C 4.6875 -0.8125 5.078125 -0.867188 5.484375 -0.984375 C 5.890625 -1.097656 6.320312 -1.28125 6.78125 -1.53125 L 6.78125 -0.359375 C 6.34375 -0.179688 5.914062 -0.046875 5.5 0.046875 C 5.082031 0.140625 4.679688 0.1875 4.296875 0.1875 C 3.191406 0.1875 2.328125 -0.140625 1.703125 -0.796875 C 1.085938 -1.460938 0.78125 -2.378906 0.78125 -3.546875 C 0.78125 -4.679688 1.082031 -5.585938 1.6875 -6.265625 C 2.300781 -6.941406 3.113281 -7.28125 4.125 -7.28125 C 5.03125 -7.28125 5.742188 -6.972656 6.265625 -6.359375 C 6.796875 -5.742188 7.0625 -4.90625 7.0625 -3.84375 Z M 5.890625 -4.1875 C 5.867188 -4.875 5.703125 -5.394531 5.390625 -5.75 C 5.085938 -6.113281 4.648438 -6.296875 4.078125 -6.296875 C 3.515625 -6.296875 3.050781 -6.109375 2.6875 -5.734375 C 2.320312 -5.359375 2.109375 -4.84375 2.046875 -4.1875 Z M 5.890625 -4.1875 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph1-6">
|
||||
<path style="stroke:none;" d="M 6.171875 -6.859375 L 6.171875 -5.71875 C 5.835938 -5.914062 5.5 -6.0625 5.15625 -6.15625 C 4.820312 -6.25 4.476562 -6.296875 4.125 -6.296875 C 3.601562 -6.296875 3.210938 -6.210938 2.953125 -6.046875 C 2.691406 -5.878906 2.5625 -5.617188 2.5625 -5.265625 C 2.5625 -4.941406 2.65625 -4.703125 2.84375 -4.546875 C 3.039062 -4.390625 3.523438 -4.238281 4.296875 -4.09375 L 4.78125 -4 C 5.351562 -3.894531 5.785156 -3.675781 6.078125 -3.34375 C 6.378906 -3.007812 6.53125 -2.582031 6.53125 -2.0625 C 6.53125 -1.351562 6.28125 -0.800781 5.78125 -0.40625 C 5.289062 -0.0078125 4.597656 0.1875 3.703125 0.1875 C 3.359375 0.1875 2.992188 0.148438 2.609375 0.078125 C 2.222656 0.00390625 1.804688 -0.109375 1.359375 -0.265625 L 1.359375 -1.46875 C 1.785156 -1.238281 2.195312 -1.066406 2.59375 -0.953125 C 3 -0.847656 3.378906 -0.796875 3.734375 -0.796875 C 4.242188 -0.796875 4.640625 -0.898438 4.921875 -1.109375 C 5.210938 -1.316406 5.359375 -1.609375 5.359375 -1.984375 C 5.359375 -2.523438 4.835938 -2.898438 3.796875 -3.109375 L 3.75 -3.125 L 3.3125 -3.21875 C 2.632812 -3.34375 2.140625 -3.5625 1.828125 -3.875 C 1.523438 -4.1875 1.375 -4.609375 1.375 -5.140625 C 1.375 -5.828125 1.601562 -6.351562 2.0625 -6.71875 C 2.53125 -7.09375 3.191406 -7.28125 4.046875 -7.28125 C 4.421875 -7.28125 4.785156 -7.242188 5.140625 -7.171875 C 5.492188 -7.109375 5.835938 -7.003906 6.171875 -6.859375 Z M 6.171875 -6.859375 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph1-7">
|
||||
<path style="stroke:none;" d=""/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph1-8">
|
||||
<path style="stroke:none;" d="M 3.890625 -9.125 L 3.890625 -7.109375 L 6.546875 -7.109375 L 6.546875 -6.203125 L 3.890625 -6.203125 L 3.890625 -2.34375 C 3.890625 -1.820312 3.988281 -1.457031 4.1875 -1.25 C 4.394531 -1.039062 4.742188 -0.9375 5.234375 -0.9375 L 6.546875 -0.9375 L 6.546875 0 L 5.125 0 C 4.25 0 3.628906 -0.171875 3.265625 -0.515625 C 2.910156 -0.867188 2.734375 -1.476562 2.734375 -2.34375 L 2.734375 -6.203125 L 0.828125 -6.203125 L 0.828125 -7.109375 L 2.734375 -7.109375 L 2.734375 -9.125 Z M 3.890625 -9.125 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph1-9">
|
||||
<path style="stroke:none;" d="M 3.90625 -6.296875 C 3.3125 -6.296875 2.863281 -6.0625 2.5625 -5.59375 C 2.257812 -5.132812 2.109375 -4.453125 2.109375 -3.546875 C 2.109375 -2.648438 2.257812 -1.96875 2.5625 -1.5 C 2.863281 -1.039062 3.3125 -0.8125 3.90625 -0.8125 C 4.507812 -0.8125 4.960938 -1.039062 5.265625 -1.5 C 5.566406 -1.96875 5.71875 -2.648438 5.71875 -3.546875 C 5.71875 -4.453125 5.566406 -5.132812 5.265625 -5.59375 C 4.960938 -6.0625 4.507812 -6.296875 3.90625 -6.296875 Z M 3.90625 -7.28125 C 4.894531 -7.28125 5.648438 -6.957031 6.171875 -6.3125 C 6.691406 -5.675781 6.953125 -4.753906 6.953125 -3.546875 C 6.953125 -2.335938 6.691406 -1.410156 6.171875 -0.765625 C 5.648438 -0.128906 4.894531 0.1875 3.90625 0.1875 C 2.925781 0.1875 2.175781 -0.128906 1.65625 -0.765625 C 1.132812 -1.410156 0.875 -2.335938 0.875 -3.546875 C 0.875 -4.753906 1.132812 -5.675781 1.65625 -6.3125 C 2.175781 -6.957031 2.925781 -7.28125 3.90625 -7.28125 Z M 3.90625 -7.28125 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph1-10">
|
||||
<path style="stroke:none;" d="M 5.453125 -3.609375 C 5.453125 -4.484375 5.304688 -5.148438 5.015625 -5.609375 C 4.734375 -6.066406 4.316406 -6.296875 3.765625 -6.296875 C 3.191406 -6.296875 2.753906 -6.066406 2.453125 -5.609375 C 2.160156 -5.148438 2.015625 -4.484375 2.015625 -3.609375 C 2.015625 -2.734375 2.164062 -2.066406 2.46875 -1.609375 C 2.769531 -1.148438 3.207031 -0.921875 3.78125 -0.921875 C 4.320312 -0.921875 4.734375 -1.148438 5.015625 -1.609375 C 5.304688 -2.066406 5.453125 -2.734375 5.453125 -3.609375 Z M 6.609375 -0.453125 C 6.609375 0.609375 6.359375 1.414062 5.859375 1.96875 C 5.359375 2.519531 4.617188 2.796875 3.640625 2.796875 C 3.316406 2.796875 2.976562 2.765625 2.625 2.703125 C 2.269531 2.640625 1.921875 2.550781 1.578125 2.4375 L 1.578125 1.28125 C 1.992188 1.476562 2.367188 1.625 2.703125 1.71875 C 3.046875 1.8125 3.359375 1.859375 3.640625 1.859375 C 4.265625 1.859375 4.722656 1.6875 5.015625 1.34375 C 5.304688 1 5.453125 0.457031 5.453125 -0.28125 L 5.453125 -1.125 C 5.265625 -0.726562 5.007812 -0.429688 4.6875 -0.234375 C 4.363281 -0.046875 3.972656 0.046875 3.515625 0.046875 C 2.679688 0.046875 2.015625 -0.28125 1.515625 -0.9375 C 1.023438 -1.601562 0.78125 -2.492188 0.78125 -3.609375 C 0.78125 -4.722656 1.023438 -5.613281 1.515625 -6.28125 C 2.015625 -6.945312 2.679688 -7.28125 3.515625 -7.28125 C 3.972656 -7.28125 4.359375 -7.1875 4.671875 -7 C 4.984375 -6.820312 5.242188 -6.539062 5.453125 -6.15625 L 5.453125 -7.078125 L 6.609375 -7.078125 Z M 6.609375 -0.453125 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph1-11">
|
||||
<path style="stroke:none;" d="M 6.734375 -0.359375 C 6.421875 -0.179688 6.097656 -0.046875 5.765625 0.046875 C 5.429688 0.140625 5.09375 0.1875 4.75 0.1875 C 3.644531 0.1875 2.78125 -0.140625 2.15625 -0.796875 C 1.539062 -1.460938 1.234375 -2.378906 1.234375 -3.546875 C 1.234375 -4.710938 1.539062 -5.625 2.15625 -6.28125 C 2.78125 -6.945312 3.644531 -7.28125 4.75 -7.28125 C 5.09375 -7.28125 5.425781 -7.234375 5.75 -7.140625 C 6.070312 -7.054688 6.398438 -6.921875 6.734375 -6.734375 L 6.734375 -5.515625 C 6.421875 -5.785156 6.109375 -5.984375 5.796875 -6.109375 C 5.492188 -6.234375 5.144531 -6.296875 4.75 -6.296875 C 4.019531 -6.296875 3.457031 -6.054688 3.0625 -5.578125 C 2.664062 -5.109375 2.46875 -4.429688 2.46875 -3.546875 C 2.46875 -2.671875 2.664062 -1.992188 3.0625 -1.515625 C 3.457031 -1.046875 4.019531 -0.8125 4.75 -0.8125 C 5.15625 -0.8125 5.519531 -0.875 5.84375 -1 C 6.164062 -1.125 6.460938 -1.316406 6.734375 -1.578125 Z M 6.734375 -0.359375 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph1-12">
|
||||
<path style="stroke:none;" d="M 6.671875 -4.40625 L 6.671875 0 L 5.5 0 L 5.5 -4.40625 C 5.5 -5.039062 5.382812 -5.507812 5.15625 -5.8125 C 4.9375 -6.113281 4.585938 -6.265625 4.109375 -6.265625 C 3.554688 -6.265625 3.132812 -6.070312 2.84375 -5.6875 C 2.550781 -5.300781 2.40625 -4.742188 2.40625 -4.015625 L 2.40625 0 L 1.234375 0 L 1.234375 -7.109375 L 2.40625 -7.109375 L 2.40625 -6.046875 C 2.613281 -6.453125 2.894531 -6.757812 3.25 -6.96875 C 3.601562 -7.175781 4.023438 -7.28125 4.515625 -7.28125 C 5.234375 -7.28125 5.769531 -7.039062 6.125 -6.5625 C 6.488281 -6.09375 6.671875 -5.375 6.671875 -4.40625 Z M 6.671875 -4.40625 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph1-13">
|
||||
<path style="stroke:none;" d="M 6.75 -9.875 L 6.75 -8.90625 L 5.421875 -8.90625 C 5.003906 -8.90625 4.710938 -8.816406 4.546875 -8.640625 C 4.378906 -8.472656 4.296875 -8.171875 4.296875 -7.734375 L 4.296875 -7.109375 L 6.75 -7.109375 L 6.75 -6.203125 L 4.296875 -6.203125 L 4.296875 0 L 3.140625 0 L 3.140625 -6.203125 L 1.234375 -6.203125 L 1.234375 -7.109375 L 3.140625 -7.109375 L 3.140625 -7.609375 C 3.140625 -8.378906 3.316406 -8.945312 3.671875 -9.3125 C 4.023438 -9.6875 4.582031 -9.875 5.34375 -9.875 Z M 6.75 -9.875 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph1-14">
|
||||
<path style="stroke:none;" d="M 1.234375 -2.6875 L 1.234375 -7.09375 L 2.40625 -7.09375 L 2.40625 -2.6875 C 2.40625 -2.050781 2.515625 -1.582031 2.734375 -1.28125 C 2.960938 -0.976562 3.316406 -0.828125 3.796875 -0.828125 C 4.347656 -0.828125 4.769531 -1.019531 5.0625 -1.40625 C 5.351562 -1.800781 5.5 -2.359375 5.5 -3.078125 L 5.5 -7.09375 L 6.671875 -7.09375 L 6.671875 0 L 5.5 0 L 5.5 -1.0625 C 5.289062 -0.65625 5.003906 -0.34375 4.640625 -0.125 C 4.285156 0.0820312 3.867188 0.1875 3.390625 0.1875 C 2.660156 0.1875 2.117188 -0.0507812 1.765625 -0.53125 C 1.410156 -1.007812 1.234375 -1.726562 1.234375 -2.6875 Z M 1.234375 -2.6875 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph1-15">
|
||||
<path style="stroke:none;" d="M 7.328125 -5.640625 C 7.078125 -5.835938 6.820312 -5.976562 6.5625 -6.0625 C 6.3125 -6.15625 6.03125 -6.203125 5.71875 -6.203125 C 4.988281 -6.203125 4.429688 -5.972656 4.046875 -5.515625 C 3.660156 -5.054688 3.46875 -4.394531 3.46875 -3.53125 L 3.46875 0 L 2.296875 0 L 2.296875 -7.109375 L 3.46875 -7.109375 L 3.46875 -5.71875 C 3.664062 -6.21875 3.96875 -6.601562 4.375 -6.875 C 4.78125 -7.144531 5.257812 -7.28125 5.8125 -7.28125 C 6.09375 -7.28125 6.359375 -7.242188 6.609375 -7.171875 C 6.859375 -7.097656 7.097656 -6.988281 7.328125 -6.84375 Z M 7.328125 -5.640625 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph1-16">
|
||||
<path style="stroke:none;" d="M 4.453125 -3.578125 L 4.0625 -3.578125 C 3.382812 -3.578125 2.875 -3.457031 2.53125 -3.21875 C 2.1875 -2.976562 2.015625 -2.617188 2.015625 -2.140625 C 2.015625 -1.710938 2.140625 -1.378906 2.390625 -1.140625 C 2.648438 -0.910156 3.007812 -0.796875 3.46875 -0.796875 C 4.113281 -0.796875 4.617188 -1.019531 4.984375 -1.46875 C 5.359375 -1.914062 5.546875 -2.53125 5.546875 -3.3125 L 5.546875 -3.578125 Z M 6.71875 -4.0625 L 6.71875 0 L 5.546875 0 L 5.546875 -1.046875 C 5.296875 -0.628906 4.976562 -0.316406 4.59375 -0.109375 C 4.21875 0.0859375 3.757812 0.1875 3.21875 0.1875 C 2.5 0.1875 1.921875 -0.015625 1.484375 -0.421875 C 1.054688 -0.835938 0.84375 -1.382812 0.84375 -2.0625 C 0.84375 -2.851562 1.109375 -3.453125 1.640625 -3.859375 C 2.171875 -4.273438 2.953125 -4.484375 3.984375 -4.484375 L 5.546875 -4.484375 L 5.546875 -4.671875 C 5.546875 -5.234375 5.398438 -5.644531 5.109375 -5.90625 C 4.828125 -6.164062 4.378906 -6.296875 3.765625 -6.296875 C 3.359375 -6.296875 2.953125 -6.238281 2.546875 -6.125 C 2.140625 -6.007812 1.742188 -5.84375 1.359375 -5.625 L 1.359375 -6.78125 C 1.796875 -6.945312 2.210938 -7.070312 2.609375 -7.15625 C 3.003906 -7.238281 3.390625 -7.28125 3.765625 -7.28125 C 4.347656 -7.28125 4.847656 -7.191406 5.265625 -7.015625 C 5.679688 -6.847656 6.019531 -6.585938 6.28125 -6.234375 C 6.4375 -6.023438 6.546875 -5.765625 6.609375 -5.453125 C 6.679688 -5.140625 6.71875 -4.675781 6.71875 -4.0625 Z M 6.71875 -4.0625 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph1-17">
|
||||
<path style="stroke:none;" d="M 4.296875 -6.390625 C 4.429688 -6.691406 4.609375 -6.914062 4.828125 -7.0625 C 5.054688 -7.207031 5.328125 -7.28125 5.640625 -7.28125 C 6.210938 -7.28125 6.613281 -7.054688 6.84375 -6.609375 C 7.082031 -6.171875 7.203125 -5.34375 7.203125 -4.125 L 7.203125 0 L 6.140625 0 L 6.140625 -4.0625 C 6.140625 -5.070312 6.082031 -5.695312 5.96875 -5.9375 C 5.851562 -6.175781 5.648438 -6.296875 5.359375 -6.296875 C 5.015625 -6.296875 4.78125 -6.164062 4.65625 -5.90625 C 4.53125 -5.644531 4.46875 -5.03125 4.46875 -4.0625 L 4.46875 0 L 3.40625 0 L 3.40625 -4.0625 C 3.40625 -5.082031 3.34375 -5.707031 3.21875 -5.9375 C 3.101562 -6.175781 2.890625 -6.296875 2.578125 -6.296875 C 2.265625 -6.296875 2.046875 -6.164062 1.921875 -5.90625 C 1.804688 -5.644531 1.75 -5.03125 1.75 -4.0625 L 1.75 0 L 0.6875 0 L 0.6875 -7.109375 L 1.75 -7.109375 L 1.75 -6.5 C 1.894531 -6.75 2.070312 -6.941406 2.28125 -7.078125 C 2.488281 -7.210938 2.722656 -7.28125 2.984375 -7.28125 C 3.304688 -7.28125 3.570312 -7.207031 3.78125 -7.0625 C 4 -6.914062 4.171875 -6.691406 4.296875 -6.390625 Z M 4.296875 -6.390625 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph1-18">
|
||||
<path style="stroke:none;" d="M 6.671875 -4.40625 L 6.671875 0 L 5.5 0 L 5.5 -4.40625 C 5.5 -5.039062 5.382812 -5.507812 5.15625 -5.8125 C 4.9375 -6.113281 4.585938 -6.265625 4.109375 -6.265625 C 3.554688 -6.265625 3.132812 -6.070312 2.84375 -5.6875 C 2.550781 -5.300781 2.40625 -4.742188 2.40625 -4.015625 L 2.40625 0 L 1.234375 0 L 1.234375 -9.875 L 2.40625 -9.875 L 2.40625 -6.046875 C 2.613281 -6.453125 2.894531 -6.757812 3.25 -6.96875 C 3.601562 -7.175781 4.023438 -7.28125 4.515625 -7.28125 C 5.234375 -7.28125 5.769531 -7.039062 6.125 -6.5625 C 6.488281 -6.09375 6.671875 -5.375 6.671875 -4.40625 Z M 6.671875 -4.40625 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph1-19">
|
||||
<path style="stroke:none;" d="M 0.640625 -7.109375 L 1.84375 -7.109375 L 3.90625 -1.140625 L 5.984375 -7.109375 L 7.1875 -7.109375 L 4.671875 0 L 3.15625 0 Z M 0.640625 -7.109375 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph1-20">
|
||||
<path style="stroke:none;" d="M 7.015625 -0.78125 C 6.671875 -0.46875 6.28125 -0.226562 5.84375 -0.0625 C 5.414062 0.101562 4.953125 0.1875 4.453125 0.1875 C 3.253906 0.1875 2.316406 -0.242188 1.640625 -1.109375 C 0.972656 -1.972656 0.640625 -3.179688 0.640625 -4.734375 C 0.640625 -6.273438 0.976562 -7.476562 1.65625 -8.34375 C 2.332031 -9.21875 3.273438 -9.65625 4.484375 -9.65625 C 4.878906 -9.65625 5.257812 -9.597656 5.625 -9.484375 C 5.988281 -9.367188 6.34375 -9.195312 6.6875 -8.96875 L 6.6875 -7.65625 C 6.34375 -7.976562 5.988281 -8.21875 5.625 -8.375 C 5.269531 -8.53125 4.890625 -8.609375 4.484375 -8.609375 C 3.648438 -8.609375 3.023438 -8.285156 2.609375 -7.640625 C 2.191406 -6.992188 1.984375 -6.023438 1.984375 -4.734375 C 1.984375 -3.410156 2.1875 -2.429688 2.59375 -1.796875 C 3 -1.171875 3.617188 -0.859375 4.453125 -0.859375 C 4.734375 -0.859375 4.976562 -0.890625 5.1875 -0.953125 C 5.40625 -1.015625 5.601562 -1.117188 5.78125 -1.265625 L 5.78125 -3.8125 L 4.40625 -3.8125 L 4.40625 -4.859375 L 7.015625 -4.859375 Z M 7.015625 -0.78125 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph1-21">
|
||||
<path style="stroke:none;" d="M 5.453125 -6.203125 L 5.453125 -9.875 L 6.609375 -9.875 L 6.609375 0 L 5.453125 0 L 5.453125 -0.890625 C 5.253906 -0.546875 4.992188 -0.28125 4.671875 -0.09375 C 4.347656 0.09375 3.972656 0.1875 3.546875 0.1875 C 2.691406 0.1875 2.015625 -0.144531 1.515625 -0.8125 C 1.023438 -1.476562 0.78125 -2.398438 0.78125 -3.578125 C 0.78125 -4.734375 1.023438 -5.640625 1.515625 -6.296875 C 2.015625 -6.953125 2.691406 -7.28125 3.546875 -7.28125 C 3.972656 -7.28125 4.347656 -7.1875 4.671875 -7 C 5.003906 -6.820312 5.265625 -6.554688 5.453125 -6.203125 Z M 2.015625 -3.546875 C 2.015625 -2.640625 2.15625 -1.957031 2.4375 -1.5 C 2.726562 -1.039062 3.15625 -0.8125 3.71875 -0.8125 C 4.28125 -0.8125 4.707031 -1.039062 5 -1.5 C 5.300781 -1.96875 5.453125 -2.648438 5.453125 -3.546875 C 5.453125 -4.453125 5.300781 -5.132812 5 -5.59375 C 4.707031 -6.0625 4.28125 -6.296875 3.71875 -6.296875 C 3.15625 -6.296875 2.726562 -6.0625 2.4375 -5.59375 C 2.15625 -5.132812 2.015625 -4.453125 2.015625 -3.546875 Z M 2.015625 -3.546875 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph1-22">
|
||||
<path style="stroke:none;" d="M 0.875 -9.484375 L 2.5 -9.484375 L 5.703125 -1.671875 L 5.703125 -9.484375 L 6.9375 -9.484375 L 6.9375 0 L 5.3125 0 L 2.125 -7.796875 L 2.125 0 L 0.875 0 Z M 0.875 -9.484375 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph1-23">
|
||||
<path style="stroke:none;" d="M 7.09375 -7.109375 L 4.546875 -3.703125 L 7.34375 0 L 6 0 L 3.90625 -2.84375 L 1.828125 0 L 0.484375 0 L 3.28125 -3.703125 L 0.734375 -7.109375 L 2.03125 -7.109375 L 3.90625 -4.53125 L 5.78125 -7.109375 Z M 7.09375 -7.109375 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph1-24">
|
||||
<path style="stroke:none;" d="M 0.296875 -9.484375 L 7.53125 -9.484375 L 7.53125 -8.390625 L 4.5625 -8.390625 L 4.5625 0 L 3.28125 0 L 3.28125 -8.390625 L 0.296875 -8.390625 Z M 0.296875 -9.484375 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph1-25">
|
||||
<path style="stroke:none;" d="M 2.765625 -1.046875 C 3.847656 -1.046875 4.601562 -1.3125 5.03125 -1.84375 C 5.457031 -2.375 5.671875 -3.335938 5.671875 -4.734375 C 5.671875 -6.128906 5.457031 -7.09375 5.03125 -7.625 C 4.601562 -8.15625 3.847656 -8.421875 2.765625 -8.421875 L 2.15625 -8.421875 L 2.15625 -1.046875 Z M 2.796875 -9.484375 C 4.242188 -9.484375 5.304688 -9.097656 5.984375 -8.328125 C 6.671875 -7.554688 7.015625 -6.359375 7.015625 -4.734375 C 7.015625 -3.109375 6.671875 -1.910156 5.984375 -1.140625 C 5.304688 -0.378906 4.242188 0 2.796875 0 L 0.875 0 L 0.875 -9.484375 Z M 2.796875 -9.484375 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph1-26">
|
||||
<path style="stroke:none;" d="M 6.8125 -0.34375 C 6.488281 -0.164062 6.15625 -0.0351562 5.8125 0.046875 C 5.46875 0.140625 5.101562 0.1875 4.71875 0.1875 C 3.5 0.1875 2.550781 -0.238281 1.875 -1.09375 C 1.207031 -1.957031 0.875 -3.171875 0.875 -4.734375 C 0.875 -6.273438 1.210938 -7.476562 1.890625 -8.34375 C 2.566406 -9.21875 3.507812 -9.65625 4.71875 -9.65625 C 5.101562 -9.65625 5.46875 -9.609375 5.8125 -9.515625 C 6.15625 -9.429688 6.488281 -9.300781 6.8125 -9.125 L 6.8125 -7.8125 C 6.5 -8.070312 6.160156 -8.269531 5.796875 -8.40625 C 5.441406 -8.539062 5.082031 -8.609375 4.71875 -8.609375 C 3.882812 -8.609375 3.257812 -8.285156 2.84375 -7.640625 C 2.425781 -6.992188 2.21875 -6.023438 2.21875 -4.734375 C 2.21875 -3.429688 2.425781 -2.457031 2.84375 -1.8125 C 3.257812 -1.175781 3.882812 -0.859375 4.71875 -0.859375 C 5.09375 -0.859375 5.457031 -0.925781 5.8125 -1.0625 C 6.164062 -1.195312 6.5 -1.394531 6.8125 -1.65625 Z M 6.8125 -0.34375 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph1-27">
|
||||
<path style="stroke:none;" d="M 0.546875 -9.484375 L 2.265625 -9.484375 L 3.890625 -4.65625 L 5.546875 -9.484375 L 7.265625 -9.484375 L 7.265625 0 L 6.078125 0 L 6.078125 -8.375 L 4.390625 -3.375 L 3.421875 -3.375 L 1.734375 -8.375 L 1.734375 0 L 0.546875 0 Z M 0.546875 -9.484375 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph1-28">
|
||||
<path style="stroke:none;" d="M 1.359375 -9.484375 L 2.65625 -9.484375 L 2.65625 -1.078125 L 7.234375 -1.078125 L 7.234375 0 L 1.359375 0 Z M 1.359375 -9.484375 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph2-0">
|
||||
<path style="stroke:none;" d="M 0.640625 2.296875 L 0.640625 -9.171875 L 7.140625 -9.171875 L 7.140625 2.296875 Z M 1.375 1.578125 L 6.421875 1.578125 L 6.421875 -8.4375 L 1.375 -8.4375 Z M 1.375 1.578125 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph2-1">
|
||||
<path style="stroke:none;" d="M 6.9375 -1.734375 L 3.125 -1.734375 L 2.515625 0 L 0.0625 0 L 3.578125 -9.484375 L 6.484375 -9.484375 L 10 0 L 7.546875 0 Z M 3.734375 -3.484375 L 6.328125 -3.484375 L 5.03125 -7.25 Z M 3.734375 -3.484375 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph2-2">
|
||||
<path style="stroke:none;" d="M 5.921875 -6.0625 L 5.921875 -9.875 L 8.21875 -9.875 L 8.21875 0 L 5.921875 0 L 5.921875 -1.03125 C 5.609375 -0.613281 5.265625 -0.304688 4.890625 -0.109375 C 4.515625 0.0859375 4.082031 0.1875 3.59375 0.1875 C 2.707031 0.1875 1.984375 -0.160156 1.421875 -0.859375 C 0.859375 -1.554688 0.578125 -2.453125 0.578125 -3.546875 C 0.578125 -4.640625 0.859375 -5.535156 1.421875 -6.234375 C 1.984375 -6.929688 2.707031 -7.28125 3.59375 -7.28125 C 4.082031 -7.28125 4.515625 -7.179688 4.890625 -6.984375 C 5.265625 -6.785156 5.609375 -6.476562 5.921875 -6.0625 Z M 4.4375 -1.46875 C 4.914062 -1.46875 5.28125 -1.644531 5.53125 -2 C 5.789062 -2.351562 5.921875 -2.867188 5.921875 -3.546875 C 5.921875 -4.222656 5.789062 -4.738281 5.53125 -5.09375 C 5.28125 -5.445312 4.914062 -5.625 4.4375 -5.625 C 3.945312 -5.625 3.570312 -5.445312 3.3125 -5.09375 C 3.0625 -4.738281 2.9375 -4.222656 2.9375 -3.546875 C 2.9375 -2.867188 3.0625 -2.351562 3.3125 -2 C 3.570312 -1.644531 3.945312 -1.46875 4.4375 -1.46875 Z M 4.4375 -1.46875 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph2-3">
|
||||
<path style="stroke:none;" d="M 7.6875 -5.921875 C 7.96875 -6.367188 8.304688 -6.707031 8.703125 -6.9375 C 9.097656 -7.164062 9.535156 -7.28125 10.015625 -7.28125 C 10.828125 -7.28125 11.445312 -7.023438 11.875 -6.515625 C 12.300781 -6.015625 12.515625 -5.285156 12.515625 -4.328125 L 12.515625 0 L 10.234375 0 L 10.234375 -3.703125 C 10.234375 -3.765625 10.234375 -3.820312 10.234375 -3.875 C 10.242188 -3.9375 10.25 -4.019531 10.25 -4.125 C 10.25 -4.632812 10.171875 -5 10.015625 -5.21875 C 9.867188 -5.445312 9.632812 -5.5625 9.3125 -5.5625 C 8.875 -5.5625 8.535156 -5.382812 8.296875 -5.03125 C 8.066406 -4.675781 7.945312 -4.160156 7.9375 -3.484375 L 7.9375 0 L 5.65625 0 L 5.65625 -3.703125 C 5.65625 -4.492188 5.585938 -5 5.453125 -5.21875 C 5.316406 -5.445312 5.078125 -5.5625 4.734375 -5.5625 C 4.296875 -5.5625 3.957031 -5.382812 3.71875 -5.03125 C 3.476562 -4.675781 3.359375 -4.164062 3.359375 -3.5 L 3.359375 0 L 1.078125 0 L 1.078125 -7.109375 L 3.359375 -7.109375 L 3.359375 -6.0625 C 3.640625 -6.46875 3.960938 -6.769531 4.328125 -6.96875 C 4.691406 -7.175781 5.085938 -7.28125 5.515625 -7.28125 C 6.015625 -7.28125 6.453125 -7.160156 6.828125 -6.921875 C 7.203125 -6.679688 7.488281 -6.347656 7.6875 -5.921875 Z M 7.6875 -5.921875 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph2-4">
|
||||
<path style="stroke:none;" d="M 1.09375 -7.109375 L 3.359375 -7.109375 L 3.359375 0 L 1.09375 0 Z M 1.09375 -9.875 L 3.359375 -9.875 L 3.359375 -8.03125 L 1.09375 -8.03125 Z M 1.09375 -9.875 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph2-5">
|
||||
<path style="stroke:none;" d="M 8.234375 -4.328125 L 8.234375 0 L 5.953125 0 L 5.953125 -3.3125 C 5.953125 -3.925781 5.9375 -4.347656 5.90625 -4.578125 C 5.882812 -4.816406 5.835938 -4.988281 5.765625 -5.09375 C 5.679688 -5.238281 5.5625 -5.351562 5.40625 -5.4375 C 5.257812 -5.519531 5.085938 -5.5625 4.890625 -5.5625 C 4.410156 -5.5625 4.035156 -5.378906 3.765625 -5.015625 C 3.492188 -4.648438 3.359375 -4.144531 3.359375 -3.5 L 3.359375 0 L 1.09375 0 L 1.09375 -7.109375 L 3.359375 -7.109375 L 3.359375 -6.0625 C 3.703125 -6.476562 4.066406 -6.785156 4.453125 -6.984375 C 4.835938 -7.179688 5.265625 -7.28125 5.734375 -7.28125 C 6.554688 -7.28125 7.175781 -7.023438 7.59375 -6.515625 C 8.019531 -6.015625 8.234375 -5.285156 8.234375 -4.328125 Z M 8.234375 -4.328125 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph2-6">
|
||||
<path style="stroke:none;" d="M 6.640625 -6.890625 L 6.640625 -5.15625 C 6.160156 -5.363281 5.691406 -5.515625 5.234375 -5.609375 C 4.785156 -5.710938 4.359375 -5.765625 3.953125 -5.765625 C 3.523438 -5.765625 3.203125 -5.710938 2.984375 -5.609375 C 2.773438 -5.503906 2.671875 -5.335938 2.671875 -5.109375 C 2.671875 -4.929688 2.75 -4.789062 2.90625 -4.6875 C 3.070312 -4.59375 3.359375 -4.519531 3.765625 -4.46875 L 4.171875 -4.421875 C 5.335938 -4.273438 6.117188 -4.03125 6.515625 -3.6875 C 6.921875 -3.351562 7.125 -2.820312 7.125 -2.09375 C 7.125 -1.332031 6.84375 -0.757812 6.28125 -0.375 C 5.726562 0 4.894531 0.1875 3.78125 0.1875 C 3.3125 0.1875 2.828125 0.148438 2.328125 0.078125 C 1.828125 0.00390625 1.3125 -0.109375 0.78125 -0.265625 L 0.78125 -1.984375 C 1.226562 -1.765625 1.691406 -1.597656 2.171875 -1.484375 C 2.648438 -1.378906 3.132812 -1.328125 3.625 -1.328125 C 4.070312 -1.328125 4.40625 -1.382812 4.625 -1.5 C 4.851562 -1.625 4.96875 -1.8125 4.96875 -2.0625 C 4.96875 -2.257812 4.890625 -2.40625 4.734375 -2.5 C 4.578125 -2.601562 4.269531 -2.6875 3.8125 -2.75 L 3.40625 -2.796875 C 2.394531 -2.921875 1.6875 -3.15625 1.28125 -3.5 C 0.875 -3.84375 0.671875 -4.363281 0.671875 -5.0625 C 0.671875 -5.8125 0.925781 -6.367188 1.4375 -6.734375 C 1.957031 -7.097656 2.753906 -7.28125 3.828125 -7.28125 C 4.242188 -7.28125 4.679688 -7.25 5.140625 -7.1875 C 5.597656 -7.125 6.097656 -7.023438 6.640625 -6.890625 Z M 6.640625 -6.890625 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph2-7">
|
||||
<path style="stroke:none;" d="M 3.578125 -9.125 L 3.578125 -7.109375 L 5.921875 -7.109375 L 5.921875 -5.484375 L 3.578125 -5.484375 L 3.578125 -2.46875 C 3.578125 -2.132812 3.640625 -1.910156 3.765625 -1.796875 C 3.898438 -1.679688 4.160156 -1.625 4.546875 -1.625 L 5.71875 -1.625 L 5.71875 0 L 3.765625 0 C 2.867188 0 2.234375 -0.1875 1.859375 -0.5625 C 1.484375 -0.9375 1.296875 -1.570312 1.296875 -2.46875 L 1.296875 -5.484375 L 0.171875 -5.484375 L 0.171875 -7.109375 L 1.296875 -7.109375 L 1.296875 -9.125 Z M 3.578125 -9.125 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph2-8">
|
||||
<path style="stroke:none;" d="M 6.375 -5.171875 C 6.175781 -5.265625 5.976562 -5.332031 5.78125 -5.375 C 5.582031 -5.425781 5.382812 -5.453125 5.1875 -5.453125 C 4.601562 -5.453125 4.148438 -5.265625 3.828125 -4.890625 C 3.515625 -4.515625 3.359375 -3.976562 3.359375 -3.28125 L 3.359375 0 L 1.09375 0 L 1.09375 -7.109375 L 3.359375 -7.109375 L 3.359375 -5.9375 C 3.648438 -6.40625 3.984375 -6.742188 4.359375 -6.953125 C 4.742188 -7.171875 5.203125 -7.28125 5.734375 -7.28125 C 5.804688 -7.28125 5.882812 -7.273438 5.96875 -7.265625 C 6.0625 -7.265625 6.191406 -7.253906 6.359375 -7.234375 Z M 6.375 -5.171875 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph2-9">
|
||||
<path style="stroke:none;" d="M 4.28125 -3.203125 C 3.800781 -3.203125 3.441406 -3.117188 3.203125 -2.953125 C 2.960938 -2.796875 2.84375 -2.5625 2.84375 -2.25 C 2.84375 -1.957031 2.9375 -1.726562 3.125 -1.5625 C 3.320312 -1.40625 3.59375 -1.328125 3.9375 -1.328125 C 4.363281 -1.328125 4.722656 -1.476562 5.015625 -1.78125 C 5.304688 -2.09375 5.453125 -2.476562 5.453125 -2.9375 L 5.453125 -3.203125 Z M 7.75 -4.0625 L 7.75 0 L 5.453125 0 L 5.453125 -1.046875 C 5.148438 -0.617188 4.804688 -0.304688 4.421875 -0.109375 C 4.046875 0.0859375 3.585938 0.1875 3.046875 0.1875 C 2.304688 0.1875 1.707031 -0.0234375 1.25 -0.453125 C 0.789062 -0.890625 0.5625 -1.453125 0.5625 -2.140625 C 0.5625 -2.972656 0.847656 -3.582031 1.421875 -3.96875 C 1.992188 -4.351562 2.894531 -4.546875 4.125 -4.546875 L 5.453125 -4.546875 L 5.453125 -4.734375 C 5.453125 -5.085938 5.3125 -5.347656 5.03125 -5.515625 C 4.75 -5.679688 4.304688 -5.765625 3.703125 -5.765625 C 3.222656 -5.765625 2.769531 -5.71875 2.34375 -5.625 C 1.925781 -5.53125 1.539062 -5.382812 1.1875 -5.1875 L 1.1875 -6.921875 C 1.664062 -7.035156 2.148438 -7.125 2.640625 -7.1875 C 3.140625 -7.25 3.632812 -7.28125 4.125 -7.28125 C 5.40625 -7.28125 6.328125 -7.023438 6.890625 -6.515625 C 7.460938 -6.015625 7.75 -5.195312 7.75 -4.0625 Z M 7.75 -4.0625 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph2-10">
|
||||
<path style="stroke:none;" d="M 4.46875 -5.65625 C 3.96875 -5.65625 3.582031 -5.472656 3.3125 -5.109375 C 3.050781 -4.753906 2.921875 -4.234375 2.921875 -3.546875 C 2.921875 -2.867188 3.050781 -2.347656 3.3125 -1.984375 C 3.582031 -1.617188 3.96875 -1.4375 4.46875 -1.4375 C 4.96875 -1.4375 5.347656 -1.617188 5.609375 -1.984375 C 5.867188 -2.347656 6 -2.867188 6 -3.546875 C 6 -4.234375 5.867188 -4.753906 5.609375 -5.109375 C 5.347656 -5.472656 4.96875 -5.65625 4.46875 -5.65625 Z M 4.46875 -7.28125 C 5.695312 -7.28125 6.65625 -6.945312 7.34375 -6.28125 C 8.03125 -5.625 8.375 -4.710938 8.375 -3.546875 C 8.375 -2.378906 8.03125 -1.460938 7.34375 -0.796875 C 6.65625 -0.140625 5.695312 0.1875 4.46875 0.1875 C 3.25 0.1875 2.289062 -0.140625 1.59375 -0.796875 C 0.90625 -1.460938 0.5625 -2.378906 0.5625 -3.546875 C 0.5625 -4.710938 0.90625 -5.625 1.59375 -6.28125 C 2.289062 -6.945312 3.25 -7.28125 4.46875 -7.28125 Z M 4.46875 -7.28125 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph2-11">
|
||||
<path style="stroke:none;" d="M 8.703125 -0.515625 C 8.253906 -0.285156 7.785156 -0.113281 7.296875 0 C 6.816406 0.125 6.3125 0.1875 5.78125 0.1875 C 4.207031 0.1875 2.957031 -0.253906 2.03125 -1.140625 C 1.101562 -2.023438 0.640625 -3.222656 0.640625 -4.734375 C 0.640625 -6.242188 1.101562 -7.441406 2.03125 -8.328125 C 2.957031 -9.210938 4.207031 -9.65625 5.78125 -9.65625 C 6.3125 -9.65625 6.816406 -9.59375 7.296875 -9.46875 C 7.785156 -9.351562 8.253906 -9.175781 8.703125 -8.9375 L 8.703125 -6.984375 C 8.253906 -7.296875 7.804688 -7.519531 7.359375 -7.65625 C 6.921875 -7.800781 6.460938 -7.875 5.984375 -7.875 C 5.109375 -7.875 4.421875 -7.59375 3.921875 -7.03125 C 3.421875 -6.476562 3.171875 -5.710938 3.171875 -4.734375 C 3.171875 -3.753906 3.421875 -2.984375 3.921875 -2.421875 C 4.421875 -1.867188 5.109375 -1.59375 5.984375 -1.59375 C 6.460938 -1.59375 6.921875 -1.660156 7.359375 -1.796875 C 7.804688 -1.941406 8.253906 -2.171875 8.703125 -2.484375 Z M 8.703125 -0.515625 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph2-12">
|
||||
<path style="stroke:none;" d="M 1.015625 -2.765625 L 1.015625 -7.109375 L 3.296875 -7.109375 L 3.296875 -6.40625 C 3.296875 -6.019531 3.289062 -5.535156 3.28125 -4.953125 C 3.28125 -4.367188 3.28125 -3.976562 3.28125 -3.78125 C 3.28125 -3.207031 3.296875 -2.796875 3.328125 -2.546875 C 3.359375 -2.296875 3.410156 -2.113281 3.484375 -2 C 3.578125 -1.851562 3.695312 -1.738281 3.84375 -1.65625 C 4 -1.570312 4.175781 -1.53125 4.375 -1.53125 C 4.84375 -1.53125 5.210938 -1.710938 5.484375 -2.078125 C 5.753906 -2.441406 5.890625 -2.945312 5.890625 -3.59375 L 5.890625 -7.109375 L 8.15625 -7.109375 L 8.15625 0 L 5.890625 0 L 5.890625 -1.03125 C 5.546875 -0.613281 5.179688 -0.304688 4.796875 -0.109375 C 4.421875 0.0859375 4 0.1875 3.53125 0.1875 C 2.707031 0.1875 2.082031 -0.0625 1.65625 -0.5625 C 1.226562 -1.070312 1.015625 -1.804688 1.015625 -2.765625 Z M 1.015625 -2.765625 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph2-13">
|
||||
<path style="stroke:none;" d="M 8.1875 -3.578125 L 8.1875 -2.921875 L 2.875 -2.921875 C 2.925781 -2.390625 3.117188 -1.988281 3.453125 -1.71875 C 3.785156 -1.457031 4.25 -1.328125 4.84375 -1.328125 C 5.3125 -1.328125 5.796875 -1.394531 6.296875 -1.53125 C 6.804688 -1.675781 7.328125 -1.894531 7.859375 -2.1875 L 7.859375 -0.4375 C 7.316406 -0.226562 6.773438 -0.0703125 6.234375 0.03125 C 5.703125 0.132812 5.164062 0.1875 4.625 0.1875 C 3.34375 0.1875 2.34375 -0.140625 1.625 -0.796875 C 0.914062 -1.453125 0.5625 -2.367188 0.5625 -3.546875 C 0.5625 -4.703125 0.910156 -5.613281 1.609375 -6.28125 C 2.304688 -6.945312 3.269531 -7.28125 4.5 -7.28125 C 5.613281 -7.28125 6.503906 -6.941406 7.171875 -6.265625 C 7.847656 -5.597656 8.1875 -4.703125 8.1875 -3.578125 Z M 5.859375 -4.328125 C 5.859375 -4.765625 5.726562 -5.113281 5.46875 -5.375 C 5.21875 -5.632812 4.890625 -5.765625 4.484375 -5.765625 C 4.046875 -5.765625 3.6875 -5.640625 3.40625 -5.390625 C 3.132812 -5.148438 2.96875 -4.796875 2.90625 -4.328125 Z M 5.859375 -4.328125 "/>
|
||||
</symbol>
|
||||
</g>
|
||||
</defs>
|
||||
<g id="surface25169">
|
||||
<rect x="0" y="0" width="1146" height="548" style="fill:rgb(100%,100%,100%);fill-opacity:1;stroke:none;"/>
|
||||
<path style="fill-rule:evenodd;fill:rgb(100%,100%,100%);fill-opacity:1;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 28.5 4.95 L 35.825 4.95 L 35.825 6.35 L 28.5 6.35 Z M 28.5 4.95 " transform="matrix(20,0,0,20,-26,-8)"/>
|
||||
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
|
||||
<use xlink:href="#glyph0-1" x="537.601562" y="110"/>
|
||||
<use xlink:href="#glyph0-2" x="549.984375" y="110"/>
|
||||
<use xlink:href="#glyph0-3" x="561.371094" y="110"/>
|
||||
<use xlink:href="#glyph0-4" x="572.816406" y="110"/>
|
||||
<use xlink:href="#glyph0-5" x="578.304688" y="110"/>
|
||||
<use xlink:href="#glyph0-6" x="585.960938" y="110"/>
|
||||
<use xlink:href="#glyph0-7" x="623.109375" y="110"/>
|
||||
<use xlink:href="#glyph0-8" x="623.109375" y="110"/>
|
||||
<use xlink:href="#glyph0-9" x="633.96875" y="110"/>
|
||||
<use xlink:href="#glyph0-10" x="650.648438" y="110"/>
|
||||
<use xlink:href="#glyph0-11" x="662.09375" y="110"/>
|
||||
<use xlink:href="#glyph0-12" x="667.582031" y="110"/>
|
||||
<use xlink:href="#glyph0-5" x="678.382812" y="110"/>
|
||||
<use xlink:href="#glyph0-8" x="686.039062" y="110"/>
|
||||
</g>
|
||||
<path style="fill-rule:evenodd;fill:rgb(100%,100%,100%);fill-opacity:1;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 10.6 7 L 19.475 7 L 19.475 8.4 L 10.6 8.4 Z M 10.6 7 " transform="matrix(20,0,0,20,-26,-8)"/>
|
||||
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
|
||||
<use xlink:href="#glyph0-13" x="191" y="151"/>
|
||||
<use xlink:href="#glyph0-10" x="204.59375" y="151"/>
|
||||
<use xlink:href="#glyph0-8" x="216.039063" y="151"/>
|
||||
<use xlink:href="#glyph0-14" x="226.898438" y="151"/>
|
||||
<use xlink:href="#glyph0-15" x="238.285156" y="151"/>
|
||||
<use xlink:href="#glyph0-5" x="249.808594" y="151"/>
|
||||
<use xlink:href="#glyph0-12" x="257.464844" y="151"/>
|
||||
<use xlink:href="#glyph0-16" x="268.265625" y="151"/>
|
||||
<use xlink:href="#glyph0-17" x="277.757812" y="151"/>
|
||||
<use xlink:href="#glyph0-6" x="288.402344" y="151"/>
|
||||
<use xlink:href="#glyph0-18" x="293.96875" y="151"/>
|
||||
<use xlink:href="#glyph0-11" x="305.707031" y="151"/>
|
||||
<use xlink:href="#glyph0-2" x="311.195312" y="151"/>
|
||||
<use xlink:href="#glyph0-19" x="322.582031" y="151"/>
|
||||
<use xlink:href="#glyph0-5" x="332.113281" y="151"/>
|
||||
<use xlink:href="#glyph0-8" x="339.769531" y="151"/>
|
||||
<use xlink:href="#glyph0-20" x="350.628906" y="151"/>
|
||||
</g>
|
||||
<path style="fill:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-dasharray:0.4,0.4;stroke-miterlimit:10;" d="M 28.451953 5.65 L 22.3 5.65 L 22.3 7.7 L 19.85957 7.7 " transform="matrix(20,0,0,20,-26,-8)"/>
|
||||
<path style="fill:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 20.491797 7.45 L 19.691797 7.7 L 20.491797 7.95 " transform="matrix(20,0,0,20,-26,-8)"/>
|
||||
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
|
||||
<use xlink:href="#glyph1-1" x="422" y="121.5"/>
|
||||
<use xlink:href="#glyph1-2" x="429.695313" y="121.5"/>
|
||||
<use xlink:href="#glyph1-2" x="437.390625" y="121.5"/>
|
||||
<use xlink:href="#glyph1-3" x="445.085938" y="121.5"/>
|
||||
<use xlink:href="#glyph1-4" x="452.78125" y="121.5"/>
|
||||
<use xlink:href="#glyph1-5" x="460.476563" y="121.5"/>
|
||||
<use xlink:href="#glyph1-6" x="468.171875" y="121.5"/>
|
||||
<use xlink:href="#glyph1-7" x="475.867188" y="121.5"/>
|
||||
<use xlink:href="#glyph1-8" x="483.5625" y="121.5"/>
|
||||
<use xlink:href="#glyph1-9" x="491.257812" y="121.5"/>
|
||||
</g>
|
||||
<path style="fill-rule:evenodd;fill:rgb(100%,100%,100%);fill-opacity:1;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 30.75 11.35 L 33.669922 11.35 L 33.669922 12.75 L 30.75 12.75 Z M 30.75 11.35 " transform="matrix(20,0,0,20,-26,-8)"/>
|
||||
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
|
||||
<use xlink:href="#glyph0-1" x="594.019531" y="238"/>
|
||||
<use xlink:href="#glyph0-2" x="606.402344" y="238"/>
|
||||
<use xlink:href="#glyph0-3" x="617.789062" y="238"/>
|
||||
<use xlink:href="#glyph0-4" x="629.234375" y="238"/>
|
||||
<use xlink:href="#glyph0-5" x="634.722656" y="238"/>
|
||||
</g>
|
||||
<path style="fill:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-dasharray:0.4,0.4;stroke-miterlimit:10;" d="M 32.209961 11.299805 L 32.209961 9.424805 L 32.215039 9.424805 L 32.215039 6.685352 " transform="matrix(20,0,0,20,-26,-8)"/>
|
||||
<path style="fill:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 32.465039 7.317578 L 32.215039 6.517578 L 31.965039 7.317578 " transform="matrix(20,0,0,20,-26,-8)"/>
|
||||
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
|
||||
<use xlink:href="#glyph1-10" x="529.753906" y="176.496094"/>
|
||||
<use xlink:href="#glyph1-5" x="537.449219" y="176.496094"/>
|
||||
<use xlink:href="#glyph1-8" x="545.144531" y="176.496094"/>
|
||||
<use xlink:href="#glyph1-6" x="552.839844" y="176.496094"/>
|
||||
<use xlink:href="#glyph1-7" x="560.535156" y="176.496094"/>
|
||||
<use xlink:href="#glyph1-11" x="568.230469" y="176.496094"/>
|
||||
<use xlink:href="#glyph1-9" x="575.925781" y="176.496094"/>
|
||||
<use xlink:href="#glyph1-12" x="583.621094" y="176.496094"/>
|
||||
<use xlink:href="#glyph1-13" x="591.316406" y="176.496094"/>
|
||||
<use xlink:href="#glyph1-4" x="599.011719" y="176.496094"/>
|
||||
<use xlink:href="#glyph1-10" x="606.707031" y="176.496094"/>
|
||||
<use xlink:href="#glyph1-14" x="614.402344" y="176.496094"/>
|
||||
<use xlink:href="#glyph1-15" x="622.097656" y="176.496094"/>
|
||||
<use xlink:href="#glyph1-16" x="629.792969" y="176.496094"/>
|
||||
<use xlink:href="#glyph1-8" x="637.488281" y="176.496094"/>
|
||||
<use xlink:href="#glyph1-4" x="645.183594" y="176.496094"/>
|
||||
<use xlink:href="#glyph1-9" x="652.878906" y="176.496094"/>
|
||||
<use xlink:href="#glyph1-12" x="660.574219" y="176.496094"/>
|
||||
<use xlink:href="#glyph1-7" x="668.269531" y="176.496094"/>
|
||||
<use xlink:href="#glyph1-13" x="675.964844" y="176.496094"/>
|
||||
<use xlink:href="#glyph1-15" x="683.660156" y="176.496094"/>
|
||||
<use xlink:href="#glyph1-9" x="691.355469" y="176.496094"/>
|
||||
<use xlink:href="#glyph1-17" x="699.050781" y="176.496094"/>
|
||||
</g>
|
||||
<path style="fill-rule:evenodd;fill:rgb(100%,100%,100%);fill-opacity:1;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 45.8 0.45 L 48.322461 0.45 L 48.322461 1.85 L 45.8 1.85 Z M 45.8 0.45 " transform="matrix(20,0,0,20,-26,-8)"/>
|
||||
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
|
||||
<use xlink:href="#glyph0-21" x="895.03125" y="20"/>
|
||||
<use xlink:href="#glyph0-22" x="908.15625" y="20"/>
|
||||
<use xlink:href="#glyph0-12" x="919.152344" y="20"/>
|
||||
<use xlink:href="#glyph0-11" x="929.953125" y="20"/>
|
||||
</g>
|
||||
<path style="fill:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-dasharray:0.4,0.4;stroke-miterlimit:10;" d="M 32.1625 4.899609 L 32.1625 3.6 L 47.061328 3.6 L 47.061328 2.235547 " transform="matrix(20,0,0,20,-26,-8)"/>
|
||||
<path style="fill:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 47.311328 2.867969 L 47.061328 2.067969 L 46.811328 2.867969 " transform="matrix(20,0,0,20,-26,-8)"/>
|
||||
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
|
||||
<use xlink:href="#glyph1-1" x="735.457031" y="60"/>
|
||||
<use xlink:href="#glyph1-11" x="743.152344" y="60"/>
|
||||
<use xlink:href="#glyph1-18" x="750.847656" y="60"/>
|
||||
<use xlink:href="#glyph1-4" x="758.542969" y="60"/>
|
||||
<use xlink:href="#glyph1-5" x="766.238281" y="60"/>
|
||||
<use xlink:href="#glyph1-19" x="773.933594" y="60"/>
|
||||
<use xlink:href="#glyph1-5" x="781.628906" y="60"/>
|
||||
<use xlink:href="#glyph1-6" x="789.324219" y="60"/>
|
||||
</g>
|
||||
<path style="fill-rule:evenodd;fill:rgb(100%,100%,100%);fill-opacity:1;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 24.75 18.35 L 30.372461 18.35 L 30.372461 19.75 L 24.75 19.75 Z M 24.75 18.35 " transform="matrix(20,0,0,20,-26,-8)"/>
|
||||
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
|
||||
<use xlink:href="#glyph0-1" x="474.054688" y="378"/>
|
||||
<use xlink:href="#glyph0-16" x="486.4375" y="378"/>
|
||||
<use xlink:href="#glyph0-5" x="495.929688" y="378"/>
|
||||
<use xlink:href="#glyph0-4" x="503.585938" y="378"/>
|
||||
<use xlink:href="#glyph0-22" x="509.074219" y="378"/>
|
||||
<use xlink:href="#glyph0-14" x="520.070312" y="378"/>
|
||||
<use xlink:href="#glyph0-6" x="531.457031" y="378"/>
|
||||
<use xlink:href="#glyph0-23" x="537.023438" y="378"/>
|
||||
<use xlink:href="#glyph0-11" x="548.742188" y="378"/>
|
||||
<use xlink:href="#glyph0-12" x="554.230469" y="378"/>
|
||||
<use xlink:href="#glyph0-14" x="565.03125" y="378"/>
|
||||
</g>
|
||||
<path style="fill:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-dasharray:0.4,0.4;stroke-miterlimit:10;" d="M 32.209961 12.8 L 32.209961 14.925 L 26.15 14.925 L 26.15 17.814648 " transform="matrix(20,0,0,20,-26,-8)"/>
|
||||
<path style="fill:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 25.9 17.182422 L 26.15 17.982422 L 26.4 17.182422 " transform="matrix(20,0,0,20,-26,-8)"/>
|
||||
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
|
||||
<use xlink:href="#glyph1-20" x="522.972656" y="286.5"/>
|
||||
<use xlink:href="#glyph1-5" x="530.667969" y="286.5"/>
|
||||
<use xlink:href="#glyph1-12" x="538.363281" y="286.5"/>
|
||||
<use xlink:href="#glyph1-5" x="546.058594" y="286.5"/>
|
||||
<use xlink:href="#glyph1-15" x="553.753906" y="286.5"/>
|
||||
<use xlink:href="#glyph1-16" x="561.449219" y="286.5"/>
|
||||
<use xlink:href="#glyph1-8" x="569.144531" y="286.5"/>
|
||||
<use xlink:href="#glyph1-5" x="576.839844" y="286.5"/>
|
||||
<use xlink:href="#glyph1-6" x="584.535156" y="286.5"/>
|
||||
</g>
|
||||
<path style="fill-rule:evenodd;fill:rgb(100%,100%,100%);fill-opacity:1;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 34.1 23.55 L 37.472461 23.55 L 37.472461 24.95 L 34.1 24.95 Z M 34.1 23.55 " transform="matrix(20,0,0,20,-26,-8)"/>
|
||||
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
|
||||
<use xlink:href="#glyph0-1" x="661.035156" y="482"/>
|
||||
<use xlink:href="#glyph0-16" x="673.417969" y="482"/>
|
||||
<use xlink:href="#glyph0-5" x="682.910156" y="482"/>
|
||||
<use xlink:href="#glyph0-4" x="690.566406" y="482"/>
|
||||
<use xlink:href="#glyph0-22" x="696.054688" y="482"/>
|
||||
<use xlink:href="#glyph0-14" x="707.050781" y="482"/>
|
||||
</g>
|
||||
<path style="fill:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 27.561328 21.047266 L 27.561328 22.15 L 35.786328 22.15 L 35.786328 23.501562 " transform="matrix(20,0,0,20,-26,-8)"/>
|
||||
<path style="fill-rule:evenodd;fill:rgb(0%,0%,0%);fill-opacity:1;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 27.561328 19.788672 L 27.801172 20.488672 L 27.561328 21.188672 L 27.321289 20.488672 Z M 27.561328 19.788672 " transform="matrix(20,0,0,20,-26,-8)"/>
|
||||
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
|
||||
<use xlink:href="#glyph1-4" x="553.609375" y="431"/>
|
||||
<use xlink:href="#glyph1-6" x="561.304688" y="431"/>
|
||||
<use xlink:href="#glyph1-7" x="569" y="431"/>
|
||||
<use xlink:href="#glyph1-11" x="576.695313" y="431"/>
|
||||
<use xlink:href="#glyph1-9" x="584.390625" y="431"/>
|
||||
<use xlink:href="#glyph1-17" x="592.085938" y="431"/>
|
||||
<use xlink:href="#glyph1-2" x="599.78125" y="431"/>
|
||||
<use xlink:href="#glyph1-9" x="607.476563" y="431"/>
|
||||
<use xlink:href="#glyph1-6" x="615.171875" y="431"/>
|
||||
<use xlink:href="#glyph1-5" x="622.867188" y="431"/>
|
||||
<use xlink:href="#glyph1-21" x="630.5625" y="431"/>
|
||||
<use xlink:href="#glyph1-7" x="638.257812" y="431"/>
|
||||
<use xlink:href="#glyph1-9" x="645.953125" y="431"/>
|
||||
<use xlink:href="#glyph1-13" x="653.648438" y="431"/>
|
||||
</g>
|
||||
<path style="fill:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 37.472461 24.95 L 37.472461 25.85 L 43.1 25.85 L 43.1 24.25 L 37.472461 24.25 " transform="matrix(20,0,0,20,-26,-8)"/>
|
||||
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
|
||||
<use xlink:href="#glyph1-22" x="737.402344" y="505"/>
|
||||
<use xlink:href="#glyph1-5" x="745.097656" y="505"/>
|
||||
<use xlink:href="#glyph1-23" x="752.792969" y="505"/>
|
||||
<use xlink:href="#glyph1-8" x="760.488281" y="505"/>
|
||||
<use xlink:href="#glyph1-7" x="768.183594" y="505"/>
|
||||
<use xlink:href="#glyph1-16" x="775.878906" y="505"/>
|
||||
<use xlink:href="#glyph1-11" x="783.574219" y="505"/>
|
||||
<use xlink:href="#glyph1-8" x="791.269531" y="505"/>
|
||||
<use xlink:href="#glyph1-4" x="798.964844" y="505"/>
|
||||
<use xlink:href="#glyph1-9" x="806.660156" y="505"/>
|
||||
<use xlink:href="#glyph1-12" x="814.355469" y="505"/>
|
||||
</g>
|
||||
<path style=" stroke:none;fill-rule:evenodd;fill:rgb(0%,0%,0%);fill-opacity:1;" d="M 824.074219 505 L 824.074219 497 L 832.074219 501 Z M 824.074219 505 "/>
|
||||
<path style="fill-rule:evenodd;fill:rgb(100%,100%,100%);fill-opacity:1;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(100%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 52.1 10.95 C 52.1 11.115625 51.965625 11.25 51.8 11.25 C 51.634375 11.25 51.5 11.115625 51.5 10.95 C 51.5 10.784375 51.634375 10.65 51.8 10.65 C 51.965625 10.65 52.1 10.784375 52.1 10.95 " transform="matrix(20,0,0,20,-26,-8)"/>
|
||||
<path style="fill:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(100%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 50.6 11.55 L 53 11.55 " transform="matrix(20,0,0,20,-26,-8)"/>
|
||||
<path style="fill:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(100%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 51.8 11.25 L 51.8 12.75 " transform="matrix(20,0,0,20,-26,-8)"/>
|
||||
<path style="fill:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(100%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 51.8 12.75 L 50.6 14.05 " transform="matrix(20,0,0,20,-26,-8)"/>
|
||||
<path style="fill:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(100%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 51.8 12.75 L 53 14.05 " transform="matrix(20,0,0,20,-26,-8)"/>
|
||||
<g style="fill:rgb(100%,0%,0%);fill-opacity:1;">
|
||||
<use xlink:href="#glyph2-1" x="959.921875" y="296.898438"/>
|
||||
<use xlink:href="#glyph2-2" x="969.824219" y="296.898438"/>
|
||||
<use xlink:href="#glyph2-3" x="978.984375" y="296.898438"/>
|
||||
<use xlink:href="#glyph2-4" x="992.324219" y="296.898438"/>
|
||||
<use xlink:href="#glyph2-5" x="996.71875" y="296.898438"/>
|
||||
<use xlink:href="#glyph2-4" x="1005.820312" y="296.898438"/>
|
||||
<use xlink:href="#glyph2-6" x="1010.214844" y="296.898438"/>
|
||||
<use xlink:href="#glyph2-7" x="1017.832031" y="296.898438"/>
|
||||
<use xlink:href="#glyph2-8" x="1023.945312" y="296.898438"/>
|
||||
<use xlink:href="#glyph2-9" x="1030.253906" y="296.898438"/>
|
||||
<use xlink:href="#glyph2-7" x="1038.886719" y="296.898438"/>
|
||||
<use xlink:href="#glyph2-10" x="1045" y="296.898438"/>
|
||||
<use xlink:href="#glyph2-8" x="1053.789062" y="296.898438"/>
|
||||
</g>
|
||||
<path style="fill:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-dasharray:0.4,0.4;stroke-miterlimit:10;" d="M 49.295898 12.75 L 41.708203 12.75 L 41.708203 12.05 L 34.055664 12.05 " transform="matrix(20,0,0,20,-26,-8)"/>
|
||||
<path style="fill:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 34.688086 11.8 L 33.888086 12.05 L 34.688086 12.3 " transform="matrix(20,0,0,20,-26,-8)"/>
|
||||
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
|
||||
<use xlink:href="#glyph1-24" x="810.164062" y="236"/>
|
||||
<use xlink:href="#glyph1-15" x="817.859375" y="236"/>
|
||||
<use xlink:href="#glyph1-4" x="825.554688" y="236"/>
|
||||
<use xlink:href="#glyph1-10" x="833.25" y="236"/>
|
||||
<use xlink:href="#glyph1-10" x="840.945312" y="236"/>
|
||||
<use xlink:href="#glyph1-5" x="848.640625" y="236"/>
|
||||
<use xlink:href="#glyph1-15" x="856.335938" y="236"/>
|
||||
<use xlink:href="#glyph1-6" x="864.03125" y="236"/>
|
||||
</g>
|
||||
<path style="fill:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-dasharray:0.4,0.4;stroke-miterlimit:10;" d="M 51.9 9.649609 L 44.0625 9.649609 L 44.0625 5.65 L 36.160352 5.65 " transform="matrix(20,0,0,20,-26,-8)"/>
|
||||
<path style="fill:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 36.792578 5.4 L 35.992578 5.65 L 36.792578 5.9 " transform="matrix(20,0,0,20,-26,-8)"/>
|
||||
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
|
||||
<use xlink:href="#glyph1-25" x="857.25" y="140.996094"/>
|
||||
<use xlink:href="#glyph1-5" x="864.945312" y="140.996094"/>
|
||||
<use xlink:href="#glyph1-13" x="872.640625" y="140.996094"/>
|
||||
<use xlink:href="#glyph1-4" x="880.335938" y="140.996094"/>
|
||||
<use xlink:href="#glyph1-12" x="888.03125" y="140.996094"/>
|
||||
<use xlink:href="#glyph1-5" x="895.726562" y="140.996094"/>
|
||||
<use xlink:href="#glyph1-6" x="903.421875" y="140.996094"/>
|
||||
<use xlink:href="#glyph1-7" x="911.117188" y="140.996094"/>
|
||||
<use xlink:href="#glyph1-1" x="918.8125" y="140.996094"/>
|
||||
<use xlink:href="#glyph1-14" x="926.507812" y="140.996094"/>
|
||||
<use xlink:href="#glyph1-21" x="934.203125" y="140.996094"/>
|
||||
<use xlink:href="#glyph1-4" x="941.898438" y="140.996094"/>
|
||||
<use xlink:href="#glyph1-8" x="949.59375" y="140.996094"/>
|
||||
<use xlink:href="#glyph1-7" x="957.289062" y="140.996094"/>
|
||||
<use xlink:href="#glyph1-11" x="964.984375" y="140.996094"/>
|
||||
<use xlink:href="#glyph1-9" x="972.679688" y="140.996094"/>
|
||||
<use xlink:href="#glyph1-12" x="980.375" y="140.996094"/>
|
||||
<use xlink:href="#glyph1-13" x="988.070312" y="140.996094"/>
|
||||
<use xlink:href="#glyph1-4" x="995.765625" y="140.996094"/>
|
||||
<use xlink:href="#glyph1-10" x="1003.460938" y="140.996094"/>
|
||||
<use xlink:href="#glyph1-14" x="1011.15625" y="140.996094"/>
|
||||
<use xlink:href="#glyph1-15" x="1018.851562" y="140.996094"/>
|
||||
<use xlink:href="#glyph1-16" x="1026.546875" y="140.996094"/>
|
||||
<use xlink:href="#glyph1-8" x="1034.242188" y="140.996094"/>
|
||||
<use xlink:href="#glyph1-4" x="1041.9375" y="140.996094"/>
|
||||
<use xlink:href="#glyph1-9" x="1049.632812" y="140.996094"/>
|
||||
<use xlink:href="#glyph1-12" x="1057.328125" y="140.996094"/>
|
||||
<use xlink:href="#glyph1-7" x="1065.023438" y="140.996094"/>
|
||||
<use xlink:href="#glyph1-4" x="1072.71875" y="140.996094"/>
|
||||
<use xlink:href="#glyph1-12" x="1080.414062" y="140.996094"/>
|
||||
</g>
|
||||
<path style="fill-rule:evenodd;fill:rgb(100%,100%,100%);fill-opacity:1;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(100%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 5.45 1.4 C 5.45 1.565625 5.315625 1.7 5.15 1.7 C 4.984375 1.7 4.85 1.565625 4.85 1.4 C 4.85 1.234375 4.984375 1.1 5.15 1.1 C 5.315625 1.1 5.45 1.234375 5.45 1.4 " transform="matrix(20,0,0,20,-26,-8)"/>
|
||||
<path style="fill:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(100%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 3.95 2 L 6.35 2 " transform="matrix(20,0,0,20,-26,-8)"/>
|
||||
<path style="fill:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(100%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 5.15 1.7 L 5.15 3.2 " transform="matrix(20,0,0,20,-26,-8)"/>
|
||||
<path style="fill:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(100%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 5.15 3.2 L 3.95 4.5 " transform="matrix(20,0,0,20,-26,-8)"/>
|
||||
<path style="fill:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(100%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 5.15 3.2 L 6.35 4.5 " transform="matrix(20,0,0,20,-26,-8)"/>
|
||||
<g style="fill:rgb(100%,0%,0%);fill-opacity:1;">
|
||||
<use xlink:href="#glyph2-11" x="42.332031" y="105.898438"/>
|
||||
<use xlink:href="#glyph2-12" x="51.726562" y="105.898438"/>
|
||||
<use xlink:href="#glyph2-6" x="60.828125" y="105.898438"/>
|
||||
<use xlink:href="#glyph2-7" x="68.445312" y="105.898438"/>
|
||||
<use xlink:href="#glyph2-10" x="74.558594" y="105.898438"/>
|
||||
<use xlink:href="#glyph2-3" x="83.347656" y="105.898438"/>
|
||||
<use xlink:href="#glyph2-13" x="96.6875" y="105.898438"/>
|
||||
<use xlink:href="#glyph2-8" x="105.359375" y="105.898438"/>
|
||||
</g>
|
||||
<path style="fill:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-dasharray:0.4,0.4;stroke-miterlimit:10;" d="M 6.88418 3.2 L 15.0375 3.2 L 15.0375 6.664648 " transform="matrix(20,0,0,20,-26,-8)"/>
|
||||
<path style="fill:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 14.7875 6.032422 L 15.0375 6.832422 L 15.2875 6.032422 " transform="matrix(20,0,0,20,-26,-8)"/>
|
||||
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
|
||||
<use xlink:href="#glyph1-26" x="123.957031" y="52"/>
|
||||
<use xlink:href="#glyph1-9" x="131.652344" y="52"/>
|
||||
<use xlink:href="#glyph1-12" x="139.347656" y="52"/>
|
||||
<use xlink:href="#glyph1-6" x="147.042969" y="52"/>
|
||||
<use xlink:href="#glyph1-14" x="154.738281" y="52"/>
|
||||
<use xlink:href="#glyph1-17" x="162.433594" y="52"/>
|
||||
<use xlink:href="#glyph1-5" x="170.128906" y="52"/>
|
||||
<use xlink:href="#glyph1-6" x="177.824219" y="52"/>
|
||||
<use xlink:href="#glyph1-7" x="185.519531" y="52"/>
|
||||
<use xlink:href="#glyph1-15" x="193.214844" y="52"/>
|
||||
<use xlink:href="#glyph1-5" x="200.910156" y="52"/>
|
||||
<use xlink:href="#glyph1-6" x="208.605469" y="52"/>
|
||||
<use xlink:href="#glyph1-9" x="216.300781" y="52"/>
|
||||
<use xlink:href="#glyph1-14" x="223.996094" y="52"/>
|
||||
<use xlink:href="#glyph1-15" x="231.691406" y="52"/>
|
||||
<use xlink:href="#glyph1-11" x="239.386719" y="52"/>
|
||||
<use xlink:href="#glyph1-5" x="247.082031" y="52"/>
|
||||
<use xlink:href="#glyph1-6" x="254.777344" y="52"/>
|
||||
</g>
|
||||
<path style="fill-rule:evenodd;fill:rgb(100%,100%,100%);fill-opacity:1;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 1.35 12.9 L 6.490039 12.9 L 6.490039 14.3 L 1.35 14.3 Z M 1.35 12.9 " transform="matrix(20,0,0,20,-26,-8)"/>
|
||||
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
|
||||
<use xlink:href="#glyph0-24" x="5.972656" y="269"/>
|
||||
<use xlink:href="#glyph0-8" x="18.296875" y="269"/>
|
||||
<use xlink:href="#glyph0-19" x="29.15625" y="269"/>
|
||||
<use xlink:href="#glyph0-22" x="38.6875" y="269"/>
|
||||
<use xlink:href="#glyph0-2" x="49.683594" y="269"/>
|
||||
<use xlink:href="#glyph0-20" x="61.070312" y="269"/>
|
||||
<use xlink:href="#glyph0-16" x="68.960938" y="269"/>
|
||||
<use xlink:href="#glyph0-8" x="78.453125" y="269"/>
|
||||
<use xlink:href="#glyph0-19" x="89.3125" y="269"/>
|
||||
</g>
|
||||
<path style="fill:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 9.341406 7.7 L 3.919922 7.7 L 3.919922 12.9 " transform="matrix(20,0,0,20,-26,-8)"/>
|
||||
<path style="fill-rule:evenodd;fill:rgb(0%,0%,0%);fill-opacity:1;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 10.6 7.7 L 9.9 7.940039 L 9.2 7.7 L 9.9 7.459961 Z M 10.6 7.7 " transform="matrix(20,0,0,20,-26,-8)"/>
|
||||
<path style="fill:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-dasharray:0.4,0.4;stroke-miterlimit:10;" d="M 35.786133 24.95 L 35.786133 27 L 3.919922 27 L 3.919922 14.635352 " transform="matrix(20,0,0,20,-26,-8)"/>
|
||||
<path style="fill:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 4.169922 15.267578 L 3.919922 14.467578 L 3.669922 15.267578 " transform="matrix(20,0,0,20,-26,-8)"/>
|
||||
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
|
||||
<use xlink:href="#glyph1-27" x="340.28125" y="528"/>
|
||||
<use xlink:href="#glyph1-9" x="347.976563" y="528"/>
|
||||
<use xlink:href="#glyph1-21" x="355.671875" y="528"/>
|
||||
<use xlink:href="#glyph1-4" x="363.367188" y="528"/>
|
||||
<use xlink:href="#glyph1-13" x="371.0625" y="528"/>
|
||||
<use xlink:href="#glyph1-4" x="378.757813" y="528"/>
|
||||
<use xlink:href="#glyph1-5" x="386.453125" y="528"/>
|
||||
<use xlink:href="#glyph1-6" x="394.148438" y="528"/>
|
||||
</g>
|
||||
<path style="fill:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-dasharray:0.4,0.4;stroke-miterlimit:10;" d="M 51.8 15.49707 L 51.8 19.05 L 30.707813 19.05 " transform="matrix(20,0,0,20,-26,-8)"/>
|
||||
<path style="fill:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 31.340039 18.8 L 30.540039 19.05 L 31.340039 19.3 " transform="matrix(20,0,0,20,-26,-8)"/>
|
||||
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
|
||||
<use xlink:href="#glyph1-28" x="764.945312" y="369"/>
|
||||
<use xlink:href="#glyph1-16" x="772.640625" y="369"/>
|
||||
<use xlink:href="#glyph1-14" x="780.335938" y="369"/>
|
||||
<use xlink:href="#glyph1-12" x="788.03125" y="369"/>
|
||||
<use xlink:href="#glyph1-11" x="795.726562" y="369"/>
|
||||
<use xlink:href="#glyph1-18" x="803.421875" y="369"/>
|
||||
<use xlink:href="#glyph1-5" x="811.117188" y="369"/>
|
||||
<use xlink:href="#glyph1-6" x="818.8125" y="369"/>
|
||||
</g>
|
||||
<path style="fill-rule:evenodd;fill:rgb(100%,100%,100%);fill-opacity:1;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 54.144922 2.155078 L 58.557422 2.155078 L 58.557422 3.555078 L 54.144922 3.555078 Z M 54.144922 2.155078 " transform="matrix(20,0,0,20,-26,-8)"/>
|
||||
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
|
||||
<use xlink:href="#glyph0-15" x="1061.902344" y="54.101562"/>
|
||||
<use xlink:href="#glyph0-5" x="1073.425781" y="54.101562"/>
|
||||
<use xlink:href="#glyph0-20" x="1081.082031" y="54.101562"/>
|
||||
<use xlink:href="#glyph0-12" x="1088.972656" y="54.101562"/>
|
||||
<use xlink:href="#glyph0-5" x="1099.773438" y="54.101562"/>
|
||||
<use xlink:href="#glyph0-8" x="1107.429688" y="54.101562"/>
|
||||
<use xlink:href="#glyph0-25" x="1118.289062" y="54.101562"/>
|
||||
<use xlink:href="#glyph0-26" x="1129.734375" y="54.101562"/>
|
||||
</g>
|
||||
<path style="fill:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-dasharray:0.4,0.4;stroke-miterlimit:10;" d="M 48.322461 1.15 L 51.008594 1.15 L 51.008594 2.855078 L 53.760742 2.855078 " transform="matrix(20,0,0,20,-26,-8)"/>
|
||||
<path style="fill:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 53.12832 3.105078 L 53.92832 2.855078 L 53.12832 2.605078 " transform="matrix(20,0,0,20,-26,-8)"/>
|
||||
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
|
||||
<use xlink:href="#glyph1-14" x="996.171875" y="28.050781"/>
|
||||
<use xlink:href="#glyph1-6" x="1003.867188" y="28.050781"/>
|
||||
<use xlink:href="#glyph1-5" x="1011.5625" y="28.050781"/>
|
||||
<use xlink:href="#glyph1-6" x="1019.257812" y="28.050781"/>
|
||||
</g>
|
||||
<path style="fill:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 27.561328 21.058594 L 27.561328 22.15 L 19.345703 22.15 L 19.345703 23.652734 " transform="matrix(20,0,0,20,-26,-8)"/>
|
||||
<path style="fill-rule:evenodd;fill:rgb(0%,0%,0%);fill-opacity:1;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 27.561328 19.8 L 27.801172 20.5 L 27.561328 21.2 L 27.321289 20.5 Z M 27.561328 19.8 " transform="matrix(20,0,0,20,-26,-8)"/>
|
||||
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
|
||||
<use xlink:href="#glyph1-4" x="389.203125" y="431"/>
|
||||
<use xlink:href="#glyph1-6" x="396.898438" y="431"/>
|
||||
<use xlink:href="#glyph1-7" x="404.59375" y="431"/>
|
||||
<use xlink:href="#glyph1-11" x="412.289062" y="431"/>
|
||||
<use xlink:href="#glyph1-9" x="419.984375" y="431"/>
|
||||
<use xlink:href="#glyph1-17" x="427.679688" y="431"/>
|
||||
<use xlink:href="#glyph1-2" x="435.375" y="431"/>
|
||||
<use xlink:href="#glyph1-9" x="443.070312" y="431"/>
|
||||
<use xlink:href="#glyph1-6" x="450.765625" y="431"/>
|
||||
<use xlink:href="#glyph1-5" x="458.460938" y="431"/>
|
||||
<use xlink:href="#glyph1-21" x="466.15625" y="431"/>
|
||||
<use xlink:href="#glyph1-7" x="473.851562" y="431"/>
|
||||
<use xlink:href="#glyph1-9" x="481.546875" y="431"/>
|
||||
<use xlink:href="#glyph1-13" x="489.242188" y="431"/>
|
||||
</g>
|
||||
<path style="fill-rule:evenodd;fill:rgb(100%,100%,100%);fill-opacity:1;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 15.201953 23.652734 L 23.489453 23.652734 L 23.489453 25.052734 L 15.201953 25.052734 Z M 15.201953 23.652734 " transform="matrix(20,0,0,20,-26,-8)"/>
|
||||
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
|
||||
<use xlink:href="#glyph0-27" x="283.082031" y="484.054688"/>
|
||||
<use xlink:href="#glyph0-28" x="294.019531" y="484.054688"/>
|
||||
<use xlink:href="#glyph0-16" x="311.871094" y="484.054688"/>
|
||||
<use xlink:href="#glyph0-12" x="321.363281" y="484.054688"/>
|
||||
<use xlink:href="#glyph0-16" x="332.164062" y="484.054688"/>
|
||||
<use xlink:href="#glyph0-26" x="341.65625" y="484.054688"/>
|
||||
<use xlink:href="#glyph0-6" x="352.085938" y="484.054688"/>
|
||||
<use xlink:href="#glyph0-29" x="357.652344" y="484.054688"/>
|
||||
<use xlink:href="#glyph0-14" x="363.609375" y="484.054688"/>
|
||||
<use xlink:href="#glyph0-3" x="374.996094" y="484.054688"/>
|
||||
<use xlink:href="#glyph0-4" x="386.441406" y="484.054688"/>
|
||||
<use xlink:href="#glyph0-16" x="391.929688" y="484.054688"/>
|
||||
<use xlink:href="#glyph0-12" x="401.421875" y="484.054688"/>
|
||||
<use xlink:href="#glyph0-5" x="412.222656" y="484.054688"/>
|
||||
<use xlink:href="#glyph0-22" x="419.878906" y="484.054688"/>
|
||||
<use xlink:href="#glyph0-20" x="430.875" y="484.054688"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 86 KiB |
BIN
doc/source/images/sequence_architecture_cdmc_sync.png
Normal file
|
After Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 72 KiB |
|
Before Width: | Height: | Size: 89 KiB |
BIN
doc/source/images/watcher_db_schema_diagram.png
Normal file
|
After Width: | Height: | Size: 56 KiB |
@@ -57,6 +57,7 @@ Getting Started
|
||||
deploy/configuration
|
||||
deploy/conf-files
|
||||
dev/testing
|
||||
dev/rally_link
|
||||
|
||||
API References
|
||||
--------------
|
||||
@@ -73,7 +74,10 @@ Plugins
|
||||
:maxdepth: 1
|
||||
|
||||
dev/plugin/base-setup
|
||||
dev/plugin/goal-plugin
|
||||
dev/plugin/scoring-engine-plugin
|
||||
dev/plugin/strategy-plugin
|
||||
dev/plugin/cdmc-plugin
|
||||
dev/plugin/action-plugin
|
||||
dev/plugin/planner-plugin
|
||||
dev/plugins
|
||||
@@ -90,6 +94,7 @@ Introduction
|
||||
|
||||
deploy/installation
|
||||
deploy/user-guide
|
||||
deploy/policy
|
||||
deploy/gmr
|
||||
|
||||
Watcher Manual Pages
|
||||
|
||||
@@ -1,5 +1,41 @@
|
||||
{
|
||||
"admin_api": "role:admin or role:administrator",
|
||||
"show_password": "!",
|
||||
"default": "rule:admin_api"
|
||||
"default": "rule:admin_api",
|
||||
|
||||
"action:detail": "rule:default",
|
||||
"action:get": "rule:default",
|
||||
"action:get_all": "rule:default",
|
||||
|
||||
"action_plan:delete": "rule:default",
|
||||
"action_plan:detail": "rule:default",
|
||||
"action_plan:get": "rule:default",
|
||||
"action_plan:get_all": "rule:default",
|
||||
"action_plan:update": "rule:default",
|
||||
|
||||
"audit:create": "rule:default",
|
||||
"audit:delete": "rule:default",
|
||||
"audit:detail": "rule:default",
|
||||
"audit:get": "rule:default",
|
||||
"audit:get_all": "rule:default",
|
||||
"audit:update": "rule:default",
|
||||
|
||||
"audit_template:create": "rule:default",
|
||||
"audit_template:delete": "rule:default",
|
||||
"audit_template:detail": "rule:default",
|
||||
"audit_template:get": "rule:default",
|
||||
"audit_template:get_all": "rule:default",
|
||||
"audit_template:update": "rule:default",
|
||||
|
||||
"goal:detail": "rule:default",
|
||||
"goal:get": "rule:default",
|
||||
"goal:get_all": "rule:default",
|
||||
|
||||
"scoring_engine:detail": "rule:default",
|
||||
"scoring_engine:get": "rule:default",
|
||||
"scoring_engine:get_all": "rule:default",
|
||||
|
||||
"strategy:detail": "rule:default",
|
||||
"strategy:get": "rule:default",
|
||||
"strategy:get_all": "rule:default"
|
||||
}
|
||||
|
||||
@@ -4,6 +4,13 @@ wrap_width = 79
|
||||
|
||||
namespace = watcher
|
||||
namespace = keystonemiddleware.auth_token
|
||||
namespace = oslo.log
|
||||
namespace = oslo.cache
|
||||
namespace = oslo.concurrency
|
||||
namespace = oslo.db
|
||||
namespace = oslo.log
|
||||
namespace = oslo.messaging
|
||||
namespace = oslo.policy
|
||||
namespace = oslo.reports
|
||||
namespace = oslo.service.periodic_task
|
||||
namespace = oslo.service.service
|
||||
namespace = oslo.service.wsgi
|
||||
|
||||
42
rally-jobs/README.rst
Normal file
@@ -0,0 +1,42 @@
|
||||
Rally job
|
||||
=========
|
||||
|
||||
We provide, with Watcher, a Rally plugin you can use to benchmark the optimization service.
|
||||
|
||||
To launch this task with configured Rally you just need to run:
|
||||
|
||||
::
|
||||
|
||||
rally task start watcher/rally-jobs/watcher.yaml
|
||||
|
||||
Structure
|
||||
---------
|
||||
|
||||
* plugins - directory where you can add rally plugins. Almost everything in
|
||||
Rally is a plugin. Benchmark context, Benchmark scenario, SLA checks, Generic
|
||||
cleanup resources, ....
|
||||
|
||||
* extra - all files from this directory will be copy pasted to gates, so you
|
||||
are able to use absolute paths in rally tasks.
|
||||
Files will be located in ~/.rally/extra/*
|
||||
|
||||
* watcher.yaml is a task that is run in gates against OpenStack
|
||||
deployed by DevStack
|
||||
|
||||
|
||||
Useful links
|
||||
------------
|
||||
|
||||
* How to install: http://docs.openstack.org/developer/rally/install.html
|
||||
|
||||
* How to set Rally up and launch your first scenario: https://rally.readthedocs.io/en/latest/tutorial/step_1_setting_up_env_and_running_benchmark_from_samples.html
|
||||
|
||||
* More about Rally: https://rally.readthedocs.org/en/latest/
|
||||
|
||||
* Rally release notes: https://rally.readthedocs.org/en/latest/release_notes.html
|
||||
|
||||
* How to add rally-gates: https://rally.readthedocs.org/en/latest/gates.html
|
||||
|
||||
* About plugins: https://rally.readthedocs.org/en/latest/plugins.html
|
||||
|
||||
* Plugin samples: https://github.com/openstack/rally/tree/master/samples/plugins
|
||||
67
rally-jobs/watcher-watcher.yaml
Normal file
@@ -0,0 +1,67 @@
|
||||
---
|
||||
Watcher.create_audit_and_delete:
|
||||
-
|
||||
runner:
|
||||
type: "constant"
|
||||
times: 10
|
||||
concurrency: 2
|
||||
context:
|
||||
users:
|
||||
tenants: 2
|
||||
users_per_tenant: 2
|
||||
audit_templates:
|
||||
audit_templates_per_admin: 5
|
||||
fill_strategy: "round_robin"
|
||||
params:
|
||||
- goal:
|
||||
name: "dummy"
|
||||
strategy:
|
||||
name: "dummy"
|
||||
extra: {}
|
||||
sla:
|
||||
failure_rate:
|
||||
max: 0
|
||||
|
||||
Watcher.create_audit_template_and_delete:
|
||||
-
|
||||
args:
|
||||
goal:
|
||||
name: "dummy"
|
||||
strategy:
|
||||
name: "dummy"
|
||||
extra: {}
|
||||
runner:
|
||||
type: "constant"
|
||||
times: 10
|
||||
concurrency: 2
|
||||
sla:
|
||||
failure_rate:
|
||||
max: 0
|
||||
|
||||
Watcher.list_audit_templates:
|
||||
-
|
||||
runner:
|
||||
type: "constant"
|
||||
times: 10
|
||||
concurrency: 2
|
||||
context:
|
||||
users:
|
||||
tenants: 2
|
||||
users_per_tenant: 2
|
||||
audit_templates:
|
||||
audit_templates_per_admin: 5
|
||||
fill_strategy: "random"
|
||||
params:
|
||||
- goal:
|
||||
name: "workload_balancing"
|
||||
strategy:
|
||||
name: "workload_stabilization"
|
||||
extra: {}
|
||||
- goal:
|
||||
name: "dummy"
|
||||
strategy:
|
||||
name: "dummy"
|
||||
extra: {}
|
||||
sla:
|
||||
failure_rate:
|
||||
max: 0
|
||||
@@ -0,0 +1,8 @@
|
||||
---
|
||||
features:
|
||||
- Added a standard way to both declare and fetch
|
||||
configuration options so that whenever the
|
||||
administrator generates the Watcher
|
||||
configuration sample file, it contains the
|
||||
configuration options of the plugins that are
|
||||
currently available.
|
||||
@@ -0,0 +1,7 @@
|
||||
---
|
||||
features:
|
||||
- Added a generic scoring engine module, which
|
||||
will standarize interactions with scoring engines
|
||||
through the common API. It is possible to use the
|
||||
scoring engine by different Strategies, which
|
||||
improve the code and data model re-use.
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
features:
|
||||
- Added an in-memory cache of the cluster model
|
||||
built up and kept fresh via notifications from
|
||||
services of interest in addition to periodic
|
||||
syncing logic.
|
||||
@@ -0,0 +1,4 @@
|
||||
---
|
||||
features:
|
||||
- Added a way to add a new action without having to
|
||||
amend the source code of the default planner.
|
||||
@@ -0,0 +1,4 @@
|
||||
---
|
||||
features:
|
||||
- Added a way to create periodic audit to be able to
|
||||
optimize continuously the cloud infrastructure.
|
||||
@@ -0,0 +1,4 @@
|
||||
---
|
||||
features:
|
||||
- Added a way to compare the efficacy of different
|
||||
strategies for a give optimization goal.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
features:
|
||||
- Added a way to return the of available goals depending
|
||||
on which strategies have been deployed on the node
|
||||
where the decison engine is running.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
features:
|
||||
- Allow decision engine to pass strategy parameters,
|
||||
like optimization threshold, to selected strategy,
|
||||
also strategy to provide parameters info to end user.
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
features:
|
||||
- Copy all audit templates parameters into
|
||||
audit instead of having a reference to the
|
||||
audit template.
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
---
|
||||
features:
|
||||
- Added a strategy that monitors if there is a higher
|
||||
load on some hosts compared to other hosts in the
|
||||
cluster and re-balances the work across hosts to
|
||||
minimize the standard deviation of the loads in
|
||||
the cluster.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
features:
|
||||
- Added a new strategy based on the airflow
|
||||
of servers. This strategy makes decisions
|
||||
to migrate VMs to make the airflow uniform.
|
||||
@@ -0,0 +1,4 @@
|
||||
---
|
||||
features:
|
||||
- Added policies to handle user rights
|
||||
to access Watcher API.
|
||||
@@ -0,0 +1,7 @@
|
||||
---
|
||||
features:
|
||||
- Added a strategy based on the VM workloads of
|
||||
hypervisors. This strategy makes decisions to
|
||||
migrate workloads to make the total VM workloads
|
||||
of each hypervisor balanced, when the total VM
|
||||
workloads of hypervisor reaches threshold.
|
||||
244
releasenotes/source/conf.py
Normal file
@@ -0,0 +1,244 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# watcher documentation build configuration file, created by
|
||||
# sphinx-quickstart on Fri Jun 3 11:37:52 2016.
|
||||
#
|
||||
# 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.
|
||||
|
||||
import sys, os
|
||||
from watcher import version as watcher_version
|
||||
|
||||
# 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.
|
||||
#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 = ['reno.sphinxext',
|
||||
'oslosphinx']
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
|
||||
# The suffix of source filenames.
|
||||
source_suffix = '.rst'
|
||||
|
||||
# The encoding of source files.
|
||||
#source_encoding = 'utf-8-sig'
|
||||
|
||||
# The master toctree document.
|
||||
master_doc = 'index'
|
||||
|
||||
# General information about the project.
|
||||
project = u'watcher'
|
||||
copyright = u'2016, Watcher developers'
|
||||
|
||||
# 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 = watcher_version.version_info.release_string()
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = watcher_version.version_info.version_string()
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
#language = None
|
||||
|
||||
# There are two options for replacing |today|: either, you set today to some
|
||||
# non-false value, then it is used:
|
||||
#today = ''
|
||||
# Else, today_fmt is used as the format for a strftime call.
|
||||
#today_fmt = '%B %d, %Y'
|
||||
|
||||
# List of patterns, relative to source directory, that match files and
|
||||
# directories to ignore when looking for source files.
|
||||
exclude_patterns = ['_build']
|
||||
|
||||
# The reST default role (used for this markup: `text`) to use for all documents
|
||||
#default_role = None
|
||||
|
||||
# If true, '()' will be appended to :func: etc. cross-reference text.
|
||||
#add_function_parentheses = True
|
||||
|
||||
# If true, the current module name will be prepended to all description
|
||||
# unit titles (such as .. function::).
|
||||
#add_module_names = True
|
||||
|
||||
# If true, sectionauthor and moduleauthor directives will be shown in the
|
||||
# output. They are ignored by default.
|
||||
#show_authors = False
|
||||
|
||||
# The name of the Pygments (syntax highlighting) style to use.
|
||||
pygments_style = 'sphinx'
|
||||
|
||||
# A list of ignored prefixes for module index sorting.
|
||||
#modindex_common_prefix = []
|
||||
|
||||
|
||||
# -- 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 themes here, relative to this directory.
|
||||
#html_theme_path = []
|
||||
|
||||
# The name for this set of Sphinx documents. If None, it defaults to
|
||||
# "<project> v<release> documentation".
|
||||
#html_title = None
|
||||
|
||||
# A shorter title for the navigation bar. Default is the same as html_title.
|
||||
#html_short_title = None
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top
|
||||
# of the sidebar.
|
||||
#html_logo = None
|
||||
|
||||
# The name of an image file (within the static path) to use as favicon of the
|
||||
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
|
||||
# pixels large.
|
||||
#html_favicon = None
|
||||
|
||||
# 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']
|
||||
|
||||
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
|
||||
# using the given strftime format.
|
||||
#html_last_updated_fmt = '%b %d, %Y'
|
||||
|
||||
# If true, SmartyPants will be used to convert quotes and dashes to
|
||||
# typographically correct entities.
|
||||
#html_use_smartypants = True
|
||||
|
||||
# Custom sidebar templates, maps document names to template names.
|
||||
#html_sidebars = {}
|
||||
|
||||
# Additional templates that should be rendered to pages, maps page names to
|
||||
# template names.
|
||||
#html_additional_pages = {}
|
||||
|
||||
# If false, no module index is generated.
|
||||
#html_domain_indices = True
|
||||
|
||||
# If false, no index is generated.
|
||||
#html_use_index = True
|
||||
|
||||
# If true, the index is split into individual pages for each letter.
|
||||
#html_split_index = False
|
||||
|
||||
# If true, links to the reST sources are added to the pages.
|
||||
#html_show_sourcelink = True
|
||||
|
||||
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
|
||||
#html_show_sphinx = True
|
||||
|
||||
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
|
||||
#html_show_copyright = True
|
||||
|
||||
# If true, an OpenSearch description file will be output, and all pages will
|
||||
# contain a <link> tag referring to it. The value of this option must be the
|
||||
# base URL from which the finished HTML is served.
|
||||
#html_use_opensearch = ''
|
||||
|
||||
# This is the file name suffix for HTML files (e.g. ".xhtml").
|
||||
#html_file_suffix = None
|
||||
|
||||
# Output file base name for HTML help builder.
|
||||
htmlhelp_basename = 'watcherdoc'
|
||||
|
||||
|
||||
# -- Options for LaTeX output -------------------------------------------------
|
||||
|
||||
latex_elements = {
|
||||
# The paper size ('letterpaper' or 'a4paper').
|
||||
#'papersize': 'letterpaper',
|
||||
|
||||
# The font size ('10pt', '11pt' or '12pt').
|
||||
#'pointsize': '10pt',
|
||||
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
#'preamble': '',
|
||||
}
|
||||
|
||||
# Grouping the document tree into LaTeX files. List of tuples
|
||||
# (source start file, target name, title, author, documentclass [howto/manual])
|
||||
latex_documents = [
|
||||
('index', 'watcher.tex', u'Watcher Documentation',
|
||||
u'Watcher developers', 'manual'),
|
||||
]
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top of
|
||||
# the title page.
|
||||
#latex_logo = None
|
||||
|
||||
# For "manual" documents, if this is true, then toplevel headings are parts,
|
||||
# not chapters.
|
||||
#latex_use_parts = False
|
||||
|
||||
# If true, show page references after internal links.
|
||||
#latex_show_pagerefs = False
|
||||
|
||||
# If true, show URL addresses after external links.
|
||||
#latex_show_urls = False
|
||||
|
||||
# Documents to append as an appendix to all manuals.
|
||||
#latex_appendices = []
|
||||
|
||||
# If false, no module index is generated.
|
||||
#latex_domain_indices = True
|
||||
|
||||
|
||||
# -- Options for manual page output -------------------------------------------
|
||||
|
||||
# One entry per manual page. List of tuples
|
||||
# (source start file, name, description, authors, manual section).
|
||||
man_pages = [
|
||||
('index', 'watcher', u'Watcher Documentation',
|
||||
[u'Watcher developers'], 1)
|
||||
]
|
||||
|
||||
# If true, show URL addresses after external links.
|
||||
#man_show_urls = False
|
||||
|
||||
|
||||
# -- Options for Texinfo output -----------------------------------------------
|
||||
|
||||
# Grouping the document tree into Texinfo files. List of tuples
|
||||
# (source start file, target name, title, author,
|
||||
# dir menu entry, description, category)
|
||||
texinfo_documents = [
|
||||
('index', 'watcher', u'Watcher Documentation',
|
||||
u'Watcher developers', 'watcher', 'One line description of project.',
|
||||
'Miscellaneous'),
|
||||
]
|
||||
|
||||
# Documents to append as an appendix to all manuals.
|
||||
#texinfo_appendices = []
|
||||
|
||||
# If false, no module index is generated.
|
||||
#texinfo_domain_indices = True
|
||||
|
||||
# How to display URL addresses: 'footnote', 'no', or 'inline'.
|
||||
#texinfo_show_urls = 'footnote'
|
||||
10
releasenotes/source/index.rst
Normal file
@@ -0,0 +1,10 @@
|
||||
Welcome to watcher's Release Notes documentation!
|
||||
=================================================
|
||||
|
||||
Contents:
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
unreleased.rst
|
||||
|
||||
5
releasenotes/source/unreleased.rst
Normal file
@@ -0,0 +1,5 @@
|
||||
==============================
|
||||
Current Series Release Notes
|
||||
==============================
|
||||
|
||||
.. release-notes::
|
||||
@@ -2,37 +2,40 @@
|
||||
# of appearance. Changing the order has an impact on the overall integration
|
||||
# process, which may cause wedges in the gate later.
|
||||
|
||||
apscheduler # MIT License
|
||||
enum34;python_version=='2.7' or python_version=='2.6' or python_version=='3.3' # BSD
|
||||
jsonpatch>=1.1 # BSD
|
||||
keystoneauth1>=2.1.0 # Apache-2.0
|
||||
keystoneauth1>=2.10.0 # Apache-2.0
|
||||
keystonemiddleware!=4.1.0,!=4.5.0,>=4.0.0 # Apache-2.0
|
||||
lxml>=2.3 # BSD
|
||||
oslo.concurrency>=3.8.0 # Apache-2.0
|
||||
oslo.cache>=1.5.0 # Apache-2.0
|
||||
oslo.config>=3.9.0 # Apache-2.0
|
||||
oslo.context>=2.2.0 # Apache-2.0
|
||||
oslo.db>=4.1.0 # Apache-2.0
|
||||
oslo.config>=3.14.0 # Apache-2.0
|
||||
oslo.context>=2.9.0 # Apache-2.0
|
||||
oslo.db!=4.13.1,!=4.13.2,>=4.10.0 # Apache-2.0
|
||||
oslo.i18n>=2.1.0 # Apache-2.0
|
||||
oslo.log>=1.14.0 # Apache-2.0
|
||||
oslo.messaging>=4.5.0 # Apache-2.0
|
||||
oslo.policy>=0.5.0 # Apache-2.0
|
||||
oslo.messaging>=5.2.0 # Apache-2.0
|
||||
oslo.policy>=1.9.0 # Apache-2.0
|
||||
oslo.reports>=0.6.0 # Apache-2.0
|
||||
oslo.serialization>=1.10.0 # Apache-2.0
|
||||
oslo.service>=1.10.0 # Apache-2.0
|
||||
oslo.utils>=3.5.0 # Apache-2.0
|
||||
oslo.utils>=3.16.0 # Apache-2.0
|
||||
PasteDeploy>=1.5.0 # MIT
|
||||
pbr>=1.6 # Apache-2.0
|
||||
pecan>=1.0.0 # BSD
|
||||
pecan!=1.0.2,!=1.0.3,!=1.0.4,>=1.0.0 # BSD
|
||||
PrettyTable<0.8,>=0.7 # BSD
|
||||
voluptuous>=0.8.9 # BSD License
|
||||
python-ceilometerclient>=2.2.1 # Apache-2.0
|
||||
python-cinderclient!=1.7.0,>=1.6.0 # Apache-2.0
|
||||
python-glanceclient>=2.0.0 # Apache-2.0
|
||||
python-keystoneclient!=1.8.0,!=2.1.0,>=1.7.0 # Apache-2.0
|
||||
python-neutronclient>=4.2.0 # Apache-2.0
|
||||
python-ceilometerclient>=2.5.0 # Apache-2.0
|
||||
python-cinderclient!=1.7.0,!=1.7.1,>=1.6.0 # Apache-2.0
|
||||
python-glanceclient!=2.4.0,>=2.3.0 # Apache-2.0
|
||||
python-keystoneclient!=2.1.0,>=2.0.0 # Apache-2.0
|
||||
python-neutronclient>=5.1.0 # Apache-2.0
|
||||
python-novaclient!=2.33.0,>=2.29.0 # Apache-2.0
|
||||
python-openstackclient>=2.1.0 # Apache-2.0
|
||||
six>=1.9.0 # MIT
|
||||
SQLAlchemy<1.1.0,>=1.0.10 # MIT
|
||||
stevedore>=1.10.0 # Apache-2.0
|
||||
stevedore>=1.16.0 # Apache-2.0
|
||||
taskflow>=1.26.0 # Apache-2.0
|
||||
WebOb>=1.2.3 # MIT
|
||||
WSME>=0.8 # MIT
|
||||
|
||||
27
setup.cfg
@@ -1,11 +1,11 @@
|
||||
[metadata]
|
||||
name = python-watcher
|
||||
summary = Watcher takes advantage of CEP and ML algorithms/metaheuristics to improve physical resources usage through better VM placement. Watcher can improve your cloud optimization by reducing energy footprint and increasing profits.
|
||||
summary = OpenStack Watcher provides a flexible and scalable resource optimization service for multi-tenant OpenStack-based clouds.
|
||||
description-file =
|
||||
README.rst
|
||||
author = OpenStack
|
||||
author-email = openstack-dev@lists.openstack.org
|
||||
home-page = http://www.openstack.org/
|
||||
home-page = http://docs.openstack.org/developer/watcher/
|
||||
classifier =
|
||||
Environment :: OpenStack
|
||||
Intended Audience :: Information Technology
|
||||
@@ -17,6 +17,7 @@ classifier =
|
||||
Programming Language :: Python :: 2.7
|
||||
Programming Language :: Python :: 3
|
||||
Programming Language :: Python :: 3.4
|
||||
Programming Language :: Python :: 3.5
|
||||
|
||||
[files]
|
||||
packages =
|
||||
@@ -38,6 +39,7 @@ console_scripts =
|
||||
watcher-db-manage = watcher.cmd.dbmanage:main
|
||||
watcher-decision-engine = watcher.cmd.decisionengine:main
|
||||
watcher-applier = watcher.cmd.applier:main
|
||||
watcher-sync = watcher.cmd.sync:main
|
||||
|
||||
tempest.test_plugins =
|
||||
watcher_tests = watcher_tempest_plugin.plugin:WatcherTempestPlugin
|
||||
@@ -45,13 +47,29 @@ tempest.test_plugins =
|
||||
watcher.database.migration_backend =
|
||||
sqlalchemy = watcher.db.sqlalchemy.migration
|
||||
|
||||
watcher_goals =
|
||||
unclassified = watcher.decision_engine.goal.goals:Unclassified
|
||||
dummy = watcher.decision_engine.goal.goals:Dummy
|
||||
server_consolidation = watcher.decision_engine.goal.goals:ServerConsolidation
|
||||
thermal_optimization = watcher.decision_engine.goal.goals:ThermalOptimization
|
||||
workload_balancing = watcher.decision_engine.goal.goals:WorkloadBalancing
|
||||
airflow_optimization = watcher.decision_engine.goal.goals:AirflowOptimization
|
||||
|
||||
watcher_scoring_engines =
|
||||
dummy_scorer = watcher.decision_engine.scoring.dummy_scorer:DummyScorer
|
||||
|
||||
watcher_scoring_engine_containers =
|
||||
dummy_scoring_container = watcher.decision_engine.scoring.dummy_scoring_container:DummyScoringContainer
|
||||
|
||||
watcher_strategies =
|
||||
dummy = watcher.decision_engine.strategy.strategies.dummy_strategy:DummyStrategy
|
||||
dummy_with_scorer = watcher.decision_engine.strategy.strategies.dummy_with_scorer:DummyWithScorer
|
||||
basic = watcher.decision_engine.strategy.strategies.basic_consolidation:BasicConsolidation
|
||||
outlet_temp_control = watcher.decision_engine.strategy.strategies.outlet_temp_control:OutletTempControl
|
||||
outlet_temperature = watcher.decision_engine.strategy.strategies.outlet_temp_control:OutletTempControl
|
||||
vm_workload_consolidation = watcher.decision_engine.strategy.strategies.vm_workload_consolidation:VMWorkloadConsolidation
|
||||
workload_stabilization = watcher.decision_engine.strategy.strategies.workload_stabilization:WorkloadStabilization
|
||||
workload_balance = watcher.decision_engine.strategy.strategies.workload_balance:WorkloadBalance
|
||||
uniform_airflow = watcher.decision_engine.strategy.strategies.uniform_airflow:UniformAirflow
|
||||
|
||||
watcher_actions =
|
||||
migrate = watcher.applier.actions.migration:Migrate
|
||||
@@ -65,6 +83,9 @@ watcher_workflow_engines =
|
||||
watcher_planners =
|
||||
default = watcher.decision_engine.planner.default:DefaultPlanner
|
||||
|
||||
watcher_cluster_data_model_collectors =
|
||||
compute = watcher.decision_engine.model.collector.nova:NovaClusterDataModelCollector
|
||||
|
||||
[pbr]
|
||||
warnerrors = true
|
||||
autodoc_index_modules = true
|
||||
|
||||
@@ -3,13 +3,12 @@
|
||||
# process, which may cause wedges in the gate later.
|
||||
|
||||
coverage>=3.6 # Apache-2.0
|
||||
discover # BSD
|
||||
doc8 # Apache-2.0
|
||||
freezegun # Apache-2.0
|
||||
hacking<0.11,>=0.10.2
|
||||
mock>=2.0 # BSD
|
||||
oslotest>=1.10.0 # Apache-2.0
|
||||
os-testr>=0.4.1 # Apache-2.0
|
||||
os-testr>=0.7.0 # Apache-2.0
|
||||
python-subunit>=0.0.18 # Apache-2.0/BSD
|
||||
testrepository>=0.0.18 # Apache-2.0/BSD
|
||||
testscenarios>=0.4 # Apache-2.0/BSD
|
||||
@@ -17,5 +16,11 @@ testtools>=1.4.0 # MIT
|
||||
|
||||
# Doc requirements
|
||||
oslosphinx!=3.4.0,>=2.5.0 # Apache-2.0
|
||||
sphinx!=1.2.0,!=1.3b1,<1.3,>=1.1.2 # BSD
|
||||
sphinx!=1.3b1,<1.3,>=1.2.1 # BSD
|
||||
sphinxcontrib-pecanwsme>=0.8 # Apache-2.0
|
||||
|
||||
# releasenotes
|
||||
reno>=1.8.0 # Apache2
|
||||
|
||||
# bandit
|
||||
bandit>=1.1.0 # Apache-2.0
|
||||
|
||||
22
tox.ini
@@ -1,16 +1,17 @@
|
||||
[tox]
|
||||
minversion = 1.6
|
||||
envlist = py34,py27,pep8
|
||||
minversion = 1.8
|
||||
envlist = py35,py34,py27,pep8
|
||||
skipsdist = True
|
||||
|
||||
[testenv]
|
||||
usedevelop = True
|
||||
whitelist_externals = find
|
||||
install_command = pip install -U {opts} {packages}
|
||||
install_command =
|
||||
constraints: pip install -U --force-reinstall -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/newton} {opts} {packages}
|
||||
pip install -U {opts} {packages}
|
||||
setenv =
|
||||
VIRTUAL_ENV={envdir}
|
||||
deps = -r{toxinidir}/requirements.txt
|
||||
-r{toxinidir}/test-requirements.txt
|
||||
deps = -r{toxinidir}/test-requirements.txt
|
||||
commands =
|
||||
find . -type f -name "*.pyc" -delete
|
||||
find . -type d -name "__pycache__" -delete
|
||||
@@ -20,6 +21,7 @@ commands =
|
||||
commands =
|
||||
doc8 doc/source/ CONTRIBUTING.rst HACKING.rst README.rst
|
||||
flake8
|
||||
bandit -r watcher -x tests -n5 -ll -s B320
|
||||
|
||||
[testenv:venv]
|
||||
setenv = PYTHONHASHSEED=0
|
||||
@@ -46,15 +48,23 @@ commands =
|
||||
show-source=True
|
||||
ignore=
|
||||
builtins= _
|
||||
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,*sqlalchemy/alembic/versions/*,demo/
|
||||
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,*sqlalchemy/alembic/versions/*,demo/,releasenotes
|
||||
|
||||
[testenv:wheel]
|
||||
commands = python setup.py bdist_wheel
|
||||
|
||||
[hacking]
|
||||
import_exceptions = watcher._i18n
|
||||
local-check-factory = watcher.hacking.checks.factory
|
||||
|
||||
[doc8]
|
||||
extension=.rst
|
||||
# todo: stop ignoring doc/source/man when https://bugs.launchpad.net/doc8/+bug/1502391 is fixed
|
||||
ignore-path=doc/source/image_src,doc/source/man,doc/source/api
|
||||
|
||||
[testenv:releasenotes]
|
||||
commands = sphinx-build -a -W -E -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
||||
|
||||
[testenv:bandit]
|
||||
deps = -r{toxinidir}/test-requirements.txt
|
||||
commands = bandit -r watcher -x tests -n5 -ll -s B320
|
||||
|
||||
@@ -30,7 +30,7 @@ API_SERVICE_OPTS = [
|
||||
default=9322,
|
||||
help=_('The port for the watcher API server')),
|
||||
cfg.StrOpt('host',
|
||||
default='0.0.0.0',
|
||||
default='127.0.0.1',
|
||||
help=_('The listen IP for the watcher API server')),
|
||||
cfg.IntOpt('max_limit',
|
||||
default=1000,
|
||||
|
||||
@@ -22,7 +22,7 @@ from watcher.api import hooks
|
||||
# See https://pecan.readthedocs.org/en/latest/configuration.html#server-configuration # noqa
|
||||
server = {
|
||||
'port': '9322',
|
||||
'host': '0.0.0.0'
|
||||
'host': '127.0.0.1'
|
||||
}
|
||||
|
||||
# Pecan Application Configurations
|
||||
|
||||
@@ -34,6 +34,7 @@ from watcher.api.controllers.v1 import action_plan
|
||||
from watcher.api.controllers.v1 import audit
|
||||
from watcher.api.controllers.v1 import audit_template
|
||||
from watcher.api.controllers.v1 import goal
|
||||
from watcher.api.controllers.v1 import scoring_engine
|
||||
from watcher.api.controllers.v1 import strategy
|
||||
|
||||
|
||||
@@ -101,6 +102,9 @@ class V1(APIBase):
|
||||
action_plans = [link.Link]
|
||||
"""Links to the action plans resource"""
|
||||
|
||||
scoring_engines = [link.Link]
|
||||
"""Links to the Scoring Engines resource"""
|
||||
|
||||
links = [link.Link]
|
||||
"""Links that point to a specific URL for this version and documentation"""
|
||||
|
||||
@@ -147,6 +151,14 @@ class V1(APIBase):
|
||||
'action_plans', '',
|
||||
bookmark=True)
|
||||
]
|
||||
|
||||
v1.scoring_engines = [link.Link.make_link(
|
||||
'self', pecan.request.host_url, 'scoring_engines', ''),
|
||||
link.Link.make_link('bookmark',
|
||||
pecan.request.host_url,
|
||||
'scoring_engines', '',
|
||||
bookmark=True)
|
||||
]
|
||||
return v1
|
||||
|
||||
|
||||
@@ -158,6 +170,7 @@ class Controller(rest.RestController):
|
||||
actions = action.ActionsController()
|
||||
action_plans = action_plan.ActionPlansController()
|
||||
goals = goal.GoalsController()
|
||||
scoring_engines = scoring_engine.ScoringEngineController()
|
||||
strategies = strategy.StrategiesController()
|
||||
|
||||
@wsme_pecan.wsexpose(V1)
|
||||
@@ -167,4 +180,5 @@ class Controller(rest.RestController):
|
||||
# the request object to make the links.
|
||||
return V1.convert()
|
||||
|
||||
__all__ = (Controller)
|
||||
|
||||
__all__ = ("Controller", )
|
||||
|
||||
@@ -27,7 +27,7 @@ of the OpenStack :ref:`Cluster <cluster_definition>` such as:
|
||||
- Live migration of an instance from one compute node to another compute
|
||||
node with Nova
|
||||
- Changing the power level of a compute node (ACPI level, ...)
|
||||
- Changing the current state of an hypervisor (enable or disable) with Nova
|
||||
- Changing the current state of a compute node (enable or disable) with Nova
|
||||
|
||||
In most cases, an :ref:`Action <action_definition>` triggers some concrete
|
||||
commands on an existing OpenStack module (Nova, Neutron, Cinder, Ironic, etc.).
|
||||
@@ -63,12 +63,14 @@ import wsme
|
||||
from wsme import types as wtypes
|
||||
import wsmeext.pecan as wsme_pecan
|
||||
|
||||
from watcher._i18n import _
|
||||
from watcher.api.controllers import base
|
||||
from watcher.api.controllers import link
|
||||
from watcher.api.controllers.v1 import collection
|
||||
from watcher.api.controllers.v1 import types
|
||||
from watcher.api.controllers.v1 import utils as api_utils
|
||||
from watcher.common import exception
|
||||
from watcher.common import policy
|
||||
from watcher import objects
|
||||
|
||||
|
||||
@@ -149,8 +151,6 @@ class Action(base.APIBase):
|
||||
|
||||
self.fields = []
|
||||
fields = list(objects.Action.fields)
|
||||
# audit_template_uuid is not part of objects.Audit.fields
|
||||
# because it's an API-only attribute.
|
||||
fields.append('action_plan_uuid')
|
||||
fields.append('next_uuid')
|
||||
for field in fields:
|
||||
@@ -302,6 +302,10 @@ class ActionsController(rest.RestController):
|
||||
:param audit_uuid: Optional UUID of an audit,
|
||||
to get only actions for that audit.
|
||||
"""
|
||||
context = pecan.request.context
|
||||
policy.enforce(context, 'action:get_all',
|
||||
action='action:get_all')
|
||||
|
||||
if action_plan_uuid and audit_uuid:
|
||||
raise exception.ActionFilterCombinationProhibited
|
||||
|
||||
@@ -326,6 +330,10 @@ class ActionsController(rest.RestController):
|
||||
:param audit_uuid: Optional UUID of an audit,
|
||||
to get only actions for that audit.
|
||||
"""
|
||||
context = pecan.request.context
|
||||
policy.enforce(context, 'action:detail',
|
||||
action='action:detail')
|
||||
|
||||
# NOTE(lucasagomes): /detail should only work agaist collections
|
||||
parent = pecan.request.path.split('/')[:-1][-1]
|
||||
if parent != "actions":
|
||||
@@ -349,8 +357,10 @@ class ActionsController(rest.RestController):
|
||||
if self.from_actions:
|
||||
raise exception.OperationNotPermitted
|
||||
|
||||
action = objects.Action.get_by_uuid(pecan.request.context,
|
||||
action_uuid)
|
||||
context = pecan.request.context
|
||||
action = api_utils.get_resource('Action', action_uuid)
|
||||
policy.enforce(context, 'action:get', action, action='action:get')
|
||||
|
||||
return Action.convert_with_links(action)
|
||||
|
||||
@wsme_pecan.wsexpose(Action, body=Action, status_code=201)
|
||||
|
||||
@@ -16,9 +16,11 @@
|
||||
# limitations under the License.
|
||||
|
||||
"""
|
||||
An :ref:`Action Plan <action_plan_definition>` is a flow of
|
||||
An :ref:`Action Plan <action_plan_definition>` specifies a flow of
|
||||
:ref:`Actions <action_definition>` that should be executed in order to satisfy
|
||||
a given :ref:`Goal <goal_definition>`.
|
||||
a given :ref:`Goal <goal_definition>`. It also contains an estimated
|
||||
:ref:`global efficacy <efficacy_definition>` alongside a set of
|
||||
:ref:`efficacy indicators <efficacy_indicator_definition>`.
|
||||
|
||||
An :ref:`Action Plan <action_plan_definition>` is generated by Watcher when an
|
||||
:ref:`Audit <audit_definition>` is successful which implies that the
|
||||
@@ -26,16 +28,13 @@ An :ref:`Action Plan <action_plan_definition>` is generated by Watcher when an
|
||||
which was used has found a :ref:`Solution <solution_definition>` to achieve the
|
||||
:ref:`Goal <goal_definition>` of this :ref:`Audit <audit_definition>`.
|
||||
|
||||
In the default implementation of Watcher, an
|
||||
:ref:`Action Plan <action_plan_definition>`
|
||||
is only composed of successive :ref:`Actions <action_definition>`
|
||||
(i.e., a Workflow of :ref:`Actions <action_definition>` belonging to a unique
|
||||
branch).
|
||||
In the default implementation of Watcher, an action plan is composed of
|
||||
a list of successive :ref:`Actions <action_definition>` (i.e., a Workflow of
|
||||
:ref:`Actions <action_definition>` belonging to a unique branch).
|
||||
|
||||
However, Watcher provides abstract interfaces for many of its components,
|
||||
allowing other implementations to generate and handle more complex
|
||||
:ref:`Action Plan(s) <action_plan_definition>`
|
||||
composed of two types of Action Item(s):
|
||||
allowing other implementations to generate and handle more complex :ref:`Action
|
||||
Plan(s) <action_plan_definition>` composed of two types of Action Item(s):
|
||||
|
||||
- simple :ref:`Actions <action_definition>`: atomic tasks, which means it
|
||||
can not be split into smaller tasks or commands from an OpenStack point of
|
||||
@@ -46,16 +45,18 @@ composed of two types of Action Item(s):
|
||||
|
||||
An :ref:`Action Plan <action_plan_definition>` may be described using
|
||||
standard workflow model description formats such as
|
||||
`Business Process Model and Notation 2.0 (BPMN 2.0) <http://www.omg.org/spec/BPMN/2.0/>`_
|
||||
or `Unified Modeling Language (UML) <http://www.uml.org/>`_.
|
||||
`Business Process Model and Notation 2.0 (BPMN 2.0)
|
||||
<http://www.omg.org/spec/BPMN/2.0/>`_ or `Unified Modeling Language (UML)
|
||||
<http://www.uml.org/>`_.
|
||||
|
||||
To see the life-cycle and description of
|
||||
:ref:`Action Plan <action_plan_definition>` states, visit :ref:`the Action Plan state
|
||||
machine <action_plan_state_machine>`.
|
||||
""" # noqa
|
||||
To see the life-cycle and description of
|
||||
:ref:`Action Plan <action_plan_definition>` states, visit :ref:`the Action Plan
|
||||
state machine <action_plan_state_machine>`.
|
||||
"""
|
||||
|
||||
import datetime
|
||||
|
||||
from oslo_log import log
|
||||
import pecan
|
||||
from pecan import rest
|
||||
import wsme
|
||||
@@ -66,13 +67,18 @@ from watcher._i18n import _
|
||||
from watcher.api.controllers import base
|
||||
from watcher.api.controllers import link
|
||||
from watcher.api.controllers.v1 import collection
|
||||
from watcher.api.controllers.v1 import efficacy_indicator as efficacyindicator
|
||||
from watcher.api.controllers.v1 import types
|
||||
from watcher.api.controllers.v1 import utils as api_utils
|
||||
from watcher.applier import rpcapi
|
||||
from watcher.common import exception
|
||||
from watcher.common import policy
|
||||
from watcher.common import utils
|
||||
from watcher import objects
|
||||
from watcher.objects import action_plan as ap_objects
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
|
||||
|
||||
class ActionPlanPatchType(types.JsonPatchType):
|
||||
|
||||
@@ -112,7 +118,10 @@ class ActionPlan(base.APIBase):
|
||||
"""
|
||||
|
||||
_audit_uuid = None
|
||||
_strategy_uuid = None
|
||||
_strategy_name = None
|
||||
_first_action_uuid = None
|
||||
_efficacy_indicators = None
|
||||
|
||||
def _get_audit_uuid(self):
|
||||
return self._audit_uuid
|
||||
@@ -143,6 +152,71 @@ class ActionPlan(base.APIBase):
|
||||
except exception.ActionNotFound:
|
||||
self._first_action_uuid = None
|
||||
|
||||
def _get_efficacy_indicators(self):
|
||||
if self._efficacy_indicators is None:
|
||||
self._set_efficacy_indicators(wtypes.Unset)
|
||||
return self._efficacy_indicators
|
||||
|
||||
def _set_efficacy_indicators(self, value):
|
||||
efficacy_indicators = []
|
||||
if value == wtypes.Unset and not self._efficacy_indicators:
|
||||
try:
|
||||
_efficacy_indicators = objects.EfficacyIndicator.list(
|
||||
pecan.request.context,
|
||||
filters={"action_plan_uuid": self.uuid})
|
||||
|
||||
for indicator in _efficacy_indicators:
|
||||
efficacy_indicator = efficacyindicator.EfficacyIndicator(
|
||||
context=pecan.request.context,
|
||||
name=indicator.name,
|
||||
description=indicator.description,
|
||||
unit=indicator.unit,
|
||||
value=indicator.value,
|
||||
)
|
||||
efficacy_indicators.append(efficacy_indicator.as_dict())
|
||||
self._efficacy_indicators = efficacy_indicators
|
||||
except exception.EfficacyIndicatorNotFound as exc:
|
||||
LOG.exception(exc)
|
||||
elif value and self._efficacy_indicators != value:
|
||||
self._efficacy_indicators = value
|
||||
|
||||
def _get_strategy(self, value):
|
||||
if value == wtypes.Unset:
|
||||
return None
|
||||
strategy = None
|
||||
try:
|
||||
if utils.is_uuid_like(value) or utils.is_int_like(value):
|
||||
strategy = objects.Strategy.get(
|
||||
pecan.request.context, value)
|
||||
else:
|
||||
strategy = objects.Strategy.get_by_name(
|
||||
pecan.request.context, value)
|
||||
except exception.StrategyNotFound:
|
||||
pass
|
||||
if strategy:
|
||||
self.strategy_id = strategy.id
|
||||
return strategy
|
||||
|
||||
def _get_strategy_uuid(self):
|
||||
return self._strategy_uuid
|
||||
|
||||
def _set_strategy_uuid(self, value):
|
||||
if value and self._strategy_uuid != value:
|
||||
self._strategy_uuid = None
|
||||
strategy = self._get_strategy(value)
|
||||
if strategy:
|
||||
self._strategy_uuid = strategy.uuid
|
||||
|
||||
def _get_strategy_name(self):
|
||||
return self._strategy_name
|
||||
|
||||
def _set_strategy_name(self, value):
|
||||
if value and self._strategy_name != value:
|
||||
self._strategy_name = None
|
||||
strategy = self._get_strategy(value)
|
||||
if strategy:
|
||||
self._strategy_name = strategy.name
|
||||
|
||||
uuid = wtypes.wsattr(types.uuid, readonly=True)
|
||||
"""Unique UUID for this action plan"""
|
||||
|
||||
@@ -155,6 +229,22 @@ class ActionPlan(base.APIBase):
|
||||
mandatory=True)
|
||||
"""The UUID of the audit this port belongs to"""
|
||||
|
||||
strategy_uuid = wsme.wsproperty(
|
||||
wtypes.text, _get_strategy_uuid, _set_strategy_uuid, mandatory=False)
|
||||
"""Strategy UUID the action plan refers to"""
|
||||
|
||||
strategy_name = wsme.wsproperty(
|
||||
wtypes.text, _get_strategy_name, _set_strategy_name, mandatory=False)
|
||||
"""The name of the strategy this action plan refers to"""
|
||||
|
||||
efficacy_indicators = wsme.wsproperty(
|
||||
types.jsontype, _get_efficacy_indicators, _set_efficacy_indicators,
|
||||
mandatory=True)
|
||||
"""The list of efficacy indicators associated to this action plan"""
|
||||
|
||||
global_efficacy = wtypes.wsattr(types.jsontype, readonly=True)
|
||||
"""The global efficacy of this action plan"""
|
||||
|
||||
state = wtypes.text
|
||||
"""This action plan state"""
|
||||
|
||||
@@ -163,7 +253,6 @@ class ActionPlan(base.APIBase):
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
super(ActionPlan, self).__init__()
|
||||
|
||||
self.fields = []
|
||||
fields = list(objects.ActionPlan.fields)
|
||||
for field in fields:
|
||||
@@ -175,8 +264,13 @@ class ActionPlan(base.APIBase):
|
||||
|
||||
self.fields.append('audit_uuid')
|
||||
self.fields.append('first_action_uuid')
|
||||
self.fields.append('efficacy_indicators')
|
||||
|
||||
setattr(self, 'audit_uuid', kwargs.get('audit_id', wtypes.Unset))
|
||||
fields.append('strategy_uuid')
|
||||
setattr(self, 'strategy_uuid', kwargs.get('strategy_id', wtypes.Unset))
|
||||
fields.append('strategy_name')
|
||||
setattr(self, 'strategy_name', kwargs.get('strategy_id', wtypes.Unset))
|
||||
setattr(self, 'first_action_uuid',
|
||||
kwargs.get('first_action_id', wtypes.Unset))
|
||||
|
||||
@@ -184,12 +278,14 @@ class ActionPlan(base.APIBase):
|
||||
def _convert_with_links(action_plan, url, expand=True):
|
||||
if not expand:
|
||||
action_plan.unset_fields_except(
|
||||
['uuid', 'state', 'updated_at',
|
||||
'audit_uuid', 'first_action_uuid'])
|
||||
['uuid', 'state', 'efficacy_indicators', 'global_efficacy',
|
||||
'updated_at', 'audit_uuid', 'strategy_uuid', 'strategy_name',
|
||||
'first_action_uuid'])
|
||||
|
||||
action_plan.links = [link.Link.make_link(
|
||||
'self', url,
|
||||
'action_plans', action_plan.uuid),
|
||||
action_plan.links = [
|
||||
link.Link.make_link(
|
||||
'self', url,
|
||||
'action_plans', action_plan.uuid),
|
||||
link.Link.make_link(
|
||||
'bookmark', url,
|
||||
'action_plans', action_plan.uuid,
|
||||
@@ -211,6 +307,12 @@ class ActionPlan(base.APIBase):
|
||||
updated_at=datetime.datetime.utcnow())
|
||||
sample._first_action_uuid = '57eaf9ab-5aaa-4f7e-bdf7-9a140ac7a720'
|
||||
sample._audit_uuid = 'abcee106-14d3-4515-b744-5a26885cf6f6'
|
||||
sample._efficacy_indicators = [{'description': 'Test indicator',
|
||||
'name': 'test_indicator',
|
||||
'unit': '%'}]
|
||||
sample._global_efficacy = {'description': 'Global efficacy',
|
||||
'name': 'test_global_efficacy',
|
||||
'unit': '%'}
|
||||
return cls._convert_with_links(sample, 'http://localhost:9322', expand)
|
||||
|
||||
|
||||
@@ -226,8 +328,8 @@ class ActionPlanCollection(collection.Collection):
|
||||
@staticmethod
|
||||
def convert_with_links(rpc_action_plans, limit, url=None, expand=False,
|
||||
**kwargs):
|
||||
collection = ActionPlanCollection()
|
||||
collection.action_plans = [ActionPlan.convert_with_links(
|
||||
ap_collection = ActionPlanCollection()
|
||||
ap_collection.action_plans = [ActionPlan.convert_with_links(
|
||||
p, expand) for p in rpc_action_plans]
|
||||
|
||||
if 'sort_key' in kwargs:
|
||||
@@ -235,13 +337,13 @@ class ActionPlanCollection(collection.Collection):
|
||||
if kwargs['sort_key'] == 'audit_uuid':
|
||||
if 'sort_dir' in kwargs:
|
||||
reverse = True if kwargs['sort_dir'] == 'desc' else False
|
||||
collection.action_plans = sorted(
|
||||
collection.action_plans,
|
||||
ap_collection.action_plans = sorted(
|
||||
ap_collection.action_plans,
|
||||
key=lambda action_plan: action_plan.audit_uuid,
|
||||
reverse=reverse)
|
||||
|
||||
collection.next = collection.get_next(limit, url=url, **kwargs)
|
||||
return collection
|
||||
ap_collection.next = ap_collection.get_next(limit, url=url, **kwargs)
|
||||
return ap_collection
|
||||
|
||||
@classmethod
|
||||
def sample(cls):
|
||||
@@ -252,6 +354,7 @@ class ActionPlanCollection(collection.Collection):
|
||||
|
||||
class ActionPlansController(rest.RestController):
|
||||
"""REST controller for Actions."""
|
||||
|
||||
def __init__(self):
|
||||
super(ActionPlansController, self).__init__()
|
||||
|
||||
@@ -265,7 +368,8 @@ class ActionPlansController(rest.RestController):
|
||||
|
||||
def _get_action_plans_collection(self, marker, limit,
|
||||
sort_key, sort_dir, expand=False,
|
||||
resource_url=None, audit_uuid=None):
|
||||
resource_url=None, audit_uuid=None,
|
||||
strategy=None):
|
||||
|
||||
limit = api_utils.validate_limit(limit)
|
||||
api_utils.validate_sort_dir(sort_dir)
|
||||
@@ -279,6 +383,12 @@ class ActionPlansController(rest.RestController):
|
||||
if audit_uuid:
|
||||
filters['audit_uuid'] = audit_uuid
|
||||
|
||||
if strategy:
|
||||
if utils.is_uuid_like(strategy):
|
||||
filters['strategy_uuid'] = strategy
|
||||
else:
|
||||
filters['strategy_name'] = strategy
|
||||
|
||||
if sort_key == 'audit_uuid':
|
||||
sort_db_key = None
|
||||
else:
|
||||
@@ -298,9 +408,9 @@ class ActionPlansController(rest.RestController):
|
||||
sort_dir=sort_dir)
|
||||
|
||||
@wsme_pecan.wsexpose(ActionPlanCollection, types.uuid, int, wtypes.text,
|
||||
wtypes.text, types.uuid)
|
||||
wtypes.text, types.uuid, wtypes.text)
|
||||
def get_all(self, marker=None, limit=None,
|
||||
sort_key='id', sort_dir='asc', audit_uuid=None):
|
||||
sort_key='id', sort_dir='asc', audit_uuid=None, strategy=None):
|
||||
"""Retrieve a list of action plans.
|
||||
|
||||
:param marker: pagination marker for large data sets.
|
||||
@@ -309,14 +419,20 @@ class ActionPlansController(rest.RestController):
|
||||
:param sort_dir: direction to sort. "asc" or "desc". Default: asc.
|
||||
:param audit_uuid: Optional UUID of an audit, to get only actions
|
||||
for that audit.
|
||||
:param strategy: strategy UUID or name to filter by
|
||||
"""
|
||||
context = pecan.request.context
|
||||
policy.enforce(context, 'action_plan:get_all',
|
||||
action='action_plan:get_all')
|
||||
|
||||
return self._get_action_plans_collection(
|
||||
marker, limit, sort_key, sort_dir, audit_uuid=audit_uuid)
|
||||
marker, limit, sort_key, sort_dir,
|
||||
audit_uuid=audit_uuid, strategy=strategy)
|
||||
|
||||
@wsme_pecan.wsexpose(ActionPlanCollection, types.uuid, int, wtypes.text,
|
||||
wtypes.text, types.uuid)
|
||||
wtypes.text, types.uuid, wtypes.text)
|
||||
def detail(self, marker=None, limit=None,
|
||||
sort_key='id', sort_dir='asc', audit_uuid=None):
|
||||
sort_key='id', sort_dir='asc', audit_uuid=None, strategy=None):
|
||||
"""Retrieve a list of action_plans with detail.
|
||||
|
||||
:param marker: pagination marker for large data sets.
|
||||
@@ -325,7 +441,12 @@ class ActionPlansController(rest.RestController):
|
||||
:param sort_dir: direction to sort. "asc" or "desc". Default: asc.
|
||||
:param audit_uuid: Optional UUID of an audit, to get only actions
|
||||
for that audit.
|
||||
:param strategy: strategy UUID or name to filter by
|
||||
"""
|
||||
context = pecan.request.context
|
||||
policy.enforce(context, 'action_plan:detail',
|
||||
action='action_plan:detail')
|
||||
|
||||
# NOTE(lucasagomes): /detail should only work agaist collections
|
||||
parent = pecan.request.path.split('/')[:-1][-1]
|
||||
if parent != "action_plans":
|
||||
@@ -334,9 +455,8 @@ class ActionPlansController(rest.RestController):
|
||||
expand = True
|
||||
resource_url = '/'.join(['action_plans', 'detail'])
|
||||
return self._get_action_plans_collection(
|
||||
marker, limit,
|
||||
sort_key, sort_dir, expand,
|
||||
resource_url, audit_uuid=audit_uuid)
|
||||
marker, limit, sort_key, sort_dir, expand,
|
||||
resource_url, audit_uuid=audit_uuid, strategy=strategy)
|
||||
|
||||
@wsme_pecan.wsexpose(ActionPlan, types.uuid)
|
||||
def get_one(self, action_plan_uuid):
|
||||
@@ -347,8 +467,11 @@ class ActionPlansController(rest.RestController):
|
||||
if self.from_actionsPlans:
|
||||
raise exception.OperationNotPermitted
|
||||
|
||||
action_plan = objects.ActionPlan.get_by_uuid(
|
||||
pecan.request.context, action_plan_uuid)
|
||||
context = pecan.request.context
|
||||
action_plan = api_utils.get_resource('ActionPlan', action_plan_uuid)
|
||||
policy.enforce(
|
||||
context, 'action_plan:get', action_plan, action='action_plan:get')
|
||||
|
||||
return ActionPlan.convert_with_links(action_plan)
|
||||
|
||||
@wsme_pecan.wsexpose(None, types.uuid, status_code=204)
|
||||
@@ -357,11 +480,12 @@ class ActionPlansController(rest.RestController):
|
||||
|
||||
:param action_plan_uuid: UUID of a action.
|
||||
"""
|
||||
context = pecan.request.context
|
||||
action_plan = api_utils.get_resource('ActionPlan', action_plan_uuid)
|
||||
policy.enforce(context, 'action_plan:delete', action_plan,
|
||||
action='action_plan:delete')
|
||||
|
||||
action_plan_to_delete = objects.ActionPlan.get_by_uuid(
|
||||
pecan.request.context,
|
||||
action_plan_uuid)
|
||||
action_plan_to_delete.soft_delete()
|
||||
action_plan.soft_delete()
|
||||
|
||||
@wsme.validate(types.uuid, [ActionPlanPatchType])
|
||||
@wsme_pecan.wsexpose(ActionPlan, types.uuid,
|
||||
@@ -376,9 +500,12 @@ class ActionPlansController(rest.RestController):
|
||||
if self.from_actionsPlans:
|
||||
raise exception.OperationNotPermitted
|
||||
|
||||
action_plan_to_update = objects.ActionPlan.get_by_uuid(
|
||||
pecan.request.context,
|
||||
action_plan_uuid)
|
||||
context = pecan.request.context
|
||||
action_plan_to_update = api_utils.get_resource('ActionPlan',
|
||||
action_plan_uuid)
|
||||
policy.enforce(context, 'action_plan:update', action_plan_to_update,
|
||||
action='action_plan:update')
|
||||
|
||||
try:
|
||||
action_plan_dict = action_plan_to_update.as_dict()
|
||||
action_plan = ActionPlan(**api_utils.apply_jsonpatch(
|
||||
@@ -427,8 +554,8 @@ class ActionPlansController(rest.RestController):
|
||||
if action_plan_to_update[field] != patch_val:
|
||||
action_plan_to_update[field] = patch_val
|
||||
|
||||
if (field == 'state'
|
||||
and patch_val == objects.action_plan.State.PENDING):
|
||||
if (field == 'state'and
|
||||
patch_val == objects.action_plan.State.PENDING):
|
||||
launch_action_plan = True
|
||||
|
||||
action_plan_to_update.save()
|
||||
|
||||
@@ -44,6 +44,7 @@ from watcher.api.controllers.v1 import collection
|
||||
from watcher.api.controllers.v1 import types
|
||||
from watcher.api.controllers.v1 import utils as api_utils
|
||||
from watcher.common import exception
|
||||
from watcher.common import policy
|
||||
from watcher.common import utils
|
||||
from watcher.decision_engine import rpcapi
|
||||
from watcher import objects
|
||||
@@ -51,31 +52,91 @@ from watcher import objects
|
||||
|
||||
class AuditPostType(wtypes.Base):
|
||||
|
||||
audit_template_uuid = wtypes.wsattr(types.uuid, mandatory=True)
|
||||
audit_template_uuid = wtypes.wsattr(types.uuid, mandatory=False)
|
||||
|
||||
type = wtypes.wsattr(wtypes.text, mandatory=True)
|
||||
goal = wtypes.wsattr(wtypes.text, mandatory=False)
|
||||
|
||||
strategy = wtypes.wsattr(wtypes.text, mandatory=False)
|
||||
|
||||
audit_type = wtypes.wsattr(wtypes.text, mandatory=True)
|
||||
|
||||
deadline = wtypes.wsattr(datetime.datetime, mandatory=False)
|
||||
|
||||
state = wsme.wsattr(wtypes.text, readonly=True,
|
||||
default=objects.audit.State.PENDING)
|
||||
|
||||
def as_audit(self):
|
||||
audit_type_values = [val.value for val in objects.audit.AuditType]
|
||||
if self.type not in audit_type_values:
|
||||
raise exception.AuditTypeNotFound(audit_type=self.type)
|
||||
parameters = wtypes.wsattr({wtypes.text: types.jsontype}, mandatory=False,
|
||||
default={})
|
||||
interval = wsme.wsattr(int, mandatory=False)
|
||||
|
||||
host_aggregate = wsme.wsattr(wtypes.IntegerType(minimum=1),
|
||||
mandatory=False)
|
||||
|
||||
def as_audit(self, context):
|
||||
audit_type_values = [val.value for val in objects.audit.AuditType]
|
||||
if self.audit_type not in audit_type_values:
|
||||
raise exception.AuditTypeNotFound(audit_type=self.audit_type)
|
||||
|
||||
if (self.audit_type == objects.audit.AuditType.ONESHOT.value and
|
||||
self.interval not in (wtypes.Unset, None)):
|
||||
raise exception.AuditIntervalNotAllowed(audit_type=self.audit_type)
|
||||
|
||||
if (self.audit_type == objects.audit.AuditType.CONTINUOUS.value and
|
||||
self.interval in (wtypes.Unset, None)):
|
||||
raise exception.AuditIntervalNotSpecified(
|
||||
audit_type=self.audit_type)
|
||||
|
||||
# If audit_template_uuid was provided, we will provide any
|
||||
# variables not included in the request, but not override
|
||||
# those variables that were included.
|
||||
if self.audit_template_uuid:
|
||||
try:
|
||||
audit_template = objects.AuditTemplate.get(
|
||||
context, self.audit_template_uuid)
|
||||
except exception.AuditTemplateNotFound:
|
||||
raise exception.Invalid(
|
||||
message=_('The audit template UUID or name specified is '
|
||||
'invalid'))
|
||||
at2a = {
|
||||
'goal': 'goal_id',
|
||||
'strategy': 'strategy_id',
|
||||
'host_aggregate': 'host_aggregate'
|
||||
}
|
||||
to_string_fields = set(['goal', 'strategy'])
|
||||
for k in at2a:
|
||||
if not getattr(self, k):
|
||||
try:
|
||||
at_attr = getattr(audit_template, at2a[k])
|
||||
if at_attr and (k in to_string_fields):
|
||||
at_attr = str(at_attr)
|
||||
setattr(self, k, at_attr)
|
||||
except AttributeError:
|
||||
pass
|
||||
return Audit(
|
||||
audit_template_id=self.audit_template_uuid,
|
||||
type=self.type,
|
||||
deadline=self.deadline)
|
||||
audit_type=self.audit_type,
|
||||
deadline=self.deadline,
|
||||
parameters=self.parameters,
|
||||
goal_id=self.goal,
|
||||
host_aggregate=self.host_aggregate,
|
||||
strategy_id=self.strategy,
|
||||
interval=self.interval)
|
||||
|
||||
|
||||
class AuditPatchType(types.JsonPatchType):
|
||||
|
||||
@staticmethod
|
||||
def mandatory_attrs():
|
||||
return ['/audit_template_uuid']
|
||||
return ['/audit_template_uuid', '/type']
|
||||
|
||||
@staticmethod
|
||||
def validate(patch):
|
||||
serialized_patch = {'path': patch.path, 'op': patch.op}
|
||||
if patch.path in AuditPatchType.mandatory_attrs():
|
||||
msg = _("%(field)s can't be updated.")
|
||||
raise exception.PatchError(
|
||||
patch=serialized_patch,
|
||||
reason=msg % dict(field=patch.path))
|
||||
return types.JsonPatchType.validate(patch)
|
||||
|
||||
|
||||
class Audit(base.APIBase):
|
||||
@@ -84,50 +145,89 @@ class Audit(base.APIBase):
|
||||
This class enforces type checking and value constraints, and converts
|
||||
between the internal object model and the API representation of a audit.
|
||||
"""
|
||||
_audit_template_uuid = None
|
||||
_audit_template_name = None
|
||||
_goal_uuid = None
|
||||
_goal_name = None
|
||||
_strategy_uuid = None
|
||||
_strategy_name = None
|
||||
|
||||
def _get_audit_template(self, value):
|
||||
def _get_goal(self, value):
|
||||
if value == wtypes.Unset:
|
||||
return None
|
||||
audit_template = None
|
||||
goal = None
|
||||
try:
|
||||
if utils.is_uuid_like(value) or utils.is_int_like(value):
|
||||
audit_template = objects.AuditTemplate.get(
|
||||
goal = objects.Goal.get(
|
||||
pecan.request.context, value)
|
||||
else:
|
||||
audit_template = objects.AuditTemplate.get_by_name(
|
||||
goal = objects.Goal.get_by_name(
|
||||
pecan.request.context, value)
|
||||
except exception.AuditTemplateNotFound:
|
||||
except exception.GoalNotFound:
|
||||
pass
|
||||
if audit_template:
|
||||
self.audit_template_id = audit_template.id
|
||||
return audit_template
|
||||
if goal:
|
||||
self.goal_id = goal.id
|
||||
return goal
|
||||
|
||||
def _get_audit_template_uuid(self):
|
||||
return self._audit_template_uuid
|
||||
def _get_goal_uuid(self):
|
||||
return self._goal_uuid
|
||||
|
||||
def _set_audit_template_uuid(self, value):
|
||||
if value and self._audit_template_uuid != value:
|
||||
self._audit_template_uuid = None
|
||||
audit_template = self._get_audit_template(value)
|
||||
if audit_template:
|
||||
self._audit_template_uuid = audit_template.uuid
|
||||
def _set_goal_uuid(self, value):
|
||||
if value and self._goal_uuid != value:
|
||||
self._goal_uuid = None
|
||||
goal = self._get_goal(value)
|
||||
if goal:
|
||||
self._goal_uuid = goal.uuid
|
||||
|
||||
def _get_audit_template_name(self):
|
||||
return self._audit_template_name
|
||||
def _get_goal_name(self):
|
||||
return self._goal_name
|
||||
|
||||
def _set_audit_template_name(self, value):
|
||||
if value and self._audit_template_name != value:
|
||||
self._audit_template_name = None
|
||||
audit_template = self._get_audit_template(value)
|
||||
if audit_template:
|
||||
self._audit_template_name = audit_template.name
|
||||
def _set_goal_name(self, value):
|
||||
if value and self._goal_name != value:
|
||||
self._goal_name = None
|
||||
goal = self._get_goal(value)
|
||||
if goal:
|
||||
self._goal_name = goal.name
|
||||
|
||||
def _get_strategy(self, value):
|
||||
if value == wtypes.Unset:
|
||||
return None
|
||||
strategy = None
|
||||
try:
|
||||
if utils.is_uuid_like(value) or utils.is_int_like(value):
|
||||
strategy = objects.Strategy.get(
|
||||
pecan.request.context, value)
|
||||
else:
|
||||
strategy = objects.Strategy.get_by_name(
|
||||
pecan.request.context, value)
|
||||
except exception.StrategyNotFound:
|
||||
pass
|
||||
if strategy:
|
||||
self.strategy_id = strategy.id
|
||||
return strategy
|
||||
|
||||
def _get_strategy_uuid(self):
|
||||
return self._strategy_uuid
|
||||
|
||||
def _set_strategy_uuid(self, value):
|
||||
if value and self._strategy_uuid != value:
|
||||
self._strategy_uuid = None
|
||||
strategy = self._get_strategy(value)
|
||||
if strategy:
|
||||
self._strategy_uuid = strategy.uuid
|
||||
|
||||
def _get_strategy_name(self):
|
||||
return self._strategy_name
|
||||
|
||||
def _set_strategy_name(self, value):
|
||||
if value and self._strategy_name != value:
|
||||
self._strategy_name = None
|
||||
strategy = self._get_strategy(value)
|
||||
if strategy:
|
||||
self._strategy_name = strategy.name
|
||||
|
||||
uuid = types.uuid
|
||||
"""Unique UUID for this audit"""
|
||||
|
||||
type = wtypes.text
|
||||
audit_type = wtypes.text
|
||||
"""Type of this audit"""
|
||||
|
||||
deadline = datetime.datetime
|
||||
@@ -136,25 +236,37 @@ class Audit(base.APIBase):
|
||||
state = wtypes.text
|
||||
"""This audit state"""
|
||||
|
||||
audit_template_uuid = wsme.wsproperty(wtypes.text,
|
||||
_get_audit_template_uuid,
|
||||
_set_audit_template_uuid,
|
||||
mandatory=True)
|
||||
"""The UUID of the audit template this audit refers to"""
|
||||
goal_uuid = wsme.wsproperty(
|
||||
wtypes.text, _get_goal_uuid, _set_goal_uuid, mandatory=True)
|
||||
"""Goal UUID the audit template refers to"""
|
||||
|
||||
audit_template_name = wsme.wsproperty(wtypes.text,
|
||||
_get_audit_template_name,
|
||||
_set_audit_template_name,
|
||||
mandatory=False)
|
||||
"""The name of the audit template this audit refers to"""
|
||||
goal_name = wsme.wsproperty(
|
||||
wtypes.text, _get_goal_name, _set_goal_name, mandatory=False)
|
||||
"""The name of the goal this audit template refers to"""
|
||||
|
||||
strategy_uuid = wsme.wsproperty(
|
||||
wtypes.text, _get_strategy_uuid, _set_strategy_uuid, mandatory=False)
|
||||
"""Strategy UUID the audit template refers to"""
|
||||
|
||||
strategy_name = wsme.wsproperty(
|
||||
wtypes.text, _get_strategy_name, _set_strategy_name, mandatory=False)
|
||||
"""The name of the strategy this audit template refers to"""
|
||||
|
||||
parameters = {wtypes.text: types.jsontype}
|
||||
"""The strategy parameters for this audit"""
|
||||
|
||||
links = wsme.wsattr([link.Link], readonly=True)
|
||||
"""A list containing a self link and associated audit links"""
|
||||
|
||||
interval = wsme.wsattr(int, mandatory=False)
|
||||
"""Launch audit periodically (in seconds)"""
|
||||
|
||||
host_aggregate = wtypes.IntegerType(minimum=1)
|
||||
"""ID of the Nova host aggregate targeted by the audit template"""
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
self.fields = []
|
||||
fields = list(objects.Audit.fields)
|
||||
|
||||
for k in fields:
|
||||
# Skip fields we do not expose.
|
||||
if not hasattr(self, k):
|
||||
@@ -162,27 +274,28 @@ class Audit(base.APIBase):
|
||||
self.fields.append(k)
|
||||
setattr(self, k, kwargs.get(k, wtypes.Unset))
|
||||
|
||||
self.fields.append('audit_template_id')
|
||||
|
||||
# audit_template_uuid & audit_template_name are not part of
|
||||
# objects.Audit.fields because they're API-only attributes.
|
||||
fields.append('audit_template_uuid')
|
||||
setattr(self, 'audit_template_uuid', kwargs.get('audit_template_id',
|
||||
self.fields.append('goal_id')
|
||||
self.fields.append('strategy_id')
|
||||
fields.append('goal_uuid')
|
||||
setattr(self, 'goal_uuid', kwargs.get('goal_id',
|
||||
wtypes.Unset))
|
||||
fields.append('audit_template_name')
|
||||
setattr(self, 'audit_template_name', kwargs.get('audit_template_id',
|
||||
fields.append('goal_name')
|
||||
setattr(self, 'goal_name', kwargs.get('goal_id',
|
||||
wtypes.Unset))
|
||||
fields.append('strategy_uuid')
|
||||
setattr(self, 'strategy_uuid', kwargs.get('strategy_id',
|
||||
wtypes.Unset))
|
||||
fields.append('strategy_name')
|
||||
setattr(self, 'strategy_name', kwargs.get('strategy_id',
|
||||
wtypes.Unset))
|
||||
|
||||
@staticmethod
|
||||
def _convert_with_links(audit, url, expand=True):
|
||||
if not expand:
|
||||
audit.unset_fields_except(['uuid', 'type', 'deadline',
|
||||
'state', 'audit_template_uuid',
|
||||
'audit_template_name'])
|
||||
|
||||
# The numeric ID should not be exposed to
|
||||
# the user, it's internal only.
|
||||
audit.audit_template_id = wtypes.Unset
|
||||
audit.unset_fields_except(['uuid', 'audit_type', 'deadline',
|
||||
'state', 'goal_uuid', 'interval',
|
||||
'strategy_uuid', 'host_aggregate',
|
||||
'goal_name', 'strategy_name'])
|
||||
|
||||
audit.links = [link.Link.make_link('self', url,
|
||||
'audits', audit.uuid),
|
||||
@@ -201,13 +314,17 @@ class Audit(base.APIBase):
|
||||
@classmethod
|
||||
def sample(cls, expand=True):
|
||||
sample = cls(uuid='27e3153e-d5bf-4b7e-b517-fb518e17f34c',
|
||||
type='ONESHOT',
|
||||
audit_type='ONESHOT',
|
||||
state='PENDING',
|
||||
deadline=None,
|
||||
created_at=datetime.datetime.utcnow(),
|
||||
deleted_at=None,
|
||||
updated_at=datetime.datetime.utcnow())
|
||||
sample._audit_template_uuid = '7ae81bb3-dec3-4289-8d6c-da80bd8001ae'
|
||||
updated_at=datetime.datetime.utcnow(),
|
||||
interval=7200)
|
||||
|
||||
sample.goal_id = '7ae81bb3-dec3-4289-8d6c-da80bd8001ae'
|
||||
sample.strategy_id = '7ae81bb3-dec3-4289-8d6c-da80bd8001ff'
|
||||
sample.host_aggregate = 1
|
||||
return cls._convert_with_links(sample, 'http://localhost:9322', expand)
|
||||
|
||||
|
||||
@@ -230,12 +347,12 @@ class AuditCollection(collection.Collection):
|
||||
|
||||
if 'sort_key' in kwargs:
|
||||
reverse = False
|
||||
if kwargs['sort_key'] == 'audit_template_uuid':
|
||||
if kwargs['sort_key'] == 'goal_uuid':
|
||||
if 'sort_dir' in kwargs:
|
||||
reverse = True if kwargs['sort_dir'] == 'desc' else False
|
||||
collection.audits = sorted(
|
||||
collection.audits,
|
||||
key=lambda audit: audit.audit_template_uuid,
|
||||
key=lambda audit: audit.goal_uuid,
|
||||
reverse=reverse)
|
||||
|
||||
collection.next = collection.get_next(limit, url=url, **kwargs)
|
||||
@@ -263,24 +380,34 @@ class AuditsController(rest.RestController):
|
||||
|
||||
def _get_audits_collection(self, marker, limit,
|
||||
sort_key, sort_dir, expand=False,
|
||||
resource_url=None, audit_template=None):
|
||||
resource_url=None, goal=None,
|
||||
strategy=None, host_aggregate=None):
|
||||
limit = api_utils.validate_limit(limit)
|
||||
api_utils.validate_sort_dir(sort_dir)
|
||||
|
||||
marker_obj = None
|
||||
if marker:
|
||||
marker_obj = objects.Audit.get_by_uuid(pecan.request.context,
|
||||
marker)
|
||||
|
||||
filters = {}
|
||||
if audit_template:
|
||||
if utils.is_uuid_like(audit_template):
|
||||
filters['audit_template_uuid'] = audit_template
|
||||
if goal:
|
||||
if utils.is_uuid_like(goal):
|
||||
filters['goal_uuid'] = goal
|
||||
else:
|
||||
filters['audit_template_name'] = audit_template
|
||||
# TODO(michaelgugino): add method to get goal by name.
|
||||
filters['goal_name'] = goal
|
||||
|
||||
if sort_key == 'audit_template_uuid':
|
||||
sort_db_key = None
|
||||
if strategy:
|
||||
if utils.is_uuid_like(strategy):
|
||||
filters['strategy_uuid'] = strategy
|
||||
else:
|
||||
# TODO(michaelgugino): add method to get goal by name.
|
||||
filters['strategy_name'] = strategy
|
||||
|
||||
if sort_key == 'goal_uuid':
|
||||
sort_db_key = 'goal_id'
|
||||
elif sort_key == 'strategy_uuid':
|
||||
sort_db_key = 'strategy_id'
|
||||
else:
|
||||
sort_db_key = sort_key
|
||||
|
||||
@@ -296,33 +423,46 @@ class AuditsController(rest.RestController):
|
||||
sort_dir=sort_dir)
|
||||
|
||||
@wsme_pecan.wsexpose(AuditCollection, types.uuid, int, wtypes.text,
|
||||
wtypes.text, wtypes.text)
|
||||
wtypes.text, wtypes.text, wtypes.text, int)
|
||||
def get_all(self, marker=None, limit=None,
|
||||
sort_key='id', sort_dir='asc', audit_template=None):
|
||||
sort_key='id', sort_dir='asc', goal=None,
|
||||
strategy=None, host_aggregate=None):
|
||||
"""Retrieve a list of audits.
|
||||
|
||||
:param marker: pagination marker for large data sets.
|
||||
:param limit: maximum number of resources to return in a single result.
|
||||
:param sort_key: column to sort results by. Default: id.
|
||||
:param sort_dir: direction to sort. "asc" or "desc". Default: asc.
|
||||
:param audit_template: Optional UUID or name of an audit
|
||||
template, to get only audits for that audit template.
|
||||
id.
|
||||
:param goal: goal UUID or name to filter by
|
||||
:param strategy: strategy UUID or name to filter by
|
||||
:param host_aggregate: Optional host_aggregate
|
||||
"""
|
||||
return self._get_audits_collection(marker, limit, sort_key,
|
||||
sort_dir,
|
||||
audit_template=audit_template)
|
||||
|
||||
@wsme_pecan.wsexpose(AuditCollection, types.uuid, int, wtypes.text,
|
||||
wtypes.text)
|
||||
def detail(self, marker=None, limit=None,
|
||||
context = pecan.request.context
|
||||
policy.enforce(context, 'audit:get_all',
|
||||
action='audit:get_all')
|
||||
|
||||
return self._get_audits_collection(marker, limit, sort_key,
|
||||
sort_dir, goal=goal,
|
||||
strategy=strategy,
|
||||
host_aggregate=host_aggregate)
|
||||
|
||||
@wsme_pecan.wsexpose(AuditCollection, wtypes.text, types.uuid, int,
|
||||
wtypes.text, wtypes.text)
|
||||
def detail(self, goal=None, marker=None, limit=None,
|
||||
sort_key='id', sort_dir='asc'):
|
||||
"""Retrieve a list of audits with detail.
|
||||
|
||||
:param goal: goal UUID or name to filter by
|
||||
:param marker: pagination marker for large data sets.
|
||||
:param limit: maximum number of resources to return in a single result.
|
||||
:param sort_key: column to sort results by. Default: id.
|
||||
:param sort_dir: direction to sort. "asc" or "desc". Default: asc.
|
||||
"""
|
||||
context = pecan.request.context
|
||||
policy.enforce(context, 'audit:detail',
|
||||
action='audit:detail')
|
||||
# NOTE(lucasagomes): /detail should only work agaist collections
|
||||
parent = pecan.request.path.split('/')[:-1][-1]
|
||||
if parent != "audits":
|
||||
@@ -332,7 +472,8 @@ class AuditsController(rest.RestController):
|
||||
resource_url = '/'.join(['audits', 'detail'])
|
||||
return self._get_audits_collection(marker, limit,
|
||||
sort_key, sort_dir, expand,
|
||||
resource_url)
|
||||
resource_url,
|
||||
goal=goal)
|
||||
|
||||
@wsme_pecan.wsexpose(Audit, types.uuid)
|
||||
def get_one(self, audit_uuid):
|
||||
@@ -343,8 +484,10 @@ class AuditsController(rest.RestController):
|
||||
if self.from_audits:
|
||||
raise exception.OperationNotPermitted
|
||||
|
||||
rpc_audit = objects.Audit.get_by_uuid(pecan.request.context,
|
||||
audit_uuid)
|
||||
context = pecan.request.context
|
||||
rpc_audit = api_utils.get_resource('Audit', audit_uuid)
|
||||
policy.enforce(context, 'audit:get', rpc_audit, action='audit:get')
|
||||
|
||||
return Audit.convert_with_links(rpc_audit)
|
||||
|
||||
@wsme_pecan.wsexpose(Audit, body=AuditPostType, status_code=201)
|
||||
@@ -353,17 +496,39 @@ class AuditsController(rest.RestController):
|
||||
|
||||
:param audit_p: a audit within the request body.
|
||||
"""
|
||||
audit = audit_p.as_audit()
|
||||
context = pecan.request.context
|
||||
policy.enforce(context, 'audit:create',
|
||||
action='audit:create')
|
||||
audit = audit_p.as_audit(context)
|
||||
|
||||
if self.from_audits:
|
||||
raise exception.OperationNotPermitted
|
||||
|
||||
if not audit._audit_template_uuid:
|
||||
if not audit._goal_uuid:
|
||||
raise exception.Invalid(
|
||||
message=_('The audit template UUID or name specified is '
|
||||
'invalid'))
|
||||
message=_('A valid goal_id or audit_template_id '
|
||||
'must be provided'))
|
||||
|
||||
strategy_uuid = audit.strategy_uuid
|
||||
no_schema = True
|
||||
if strategy_uuid is not None:
|
||||
# validate parameter when predefined strategy in audit template
|
||||
strategy = objects.Strategy.get(pecan.request.context,
|
||||
strategy_uuid)
|
||||
schema = strategy.parameters_spec
|
||||
if schema:
|
||||
# validate input parameter with default value feedback
|
||||
no_schema = False
|
||||
utils.StrictDefaultValidatingDraft4Validator(schema).validate(
|
||||
audit.parameters)
|
||||
|
||||
if no_schema and audit.parameters:
|
||||
raise exception.Invalid(_('Specify parameters but no predefined '
|
||||
'strategy for audit template, or no '
|
||||
'parameter spec in predefined strategy'))
|
||||
|
||||
audit_dict = audit.as_dict()
|
||||
context = pecan.request.context
|
||||
|
||||
new_audit = objects.Audit(context, **audit_dict)
|
||||
new_audit.create(context)
|
||||
|
||||
@@ -372,8 +537,9 @@ class AuditsController(rest.RestController):
|
||||
|
||||
# trigger decision-engine to run the audit
|
||||
|
||||
dc_client = rpcapi.DecisionEngineAPI()
|
||||
dc_client.trigger_audit(context, new_audit.uuid)
|
||||
if new_audit.audit_type == objects.audit.AuditType.ONESHOT.value:
|
||||
dc_client = rpcapi.DecisionEngineAPI()
|
||||
dc_client.trigger_audit(context, new_audit.uuid)
|
||||
|
||||
return Audit.convert_with_links(new_audit)
|
||||
|
||||
@@ -388,8 +554,15 @@ class AuditsController(rest.RestController):
|
||||
if self.from_audits:
|
||||
raise exception.OperationNotPermitted
|
||||
|
||||
context = pecan.request.context
|
||||
audit_to_update = api_utils.get_resource('Audit',
|
||||
audit_uuid)
|
||||
policy.enforce(context, 'audit:update', audit_to_update,
|
||||
action='audit:update')
|
||||
|
||||
audit_to_update = objects.Audit.get_by_uuid(pecan.request.context,
|
||||
audit_uuid)
|
||||
|
||||
try:
|
||||
audit_dict = audit_to_update.as_dict()
|
||||
audit = Audit(**api_utils.apply_jsonpatch(audit_dict, patch))
|
||||
@@ -417,8 +590,9 @@ class AuditsController(rest.RestController):
|
||||
|
||||
:param audit_uuid: UUID of a audit.
|
||||
"""
|
||||
context = pecan.request.context
|
||||
audit_to_delete = api_utils.get_resource('Audit', audit_uuid)
|
||||
policy.enforce(context, 'audit:update', audit_to_delete,
|
||||
action='audit:update')
|
||||
|
||||
audit_to_delete = objects.Audit.get_by_uuid(
|
||||
pecan.request.context,
|
||||
audit_uuid)
|
||||
audit_to_delete.soft_delete()
|
||||
|
||||
@@ -64,6 +64,7 @@ from watcher.api.controllers.v1 import types
|
||||
from watcher.api.controllers.v1 import utils as api_utils
|
||||
from watcher.common import context as context_utils
|
||||
from watcher.common import exception
|
||||
from watcher.common import policy
|
||||
from watcher.common import utils as common_utils
|
||||
from watcher import objects
|
||||
|
||||
@@ -493,6 +494,9 @@ class AuditTemplatesController(rest.RestController):
|
||||
:param sort_key: column to sort results by. Default: id.
|
||||
:param sort_dir: direction to sort. "asc" or "desc". Default: asc.
|
||||
"""
|
||||
context = pecan.request.context
|
||||
policy.enforce(context, 'audit_template:get_all',
|
||||
action='audit_template:get_all')
|
||||
filters = {}
|
||||
if goal:
|
||||
if common_utils.is_uuid_like(goal):
|
||||
@@ -522,6 +526,10 @@ class AuditTemplatesController(rest.RestController):
|
||||
:param sort_key: column to sort results by. Default: id.
|
||||
:param sort_dir: direction to sort. "asc" or "desc". Default: asc.
|
||||
"""
|
||||
context = pecan.request.context
|
||||
policy.enforce(context, 'audit_template:detail',
|
||||
action='audit_template:detail')
|
||||
|
||||
# NOTE(lucasagomes): /detail should only work agaist collections
|
||||
parent = pecan.request.path.split('/')[:-1][-1]
|
||||
if parent != "audit_templates":
|
||||
@@ -555,14 +563,11 @@ class AuditTemplatesController(rest.RestController):
|
||||
if self.from_audit_templates:
|
||||
raise exception.OperationNotPermitted
|
||||
|
||||
if common_utils.is_uuid_like(audit_template):
|
||||
rpc_audit_template = objects.AuditTemplate.get_by_uuid(
|
||||
pecan.request.context,
|
||||
audit_template)
|
||||
else:
|
||||
rpc_audit_template = objects.AuditTemplate.get_by_name(
|
||||
pecan.request.context,
|
||||
audit_template)
|
||||
context = pecan.request.context
|
||||
rpc_audit_template = api_utils.get_resource('AuditTemplate',
|
||||
audit_template)
|
||||
policy.enforce(context, 'audit_template:get', rpc_audit_template,
|
||||
action='audit_template:get')
|
||||
|
||||
return AuditTemplate.convert_with_links(rpc_audit_template)
|
||||
|
||||
@@ -578,6 +583,10 @@ class AuditTemplatesController(rest.RestController):
|
||||
if self.from_audit_templates:
|
||||
raise exception.OperationNotPermitted
|
||||
|
||||
context = pecan.request.context
|
||||
policy.enforce(context, 'audit_template:create',
|
||||
action='audit_template:create')
|
||||
|
||||
context = pecan.request.context
|
||||
audit_template = audit_template_postdata.as_audit_template()
|
||||
audit_template_dict = audit_template.as_dict()
|
||||
@@ -602,6 +611,13 @@ class AuditTemplatesController(rest.RestController):
|
||||
if self.from_audit_templates:
|
||||
raise exception.OperationNotPermitted
|
||||
|
||||
context = pecan.request.context
|
||||
audit_template_to_update = api_utils.get_resource('AuditTemplate',
|
||||
audit_template)
|
||||
policy.enforce(context, 'audit_template:update',
|
||||
audit_template_to_update,
|
||||
action='audit_template:update')
|
||||
|
||||
if common_utils.is_uuid_like(audit_template):
|
||||
audit_template_to_update = objects.AuditTemplate.get_by_uuid(
|
||||
pecan.request.context,
|
||||
@@ -639,14 +655,11 @@ class AuditTemplatesController(rest.RestController):
|
||||
|
||||
:param audit template_uuid: UUID or name of an audit template.
|
||||
"""
|
||||
|
||||
if common_utils.is_uuid_like(audit_template):
|
||||
audit_template_to_delete = objects.AuditTemplate.get_by_uuid(
|
||||
pecan.request.context,
|
||||
audit_template)
|
||||
else:
|
||||
audit_template_to_delete = objects.AuditTemplate.get_by_name(
|
||||
pecan.request.context,
|
||||
audit_template)
|
||||
context = pecan.request.context
|
||||
audit_template_to_delete = api_utils.get_resource('AuditTemplate',
|
||||
audit_template)
|
||||
policy.enforce(context, 'audit_template:update',
|
||||
audit_template_to_delete,
|
||||
action='audit_template:update')
|
||||
|
||||
audit_template_to_delete.soft_delete()
|
||||
|
||||
@@ -35,7 +35,7 @@ class Collection(base.APIBase):
|
||||
"""Return whether collection has more items."""
|
||||
return len(self.collection) and len(self.collection) == limit
|
||||
|
||||
def get_next(self, limit, url=None, **kwargs):
|
||||
def get_next(self, limit, url=None, marker_field="uuid", **kwargs):
|
||||
"""Return a link to the next subset of the collection."""
|
||||
if not self.has_next(limit):
|
||||
return wtypes.Unset
|
||||
@@ -44,7 +44,7 @@ class Collection(base.APIBase):
|
||||
q_args = ''.join(['%s=%s&' % (key, kwargs[key]) for key in kwargs])
|
||||
next_args = '?%(args)slimit=%(limit)d&marker=%(marker)s' % {
|
||||
'args': q_args, 'limit': limit,
|
||||
'marker': getattr(self.collection[-1], "uuid")}
|
||||
'marker': getattr(self.collection[-1], marker_field)}
|
||||
|
||||
return link.Link.make_link('next', pecan.request.host_url,
|
||||
resource_url, next_args).href
|
||||
|
||||
72
watcher/api/controllers/v1/efficacy_indicator.py
Normal file
@@ -0,0 +1,72 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
# Copyright (c) 2016 b<>com
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
"""
|
||||
An efficacy indicator is a single value that gives an indication on how the
|
||||
:ref:`solution <solution_definition>` produced by a given :ref:`strategy
|
||||
<strategy_definition>` performed. These efficacy indicators are specific to a
|
||||
given :ref:`goal <goal_definition>` and are usually used to compute the
|
||||
:ref:`gobal efficacy <efficacy_definition>` of the resulting :ref:`action plan
|
||||
<action_plan_definition>`.
|
||||
|
||||
In Watcher, these efficacy indicators are specified alongside the goal they
|
||||
relate to. When a strategy (which always relates to a goal) is executed, it
|
||||
produces a solution containing the efficacy indicators specified by the goal.
|
||||
This solution, which has been translated by the :ref:`Watcher Planner
|
||||
<watcher_planner_definition>` into an action plan, will see its indicators and
|
||||
global efficacy stored and would now be accessible through the :ref:`Watcher
|
||||
API <archi_watcher_api_definition>`.
|
||||
"""
|
||||
|
||||
import numbers
|
||||
|
||||
from wsme import types as wtypes
|
||||
|
||||
from watcher.api.controllers import base
|
||||
from watcher import objects
|
||||
|
||||
|
||||
class EfficacyIndicator(base.APIBase):
|
||||
"""API representation of a efficacy indicator.
|
||||
|
||||
This class enforces type checking and value constraints, and converts
|
||||
between the internal object model and the API representation of an
|
||||
efficacy indicator.
|
||||
"""
|
||||
|
||||
name = wtypes.wsattr(wtypes.text, mandatory=True)
|
||||
"""Name of this efficacy indicator"""
|
||||
|
||||
description = wtypes.wsattr(wtypes.text, mandatory=False)
|
||||
"""Description of this efficacy indicator"""
|
||||
|
||||
unit = wtypes.wsattr(wtypes.text, mandatory=False)
|
||||
"""Unit of this efficacy indicator"""
|
||||
|
||||
value = wtypes.wsattr(numbers.Number, mandatory=True)
|
||||
"""Value of this efficacy indicator"""
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
super(EfficacyIndicator, self).__init__()
|
||||
|
||||
self.fields = []
|
||||
fields = list(objects.EfficacyIndicator.fields)
|
||||
for field in fields:
|
||||
# Skip fields we do not expose.
|
||||
if not hasattr(self, field):
|
||||
continue
|
||||
self.fields.append(field)
|
||||
setattr(self, field, kwargs.get(field, wtypes.Unset))
|
||||
@@ -32,8 +32,6 @@ Here are some examples of :ref:`Goals <goal_definition>`:
|
||||
modification, ...
|
||||
"""
|
||||
|
||||
from oslo_config import cfg
|
||||
|
||||
import pecan
|
||||
from pecan import rest
|
||||
import wsme
|
||||
@@ -46,11 +44,9 @@ from watcher.api.controllers.v1 import collection
|
||||
from watcher.api.controllers.v1 import types
|
||||
from watcher.api.controllers.v1 import utils as api_utils
|
||||
from watcher.common import exception
|
||||
from watcher.common import utils as common_utils
|
||||
from watcher.common import policy
|
||||
from watcher import objects
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
||||
|
||||
class Goal(base.APIBase):
|
||||
"""API representation of a goal.
|
||||
@@ -68,24 +64,28 @@ class Goal(base.APIBase):
|
||||
display_name = wtypes.text
|
||||
"""Localized name of the goal"""
|
||||
|
||||
efficacy_specification = wtypes.wsattr(types.jsontype, readonly=True)
|
||||
"""Efficacy specification for this goal"""
|
||||
|
||||
links = wsme.wsattr([link.Link], readonly=True)
|
||||
"""A list containing a self link and associated audit template links"""
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
super(Goal, self).__init__()
|
||||
|
||||
self.fields = []
|
||||
self.fields.append('uuid')
|
||||
self.fields.append('name')
|
||||
self.fields.append('display_name')
|
||||
setattr(self, 'uuid', kwargs.get('uuid', wtypes.Unset))
|
||||
setattr(self, 'name', kwargs.get('name', wtypes.Unset))
|
||||
setattr(self, 'display_name', kwargs.get('display_name', wtypes.Unset))
|
||||
fields = list(objects.Goal.fields)
|
||||
|
||||
for k in fields:
|
||||
# Skip fields we do not expose.
|
||||
if not hasattr(self, k):
|
||||
continue
|
||||
self.fields.append(k)
|
||||
setattr(self, k, kwargs.get(k, wtypes.Unset))
|
||||
|
||||
@staticmethod
|
||||
def _convert_with_links(goal, url, expand=True):
|
||||
if not expand:
|
||||
goal.unset_fields_except(['uuid', 'name', 'display_name'])
|
||||
goal.unset_fields_except(['uuid', 'name', 'display_name',
|
||||
'efficacy_specification'])
|
||||
|
||||
goal.links = [link.Link.make_link('self', url,
|
||||
'goals', goal.uuid),
|
||||
@@ -101,9 +101,16 @@ class Goal(base.APIBase):
|
||||
|
||||
@classmethod
|
||||
def sample(cls, expand=True):
|
||||
sample = cls(uuid='27e3153e-d5bf-4b7e-b517-fb518e17f34c',
|
||||
name='DUMMY',
|
||||
display_name='Dummy strategy')
|
||||
sample = cls(
|
||||
uuid='27e3153e-d5bf-4b7e-b517-fb518e17f34c',
|
||||
name='DUMMY',
|
||||
display_name='Dummy strategy',
|
||||
efficacy_specification=[
|
||||
{'description': 'Dummy indicator', 'name': 'dummy',
|
||||
'schema': 'Range(min=0, max=100, min_included=True, '
|
||||
'max_included=True, msg=None)',
|
||||
'unit': '%'}
|
||||
])
|
||||
return cls._convert_with_links(sample, 'http://localhost:9322', expand)
|
||||
|
||||
|
||||
@@ -190,6 +197,9 @@ class GoalsController(rest.RestController):
|
||||
:param sort_key: column to sort results by. Default: id.
|
||||
:param sort_dir: direction to sort. "asc" or "desc". Default: asc.
|
||||
"""
|
||||
context = pecan.request.context
|
||||
policy.enforce(context, 'goal:get_all',
|
||||
action='goal:get_all')
|
||||
return self._get_goals_collection(marker, limit, sort_key, sort_dir)
|
||||
|
||||
@wsme_pecan.wsexpose(GoalCollection, wtypes.text, int,
|
||||
@@ -202,6 +212,9 @@ class GoalsController(rest.RestController):
|
||||
:param sort_key: column to sort results by. Default: id.
|
||||
:param sort_dir: direction to sort. "asc" or "desc". Default: asc.
|
||||
"""
|
||||
context = pecan.request.context
|
||||
policy.enforce(context, 'goal:detail',
|
||||
action='goal:detail')
|
||||
# NOTE(lucasagomes): /detail should only work agaist collections
|
||||
parent = pecan.request.path.split('/')[:-1][-1]
|
||||
if parent != "goals":
|
||||
@@ -220,11 +233,8 @@ class GoalsController(rest.RestController):
|
||||
if self.from_goals:
|
||||
raise exception.OperationNotPermitted
|
||||
|
||||
if common_utils.is_uuid_like(goal):
|
||||
get_goal_func = objects.Goal.get_by_uuid
|
||||
else:
|
||||
get_goal_func = objects.Goal.get_by_name
|
||||
|
||||
rpc_goal = get_goal_func(pecan.request.context, goal)
|
||||
context = pecan.request.context
|
||||
rpc_goal = api_utils.get_resource('Goal', goal)
|
||||
policy.enforce(context, 'goal:get', rpc_goal, action='goal:get')
|
||||
|
||||
return Goal.convert_with_links(rpc_goal)
|
||||
|
||||
248
watcher/api/controllers/v1/scoring_engine.py
Normal file
@@ -0,0 +1,248 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
# Copyright 2016 Intel
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
"""
|
||||
A :ref:`Scoring Engine <scoring_engine_definition>` is an executable that has
|
||||
a well-defined input, a well-defined output, and performs a purely mathematical
|
||||
task. That is, the calculation does not depend on the environment in which it
|
||||
is running - it would produce the same result anywhere.
|
||||
|
||||
Because there might be multiple algorithms used to build a particular data
|
||||
model (and therefore a scoring engine), the usage of scoring engine might
|
||||
vary. A metainfo field is supposed to contain any information which might
|
||||
be needed by the user of a given scoring engine.
|
||||
"""
|
||||
|
||||
import pecan
|
||||
from pecan import rest
|
||||
import wsme
|
||||
from wsme import types as wtypes
|
||||
import wsmeext.pecan as wsme_pecan
|
||||
|
||||
from watcher.api.controllers import base
|
||||
from watcher.api.controllers import link
|
||||
from watcher.api.controllers.v1 import collection
|
||||
from watcher.api.controllers.v1 import types
|
||||
from watcher.api.controllers.v1 import utils as api_utils
|
||||
from watcher.common import exception
|
||||
from watcher.common import policy
|
||||
from watcher import objects
|
||||
|
||||
|
||||
class ScoringEngine(base.APIBase):
|
||||
"""API representation of a scoring engine.
|
||||
|
||||
This class enforces type checking and value constraints, and converts
|
||||
between the internal object model and the API representation of a scoring
|
||||
engine.
|
||||
"""
|
||||
|
||||
uuid = types.uuid
|
||||
"""Unique UUID of the scoring engine"""
|
||||
|
||||
name = wtypes.text
|
||||
"""The name of the scoring engine"""
|
||||
|
||||
description = wtypes.text
|
||||
"""A human readable description of the Scoring Engine"""
|
||||
|
||||
metainfo = wtypes.text
|
||||
"""A metadata associated with the scoring engine"""
|
||||
|
||||
links = wsme.wsattr([link.Link], readonly=True)
|
||||
"""A list containing a self link and associated action links"""
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
super(ScoringEngine, self).__init__()
|
||||
|
||||
self.fields = []
|
||||
self.fields.append('uuid')
|
||||
self.fields.append('name')
|
||||
self.fields.append('description')
|
||||
self.fields.append('metainfo')
|
||||
setattr(self, 'uuid', kwargs.get('uuid', wtypes.Unset))
|
||||
setattr(self, 'name', kwargs.get('name', wtypes.Unset))
|
||||
setattr(self, 'description', kwargs.get('description', wtypes.Unset))
|
||||
setattr(self, 'metainfo', kwargs.get('metainfo', wtypes.Unset))
|
||||
|
||||
@staticmethod
|
||||
def _convert_with_links(se, url, expand=True):
|
||||
if not expand:
|
||||
se.unset_fields_except(
|
||||
['uuid', 'name', 'description', 'metainfo'])
|
||||
|
||||
se.links = [link.Link.make_link('self', url,
|
||||
'scoring_engines', se.uuid),
|
||||
link.Link.make_link('bookmark', url,
|
||||
'scoring_engines', se.uuid,
|
||||
bookmark=True)]
|
||||
return se
|
||||
|
||||
@classmethod
|
||||
def convert_with_links(cls, scoring_engine, expand=True):
|
||||
scoring_engine = ScoringEngine(**scoring_engine.as_dict())
|
||||
return cls._convert_with_links(
|
||||
scoring_engine, pecan.request.host_url, expand)
|
||||
|
||||
@classmethod
|
||||
def sample(cls, expand=True):
|
||||
sample = cls(uuid='81bbd3c7-3b08-4d12-a268-99354dbf7b71',
|
||||
name='sample-se-123',
|
||||
description='Sample Scoring Engine 123 just for testing')
|
||||
return cls._convert_with_links(sample, 'http://localhost:9322', expand)
|
||||
|
||||
|
||||
class ScoringEngineCollection(collection.Collection):
|
||||
"""API representation of a collection of scoring engines."""
|
||||
|
||||
scoring_engines = [ScoringEngine]
|
||||
"""A list containing scoring engine objects"""
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
super(ScoringEngineCollection, self).__init__()
|
||||
self._type = 'scoring_engines'
|
||||
|
||||
@staticmethod
|
||||
def convert_with_links(scoring_engines, limit, url=None, expand=False,
|
||||
**kwargs):
|
||||
|
||||
collection = ScoringEngineCollection()
|
||||
collection.scoring_engines = [ScoringEngine.convert_with_links(
|
||||
se, expand) for se in scoring_engines]
|
||||
|
||||
if 'sort_key' in kwargs:
|
||||
reverse = False
|
||||
if kwargs['sort_key'] == 'name':
|
||||
if 'sort_dir' in kwargs:
|
||||
reverse = True if kwargs['sort_dir'] == 'desc' else False
|
||||
collection.goals = sorted(
|
||||
collection.scoring_engines,
|
||||
key=lambda se: se.name,
|
||||
reverse=reverse)
|
||||
|
||||
collection.next = collection.get_next(limit, url=url, **kwargs)
|
||||
return collection
|
||||
|
||||
@classmethod
|
||||
def sample(cls):
|
||||
sample = cls()
|
||||
sample.scoring_engines = [ScoringEngine.sample(expand=False)]
|
||||
return sample
|
||||
|
||||
|
||||
class ScoringEngineController(rest.RestController):
|
||||
"""REST controller for Scoring Engines."""
|
||||
def __init__(self):
|
||||
super(ScoringEngineController, self).__init__()
|
||||
|
||||
from_scoring_engines = False
|
||||
"""A flag to indicate if the requests to this controller are coming
|
||||
from the top-level resource Scoring Engines."""
|
||||
|
||||
_custom_actions = {
|
||||
'detail': ['GET'],
|
||||
}
|
||||
|
||||
def _get_scoring_engines_collection(self, marker, limit,
|
||||
sort_key, sort_dir, expand=False,
|
||||
resource_url=None):
|
||||
|
||||
limit = api_utils.validate_limit(limit)
|
||||
api_utils.validate_sort_dir(sort_dir)
|
||||
|
||||
marker_obj = None
|
||||
if marker:
|
||||
marker_obj = objects.ScoringEngine.get_by_uuid(
|
||||
pecan.request.context, marker)
|
||||
|
||||
filters = {}
|
||||
|
||||
sort_db_key = sort_key
|
||||
|
||||
scoring_engines = objects.ScoringEngine.list(
|
||||
context=pecan.request.context,
|
||||
limit=limit,
|
||||
marker=marker_obj,
|
||||
sort_key=sort_db_key,
|
||||
sort_dir=sort_dir,
|
||||
filters=filters)
|
||||
|
||||
return ScoringEngineCollection.convert_with_links(
|
||||
scoring_engines,
|
||||
limit,
|
||||
url=resource_url,
|
||||
expand=expand,
|
||||
sort_key=sort_key,
|
||||
sort_dir=sort_dir)
|
||||
|
||||
@wsme_pecan.wsexpose(ScoringEngineCollection, wtypes.text,
|
||||
int, wtypes.text, wtypes.text)
|
||||
def get_all(self, marker=None, limit=None, sort_key='id',
|
||||
sort_dir='asc'):
|
||||
"""Retrieve a list of Scoring Engines.
|
||||
|
||||
:param marker: pagination marker for large data sets.
|
||||
:param limit: maximum number of resources to return in a single result.
|
||||
:param sort_key: column to sort results by. Default: name.
|
||||
:param sort_dir: direction to sort. "asc" or "desc". Default: asc.
|
||||
"""
|
||||
context = pecan.request.context
|
||||
policy.enforce(context, 'scoring_engine:get_all',
|
||||
action='scoring_engine:get_all')
|
||||
|
||||
return self._get_scoring_engines_collection(
|
||||
marker, limit, sort_key, sort_dir)
|
||||
|
||||
@wsme_pecan.wsexpose(ScoringEngineCollection, wtypes.text,
|
||||
int, wtypes.text, wtypes.text)
|
||||
def detail(self, marker=None, limit=None, sort_key='id', sort_dir='asc'):
|
||||
"""Retrieve a list of Scoring Engines with detail.
|
||||
|
||||
:param marker: pagination marker for large data sets.
|
||||
:param limit: maximum number of resources to return in a single result.
|
||||
:param sort_key: column to sort results by. Default: name.
|
||||
:param sort_dir: direction to sort. "asc" or "desc". Default: asc.
|
||||
"""
|
||||
context = pecan.request.context
|
||||
policy.enforce(context, 'scoring_engine:detail',
|
||||
action='scoring_engine:detail')
|
||||
|
||||
parent = pecan.request.path.split('/')[:-1][-1]
|
||||
if parent != "scoring_engines":
|
||||
raise exception.HTTPNotFound
|
||||
expand = True
|
||||
resource_url = '/'.join(['scoring_engines', 'detail'])
|
||||
return self._get_scoring_engines_collection(
|
||||
marker, limit, sort_key, sort_dir, expand, resource_url)
|
||||
|
||||
@wsme_pecan.wsexpose(ScoringEngine, wtypes.text)
|
||||
def get_one(self, scoring_engine):
|
||||
"""Retrieve information about the given Scoring Engine.
|
||||
|
||||
:param scoring_engine_name: The name of the Scoring Engine.
|
||||
"""
|
||||
context = pecan.request.context
|
||||
policy.enforce(context, 'scoring_engine:get',
|
||||
action='scoring_engine:get')
|
||||
|
||||
if self.from_scoring_engines:
|
||||
raise exception.OperationNotPermitted
|
||||
|
||||
rpc_scoring_engine = api_utils.get_resource(
|
||||
'ScoringEngine', scoring_engine)
|
||||
|
||||
return ScoringEngine.convert_with_links(rpc_scoring_engine)
|
||||
@@ -27,8 +27,6 @@ Some strategies may provide better optimization results but may take more time
|
||||
to find an optimal :ref:`Solution <solution_definition>`.
|
||||
"""
|
||||
|
||||
from oslo_config import cfg
|
||||
|
||||
import pecan
|
||||
from pecan import rest
|
||||
import wsme
|
||||
@@ -41,11 +39,10 @@ from watcher.api.controllers.v1 import collection
|
||||
from watcher.api.controllers.v1 import types
|
||||
from watcher.api.controllers.v1 import utils as api_utils
|
||||
from watcher.common import exception
|
||||
from watcher.common import policy
|
||||
from watcher.common import utils as common_utils
|
||||
from watcher import objects
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
||||
|
||||
class Strategy(base.APIBase):
|
||||
"""API representation of a strategy.
|
||||
@@ -54,6 +51,7 @@ class Strategy(base.APIBase):
|
||||
between the internal object model and the API representation of a strategy.
|
||||
"""
|
||||
_goal_uuid = None
|
||||
_goal_name = None
|
||||
|
||||
def _get_goal(self, value):
|
||||
if value == wtypes.Unset:
|
||||
@@ -81,6 +79,16 @@ class Strategy(base.APIBase):
|
||||
if goal:
|
||||
self._goal_uuid = goal.uuid
|
||||
|
||||
def _get_goal_name(self):
|
||||
return self._goal_name
|
||||
|
||||
def _set_goal_name(self, value):
|
||||
if value and self._goal_name != value:
|
||||
self._goal_name = None
|
||||
goal = self._get_goal(value)
|
||||
if goal:
|
||||
self._goal_name = goal.name
|
||||
|
||||
uuid = types.uuid
|
||||
"""Unique UUID for this strategy"""
|
||||
|
||||
@@ -97,6 +105,13 @@ class Strategy(base.APIBase):
|
||||
mandatory=True)
|
||||
"""The UUID of the goal this audit refers to"""
|
||||
|
||||
goal_name = wsme.wsproperty(wtypes.text, _get_goal_name, _set_goal_name,
|
||||
mandatory=False)
|
||||
"""The name of the goal this audit refers to"""
|
||||
|
||||
parameters_spec = {wtypes.text: types.jsontype}
|
||||
""" Parameters spec dict"""
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
super(Strategy, self).__init__()
|
||||
|
||||
@@ -105,16 +120,21 @@ class Strategy(base.APIBase):
|
||||
self.fields.append('name')
|
||||
self.fields.append('display_name')
|
||||
self.fields.append('goal_uuid')
|
||||
self.fields.append('goal_name')
|
||||
self.fields.append('parameters_spec')
|
||||
setattr(self, 'uuid', kwargs.get('uuid', wtypes.Unset))
|
||||
setattr(self, 'name', kwargs.get('name', wtypes.Unset))
|
||||
setattr(self, 'display_name', kwargs.get('display_name', wtypes.Unset))
|
||||
setattr(self, 'goal_uuid', kwargs.get('goal_id', wtypes.Unset))
|
||||
setattr(self, 'goal_name', kwargs.get('goal_id', wtypes.Unset))
|
||||
setattr(self, 'parameters_spec', kwargs.get('parameters_spec',
|
||||
wtypes.Unset))
|
||||
|
||||
@staticmethod
|
||||
def _convert_with_links(strategy, url, expand=True):
|
||||
if not expand:
|
||||
strategy.unset_fields_except(
|
||||
['uuid', 'name', 'display_name', 'goal_uuid'])
|
||||
['uuid', 'name', 'display_name', 'goal_uuid', 'goal_name'])
|
||||
|
||||
strategy.links = [
|
||||
link.Link.make_link('self', url, 'strategies', strategy.uuid),
|
||||
@@ -223,6 +243,9 @@ class StrategiesController(rest.RestController):
|
||||
:param sort_key: column to sort results by. Default: id.
|
||||
:param sort_dir: direction to sort. "asc" or "desc". Default: asc.
|
||||
"""
|
||||
context = pecan.request.context
|
||||
policy.enforce(context, 'strategy:get_all',
|
||||
action='strategy:get_all')
|
||||
filters = {}
|
||||
if goal:
|
||||
if common_utils.is_uuid_like(goal):
|
||||
@@ -245,6 +268,9 @@ class StrategiesController(rest.RestController):
|
||||
:param sort_key: column to sort results by. Default: id.
|
||||
:param sort_dir: direction to sort. "asc" or "desc". Default: asc.
|
||||
"""
|
||||
context = pecan.request.context
|
||||
policy.enforce(context, 'strategy:detail',
|
||||
action='strategy:detail')
|
||||
# NOTE(lucasagomes): /detail should only work agaist collections
|
||||
parent = pecan.request.path.split('/')[:-1][-1]
|
||||
if parent != "strategies":
|
||||
@@ -271,11 +297,9 @@ class StrategiesController(rest.RestController):
|
||||
if self.from_strategies:
|
||||
raise exception.OperationNotPermitted
|
||||
|
||||
if common_utils.is_uuid_like(strategy):
|
||||
get_strategy_func = objects.Strategy.get_by_uuid
|
||||
else:
|
||||
get_strategy_func = objects.Strategy.get_by_name
|
||||
|
||||
rpc_strategy = get_strategy_func(pecan.request.context, strategy)
|
||||
context = pecan.request.context
|
||||
rpc_strategy = api_utils.get_resource('Strategy', strategy)
|
||||
policy.enforce(context, 'strategy:get', rpc_strategy,
|
||||
action='strategy:get')
|
||||
|
||||
return Strategy.convert_with_links(rpc_strategy)
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import json
|
||||
from oslo_serialization import jsonutils
|
||||
from oslo_utils import strutils
|
||||
import six
|
||||
import wsme
|
||||
@@ -118,7 +118,7 @@ class JsonType(wtypes.UserType):
|
||||
@staticmethod
|
||||
def validate(value):
|
||||
try:
|
||||
json.dumps(value)
|
||||
jsonutils.dumps(value, default=None)
|
||||
except TypeError:
|
||||
raise exception.Invalid(_('%s is not JSON serializable') % value)
|
||||
else:
|
||||
|
||||
@@ -15,9 +15,12 @@
|
||||
|
||||
import jsonpatch
|
||||
from oslo_config import cfg
|
||||
from oslo_utils import uuidutils
|
||||
import pecan
|
||||
import wsme
|
||||
|
||||
from watcher._i18n import _
|
||||
from watcher import objects
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
||||
@@ -75,3 +78,19 @@ def as_filters_dict(**filters):
|
||||
filters_dict[filter_name] = filter_value
|
||||
|
||||
return filters_dict
|
||||
|
||||
|
||||
def get_resource(resource, resource_ident):
|
||||
"""Get the resource from the uuid or logical name.
|
||||
|
||||
:param resource: the resource type.
|
||||
:param resource_ident: the UUID or logical name of the resource.
|
||||
|
||||
:returns: The resource.
|
||||
"""
|
||||
resource = getattr(objects, resource)
|
||||
|
||||
if uuidutils.is_uuid_like(resource_ident):
|
||||
return resource.get_by_uuid(pecan.request.context, resource_ident)
|
||||
|
||||
return resource.get_by_name(pecan.request.context, resource_ident)
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
from oslo_config import cfg
|
||||
from oslo_utils import importutils
|
||||
from pecan import hooks
|
||||
from six.moves import http_client
|
||||
|
||||
from watcher.common import context
|
||||
|
||||
@@ -56,6 +57,8 @@ class ContextHook(hooks.PecanHook):
|
||||
auth_token = headers.get('X-Auth-Token', auth_token)
|
||||
show_deleted = headers.get('X-Show-Deleted')
|
||||
auth_token_info = state.request.environ.get('keystone.token_info')
|
||||
roles = (headers.get('X-Roles', None) and
|
||||
headers.get('X-Roles').split(','))
|
||||
|
||||
auth_url = headers.get('X-Auth-Url')
|
||||
if auth_url is None:
|
||||
@@ -72,7 +75,8 @@ class ContextHook(hooks.PecanHook):
|
||||
project_id=project_id,
|
||||
domain_id=domain_id,
|
||||
domain_name=domain_name,
|
||||
show_deleted=show_deleted)
|
||||
show_deleted=show_deleted,
|
||||
roles=roles)
|
||||
|
||||
|
||||
class NoExceptionTracebackHook(hooks.PecanHook):
|
||||
@@ -92,18 +96,20 @@ class NoExceptionTracebackHook(hooks.PecanHook):
|
||||
return
|
||||
|
||||
# Do nothing if there is no error.
|
||||
if 200 <= state.response.status_int < 400:
|
||||
# Status codes in the range 200 (OK) to 399 (400 = BAD_REQUEST) are not
|
||||
# an error.
|
||||
if (http_client.OK <= state.response.status_int <
|
||||
http_client.BAD_REQUEST):
|
||||
return
|
||||
|
||||
json_body = state.response.json
|
||||
# Do not remove traceback when server in debug mode (except 'Server'
|
||||
# errors when 'debuginfo' will be used for traces).
|
||||
if cfg.CONF.debug and json_body.get('faultcode') != 'Server':
|
||||
# Do not remove traceback when traceback config is set
|
||||
if cfg.CONF.debug:
|
||||
return
|
||||
|
||||
faultstring = json_body.get('faultstring')
|
||||
traceback_marker = 'Traceback (most recent call last):'
|
||||
if faultstring and (traceback_marker in faultstring):
|
||||
if faultstring and traceback_marker in faultstring:
|
||||
# Cut-off traceback.
|
||||
faultstring = faultstring.split(traceback_marker, 1)[0]
|
||||
# Remove trailing newlines and spaces if any.
|
||||
|
||||
@@ -20,21 +20,21 @@ response with one formatted so the client can parse it.
|
||||
Based on pecan.middleware.errordocument
|
||||
"""
|
||||
|
||||
import json
|
||||
from xml import etree as et
|
||||
|
||||
from oslo_log import log
|
||||
from oslo_serialization import jsonutils
|
||||
import six
|
||||
import webob
|
||||
|
||||
from watcher._i18n import _
|
||||
from watcher._i18n import _LE
|
||||
from watcher._i18n import _, _LE
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
|
||||
|
||||
class ParsableErrorMiddleware(object):
|
||||
"""Replace error body with something the client can parse."""
|
||||
|
||||
def __init__(self, app):
|
||||
self.app = app
|
||||
|
||||
@@ -59,8 +59,7 @@ class ParsableErrorMiddleware(object):
|
||||
# compute the length.
|
||||
headers = [(h, v)
|
||||
for (h, v) in headers
|
||||
if h not in ('Content-Length', 'Content-Type')
|
||||
]
|
||||
if h not in ('Content-Length', 'Content-Type')]
|
||||
# Save the headers in case we need to modify them.
|
||||
state['headers'] = headers
|
||||
return start_response(status, headers, exc_info)
|
||||
@@ -68,23 +67,27 @@ class ParsableErrorMiddleware(object):
|
||||
app_iter = self.app(environ, replacement_start_response)
|
||||
if (state['status_code'] // 100) not in (2, 3):
|
||||
req = webob.Request(environ)
|
||||
if (req.accept.best_match(['application/json', 'application/xml']
|
||||
) == 'application/xml'):
|
||||
if (
|
||||
req.accept.best_match(
|
||||
['application/json',
|
||||
'application/xml']) == 'application/xml'
|
||||
):
|
||||
try:
|
||||
# simple check xml is valid
|
||||
body = [et.ElementTree.tostring(
|
||||
et.ElementTree.Element('error_message',
|
||||
text='\n'.join(app_iter)))]
|
||||
body = [
|
||||
et.ElementTree.tostring(
|
||||
et.ElementTree.Element(
|
||||
'error_message', text='\n'.join(app_iter)))]
|
||||
except et.ElementTree.ParseError as err:
|
||||
LOG.error(_LE('Error parsing HTTP response: %s'), err)
|
||||
body = [et.ElementTree.tostring(
|
||||
et.ElementTree.Element('error_message',
|
||||
text=state['status_code']))]
|
||||
body = ['<error_message>%s'
|
||||
'</error_message>' % state['status_code']]
|
||||
state['headers'].append(('Content-Type', 'application/xml'))
|
||||
else:
|
||||
if six.PY3:
|
||||
app_iter = [i.decode('utf-8') for i in app_iter]
|
||||
body = [json.dumps({'error_message': '\n'.join(app_iter)})]
|
||||
body = [jsonutils.dumps(
|
||||
{'error_message': '\n'.join(app_iter)})]
|
||||
if six.PY3:
|
||||
body = [item.encode('utf-8') for item in body]
|
||||
state['headers'].append(('Content-Type', 'application/json'))
|
||||
|
||||
@@ -28,11 +28,11 @@ LOG = log.getLogger(__name__)
|
||||
|
||||
|
||||
class DefaultActionPlanHandler(base.BaseActionPlanHandler):
|
||||
def __init__(self, context, applier_manager, action_plan_uuid):
|
||||
def __init__(self, context, service, action_plan_uuid):
|
||||
super(DefaultActionPlanHandler, self).__init__()
|
||||
self.ctx = context
|
||||
self.service = service
|
||||
self.action_plan_uuid = action_plan_uuid
|
||||
self.applier_manager = applier_manager
|
||||
|
||||
def notify(self, uuid, event_type, state):
|
||||
action_plan = ap_objects.ActionPlan.get_by_uuid(self.ctx, uuid)
|
||||
@@ -43,8 +43,7 @@ class DefaultActionPlanHandler(base.BaseActionPlanHandler):
|
||||
ev.data = {}
|
||||
payload = {'action_plan__uuid': uuid,
|
||||
'action_plan_state': state}
|
||||
self.applier_manager.status_topic_handler.publish_event(
|
||||
ev.type.name, payload)
|
||||
self.service.publish_status_event(ev.type.name, payload)
|
||||
|
||||
def execute(self):
|
||||
try:
|
||||
@@ -52,10 +51,9 @@ class DefaultActionPlanHandler(base.BaseActionPlanHandler):
|
||||
self.notify(self.action_plan_uuid,
|
||||
event_types.EventTypes.LAUNCH_ACTION_PLAN,
|
||||
ap_objects.State.ONGOING)
|
||||
applier = default.DefaultApplier(self.ctx, self.applier_manager)
|
||||
applier = default.DefaultApplier(self.ctx, self.service)
|
||||
applier.execute(self.action_plan_uuid)
|
||||
state = ap_objects.State.SUCCEEDED
|
||||
|
||||
except Exception as e:
|
||||
LOG.exception(e)
|
||||
state = ap_objects.State.FAILED
|
||||
|
||||
@@ -15,8 +15,6 @@
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
|
||||
import abc
|
||||
|
||||
@@ -28,7 +26,7 @@ from watcher.common.loader import loadable
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
class BaseAction(loadable.Loadable):
|
||||
# NOTE(jed) by convention we decided
|
||||
# NOTE(jed): by convention we decided
|
||||
# that the attribute "resource_id" is the unique id of
|
||||
# the resource to which the Action applies to allow us to use it in the
|
||||
# watcher dashboard and will be nested in input_parameters
|
||||
@@ -99,7 +97,7 @@ class BaseAction(loadable.Loadable):
|
||||
raise NotImplementedError()
|
||||
|
||||
@abc.abstractmethod
|
||||
def precondition(self):
|
||||
def pre_condition(self):
|
||||
"""Hook: called before the execution of an action
|
||||
|
||||
This method can be used to perform some initializations or to make
|
||||
@@ -110,7 +108,7 @@ class BaseAction(loadable.Loadable):
|
||||
raise NotImplementedError()
|
||||
|
||||
@abc.abstractmethod
|
||||
def postcondition(self):
|
||||
def post_condition(self):
|
||||
"""Hook: called after the execution of an action
|
||||
|
||||
This function is called regardless of whether an action succeded or
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
import six
|
||||
import voluptuous
|
||||
|
||||
@@ -23,7 +24,7 @@ from watcher._i18n import _
|
||||
from watcher.applier.actions import base
|
||||
from watcher.common import exception
|
||||
from watcher.common import nova_helper
|
||||
from watcher.decision_engine.model import hypervisor_state as hstate
|
||||
from watcher.decision_engine.model import element
|
||||
|
||||
|
||||
class ChangeNovaServiceState(base.BaseAction):
|
||||
@@ -57,7 +58,7 @@ class ChangeNovaServiceState(base.BaseAction):
|
||||
voluptuous.Length(min=1)),
|
||||
voluptuous.Required(self.STATE):
|
||||
voluptuous.Any(*[state.value
|
||||
for state in list(hstate.HypervisorState)]),
|
||||
for state in list(element.ServiceState)]),
|
||||
})
|
||||
|
||||
@property
|
||||
@@ -70,17 +71,17 @@ class ChangeNovaServiceState(base.BaseAction):
|
||||
|
||||
def execute(self):
|
||||
target_state = None
|
||||
if self.state == hstate.HypervisorState.DISABLED.value:
|
||||
if self.state == element.ServiceState.DISABLED.value:
|
||||
target_state = False
|
||||
elif self.state == hstate.HypervisorState.ENABLED.value:
|
||||
elif self.state == element.ServiceState.ENABLED.value:
|
||||
target_state = True
|
||||
return self._nova_manage_service(target_state)
|
||||
|
||||
def revert(self):
|
||||
target_state = None
|
||||
if self.state == hstate.HypervisorState.DISABLED.value:
|
||||
if self.state == element.ServiceState.DISABLED.value:
|
||||
target_state = True
|
||||
elif self.state == hstate.HypervisorState.ENABLED.value:
|
||||
elif self.state == element.ServiceState.ENABLED.value:
|
||||
target_state = False
|
||||
return self._nova_manage_service(target_state)
|
||||
|
||||
@@ -95,8 +96,8 @@ class ChangeNovaServiceState(base.BaseAction):
|
||||
else:
|
||||
return nova.disable_service_nova_compute(self.host)
|
||||
|
||||
def precondition(self):
|
||||
def pre_condition(self):
|
||||
pass
|
||||
|
||||
def postcondition(self):
|
||||
def post_condition(self):
|
||||
pass
|
||||
|
||||
@@ -19,7 +19,7 @@ from __future__ import unicode_literals
|
||||
|
||||
from oslo_log import log
|
||||
|
||||
from watcher.applier.actions.loading import default
|
||||
from watcher.applier.loading import default
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -44,12 +44,12 @@ class Migrate(base.BaseAction):
|
||||
schema = Schema({
|
||||
'resource_id': str, # should be a UUID
|
||||
'migration_type': str, # choices -> "live", "cold"
|
||||
'dst_hypervisor': str,
|
||||
'src_hypervisor': str,
|
||||
'destination_node': str,
|
||||
'source_node': str,
|
||||
})
|
||||
|
||||
The `resource_id` is the UUID of the server to migrate.
|
||||
The `src_hypervisor` and `dst_hypervisor` parameters are respectively the
|
||||
The `source_node` and `destination_node` parameters are respectively the
|
||||
source and the destination compute hostname (list of available compute
|
||||
hosts is returned by this command: ``nova service-list --binary
|
||||
nova-compute``).
|
||||
@@ -59,28 +59,28 @@ class Migrate(base.BaseAction):
|
||||
MIGRATION_TYPE = 'migration_type'
|
||||
LIVE_MIGRATION = 'live'
|
||||
COLD_MIGRATION = 'cold'
|
||||
DST_HYPERVISOR = 'dst_hypervisor'
|
||||
SRC_HYPERVISOR = 'src_hypervisor'
|
||||
DESTINATION_NODE = 'destination_node'
|
||||
SOURCE_NODE = 'source_node'
|
||||
|
||||
def check_resource_id(self, value):
|
||||
if (value is not None and
|
||||
len(value) > 0 and not
|
||||
utils.is_uuid_like(value)):
|
||||
raise voluptuous.Invalid(_("The parameter"
|
||||
" resource_id is invalid."))
|
||||
raise voluptuous.Invalid(_("The parameter "
|
||||
"resource_id is invalid."))
|
||||
|
||||
@property
|
||||
def schema(self):
|
||||
return voluptuous.Schema({
|
||||
voluptuous.Required(self.RESOURCE_ID): self.check_resource_id,
|
||||
voluptuous.Required(self.MIGRATION_TYPE,
|
||||
default=self.LIVE_MIGRATION):
|
||||
voluptuous.Any(*[self.LIVE_MIGRATION,
|
||||
self.COLD_MIGRATION]),
|
||||
voluptuous.Required(self.DST_HYPERVISOR):
|
||||
voluptuous.Required(
|
||||
self.MIGRATION_TYPE, default=self.LIVE_MIGRATION):
|
||||
voluptuous.Any(
|
||||
*[self.LIVE_MIGRATION, self.COLD_MIGRATION]),
|
||||
voluptuous.Required(self.DESTINATION_NODE):
|
||||
voluptuous.All(voluptuous.Any(*six.string_types),
|
||||
voluptuous.Length(min=1)),
|
||||
voluptuous.Required(self.SRC_HYPERVISOR):
|
||||
voluptuous.Required(self.SOURCE_NODE):
|
||||
voluptuous.All(voluptuous.Any(*six.string_types),
|
||||
voluptuous.Length(min=1)),
|
||||
})
|
||||
@@ -94,12 +94,12 @@ class Migrate(base.BaseAction):
|
||||
return self.input_parameters.get(self.MIGRATION_TYPE)
|
||||
|
||||
@property
|
||||
def dst_hypervisor(self):
|
||||
return self.input_parameters.get(self.DST_HYPERVISOR)
|
||||
def destination_node(self):
|
||||
return self.input_parameters.get(self.DESTINATION_NODE)
|
||||
|
||||
@property
|
||||
def src_hypervisor(self):
|
||||
return self.input_parameters.get(self.SRC_HYPERVISOR)
|
||||
def source_node(self):
|
||||
return self.input_parameters.get(self.SOURCE_NODE)
|
||||
|
||||
def _live_migrate_instance(self, nova, destination):
|
||||
result = None
|
||||
@@ -116,11 +116,11 @@ class Migrate(base.BaseAction):
|
||||
dest_hostname=destination,
|
||||
block_migration=True)
|
||||
else:
|
||||
LOG.debug("Nova client exception occured while live migrating "
|
||||
"instance %s.Exception: %s" %
|
||||
LOG.debug("Nova client exception occurred while live "
|
||||
"migrating instance %s.Exception: %s" %
|
||||
(self.instance_uuid, e))
|
||||
except Exception:
|
||||
LOG.critical(_LC("Unexpected error occured. Migration failed for"
|
||||
LOG.critical(_LC("Unexpected error occurred. Migration failed for "
|
||||
"instance %s. Leaving instance on previous "
|
||||
"host."), self.instance_uuid)
|
||||
|
||||
@@ -134,7 +134,7 @@ class Migrate(base.BaseAction):
|
||||
dest_hostname=destination)
|
||||
except Exception as exc:
|
||||
LOG.exception(exc)
|
||||
LOG.critical(_LC("Unexpected error occured. Migration failed for"
|
||||
LOG.critical(_LC("Unexpected error occurred. Migration failed for "
|
||||
"instance %s. Leaving instance on previous "
|
||||
"host."), self.instance_uuid)
|
||||
|
||||
@@ -152,23 +152,23 @@ class Migrate(base.BaseAction):
|
||||
return self._cold_migrate_instance(nova, destination)
|
||||
else:
|
||||
raise exception.Invalid(
|
||||
message=(_('Migration of type %(migration_type)s is not '
|
||||
'supported.') %
|
||||
message=(_("Migration of type '%(migration_type)s' is not "
|
||||
"supported.") %
|
||||
{'migration_type': self.migration_type}))
|
||||
else:
|
||||
raise exception.InstanceNotFound(name=self.instance_uuid)
|
||||
|
||||
def execute(self):
|
||||
return self.migrate(destination=self.dst_hypervisor)
|
||||
return self.migrate(destination=self.destination_node)
|
||||
|
||||
def revert(self):
|
||||
return self.migrate(destination=self.src_hypervisor)
|
||||
return self.migrate(destination=self.source_node)
|
||||
|
||||
def precondition(self):
|
||||
# todo(jed) check if the instance exist/ check if the instance is on
|
||||
# the src_hypervisor
|
||||
def pre_condition(self):
|
||||
# TODO(jed): check if the instance exists / check if the instance is on
|
||||
# the source_node
|
||||
pass
|
||||
|
||||
def postcondition(self):
|
||||
# todo(jed) we can image to check extra parameters (nework reponse,ect)
|
||||
def post_condition(self):
|
||||
# TODO(jed): check extra parameters (network response, etc.)
|
||||
pass
|
||||
|
||||
@@ -53,15 +53,15 @@ class Nop(base.BaseAction):
|
||||
return self.input_parameters.get(self.MESSAGE)
|
||||
|
||||
def execute(self):
|
||||
LOG.debug("executing action NOP message:%s ", self.message)
|
||||
LOG.debug("Executing action NOP message: %s ", self.message)
|
||||
return True
|
||||
|
||||
def revert(self):
|
||||
LOG.debug("revert action NOP")
|
||||
LOG.debug("Revert action NOP")
|
||||
return True
|
||||
|
||||
def precondition(self):
|
||||
def pre_condition(self):
|
||||
pass
|
||||
|
||||
def postcondition(self):
|
||||
def post_condition(self):
|
||||
pass
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
import time
|
||||
|
||||
import time
|
||||
|
||||
from oslo_log import log
|
||||
import voluptuous
|
||||
@@ -53,16 +53,16 @@ class Sleep(base.BaseAction):
|
||||
return int(self.input_parameters.get(self.DURATION))
|
||||
|
||||
def execute(self):
|
||||
LOG.debug("Starting action Sleep duration:%s ", self.duration)
|
||||
LOG.debug("Starting action sleep with duration: %s ", self.duration)
|
||||
time.sleep(self.duration)
|
||||
return True
|
||||
|
||||
def revert(self):
|
||||
LOG.debug("revert action Sleep")
|
||||
LOG.debug("Revert action sleep")
|
||||
return True
|
||||
|
||||
def precondition(self):
|
||||
def pre_condition(self):
|
||||
pass
|
||||
|
||||
def postcondition(self):
|
||||
def post_condition(self):
|
||||
pass
|
||||
|
||||
@@ -20,7 +20,7 @@ from oslo_config import cfg
|
||||
from oslo_log import log
|
||||
|
||||
from watcher.applier import base
|
||||
from watcher.applier.workflow_engine.loading import default
|
||||
from watcher.applier.loading import default
|
||||
from watcher import objects
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
@@ -56,9 +56,7 @@ class DefaultApplier(base.BaseApplier):
|
||||
|
||||
def execute(self, action_plan_uuid):
|
||||
LOG.debug("Executing action plan %s ", action_plan_uuid)
|
||||
action_plan = objects.ActionPlan.get_by_uuid(self.context,
|
||||
action_plan_uuid)
|
||||
# todo(jed) remove direct access to dbapi need filter in object
|
||||
filters = {'action_plan_id': action_plan.id}
|
||||
actions = objects.Action.dbapi.get_action_list(self.context, filters)
|
||||
filters = {'action_plan_uuid': action_plan_uuid}
|
||||
actions = objects.Action.list(self.context,
|
||||
filters=filters)
|
||||
return self.engine.execute(actions)
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
# Copyright (c) 2015 b<>com
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
@@ -13,10 +10,10 @@
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
|
||||
from watcher.common.loader import default
|
||||
|
||||
|
||||
@@ -24,3 +21,9 @@ class DefaultWorkFlowEngineLoader(default.DefaultLoader):
|
||||
def __init__(self):
|
||||
super(DefaultWorkFlowEngineLoader, self).__init__(
|
||||
namespace='watcher_workflow_engines')
|
||||
|
||||
|
||||
class DefaultActionLoader(default.DefaultLoader):
|
||||
def __init__(self):
|
||||
super(DefaultActionLoader, self).__init__(
|
||||
namespace='watcher_actions')
|
||||
@@ -18,11 +18,9 @@
|
||||
#
|
||||
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log
|
||||
|
||||
from watcher.applier.messaging import trigger
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
CONF = cfg.CONF
|
||||
|
||||
|
||||
@@ -68,6 +66,8 @@ class ApplierManager(object):
|
||||
|
||||
conductor_endpoints = [trigger.TriggerActionPlan]
|
||||
status_endpoints = []
|
||||
notification_endpoints = []
|
||||
notification_topics = []
|
||||
|
||||
def __init__(self):
|
||||
self.publisher_id = CONF.watcher_applier.publisher_id
|
||||
|
||||
@@ -17,16 +17,13 @@
|
||||
# limitations under the License.
|
||||
#
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log
|
||||
|
||||
from watcher.applier import manager
|
||||
from watcher.common import exception
|
||||
from watcher.common.messaging import notification_handler as notification
|
||||
from watcher.common import service
|
||||
from watcher.common import utils
|
||||
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
CONF = cfg.CONF
|
||||
CONF.register_group(manager.opt_group)
|
||||
CONF.register_opts(manager.APPLIER_MANAGER_OPTS, manager.opt_group)
|
||||
@@ -51,7 +48,9 @@ class ApplierAPIManager(object):
|
||||
API_VERSION = '1.0'
|
||||
|
||||
conductor_endpoints = []
|
||||
status_endpoints = [notification.NotificationHandler]
|
||||
status_endpoints = []
|
||||
notification_endpoints = []
|
||||
notification_topics = []
|
||||
|
||||
def __init__(self):
|
||||
self.publisher_id = CONF.watcher_applier.publisher_id
|
||||
|
||||
@@ -82,8 +82,7 @@ class BaseWorkFlowEngine(loadable.Loadable):
|
||||
ev.data = {}
|
||||
payload = {'action_uuid': action.uuid,
|
||||
'action_state': state}
|
||||
self.applier_manager.status_topic_handler.publish_event(
|
||||
ev.type.name, payload)
|
||||
self.applier_manager.publish_status_event(ev.type.name, payload)
|
||||
|
||||
@abc.abstractmethod
|
||||
def execute(self, actions):
|
||||
|
||||
@@ -109,8 +109,8 @@ class TaskFlowActionContainer(task.Task):
|
||||
try:
|
||||
self.engine.notify(self._db_action,
|
||||
obj_action.State.ONGOING)
|
||||
LOG.debug("Precondition action %s", self.name)
|
||||
self.action.precondition()
|
||||
LOG.debug("Pre-condition action: %s", self.name)
|
||||
self.action.pre_condition()
|
||||
except Exception as e:
|
||||
LOG.exception(e)
|
||||
self.engine.notify(self._db_action,
|
||||
@@ -119,15 +119,15 @@ class TaskFlowActionContainer(task.Task):
|
||||
|
||||
def execute(self, *args, **kwargs):
|
||||
try:
|
||||
LOG.debug("Running action %s", self.name)
|
||||
LOG.debug("Running action: %s", self.name)
|
||||
|
||||
self.action.execute()
|
||||
self.engine.notify(self._db_action,
|
||||
obj_action.State.SUCCEEDED)
|
||||
except Exception as e:
|
||||
LOG.exception(e)
|
||||
LOG.error(_LE('The WorkFlow Engine has failed '
|
||||
'to execute the action %s'), self.name)
|
||||
LOG.error(_LE('The workflow engine has failed '
|
||||
'to execute the action: %s'), self.name)
|
||||
|
||||
self.engine.notify(self._db_action,
|
||||
obj_action.State.FAILED)
|
||||
@@ -135,8 +135,8 @@ class TaskFlowActionContainer(task.Task):
|
||||
|
||||
def post_execute(self):
|
||||
try:
|
||||
LOG.debug("postcondition action %s", self.name)
|
||||
self.action.postcondition()
|
||||
LOG.debug("Post-condition action: %s", self.name)
|
||||
self.action.post_condition()
|
||||
except Exception as e:
|
||||
LOG.exception(e)
|
||||
self.engine.notify(self._db_action,
|
||||
@@ -144,19 +144,19 @@ class TaskFlowActionContainer(task.Task):
|
||||
raise
|
||||
|
||||
def revert(self, *args, **kwargs):
|
||||
LOG.warning(_LW("Revert action %s"), self.name)
|
||||
LOG.warning(_LW("Revert action: %s"), self.name)
|
||||
try:
|
||||
# todo(jed) do we need to update the states in case of failure ?
|
||||
# TODO(jed): do we need to update the states in case of failure?
|
||||
self.action.revert()
|
||||
except Exception as e:
|
||||
LOG.exception(e)
|
||||
LOG.critical(_LC("Oops! We need disaster recover plan"))
|
||||
LOG.critical(_LC("Oops! We need a disaster recover plan."))
|
||||
|
||||
|
||||
class TaskFlowNop(task.Task):
|
||||
"""This class is use in case of the workflow have only one Action.
|
||||
"""This class is used in case of the workflow have only one Action.
|
||||
|
||||
We need at least two atoms to create a link
|
||||
We need at least two atoms to create a link.
|
||||
"""
|
||||
def execute(self):
|
||||
pass
|
||||
|
||||
@@ -38,14 +38,13 @@ def main():
|
||||
server = service.WSGIService(
|
||||
'watcher-api', CONF.api.enable_ssl_api)
|
||||
|
||||
if host == '0.0.0.0':
|
||||
LOG.info(_LI('serving on 0.0.0.0:%(port)s, '
|
||||
if host == '127.0.0.1':
|
||||
LOG.info(_LI('serving on 127.0.0.1:%(port)s, '
|
||||
'view at %(protocol)s://127.0.0.1:%(port)s') %
|
||||
dict(protocol=protocol, port=port))
|
||||
else:
|
||||
LOG.info(_LI('serving on %(protocol)s://%(host)s:%(port)s') %
|
||||
dict(protocol=protocol, host=host, port=port))
|
||||
|
||||
launcher = service.process_launcher()
|
||||
launcher.launch_service(server, workers=server.workers)
|
||||
launcher = service.launch(CONF, server, workers=server.workers)
|
||||
launcher.wait()
|
||||
|
||||
@@ -22,7 +22,6 @@ import sys
|
||||
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
from oslo_service import service
|
||||
|
||||
from watcher._i18n import _LI
|
||||
from watcher.applier import manager
|
||||
@@ -38,5 +37,7 @@ def main():
|
||||
LOG.info(_LI('Starting Watcher Applier service in PID %s'), os.getpid())
|
||||
|
||||
applier_service = watcher_service.Service(manager.ApplierManager)
|
||||
launcher = service.launch(CONF, applier_service)
|
||||
|
||||
# Only 1 process
|
||||
launcher = watcher_service.launch(CONF, applier_service)
|
||||
launcher.wait()
|
||||
|
||||
@@ -59,7 +59,7 @@ class DBCommand(object):
|
||||
@staticmethod
|
||||
def purge():
|
||||
purge.purge(CONF.command.age_in_days, CONF.command.max_number,
|
||||
CONF.command.audit_template, CONF.command.exclude_orphans,
|
||||
CONF.command.goal, CONF.command.exclude_orphans,
|
||||
CONF.command.dry_run)
|
||||
|
||||
|
||||
@@ -115,8 +115,8 @@ def add_command_parsers(subparsers):
|
||||
"Prevents the deletion if exceeded. No limit if "
|
||||
"set to None.",
|
||||
type=int, default=None, nargs='?')
|
||||
parser.add_argument('-t', '--audit-template',
|
||||
help="UUID or name of the audit template to purge.",
|
||||
parser.add_argument('-t', '--goal',
|
||||
help="UUID or name of the goal to purge.",
|
||||
type=str, default=None, nargs='?')
|
||||
parser.add_argument('-e', '--exclude-orphans', action='store_true',
|
||||
help="Flag to indicate whether or not you want to "
|
||||
|
||||
@@ -22,11 +22,12 @@ import sys
|
||||
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
from oslo_service import service
|
||||
|
||||
from watcher._i18n import _LI
|
||||
from watcher.common import service as watcher_service
|
||||
from watcher.decision_engine import gmr
|
||||
from watcher.decision_engine import manager
|
||||
from watcher.decision_engine import scheduling
|
||||
from watcher.decision_engine import sync
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
@@ -35,6 +36,7 @@ CONF = cfg.CONF
|
||||
|
||||
def main():
|
||||
watcher_service.prepare_service(sys.argv)
|
||||
gmr.register_gmr_plugins()
|
||||
|
||||
LOG.info(_LI('Starting Watcher Decision Engine service in PID %s'),
|
||||
os.getpid())
|
||||
@@ -43,5 +45,10 @@ def main():
|
||||
syncer.sync()
|
||||
|
||||
de_service = watcher_service.Service(manager.DecisionEngineManager)
|
||||
launcher = service.launch(CONF, de_service)
|
||||
bg_schedulder_service = scheduling.DecisionEngineSchedulingService()
|
||||
|
||||
# Only 1 process
|
||||
launcher = watcher_service.launch(CONF, de_service)
|
||||
launcher.launch_service(bg_schedulder_service)
|
||||
|
||||
launcher.wait()
|
||||
|
||||
39
watcher/cmd/sync.py
Normal file
@@ -0,0 +1,39 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
#
|
||||
# Copyright (c) 2016 Intel
|
||||
#
|
||||
# Authors: Tomasz Kaczynski <tomasz.kaczynski@intel.com>
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
"""Script for the sync tool."""
|
||||
|
||||
import sys
|
||||
|
||||
from oslo_log import log as logging
|
||||
|
||||
from watcher._i18n import _LI
|
||||
from watcher.common import service as service
|
||||
from watcher.decision_engine import sync
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def main():
|
||||
LOG.info(_LI('Watcher sync started.'))
|
||||
|
||||
service.prepare_service(sys.argv)
|
||||
syncer = sync.Syncer()
|
||||
syncer.sync()
|
||||
|
||||
LOG.info(_LI('Watcher sync finished.'))
|
||||
@@ -15,11 +15,15 @@
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
from ceilometerclient.exc import HTTPUnauthorized
|
||||
import datetime
|
||||
|
||||
from ceilometerclient import exc
|
||||
from oslo_utils import timeutils
|
||||
|
||||
from watcher._i18n import _
|
||||
from watcher.common import clients
|
||||
from watcher.common import exception
|
||||
|
||||
|
||||
class CeilometerHelper(object):
|
||||
@@ -29,18 +33,20 @@ class CeilometerHelper(object):
|
||||
self.ceilometer = self.osc.ceilometer()
|
||||
|
||||
def build_query(self, user_id=None, tenant_id=None, resource_id=None,
|
||||
user_ids=None, tenant_ids=None, resource_ids=None):
|
||||
user_ids=None, tenant_ids=None, resource_ids=None,
|
||||
start_time=None, end_time=None):
|
||||
"""Returns query built from given parameters.
|
||||
|
||||
This query can be then used for querying resources, meters and
|
||||
statistics.
|
||||
:Parameters:
|
||||
- `user_id`: user_id, has a priority over list of ids
|
||||
- `tenant_id`: tenant_id, has a priority over list of ids
|
||||
- `resource_id`: resource_id, has a priority over list of ids
|
||||
- `user_ids`: list of user_ids
|
||||
- `tenant_ids`: list of tenant_ids
|
||||
- `resource_ids`: list of resource_ids
|
||||
:param user_id: user_id, has a priority over list of ids
|
||||
:param tenant_id: tenant_id, has a priority over list of ids
|
||||
:param resource_id: resource_id, has a priority over list of ids
|
||||
:param user_ids: list of user_ids
|
||||
:param tenant_ids: list of tenant_ids
|
||||
:param resource_ids: list of resource_ids
|
||||
:param start_time: datetime from which measurements should be collected
|
||||
:param end_time: datetime until which measurements should be collected
|
||||
"""
|
||||
|
||||
user_ids = user_ids or []
|
||||
@@ -63,12 +69,38 @@ class CeilometerHelper(object):
|
||||
for r_id in resource_ids:
|
||||
query.append({"field": "resource_id", "op": "eq", "value": r_id})
|
||||
|
||||
start_timestamp = None
|
||||
end_timestamp = None
|
||||
|
||||
if start_time:
|
||||
start_timestamp = start_time
|
||||
if isinstance(start_time, datetime.datetime):
|
||||
start_timestamp = start_time.isoformat()
|
||||
|
||||
if end_time:
|
||||
end_timestamp = end_time
|
||||
if isinstance(end_time, datetime.datetime):
|
||||
end_timestamp = end_time.isoformat()
|
||||
|
||||
if (start_timestamp and end_timestamp and
|
||||
timeutils.parse_isotime(start_timestamp) >
|
||||
timeutils.parse_isotime(end_timestamp)):
|
||||
raise exception.Invalid(
|
||||
_("Invalid query: %(start_time)s > %(end_time)s") % dict(
|
||||
start_time=start_timestamp, end_time=end_timestamp))
|
||||
|
||||
if start_timestamp:
|
||||
query.append({"field": "timestamp", "op": "ge",
|
||||
"value": start_timestamp})
|
||||
if end_timestamp:
|
||||
query.append({"field": "timestamp", "op": "le",
|
||||
"value": end_timestamp})
|
||||
return query
|
||||
|
||||
def query_retry(self, f, *args, **kargs):
|
||||
try:
|
||||
return f(*args, **kargs)
|
||||
except HTTPUnauthorized:
|
||||
except exc.HTTPUnauthorized:
|
||||
self.osc.reset_clients()
|
||||
self.ceilometer = self.osc.ceilometer()
|
||||
return f(*args, **kargs)
|
||||
@@ -112,7 +144,10 @@ class CeilometerHelper(object):
|
||||
:return:
|
||||
"""
|
||||
|
||||
query = self.build_query(resource_id=resource_id)
|
||||
start_time = (datetime.datetime.utcnow() -
|
||||
datetime.timedelta(seconds=int(period)))
|
||||
query = self.build_query(
|
||||
resource_id=resource_id, start_time=start_time)
|
||||
statistic = self.query_retry(f=self.ceilometer.statistics.list,
|
||||
meter_name=meter_name,
|
||||
q=query,
|
||||
|
||||