<div dir="ltr"><p>Hi,</p> <p>I want to know when a api call such as 
GET /v2.0/networks
Accept: application/json
is made how and where does the server interpret it and respond to it.</p> <p>I have been looking in the source code and this is what i have found.
The server file at <a href="https://github.com/openstack/quantum/blob/master/bin/quantum-server">https://github.com/openstack/quantum/blob/master/bin/quantum-server</a> starts the server.</p> <p>Then the flow goes to the file service.py 
(<a href="https://github.com/openstack/quantum/blob/master/quantum/service.py">https://github.com/openstack/quantum/blob/master/quantum/service.py</a>)</p> <p>Here the wsgi server is started at line # 104 and consequently the Quantum Service is started.
All this is done with the aid of wsgi.py
(<a href="https://github.com/openstack/quantum/blob/master/quantum/wsgi.py">https://github.com/openstack/quantum/blob/master/quantum/wsgi.py</a>).</p> <p>So now the quantum service has started. I checked the log information to verify. </p>
 <p>What i want to know is if i make a request such as get network list
<strong>GET /v2.0/networks
Accept: application/json</strong></p> <p>what would be the flow of that. As asked above how would the Quantum server now read it interpret it and respond to it. </p> <p>So
 far after this is what i have found out.
In the wsgi.py (Same location as above) the request could go to Class 
Request (line # 266) As this would determine the most acceptable 
content-type, Accept* headers in the scenario described above.</p> <p>Based on the request it would use the Router class (line # 904). As this, helps to   maps incoming requests to WSGI app.</p> <p>Then
 there is the attributes.py 
(<a href="https://github.com/openstack/quantum/blob/master/quantum/api/v2/attributes.py">https://github.com/openstack/quantum/blob/master/quantum/api/v2/attributes.py</a>).
 This helps to form the response for resources like network, port and 
subnet. It has the resource attribute map (line # 475) which composes 
the response for network, port or subnet</p> <p>Also there is the 
router.py(<a href="https://github.com/openstack/quantum/blob/master/quantum/api/v2/router.py">https://github.com/openstack/quantum/blob/master/quantum/api/v2/router.py</a>)
 which has the class Api Router(line # 68). From its description it 
should route the api requests to its core functions.</p> <p>Here is 
where i am lost. I don't have a clear idea how do these relate and work .
 Any help on this would be appreciated. Thank you.</p><p><br></p><p>Udit<br></p></div>