settingsLogin | Registersettings

[openstack-dev] [tricircle]Distinguish the direction of requests

0 votes

Hello,

I have some questions in how to distinguish the direction of requests between local neutron and central neutron.

There is the preliminary plan

  1. For how to distinguish the requests in central neutron

we can add a filter in neutron/…./etc/api-paste.ini. Using this filter we can get some values about the source.

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?

  1. For how to add a signal in the requests

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.

Best Regards

Zhuangzhuang Xu (Lyman Xu)__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: OpenStack-dev-request@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

asked Nov 5, 2017 in openstack-dev by XuZhuang (120 points)  

2 Responses

0 votes

Hello,

As you are talking about how to distinguish the request to local Neutron and central Neutron, do you mean how to set the "USERAGENT" in the request header, and how to extract the "USERAGENT" and stored it in the context? Though it's mentioned in https://developer.openstack.org/sdks/python/openstacksdk/users/connection.html

This field has not been extracted neither in oslo.context, nor neutron-lib context:

https://github.com/openstack/oslo.context/blob/master/oslo_context/context.py
https://github.com/openstack/neutron-lib/blob/master/neutron_lib/context.py

May be we can add it in oslo.context?

Best Regards
Chaoyi Huang (joehuang)


From: XuZhuang [xu_lyman@163.com]
Sent: 01 November 2017 19:49
To: openstack-dev@lists.openstack.org
Subject: [openstack-dev] [tricircle]Distinguish the direction of requests

Hello,

I have some questions in how to distinguish the direction of requests between local neutron and central neutron.

There is the preliminary plan

  1. For how to distinguish the requests in central neutron

we can add a filter in neutron/…./etc/api-paste.ini. Using this filter we can get some values about the source.

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?

  1. For how to add a signal in the requests

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.

Best Regards

Zhuangzhuang Xu (Lyman Xu)


OpenStack Development Mailing List (not for usage questions)
Unsubscribe: OpenStack-dev-request@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
responded Nov 3, 2017 by joehuang (17,140 points)   2 5 7
0 votes

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.

On Fri, 3 Nov 2017 at 12:29 joehuang joehuang@huawei.com wrote:

Hello,

As you are talking about how to distinguish the request to local Neutron
and central Neutron, do you mean how to set the "USERAGENT" in the request
header, and how to extract the "USER
AGENT" and stored it in the context?
Though it's mentioned in
https://developer.openstack.org/sdks/python/openstacksdk/users/connection.html

This field has not been extracted neither in oslo.context, nor neutron-lib
context:

https://github.com/openstack/oslo.context/blob/master/oslo_context/context.py
https://github.com/openstack/neutron-lib/blob/master/neutron_lib/context.py

May be we can add it in oslo.context?

Best Regards
Chaoyi Huang (joehuang)


From: XuZhuang [xu_lyman@163.com]
*Sent:* 01 November 2017 19:49
*To:* openstack-dev@lists.openstack.org
*Subject:* [openstack-dev] [tricircle]Distinguish the direction of
requests

Hello,

I have some questions in how to distinguish the direction of requests
between local neutron and central neutron.

There is the preliminary plan

  1. For how to distinguish the requests in central neutron

we can add a filter in neutron/…./etc/api-paste.ini. Using this filter we
can get some values about the source.

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?

  1. For how to add a signal in the requests

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.

Best Regards

Zhuangzhuang Xu (Lyman Xu)


OpenStack Development Mailing List (not for usage questions)
Unsubscribe: OpenStack-dev-request@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

--
BR
Zhiyuan


OpenStack Development Mailing List (not for usage questions)
Unsubscribe: OpenStack-dev-request@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
responded Nov 5, 2017 by Vega_Cai (1,900 points)   2
...