Due to importing modules rather than functions and decorators directly,
@abc.abstract and 'raise NotImplementedError' were added to the
.coveragerc file. Since abstract methods are not testable, this will
give us a more accurate representation of our coverage.
Change-Id: Id5ed5e1f5e142d10f41ad18d20228399226ec20d
Co-Authored-By: Jin Li <jl7351@att.com>
Closes-Bug: #1563717
We need to update sqlalchemy/api and sqlalchemy/models (and appropriate tests)
to support deleting audit templates and recreating them with the same names.
Change-Id: Icf54cf1ed989a3f2ad689e25be4474b16a3a3eb2
Related-Bug: #1510179
In some modules the global LOG is not used any more. And the import
of logging is not used. This patch removes the unused logging import
and LOG vars.
Change-Id: I794ee719d76f04e70154cf67f726152fbb1ba15a
Unicode type resource state is now handled in the same fashion as resource state specified by general string.
Change-Id: I35ffa09015283b51c935515436735aecbe83a9d6
Closes-Bug: #1565764
I removed the POST, PATCH and DELETE verbs from the actions
controller as they should only be modified internally.
Change-Id: Ia72484249240f829423056f66c5c0f9632d02106
Closes-Bug: #1533281
Added extra information regarding the plugin mechanism for:
action, strategy, and Watcher planner.
Change-Id: I9a7523282e229b83c16b06e3806ff795a0699c78
Closes-Bug: #1558470
The list of possible states for Action Plan objects was outdated, and
was updated to match the state machine diagram. A reference to the
state machines for Audits and Action Plans were added to the glossary,
and the descriptions of each state were moved to the sections containing
the state machines within the Architecture page.
Change-Id: I27043ad864c02fff50fb31868b27dc4b4897dbd4
Closes-Bug: #1558464
This patch adds a new load consolidation strategy based on a heuristic
algorithm which focuses on measured CPU utilization and tries to
minimize hosts which have too much or too little load.
A new goal "vm_workload_consolidation" was added which executes
the strategy "VM_WORKLOAD_CONSOLIDATION".
This work depends on the implemetation of the bug:
https://bugs.launchpad.net/watcher/+bug/1553124
Change-Id: Ide05bddb5c85a3df05b94658ee5bd98f32e554b0
Implements: blueprint basic-cloud-consolidation-integration
Watcher sample configuration file groups parameters from
various projects and the watcher project ones. This makes it
tricky to review updates on configuration parameters.
It is inconvenient for developer if the add/remove/change some
configuration options cause they need to take care about the
config.sample file.
The sample configuration file should be available into HTML doc.
This patchset:
. removes the file /etc/watcher/watcher.conf.sample
. adds an admin script tool to be able to built it, by using tox
. includes a new section 'Watcher sample configuration files' into
the doc source files
. uses sphinx extension oslo_config.sphinxgenconfig
Change-Id: If2180de3614663f9cbc5396961a8d2175e28e315
Closes-Bug: #1541734
In this patchset, I added a small subsection which highlights the fact
that actions are using Voluptuous Schemas to validate their input
parameters.
Change-Id: I96a6060cf167468e4a3f7c8d8cd78330a20572e3
Closes-Bug: #1545643
The variable vm_avg_cpu_util was renamed to host_avg_cpu_util for
clarity, as it was really referring to the host average cpu util.
Change-Id: I7aaef9eb2c8421d01715c86afa36ab67f2fd5f30
Closes-Bug: #1559113
In watcher/applier/workflow_engine/default.py, we are checking the
return value of action.execute(). As the "TODO" above indicates it
(line 118), we should get rid of this and only flag an action as
failed if an exception was raised during its execute(). We will
need to update the related unit tests.
Change-Id: Ia8ff7abd9994c3504e733ccd1d629cafe9d4b839
Closes-Bug: #1548383
This patchset add a new entry for the purge into the Watcher
documentation.
Change-Id: Ifb74b379bccd59ff736bf186bdaaf74de77098f1
Implements: blueprint db-purge-engine
This patchset implements the purge script as specified in its
related blueprint:
- The '--age-in-days' option allows to specify the number of
days before expiry
- The '--max-number' option allows us to specify a limit on the number
of objects to delete
- The '--audit-template' option allows you to only delete objects
related to the specified audit template UUID or name
- The '--dry-run' option to go through the purge procedure without
actually deleting anything
- The '--exclude-orphans' option which allows you to exclude from the
purge any object that does not have a parent (i.e. and audit without
a related audit template)
A prompt has been added to also propose to narrow down the number of
deletions to be below the specified limit.
Change-Id: I3ce83ab95277c109df67a6b5b920a878f6e59d3f
Implements: blueprint db-purge-engine
As a pre-requisite for being able to query the database for objects
that are expired, I need a way to express date comparison on the
'deleted_at' field which is common for every Watcher object. As they
are coming from mixins, I decided to implement these filters with a
syntax borrowed from the Django ORM where the field is suffixed by the
comparison operator you want to apply:
- The '__lt' suffix stands for 'less than'
- The '__lte' suffix stands for 'less than or equal to'
- The '__gt' suffix stands for 'greater than'
- The '__gte' suffix stands for 'greater than or equal to'
- The '__eq' suffix stands for 'equal to'
I also added a 'uuid' filter to later on be able to filter by uuid.
Partially Implements: blueprint db-purge-engine
Change-Id: I763f330c1b8ea8395990d2276b71e87f5b3f3ddc
When creating a new audit template, the verification of its goal
existence was previously done in watcher/objects/audit_template.py.
This check was moved to api/controllers/v1/audit_template.py, rather
than in the DAO class.
Change-Id: I6efb0657f64c46a56914a946ec78013b9e47331b
Closes-Bug: #1536191
In watcher/metrics_engine/cluster_history/api.py,
we can find the BaseClusterHistory abstract base class.
To follow the same naming convention observed throughout the rest
of the project, I renamed watcher/metrics_engine/cluster_history/api.py
to watcher/metrics_engine/cluster_history/base.py
Change-Id: If18f8db7f0982e47c1998a469c54952670c262f5
Closes-Bug: #1548398
There are translations that are missing from watcher.pot.
This patchset includes them.
Change-Id: Ia418066b5653b4c81885d3eb150613ba357f9b7b
Related-Bug: #1510189
Fetched information of total disk capacity from nova and added a new
resource 'disk_capacity' to NovaClusterModelCollector cluster. Also a
new resource type 'disk_capacity' was added to ResourceType.
https://bugs.launchpad.net/watcher/+bug/1553124
Change-Id: I85750f25c6d2693432da8e5e3a3d0861320f4787
Closes-Bug: #1553124
This documentation is a pre-requisite to all plugin documentation
as it guides you through the creation of a project from scratch
instead of simply forcusing on the implementation of the plugin
itself.
Change-Id: Id2e09b3667390ee6c4be42454c41f9d266fdfac2
Related-Bug: #1534639
Related-Bug: #1533739
Related-Bug: #1533740
In coverage target in tox.ini, there is the following argument:
--omit="watcher/tests/*"
However, in .coveragerc, the tests are also omitted,
according to line 4 in .coveragerc:
omit = watcher/tests/*
So the watcher/tests/* directory is omitted twice. As it can be
seen in other modules (e.g.: swift, nova) omitting only in
.coveragerc should be enough.
Change-Id: I72951196a346fb73a90c998138fc91dd171432cd
Closes-Bug: #1552617