<div dir="ltr">For the first question, since api-paste.ini is a configuration file, you can just add your new filter to the configuration file so your filter can take effect. As Joe suggests, you can add embed the information in the oslo.context object so plugin can get it from context which is passed to plugin.</div><br><div class="gmail_quote"><div dir="ltr">On Fri, 3 Nov 2017 at 12:29 joehuang <<a href="mailto:joehuang@huawei.com">joehuang@huawei.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div>
<div style="direction:ltr;font-family:Courier New;color:#000000;font-size:12pt">
Hello,
<div><br>
</div>
<div>As you are talking about how to distinguish the request to local Neutron and central Neutron, do you mean how to set the "USER_AGENT" in the request header, and how to extract the "USER_AGENT" and stored it in the context? Though it's mentioned in <a href="https://developer.openstack.org/sdks/python/openstacksdk/users/connection.html" target="_blank">https://developer.openstack.org/sdks/python/openstacksdk/users/connection.html</a></div>
<div><br>
</div>
<div>This field has not been extracted neither in oslo.context, nor neutron-lib context:</div>
<div><br>
</div>
<div><a href="https://github.com/openstack/oslo.context/blob/master/oslo_context/context.py" target="_blank">https://github.com/openstack/oslo.context/blob/master/oslo_context/context.py</a></div>
<div><a href="https://github.com/openstack/neutron-lib/blob/master/neutron_lib/context.py" style="font-size:12pt" target="_blank">https://github.com/openstack/neutron-lib/blob/master/neutron_lib/context.py</a> </div>
<div>
<div><br>
</div>
<div>May be we can add it in oslo.context?</div>
<div><br>
<div style="font-family:Tahoma;font-size:13px">
<div>
<div><font size="3" face="Courier New">Best Regards</font></div>
<font size="3" face="Courier New">Chaoyi Huang (joehuang)</font></div>
</div>
</div>
<div style="font-family:Times New Roman;color:#000000;font-size:16px">
<hr>
<div id="m_-1982839482995910274divRpF188906" style="direction:ltr"><font face="Tahoma" size="2" color="#000000"><b>From:</b> XuZhuang [<a href="mailto:xu_lyman@163.com" target="_blank">xu_lyman@163.com</a>]<br>
<b>Sent:</b> 01 November 2017 19:49<br>
<b>To:</b> <a href="mailto:openstack-dev@lists.openstack.org" target="_blank">openstack-dev@lists.openstack.org</a><br>
<b>Subject:</b> [openstack-dev] [tricircle]Distinguish the direction of requests<br>
</font><br>
</div></div></div></div></div><div><div style="direction:ltr;font-family:Courier New;color:#000000;font-size:12pt"><div><div style="font-family:Times New Roman;color:#000000;font-size:16px">
<div></div>
<div>
<div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial">
<div>Hello,</div>
<div><br>
</div>
<div>
<p style="margin-bottom:0cm;line-height:100%"><font face="Liberation Serif, serif"><font style="font-size:12pt"><span lang="en-US">I have some questions in how to distinguish the direction of requests between local neutron and central neutron.</span></font></font></p>
<p style="margin-bottom:0cm;line-height:100%"><br>
</p>
<p style="margin-bottom:0cm;line-height:100%"><font face="Liberation Serif, serif"><font style="font-size:12pt"><span lang="en-US">There is the preliminary plan</span></font></font></p>
<p style="margin-bottom:0cm;line-height:100%"><br>
</p>
<p style="margin-bottom:0cm;line-height:100%"><font face="Liberation Serif, serif"><font style="font-size:12pt"><span lang="en-US">1. For how to distinguish the requests in central neutron</span></font></font></p>
<p style="margin-bottom:0cm;line-height:100%"><font face="Liberation Serif, serif"><font style="font-size:12pt"><span lang="en-US">we can add a filter in neutron/…./etc/api-paste.ini. Using this filter we can get some values about the source.</span></font></font></p>
<p style="margin-bottom:0cm;line-height:100%"><font face="Liberation Serif, serif"><font style="font-size:12pt"><span lang="en-US">But the question is that the process of loading filter is in Neutron. Without changing Neutron how could we add a filter? Could
 we change Neutron?</span></font></font></p>
<p style="margin-bottom:0cm;line-height:100%"><br>
</p>
<p style="margin-bottom:0cm;line-height:100%"><font face="Liberation Serif, serif"><font style="font-size:12pt"><span lang="en-US">2. For how to add a signal in the requests</span></font></font></p>
<p style="margin-bottom:0cm;line-height:100%"><font face="Liberation Serif, serif"><font style="font-size:12pt"><span lang="en-US">The module of common.client in Tricircle is responsible for sending requests. So we can add a signal in the header of requests.
 And central plugin will get this signal using the filter.</span></font></font></p>
<p style="margin-bottom:0cm;line-height:100%"><font face="Liberation Serif, serif"><font style="font-size:12pt"><span lang="en-US"><br>
</span></font></font></p>
<div style="font-family:Tahoma;font-size:13px"><font size="3" face="Courier New">Best Regards</font></div>
<p style="margin-bottom:0cm;line-height:100%"><font size="3" face="Courier New">Zhuangzhuang Xu (Lyman Xu)</font></p>
</div>
</div>
<br>
<br>
<span title="neteasefooter">
<p> </p>
</span></div>
</div></div></div></div>

__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
</blockquote></div><div dir="ltr">-- <br></div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">BR<div>Zhiyuan</div></div></div>