Implementing a baymodel attributes validation restful api
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-
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
- Started by
- Completed by
- Adrian Otto
Related branches
Related bugs
Bug #1412181: Validate inputs when creating a baymodel | Fix Released |
Bug #1476500: "keypair_id" should be existent when creating a baymodel | Fix Released |
Sprints
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:/
Addressed by: https:/
Validate baymodel's flavor when create a bay