PagerDuty / pdpyras

Low-level PagerDuty REST/Events API client for Python
MIT License
129 stars 29 forks source link

How to set proxy for pdpyrsa #47

Closed zelong430 closed 3 years ago

zelong430 commented 3 years ago

Our enterprise network require to use a proxy to access https://api.pagerduty.com. I can't find a way to set the proxy for EventAPISession. Can someone here provide some helps our point me to the correct instructions/docs?

badnetmask commented 3 years ago

pdpyrsa uses the Python requests library. I am unable to test right now, but I would suggest that you try environment variables, like explained in the documentation. In theory, it should work just fine.

zelong430 commented 3 years ago

Hi Thanks for the reply,

I was able to get it work by something like:

session = pdpyras.EventsAPISession(CONFIG['our-pager-duty-key']) session.proxies.update(PD_PROXY)