Enhance neutron constraints

Since we have many type of properties, some of them have custom constraints,
e.g. nova.flavor, glance.image etc. But still some of them have some certain
format as input, e.g. IP address, MAC address, port, protocol etc. It's better
to validate these inputs before stack create/update, so that users can get
an early error message.

Change-Id: I951aa216d073d86276113272a398faca9fbfbfd1
Implemented: blueprint enhance-property-constraints
This commit is contained in:
Ethan Lynn 2015-04-15 13:44:45 +08:00
parent e61ae65889
commit dab12471da
1 changed files with 91 additions and 0 deletions

View File

@ -0,0 +1,91 @@
..
This work is licensed under a Creative Commons Attribution 3.0 Unported
License.
http://creativecommons.org/licenses/by/3.0/legalcode
===================================
Enhance constraints for properties
===================================
https://blueprints.launchpad.net/heat/+spec/enhance-property-constraints
We need more constraints for neutron properties so that we can validate them
before stack creation.
Problem description
===================
Since we have many type of properties, some of them have custom constraints,
e.g. nova.flavor, glance.image etc. But still some of them have some certain
format as input, e.g. IP address, MAC address, network cidr, protocol etc.
It's better to check input format before passing them to CLI or stack
creation. It's helpful for users, so that they can get error message during
validation instead of stack create/update failed.
Proposed change
===============
Add custom constraints for IP address, mac address, network cidr.
For IP address constraint, it's going to be like this:
::
constraints=[
constraints.CustomConstraint('ip_addr')
]
For mac address constraint, it's going to be like this:
::
constraints=[
constraints.CustomConstraint('mac_addr')
]
For CIDR constraint, it's going to be like this:
::
constraints=[
constraints.CustomConstraint('net_cidr')
]
We can apply these constraints to neutron properties or
template parameters.
Alternatives
------------
None
Implementation
==============
Assignee(s)
-----------
Primary assignee:
Ethan Lynn
Milestones
----------
Target Milestone for completion:
liberty-2
Work Items
----------
1. Add IPv4/IPv6 address format constraint
2. Add mac address format constraint
2. Add network cidr format constraint
Dependencies
============
None