Rearrange Nova Response Schemas
Compute response schemas were implemented for v2 and v3 APIs. At that time common parts were defined in common schemas and version specific into respective directories (v2 & v3).
Now v3 API is not valid for Nova and v2 and v2.1 API`s response are same. After removing v3 schemas (https://review.openstack.org/#/c/141274/) we have only 1 set of schemas for v2 (/v2.1) APIs but those end up in scattered structure.
It is difficult to read and understand API’ complete schema as they are defined in multiple files.
Rearrange current schemas into better file/directory structure and if needed then, defined schemas name more clearly as per API methods.
As Nova v2.1 APIs are current API (https://review.openstack.org/#/c/149948/), we should move all current schema files to directory name v2.1. As nova is going to release microversion also, schema files for microversion needs to go in their respective new directories.
Below are the re arrangement details-
api_schema/response/compute/v2.1/ -> will contain all the schema files for v2.1. api_schema/response/compute/v2.2/ -> will contain all the schema files for v2.2. and so on
For example -hypervisors.py will have all schema of hypervisor resource API.
Each schema name should be clear enough to easily understand the API for which they are defined. For example -
- list_hypervisors - list hypervisors API schema
- list_hypervisors_detail - detail list of hypervisors
- create_get_update_<resource name> - If schema is same for create, get & update API of any resource.
Note- Most of the schema names are defined as per above guidelines but if there are some misleading names, those needs to be fixed. For example - quota class set and quota set schemas are defined with same name (quota_set) in quotas.py and quota_classes.py.
After above re arrangement it will be easy to maintain those schemas.
Keep things as they are which will keep schemas readability and maintenance difficult.
Target Milestone for completion: