def validate(self, task, method, http_method, **kwargs):
"""Validates the vendor method's parameters.
This method validates whether the supplied data contains the required
information for the driver.
:param task: a TaskManager instance.
:param method: name of vendor method.
:param http_method: HTTP method.
:param kwargs: data passed to vendor's method.
:raises: InvalidParameterValue if supplied data is not valid.
:raises: MissingParameterValue if parameters missing in supplied data.
"""
try:
if 'statistics' in method:
self._validate_statistics_methods(method, **kwargs)
else:
self._validate_policy_methods(method, **kwargs)
except json_schema_exc.ValidationError as e:
raise exception.InvalidParameterValue(_('Input data validation '
'error: %s') % e)
评论列表
文章目录