Advertisement
Guest User

pynetbox_ssl_verify

a guest
Jul 7th, 2020
316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. python
  2. Python 3.7.7 (default, Mar 10 2020, 15:43:03)
  3. [Clang 11.0.0 (clang-1100.0.33.17)] on darwin
  4. Type "help", "copyright", "credits" or "license" for more information.
  5. >>>
  6. >>> import requests
  7. >>>
  8. >>> requests.get('https://netbox.url',verify='/my/path/to/cacert.crt')
  9. <Response [200]>
  10. >>>
  11. >>> import pynetbox
  12. >>> import os
  13. >>>
  14. >>> os.environ['REQUESTS_CA_BUNDLE'] = '/my/path/to/cacert.crt'
  15. >>>
  16. >>> nb = pynetbox.api(
  17. ... 'https://netbox.url',
  18. ... token='XXX',
  19. ... private_key_file='/my/path/to/key'
  20. ... )
  21. >>>
  22. >>> nb.version
  23. '2.8'
  24. >>> nb.dcim.devices.all()
  25. []
  26. >>>
  27. >>> exit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement