Modification of statistic_aggregation method
In this patch feching resource_id by resource's original_id was added to statistic_aggregation method. Closes-Bug: #1707653 Change-Id: I70b9346146f810e2236ccdb31de4c3fedf200568
This commit is contained in:
committed by
Alexander Chadin
parent
728acc091b
commit
4f38595e4e
@@ -24,6 +24,7 @@ from oslo_log import log
|
|||||||
|
|
||||||
from watcher.common import clients
|
from watcher.common import clients
|
||||||
from watcher.common import exception
|
from watcher.common import exception
|
||||||
|
from watcher.common import utils as common_utils
|
||||||
|
|
||||||
CONF = cfg.CONF
|
CONF = cfg.CONF
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
@@ -72,6 +73,17 @@ class GnocchiHelper(object):
|
|||||||
raise exception.InvalidParameter(parameter='stop_time',
|
raise exception.InvalidParameter(parameter='stop_time',
|
||||||
parameter_type=datetime)
|
parameter_type=datetime)
|
||||||
|
|
||||||
|
if not common_utils.is_uuid_like(resource_id):
|
||||||
|
kwargs = dict(query={"=": {"original_resource_id": resource_id}},
|
||||||
|
limit=1)
|
||||||
|
resources = self.query_retry(
|
||||||
|
f=self.gnocchi.resource.search, **kwargs)
|
||||||
|
|
||||||
|
if not resources:
|
||||||
|
raise exception.ResourceNotFound(name=resource_id)
|
||||||
|
|
||||||
|
resource_id = resources[0]['id']
|
||||||
|
|
||||||
raw_kwargs = dict(
|
raw_kwargs = dict(
|
||||||
metric=metric,
|
metric=metric,
|
||||||
start=start_time,
|
start=start_time,
|
||||||
|
|||||||
Reference in New Issue
Block a user