Implementing a baymodel attributes validation restful api

Registered by vikas choudhary

This blueprint has been superseded. See the newer blueprint "Enhance API parameters validation when create Bay" for updated plans.

A new api should be written to validate existence of all the attributes of a baymodel including externel-network, image, keypair, dns-server. This api will be making rest calls to corresponding projects for resource existence validation. This api will be called both at baymodel creation time and bay creation time. Api can be implemented both, internal to magnum only or as a public lib(available for any project).Public lib is preferred approach considering reusability.

Baymodel is a resource which once created will be used to create bays for a longer time period. In the meantime , chances are there that users might delete few attributes and thus invalidating baymodel at bay creation time. Calling of mentioned baymodel-all-attributes-validation api will help picking up any missing resource at magnum side itself rather than failures in heat orchestration.

Blueprint information

Status:
Complete
Approver:
Adrian Otto
Priority:
Medium
Drafter:
vikas choudhary
Direction:
Approved
Assignee:
HouMing Wang
Definition:
Superseded
Series goal:
Accepted for mitaka
Implementation:
Unknown
Milestone target:
None
Completed by
Adrian Otto

Whiteboard

It is worthy to do validation before send request to heat, we don't want create a Failed stack and leave it there then let user to delete it manually. What I am thinking about is we validate all resources
include(nova key-pair, glance image, neutron network-id etc...) before generate request to Heat.

Both baymodel and bay are all need to be validate, so a public lib(which could be named as validation) should be work out to provide interface can be called from m-api/m-cond to do validation for various kinds of resources. --Eli

@Eli
Exactly Eli. This is what i have mentioned in summary. I did not mention "validation api" implementation should be magnum part or it should be implemented as an seperate public lib. Doing at independent public lib seems a good idea.A dict of resource-value pairs can be passed to this validation api. In future other projects can also use this.Lets discuss it here and others also share views.
Thanks
-Vikas

Gerrit topic: https://review.openstack.org/#q,topic:bp/baymodel-all-attributes-validation,n,z

Addressed by: https://review.openstack.org/246609
    Validate baymodel's flavor when create a bay

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.