[openstack-dev] [Quantum][LBaaS] Specify optional Attribute in RESOURCE_ATTRIBUTE_MAP

Oleg Bondarev obondarev at mirantis.com
Thu May 30 08:02:52 UTC 2013


Hi Pattabi,

 

You can use ATTR_NOT_SPECIFIED constant for such cases:

 

'delay': {'allow_post': True, 'allow_put': True,

                 'default': ATTR_NOT_SPECIFIED,

                  'validate': {'type:range': [1, 120]},

                  'convert_to': attr.convert_to_int,

                  'is_visible': True}

 

Thanks,

Oleg

 

From: Pattabi Ayyasami [mailto:pattabi at Brocade.com] 
Sent: Wednesday, May 29, 2013 9:52 PM
To: 'openstack-dev at lists.openstack.org' (openstack-dev at lists.openstack.org)
Subject: [openstack-dev] [Quantum][LBaaS] Specify optional Attribute in
RESOURCE_ATTRIBUTE_MAP

 

Hi,

 

How do I specify an attribute as optional without having to specify a
default value?  

For example, how do I specify "delay" attribute is optional in the request
without having to specify a default value of "5"? 

Is this because I also have a "validate" constraint?

 

Snippet from loadbalancer.py in quantum/extensions.

 

'delay': {'allow_post': True, 'allow_put': True,

                  'default': '5',

                  'validate': {'type:range': [1, 120]},

                  'convert_to': attr.convert_to_int,

                  'is_visible': True}

 

Regards,

Pattabi

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20130530/864538e3/attachment.html>


More information about the OpenStack-dev mailing list