From f3ce00daaf4dce966af46e0da28b2d0c0108f703 Mon Sep 17 00:00:00 2001 From: Demitri Morgan Date: Thu, 18 Mar 2021 15:27:53 -0600 Subject: [PATCH 1/2] Change how routing key is included in event payloads Including the routing key via the `send_event` method broke some downstream usage of the client, which depended on being able to call `post` directly with an explicitly-defined payload that lacked a routing key (which was possible when using the header). To remedy this, the `post` method is overridden in EventsAPIClient to add the `routing_key` parameter to the body before sending. --- pdpyras.py | 15 +++++++++++---- test_pdpyras.py | 20 ++++++++++++++++++++ 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/pdpyras.py b/pdpyras.py index 9da801c..477b1f3 100644 --- a/pdpyras.py +++ b/pdpyras.py @@ -697,10 +697,7 @@ def send_event(self, action, dedup_key=None, **properties): if action not in actions: raise ValueError("Event action must be one of: "+', '.join(actions)) - event = { - 'event_action':action, - 'routing_key': self.api_key - } + event = {'event_action':action} event.update(properties) if isinstance(dedup_key, string_types): @@ -716,6 +713,16 @@ def send_event(self, action, dedup_key=None, **properties): "deduplication key.", response=response) return response_body['dedup_key'] + def post(self, *args, **kw): + """ + Override of ``requests.Session.post`` + + Adds the ``routing_key`` parameter to the body before sending. + """ + if 'json' in kw and hasattr(kw['json'], 'update'): + kw['json'].update({'routing_key': self.api_key}) + return super(EventsAPISession, self).post(*args, **kw) + def trigger(self, summary, source, dedup_key=None, severity='critical', payload=None, custom_details=None, images=None, links=None): """ diff --git a/test_pdpyras.py b/test_pdpyras.py index a2d1899..ec829cf 100755 --- a/test_pdpyras.py +++ b/test_pdpyras.py @@ -127,6 +127,26 @@ def test_send_event(self): }, parent.request.call_args[1]['json']) + def test_send_explicit_event(self): + # test sending an event by calling `post` directly as opposed to any of + # the methods written into the client for sending events + sess = pdpyras.EventsAPISession('routingkey') + parent = MagicMock() + parent.request = MagicMock() + parent.request.side_effect = [Response(202, '{"dedup_key":"abc123"}')] + with patch.object(sess, 'parent', new=parent): + response = sess.post('/v2/enqueue', json={ + 'payload': { + 'summary': 'testing 123', + 'source': 'pdpyras integration', + 'severity': 'critical' + }, + 'event_action': 'trigger' + }) + json_sent = parent.request.call_args[1]['json'] + self.assertTrue('routing_key' in json_sent) + self.assertEqual(json_sent['routing_key'], 'routingkey') + class APISessionTest(SessionTest): def debug(self, sess): From faefccace72aca17e7bfc02f2eeb975efc299e68 Mon Sep 17 00:00:00 2001 From: Demitri Morgan Date: Thu, 18 Mar 2021 15:32:02 -0600 Subject: [PATCH 2/2] Update changelog and bump version --- CHANGELOG.rst | 6 ++++++ docs/_static/documentation_options.js | 2 +- docs/genindex.html | 4 +++- docs/index.html | 20 +++++++++++++++++++- docs/objects.inv | Bin 1524 -> 1531 bytes docs/py-modindex.html | 2 +- docs/search.html | 2 +- docs/searchindex.js | 2 +- pdpyras.py | 2 +- setup.py | 2 +- 10 files changed, 34 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 2c87263..e1b821b 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,3 +1,9 @@ +**2021-03-18: Version 4.1.4** + +* Fix regression in :attr:`EventsAPISession.post` + * Use case: explicitly-defined body (``json`` keyword argument) without a ``routing_key`` parameter + * This was previously possible (before version 4.1.3) with the ``X-Routing-Key`` header (an undocumented API feature) + **2021-03-10: Version 4.1.3** * Use documented method for including the routing key in the request for API V2 (addresses `#53 `_) diff --git a/docs/_static/documentation_options.js b/docs/_static/documentation_options.js index 3a8841b..8727c9a 100644 --- a/docs/_static/documentation_options.js +++ b/docs/_static/documentation_options.js @@ -1,6 +1,6 @@ var DOCUMENTATION_OPTIONS = { URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), - VERSION: '4.1.3', + VERSION: '4.1.4', LANGUAGE: 'None', COLLAPSE_INDEX: false, BUILDER: 'html', diff --git a/docs/genindex.html b/docs/genindex.html index c83cef4..1570607 100644 --- a/docs/genindex.html +++ b/docs/genindex.html @@ -5,7 +5,7 @@ - Index — PagerDuty Python REST API Sessions 4.1.3 documentation + Index — PagerDuty Python REST API Sessions 4.1.4 documentation @@ -187,6 +187,8 @@

P

    +
  • post() (pdpyras.EventsAPISession method) +
  • postprocess() (pdpyras.APISession method)
      diff --git a/docs/index.html b/docs/index.html index 759ccf7..7dfd914 100644 --- a/docs/index.html +++ b/docs/index.html @@ -5,7 +5,7 @@ - PDPYRAS: PagerDuty Python REST API Sessions — PagerDuty Python REST API Sessions 4.1.3 documentation + PDPYRAS: PagerDuty Python REST API Sessions — PagerDuty Python REST API Sessions 4.1.4 documentation @@ -1218,6 +1218,13 @@

      Events API Client +
      +post(*args, **kw)
      +

      Override of requests.Session.post

      +

      Adds the routing_key parameter to the body before sending.

      +
      +
      prepare_headers(method)
      @@ -1462,6 +1469,17 @@

      Errors

      Changelog

      +

      2021-03-18: Version 4.1.4

      +
        +
      • +
        Fix regression in EventsAPISession.post
          +
        • Use case: explicitly-defined body (json keyword argument) without a routing_key parameter

        • +
        • This was previously possible (before version 4.1.3) with the X-Routing-Key header (an undocumented API feature)

        • +
        +
        +
        +
      • +

      2021-03-10: Version 4.1.3

      • Use documented method for including the routing key in the request for API V2 (addresses #53)

      • diff --git a/docs/objects.inv b/docs/objects.inv index 57750375b3a4459deccc8f6c427a5133c1fd143b..8484b50d5e15863286c60e60d054de3a35914412 100644 GIT binary patch delta 1403 zcmV->1%&$a3;PR@S^+eXTRVT4O>g5i5Qgvi6$F}NX>1og<>rmEn*h70;Up+}5@>NO zb3={uslxzp;9zu!c+tcKEve=ayO z7ZpAzDKq!ILrEqgTv+6-Il8Z6HO*(m1S~JI4;Li?Z}~Z*Hood&yc(APRp4|d;0^h z9A;JJ*T{lZ&y9MK!0TBje9Pw*$T$4l5PA#dr`H=B8jO-ZE<3n^hL_+*FT(NR*7ZD} ztyecvAbzX0(leg%nckhTRgIZ@5v*79gQ?eEcEb}R>Rwk?r@Lp!^HIk(V&eNp=Paw9HVLa^pxc^BXS%umo0teG%Sid}FVq{z?OxrV*}@5i zVTW9#Wp+Og@f``i7nIm$V7!WobOv8j zMzvl;gXWXhKe^9EwP#HYt`d*0a+5SgrJ9fuZs!xgK!$$|o?6srd; zTFxeyN@|K~+N*DdHlE^Wfqxi@_Z!<9t66aRm~E%0K~IPJm9w)9c9y5{!oMg?`(+g+ zs13oaaUL)G9jnHlT(6}k?W*VR(^$cU!4|_6FhexdO#AS1uZ3*-oF|U<96fQXf!$4S z_dd-RA@P4PM7W$fy_eBm7W%Kd_-`;`Mq$A}2Er7+OT;JG3R3ybYJti zyor;=$rW5x=T^yjwf<|fe7GiS3?04d?2)XGcgLbgDkaBvPSLoQ2 ztayJv?XLzYd|(Z$F%5quZ1KEc3v%eB74+Tmn>fnoGyc4yzP+~k&CmA*`QR?VH__4_ zX_^SG`WC)V4RI6m;hMPbrP!Ho9MUET}K=FdeT1h{B0U5us@rs%TJrH zsPSdJ?l9p;rCvjW##epv#eGILv>QaZmtpcT^%>zSE31ebMn{N>*(vLxm7(4W{g`jM z4{rs3(=#hiY0W>DVa?c+Jf=0519jYCs$hn=F94-$CDe{gdM9kE2eApE9;9kVJs9?} z8CqT^%h9nuuv@4E-ah>`iPJGG-&;JQG@)+k9u3PsMC+di)?;9s;)Q8^<*-w?&7Vg5i5WVYH5NM92v0e0(n>WsG0_>uOlc4BHpvAGw z4K1o9wORMqclagCNu`MHA&Eo2_c$EQm)!F9sF@+{@%o^6CxLt*qT%p!v9|~LOIV{< zgcfZ;E|%;22QWsc#*r$?j3K`bIsXk_u$={68n7j6MfnUzeWu>~t zdW)I0T5LNDvjwa;zy-|C?#n$e4m#Ip$F#>5GI<p1!dzlt3)&zvm!*ttwW{#nT&9MWX^7F2&sIAj(Led=qB%&g zxpAj!$n}kO&dKI(z}E zNWaxu=^2me4DasPs>aN%=j+w{nCP*WHR=KVe~?O6&8@KmZeD-zorqG^xsF^M*w1or zZCfG>4(;qY&%k0=>2w7pG(SM9*=8kL!w$KW zmf8J0iXSX+yf1ND$f4gnVsy%CJaFuxcl$(SpD%FIPaF$OH1~BB{twn#mx08g3DJl)jt7D9iuH|g< zsD!47rak&*sPPn63;e@K>~CyqtY*RKW7-Z+1D+1?E2pyzI?K~~;phEnzpNqzu_2f> z?qjpxv1lfiAkYHkp4oG;%fry-m{lXR?-GjhYYL6mzLCLhzB5x#k{inwKTgs7OEQV*jH^(ypZnm)V={-$VW zDo^RmKbGOlIFmf4GnWH&v@lgLL)`ax(v1>oM<%@!jOvLvgiueUYDYaW*s&QZuak0g ztPkuKDuLanZ=Ye_*Y*V~2jjtSbs@wb-A;rHt3m?c} C)XTg8 diff --git a/docs/py-modindex.html b/docs/py-modindex.html index e29291c..42331c1 100644 --- a/docs/py-modindex.html +++ b/docs/py-modindex.html @@ -5,7 +5,7 @@ - Python Module Index — PagerDuty Python REST API Sessions 4.1.3 documentation + Python Module Index — PagerDuty Python REST API Sessions 4.1.4 documentation diff --git a/docs/search.html b/docs/search.html index 7781563..2ad362d 100644 --- a/docs/search.html +++ b/docs/search.html @@ -5,7 +5,7 @@ - Search — PagerDuty Python REST API Sessions 4.1.3 documentation + Search — PagerDuty Python REST API Sessions 4.1.4 documentation diff --git a/docs/searchindex.js b/docs/searchindex.js index ffa2cd0..10a2104 100644 --- a/docs/searchindex.js +++ b/docs/searchindex.js @@ -1 +1 @@ -Search.setIndex({docnames:["index"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":3,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":2,"sphinx.domains.rst":2,"sphinx.domains.std":1,"sphinx.ext.intersphinx":1,"sphinx.ext.todo":2,sphinx:56},filenames:["index.rst"],objects:{"":{pdpyras:[0,0,0,"-"]},"pdpyras.APISession":{after_set_api_key:[0,2,1,""],api_call_counts:[0,3,1,""],api_time:[0,3,1,""],auth_header:[0,2,1,""],auth_type:[0,2,1,""],default_from:[0,3,1,""],default_page_size:[0,3,1,""],dict_all:[0,2,1,""],find:[0,2,1,""],iter_all:[0,2,1,""],list_all:[0,2,1,""],persist:[0,2,1,""],postprocess:[0,2,1,""],prepare_headers:[0,2,1,""],profiler_key:[0,2,1,""],rdelete:[0,2,1,""],rget:[0,2,1,""],rpost:[0,2,1,""],rput:[0,2,1,""],subdomain:[0,2,1,""],total_call_count:[0,2,1,""],total_call_time:[0,2,1,""],trunc_token:[0,2,1,""],url:[0,3,1,""]},"pdpyras.EventsAPISession":{acknowledge:[0,2,1,""],auth_header:[0,2,1,""],prepare_headers:[0,2,1,""],resolve:[0,2,1,""],send_event:[0,2,1,""],trigger:[0,2,1,""]},"pdpyras.PDClientError":{response:[0,3,1,""]},"pdpyras.PDSession":{after_set_api_key:[0,2,1,""],api_key:[0,2,1,""],api_key_access:[0,2,1,""],auth_header:[0,2,1,""],log:[0,3,1,""],max_http_attempts:[0,3,1,""],max_network_attempts:[0,3,1,""],parent:[0,3,1,""],postprocess:[0,2,1,""],prepare_headers:[0,2,1,""],raise_if_http_error:[0,3,1,""],request:[0,2,1,""],retry:[0,3,1,""],set_api_key:[0,2,1,""],sleep_timer:[0,3,1,""],sleep_timer_base:[0,3,1,""],stagger_cooldown:[0,2,1,""],trunc_key:[0,2,1,""]},pdpyras:{APISession:[0,1,1,""],EventsAPISession:[0,1,1,""],PDClientError:[0,1,1,""],PDSession:[0,1,1,""],auto_json:[0,4,1,""],last_4:[0,4,1,""],object_type:[0,4,1,""],raise_on_error:[0,4,1,""],random:[0,4,1,""],resource_envelope:[0,4,1,""],resource_name:[0,4,1,""],resource_path:[0,4,1,""],tokenize_url_path:[0,4,1,""],try_decoding:[0,4,1,""]}},objnames:{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","method","Python method"],"3":["py","attribute","Python attribute"],"4":["py","function","Python function"]},objtypes:{"0":"py:module","1":"py:class","2":"py:method","3":"py:attribute","4":"py:function"},terms:{"0123456789abcdef0123456789abcdef":0,"100":0,"10000":0,"101st":0,"2018":0,"2019":0,"201st":0,"2020":0,"2021":0,"400":0,"401":0,"404":0,"429":0,"500":0,"502":0,"601":0,"700":0,"case":0,"catch":0,"class":0,"default":0,"final":0,"import":0,"int":0,"new":0,"return":0,"super":0,"transient":0,"true":0,"try":0,"while":0,AND:0,Added:0,BUT:0,FOR:0,For:0,IDs:0,NOT:0,Not:0,One:0,THE:0,The:0,There:0,These:0,USE:0,Use:0,Useful:0,WITH:0,Will:0,With:0,_all:0,_api_kei:0,abbrevi:0,abc123:0,abil:0,abov:0,absolut:0,accept:0,accord:0,account:0,acknowledg:0,action:0,add:0,added:0,adding:0,addit:0,address:0,adjust:0,admin:0,administr:0,advanc:0,advantag:0,affect:0,after:0,after_set_api_kei:0,against:0,agent:0,alert:0,algorithm:0,all:0,allow:0,along:0,alreadi:0,also:0,alter:0,altern:0,although:0,altogeth:0,alwai:0,amount:0,analyt:0,ani:0,anoth:0,api_call_count:0,api_kei:0,api_key_access:0,api_tim:0,api_token:0,apisess:0,append:0,appli:0,applic:0,approach:0,appropri:0,argument:0,aris:0,around:0,arrai:0,assert:0,assign:0,associ:0,assum:0,asynchron:0,attempt:0,attr:0,attribut:0,attributeerror:0,auth_head:0,auth_typ:0,author:0,auto:0,auto_json:0,automat:0,avail:0,avoid:0,back:0,base:0,baseurl:0,basi:0,bearer:0,becaus:0,becom:0,been:0,befor:0,begin:0,behav:0,behavior:0,being:0,beta:0,between:0,beyond:0,bit:0,bob:0,bonu:0,bool:0,born:0,both:0,brief:0,bug:0,bulk:0,bulletproof:0,busi:0,call:0,callabl:0,can:0,cannot:0,capit:0,captur:0,care:0,carri:0,caus:0,cautiou:0,certain:0,chang:0,charact:0,charg:0,check:0,child:0,claim:0,classifi:0,code:0,colon:0,com:0,commit:0,common:0,commonli:0,commun:0,compar:0,comparison:0,compil:0,complet:0,comput:0,concurr:0,condit:0,conduc:0,confer:0,configur:0,conjunct:0,connect:0,consequ:0,consid:0,consist:0,constant:0,constitut:0,constrain:0,construct:0,constructor:0,contact_method:0,contain:0,content:0,contract:0,conveni:0,cooldown:0,copi:0,correspond:0,could:0,count:0,coverag:0,creator:0,credenti:0,critic:0,current:0,custom:0,custom_detail:0,damag:0,dav:0,dave:0,david:0,deal:0,decod:0,decor:0,dedup:0,dedup_kei:0,dedupl:0,deem:0,def:0,default_from:0,default_page_s:0,defin:0,delai:0,demitri:0,departur:0,depend:0,deprec:0,deriv:0,descript:0,design:0,desir:0,detail:0,determin:0,dict:0,dict_al:0,dictionari:0,differ:0,directli:0,directori:0,disabl:0,discov:0,displai:0,distinct:0,distinguish:0,distribut:0,doc:0,document:0,doe:0,doesn:0,don:0,done:0,download:0,due:0,duplic:0,dure:0,dusti:0,each:0,easi:0,easier:0,easili:0,effect:0,effici:0,effort:0,either:0,elabor:0,elicit:0,elif:0,elimin:0,els:0,email:0,encapsul:0,enclos:0,encod:0,encount:0,end:0,enforc:0,enhanc:0,ensur:0,entiti:0,entri:0,envelop:0,equal:0,escal:0,escalation_polici:0,essenti:0,etc:0,eventsapisess:0,ever:0,everyth:0,exact:0,exactli:0,exampl:0,example35:0,exceed:0,except:0,exist:0,exit:0,expect:0,experiment:0,express:0,extend:0,factor:0,fail:0,failur:0,fals:0,far:0,faulti:0,fetch:0,few:0,file:0,filter:0,find:0,finish:0,fire:0,first:0,first_100_dav:0,fit:0,fix:0,flow:0,focu:0,follow:0,followup:0,format:0,forward:0,found:0,four:0,free:0,frequent:0,from:0,full:0,fulli:0,furnish:0,further:0,furthermor:0,get:0,getter:0,github:0,give:0,given:0,global:0,goal:0,going:0,grant:0,greater:0,halt:0,happen:0,hard:0,has:0,have:0,header:0,help:0,herd:0,here:0,herebi:0,higher:0,hoc:0,hold:0,holder:0,hook:0,how:0,howev:0,human:0,hundr:0,identif:0,identifi:0,ignor:0,imag:0,immedi:0,impact:0,implement:0,impli:0,incid:0,incident_refer:0,includ:0,inclus:0,incorrect:0,increas:0,increment:0,indefinit:0,index:0,indic:0,individu:0,infinit:0,inform:0,inherit:0,initi:0,innermost:0,input:0,insensit:0,insert:0,instanc:0,instanti:0,instead:0,insul:0,integr:0,intend:0,intern:0,interrupt:0,interv:0,introduc:0,introduct:0,invok:0,isinst:0,issu:0,item:0,item_hook:0,iter_al:0,its:0,itself:0,jane:0,jget:0,job:0,jpost:0,jput:0,json:0,just:0,keep:0,kei:0,key1:0,key2:0,keyerror:0,keyword:0,kind:0,kwarg:0,last:0,last_4:0,later:0,latest:0,lead:0,leav:0,length:0,let:0,level:0,liabil:0,liabl:0,librari:0,licens:0,lies:0,light:0,like:0,limit:0,link:0,list:0,list_al:0,littl:0,local:0,log:0,log_entri:0,logger:0,login:0,longer:0,lot:0,lower:0,made:0,mai:0,make:0,mani:0,manual:0,match:0,max_http_attempt:0,max_network_attempt:0,maximum:0,mcuserson:0,mean:0,member:0,memoiz:0,merchant:0,merg:0,messag:0,metadata:0,method:0,metric:0,might:0,minim:0,minimum:0,mirror:0,mit:0,modif:0,modifi:0,modul:0,more:0,moreov:0,morgan:0,most:0,multipl:0,must:0,name:0,namespac:0,natur:0,necess:0,need:0,nest:0,net:0,network:0,next:0,node:0,non:0,none:0,noninfring:0,nonzero:0,note:0,notebook:0,noth:0,notic:0,notification_rul:0,now:0,number:0,oauth2:0,oauth_token_her:0,obj_typ:0,object:0,object_typ:0,obtain:0,obvious:0,occur:0,odd:0,offici:0,offset:0,old:0,omit:0,one:0,onli:0,onu:0,oper:0,oppos:0,option:0,order:0,organ:0,origin:0,other:0,otherwis:0,our:0,ourselv:0,out:0,outsid:0,over:0,overal:0,overkil:0,overrid:0,own:0,pabc123:0,page:0,page_s:0,pagin:0,pair:0,parallel:0,param:0,paramet:0,parent:0,part:0,particular:0,pass:0,path:0,pattern:0,paus:0,payload:0,pdclienterror:0,pdef456:0,pdsession:0,per:0,perform:0,permiss:0,permit:0,permitted_method:0,persist:0,person:0,pertain:0,phij789:0,pi86now:0,pip:0,pjkl678:0,pkce:0,plain:0,pleas:0,plu:0,pnoexst:0,polici:0,pool:0,portion:0,posit:0,possibl:0,post:0,postprocess:0,potenti:0,power:0,practic:0,pre:0,preced:0,predict:0,preexist:0,prepare_head:0,prepend:0,prerequisit:0,presenc:0,present:0,previou:0,previous:0,print:0,prioriti:0,problem:0,process:0,profil:0,profiler_kei:0,program:0,progress:0,project:0,promote_to_admin:0,properti:0,provid:0,psomeusr:0,publish:0,pull:0,purpos:0,purview:0,put:0,pzyx321:0,queri:0,question:0,r_name:0,rais:0,raise_if_http_error:0,raise_on_error:0,random:0,rang:0,rank:0,rate:0,rather:0,rdelet:0,readabl:0,real:0,reason:0,reattempt:0,receiv:0,recommend:0,record:0,refactor:0,refer:0,reflect:0,reform:0,regress:0,reinvent:0,rel:0,reload:0,remov:0,renam:0,repeat:0,repetit:0,replac:0,report:0,repositori:0,repres:0,represent:0,reproduc:0,reqeust:0,requir:0,rescind:0,resolv:0,resource_envelop:0,resource_nam:0,resource_path:0,respect:0,respond:0,restrict:0,result:0,retriev:0,reusabl:0,rget:0,right:0,role:0,root:0,rout:0,routing_kei:0,rpost:0,rput:0,rule:0,safeguard:0,sai:0,same:0,sane:0,save:0,schema:0,scope:0,search:0,second:0,secret:0,secur:0,see:0,self:0,sell:0,send:0,send_ev:0,separ:0,seri:0,serial:0,serv:0,server:0,servic:0,session_id:0,set:0,set_api_kei:0,setter:0,sever:0,shall:0,shift:0,should:0,similar:0,similarli:0,simpl:0,simpler:0,simpli:0,simultan:0,singl:0,size:0,skip:0,slash:0,sleep:0,sleep_tim:0,sleep_timer_bas:0,small:0,softwar:0,some:0,someth:0,sort:0,sought:0,sourc:0,specif:0,specifi:0,spent:0,stagger_cooldown:0,standard:0,start:0,state:0,statu:0,status:0,status_cod:0,step:0,still:0,stop:0,str:0,string:0,strip:0,structur:0,subdomain:0,subject:0,sublicens:0,submit:0,substanti:0,success:0,successfulli:0,succinct:0,succinctli:0,suffix:0,summari:0,superpow:0,supersed:0,supplement:0,suppli:0,sure:0,synchron:0,system:0,take:0,taken:0,task:0,tear:0,tediou:0,tell:0,temporari:0,test:0,test_pdpyra:0,than:0,thei:0,them:0,themselv:0,thi:0,thing:0,third:0,thread:0,three:0,through:0,throught:0,thu:0,thunder:0,time:0,timer:0,tokenize_url_path:0,toler:0,too:0,tool:0,top:0,tort:0,total:0,total_call_count:0,total_call_tim:0,transform:0,transmit:0,treat:0,trigger:0,trunc_kei:0,trunc_token:0,truncat:0,try_decod:0,tupl:0,turn:0,two:0,type:0,typo:0,uid:0,ultim:0,unauthor:0,under:0,underli:0,uniformli:0,uniqu:0,unless:0,unpack:0,unspecifi:0,unsupport:0,until:0,unwrap:0,updated_incid:0,updated_us:0,upon:0,upper:0,uri:0,urllib3:0,use:0,used:0,user:0,user_id:0,user_refer:0,user_sess:0,uses:0,using:0,usual:0,valid:0,valu:0,value1:0,value2:0,variabl:0,verb:0,veri:0,version:0,versu:0,via:0,wai:0,wait:0,want:0,warn:0,wasn:0,web:0,welcom:0,well:0,went:0,were:0,what:0,wheel:0,when:0,whenev:0,where:0,wherea:0,whether:0,which:0,whichev:0,whitelist:0,whole:0,whom:0,whose:0,wise:0,within:0,without:0,word:0,work:0,would:0,wrap:0,write:0,wrong:0,yet:0,yield:0,you:0,your:0,yuck:0,zero:0},titles:["PDPYRAS: PagerDuty Python REST API Sessions"],titleterms:{"abstract":0,"function":0,Using:0,about:0,access:0,api:0,authent:0,basic:0,bodi:0,changelog:0,client:0,concept:0,contribut:0,copyright:0,creat:0,creation:0,data:0,delet:0,develop:0,disclaim:0,endpoint:0,error:0,event:0,featur:0,gener:0,guid:0,handl:0,histori:0,http:0,idempot:0,instal:0,interfac:0,iter:0,logic:0,manag:0,multi:0,oauth:0,pagerduti:0,pdpyra:0,place:0,python:0,read:0,regard:0,request:0,resourc:0,respons:0,rest:0,retri:0,session:0,special:0,support:0,token:0,updat:0,url:0,usag:0,warranti:0}}) \ No newline at end of file +Search.setIndex({docnames:["index"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":3,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":2,"sphinx.domains.rst":2,"sphinx.domains.std":1,"sphinx.ext.intersphinx":1,"sphinx.ext.todo":2,sphinx:56},filenames:["index.rst"],objects:{"":{pdpyras:[0,0,0,"-"]},"pdpyras.APISession":{after_set_api_key:[0,2,1,""],api_call_counts:[0,3,1,""],api_time:[0,3,1,""],auth_header:[0,2,1,""],auth_type:[0,2,1,""],default_from:[0,3,1,""],default_page_size:[0,3,1,""],dict_all:[0,2,1,""],find:[0,2,1,""],iter_all:[0,2,1,""],list_all:[0,2,1,""],persist:[0,2,1,""],postprocess:[0,2,1,""],prepare_headers:[0,2,1,""],profiler_key:[0,2,1,""],rdelete:[0,2,1,""],rget:[0,2,1,""],rpost:[0,2,1,""],rput:[0,2,1,""],subdomain:[0,2,1,""],total_call_count:[0,2,1,""],total_call_time:[0,2,1,""],trunc_token:[0,2,1,""],url:[0,3,1,""]},"pdpyras.EventsAPISession":{acknowledge:[0,2,1,""],auth_header:[0,2,1,""],post:[0,2,1,""],prepare_headers:[0,2,1,""],resolve:[0,2,1,""],send_event:[0,2,1,""],trigger:[0,2,1,""]},"pdpyras.PDClientError":{response:[0,3,1,""]},"pdpyras.PDSession":{after_set_api_key:[0,2,1,""],api_key:[0,2,1,""],api_key_access:[0,2,1,""],auth_header:[0,2,1,""],log:[0,3,1,""],max_http_attempts:[0,3,1,""],max_network_attempts:[0,3,1,""],parent:[0,3,1,""],postprocess:[0,2,1,""],prepare_headers:[0,2,1,""],raise_if_http_error:[0,3,1,""],request:[0,2,1,""],retry:[0,3,1,""],set_api_key:[0,2,1,""],sleep_timer:[0,3,1,""],sleep_timer_base:[0,3,1,""],stagger_cooldown:[0,2,1,""],trunc_key:[0,2,1,""]},pdpyras:{APISession:[0,1,1,""],EventsAPISession:[0,1,1,""],PDClientError:[0,1,1,""],PDSession:[0,1,1,""],auto_json:[0,4,1,""],last_4:[0,4,1,""],object_type:[0,4,1,""],raise_on_error:[0,4,1,""],random:[0,4,1,""],resource_envelope:[0,4,1,""],resource_name:[0,4,1,""],resource_path:[0,4,1,""],tokenize_url_path:[0,4,1,""],try_decoding:[0,4,1,""]}},objnames:{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","method","Python method"],"3":["py","attribute","Python attribute"],"4":["py","function","Python function"]},objtypes:{"0":"py:module","1":"py:class","2":"py:method","3":"py:attribute","4":"py:function"},terms:{"0123456789abcdef0123456789abcdef":0,"100":0,"10000":0,"101st":0,"2018":0,"2019":0,"201st":0,"2020":0,"2021":0,"400":0,"401":0,"404":0,"429":0,"500":0,"502":0,"601":0,"700":0,"case":0,"catch":0,"class":0,"default":0,"final":0,"import":0,"int":0,"new":0,"return":0,"super":0,"transient":0,"true":0,"try":0,"while":0,AND:0,Added:0,BUT:0,FOR:0,For:0,IDs:0,NOT:0,Not:0,One:0,THE:0,The:0,There:0,These:0,USE:0,Use:0,Useful:0,WITH:0,Will:0,With:0,_all:0,_api_kei:0,abbrevi:0,abc123:0,abil:0,abov:0,absolut:0,accept:0,accord:0,account:0,acknowledg:0,action:0,add:0,added:0,adding:0,addit:0,address:0,adjust:0,admin:0,administr:0,advanc:0,advantag:0,affect:0,after:0,after_set_api_kei:0,against:0,agent:0,alert:0,algorithm:0,all:0,allow:0,along:0,alreadi:0,also:0,alter:0,altern:0,although:0,altogeth:0,alwai:0,amount:0,analyt:0,ani:0,anoth:0,api_call_count:0,api_kei:0,api_key_access:0,api_tim:0,api_token:0,apisess:0,append:0,appli:0,applic:0,approach:0,appropri:0,arg:0,argument:0,aris:0,around:0,arrai:0,assert:0,assign:0,associ:0,assum:0,asynchron:0,attempt:0,attr:0,attribut:0,attributeerror:0,auth_head:0,auth_typ:0,author:0,auto:0,auto_json:0,automat:0,avail:0,avoid:0,back:0,base:0,baseurl:0,basi:0,bearer:0,becaus:0,becom:0,been:0,befor:0,begin:0,behav:0,behavior:0,being:0,beta:0,between:0,beyond:0,bit:0,bob:0,bonu:0,bool:0,born:0,both:0,brief:0,bug:0,bulk:0,bulletproof:0,busi:0,call:0,callabl:0,can:0,cannot:0,capit:0,captur:0,care:0,carri:0,caus:0,cautiou:0,certain:0,chang:0,charact:0,charg:0,check:0,child:0,claim:0,classifi:0,code:0,colon:0,com:0,commit:0,common:0,commonli:0,commun:0,compar:0,comparison:0,compil:0,complet:0,comput:0,concurr:0,condit:0,conduc:0,confer:0,configur:0,conjunct:0,connect:0,consequ:0,consid:0,consist:0,constant:0,constitut:0,constrain:0,construct:0,constructor:0,contact_method:0,contain:0,content:0,contract:0,conveni:0,cooldown:0,copi:0,correspond:0,could:0,count:0,coverag:0,creator:0,credenti:0,critic:0,current:0,custom:0,custom_detail:0,damag:0,dav:0,dave:0,david:0,deal:0,decod:0,decor:0,dedup:0,dedup_kei:0,dedupl:0,deem:0,def:0,default_from:0,default_page_s:0,defin:0,delai:0,demitri:0,departur:0,depend:0,deprec:0,deriv:0,descript:0,design:0,desir:0,detail:0,determin:0,dict:0,dict_al:0,dictionari:0,differ:0,directli:0,directori:0,disabl:0,discov:0,displai:0,distinct:0,distinguish:0,distribut:0,doc:0,document:0,doe:0,doesn:0,don:0,done:0,download:0,due:0,duplic:0,dure:0,dusti:0,each:0,easi:0,easier:0,easili:0,effect:0,effici:0,effort:0,either:0,elabor:0,elicit:0,elif:0,elimin:0,els:0,email:0,encapsul:0,enclos:0,encod:0,encount:0,end:0,enforc:0,enhanc:0,ensur:0,entiti:0,entri:0,envelop:0,equal:0,escal:0,escalation_polici:0,essenti:0,etc:0,eventsapisess:0,ever:0,everyth:0,exact:0,exactli:0,exampl:0,example35:0,exceed:0,except:0,exist:0,exit:0,expect:0,experiment:0,explicitli:0,express:0,extend:0,factor:0,fail:0,failur:0,fals:0,far:0,faulti:0,fetch:0,few:0,file:0,filter:0,find:0,finish:0,fire:0,first:0,first_100_dav:0,fit:0,fix:0,flow:0,focu:0,follow:0,followup:0,format:0,forward:0,found:0,four:0,free:0,frequent:0,from:0,full:0,fulli:0,furnish:0,further:0,furthermor:0,get:0,getter:0,github:0,give:0,given:0,global:0,goal:0,going:0,grant:0,greater:0,halt:0,happen:0,hard:0,has:0,have:0,header:0,help:0,herd:0,here:0,herebi:0,higher:0,hoc:0,hold:0,holder:0,hook:0,how:0,howev:0,human:0,hundr:0,identif:0,identifi:0,ignor:0,imag:0,immedi:0,impact:0,implement:0,impli:0,incid:0,incident_refer:0,includ:0,inclus:0,incorrect:0,increas:0,increment:0,indefinit:0,index:0,indic:0,individu:0,infinit:0,inform:0,inherit:0,initi:0,innermost:0,input:0,insensit:0,insert:0,instanc:0,instanti:0,instead:0,insul:0,integr:0,intend:0,intern:0,interrupt:0,interv:0,introduc:0,introduct:0,invok:0,isinst:0,issu:0,item:0,item_hook:0,iter_al:0,its:0,itself:0,jane:0,jget:0,job:0,jpost:0,jput:0,json:0,just:0,keep:0,kei:0,key1:0,key2:0,keyerror:0,keyword:0,kind:0,kwarg:0,last:0,last_4:0,later:0,latest:0,lead:0,leav:0,length:0,let:0,level:0,liabil:0,liabl:0,librari:0,licens:0,lies:0,light:0,like:0,limit:0,link:0,list:0,list_al:0,littl:0,local:0,log:0,log_entri:0,logger:0,login:0,longer:0,lot:0,lower:0,made:0,mai:0,make:0,mani:0,manual:0,match:0,max_http_attempt:0,max_network_attempt:0,maximum:0,mcuserson:0,mean:0,member:0,memoiz:0,merchant:0,merg:0,messag:0,metadata:0,method:0,metric:0,might:0,minim:0,minimum:0,mirror:0,mit:0,modif:0,modifi:0,modul:0,more:0,moreov:0,morgan:0,most:0,multipl:0,must:0,name:0,namespac:0,natur:0,necess:0,need:0,nest:0,net:0,network:0,next:0,node:0,non:0,none:0,noninfring:0,nonzero:0,note:0,notebook:0,noth:0,notic:0,notification_rul:0,now:0,number:0,oauth2:0,oauth_token_her:0,obj_typ:0,object:0,object_typ:0,obtain:0,obvious:0,occur:0,odd:0,offici:0,offset:0,old:0,omit:0,one:0,onli:0,onu:0,oper:0,oppos:0,option:0,order:0,organ:0,origin:0,other:0,otherwis:0,our:0,ourselv:0,out:0,outsid:0,over:0,overal:0,overkil:0,overrid:0,own:0,pabc123:0,page:0,page_s:0,pagin:0,pair:0,parallel:0,param:0,paramet:0,parent:0,part:0,particular:0,pass:0,path:0,pattern:0,paus:0,payload:0,pdclienterror:0,pdef456:0,pdsession:0,per:0,perform:0,permiss:0,permit:0,permitted_method:0,persist:0,person:0,pertain:0,phij789:0,pi86now:0,pip:0,pjkl678:0,pkce:0,plain:0,pleas:0,plu:0,pnoexst:0,polici:0,pool:0,portion:0,posit:0,possibl:0,post:0,postprocess:0,potenti:0,power:0,practic:0,pre:0,preced:0,predict:0,preexist:0,prepare_head:0,prepend:0,prerequisit:0,presenc:0,present:0,previou:0,previous:0,print:0,prioriti:0,problem:0,process:0,profil:0,profiler_kei:0,program:0,progress:0,project:0,promote_to_admin:0,properti:0,provid:0,psomeusr:0,publish:0,pull:0,purpos:0,purview:0,put:0,pzyx321:0,queri:0,question:0,r_name:0,rais:0,raise_if_http_error:0,raise_on_error:0,random:0,rang:0,rank:0,rate:0,rather:0,rdelet:0,readabl:0,real:0,reason:0,reattempt:0,receiv:0,recommend:0,record:0,refactor:0,refer:0,reflect:0,reform:0,regress:0,reinvent:0,rel:0,reload:0,remov:0,renam:0,repeat:0,repetit:0,replac:0,report:0,repositori:0,repres:0,represent:0,reproduc:0,reqeust:0,requir:0,rescind:0,resolv:0,resource_envelop:0,resource_nam:0,resource_path:0,respect:0,respond:0,restrict:0,result:0,retriev:0,reusabl:0,rget:0,right:0,role:0,root:0,rout:0,routing_kei:0,rpost:0,rput:0,rule:0,safeguard:0,sai:0,same:0,sane:0,save:0,schema:0,scope:0,search:0,second:0,secret:0,secur:0,see:0,self:0,sell:0,send:0,send_ev:0,separ:0,seri:0,serial:0,serv:0,server:0,servic:0,session_id:0,set:0,set_api_kei:0,setter:0,sever:0,shall:0,shift:0,should:0,similar:0,similarli:0,simpl:0,simpler:0,simpli:0,simultan:0,singl:0,size:0,skip:0,slash:0,sleep:0,sleep_tim:0,sleep_timer_bas:0,small:0,softwar:0,some:0,someth:0,sort:0,sought:0,sourc:0,specif:0,specifi:0,spent:0,stagger_cooldown:0,standard:0,start:0,state:0,statu:0,status:0,status_cod:0,step:0,still:0,stop:0,str:0,string:0,strip:0,structur:0,subdomain:0,subject:0,sublicens:0,submit:0,substanti:0,success:0,successfulli:0,succinct:0,succinctli:0,suffix:0,summari:0,superpow:0,supersed:0,supplement:0,suppli:0,sure:0,synchron:0,system:0,take:0,taken:0,task:0,tear:0,tediou:0,tell:0,temporari:0,test:0,test_pdpyra:0,than:0,thei:0,them:0,themselv:0,thi:0,thing:0,third:0,thread:0,three:0,through:0,throught:0,thu:0,thunder:0,time:0,timer:0,tokenize_url_path:0,toler:0,too:0,tool:0,top:0,tort:0,total:0,total_call_count:0,total_call_tim:0,transform:0,transmit:0,treat:0,trigger:0,trunc_kei:0,trunc_token:0,truncat:0,try_decod:0,tupl:0,turn:0,two:0,type:0,typo:0,uid:0,ultim:0,unauthor:0,under:0,underli:0,undocu:0,uniformli:0,uniqu:0,unless:0,unpack:0,unspecifi:0,unsupport:0,until:0,unwrap:0,updated_incid:0,updated_us:0,upon:0,upper:0,uri:0,urllib3:0,use:0,used:0,user:0,user_id:0,user_refer:0,user_sess:0,uses:0,using:0,usual:0,valid:0,valu:0,value1:0,value2:0,variabl:0,verb:0,veri:0,version:0,versu:0,via:0,wai:0,wait:0,want:0,warn:0,wasn:0,web:0,welcom:0,well:0,went:0,were:0,what:0,wheel:0,when:0,whenev:0,where:0,wherea:0,whether:0,which:0,whichev:0,whitelist:0,whole:0,whom:0,whose:0,wise:0,within:0,without:0,word:0,work:0,would:0,wrap:0,write:0,wrong:0,yet:0,yield:0,you:0,your:0,yuck:0,zero:0},titles:["PDPYRAS: PagerDuty Python REST API Sessions"],titleterms:{"abstract":0,"function":0,Using:0,about:0,access:0,api:0,authent:0,basic:0,bodi:0,changelog:0,client:0,concept:0,contribut:0,copyright:0,creat:0,creation:0,data:0,delet:0,develop:0,disclaim:0,endpoint:0,error:0,event:0,featur:0,gener:0,guid:0,handl:0,histori:0,http:0,idempot:0,instal:0,interfac:0,iter:0,logic:0,manag:0,multi:0,oauth:0,pagerduti:0,pdpyra:0,place:0,python:0,read:0,regard:0,request:0,resourc:0,respons:0,rest:0,retri:0,session:0,special:0,support:0,token:0,updat:0,url:0,usag:0,warranti:0}}) \ No newline at end of file diff --git a/pdpyras.py b/pdpyras.py index 477b1f3..eb35f05 100644 --- a/pdpyras.py +++ b/pdpyras.py @@ -20,7 +20,7 @@ warnings.warn('Module pdpyras will no longer support Python 2.7 as of ' 'June 21, 2021.') -__version__ = '4.1.3' +__version__ = '4.1.4' # These are API resource endpoints/methods for which multi-update is supported VALID_MULTI_UPDATE_PATHS = [ diff --git a/setup.py b/setup.py index d4dde32..33cb854 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import setup, find_packages -__version__ = '4.1.3' +__version__ = '4.1.4' if __name__ == '__main__': setup(