Difference between revisions of "Neutron/API/WADL"
< Neutron
m (ThierryCarrez moved page Quantum/API/WADL to Neutron/API/WADL) |
|||
(7 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | + | ||
= Quantum API WADL Specification = | = Quantum API WADL Specification = | ||
[https://blueprints.launchpad.net/quantum/+spec/quantum-api-wadl blueprint link] | [https://blueprints.launchpad.net/quantum/+spec/quantum-api-wadl blueprint link] | ||
Line 5: | Line 5: | ||
== Resources == | == Resources == | ||
* http://www.w3.org/Submission/wadl/ | * http://www.w3.org/Submission/wadl/ | ||
− | |||
== Scope == | == Scope == | ||
− | Provide WADL documents for the Quantum | + | Provide WADL documents for the Quantum core API and API extensions. |
WADL document scope | WADL document scope | ||
Line 18: | Line 17: | ||
* A '''resources''' component will have '''resource''' components for each resource entity | * A '''resources''' component will have '''resource''' components for each resource entity | ||
** eg) network, subnet, port, etc. | ** eg) network, subnet, port, etc. | ||
− | * Each '''resource''' component will have '''method''' components for GET, POST, PUT, and DELETE. | + | * Each '''resource''' component will have '''method''' components for GET(list, show), POST(create, bulk create), PUT(update), and DELETE(delete). |
− | * Each '''method''' component will have a '''request''' component and ''''' | + | * Each '''method''' component will have a '''request''' component and a optional '''response''' component |
− | + | * A '''request''' or '''response''' component will have '''representation''' components composed with '''param''' components based on the attribute resource map of the API | |
== Use Cases == | == Use Cases == | ||
Line 33: | Line 32: | ||
== Implementation Overview == | == Implementation Overview == | ||
− | Write a python script ''quantum/tools/wadl/ | + | Write a python script ''quantum/tools/wadl/generate_docs.sh'' and ''quantum/tools/wadl/extract_attrs.py'' |
− | * | + | * Process core APIs |
− | * | + | ** Retrieve the RESOURCE_ATTR_MAP in quantum.api.v2.attributes |
− | + | ** Create document quantum/doc/wadl/core.wadl based on the RESOURCE_ATTR_MAP dict. | |
− | + | * Process API extensions | |
− | + | ** Traverse modules in quantum/quantum/extension and find all subclasses of quantum.extension.[[ExtensionDescriptor]] in each module. | |
− | + | ** Retrieve the attr_map property in each [[ResourceExtension]] object returned by the get_resources() method of [[ExtensionDescriptior]]. | |
− | + | ** Automatically generate WADL document files | |
− | + | *** quantum/doc/wadl/[extention].wadl | |
− | * | + | * All data will be populated according to the attr_map for each API extension module |
− | * Automatically generate WADL | ||
− | |||
== Data Model Changes == | == Data Model Changes == | ||
Line 72: | Line 69: | ||
== Usage Example == | == Usage Example == | ||
− | After changing | + | After changing the core API or API extension specification in the source code, the developer will run ''./tools/wadl/generate_docs.sh'' to update the WADL documents in ''quantum/doc/wadl/'' |
== Test Cases == | == Test Cases == | ||
− | No plans of test cases. However need to check if | + | No plans of test cases. However need to check if all API extensions are subclassing from quantum.extension.[[ExtensionDescriptor]] beforehand. |
Latest revision as of 15:54, 21 June 2013
Contents
Quantum API WADL Specification
Resources
Scope
Provide WADL documents for the Quantum core API and API extensions.
WADL document scope
- Core APIs will have a WADL document
- All extension APIs will have its own WADL document
- Each WADL document will have one application component
- An application component will have one resources component
- A resources component will have resource components for each resource entity
- eg) network, subnet, port, etc.
- Each resource component will have method components for GET(list, show), POST(create, bulk create), PUT(update), and DELETE(delete).
- Each method component will have a request component and a optional response component
- A request or response component will have representation components composed with param components based on the attribute resource map of the API
Use Cases
These are some of the use cases borrowed from the W3 WADL specification.
- Application Modelling and Visualization
- Support for development of resource modelling tools for resource relationship and choreography analysis and manipulation.
- Code Generation
- Automated generation of stub and skeleton code and code for manipulation of resource representations.
- Configuration
- Configuration of client and server using a portable format.
Implementation Overview
Write a python script quantum/tools/wadl/generate_docs.sh and quantum/tools/wadl/extract_attrs.py
- Process core APIs
- Retrieve the RESOURCE_ATTR_MAP in quantum.api.v2.attributes
- Create document quantum/doc/wadl/core.wadl based on the RESOURCE_ATTR_MAP dict.
- Process API extensions
- Traverse modules in quantum/quantum/extension and find all subclasses of quantum.extension.ExtensionDescriptor in each module.
- Retrieve the attr_map property in each ResourceExtension object returned by the get_resources() method of ExtensionDescriptior.
- Automatically generate WADL document files
- quantum/doc/wadl/[extention].wadl
- All data will be populated according to the attr_map for each API extension module
Data Model Changes
N/A
Configuration variables
N/A
API's
N/A
Plugin Interface
N/A
Required Plugin support
N/A
Dependencies
None
CLI Requirements
N/A
Horizon Requirements
N/A
Usage Example
After changing the core API or API extension specification in the source code, the developer will run ./tools/wadl/generate_docs.sh to update the WADL documents in quantum/doc/wadl/
Test Cases
No plans of test cases. However need to check if all API extensions are subclassing from quantum.extension.ExtensionDescriptor beforehand.