Bug 1042959

Summary: [RFE][oslo]: Add API input validation utility for openstack common
Product: Red Hat OpenStack Reporter: RHOS Integration <rhos-integ>
Component: RFEsAssignee: RHOS Maint <rhos-maint>
Status: CLOSED UPSTREAM QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: markmc, yeylon
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
URL: https://blueprints.launchpad.net/oslo/+spec/api-validation-utility
Whiteboard: upstream_milestone_none upstream_status_started upstream_definition_new
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-19 17:18:18 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description RHOS Integration 2013-12-13 16:47:46 UTC
Cloned from launchpad blueprint https://blueprints.launchpad.net/oslo/+spec/api-validation-utility.

Description:

This is a feature request to enable openstack-common code in oslo to perform common input validations 
across Openstack API.

Most of the validation of create resource API are scattered and duplicated, across Nova, Keystone, Cinder, Glance. Due to this, there is a lot of inconsistency in how the APIs respond to similar classes of input.

Refer: https://docs.google.com/file/d/0BwufSlaYow2GUUZJVlJYVGM2VVU/edit?usp=sharing

A utility in Oslo will enable common validation tasks such as:
* checking input length (based on min and max values)
* checking input well-formedness (say, based on an expected regex), 
* raise appropriate exceptions wherever needed

This could go into a separate module like openstack/common/validation_utils.py

Also refer the discussion on Bug https://bugs.launchpad.net/nova/+bug/1206396

Specification URL (additional information):

None