ocf / ocflib

Python libraries for account and server management
https://pypi.python.org/pypi/ocflib
Other
15 stars 32 forks source link

Added get newest RT ticket #232

Open lancemathias opened 3 years ago

lancemathias commented 3 years ago

New method to get latest RT ticket using REST API. Pushed to master to test since local tests aren't working.

ethanhs commented 3 years ago

(Closed and reopened, which seems to have fixed CI not getting triggered initially)

axmmisaka commented 2 years ago

https://metacpan.org/pod/RT::Extension::REST2#Cookie-Auth There's some discussion in #rebuild regarding using REST 2.0 api. The issue is for REST 2.0 it appears that the docs suggest against using session-token to authenticate, so every time auth token/password is needed in the header if I understand it correctly? Otherwise use resp = s.get('https://rt.ocf.berkeley.edu/REST/2.0/tickets?query=Queue="help"&orderby=Created&order=DESC', headers={"Authorization": "token dskljvelkajdhvluierwbvlijaebvleisuadghea"}) json parse resp.text, and pick the first in items.