Re: [openstack-dev] [Neutron] REST API - entity level validation

2014-06-16 Thread Avishay Balderman
Salvatore
Will Neutron is going to follow Nova?
https://blueprints.launchpad.net/nova/+spec/nova-api-validation-fw

Avishay

From: Salvatore Orlando [mailto:sorla...@nicira.com]
Sent: Monday, June 16, 2014 12:36 AM
To: OpenStack Development Mailing List (not for usage questions)
Subject: Re: [openstack-dev] [Neutron] REST API - entity level validation

Avishay,

what you say here is correct.
However, as we are in the process of moving to Pecan as REST API framework I 
would probably refrain from adding new features to it at this stage.

Therefore, even if far from ideal, this kind of validation should perhaps be 
performed in the DB layer. I think this already happens for several API 
resources.

Salvatore

On 5 June 2014 13:01, Avishay Balderman 
mailto:avish...@radware.com>> wrote:
Hi
With the current REST API engine in neutron we can declare attributes 
validations.
We have a rich set of validation functions 
https://github.com/openstack/neutron/blob/master/neutron/api/v2/attributes.py
However we do not have the concept of entity level validation.

Example:
I have an API ‘create-something’ and Something is an entity having 2 attributes:
Something {
  Attribute A
 Attribute B
}
And according to the business logic A must be greater than B


As for today our framework cannot handle  this kind of validation and the call 
is going inside a lower layer of neutron and must be validated there.
Example: https://review.openstack.org/#/c/93871/9

With this we have the validations implemented across multi layers. I think we 
better have the validations in one layer.

Thanks

Avishay

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org<mailto:OpenStack-dev@lists.openstack.org>
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Neutron] REST API - entity level validation

2014-06-15 Thread Salvatore Orlando
Avishay,

what you say here is correct.
However, as we are in the process of moving to Pecan as REST API framework
I would probably refrain from adding new features to it at this stage.

Therefore, even if far from ideal, this kind of validation should perhaps
be performed in the DB layer. I think this already happens for several API
resources.

Salvatore


On 5 June 2014 13:01, Avishay Balderman  wrote:

>   Hi
>
> With the current REST API engine in neutron we can declare attributes
> validations.
>
> We have a rich set of validation functions
> https://github.com/openstack/neutron/blob/master/neutron/api/v2/attributes.py
>
> However we do not have the concept of entity level validation.
>
>
>
> Example:
>
> I have an API ‘create-something’ and Something is an entity having 2
> attributes:
>
> Something {
>
>   Attribute A
>
>  Attribute B
>
> }
>
> And according to the business logic A must be greater than B
>
>
>
>
>
> As for today our framework cannot handle  this kind of validation and the
> call is going inside a lower layer of neutron and must be validated there.
>
> Example: https://review.openstack.org/#/c/93871/9
>
>
>
> With this we have the validations implemented across multi layers. I think
> we better have the validations in one layer.
>
>
>
> Thanks
>
>
>
> Avishay
>
> ___
> OpenStack-dev mailing list
> OpenStack-dev@lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
>
___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev