compute-gen.go 2.3 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005350063500735008350093501035011350123501335014350153501635017350183501935020350213502235023350243502535026350273502835029350303503135032350333503435035350363503735038350393504035041350423504335044350453504635047350483504935050350513505235053350543505535056350573505835059350603506135062350633506435065350663506735068350693507035071350723507335074350753507635077350783507935080350813508235083350843508535086350873508835089350903509135092350933509435095350963509735098350993510035101351023510335104351053510635107351083510935110351113511235113351143511535116351173511835119351203512135122351233512435125351263512735128351293513035131351323513335134351353513635137351383513935140351413514235143351443514535146351473514835149351503515135152351533515435155351563515735158351593516035161351623516335164351653516635167351683516935170351713517235173351743517535176351773517835179351803518135182351833518435185351863518735188351893519035191351923519335194351953519635197351983519935200352013520235203352043520535206352073520835209352103521135212352133521435215352163521735218352193522035221352223522335224352253522635227352283522935230352313523235233352343523535236352373523835239352403524135242352433524435245352463524735248352493525035251352523525335254352553525635257352583525935260352613526235263352643526535266352673526835269352703527135272352733527435275352763527735278352793528035281352823528335284352853528635287352883528935290352913529235293352943529535296352973529835299353003530135302353033530435305353063530735308353093531035311353123531335314353153531635317353183531935320353213532235323353243532535326353273532835329353303533135332353333533435335353363533735338353393534035341353423534335344353453534635347353483534935350353513535235353353543535535356353573535835359353603536135362353633536435365353663536735368353693537035371353723537335374353753537635377353783537935380353813538235383353843538535386353873538835389353903539135392353933539435395353963539735398353993540035401354023540335404354053540635407354083540935410354113541235413354143541535416354173541835419354203542135422354233542435425354263542735428354293543035431354323543335434354353543635437354383543935440354413544235443354443544535446354473544835449354503545135452354533545435455354563545735458354593546035461354623546335464354653546635467354683546935470354713547235473354743547535476354773547835479354803548135482354833548435485354863548735488354893549035491354923549335494354953549635497354983549935500355013550235503355043550535506355073550835509355103551135512355133551435515355163551735518355193552035521355223552335524355253552635527355283552935530355313553235533355343553535536355373553835539355403554135542355433554435545355463554735548355493555035551355523555335554355553555635557355583555935560355613556235563355643556535566355673556835569355703557135572355733557435575355763557735578355793558035581355823558335584355853558635587355883558935590355913559235593355943559535596355973559835599356003560135602356033560435605356063560735608356093561035611356123561335614356153561635617356183561935620356213562235623356243562535626356273562835629356303563135632356333563435635356363563735638356393564035641356423564335644356453564635647356483564935650356513565235653356543565535656356573565835659356603566135662356633566435665356663566735668356693567035671356723567335674356753567635677356783567935680356813568235683356843568535686356873568835689356903569135692356933569435695356963569735698356993570035701357023570335704357053570635707357083570935710357113571235713357143571535716357173571835719357203572135722357233572435725357263572735728357293573035731357323573335734357353573635737357383573935740357413574235743357443574535746357473574835749357503575135752357533575435755357563575735758357593576035761357623576335764357653576635767357683576935770357713577235773357743577535776357773577835779357803578135782357833578435785357863578735788357893579035791357923579335794357953579635797357983579935800358013580235803358043580535806358073580835809358103581135812358133581435815358163581735818358193582035821358223582335824358253582635827358283582935830358313583235833358343583535836358373583835839358403584135842358433584435845358463584735848358493585035851358523585335854358553585635857358583585935860358613586235863358643586535866358673586835869358703587135872358733587435875358763587735878358793588035881358823588335884358853588635887358883588935890358913589235893358943589535896358973589835899359003590135902359033590435905359063590735908359093591035911359123591335914359153591635917359183591935920359213592235923359243592535926359273592835929359303593135932359333593435935359363593735938359393594035941359423594335944359453594635947359483594935950359513595235953359543595535956359573595835959359603596135962359633596435965359663596735968359693597035971359723597335974359753597635977359783597935980359813598235983359843598535986359873598835989359903599135992359933599435995359963599735998359993600036001360023600336004360053600636007360083600936010360113601236013360143601536016360173601836019360203602136022360233602436025360263602736028360293603036031360323603336034360353603636037360383603936040360413604236043360443604536046360473604836049360503605136052360533605436055360563605736058360593606036061360623606336064360653606636067360683606936070360713607236073360743607536076360773607836079360803608136082360833608436085360863608736088360893609036091360923609336094360953609636097360983609936100361013610236103361043610536106361073610836109361103611136112361133611436115361163611736118361193612036121361223612336124361253612636127361283612936130361313613236133361343613536136361373613836139361403614136142361433614436145361463614736148361493615036151361523615336154361553615636157361583615936160361613616236163361643616536166361673616836169361703617136172361733617436175361763617736178361793618036181361823618336184361853618636187361883618936190361913619236193361943619536196361973619836199362003620136202362033620436205362063620736208362093621036211362123621336214362153621636217362183621936220362213622236223362243622536226362273622836229362303623136232362333623436235362363623736238362393624036241362423624336244362453624636247362483624936250362513625236253362543625536256362573625836259362603626136262362633626436265362663626736268362693627036271362723627336274362753627636277362783627936280362813628236283362843628536286362873628836289362903629136292362933629436295362963629736298362993630036301363023630336304363053630636307363083630936310363113631236313363143631536316363173631836319363203632136322363233632436325363263632736328363293633036331363323633336334363353633636337363383633936340363413634236343363443634536346363473634836349363503635136352363533635436355363563635736358363593636036361363623636336364363653636636367363683636936370363713637236373363743637536376363773637836379363803638136382363833638436385363863638736388363893639036391363923639336394363953639636397363983639936400364013640236403364043640536406364073640836409364103641136412364133641436415364163641736418364193642036421364223642336424364253642636427364283642936430364313643236433364343643536436364373643836439364403644136442364433644436445364463644736448364493645036451364523645336454364553645636457364583645936460364613646236463364643646536466364673646836469364703647136472364733647436475364763647736478364793648036481364823648336484364853648636487364883648936490364913649236493364943649536496364973649836499365003650136502365033650436505365063650736508365093651036511365123651336514365153651636517365183651936520365213652236523365243652536526365273652836529365303653136532365333653436535365363653736538365393654036541365423654336544365453654636547365483654936550365513655236553365543655536556365573655836559365603656136562365633656436565365663656736568365693657036571365723657336574365753657636577365783657936580365813658236583365843658536586365873658836589365903659136592365933659436595365963659736598365993660036601366023660336604366053660636607366083660936610366113661236613366143661536616366173661836619366203662136622366233662436625366263662736628366293663036631366323663336634366353663636637366383663936640366413664236643366443664536646366473664836649366503665136652366533665436655366563665736658366593666036661366623666336664366653666636667366683666936670366713667236673366743667536676366773667836679366803668136682366833668436685366863668736688366893669036691366923669336694366953669636697366983669936700367013670236703367043670536706367073670836709367103671136712367133671436715367163671736718367193672036721367223672336724367253672636727367283672936730367313673236733367343673536736367373673836739367403674136742367433674436745367463674736748367493675036751367523675336754367553675636757367583675936760367613676236763367643676536766367673676836769367703677136772367733677436775367763677736778367793678036781367823678336784367853678636787367883678936790367913679236793367943679536796367973679836799368003680136802368033680436805368063680736808368093681036811368123681336814368153681636817368183681936820368213682236823368243682536826368273682836829368303683136832368333683436835368363683736838368393684036841368423684336844368453684636847368483684936850368513685236853368543685536856368573685836859368603686136862368633686436865368663686736868368693687036871368723687336874368753687636877368783687936880368813688236883368843688536886368873688836889368903689136892368933689436895368963689736898368993690036901369023690336904369053690636907369083690936910369113691236913369143691536916369173691836919369203692136922369233692436925369263692736928369293693036931369323693336934369353693636937369383693936940369413694236943369443694536946369473694836949369503695136952369533695436955369563695736958369593696036961369623696336964369653696636967369683696936970369713697236973369743697536976369773697836979369803698136982369833698436985369863698736988369893699036991369923699336994369953699636997369983699937000370013700237003370043700537006370073700837009370103701137012370133701437015370163701737018370193702037021370223702337024370253702637027370283702937030370313703237033370343703537036370373703837039370403704137042370433704437045370463704737048370493705037051370523705337054370553705637057370583705937060370613706237063370643706537066370673706837069370703707137072370733707437075370763707737078370793708037081370823708337084370853708637087370883708937090370913709237093370943709537096370973709837099371003710137102371033710437105371063710737108371093711037111371123711337114371153711637117371183711937120371213712237123371243712537126371273712837129371303713137132371333713437135371363713737138371393714037141371423714337144371453714637147371483714937150371513715237153371543715537156371573715837159371603716137162371633716437165371663716737168371693717037171371723717337174371753717637177371783717937180371813718237183371843718537186371873718837189371903719137192371933719437195371963719737198371993720037201372023720337204372053720637207372083720937210372113721237213372143721537216372173721837219372203722137222372233722437225372263722737228372293723037231372323723337234372353723637237372383723937240372413724237243372443724537246372473724837249372503725137252372533725437255372563725737258372593726037261372623726337264372653726637267372683726937270372713727237273372743727537276372773727837279372803728137282372833728437285372863728737288372893729037291372923729337294372953729637297372983729937300373013730237303373043730537306373073730837309373103731137312373133731437315373163731737318373193732037321373223732337324373253732637327373283732937330373313733237333373343733537336373373733837339373403734137342373433734437345373463734737348373493735037351373523735337354373553735637357373583735937360373613736237363373643736537366373673736837369373703737137372373733737437375373763737737378373793738037381373823738337384373853738637387373883738937390373913739237393373943739537396373973739837399374003740137402374033740437405374063740737408374093741037411374123741337414374153741637417374183741937420374213742237423374243742537426374273742837429374303743137432374333743437435374363743737438374393744037441374423744337444374453744637447374483744937450374513745237453374543745537456374573745837459374603746137462374633746437465374663746737468374693747037471374723747337474374753747637477374783747937480374813748237483374843748537486374873748837489374903749137492374933749437495374963749737498374993750037501375023750337504375053750637507375083750937510375113751237513375143751537516375173751837519375203752137522375233752437525375263752737528375293753037531375323753337534375353753637537375383753937540375413754237543375443754537546375473754837549375503755137552375533755437555375563755737558375593756037561375623756337564375653756637567375683756937570375713757237573375743757537576375773757837579375803758137582375833758437585375863758737588375893759037591375923759337594375953759637597375983759937600376013760237603376043760537606376073760837609376103761137612376133761437615376163761737618376193762037621376223762337624376253762637627376283762937630376313763237633376343763537636376373763837639376403764137642376433764437645376463764737648376493765037651376523765337654376553765637657376583765937660376613766237663376643766537666376673766837669376703767137672376733767437675376763767737678376793768037681376823768337684376853768637687376883768937690376913769237693376943769537696376973769837699377003770137702377033770437705377063770737708377093771037711377123771337714377153771637717377183771937720377213772237723377243772537726377273772837729377303773137732377333773437735377363773737738377393774037741377423774337744377453774637747377483774937750377513775237753377543775537756377573775837759377603776137762377633776437765377663776737768377693777037771377723777337774377753777637777377783777937780377813778237783377843778537786377873778837789377903779137792377933779437795377963779737798377993780037801378023780337804378053780637807378083780937810378113781237813378143781537816378173781837819378203782137822378233782437825378263782737828378293783037831378323783337834378353783637837378383783937840378413784237843378443784537846378473784837849378503785137852378533785437855378563785737858378593786037861378623786337864378653786637867378683786937870378713787237873378743787537876378773787837879378803788137882378833788437885378863788737888378893789037891378923789337894378953789637897378983789937900379013790237903379043790537906379073790837909379103791137912379133791437915379163791737918379193792037921379223792337924379253792637927379283792937930379313793237933379343793537936379373793837939379403794137942379433794437945379463794737948379493795037951379523795337954379553795637957379583795937960379613796237963379643796537966379673796837969379703797137972379733797437975379763797737978379793798037981379823798337984379853798637987379883798937990379913799237993379943799537996379973799837999380003800138002380033800438005380063800738008380093801038011380123801338014380153801638017380183801938020380213802238023380243802538026380273802838029380303803138032380333803438035380363803738038380393804038041380423804338044380453804638047380483804938050380513805238053380543805538056380573805838059380603806138062380633806438065380663806738068380693807038071380723807338074380753807638077380783807938080380813808238083380843808538086380873808838089380903809138092380933809438095380963809738098380993810038101381023810338104381053810638107381083810938110381113811238113381143811538116381173811838119381203812138122381233812438125381263812738128381293813038131381323813338134381353813638137381383813938140381413814238143381443814538146381473814838149381503815138152381533815438155381563815738158381593816038161381623816338164381653816638167381683816938170381713817238173381743817538176381773817838179381803818138182381833818438185381863818738188381893819038191381923819338194381953819638197381983819938200382013820238203382043820538206382073820838209382103821138212382133821438215382163821738218382193822038221382223822338224382253822638227382283822938230382313823238233382343823538236382373823838239382403824138242382433824438245382463824738248382493825038251382523825338254382553825638257382583825938260382613826238263382643826538266382673826838269382703827138272382733827438275382763827738278382793828038281382823828338284382853828638287382883828938290382913829238293382943829538296382973829838299383003830138302383033830438305383063830738308383093831038311383123831338314383153831638317383183831938320383213832238323383243832538326383273832838329383303833138332383333833438335383363833738338383393834038341383423834338344383453834638347383483834938350383513835238353383543835538356383573835838359383603836138362383633836438365383663836738368383693837038371383723837338374383753837638377383783837938380383813838238383383843838538386383873838838389383903839138392383933839438395383963839738398383993840038401384023840338404384053840638407384083840938410384113841238413384143841538416384173841838419384203842138422384233842438425384263842738428384293843038431384323843338434384353843638437384383843938440384413844238443384443844538446384473844838449384503845138452384533845438455384563845738458384593846038461384623846338464384653846638467384683846938470384713847238473384743847538476384773847838479384803848138482384833848438485384863848738488384893849038491384923849338494384953849638497384983849938500385013850238503385043850538506385073850838509385103851138512385133851438515385163851738518385193852038521385223852338524385253852638527385283852938530385313853238533385343853538536385373853838539385403854138542385433854438545385463854738548385493855038551385523855338554385553855638557385583855938560385613856238563385643856538566385673856838569385703857138572385733857438575385763857738578385793858038581385823858338584385853858638587385883858938590385913859238593385943859538596385973859838599386003860138602386033860438605386063860738608386093861038611386123861338614386153861638617386183861938620386213862238623386243862538626386273862838629386303863138632386333863438635386363863738638386393864038641386423864338644386453864638647386483864938650386513865238653386543865538656386573865838659386603866138662386633866438665386663866738668386693867038671386723867338674386753867638677386783867938680386813868238683386843868538686386873868838689386903869138692386933869438695386963869738698386993870038701387023870338704387053870638707387083870938710387113871238713387143871538716387173871838719387203872138722387233872438725387263872738728387293873038731387323873338734387353873638737387383873938740387413874238743387443874538746387473874838749387503875138752387533875438755387563875738758387593876038761387623876338764387653876638767387683876938770387713877238773387743877538776387773877838779387803878138782387833878438785387863878738788387893879038791387923879338794387953879638797387983879938800388013880238803388043880538806388073880838809388103881138812388133881438815388163881738818388193882038821388223882338824388253882638827388283882938830388313883238833388343883538836388373883838839388403884138842388433884438845388463884738848388493885038851388523885338854388553885638857388583885938860388613886238863388643886538866388673886838869388703887138872388733887438875388763887738878388793888038881388823888338884388853888638887388883888938890388913889238893388943889538896388973889838899389003890138902389033890438905389063890738908389093891038911389123891338914389153891638917389183891938920389213892238923389243892538926389273892838929389303893138932389333893438935389363893738938389393894038941389423894338944389453894638947389483894938950389513895238953389543895538956389573895838959389603896138962389633896438965389663896738968389693897038971389723897338974389753897638977389783897938980389813898238983389843898538986389873898838989389903899138992389933899438995389963899738998389993900039001390023900339004390053900639007390083900939010390113901239013390143901539016390173901839019390203902139022390233902439025390263902739028390293903039031390323903339034390353903639037390383903939040390413904239043390443904539046390473904839049390503905139052390533905439055390563905739058390593906039061390623906339064390653906639067390683906939070390713907239073390743907539076390773907839079390803908139082390833908439085390863908739088390893909039091390923909339094390953909639097390983909939100391013910239103391043910539106391073910839109391103911139112391133911439115391163911739118391193912039121391223912339124391253912639127391283912939130391313913239133391343913539136391373913839139391403914139142391433914439145391463914739148391493915039151391523915339154391553915639157391583915939160391613916239163391643916539166391673916839169391703917139172391733917439175391763917739178391793918039181391823918339184391853918639187391883918939190391913919239193391943919539196391973919839199392003920139202392033920439205392063920739208392093921039211392123921339214392153921639217392183921939220392213922239223392243922539226392273922839229392303923139232392333923439235392363923739238392393924039241392423924339244392453924639247392483924939250392513925239253392543925539256392573925839259392603926139262392633926439265392663926739268392693927039271392723927339274392753927639277392783927939280392813928239283392843928539286392873928839289392903929139292392933929439295392963929739298392993930039301393023930339304393053930639307393083930939310393113931239313393143931539316393173931839319393203932139322393233932439325393263932739328393293933039331393323933339334393353933639337393383933939340393413934239343393443934539346393473934839349393503935139352393533935439355393563935739358393593936039361393623936339364393653936639367393683936939370393713937239373393743937539376393773937839379393803938139382393833938439385393863938739388393893939039391393923939339394393953939639397393983939939400394013940239403394043940539406394073940839409394103941139412394133941439415394163941739418394193942039421394223942339424394253942639427394283942939430394313943239433394343943539436394373943839439394403944139442394433944439445394463944739448394493945039451394523945339454394553945639457394583945939460394613946239463394643946539466394673946839469394703947139472394733947439475394763947739478394793948039481394823948339484394853948639487394883948939490394913949239493394943949539496394973949839499395003950139502395033950439505395063950739508395093951039511395123951339514395153951639517395183951939520395213952239523395243952539526395273952839529395303953139532395333953439535395363953739538395393954039541395423954339544395453954639547395483954939550395513955239553395543955539556395573955839559395603956139562395633956439565395663956739568395693957039571395723957339574395753957639577395783957939580395813958239583395843958539586395873958839589395903959139592395933959439595395963959739598395993960039601396023960339604396053960639607396083960939610396113961239613396143961539616396173961839619396203962139622396233962439625396263962739628396293963039631396323963339634396353963639637396383963939640396413964239643396443964539646396473964839649396503965139652396533965439655396563965739658396593966039661396623966339664396653966639667396683966939670396713967239673396743967539676396773967839679396803968139682396833968439685396863968739688396893969039691396923969339694396953969639697396983969939700397013970239703397043970539706397073970839709397103971139712397133971439715397163971739718397193972039721397223972339724397253972639727397283972939730397313973239733397343973539736397373973839739397403974139742397433974439745397463974739748397493975039751397523975339754397553975639757397583975939760397613976239763397643976539766397673976839769397703977139772397733977439775397763977739778397793978039781397823978339784397853978639787397883978939790397913979239793397943979539796397973979839799398003980139802398033980439805398063980739808398093981039811398123981339814398153981639817398183981939820398213982239823398243982539826398273982839829398303983139832398333983439835398363983739838398393984039841398423984339844398453984639847398483984939850398513985239853398543985539856398573985839859398603986139862398633986439865398663986739868398693987039871398723987339874398753987639877398783987939880398813988239883398843988539886398873988839889398903989139892398933989439895398963989739898398993990039901399023990339904399053990639907399083990939910399113991239913399143991539916399173991839919399203992139922399233992439925399263992739928399293993039931399323993339934399353993639937399383993939940399413994239943399443994539946399473994839949399503995139952399533995439955399563995739958399593996039961399623996339964399653996639967399683996939970399713997239973399743997539976399773997839979399803998139982399833998439985399863998739988399893999039991399923999339994399953999639997399983999940000400014000240003400044000540006400074000840009400104001140012400134001440015400164001740018400194002040021400224002340024400254002640027400284002940030400314003240033400344003540036400374003840039400404004140042400434004440045400464004740048400494005040051400524005340054400554005640057400584005940060400614006240063400644006540066400674006840069400704007140072400734007440075400764007740078400794008040081400824008340084400854008640087400884008940090400914009240093400944009540096400974009840099401004010140102401034010440105401064010740108401094011040111401124011340114401154011640117401184011940120401214012240123401244012540126401274012840129401304013140132401334013440135401364013740138401394014040141401424014340144401454014640147401484014940150401514015240153401544015540156401574015840159401604016140162401634016440165401664016740168401694017040171401724017340174401754017640177401784017940180401814018240183401844018540186401874018840189401904019140192401934019440195401964019740198401994020040201402024020340204402054020640207402084020940210402114021240213402144021540216402174021840219402204022140222402234022440225402264022740228402294023040231402324023340234402354023640237402384023940240402414024240243402444024540246402474024840249402504025140252402534025440255402564025740258402594026040261402624026340264402654026640267402684026940270402714027240273402744027540276402774027840279402804028140282402834028440285402864028740288402894029040291402924029340294402954029640297402984029940300403014030240303403044030540306403074030840309403104031140312403134031440315403164031740318403194032040321403224032340324403254032640327403284032940330403314033240333403344033540336403374033840339403404034140342403434034440345403464034740348403494035040351403524035340354403554035640357403584035940360403614036240363403644036540366403674036840369403704037140372403734037440375403764037740378403794038040381403824038340384403854038640387403884038940390403914039240393403944039540396403974039840399404004040140402404034040440405404064040740408404094041040411404124041340414404154041640417404184041940420404214042240423404244042540426404274042840429404304043140432404334043440435404364043740438404394044040441404424044340444404454044640447404484044940450404514045240453404544045540456404574045840459404604046140462404634046440465404664046740468404694047040471404724047340474404754047640477404784047940480404814048240483404844048540486404874048840489404904049140492404934049440495404964049740498404994050040501405024050340504405054050640507405084050940510405114051240513405144051540516405174051840519405204052140522405234052440525405264052740528405294053040531405324053340534405354053640537405384053940540405414054240543405444054540546405474054840549405504055140552405534055440555405564055740558405594056040561405624056340564405654056640567405684056940570405714057240573405744057540576405774057840579405804058140582405834058440585405864058740588405894059040591405924059340594405954059640597405984059940600406014060240603406044060540606406074060840609406104061140612406134061440615406164061740618406194062040621406224062340624406254062640627406284062940630406314063240633406344063540636406374063840639406404064140642406434064440645406464064740648406494065040651406524065340654406554065640657406584065940660406614066240663406644066540666406674066840669406704067140672406734067440675406764067740678406794068040681406824068340684406854068640687406884068940690406914069240693406944069540696406974069840699407004070140702407034070440705407064070740708407094071040711407124071340714407154071640717407184071940720407214072240723407244072540726407274072840729407304073140732407334073440735407364073740738407394074040741407424074340744407454074640747407484074940750407514075240753407544075540756407574075840759407604076140762407634076440765407664076740768407694077040771407724077340774407754077640777407784077940780407814078240783407844078540786407874078840789407904079140792407934079440795407964079740798407994080040801408024080340804408054080640807408084080940810408114081240813408144081540816408174081840819408204082140822408234082440825408264082740828408294083040831408324083340834408354083640837408384083940840408414084240843408444084540846408474084840849408504085140852408534085440855408564085740858408594086040861408624086340864408654086640867408684086940870408714087240873408744087540876408774087840879408804088140882408834088440885408864088740888408894089040891408924089340894408954089640897408984089940900409014090240903409044090540906409074090840909409104091140912409134091440915409164091740918409194092040921409224092340924409254092640927409284092940930409314093240933409344093540936409374093840939409404094140942409434094440945409464094740948409494095040951409524095340954409554095640957409584095940960409614096240963409644096540966409674096840969409704097140972409734097440975409764097740978409794098040981409824098340984409854098640987409884098940990409914099240993409944099540996409974099840999410004100141002410034100441005410064100741008410094101041011410124101341014410154101641017410184101941020410214102241023410244102541026410274102841029410304103141032410334103441035410364103741038410394104041041410424104341044410454104641047410484104941050410514105241053410544105541056410574105841059410604106141062410634106441065410664106741068410694107041071410724107341074410754107641077410784107941080410814108241083410844108541086410874108841089410904109141092410934109441095410964109741098410994110041101411024110341104411054110641107411084110941110411114111241113411144111541116411174111841119411204112141122411234112441125411264112741128411294113041131411324113341134411354113641137411384113941140411414114241143411444114541146411474114841149411504115141152411534115441155411564115741158411594116041161411624116341164411654116641167411684116941170411714117241173411744117541176411774117841179411804118141182411834118441185411864118741188411894119041191411924119341194411954119641197411984119941200412014120241203412044120541206412074120841209412104121141212412134121441215412164121741218412194122041221412224122341224412254122641227412284122941230412314123241233412344123541236412374123841239412404124141242412434124441245412464124741248412494125041251412524125341254412554125641257412584125941260412614126241263412644126541266412674126841269412704127141272412734127441275412764127741278412794128041281412824128341284412854128641287412884128941290412914129241293412944129541296412974129841299413004130141302413034130441305413064130741308413094131041311413124131341314413154131641317413184131941320413214132241323413244132541326413274132841329413304133141332413334133441335413364133741338413394134041341413424134341344413454134641347413484134941350413514135241353413544135541356413574135841359413604136141362413634136441365413664136741368413694137041371413724137341374413754137641377413784137941380413814138241383413844138541386413874138841389413904139141392413934139441395413964139741398413994140041401414024140341404414054140641407414084140941410414114141241413414144141541416414174141841419414204142141422414234142441425414264142741428414294143041431414324143341434414354143641437414384143941440414414144241443414444144541446414474144841449414504145141452414534145441455414564145741458414594146041461414624146341464414654146641467414684146941470414714147241473414744147541476414774147841479414804148141482414834148441485414864148741488414894149041491414924149341494414954149641497414984149941500415014150241503415044150541506415074150841509415104151141512415134151441515415164151741518415194152041521415224152341524415254152641527415284152941530415314153241533415344153541536415374153841539415404154141542415434154441545415464154741548415494155041551415524155341554415554155641557415584155941560415614156241563415644156541566415674156841569415704157141572415734157441575415764157741578415794158041581415824158341584415854158641587415884158941590415914159241593415944159541596415974159841599416004160141602416034160441605416064160741608416094161041611416124161341614416154161641617416184161941620416214162241623416244162541626416274162841629416304163141632416334163441635416364163741638416394164041641416424164341644416454164641647416484164941650416514165241653416544165541656416574165841659416604166141662416634166441665416664166741668416694167041671416724167341674416754167641677416784167941680416814168241683416844168541686416874168841689416904169141692416934169441695416964169741698416994170041701417024170341704417054170641707417084170941710417114171241713417144171541716417174171841719417204172141722417234172441725417264172741728417294173041731417324173341734417354173641737417384173941740417414174241743417444174541746417474174841749417504175141752417534175441755417564175741758417594176041761417624176341764417654176641767417684176941770417714177241773417744177541776417774177841779417804178141782417834178441785417864178741788417894179041791417924179341794417954179641797417984179941800418014180241803418044180541806418074180841809418104181141812418134181441815418164181741818418194182041821418224182341824418254182641827418284182941830418314183241833418344183541836418374183841839418404184141842418434184441845418464184741848418494185041851418524185341854418554185641857418584185941860418614186241863418644186541866418674186841869418704187141872418734187441875418764187741878418794188041881418824188341884418854188641887418884188941890418914189241893418944189541896418974189841899419004190141902419034190441905419064190741908419094191041911419124191341914419154191641917419184191941920419214192241923419244192541926419274192841929419304193141932419334193441935419364193741938419394194041941419424194341944419454194641947419484194941950419514195241953419544195541956419574195841959419604196141962419634196441965419664196741968419694197041971419724197341974419754197641977419784197941980419814198241983419844198541986419874198841989419904199141992419934199441995419964199741998419994200042001420024200342004420054200642007420084200942010420114201242013420144201542016420174201842019420204202142022420234202442025420264202742028420294203042031420324203342034420354203642037420384203942040420414204242043420444204542046420474204842049420504205142052420534205442055420564205742058420594206042061420624206342064420654206642067420684206942070420714207242073420744207542076420774207842079420804208142082420834208442085420864208742088420894209042091420924209342094420954209642097420984209942100421014210242103421044210542106421074210842109421104211142112421134211442115421164211742118421194212042121421224212342124421254212642127421284212942130421314213242133421344213542136421374213842139421404214142142421434214442145421464214742148421494215042151421524215342154421554215642157421584215942160421614216242163421644216542166421674216842169421704217142172421734217442175421764217742178421794218042181421824218342184421854218642187421884218942190421914219242193421944219542196421974219842199422004220142202422034220442205422064220742208422094221042211422124221342214422154221642217422184221942220422214222242223422244222542226422274222842229422304223142232422334223442235422364223742238422394224042241422424224342244422454224642247422484224942250422514225242253422544225542256422574225842259422604226142262422634226442265422664226742268422694227042271422724227342274422754227642277422784227942280422814228242283422844228542286422874228842289422904229142292422934229442295422964229742298422994230042301423024230342304423054230642307423084230942310423114231242313423144231542316423174231842319423204232142322423234232442325423264232742328423294233042331423324233342334423354233642337423384233942340423414234242343423444234542346423474234842349423504235142352423534235442355423564235742358423594236042361423624236342364423654236642367423684236942370423714237242373423744237542376423774237842379423804238142382423834238442385423864238742388423894239042391423924239342394423954239642397423984239942400424014240242403424044240542406424074240842409424104241142412424134241442415424164241742418424194242042421424224242342424424254242642427424284242942430424314243242433424344243542436424374243842439424404244142442424434244442445424464244742448424494245042451424524245342454424554245642457424584245942460424614246242463424644246542466424674246842469424704247142472424734247442475424764247742478424794248042481424824248342484424854248642487424884248942490424914249242493424944249542496424974249842499425004250142502425034250442505425064250742508425094251042511425124251342514425154251642517425184251942520425214252242523425244252542526425274252842529425304253142532425334253442535425364253742538425394254042541425424254342544425454254642547425484254942550425514255242553425544255542556425574255842559425604256142562425634256442565425664256742568425694257042571425724257342574425754257642577425784257942580425814258242583425844258542586425874258842589425904259142592425934259442595425964259742598425994260042601426024260342604426054260642607426084260942610426114261242613426144261542616426174261842619426204262142622426234262442625426264262742628426294263042631426324263342634426354263642637426384263942640426414264242643426444264542646426474264842649426504265142652426534265442655426564265742658426594266042661426624266342664426654266642667426684266942670426714267242673426744267542676426774267842679426804268142682426834268442685426864268742688426894269042691426924269342694426954269642697426984269942700427014270242703427044270542706427074270842709427104271142712427134271442715427164271742718427194272042721427224272342724427254272642727427284272942730427314273242733427344273542736427374273842739427404274142742427434274442745427464274742748427494275042751427524275342754427554275642757427584275942760427614276242763427644276542766427674276842769427704277142772427734277442775427764277742778427794278042781427824278342784427854278642787427884278942790427914279242793427944279542796427974279842799428004280142802428034280442805428064280742808428094281042811428124281342814428154281642817428184281942820428214282242823428244282542826428274282842829428304283142832428334283442835428364283742838428394284042841428424284342844428454284642847428484284942850428514285242853428544285542856428574285842859428604286142862428634286442865428664286742868428694287042871428724287342874428754287642877428784287942880428814288242883428844288542886428874288842889428904289142892428934289442895428964289742898428994290042901429024290342904429054290642907429084290942910429114291242913429144291542916429174291842919429204292142922429234292442925429264292742928429294293042931429324293342934429354293642937429384293942940429414294242943429444294542946429474294842949429504295142952429534295442955429564295742958429594296042961429624296342964429654296642967429684296942970429714297242973429744297542976429774297842979429804298142982429834298442985429864298742988429894299042991429924299342994429954299642997429984299943000430014300243003430044300543006430074300843009430104301143012430134301443015430164301743018430194302043021430224302343024430254302643027430284302943030430314303243033430344303543036430374303843039430404304143042430434304443045430464304743048430494305043051430524305343054430554305643057430584305943060430614306243063430644306543066430674306843069430704307143072430734307443075430764307743078430794308043081430824308343084430854308643087430884308943090430914309243093430944309543096430974309843099431004310143102431034310443105431064310743108431094311043111431124311343114431154311643117431184311943120431214312243123431244312543126431274312843129431304313143132431334313443135431364313743138431394314043141431424314343144431454314643147431484314943150431514315243153431544315543156431574315843159431604316143162431634316443165431664316743168431694317043171431724317343174431754317643177431784317943180431814318243183431844318543186431874318843189431904319143192431934319443195431964319743198431994320043201432024320343204432054320643207432084320943210432114321243213432144321543216432174321843219432204322143222432234322443225432264322743228432294323043231432324323343234432354323643237432384323943240432414324243243432444324543246432474324843249432504325143252432534325443255432564325743258432594326043261432624326343264432654326643267432684326943270432714327243273432744327543276432774327843279432804328143282432834328443285432864328743288432894329043291432924329343294432954329643297432984329943300433014330243303433044330543306433074330843309433104331143312433134331443315433164331743318433194332043321433224332343324433254332643327433284332943330433314333243333433344333543336433374333843339433404334143342433434334443345433464334743348433494335043351433524335343354433554335643357433584335943360433614336243363433644336543366433674336843369433704337143372433734337443375433764337743378433794338043381433824338343384433854338643387433884338943390433914339243393433944339543396433974339843399434004340143402434034340443405434064340743408434094341043411434124341343414434154341643417434184341943420434214342243423434244342543426434274342843429434304343143432434334343443435434364343743438434394344043441434424344343444434454344643447434484344943450434514345243453434544345543456434574345843459434604346143462434634346443465434664346743468434694347043471434724347343474434754347643477434784347943480434814348243483434844348543486434874348843489434904349143492434934349443495434964349743498434994350043501435024350343504435054350643507435084350943510435114351243513435144351543516435174351843519435204352143522435234352443525435264352743528435294353043531435324353343534435354353643537435384353943540435414354243543435444354543546435474354843549435504355143552435534355443555435564355743558435594356043561435624356343564435654356643567435684356943570435714357243573435744357543576435774357843579435804358143582435834358443585435864358743588435894359043591435924359343594435954359643597435984359943600436014360243603436044360543606436074360843609436104361143612436134361443615436164361743618436194362043621436224362343624436254362643627436284362943630436314363243633436344363543636436374363843639436404364143642436434364443645436464364743648436494365043651436524365343654436554365643657436584365943660436614366243663436644366543666436674366843669436704367143672436734367443675436764367743678436794368043681436824368343684436854368643687436884368943690436914369243693436944369543696436974369843699437004370143702437034370443705437064370743708437094371043711437124371343714437154371643717437184371943720437214372243723437244372543726437274372843729437304373143732437334373443735437364373743738437394374043741437424374343744437454374643747437484374943750437514375243753437544375543756437574375843759437604376143762437634376443765437664376743768437694377043771437724377343774437754377643777437784377943780437814378243783437844378543786437874378843789437904379143792437934379443795437964379743798437994380043801438024380343804438054380643807438084380943810438114381243813438144381543816438174381843819438204382143822438234382443825438264382743828438294383043831438324383343834438354383643837438384383943840438414384243843438444384543846438474384843849438504385143852438534385443855438564385743858438594386043861438624386343864438654386643867438684386943870438714387243873438744387543876438774387843879438804388143882438834388443885438864388743888438894389043891438924389343894438954389643897438984389943900439014390243903439044390543906439074390843909439104391143912439134391443915439164391743918439194392043921439224392343924439254392643927439284392943930439314393243933439344393543936439374393843939439404394143942439434394443945439464394743948439494395043951439524395343954439554395643957439584395943960439614396243963439644396543966439674396843969439704397143972439734397443975439764397743978439794398043981439824398343984439854398643987439884398943990439914399243993439944399543996439974399843999440004400144002440034400444005440064400744008440094401044011440124401344014440154401644017440184401944020440214402244023440244402544026440274402844029440304403144032440334403444035440364403744038440394404044041440424404344044440454404644047440484404944050440514405244053440544405544056440574405844059440604406144062440634406444065440664406744068440694407044071440724407344074440754407644077440784407944080440814408244083440844408544086440874408844089440904409144092440934409444095440964409744098440994410044101441024410344104441054410644107441084410944110441114411244113441144411544116441174411844119441204412144122441234412444125441264412744128441294413044131441324413344134441354413644137441384413944140441414414244143441444414544146441474414844149441504415144152441534415444155441564415744158441594416044161441624416344164441654416644167441684416944170441714417244173441744417544176441774417844179441804418144182441834418444185441864418744188441894419044191441924419344194441954419644197441984419944200442014420244203442044420544206442074420844209442104421144212442134421444215442164421744218442194422044221442224422344224442254422644227442284422944230442314423244233442344423544236442374423844239442404424144242442434424444245442464424744248442494425044251442524425344254442554425644257442584425944260442614426244263442644426544266442674426844269442704427144272442734427444275442764427744278442794428044281442824428344284442854428644287442884428944290442914429244293442944429544296442974429844299443004430144302443034430444305443064430744308443094431044311443124431344314443154431644317443184431944320443214432244323443244432544326443274432844329443304433144332443334433444335443364433744338443394434044341443424434344344443454434644347443484434944350443514435244353443544435544356443574435844359443604436144362443634436444365443664436744368443694437044371443724437344374443754437644377443784437944380443814438244383443844438544386443874438844389443904439144392443934439444395443964439744398443994440044401444024440344404444054440644407444084440944410444114441244413444144441544416444174441844419444204442144422444234442444425444264442744428444294443044431444324443344434444354443644437444384443944440444414444244443444444444544446444474444844449444504445144452444534445444455444564445744458444594446044461444624446344464444654446644467444684446944470444714447244473444744447544476444774447844479444804448144482444834448444485444864448744488444894449044491444924449344494444954449644497444984449944500445014450244503445044450544506445074450844509445104451144512445134451444515445164451744518445194452044521445224452344524445254452644527445284452944530445314453244533445344453544536445374453844539445404454144542445434454444545445464454744548445494455044551445524455344554445554455644557445584455944560445614456244563445644456544566445674456844569445704457144572445734457444575445764457744578445794458044581445824458344584445854458644587445884458944590445914459244593445944459544596445974459844599446004460144602446034460444605446064460744608446094461044611446124461344614446154461644617446184461944620446214462244623446244462544626446274462844629446304463144632446334463444635446364463744638446394464044641446424464344644446454464644647446484464944650446514465244653446544465544656446574465844659446604466144662446634466444665446664466744668446694467044671446724467344674446754467644677446784467944680446814468244683446844468544686446874468844689446904469144692446934469444695446964469744698446994470044701447024470344704447054470644707447084470944710447114471244713447144471544716447174471844719447204472144722447234472444725447264472744728447294473044731447324473344734447354473644737447384473944740447414474244743447444474544746447474474844749447504475144752447534475444755447564475744758447594476044761447624476344764447654476644767447684476944770447714477244773447744477544776447774477844779447804478144782447834478444785447864478744788447894479044791447924479344794447954479644797447984479944800448014480244803448044480544806448074480844809448104481144812448134481444815448164481744818448194482044821448224482344824448254482644827448284482944830448314483244833448344483544836448374483844839448404484144842448434484444845448464484744848448494485044851448524485344854448554485644857448584485944860448614486244863448644486544866448674486844869448704487144872448734487444875448764487744878448794488044881448824488344884448854488644887448884488944890448914489244893448944489544896448974489844899449004490144902449034490444905449064490744908449094491044911449124491344914449154491644917449184491944920449214492244923449244492544926449274492844929449304493144932449334493444935449364493744938449394494044941449424494344944449454494644947449484494944950449514495244953449544495544956449574495844959449604496144962449634496444965449664496744968449694497044971449724497344974449754497644977449784497944980449814498244983449844498544986449874498844989449904499144992449934499444995449964499744998449994500045001450024500345004450054500645007450084500945010450114501245013450144501545016450174501845019450204502145022450234502445025450264502745028450294503045031450324503345034450354503645037450384503945040450414504245043450444504545046450474504845049450504505145052450534505445055450564505745058450594506045061450624506345064450654506645067450684506945070450714507245073450744507545076450774507845079450804508145082450834508445085450864508745088450894509045091450924509345094450954509645097450984509945100451014510245103451044510545106451074510845109451104511145112451134511445115451164511745118451194512045121451224512345124451254512645127451284512945130451314513245133451344513545136451374513845139451404514145142451434514445145451464514745148451494515045151451524515345154451554515645157451584515945160451614516245163451644516545166451674516845169451704517145172451734517445175451764517745178451794518045181451824518345184451854518645187451884518945190451914519245193451944519545196451974519845199452004520145202452034520445205452064520745208452094521045211452124521345214452154521645217452184521945220452214522245223452244522545226452274522845229452304523145232452334523445235452364523745238452394524045241452424524345244452454524645247452484524945250452514525245253452544525545256452574525845259452604526145262452634526445265452664526745268452694527045271452724527345274452754527645277452784527945280452814528245283452844528545286452874528845289452904529145292452934529445295452964529745298452994530045301453024530345304453054530645307453084530945310453114531245313453144531545316453174531845319453204532145322453234532445325453264532745328453294533045331453324533345334453354533645337453384533945340453414534245343453444534545346453474534845349453504535145352453534535445355453564535745358453594536045361453624536345364453654536645367453684536945370453714537245373453744537545376453774537845379453804538145382453834538445385453864538745388453894539045391453924539345394453954539645397453984539945400454014540245403454044540545406454074540845409454104541145412454134541445415454164541745418454194542045421454224542345424454254542645427454284542945430454314543245433454344543545436454374543845439454404544145442454434544445445454464544745448454494545045451454524545345454454554545645457454584545945460454614546245463454644546545466454674546845469454704547145472454734547445475454764547745478454794548045481454824548345484454854548645487454884548945490454914549245493454944549545496454974549845499455004550145502455034550445505455064550745508455094551045511455124551345514455154551645517455184551945520455214552245523455244552545526455274552845529455304553145532455334553445535455364553745538455394554045541455424554345544455454554645547455484554945550455514555245553455544555545556455574555845559455604556145562455634556445565455664556745568455694557045571455724557345574455754557645577455784557945580455814558245583455844558545586455874558845589455904559145592455934559445595455964559745598455994560045601456024560345604456054560645607456084560945610456114561245613456144561545616456174561845619456204562145622456234562445625456264562745628456294563045631456324563345634456354563645637456384563945640456414564245643456444564545646456474564845649456504565145652456534565445655456564565745658456594566045661456624566345664456654566645667456684566945670456714567245673456744567545676456774567845679456804568145682456834568445685456864568745688456894569045691456924569345694456954569645697456984569945700457014570245703457044570545706457074570845709457104571145712457134571445715457164571745718457194572045721457224572345724457254572645727457284572945730457314573245733457344573545736457374573845739457404574145742457434574445745457464574745748457494575045751457524575345754457554575645757457584575945760457614576245763457644576545766457674576845769457704577145772457734577445775457764577745778457794578045781457824578345784457854578645787457884578945790457914579245793457944579545796457974579845799458004580145802458034580445805458064580745808458094581045811458124581345814458154581645817458184581945820458214582245823458244582545826458274582845829458304583145832458334583445835458364583745838458394584045841458424584345844458454584645847458484584945850458514585245853458544585545856458574585845859458604586145862458634586445865458664586745868458694587045871458724587345874458754587645877458784587945880458814588245883458844588545886458874588845889458904589145892458934589445895458964589745898458994590045901459024590345904459054590645907459084590945910459114591245913459144591545916459174591845919459204592145922459234592445925459264592745928459294593045931459324593345934459354593645937459384593945940459414594245943459444594545946459474594845949459504595145952459534595445955459564595745958459594596045961459624596345964459654596645967459684596945970459714597245973459744597545976459774597845979459804598145982459834598445985459864598745988459894599045991459924599345994459954599645997459984599946000460014600246003460044600546006460074600846009460104601146012460134601446015460164601746018460194602046021460224602346024460254602646027460284602946030460314603246033460344603546036460374603846039460404604146042460434604446045460464604746048460494605046051460524605346054460554605646057460584605946060460614606246063460644606546066460674606846069460704607146072460734607446075460764607746078460794608046081460824608346084460854608646087460884608946090460914609246093460944609546096460974609846099461004610146102461034610446105461064610746108461094611046111461124611346114461154611646117461184611946120461214612246123461244612546126461274612846129461304613146132461334613446135461364613746138461394614046141461424614346144461454614646147461484614946150461514615246153461544615546156461574615846159461604616146162461634616446165461664616746168461694617046171461724617346174461754617646177461784617946180461814618246183461844618546186461874618846189461904619146192461934619446195461964619746198461994620046201462024620346204462054620646207462084620946210462114621246213462144621546216462174621846219462204622146222462234622446225462264622746228462294623046231462324623346234462354623646237462384623946240462414624246243462444624546246462474624846249462504625146252462534625446255462564625746258462594626046261462624626346264462654626646267462684626946270462714627246273462744627546276462774627846279462804628146282462834628446285462864628746288462894629046291462924629346294462954629646297462984629946300463014630246303463044630546306463074630846309463104631146312463134631446315463164631746318463194632046321463224632346324463254632646327463284632946330463314633246333463344633546336463374633846339463404634146342463434634446345463464634746348463494635046351463524635346354463554635646357463584635946360463614636246363463644636546366463674636846369463704637146372463734637446375463764637746378463794638046381463824638346384463854638646387463884638946390463914639246393463944639546396463974639846399464004640146402464034640446405464064640746408464094641046411464124641346414464154641646417464184641946420464214642246423464244642546426464274642846429464304643146432464334643446435464364643746438464394644046441464424644346444464454644646447464484644946450464514645246453464544645546456464574645846459464604646146462464634646446465464664646746468464694647046471464724647346474464754647646477464784647946480464814648246483464844648546486464874648846489464904649146492464934649446495464964649746498464994650046501465024650346504465054650646507465084650946510465114651246513465144651546516465174651846519465204652146522465234652446525465264652746528465294653046531465324653346534465354653646537465384653946540465414654246543465444654546546465474654846549465504655146552465534655446555465564655746558465594656046561465624656346564465654656646567465684656946570465714657246573465744657546576465774657846579465804658146582465834658446585465864658746588465894659046591465924659346594465954659646597465984659946600466014660246603466044660546606466074660846609466104661146612466134661446615466164661746618466194662046621466224662346624466254662646627466284662946630466314663246633466344663546636466374663846639466404664146642466434664446645466464664746648466494665046651466524665346654466554665646657466584665946660466614666246663466644666546666466674666846669466704667146672466734667446675466764667746678466794668046681466824668346684466854668646687466884668946690466914669246693466944669546696466974669846699467004670146702467034670446705467064670746708467094671046711467124671346714467154671646717467184671946720467214672246723467244672546726467274672846729467304673146732467334673446735467364673746738467394674046741467424674346744467454674646747467484674946750467514675246753467544675546756467574675846759467604676146762467634676446765467664676746768467694677046771467724677346774467754677646777467784677946780467814678246783467844678546786467874678846789467904679146792467934679446795467964679746798467994680046801468024680346804468054680646807468084680946810468114681246813468144681546816468174681846819468204682146822468234682446825468264682746828468294683046831468324683346834468354683646837468384683946840468414684246843468444684546846468474684846849468504685146852468534685446855468564685746858468594686046861468624686346864468654686646867468684686946870468714687246873468744687546876468774687846879468804688146882468834688446885468864688746888468894689046891468924689346894468954689646897468984689946900469014690246903469044690546906469074690846909469104691146912469134691446915469164691746918469194692046921469224692346924469254692646927469284692946930469314693246933469344693546936469374693846939469404694146942469434694446945469464694746948469494695046951469524695346954469554695646957469584695946960469614696246963469644696546966469674696846969469704697146972469734697446975469764697746978469794698046981469824698346984469854698646987469884698946990469914699246993469944699546996469974699846999470004700147002470034700447005470064700747008470094701047011470124701347014470154701647017470184701947020470214702247023470244702547026470274702847029470304703147032470334703447035470364703747038470394704047041470424704347044470454704647047470484704947050470514705247053470544705547056470574705847059470604706147062470634706447065470664706747068470694707047071470724707347074470754707647077470784707947080470814708247083470844708547086470874708847089470904709147092470934709447095470964709747098470994710047101471024710347104471054710647107471084710947110471114711247113471144711547116471174711847119471204712147122471234712447125471264712747128471294713047131471324713347134471354713647137471384713947140471414714247143471444714547146471474714847149471504715147152471534715447155471564715747158471594716047161471624716347164471654716647167471684716947170471714717247173471744717547176471774717847179471804718147182471834718447185471864718747188471894719047191471924719347194471954719647197471984719947200472014720247203472044720547206472074720847209472104721147212472134721447215472164721747218472194722047221472224722347224472254722647227472284722947230472314723247233472344723547236472374723847239472404724147242472434724447245472464724747248472494725047251472524725347254472554725647257472584725947260472614726247263472644726547266472674726847269472704727147272472734727447275472764727747278472794728047281472824728347284472854728647287472884728947290472914729247293472944729547296472974729847299473004730147302473034730447305473064730747308473094731047311473124731347314473154731647317473184731947320473214732247323473244732547326473274732847329473304733147332473334733447335473364733747338473394734047341473424734347344473454734647347473484734947350473514735247353473544735547356473574735847359473604736147362473634736447365473664736747368473694737047371473724737347374473754737647377473784737947380473814738247383473844738547386473874738847389473904739147392473934739447395473964739747398473994740047401474024740347404474054740647407474084740947410474114741247413474144741547416474174741847419474204742147422474234742447425474264742747428474294743047431474324743347434474354743647437474384743947440474414744247443474444744547446474474744847449474504745147452474534745447455474564745747458474594746047461474624746347464474654746647467474684746947470474714747247473474744747547476474774747847479474804748147482474834748447485474864748747488474894749047491474924749347494474954749647497474984749947500475014750247503475044750547506475074750847509475104751147512475134751447515475164751747518475194752047521475224752347524475254752647527475284752947530475314753247533475344753547536475374753847539475404754147542475434754447545475464754747548475494755047551475524755347554475554755647557475584755947560475614756247563475644756547566475674756847569475704757147572475734757447575475764757747578475794758047581475824758347584475854758647587475884758947590475914759247593475944759547596475974759847599476004760147602476034760447605476064760747608476094761047611476124761347614476154761647617476184761947620476214762247623476244762547626476274762847629476304763147632476334763447635476364763747638476394764047641476424764347644476454764647647476484764947650476514765247653476544765547656476574765847659476604766147662476634766447665476664766747668476694767047671476724767347674476754767647677476784767947680476814768247683476844768547686476874768847689476904769147692476934769447695476964769747698476994770047701477024770347704477054770647707477084770947710477114771247713477144771547716477174771847719477204772147722477234772447725477264772747728477294773047731477324773347734477354773647737477384773947740477414774247743477444774547746477474774847749477504775147752477534775447755477564775747758477594776047761477624776347764477654776647767477684776947770477714777247773477744777547776477774777847779477804778147782477834778447785477864778747788477894779047791477924779347794477954779647797477984779947800478014780247803478044780547806478074780847809478104781147812478134781447815478164781747818478194782047821478224782347824478254782647827478284782947830478314783247833478344783547836478374783847839478404784147842478434784447845478464784747848478494785047851478524785347854478554785647857478584785947860478614786247863478644786547866478674786847869478704787147872478734787447875478764787747878478794788047881478824788347884478854788647887478884788947890478914789247893478944789547896478974789847899479004790147902479034790447905479064790747908479094791047911479124791347914479154791647917479184791947920479214792247923479244792547926479274792847929479304793147932479334793447935479364793747938479394794047941479424794347944479454794647947479484794947950479514795247953479544795547956479574795847959479604796147962479634796447965479664796747968479694797047971479724797347974479754797647977479784797947980479814798247983479844798547986479874798847989479904799147992479934799447995479964799747998479994800048001480024800348004480054800648007480084800948010480114801248013480144801548016480174801848019480204802148022480234802448025480264802748028480294803048031480324803348034480354803648037480384803948040480414804248043480444804548046480474804848049480504805148052480534805448055480564805748058480594806048061480624806348064480654806648067480684806948070480714807248073480744807548076480774807848079480804808148082480834808448085480864808748088480894809048091480924809348094480954809648097480984809948100481014810248103481044810548106481074810848109481104811148112481134811448115481164811748118481194812048121481224812348124481254812648127481284812948130481314813248133481344813548136481374813848139481404814148142481434814448145481464814748148481494815048151481524815348154481554815648157481584815948160481614816248163481644816548166481674816848169481704817148172481734817448175481764817748178481794818048181481824818348184481854818648187481884818948190481914819248193481944819548196481974819848199482004820148202482034820448205482064820748208482094821048211482124821348214482154821648217482184821948220482214822248223482244822548226482274822848229482304823148232482334823448235482364823748238482394824048241482424824348244482454824648247482484824948250482514825248253482544825548256482574825848259482604826148262482634826448265482664826748268482694827048271482724827348274482754827648277482784827948280482814828248283482844828548286482874828848289482904829148292482934829448295482964829748298482994830048301483024830348304483054830648307483084830948310483114831248313483144831548316483174831848319483204832148322483234832448325483264832748328483294833048331483324833348334483354833648337483384833948340483414834248343483444834548346483474834848349483504835148352483534835448355483564835748358483594836048361483624836348364483654836648367483684836948370483714837248373483744837548376483774837848379483804838148382483834838448385483864838748388483894839048391483924839348394483954839648397483984839948400484014840248403484044840548406484074840848409484104841148412484134841448415484164841748418484194842048421484224842348424484254842648427484284842948430484314843248433484344843548436484374843848439484404844148442484434844448445484464844748448484494845048451484524845348454484554845648457484584845948460484614846248463484644846548466484674846848469484704847148472484734847448475484764847748478484794848048481484824848348484484854848648487484884848948490484914849248493484944849548496484974849848499485004850148502485034850448505485064850748508485094851048511485124851348514485154851648517485184851948520485214852248523485244852548526485274852848529485304853148532485334853448535485364853748538485394854048541485424854348544485454854648547485484854948550485514855248553485544855548556485574855848559485604856148562485634856448565485664856748568485694857048571485724857348574485754857648577485784857948580485814858248583485844858548586485874858848589485904859148592485934859448595485964859748598485994860048601486024860348604486054860648607486084860948610486114861248613486144861548616486174861848619486204862148622486234862448625486264862748628486294863048631486324863348634486354863648637486384863948640486414864248643486444864548646486474864848649486504865148652486534865448655486564865748658486594866048661486624866348664486654866648667486684866948670486714867248673486744867548676486774867848679486804868148682486834868448685486864868748688486894869048691486924869348694486954869648697486984869948700487014870248703487044870548706487074870848709487104871148712487134871448715487164871748718487194872048721487224872348724487254872648727487284872948730487314873248733487344873548736487374873848739487404874148742487434874448745487464874748748487494875048751487524875348754487554875648757487584875948760487614876248763487644876548766487674876848769487704877148772487734877448775487764877748778487794878048781487824878348784487854878648787487884878948790487914879248793487944879548796487974879848799488004880148802488034880448805488064880748808488094881048811488124881348814488154881648817488184881948820488214882248823488244882548826488274882848829488304883148832488334883448835488364883748838488394884048841488424884348844488454884648847488484884948850488514885248853488544885548856488574885848859488604886148862488634886448865488664886748868488694887048871488724887348874488754887648877488784887948880488814888248883488844888548886488874888848889488904889148892488934889448895488964889748898488994890048901489024890348904489054890648907489084890948910489114891248913489144891548916489174891848919489204892148922489234892448925489264892748928489294893048931489324893348934489354893648937489384893948940489414894248943489444894548946489474894848949489504895148952489534895448955489564895748958489594896048961489624896348964489654896648967489684896948970489714897248973489744897548976489774897848979489804898148982489834898448985489864898748988489894899048991489924899348994489954899648997489984899949000490014900249003490044900549006490074900849009490104901149012490134901449015490164901749018490194902049021490224902349024490254902649027490284902949030490314903249033490344903549036490374903849039490404904149042490434904449045490464904749048490494905049051490524905349054490554905649057490584905949060490614906249063490644906549066490674906849069490704907149072490734907449075490764907749078490794908049081490824908349084490854908649087490884908949090490914909249093490944909549096490974909849099491004910149102491034910449105491064910749108491094911049111491124911349114491154911649117491184911949120491214912249123491244912549126491274912849129491304913149132491334913449135491364913749138491394914049141491424914349144491454914649147491484914949150491514915249153491544915549156491574915849159491604916149162491634916449165491664916749168491694917049171491724917349174491754917649177491784917949180491814918249183491844918549186491874918849189491904919149192491934919449195491964919749198491994920049201492024920349204492054920649207492084920949210492114921249213492144921549216492174921849219492204922149222492234922449225492264922749228492294923049231492324923349234492354923649237492384923949240492414924249243492444924549246492474924849249492504925149252492534925449255492564925749258492594926049261492624926349264492654926649267492684926949270492714927249273492744927549276492774927849279492804928149282492834928449285492864928749288492894929049291492924929349294492954929649297492984929949300493014930249303493044930549306493074930849309493104931149312493134931449315493164931749318493194932049321493224932349324493254932649327493284932949330493314933249333493344933549336493374933849339493404934149342493434934449345493464934749348493494935049351493524935349354493554935649357493584935949360493614936249363493644936549366493674936849369493704937149372493734937449375493764937749378493794938049381493824938349384493854938649387493884938949390493914939249393493944939549396493974939849399494004940149402494034940449405494064940749408494094941049411494124941349414494154941649417494184941949420494214942249423494244942549426494274942849429494304943149432494334943449435494364943749438494394944049441494424944349444494454944649447494484944949450494514945249453494544945549456494574945849459494604946149462494634946449465494664946749468494694947049471494724947349474494754947649477494784947949480494814948249483494844948549486494874948849489494904949149492494934949449495494964949749498494994950049501495024950349504495054950649507495084950949510495114951249513495144951549516495174951849519495204952149522495234952449525495264952749528495294953049531495324953349534495354953649537495384953949540495414954249543495444954549546495474954849549495504955149552495534955449555495564955749558495594956049561495624956349564495654956649567495684956949570495714957249573495744957549576495774957849579495804958149582495834958449585495864958749588495894959049591495924959349594495954959649597495984959949600496014960249603496044960549606496074960849609496104961149612496134961449615496164961749618496194962049621496224962349624496254962649627496284962949630496314963249633496344963549636496374963849639496404964149642496434964449645496464964749648496494965049651496524965349654496554965649657496584965949660496614966249663496644966549666496674966849669496704967149672496734967449675496764967749678496794968049681496824968349684496854968649687496884968949690496914969249693496944969549696496974969849699497004970149702497034970449705497064970749708497094971049711497124971349714497154971649717497184971949720497214972249723497244972549726497274972849729497304973149732497334973449735497364973749738497394974049741497424974349744497454974649747497484974949750497514975249753497544975549756497574975849759497604976149762497634976449765497664976749768497694977049771497724977349774497754977649777497784977949780497814978249783497844978549786497874978849789497904979149792497934979449795497964979749798497994980049801498024980349804498054980649807498084980949810498114981249813498144981549816498174981849819498204982149822498234982449825498264982749828498294983049831498324983349834498354983649837498384983949840498414984249843498444984549846498474984849849498504985149852498534985449855498564985749858498594986049861498624986349864498654986649867498684986949870498714987249873498744987549876498774987849879498804988149882498834988449885498864988749888498894989049891498924989349894498954989649897498984989949900499014990249903499044990549906499074990849909499104991149912499134991449915499164991749918499194992049921499224992349924499254992649927499284992949930499314993249933499344993549936499374993849939499404994149942499434994449945499464994749948499494995049951499524995349954499554995649957499584995949960499614996249963499644996549966499674996849969499704997149972499734997449975499764997749978499794998049981499824998349984499854998649987499884998949990499914999249993499944999549996499974999849999500005000150002500035000450005500065000750008500095001050011500125001350014500155001650017500185001950020500215002250023500245002550026500275002850029500305003150032500335003450035500365003750038500395004050041500425004350044500455004650047500485004950050500515005250053500545005550056500575005850059500605006150062500635006450065500665006750068500695007050071500725007350074500755007650077500785007950080500815008250083500845008550086500875008850089500905009150092500935009450095500965009750098500995010050101501025010350104501055010650107501085010950110501115011250113501145011550116501175011850119501205012150122501235012450125501265012750128501295013050131501325013350134501355013650137501385013950140501415014250143501445014550146501475014850149501505015150152501535015450155501565015750158501595016050161501625016350164501655016650167501685016950170501715017250173501745017550176501775017850179501805018150182501835018450185501865018750188501895019050191501925019350194501955019650197501985019950200502015020250203502045020550206502075020850209502105021150212502135021450215502165021750218502195022050221502225022350224502255022650227502285022950230502315023250233502345023550236502375023850239502405024150242502435024450245502465024750248502495025050251502525025350254502555025650257502585025950260502615026250263502645026550266502675026850269502705027150272502735027450275502765027750278502795028050281502825028350284502855028650287502885028950290502915029250293502945029550296502975029850299503005030150302503035030450305503065030750308503095031050311503125031350314503155031650317503185031950320503215032250323503245032550326503275032850329503305033150332503335033450335503365033750338503395034050341503425034350344503455034650347503485034950350503515035250353503545035550356503575035850359503605036150362503635036450365503665036750368503695037050371503725037350374503755037650377503785037950380503815038250383503845038550386503875038850389503905039150392503935039450395503965039750398503995040050401504025040350404504055040650407504085040950410504115041250413504145041550416504175041850419504205042150422504235042450425504265042750428504295043050431504325043350434504355043650437504385043950440504415044250443504445044550446504475044850449504505045150452504535045450455504565045750458504595046050461504625046350464504655046650467504685046950470504715047250473504745047550476504775047850479504805048150482504835048450485504865048750488504895049050491504925049350494504955049650497504985049950500505015050250503505045050550506505075050850509505105051150512505135051450515505165051750518505195052050521505225052350524505255052650527505285052950530505315053250533505345053550536505375053850539505405054150542505435054450545505465054750548505495055050551505525055350554505555055650557505585055950560505615056250563505645056550566505675056850569505705057150572505735057450575505765057750578505795058050581505825058350584505855058650587505885058950590505915059250593505945059550596505975059850599506005060150602506035060450605506065060750608506095061050611506125061350614506155061650617506185061950620506215062250623506245062550626506275062850629506305063150632506335063450635506365063750638506395064050641506425064350644506455064650647506485064950650506515065250653506545065550656506575065850659506605066150662506635066450665506665066750668506695067050671506725067350674506755067650677506785067950680506815068250683506845068550686506875068850689506905069150692506935069450695506965069750698506995070050701507025070350704507055070650707507085070950710507115071250713507145071550716507175071850719507205072150722507235072450725507265072750728507295073050731507325073350734507355073650737507385073950740507415074250743507445074550746507475074850749507505075150752507535075450755507565075750758507595076050761507625076350764507655076650767507685076950770507715077250773507745077550776507775077850779507805078150782507835078450785507865078750788507895079050791507925079350794507955079650797507985079950800508015080250803508045080550806508075080850809508105081150812508135081450815508165081750818508195082050821508225082350824508255082650827508285082950830508315083250833508345083550836508375083850839508405084150842508435084450845508465084750848508495085050851508525085350854508555085650857508585085950860508615086250863508645086550866508675086850869508705087150872508735087450875508765087750878508795088050881508825088350884508855088650887508885088950890508915089250893508945089550896508975089850899509005090150902509035090450905509065090750908509095091050911509125091350914509155091650917509185091950920509215092250923509245092550926509275092850929509305093150932509335093450935509365093750938509395094050941509425094350944509455094650947509485094950950509515095250953509545095550956509575095850959509605096150962509635096450965509665096750968509695097050971509725097350974509755097650977509785097950980509815098250983509845098550986509875098850989509905099150992509935099450995509965099750998509995100051001510025100351004510055100651007510085100951010510115101251013510145101551016510175101851019510205102151022510235102451025510265102751028510295103051031510325103351034510355103651037510385103951040510415104251043510445104551046510475104851049510505105151052510535105451055510565105751058510595106051061510625106351064510655106651067510685106951070510715107251073510745107551076510775107851079510805108151082510835108451085510865108751088510895109051091510925109351094510955109651097510985109951100511015110251103511045110551106511075110851109511105111151112511135111451115511165111751118511195112051121511225112351124511255112651127511285112951130511315113251133511345113551136511375113851139511405114151142511435114451145511465114751148511495115051151511525115351154511555115651157511585115951160511615116251163511645116551166511675116851169511705117151172511735117451175511765117751178511795118051181511825118351184511855118651187511885118951190511915119251193511945119551196511975119851199512005120151202512035120451205512065120751208512095121051211512125121351214512155121651217512185121951220512215122251223512245122551226512275122851229512305123151232512335123451235512365123751238512395124051241512425124351244512455124651247512485124951250512515125251253512545125551256512575125851259512605126151262512635126451265512665126751268512695127051271512725127351274512755127651277512785127951280512815128251283512845128551286512875128851289512905129151292512935129451295512965129751298512995130051301513025130351304513055130651307513085130951310513115131251313513145131551316513175131851319513205132151322513235132451325513265132751328513295133051331513325133351334513355133651337513385133951340513415134251343513445134551346513475134851349513505135151352513535135451355513565135751358513595136051361513625136351364513655136651367513685136951370513715137251373513745137551376513775137851379513805138151382513835138451385513865138751388513895139051391513925139351394513955139651397513985139951400514015140251403514045140551406514075140851409514105141151412514135141451415514165141751418514195142051421514225142351424514255142651427514285142951430514315143251433514345143551436514375143851439514405144151442514435144451445514465144751448514495145051451514525145351454514555145651457514585145951460514615146251463514645146551466514675146851469514705147151472514735147451475514765147751478514795148051481514825148351484514855148651487514885148951490514915149251493514945149551496514975149851499515005150151502515035150451505515065150751508515095151051511515125151351514515155151651517515185151951520515215152251523515245152551526515275152851529515305153151532515335153451535515365153751538515395154051541515425154351544515455154651547515485154951550515515155251553515545155551556515575155851559515605156151562515635156451565515665156751568515695157051571515725157351574515755157651577515785157951580515815158251583515845158551586515875158851589515905159151592515935159451595515965159751598515995160051601516025160351604516055160651607516085160951610516115161251613516145161551616516175161851619516205162151622516235162451625516265162751628516295163051631516325163351634516355163651637516385163951640516415164251643516445164551646516475164851649516505165151652516535165451655516565165751658516595166051661516625166351664516655166651667516685166951670516715167251673516745167551676516775167851679516805168151682516835168451685516865168751688516895169051691516925169351694516955169651697516985169951700517015170251703517045170551706517075170851709517105171151712517135171451715517165171751718517195172051721517225172351724517255172651727517285172951730517315173251733517345173551736517375173851739517405174151742517435174451745517465174751748517495175051751517525175351754517555175651757517585175951760517615176251763517645176551766517675176851769517705177151772517735177451775517765177751778517795178051781517825178351784517855178651787517885178951790517915179251793517945179551796517975179851799518005180151802518035180451805518065180751808518095181051811518125181351814518155181651817518185181951820518215182251823518245182551826518275182851829518305183151832518335183451835518365183751838518395184051841518425184351844518455184651847518485184951850518515185251853518545185551856518575185851859518605186151862518635186451865518665186751868518695187051871518725187351874518755187651877518785187951880518815188251883518845188551886518875188851889518905189151892518935189451895518965189751898518995190051901519025190351904519055190651907519085190951910519115191251913519145191551916519175191851919519205192151922519235192451925519265192751928519295193051931519325193351934519355193651937519385193951940519415194251943519445194551946519475194851949519505195151952519535195451955519565195751958519595196051961519625196351964519655196651967519685196951970519715197251973519745197551976519775197851979519805198151982519835198451985519865198751988519895199051991519925199351994519955199651997519985199952000520015200252003520045200552006520075200852009520105201152012520135201452015520165201752018520195202052021520225202352024520255202652027520285202952030520315203252033520345203552036520375203852039520405204152042520435204452045520465204752048520495205052051520525205352054520555205652057520585205952060520615206252063520645206552066520675206852069520705207152072520735207452075520765207752078520795208052081520825208352084520855208652087520885208952090520915209252093520945209552096520975209852099521005210152102521035210452105521065210752108521095211052111521125211352114521155211652117521185211952120521215212252123521245212552126521275212852129521305213152132521335213452135521365213752138521395214052141521425214352144521455214652147521485214952150521515215252153521545215552156521575215852159521605216152162521635216452165521665216752168521695217052171521725217352174521755217652177521785217952180521815218252183521845218552186521875218852189521905219152192521935219452195521965219752198521995220052201522025220352204522055220652207522085220952210522115221252213522145221552216522175221852219522205222152222522235222452225522265222752228522295223052231522325223352234522355223652237522385223952240522415224252243522445224552246522475224852249522505225152252522535225452255522565225752258522595226052261522625226352264522655226652267522685226952270522715227252273522745227552276522775227852279522805228152282522835228452285522865228752288522895229052291522925229352294522955229652297522985229952300523015230252303523045230552306523075230852309523105231152312523135231452315523165231752318523195232052321523225232352324523255232652327523285232952330523315233252333523345233552336523375233852339523405234152342523435234452345523465234752348523495235052351523525235352354523555235652357523585235952360523615236252363523645236552366523675236852369523705237152372523735237452375523765237752378523795238052381523825238352384523855238652387523885238952390523915239252393523945239552396523975239852399524005240152402524035240452405524065240752408524095241052411524125241352414524155241652417524185241952420524215242252423524245242552426524275242852429524305243152432524335243452435524365243752438524395244052441524425244352444524455244652447524485244952450524515245252453524545245552456524575245852459524605246152462524635246452465524665246752468524695247052471524725247352474524755247652477524785247952480524815248252483524845248552486524875248852489524905249152492524935249452495524965249752498524995250052501525025250352504525055250652507525085250952510525115251252513525145251552516525175251852519525205252152522525235252452525525265252752528525295253052531525325253352534525355253652537525385253952540525415254252543525445254552546525475254852549525505255152552525535255452555525565255752558525595256052561525625256352564525655256652567525685256952570525715257252573525745257552576525775257852579525805258152582525835258452585525865258752588525895259052591525925259352594525955259652597525985259952600526015260252603526045260552606526075260852609526105261152612526135261452615526165261752618526195262052621526225262352624526255262652627526285262952630526315263252633526345263552636526375263852639526405264152642526435264452645526465264752648526495265052651526525265352654526555265652657526585265952660526615266252663526645266552666526675266852669526705267152672526735267452675526765267752678526795268052681526825268352684526855268652687526885268952690526915269252693526945269552696526975269852699527005270152702527035270452705527065270752708527095271052711527125271352714527155271652717527185271952720527215272252723527245272552726527275272852729527305273152732527335273452735527365273752738527395274052741527425274352744527455274652747527485274952750527515275252753527545275552756527575275852759527605276152762527635276452765527665276752768527695277052771527725277352774527755277652777527785277952780527815278252783527845278552786527875278852789527905279152792527935279452795527965279752798527995280052801528025280352804528055280652807528085280952810528115281252813528145281552816528175281852819528205282152822528235282452825528265282752828528295283052831528325283352834528355283652837528385283952840528415284252843528445284552846528475284852849528505285152852528535285452855528565285752858528595286052861528625286352864528655286652867528685286952870528715287252873528745287552876528775287852879528805288152882528835288452885528865288752888528895289052891528925289352894528955289652897528985289952900529015290252903529045290552906529075290852909529105291152912529135291452915529165291752918529195292052921529225292352924529255292652927529285292952930529315293252933529345293552936529375293852939529405294152942529435294452945529465294752948529495295052951529525295352954529555295652957529585295952960529615296252963529645296552966529675296852969529705297152972529735297452975529765297752978529795298052981529825298352984529855298652987529885298952990529915299252993529945299552996529975299852999530005300153002530035300453005530065300753008530095301053011530125301353014530155301653017530185301953020530215302253023530245302553026530275302853029530305303153032530335303453035530365303753038530395304053041530425304353044530455304653047530485304953050530515305253053530545305553056530575305853059530605306153062530635306453065530665306753068530695307053071530725307353074530755307653077530785307953080530815308253083530845308553086530875308853089530905309153092530935309453095530965309753098530995310053101531025310353104531055310653107531085310953110531115311253113531145311553116531175311853119531205312153122531235312453125531265312753128531295313053131531325313353134531355313653137531385313953140531415314253143531445314553146531475314853149531505315153152531535315453155531565315753158531595316053161531625316353164531655316653167531685316953170531715317253173531745317553176531775317853179531805318153182531835318453185531865318753188531895319053191531925319353194531955319653197531985319953200532015320253203532045320553206532075320853209532105321153212532135321453215532165321753218532195322053221532225322353224532255322653227532285322953230532315323253233532345323553236532375323853239532405324153242532435324453245532465324753248532495325053251532525325353254532555325653257532585325953260532615326253263532645326553266532675326853269532705327153272532735327453275532765327753278532795328053281532825328353284532855328653287532885328953290532915329253293532945329553296532975329853299533005330153302533035330453305533065330753308533095331053311533125331353314533155331653317533185331953320533215332253323533245332553326533275332853329533305333153332533335333453335533365333753338533395334053341533425334353344533455334653347533485334953350533515335253353533545335553356533575335853359533605336153362533635336453365533665336753368533695337053371533725337353374533755337653377533785337953380533815338253383533845338553386533875338853389533905339153392533935339453395533965339753398533995340053401534025340353404534055340653407534085340953410534115341253413534145341553416534175341853419534205342153422534235342453425534265342753428534295343053431534325343353434534355343653437534385343953440534415344253443534445344553446534475344853449534505345153452534535345453455534565345753458534595346053461534625346353464534655346653467534685346953470534715347253473534745347553476534775347853479534805348153482534835348453485534865348753488534895349053491534925349353494534955349653497534985349953500535015350253503535045350553506535075350853509535105351153512535135351453515535165351753518535195352053521535225352353524535255352653527535285352953530535315353253533535345353553536535375353853539535405354153542535435354453545535465354753548535495355053551535525355353554535555355653557535585355953560535615356253563535645356553566535675356853569535705357153572535735357453575535765357753578535795358053581535825358353584535855358653587535885358953590535915359253593535945359553596535975359853599536005360153602536035360453605536065360753608536095361053611536125361353614536155361653617536185361953620536215362253623536245362553626536275362853629536305363153632536335363453635536365363753638536395364053641536425364353644536455364653647536485364953650536515365253653536545365553656536575365853659536605366153662536635366453665536665366753668536695367053671536725367353674536755367653677536785367953680536815368253683536845368553686536875368853689536905369153692536935369453695536965369753698536995370053701537025370353704537055370653707537085370953710537115371253713537145371553716537175371853719537205372153722537235372453725537265372753728537295373053731537325373353734537355373653737537385373953740537415374253743537445374553746537475374853749537505375153752537535375453755537565375753758537595376053761537625376353764537655376653767537685376953770537715377253773537745377553776537775377853779537805378153782537835378453785537865378753788537895379053791537925379353794537955379653797537985379953800538015380253803538045380553806538075380853809538105381153812538135381453815538165381753818538195382053821538225382353824538255382653827538285382953830538315383253833538345383553836538375383853839538405384153842538435384453845538465384753848538495385053851538525385353854538555385653857538585385953860538615386253863538645386553866538675386853869538705387153872538735387453875538765387753878538795388053881538825388353884538855388653887538885388953890538915389253893538945389553896538975389853899539005390153902539035390453905539065390753908539095391053911539125391353914539155391653917539185391953920539215392253923539245392553926539275392853929539305393153932539335393453935539365393753938539395394053941539425394353944539455394653947539485394953950539515395253953539545395553956539575395853959539605396153962539635396453965539665396753968539695397053971539725397353974539755397653977539785397953980539815398253983539845398553986539875398853989539905399153992539935399453995539965399753998539995400054001540025400354004540055400654007540085400954010540115401254013540145401554016540175401854019540205402154022540235402454025540265402754028540295403054031540325403354034540355403654037540385403954040540415404254043540445404554046540475404854049540505405154052540535405454055540565405754058540595406054061540625406354064540655406654067540685406954070540715407254073540745407554076540775407854079540805408154082540835408454085540865408754088540895409054091540925409354094540955409654097540985409954100541015410254103541045410554106541075410854109541105411154112541135411454115541165411754118541195412054121541225412354124541255412654127541285412954130541315413254133541345413554136541375413854139541405414154142541435414454145541465414754148541495415054151541525415354154541555415654157541585415954160541615416254163541645416554166541675416854169541705417154172541735417454175541765417754178541795418054181541825418354184541855418654187541885418954190541915419254193541945419554196541975419854199542005420154202542035420454205542065420754208542095421054211542125421354214542155421654217542185421954220542215422254223542245422554226542275422854229542305423154232542335423454235542365423754238542395424054241542425424354244542455424654247542485424954250542515425254253542545425554256542575425854259542605426154262542635426454265542665426754268542695427054271542725427354274542755427654277542785427954280542815428254283542845428554286542875428854289542905429154292542935429454295542965429754298542995430054301543025430354304543055430654307543085430954310543115431254313543145431554316543175431854319543205432154322543235432454325543265432754328543295433054331543325433354334543355433654337543385433954340543415434254343543445434554346543475434854349543505435154352543535435454355543565435754358543595436054361543625436354364543655436654367543685436954370543715437254373543745437554376543775437854379543805438154382543835438454385543865438754388543895439054391543925439354394543955439654397543985439954400544015440254403544045440554406544075440854409544105441154412544135441454415544165441754418544195442054421544225442354424544255442654427544285442954430544315443254433544345443554436544375443854439544405444154442544435444454445544465444754448544495445054451544525445354454544555445654457544585445954460544615446254463544645446554466544675446854469544705447154472544735447454475544765447754478544795448054481544825448354484544855448654487544885448954490544915449254493544945449554496544975449854499545005450154502545035450454505545065450754508545095451054511545125451354514545155451654517545185451954520545215452254523545245452554526545275452854529545305453154532545335453454535545365453754538545395454054541545425454354544545455454654547545485454954550545515455254553545545455554556545575455854559545605456154562545635456454565545665456754568545695457054571545725457354574545755457654577545785457954580545815458254583545845458554586545875458854589545905459154592545935459454595545965459754598545995460054601546025460354604546055460654607546085460954610546115461254613546145461554616546175461854619546205462154622546235462454625546265462754628546295463054631546325463354634546355463654637546385463954640546415464254643546445464554646546475464854649546505465154652546535465454655546565465754658546595466054661546625466354664546655466654667546685466954670546715467254673546745467554676546775467854679546805468154682546835468454685546865468754688546895469054691546925469354694546955469654697546985469954700547015470254703547045470554706547075470854709547105471154712547135471454715547165471754718547195472054721547225472354724547255472654727547285472954730547315473254733547345473554736547375473854739547405474154742547435474454745547465474754748547495475054751547525475354754547555475654757547585475954760547615476254763547645476554766547675476854769547705477154772547735477454775547765477754778547795478054781547825478354784547855478654787547885478954790547915479254793547945479554796547975479854799548005480154802548035480454805548065480754808548095481054811548125481354814548155481654817548185481954820548215482254823548245482554826548275482854829548305483154832548335483454835548365483754838548395484054841548425484354844548455484654847548485484954850548515485254853548545485554856548575485854859548605486154862548635486454865548665486754868548695487054871548725487354874548755487654877548785487954880548815488254883548845488554886548875488854889548905489154892548935489454895548965489754898548995490054901549025490354904549055490654907549085490954910549115491254913549145491554916549175491854919549205492154922549235492454925549265492754928549295493054931549325493354934549355493654937549385493954940549415494254943549445494554946549475494854949549505495154952549535495454955549565495754958549595496054961549625496354964549655496654967549685496954970549715497254973549745497554976549775497854979549805498154982549835498454985549865498754988549895499054991549925499354994549955499654997549985499955000550015500255003550045500555006550075500855009550105501155012550135501455015550165501755018550195502055021550225502355024550255502655027550285502955030550315503255033550345503555036550375503855039550405504155042550435504455045550465504755048550495505055051550525505355054550555505655057550585505955060550615506255063550645506555066550675506855069550705507155072550735507455075550765507755078550795508055081550825508355084550855508655087550885508955090550915509255093550945509555096550975509855099551005510155102551035510455105551065510755108551095511055111551125511355114551155511655117551185511955120551215512255123551245512555126551275512855129551305513155132551335513455135551365513755138551395514055141551425514355144551455514655147551485514955150551515515255153551545515555156551575515855159551605516155162551635516455165551665516755168551695517055171551725517355174551755517655177551785517955180551815518255183551845518555186551875518855189551905519155192551935519455195551965519755198551995520055201552025520355204552055520655207552085520955210552115521255213552145521555216552175521855219552205522155222552235522455225552265522755228552295523055231552325523355234552355523655237552385523955240552415524255243552445524555246552475524855249552505525155252552535525455255552565525755258552595526055261552625526355264552655526655267552685526955270552715527255273552745527555276552775527855279552805528155282552835528455285552865528755288552895529055291552925529355294552955529655297552985529955300553015530255303553045530555306553075530855309553105531155312553135531455315553165531755318553195532055321553225532355324553255532655327553285532955330553315533255333553345533555336553375533855339553405534155342553435534455345553465534755348553495535055351553525535355354553555535655357553585535955360553615536255363553645536555366553675536855369553705537155372553735537455375553765537755378553795538055381553825538355384553855538655387553885538955390553915539255393553945539555396553975539855399554005540155402554035540455405554065540755408554095541055411554125541355414554155541655417554185541955420554215542255423554245542555426554275542855429554305543155432554335543455435554365543755438554395544055441554425544355444554455544655447554485544955450554515545255453554545545555456554575545855459554605546155462554635546455465554665546755468554695547055471554725547355474554755547655477554785547955480554815548255483554845548555486554875548855489554905549155492554935549455495554965549755498554995550055501555025550355504555055550655507555085550955510555115551255513555145551555516555175551855519555205552155522555235552455525555265552755528555295553055531555325553355534555355553655537555385553955540555415554255543555445554555546555475554855549555505555155552555535555455555555565555755558555595556055561555625556355564555655556655567555685556955570555715557255573555745557555576555775557855579555805558155582555835558455585555865558755588555895559055591555925559355594555955559655597555985559955600556015560255603556045560555606556075560855609556105561155612556135561455615556165561755618556195562055621556225562355624556255562655627556285562955630556315563255633556345563555636556375563855639556405564155642556435564455645556465564755648556495565055651556525565355654556555565655657556585565955660556615566255663556645566555666556675566855669556705567155672556735567455675556765567755678556795568055681556825568355684556855568655687556885568955690556915569255693556945569555696556975569855699557005570155702557035570455705557065570755708557095571055711557125571355714557155571655717557185571955720557215572255723557245572555726557275572855729557305573155732557335573455735557365573755738557395574055741557425574355744557455574655747557485574955750557515575255753557545575555756557575575855759557605576155762557635576455765557665576755768557695577055771557725577355774557755577655777557785577955780557815578255783557845578555786557875578855789557905579155792557935579455795557965579755798557995580055801558025580355804558055580655807558085580955810558115581255813558145581555816558175581855819558205582155822558235582455825558265582755828558295583055831558325583355834558355583655837558385583955840558415584255843558445584555846558475584855849558505585155852558535585455855558565585755858558595586055861558625586355864558655586655867558685586955870558715587255873558745587555876558775587855879558805588155882558835588455885558865588755888558895589055891558925589355894558955589655897558985589955900559015590255903559045590555906559075590855909559105591155912559135591455915559165591755918559195592055921559225592355924559255592655927559285592955930559315593255933559345593555936559375593855939559405594155942559435594455945559465594755948559495595055951559525595355954559555595655957559585595955960559615596255963559645596555966559675596855969559705597155972559735597455975559765597755978559795598055981559825598355984559855598655987559885598955990559915599255993559945599555996559975599855999560005600156002560035600456005560065600756008560095601056011560125601356014560155601656017560185601956020560215602256023560245602556026560275602856029560305603156032560335603456035560365603756038560395604056041560425604356044560455604656047560485604956050560515605256053560545605556056560575605856059560605606156062560635606456065560665606756068560695607056071560725607356074560755607656077560785607956080560815608256083560845608556086560875608856089560905609156092560935609456095560965609756098560995610056101561025610356104561055610656107561085610956110561115611256113561145611556116561175611856119561205612156122561235612456125561265612756128561295613056131561325613356134561355613656137561385613956140561415614256143561445614556146561475614856149561505615156152561535615456155561565615756158561595616056161561625616356164561655616656167561685616956170561715617256173561745617556176561775617856179561805618156182561835618456185561865618756188561895619056191561925619356194561955619656197561985619956200562015620256203562045620556206562075620856209562105621156212562135621456215562165621756218562195622056221562225622356224562255622656227562285622956230562315623256233562345623556236562375623856239562405624156242562435624456245562465624756248562495625056251562525625356254562555625656257562585625956260562615626256263562645626556266562675626856269562705627156272562735627456275562765627756278562795628056281562825628356284562855628656287562885628956290562915629256293562945629556296562975629856299563005630156302563035630456305563065630756308563095631056311563125631356314563155631656317563185631956320563215632256323563245632556326563275632856329563305633156332563335633456335563365633756338563395634056341563425634356344563455634656347563485634956350563515635256353563545635556356563575635856359563605636156362563635636456365563665636756368563695637056371563725637356374563755637656377563785637956380563815638256383563845638556386563875638856389563905639156392563935639456395563965639756398563995640056401564025640356404564055640656407564085640956410564115641256413564145641556416564175641856419564205642156422564235642456425564265642756428564295643056431564325643356434564355643656437564385643956440564415644256443564445644556446564475644856449564505645156452564535645456455564565645756458564595646056461564625646356464564655646656467564685646956470564715647256473564745647556476564775647856479564805648156482564835648456485564865648756488564895649056491564925649356494564955649656497564985649956500565015650256503565045650556506565075650856509565105651156512565135651456515565165651756518565195652056521565225652356524565255652656527565285652956530565315653256533565345653556536565375653856539565405654156542565435654456545565465654756548565495655056551565525655356554565555655656557565585655956560565615656256563565645656556566565675656856569565705657156572565735657456575565765657756578565795658056581565825658356584565855658656587565885658956590565915659256593565945659556596565975659856599566005660156602566035660456605566065660756608566095661056611566125661356614566155661656617566185661956620566215662256623566245662556626566275662856629566305663156632566335663456635566365663756638566395664056641566425664356644566455664656647566485664956650566515665256653566545665556656566575665856659566605666156662566635666456665566665666756668566695667056671566725667356674566755667656677566785667956680566815668256683566845668556686566875668856689566905669156692566935669456695566965669756698566995670056701567025670356704567055670656707567085670956710567115671256713567145671556716567175671856719567205672156722567235672456725567265672756728567295673056731567325673356734567355673656737567385673956740567415674256743567445674556746567475674856749567505675156752567535675456755567565675756758567595676056761567625676356764567655676656767567685676956770567715677256773567745677556776567775677856779567805678156782567835678456785567865678756788567895679056791567925679356794567955679656797567985679956800568015680256803568045680556806568075680856809568105681156812568135681456815568165681756818568195682056821568225682356824568255682656827568285682956830568315683256833568345683556836568375683856839568405684156842568435684456845568465684756848568495685056851568525685356854568555685656857568585685956860568615686256863568645686556866568675686856869568705687156872568735687456875568765687756878568795688056881568825688356884568855688656887568885688956890568915689256893568945689556896568975689856899569005690156902569035690456905569065690756908569095691056911569125691356914569155691656917569185691956920569215692256923569245692556926569275692856929569305693156932569335693456935569365693756938569395694056941569425694356944569455694656947569485694956950569515695256953569545695556956569575695856959569605696156962569635696456965569665696756968569695697056971569725697356974569755697656977569785697956980569815698256983569845698556986569875698856989569905699156992569935699456995569965699756998569995700057001570025700357004570055700657007570085700957010570115701257013570145701557016570175701857019570205702157022570235702457025570265702757028570295703057031570325703357034570355703657037570385703957040570415704257043570445704557046570475704857049570505705157052570535705457055570565705757058570595706057061570625706357064570655706657067570685706957070570715707257073570745707557076570775707857079570805708157082570835708457085570865708757088570895709057091570925709357094570955709657097570985709957100571015710257103571045710557106571075710857109571105711157112571135711457115571165711757118571195712057121571225712357124571255712657127571285712957130571315713257133571345713557136571375713857139571405714157142571435714457145571465714757148571495715057151571525715357154571555715657157571585715957160571615716257163571645716557166571675716857169571705717157172571735717457175571765717757178571795718057181571825718357184571855718657187571885718957190571915719257193571945719557196571975719857199572005720157202572035720457205572065720757208572095721057211572125721357214572155721657217572185721957220572215722257223572245722557226572275722857229572305723157232572335723457235572365723757238572395724057241572425724357244572455724657247572485724957250572515725257253572545725557256572575725857259572605726157262572635726457265572665726757268572695727057271572725727357274572755727657277572785727957280572815728257283572845728557286572875728857289572905729157292572935729457295572965729757298572995730057301573025730357304573055730657307573085730957310573115731257313573145731557316573175731857319573205732157322573235732457325573265732757328573295733057331573325733357334573355733657337573385733957340573415734257343573445734557346573475734857349573505735157352573535735457355573565735757358573595736057361573625736357364573655736657367573685736957370573715737257373573745737557376573775737857379573805738157382573835738457385573865738757388573895739057391573925739357394573955739657397573985739957400574015740257403574045740557406574075740857409574105741157412574135741457415574165741757418574195742057421574225742357424574255742657427574285742957430574315743257433574345743557436574375743857439574405744157442574435744457445574465744757448574495745057451574525745357454574555745657457574585745957460574615746257463574645746557466574675746857469574705747157472574735747457475574765747757478574795748057481574825748357484574855748657487574885748957490574915749257493574945749557496574975749857499575005750157502575035750457505575065750757508575095751057511575125751357514575155751657517575185751957520575215752257523575245752557526575275752857529575305753157532575335753457535575365753757538575395754057541575425754357544575455754657547575485754957550575515755257553575545755557556575575755857559575605756157562575635756457565575665756757568575695757057571575725757357574575755757657577575785757957580575815758257583575845758557586575875758857589575905759157592575935759457595575965759757598575995760057601576025760357604576055760657607576085760957610576115761257613576145761557616576175761857619576205762157622576235762457625576265762757628576295763057631576325763357634576355763657637576385763957640576415764257643576445764557646576475764857649576505765157652576535765457655576565765757658576595766057661576625766357664576655766657667576685766957670576715767257673576745767557676576775767857679576805768157682576835768457685576865768757688576895769057691576925769357694576955769657697576985769957700577015770257703577045770557706577075770857709577105771157712577135771457715577165771757718577195772057721577225772357724577255772657727577285772957730577315773257733577345773557736577375773857739577405774157742577435774457745577465774757748577495775057751577525775357754577555775657757577585775957760577615776257763577645776557766577675776857769577705777157772577735777457775577765777757778577795778057781577825778357784577855778657787577885778957790577915779257793577945779557796577975779857799578005780157802578035780457805578065780757808578095781057811578125781357814578155781657817578185781957820578215782257823578245782557826578275782857829578305783157832578335783457835578365783757838578395784057841578425784357844578455784657847578485784957850578515785257853578545785557856578575785857859578605786157862578635786457865578665786757868578695787057871578725787357874578755787657877578785787957880578815788257883578845788557886578875788857889578905789157892578935789457895578965789757898578995790057901579025790357904579055790657907579085790957910579115791257913579145791557916579175791857919579205792157922579235792457925579265792757928579295793057931579325793357934579355793657937579385793957940579415794257943579445794557946579475794857949579505795157952579535795457955579565795757958579595796057961579625796357964579655796657967579685796957970579715797257973579745797557976579775797857979579805798157982579835798457985579865798757988579895799057991579925799357994579955799657997579985799958000580015800258003580045800558006580075800858009580105801158012580135801458015580165801758018580195802058021580225802358024580255802658027580285802958030580315803258033580345803558036580375803858039580405804158042580435804458045580465804758048580495805058051580525805358054580555805658057580585805958060580615806258063580645806558066580675806858069580705807158072580735807458075580765807758078580795808058081580825808358084580855808658087580885808958090580915809258093580945809558096580975809858099581005810158102581035810458105581065810758108581095811058111581125811358114581155811658117581185811958120581215812258123581245812558126581275812858129581305813158132581335813458135581365813758138581395814058141581425814358144581455814658147581485814958150581515815258153581545815558156581575815858159581605816158162581635816458165581665816758168581695817058171581725817358174581755817658177581785817958180581815818258183581845818558186581875818858189581905819158192581935819458195581965819758198581995820058201582025820358204582055820658207582085820958210582115821258213582145821558216582175821858219582205822158222582235822458225582265822758228582295823058231582325823358234582355823658237582385823958240582415824258243582445824558246582475824858249582505825158252582535825458255582565825758258582595826058261582625826358264582655826658267582685826958270582715827258273582745827558276582775827858279582805828158282582835828458285582865828758288582895829058291582925829358294582955829658297582985829958300583015830258303583045830558306583075830858309583105831158312583135831458315583165831758318583195832058321583225832358324583255832658327583285832958330583315833258333583345833558336583375833858339583405834158342583435834458345583465834758348583495835058351583525835358354583555835658357583585835958360583615836258363583645836558366583675836858369583705837158372583735837458375583765837758378583795838058381583825838358384583855838658387583885838958390583915839258393583945839558396583975839858399584005840158402584035840458405584065840758408584095841058411584125841358414584155841658417584185841958420584215842258423584245842558426584275842858429584305843158432584335843458435584365843758438584395844058441584425844358444584455844658447584485844958450584515845258453584545845558456584575845858459584605846158462584635846458465584665846758468584695847058471584725847358474584755847658477584785847958480584815848258483584845848558486584875848858489584905849158492584935849458495584965849758498584995850058501585025850358504585055850658507585085850958510585115851258513585145851558516585175851858519585205852158522585235852458525585265852758528585295853058531585325853358534585355853658537585385853958540585415854258543585445854558546585475854858549585505855158552585535855458555585565855758558585595856058561585625856358564585655856658567585685856958570585715857258573585745857558576585775857858579585805858158582585835858458585585865858758588585895859058591585925859358594585955859658597585985859958600586015860258603586045860558606586075860858609586105861158612586135861458615586165861758618586195862058621586225862358624586255862658627586285862958630586315863258633586345863558636586375863858639586405864158642586435864458645586465864758648586495865058651586525865358654586555865658657586585865958660586615866258663586645866558666586675866858669586705867158672586735867458675586765867758678586795868058681586825868358684586855868658687586885868958690586915869258693586945869558696586975869858699587005870158702587035870458705587065870758708587095871058711587125871358714587155871658717587185871958720587215872258723587245872558726587275872858729587305873158732587335873458735587365873758738587395874058741587425874358744587455874658747587485874958750587515875258753587545875558756587575875858759587605876158762587635876458765587665876758768587695877058771587725877358774587755877658777587785877958780587815878258783587845878558786587875878858789587905879158792587935879458795587965879758798587995880058801588025880358804588055880658807588085880958810588115881258813588145881558816588175881858819588205882158822588235882458825588265882758828588295883058831588325883358834588355883658837588385883958840588415884258843588445884558846588475884858849588505885158852588535885458855588565885758858588595886058861588625886358864588655886658867588685886958870588715887258873588745887558876588775887858879588805888158882588835888458885588865888758888588895889058891588925889358894588955889658897588985889958900589015890258903589045890558906589075890858909589105891158912589135891458915589165891758918589195892058921589225892358924589255892658927589285892958930589315893258933589345893558936589375893858939589405894158942589435894458945589465894758948589495895058951589525895358954589555895658957589585895958960589615896258963589645896558966589675896858969589705897158972589735897458975589765897758978589795898058981589825898358984589855898658987589885898958990589915899258993589945899558996589975899858999590005900159002590035900459005590065900759008590095901059011590125901359014590155901659017590185901959020590215902259023590245902559026590275902859029590305903159032590335903459035590365903759038590395904059041590425904359044590455904659047590485904959050590515905259053590545905559056590575905859059590605906159062590635906459065590665906759068590695907059071590725907359074590755907659077590785907959080590815908259083590845908559086590875908859089590905909159092590935909459095590965909759098590995910059101591025910359104591055910659107591085910959110591115911259113591145911559116591175911859119591205912159122591235912459125591265912759128591295913059131591325913359134591355913659137591385913959140591415914259143591445914559146591475914859149591505915159152591535915459155591565915759158591595916059161591625916359164591655916659167591685916959170591715917259173591745917559176591775917859179591805918159182591835918459185591865918759188591895919059191591925919359194591955919659197591985919959200592015920259203592045920559206592075920859209592105921159212592135921459215592165921759218592195922059221592225922359224592255922659227592285922959230592315923259233592345923559236592375923859239592405924159242592435924459245592465924759248592495925059251592525925359254592555925659257592585925959260592615926259263592645926559266592675926859269592705927159272592735927459275592765927759278592795928059281592825928359284592855928659287592885928959290592915929259293592945929559296592975929859299593005930159302593035930459305593065930759308593095931059311593125931359314593155931659317593185931959320593215932259323593245932559326593275932859329593305933159332593335933459335593365933759338593395934059341593425934359344593455934659347593485934959350593515935259353593545935559356593575935859359593605936159362593635936459365593665936759368593695937059371593725937359374593755937659377593785937959380593815938259383593845938559386593875938859389593905939159392593935939459395593965939759398593995940059401594025940359404594055940659407594085940959410594115941259413594145941559416594175941859419594205942159422594235942459425594265942759428594295943059431594325943359434594355943659437594385943959440594415944259443594445944559446594475944859449594505945159452594535945459455594565945759458594595946059461594625946359464594655946659467594685946959470594715947259473594745947559476594775947859479594805948159482594835948459485594865948759488594895949059491594925949359494594955949659497594985949959500595015950259503595045950559506595075950859509595105951159512595135951459515595165951759518595195952059521595225952359524595255952659527595285952959530595315953259533595345953559536595375953859539595405954159542595435954459545595465954759548595495955059551595525955359554595555955659557595585955959560595615956259563595645956559566595675956859569595705957159572595735957459575595765957759578595795958059581595825958359584595855958659587595885958959590595915959259593595945959559596595975959859599596005960159602596035960459605596065960759608596095961059611596125961359614596155961659617596185961959620596215962259623596245962559626596275962859629596305963159632596335963459635596365963759638596395964059641596425964359644596455964659647596485964959650596515965259653596545965559656596575965859659596605966159662596635966459665596665966759668596695967059671596725967359674596755967659677596785967959680596815968259683596845968559686596875968859689596905969159692596935969459695596965969759698596995970059701597025970359704597055970659707597085970959710597115971259713597145971559716597175971859719597205972159722597235972459725597265972759728597295973059731597325973359734597355973659737597385973959740597415974259743597445974559746597475974859749597505975159752597535975459755597565975759758597595976059761597625976359764597655976659767597685976959770597715977259773597745977559776597775977859779597805978159782597835978459785597865978759788597895979059791597925979359794597955979659797597985979959800598015980259803598045980559806598075980859809598105981159812598135981459815598165981759818598195982059821598225982359824598255982659827598285982959830598315983259833598345983559836598375983859839598405984159842598435984459845598465984759848598495985059851598525985359854598555985659857598585985959860598615986259863598645986559866598675986859869598705987159872598735987459875598765987759878598795988059881598825988359884598855988659887598885988959890598915989259893598945989559896598975989859899599005990159902599035990459905599065990759908599095991059911599125991359914599155991659917599185991959920599215992259923599245992559926599275992859929599305993159932599335993459935599365993759938599395994059941599425994359944599455994659947599485994959950599515995259953599545995559956599575995859959599605996159962599635996459965599665996759968599695997059971599725997359974599755997659977599785997959980599815998259983599845998559986599875998859989599905999159992599935999459995599965999759998599996000060001600026000360004600056000660007600086000960010600116001260013600146001560016600176001860019600206002160022600236002460025600266002760028600296003060031600326003360034600356003660037600386003960040600416004260043600446004560046600476004860049600506005160052600536005460055600566005760058600596006060061600626006360064600656006660067600686006960070600716007260073600746007560076600776007860079600806008160082600836008460085600866008760088600896009060091600926009360094600956009660097600986009960100601016010260103601046010560106601076010860109601106011160112601136011460115601166011760118601196012060121601226012360124601256012660127601286012960130601316013260133601346013560136601376013860139601406014160142601436014460145601466014760148601496015060151601526015360154601556015660157601586015960160601616016260163601646016560166601676016860169601706017160172601736017460175601766017760178601796018060181601826018360184601856018660187601886018960190601916019260193601946019560196601976019860199602006020160202602036020460205602066020760208602096021060211602126021360214602156021660217602186021960220602216022260223602246022560226602276022860229602306023160232602336023460235602366023760238602396024060241602426024360244602456024660247602486024960250602516025260253602546025560256602576025860259602606026160262602636026460265602666026760268602696027060271602726027360274602756027660277602786027960280602816028260283602846028560286602876028860289602906029160292602936029460295602966029760298602996030060301603026030360304603056030660307603086030960310603116031260313603146031560316603176031860319603206032160322603236032460325603266032760328603296033060331603326033360334603356033660337603386033960340603416034260343603446034560346603476034860349603506035160352603536035460355603566035760358603596036060361603626036360364603656036660367603686036960370603716037260373603746037560376603776037860379603806038160382603836038460385603866038760388603896039060391603926039360394603956039660397603986039960400604016040260403604046040560406604076040860409604106041160412604136041460415604166041760418604196042060421604226042360424604256042660427604286042960430604316043260433604346043560436604376043860439604406044160442604436044460445604466044760448604496045060451604526045360454604556045660457604586045960460604616046260463604646046560466604676046860469604706047160472604736047460475604766047760478604796048060481604826048360484604856048660487604886048960490604916049260493604946049560496604976049860499605006050160502605036050460505605066050760508605096051060511605126051360514605156051660517605186051960520605216052260523605246052560526605276052860529605306053160532605336053460535605366053760538605396054060541605426054360544605456054660547605486054960550605516055260553605546055560556605576055860559605606056160562605636056460565605666056760568605696057060571605726057360574605756057660577605786057960580605816058260583605846058560586605876058860589605906059160592605936059460595605966059760598605996060060601606026060360604606056060660607606086060960610606116061260613606146061560616606176061860619606206062160622606236062460625606266062760628606296063060631606326063360634606356063660637606386063960640606416064260643606446064560646606476064860649606506065160652606536065460655606566065760658606596066060661606626066360664606656066660667606686066960670606716067260673606746067560676606776067860679606806068160682606836068460685606866068760688606896069060691606926069360694606956069660697606986069960700607016070260703607046070560706607076070860709607106071160712607136071460715607166071760718607196072060721607226072360724607256072660727607286072960730607316073260733607346073560736607376073860739607406074160742607436074460745607466074760748607496075060751607526075360754607556075660757607586075960760607616076260763607646076560766607676076860769607706077160772607736077460775607766077760778607796078060781607826078360784607856078660787607886078960790607916079260793607946079560796607976079860799608006080160802608036080460805608066080760808608096081060811608126081360814608156081660817608186081960820608216082260823608246082560826608276082860829608306083160832608336083460835608366083760838608396084060841608426084360844608456084660847608486084960850608516085260853608546085560856608576085860859608606086160862608636086460865608666086760868608696087060871608726087360874608756087660877608786087960880608816088260883608846088560886608876088860889608906089160892608936089460895608966089760898608996090060901609026090360904609056090660907609086090960910609116091260913609146091560916609176091860919609206092160922609236092460925609266092760928609296093060931609326093360934609356093660937609386093960940609416094260943609446094560946609476094860949609506095160952609536095460955609566095760958609596096060961609626096360964609656096660967609686096960970609716097260973609746097560976609776097860979609806098160982609836098460985609866098760988609896099060991609926099360994609956099660997609986099961000610016100261003610046100561006610076100861009610106101161012610136101461015610166101761018610196102061021610226102361024610256102661027610286102961030610316103261033610346103561036610376103861039610406104161042610436104461045610466104761048610496105061051610526105361054610556105661057610586105961060610616106261063610646106561066610676106861069610706107161072610736107461075610766107761078610796108061081610826108361084610856108661087610886108961090610916109261093610946109561096610976109861099611006110161102611036110461105611066110761108611096111061111611126111361114611156111661117611186111961120611216112261123611246112561126611276112861129611306113161132611336113461135611366113761138611396114061141611426114361144611456114661147611486114961150611516115261153611546115561156611576115861159611606116161162611636116461165611666116761168611696117061171611726117361174611756117661177611786117961180611816118261183611846118561186611876118861189611906119161192611936119461195611966119761198611996120061201612026120361204612056120661207612086120961210612116121261213612146121561216612176121861219612206122161222612236122461225612266122761228612296123061231612326123361234612356123661237612386123961240612416124261243612446124561246612476124861249612506125161252612536125461255612566125761258612596126061261612626126361264612656126661267612686126961270612716127261273612746127561276612776127861279612806128161282612836128461285612866128761288612896129061291612926129361294612956129661297612986129961300613016130261303613046130561306613076130861309613106131161312613136131461315613166131761318613196132061321613226132361324613256132661327613286132961330613316133261333613346133561336613376133861339613406134161342613436134461345613466134761348613496135061351613526135361354613556135661357613586135961360613616136261363613646136561366613676136861369613706137161372613736137461375613766137761378613796138061381613826138361384613856138661387613886138961390613916139261393613946139561396613976139861399614006140161402614036140461405614066140761408614096141061411614126141361414614156141661417614186141961420614216142261423614246142561426614276142861429614306143161432614336143461435614366143761438614396144061441614426144361444614456144661447614486144961450614516145261453614546145561456614576145861459614606146161462614636146461465614666146761468614696147061471614726147361474614756147661477614786147961480614816148261483614846148561486614876148861489614906149161492614936149461495614966149761498614996150061501615026150361504615056150661507615086150961510615116151261513615146151561516615176151861519615206152161522615236152461525615266152761528615296153061531615326153361534615356153661537615386153961540615416154261543615446154561546615476154861549615506155161552615536155461555615566155761558615596156061561615626156361564615656156661567615686156961570615716157261573615746157561576615776157861579615806158161582615836158461585615866158761588615896159061591615926159361594615956159661597615986159961600616016160261603616046160561606616076160861609616106161161612616136161461615616166161761618616196162061621616226162361624616256162661627616286162961630616316163261633616346163561636616376163861639616406164161642616436164461645616466164761648616496165061651616526165361654616556165661657616586165961660616616166261663616646166561666616676166861669616706167161672616736167461675616766167761678616796168061681616826168361684616856168661687616886168961690616916169261693616946169561696616976169861699617006170161702617036170461705617066170761708617096171061711617126171361714617156171661717617186171961720617216172261723617246172561726617276172861729617306173161732617336173461735617366173761738617396174061741617426174361744617456174661747617486174961750617516175261753617546175561756617576175861759617606176161762617636176461765617666176761768617696177061771617726177361774617756177661777617786177961780617816178261783617846178561786617876178861789617906179161792617936179461795617966179761798617996180061801618026180361804618056180661807618086180961810618116181261813618146181561816618176181861819618206182161822618236182461825618266182761828618296183061831618326183361834618356183661837618386183961840618416184261843618446184561846618476184861849618506185161852618536185461855618566185761858618596186061861618626186361864618656186661867618686186961870618716187261873618746187561876618776187861879618806188161882618836188461885618866188761888618896189061891618926189361894618956189661897618986189961900619016190261903619046190561906619076190861909619106191161912619136191461915619166191761918619196192061921619226192361924619256192661927619286192961930619316193261933619346193561936619376193861939619406194161942619436194461945619466194761948619496195061951619526195361954619556195661957619586195961960619616196261963619646196561966619676196861969619706197161972619736197461975619766197761978619796198061981619826198361984619856198661987619886198961990619916199261993619946199561996619976199861999620006200162002620036200462005620066200762008620096201062011620126201362014620156201662017620186201962020620216202262023620246202562026620276202862029620306203162032620336203462035620366203762038620396204062041620426204362044620456204662047620486204962050620516205262053620546205562056620576205862059620606206162062620636206462065620666206762068620696207062071620726207362074620756207662077620786207962080620816208262083620846208562086620876208862089620906209162092620936209462095620966209762098620996210062101621026210362104621056210662107621086210962110621116211262113621146211562116621176211862119621206212162122621236212462125621266212762128621296213062131621326213362134621356213662137621386213962140621416214262143621446214562146621476214862149621506215162152621536215462155621566215762158621596216062161621626216362164621656216662167621686216962170621716217262173621746217562176621776217862179621806218162182621836218462185621866218762188621896219062191621926219362194621956219662197621986219962200622016220262203622046220562206622076220862209622106221162212622136221462215622166221762218622196222062221622226222362224622256222662227622286222962230622316223262233622346223562236622376223862239622406224162242622436224462245622466224762248622496225062251622526225362254622556225662257622586225962260622616226262263622646226562266622676226862269622706227162272622736227462275622766227762278622796228062281622826228362284622856228662287622886228962290622916229262293622946229562296622976229862299623006230162302623036230462305623066230762308623096231062311623126231362314623156231662317623186231962320623216232262323623246232562326623276232862329623306233162332623336233462335623366233762338623396234062341623426234362344623456234662347623486234962350623516235262353623546235562356623576235862359623606236162362623636236462365623666236762368623696237062371623726237362374623756237662377623786237962380623816238262383623846238562386623876238862389623906239162392623936239462395623966239762398623996240062401624026240362404624056240662407624086240962410624116241262413624146241562416624176241862419624206242162422624236242462425624266242762428624296243062431624326243362434624356243662437624386243962440624416244262443624446244562446624476244862449624506245162452624536245462455624566245762458624596246062461624626246362464624656246662467624686246962470624716247262473624746247562476624776247862479624806248162482624836248462485624866248762488624896249062491624926249362494624956249662497624986249962500625016250262503625046250562506625076250862509625106251162512625136251462515625166251762518625196252062521625226252362524625256252662527625286252962530625316253262533625346253562536625376253862539625406254162542625436254462545625466254762548625496255062551625526255362554625556255662557625586255962560625616256262563625646256562566625676256862569625706257162572625736257462575625766257762578625796258062581625826258362584625856258662587625886258962590625916259262593625946259562596625976259862599626006260162602626036260462605626066260762608626096261062611626126261362614626156261662617626186261962620626216262262623626246262562626626276262862629626306263162632626336263462635626366263762638626396264062641626426264362644626456264662647626486264962650626516265262653626546265562656626576265862659626606266162662626636266462665626666266762668626696267062671626726267362674626756267662677626786267962680626816268262683626846268562686626876268862689626906269162692626936269462695626966269762698626996270062701627026270362704627056270662707627086270962710627116271262713627146271562716627176271862719627206272162722627236272462725627266272762728627296273062731627326273362734627356273662737627386273962740627416274262743627446274562746627476274862749627506275162752627536275462755627566275762758627596276062761627626276362764627656276662767627686276962770627716277262773627746277562776627776277862779627806278162782627836278462785627866278762788627896279062791627926279362794627956279662797627986279962800628016280262803628046280562806628076280862809628106281162812628136281462815628166281762818628196282062821628226282362824628256282662827628286282962830628316283262833628346283562836628376283862839628406284162842628436284462845628466284762848628496285062851628526285362854628556285662857628586285962860628616286262863628646286562866628676286862869628706287162872628736287462875628766287762878628796288062881628826288362884628856288662887628886288962890628916289262893628946289562896628976289862899629006290162902629036290462905629066290762908629096291062911629126291362914629156291662917629186291962920629216292262923629246292562926629276292862929629306293162932629336293462935629366293762938629396294062941629426294362944629456294662947629486294962950629516295262953629546295562956629576295862959629606296162962629636296462965629666296762968629696297062971629726297362974629756297662977629786297962980629816298262983629846298562986629876298862989629906299162992629936299462995629966299762998629996300063001630026300363004630056300663007630086300963010630116301263013630146301563016630176301863019630206302163022630236302463025630266302763028630296303063031630326303363034630356303663037
  1. // Package compute provides access to the Compute Engine API.
  2. //
  3. // See https://developers.google.com/compute/docs/reference/latest/
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/compute/v1"
  8. // ...
  9. // computeService, err := compute.New(oauthHttpClient)
  10. package compute // import "google.golang.org/api/compute/v1"
  11. import (
  12. "bytes"
  13. "encoding/json"
  14. "errors"
  15. "fmt"
  16. context "golang.org/x/net/context"
  17. ctxhttp "golang.org/x/net/context/ctxhttp"
  18. gensupport "google.golang.org/api/gensupport"
  19. googleapi "google.golang.org/api/googleapi"
  20. "io"
  21. "net/http"
  22. "net/url"
  23. "strconv"
  24. "strings"
  25. )
  26. // Always reference these packages, just in case the auto-generated code
  27. // below doesn't.
  28. var _ = bytes.NewBuffer
  29. var _ = strconv.Itoa
  30. var _ = fmt.Sprintf
  31. var _ = json.NewDecoder
  32. var _ = io.Copy
  33. var _ = url.Parse
  34. var _ = gensupport.MarshalJSON
  35. var _ = googleapi.Version
  36. var _ = errors.New
  37. var _ = strings.Replace
  38. var _ = context.Canceled
  39. var _ = ctxhttp.Do
  40. const apiId = "compute:v1"
  41. const apiName = "compute"
  42. const apiVersion = "v1"
  43. const basePath = "https://www.googleapis.com/compute/v1/projects/"
  44. // OAuth2 scopes used by this API.
  45. const (
  46. // View and manage your data across Google Cloud Platform services
  47. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
  48. // View and manage your Google Compute Engine resources
  49. ComputeScope = "https://www.googleapis.com/auth/compute"
  50. // View your Google Compute Engine resources
  51. ComputeReadonlyScope = "https://www.googleapis.com/auth/compute.readonly"
  52. // Manage your data and permissions in Google Cloud Storage
  53. DevstorageFullControlScope = "https://www.googleapis.com/auth/devstorage.full_control"
  54. // View your data in Google Cloud Storage
  55. DevstorageReadOnlyScope = "https://www.googleapis.com/auth/devstorage.read_only"
  56. // Manage your data in Google Cloud Storage
  57. DevstorageReadWriteScope = "https://www.googleapis.com/auth/devstorage.read_write"
  58. )
  59. func New(client *http.Client) (*Service, error) {
  60. if client == nil {
  61. return nil, errors.New("client is nil")
  62. }
  63. s := &Service{client: client, BasePath: basePath}
  64. s.Addresses = NewAddressesService(s)
  65. s.Autoscalers = NewAutoscalersService(s)
  66. s.BackendBuckets = NewBackendBucketsService(s)
  67. s.BackendServices = NewBackendServicesService(s)
  68. s.DiskTypes = NewDiskTypesService(s)
  69. s.Disks = NewDisksService(s)
  70. s.Firewalls = NewFirewallsService(s)
  71. s.ForwardingRules = NewForwardingRulesService(s)
  72. s.GlobalAddresses = NewGlobalAddressesService(s)
  73. s.GlobalForwardingRules = NewGlobalForwardingRulesService(s)
  74. s.GlobalOperations = NewGlobalOperationsService(s)
  75. s.HealthChecks = NewHealthChecksService(s)
  76. s.HttpHealthChecks = NewHttpHealthChecksService(s)
  77. s.HttpsHealthChecks = NewHttpsHealthChecksService(s)
  78. s.Images = NewImagesService(s)
  79. s.InstanceGroupManagers = NewInstanceGroupManagersService(s)
  80. s.InstanceGroups = NewInstanceGroupsService(s)
  81. s.InstanceTemplates = NewInstanceTemplatesService(s)
  82. s.Instances = NewInstancesService(s)
  83. s.Licenses = NewLicensesService(s)
  84. s.MachineTypes = NewMachineTypesService(s)
  85. s.Networks = NewNetworksService(s)
  86. s.Projects = NewProjectsService(s)
  87. s.RegionAutoscalers = NewRegionAutoscalersService(s)
  88. s.RegionBackendServices = NewRegionBackendServicesService(s)
  89. s.RegionInstanceGroupManagers = NewRegionInstanceGroupManagersService(s)
  90. s.RegionInstanceGroups = NewRegionInstanceGroupsService(s)
  91. s.RegionOperations = NewRegionOperationsService(s)
  92. s.Regions = NewRegionsService(s)
  93. s.Routers = NewRoutersService(s)
  94. s.Routes = NewRoutesService(s)
  95. s.Snapshots = NewSnapshotsService(s)
  96. s.SslCertificates = NewSslCertificatesService(s)
  97. s.Subnetworks = NewSubnetworksService(s)
  98. s.TargetHttpProxies = NewTargetHttpProxiesService(s)
  99. s.TargetHttpsProxies = NewTargetHttpsProxiesService(s)
  100. s.TargetInstances = NewTargetInstancesService(s)
  101. s.TargetPools = NewTargetPoolsService(s)
  102. s.TargetSslProxies = NewTargetSslProxiesService(s)
  103. s.TargetTcpProxies = NewTargetTcpProxiesService(s)
  104. s.TargetVpnGateways = NewTargetVpnGatewaysService(s)
  105. s.UrlMaps = NewUrlMapsService(s)
  106. s.VpnTunnels = NewVpnTunnelsService(s)
  107. s.ZoneOperations = NewZoneOperationsService(s)
  108. s.Zones = NewZonesService(s)
  109. return s, nil
  110. }
  111. type Service struct {
  112. client *http.Client
  113. BasePath string // API endpoint base URL
  114. UserAgent string // optional additional User-Agent fragment
  115. Addresses *AddressesService
  116. Autoscalers *AutoscalersService
  117. BackendBuckets *BackendBucketsService
  118. BackendServices *BackendServicesService
  119. DiskTypes *DiskTypesService
  120. Disks *DisksService
  121. Firewalls *FirewallsService
  122. ForwardingRules *ForwardingRulesService
  123. GlobalAddresses *GlobalAddressesService
  124. GlobalForwardingRules *GlobalForwardingRulesService
  125. GlobalOperations *GlobalOperationsService
  126. HealthChecks *HealthChecksService
  127. HttpHealthChecks *HttpHealthChecksService
  128. HttpsHealthChecks *HttpsHealthChecksService
  129. Images *ImagesService
  130. InstanceGroupManagers *InstanceGroupManagersService
  131. InstanceGroups *InstanceGroupsService
  132. InstanceTemplates *InstanceTemplatesService
  133. Instances *InstancesService
  134. Licenses *LicensesService
  135. MachineTypes *MachineTypesService
  136. Networks *NetworksService
  137. Projects *ProjectsService
  138. RegionAutoscalers *RegionAutoscalersService
  139. RegionBackendServices *RegionBackendServicesService
  140. RegionInstanceGroupManagers *RegionInstanceGroupManagersService
  141. RegionInstanceGroups *RegionInstanceGroupsService
  142. RegionOperations *RegionOperationsService
  143. Regions *RegionsService
  144. Routers *RoutersService
  145. Routes *RoutesService
  146. Snapshots *SnapshotsService
  147. SslCertificates *SslCertificatesService
  148. Subnetworks *SubnetworksService
  149. TargetHttpProxies *TargetHttpProxiesService
  150. TargetHttpsProxies *TargetHttpsProxiesService
  151. TargetInstances *TargetInstancesService
  152. TargetPools *TargetPoolsService
  153. TargetSslProxies *TargetSslProxiesService
  154. TargetTcpProxies *TargetTcpProxiesService
  155. TargetVpnGateways *TargetVpnGatewaysService
  156. UrlMaps *UrlMapsService
  157. VpnTunnels *VpnTunnelsService
  158. ZoneOperations *ZoneOperationsService
  159. Zones *ZonesService
  160. }
  161. func (s *Service) userAgent() string {
  162. if s.UserAgent == "" {
  163. return googleapi.UserAgent
  164. }
  165. return googleapi.UserAgent + " " + s.UserAgent
  166. }
  167. func NewAddressesService(s *Service) *AddressesService {
  168. rs := &AddressesService{s: s}
  169. return rs
  170. }
  171. type AddressesService struct {
  172. s *Service
  173. }
  174. func NewAutoscalersService(s *Service) *AutoscalersService {
  175. rs := &AutoscalersService{s: s}
  176. return rs
  177. }
  178. type AutoscalersService struct {
  179. s *Service
  180. }
  181. func NewBackendBucketsService(s *Service) *BackendBucketsService {
  182. rs := &BackendBucketsService{s: s}
  183. return rs
  184. }
  185. type BackendBucketsService struct {
  186. s *Service
  187. }
  188. func NewBackendServicesService(s *Service) *BackendServicesService {
  189. rs := &BackendServicesService{s: s}
  190. return rs
  191. }
  192. type BackendServicesService struct {
  193. s *Service
  194. }
  195. func NewDiskTypesService(s *Service) *DiskTypesService {
  196. rs := &DiskTypesService{s: s}
  197. return rs
  198. }
  199. type DiskTypesService struct {
  200. s *Service
  201. }
  202. func NewDisksService(s *Service) *DisksService {
  203. rs := &DisksService{s: s}
  204. return rs
  205. }
  206. type DisksService struct {
  207. s *Service
  208. }
  209. func NewFirewallsService(s *Service) *FirewallsService {
  210. rs := &FirewallsService{s: s}
  211. return rs
  212. }
  213. type FirewallsService struct {
  214. s *Service
  215. }
  216. func NewForwardingRulesService(s *Service) *ForwardingRulesService {
  217. rs := &ForwardingRulesService{s: s}
  218. return rs
  219. }
  220. type ForwardingRulesService struct {
  221. s *Service
  222. }
  223. func NewGlobalAddressesService(s *Service) *GlobalAddressesService {
  224. rs := &GlobalAddressesService{s: s}
  225. return rs
  226. }
  227. type GlobalAddressesService struct {
  228. s *Service
  229. }
  230. func NewGlobalForwardingRulesService(s *Service) *GlobalForwardingRulesService {
  231. rs := &GlobalForwardingRulesService{s: s}
  232. return rs
  233. }
  234. type GlobalForwardingRulesService struct {
  235. s *Service
  236. }
  237. func NewGlobalOperationsService(s *Service) *GlobalOperationsService {
  238. rs := &GlobalOperationsService{s: s}
  239. return rs
  240. }
  241. type GlobalOperationsService struct {
  242. s *Service
  243. }
  244. func NewHealthChecksService(s *Service) *HealthChecksService {
  245. rs := &HealthChecksService{s: s}
  246. return rs
  247. }
  248. type HealthChecksService struct {
  249. s *Service
  250. }
  251. func NewHttpHealthChecksService(s *Service) *HttpHealthChecksService {
  252. rs := &HttpHealthChecksService{s: s}
  253. return rs
  254. }
  255. type HttpHealthChecksService struct {
  256. s *Service
  257. }
  258. func NewHttpsHealthChecksService(s *Service) *HttpsHealthChecksService {
  259. rs := &HttpsHealthChecksService{s: s}
  260. return rs
  261. }
  262. type HttpsHealthChecksService struct {
  263. s *Service
  264. }
  265. func NewImagesService(s *Service) *ImagesService {
  266. rs := &ImagesService{s: s}
  267. return rs
  268. }
  269. type ImagesService struct {
  270. s *Service
  271. }
  272. func NewInstanceGroupManagersService(s *Service) *InstanceGroupManagersService {
  273. rs := &InstanceGroupManagersService{s: s}
  274. return rs
  275. }
  276. type InstanceGroupManagersService struct {
  277. s *Service
  278. }
  279. func NewInstanceGroupsService(s *Service) *InstanceGroupsService {
  280. rs := &InstanceGroupsService{s: s}
  281. return rs
  282. }
  283. type InstanceGroupsService struct {
  284. s *Service
  285. }
  286. func NewInstanceTemplatesService(s *Service) *InstanceTemplatesService {
  287. rs := &InstanceTemplatesService{s: s}
  288. return rs
  289. }
  290. type InstanceTemplatesService struct {
  291. s *Service
  292. }
  293. func NewInstancesService(s *Service) *InstancesService {
  294. rs := &InstancesService{s: s}
  295. return rs
  296. }
  297. type InstancesService struct {
  298. s *Service
  299. }
  300. func NewLicensesService(s *Service) *LicensesService {
  301. rs := &LicensesService{s: s}
  302. return rs
  303. }
  304. type LicensesService struct {
  305. s *Service
  306. }
  307. func NewMachineTypesService(s *Service) *MachineTypesService {
  308. rs := &MachineTypesService{s: s}
  309. return rs
  310. }
  311. type MachineTypesService struct {
  312. s *Service
  313. }
  314. func NewNetworksService(s *Service) *NetworksService {
  315. rs := &NetworksService{s: s}
  316. return rs
  317. }
  318. type NetworksService struct {
  319. s *Service
  320. }
  321. func NewProjectsService(s *Service) *ProjectsService {
  322. rs := &ProjectsService{s: s}
  323. return rs
  324. }
  325. type ProjectsService struct {
  326. s *Service
  327. }
  328. func NewRegionAutoscalersService(s *Service) *RegionAutoscalersService {
  329. rs := &RegionAutoscalersService{s: s}
  330. return rs
  331. }
  332. type RegionAutoscalersService struct {
  333. s *Service
  334. }
  335. func NewRegionBackendServicesService(s *Service) *RegionBackendServicesService {
  336. rs := &RegionBackendServicesService{s: s}
  337. return rs
  338. }
  339. type RegionBackendServicesService struct {
  340. s *Service
  341. }
  342. func NewRegionInstanceGroupManagersService(s *Service) *RegionInstanceGroupManagersService {
  343. rs := &RegionInstanceGroupManagersService{s: s}
  344. return rs
  345. }
  346. type RegionInstanceGroupManagersService struct {
  347. s *Service
  348. }
  349. func NewRegionInstanceGroupsService(s *Service) *RegionInstanceGroupsService {
  350. rs := &RegionInstanceGroupsService{s: s}
  351. return rs
  352. }
  353. type RegionInstanceGroupsService struct {
  354. s *Service
  355. }
  356. func NewRegionOperationsService(s *Service) *RegionOperationsService {
  357. rs := &RegionOperationsService{s: s}
  358. return rs
  359. }
  360. type RegionOperationsService struct {
  361. s *Service
  362. }
  363. func NewRegionsService(s *Service) *RegionsService {
  364. rs := &RegionsService{s: s}
  365. return rs
  366. }
  367. type RegionsService struct {
  368. s *Service
  369. }
  370. func NewRoutersService(s *Service) *RoutersService {
  371. rs := &RoutersService{s: s}
  372. return rs
  373. }
  374. type RoutersService struct {
  375. s *Service
  376. }
  377. func NewRoutesService(s *Service) *RoutesService {
  378. rs := &RoutesService{s: s}
  379. return rs
  380. }
  381. type RoutesService struct {
  382. s *Service
  383. }
  384. func NewSnapshotsService(s *Service) *SnapshotsService {
  385. rs := &SnapshotsService{s: s}
  386. return rs
  387. }
  388. type SnapshotsService struct {
  389. s *Service
  390. }
  391. func NewSslCertificatesService(s *Service) *SslCertificatesService {
  392. rs := &SslCertificatesService{s: s}
  393. return rs
  394. }
  395. type SslCertificatesService struct {
  396. s *Service
  397. }
  398. func NewSubnetworksService(s *Service) *SubnetworksService {
  399. rs := &SubnetworksService{s: s}
  400. return rs
  401. }
  402. type SubnetworksService struct {
  403. s *Service
  404. }
  405. func NewTargetHttpProxiesService(s *Service) *TargetHttpProxiesService {
  406. rs := &TargetHttpProxiesService{s: s}
  407. return rs
  408. }
  409. type TargetHttpProxiesService struct {
  410. s *Service
  411. }
  412. func NewTargetHttpsProxiesService(s *Service) *TargetHttpsProxiesService {
  413. rs := &TargetHttpsProxiesService{s: s}
  414. return rs
  415. }
  416. type TargetHttpsProxiesService struct {
  417. s *Service
  418. }
  419. func NewTargetInstancesService(s *Service) *TargetInstancesService {
  420. rs := &TargetInstancesService{s: s}
  421. return rs
  422. }
  423. type TargetInstancesService struct {
  424. s *Service
  425. }
  426. func NewTargetPoolsService(s *Service) *TargetPoolsService {
  427. rs := &TargetPoolsService{s: s}
  428. return rs
  429. }
  430. type TargetPoolsService struct {
  431. s *Service
  432. }
  433. func NewTargetSslProxiesService(s *Service) *TargetSslProxiesService {
  434. rs := &TargetSslProxiesService{s: s}
  435. return rs
  436. }
  437. type TargetSslProxiesService struct {
  438. s *Service
  439. }
  440. func NewTargetTcpProxiesService(s *Service) *TargetTcpProxiesService {
  441. rs := &TargetTcpProxiesService{s: s}
  442. return rs
  443. }
  444. type TargetTcpProxiesService struct {
  445. s *Service
  446. }
  447. func NewTargetVpnGatewaysService(s *Service) *TargetVpnGatewaysService {
  448. rs := &TargetVpnGatewaysService{s: s}
  449. return rs
  450. }
  451. type TargetVpnGatewaysService struct {
  452. s *Service
  453. }
  454. func NewUrlMapsService(s *Service) *UrlMapsService {
  455. rs := &UrlMapsService{s: s}
  456. return rs
  457. }
  458. type UrlMapsService struct {
  459. s *Service
  460. }
  461. func NewVpnTunnelsService(s *Service) *VpnTunnelsService {
  462. rs := &VpnTunnelsService{s: s}
  463. return rs
  464. }
  465. type VpnTunnelsService struct {
  466. s *Service
  467. }
  468. func NewZoneOperationsService(s *Service) *ZoneOperationsService {
  469. rs := &ZoneOperationsService{s: s}
  470. return rs
  471. }
  472. type ZoneOperationsService struct {
  473. s *Service
  474. }
  475. func NewZonesService(s *Service) *ZonesService {
  476. rs := &ZonesService{s: s}
  477. return rs
  478. }
  479. type ZonesService struct {
  480. s *Service
  481. }
  482. // AccessConfig: An access configuration attached to an instance's
  483. // network interface. Only one access config per instance is supported.
  484. type AccessConfig struct {
  485. // Kind: [Output Only] Type of the resource. Always compute#accessConfig
  486. // for access configs.
  487. Kind string `json:"kind,omitempty"`
  488. // Name: The name of this access configuration. The default and
  489. // recommended name is External NAT but you can use any arbitrary string
  490. // you would like. For example, My external IP or Network Access.
  491. Name string `json:"name,omitempty"`
  492. // NatIP: An external IP address associated with this instance. Specify
  493. // an unused static external IP address available to the project or
  494. // leave this field undefined to use an IP from a shared ephemeral IP
  495. // address pool. If you specify a static external IP address, it must
  496. // live in the same region as the zone of the instance.
  497. NatIP string `json:"natIP,omitempty"`
  498. // Type: The type of configuration. The default and only option is
  499. // ONE_TO_ONE_NAT.
  500. //
  501. // Possible values:
  502. // "ONE_TO_ONE_NAT" (default)
  503. Type string `json:"type,omitempty"`
  504. // ForceSendFields is a list of field names (e.g. "Kind") to
  505. // unconditionally include in API requests. By default, fields with
  506. // empty values are omitted from API requests. However, any non-pointer,
  507. // non-interface field appearing in ForceSendFields will be sent to the
  508. // server regardless of whether the field is empty or not. This may be
  509. // used to include empty fields in Patch requests.
  510. ForceSendFields []string `json:"-"`
  511. // NullFields is a list of field names (e.g. "Kind") to include in API
  512. // requests with the JSON null value. By default, fields with empty
  513. // values are omitted from API requests. However, any field with an
  514. // empty value appearing in NullFields will be sent to the server as
  515. // null. It is an error if a field in this list has a non-empty value.
  516. // This may be used to include null fields in Patch requests.
  517. NullFields []string `json:"-"`
  518. }
  519. func (s *AccessConfig) MarshalJSON() ([]byte, error) {
  520. type noMethod AccessConfig
  521. raw := noMethod(*s)
  522. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  523. }
  524. // Address: A reserved address resource.
  525. type Address struct {
  526. // Address: The static external IP address represented by this resource.
  527. Address string `json:"address,omitempty"`
  528. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  529. // format.
  530. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  531. // Description: An optional description of this resource. Provide this
  532. // property when you create the resource.
  533. Description string `json:"description,omitempty"`
  534. // Id: [Output Only] The unique identifier for the resource. This
  535. // identifier is defined by the server.
  536. Id uint64 `json:"id,omitempty,string"`
  537. // IpVersion: The IP Version that will be used by this address. Valid
  538. // options are IPV4 or IPV6. This can only be specified for a global
  539. // address.
  540. //
  541. // Possible values:
  542. // "IPV4"
  543. // "IPV6"
  544. // "UNSPECIFIED_VERSION"
  545. IpVersion string `json:"ipVersion,omitempty"`
  546. // Kind: [Output Only] Type of the resource. Always compute#address for
  547. // addresses.
  548. Kind string `json:"kind,omitempty"`
  549. // Name: Name of the resource. Provided by the client when the resource
  550. // is created. The name must be 1-63 characters long, and comply with
  551. // RFC1035. Specifically, the name must be 1-63 characters long and
  552. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  553. // the first character must be a lowercase letter, and all following
  554. // characters must be a dash, lowercase letter, or digit, except the
  555. // last character, which cannot be a dash.
  556. Name string `json:"name,omitempty"`
  557. // Region: [Output Only] URL of the region where the regional address
  558. // resides. This field is not applicable to global addresses.
  559. Region string `json:"region,omitempty"`
  560. // SelfLink: [Output Only] Server-defined URL for the resource.
  561. SelfLink string `json:"selfLink,omitempty"`
  562. // Status: [Output Only] The status of the address, which can be either
  563. // IN_USE or RESERVED. An address that is RESERVED is currently reserved
  564. // and available to use. An IN_USE address is currently being used by
  565. // another resource and is not available.
  566. //
  567. // Possible values:
  568. // "IN_USE"
  569. // "RESERVED"
  570. Status string `json:"status,omitempty"`
  571. // Users: [Output Only] The URLs of the resources that are using this
  572. // address.
  573. Users []string `json:"users,omitempty"`
  574. // ServerResponse contains the HTTP response code and headers from the
  575. // server.
  576. googleapi.ServerResponse `json:"-"`
  577. // ForceSendFields is a list of field names (e.g. "Address") to
  578. // unconditionally include in API requests. By default, fields with
  579. // empty values are omitted from API requests. However, any non-pointer,
  580. // non-interface field appearing in ForceSendFields will be sent to the
  581. // server regardless of whether the field is empty or not. This may be
  582. // used to include empty fields in Patch requests.
  583. ForceSendFields []string `json:"-"`
  584. // NullFields is a list of field names (e.g. "Address") to include in
  585. // API requests with the JSON null value. By default, fields with empty
  586. // values are omitted from API requests. However, any field with an
  587. // empty value appearing in NullFields will be sent to the server as
  588. // null. It is an error if a field in this list has a non-empty value.
  589. // This may be used to include null fields in Patch requests.
  590. NullFields []string `json:"-"`
  591. }
  592. func (s *Address) MarshalJSON() ([]byte, error) {
  593. type noMethod Address
  594. raw := noMethod(*s)
  595. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  596. }
  597. type AddressAggregatedList struct {
  598. // Id: [Output Only] Unique identifier for the resource; defined by the
  599. // server.
  600. Id string `json:"id,omitempty"`
  601. // Items: [Output Only] A map of scoped address lists.
  602. Items map[string]AddressesScopedList `json:"items,omitempty"`
  603. // Kind: [Output Only] Type of resource. Always
  604. // compute#addressAggregatedList for aggregated lists of addresses.
  605. Kind string `json:"kind,omitempty"`
  606. // NextPageToken: [Output Only] This token allows you to get the next
  607. // page of results for list requests. If the number of results is larger
  608. // than maxResults, use the nextPageToken as a value for the query
  609. // parameter pageToken in the next list request. Subsequent list
  610. // requests will have their own nextPageToken to continue paging through
  611. // the results.
  612. NextPageToken string `json:"nextPageToken,omitempty"`
  613. // SelfLink: [Output Only] Server-defined URL for this resource.
  614. SelfLink string `json:"selfLink,omitempty"`
  615. // ServerResponse contains the HTTP response code and headers from the
  616. // server.
  617. googleapi.ServerResponse `json:"-"`
  618. // ForceSendFields is a list of field names (e.g. "Id") to
  619. // unconditionally include in API requests. By default, fields with
  620. // empty values are omitted from API requests. However, any non-pointer,
  621. // non-interface field appearing in ForceSendFields will be sent to the
  622. // server regardless of whether the field is empty or not. This may be
  623. // used to include empty fields in Patch requests.
  624. ForceSendFields []string `json:"-"`
  625. // NullFields is a list of field names (e.g. "Id") to include in API
  626. // requests with the JSON null value. By default, fields with empty
  627. // values are omitted from API requests. However, any field with an
  628. // empty value appearing in NullFields will be sent to the server as
  629. // null. It is an error if a field in this list has a non-empty value.
  630. // This may be used to include null fields in Patch requests.
  631. NullFields []string `json:"-"`
  632. }
  633. func (s *AddressAggregatedList) MarshalJSON() ([]byte, error) {
  634. type noMethod AddressAggregatedList
  635. raw := noMethod(*s)
  636. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  637. }
  638. // AddressList: Contains a list of addresses.
  639. type AddressList struct {
  640. // Id: [Output Only] The unique identifier for the resource. This
  641. // identifier is defined by the server.
  642. Id string `json:"id,omitempty"`
  643. // Items: [Output Only] A list of addresses.
  644. Items []*Address `json:"items,omitempty"`
  645. // Kind: [Output Only] Type of resource. Always compute#addressList for
  646. // lists of addresses.
  647. Kind string `json:"kind,omitempty"`
  648. // NextPageToken: [Output Only] This token allows you to get the next
  649. // page of results for list requests. If the number of results is larger
  650. // than maxResults, use the nextPageToken as a value for the query
  651. // parameter pageToken in the next list request. Subsequent list
  652. // requests will have their own nextPageToken to continue paging through
  653. // the results.
  654. NextPageToken string `json:"nextPageToken,omitempty"`
  655. // SelfLink: [Output Only] Server-defined URL for the resource.
  656. SelfLink string `json:"selfLink,omitempty"`
  657. // ServerResponse contains the HTTP response code and headers from the
  658. // server.
  659. googleapi.ServerResponse `json:"-"`
  660. // ForceSendFields is a list of field names (e.g. "Id") to
  661. // unconditionally include in API requests. By default, fields with
  662. // empty values are omitted from API requests. However, any non-pointer,
  663. // non-interface field appearing in ForceSendFields will be sent to the
  664. // server regardless of whether the field is empty or not. This may be
  665. // used to include empty fields in Patch requests.
  666. ForceSendFields []string `json:"-"`
  667. // NullFields is a list of field names (e.g. "Id") to include in API
  668. // requests with the JSON null value. By default, fields with empty
  669. // values are omitted from API requests. However, any field with an
  670. // empty value appearing in NullFields will be sent to the server as
  671. // null. It is an error if a field in this list has a non-empty value.
  672. // This may be used to include null fields in Patch requests.
  673. NullFields []string `json:"-"`
  674. }
  675. func (s *AddressList) MarshalJSON() ([]byte, error) {
  676. type noMethod AddressList
  677. raw := noMethod(*s)
  678. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  679. }
  680. type AddressesScopedList struct {
  681. // Addresses: [Output Only] List of addresses contained in this scope.
  682. Addresses []*Address `json:"addresses,omitempty"`
  683. // Warning: [Output Only] Informational warning which replaces the list
  684. // of addresses when the list is empty.
  685. Warning *AddressesScopedListWarning `json:"warning,omitempty"`
  686. // ForceSendFields is a list of field names (e.g. "Addresses") to
  687. // unconditionally include in API requests. By default, fields with
  688. // empty values are omitted from API requests. However, any non-pointer,
  689. // non-interface field appearing in ForceSendFields will be sent to the
  690. // server regardless of whether the field is empty or not. This may be
  691. // used to include empty fields in Patch requests.
  692. ForceSendFields []string `json:"-"`
  693. // NullFields is a list of field names (e.g. "Addresses") to include in
  694. // API requests with the JSON null value. By default, fields with empty
  695. // values are omitted from API requests. However, any field with an
  696. // empty value appearing in NullFields will be sent to the server as
  697. // null. It is an error if a field in this list has a non-empty value.
  698. // This may be used to include null fields in Patch requests.
  699. NullFields []string `json:"-"`
  700. }
  701. func (s *AddressesScopedList) MarshalJSON() ([]byte, error) {
  702. type noMethod AddressesScopedList
  703. raw := noMethod(*s)
  704. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  705. }
  706. // AddressesScopedListWarning: [Output Only] Informational warning which
  707. // replaces the list of addresses when the list is empty.
  708. type AddressesScopedListWarning struct {
  709. // Code: [Output Only] A warning code, if applicable. For example,
  710. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  711. // the response.
  712. //
  713. // Possible values:
  714. // "CLEANUP_FAILED"
  715. // "DEPRECATED_RESOURCE_USED"
  716. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  717. // "FIELD_VALUE_OVERRIDEN"
  718. // "INJECTED_KERNELS_DEPRECATED"
  719. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  720. // "NEXT_HOP_CANNOT_IP_FORWARD"
  721. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  722. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  723. // "NEXT_HOP_NOT_RUNNING"
  724. // "NOT_CRITICAL_ERROR"
  725. // "NO_RESULTS_ON_PAGE"
  726. // "REQUIRED_TOS_AGREEMENT"
  727. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  728. // "RESOURCE_NOT_DELETED"
  729. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  730. // "UNREACHABLE"
  731. Code string `json:"code,omitempty"`
  732. // Data: [Output Only] Metadata about this warning in key: value format.
  733. // For example:
  734. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  735. Data []*AddressesScopedListWarningData `json:"data,omitempty"`
  736. // Message: [Output Only] A human-readable description of the warning
  737. // code.
  738. Message string `json:"message,omitempty"`
  739. // ForceSendFields is a list of field names (e.g. "Code") to
  740. // unconditionally include in API requests. By default, fields with
  741. // empty values are omitted from API requests. However, any non-pointer,
  742. // non-interface field appearing in ForceSendFields will be sent to the
  743. // server regardless of whether the field is empty or not. This may be
  744. // used to include empty fields in Patch requests.
  745. ForceSendFields []string `json:"-"`
  746. // NullFields is a list of field names (e.g. "Code") to include in API
  747. // requests with the JSON null value. By default, fields with empty
  748. // values are omitted from API requests. However, any field with an
  749. // empty value appearing in NullFields will be sent to the server as
  750. // null. It is an error if a field in this list has a non-empty value.
  751. // This may be used to include null fields in Patch requests.
  752. NullFields []string `json:"-"`
  753. }
  754. func (s *AddressesScopedListWarning) MarshalJSON() ([]byte, error) {
  755. type noMethod AddressesScopedListWarning
  756. raw := noMethod(*s)
  757. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  758. }
  759. type AddressesScopedListWarningData struct {
  760. // Key: [Output Only] A key that provides more detail on the warning
  761. // being returned. For example, for warnings where there are no results
  762. // in a list request for a particular zone, this key might be scope and
  763. // the key value might be the zone name. Other examples might be a key
  764. // indicating a deprecated resource and a suggested replacement, or a
  765. // warning about invalid network settings (for example, if an instance
  766. // attempts to perform IP forwarding but is not enabled for IP
  767. // forwarding).
  768. Key string `json:"key,omitempty"`
  769. // Value: [Output Only] A warning data value corresponding to the key.
  770. Value string `json:"value,omitempty"`
  771. // ForceSendFields is a list of field names (e.g. "Key") to
  772. // unconditionally include in API requests. By default, fields with
  773. // empty values are omitted from API requests. However, any non-pointer,
  774. // non-interface field appearing in ForceSendFields will be sent to the
  775. // server regardless of whether the field is empty or not. This may be
  776. // used to include empty fields in Patch requests.
  777. ForceSendFields []string `json:"-"`
  778. // NullFields is a list of field names (e.g. "Key") to include in API
  779. // requests with the JSON null value. By default, fields with empty
  780. // values are omitted from API requests. However, any field with an
  781. // empty value appearing in NullFields will be sent to the server as
  782. // null. It is an error if a field in this list has a non-empty value.
  783. // This may be used to include null fields in Patch requests.
  784. NullFields []string `json:"-"`
  785. }
  786. func (s *AddressesScopedListWarningData) MarshalJSON() ([]byte, error) {
  787. type noMethod AddressesScopedListWarningData
  788. raw := noMethod(*s)
  789. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  790. }
  791. // AttachedDisk: An instance-attached disk resource.
  792. type AttachedDisk struct {
  793. // AutoDelete: Specifies whether the disk will be auto-deleted when the
  794. // instance is deleted (but not when the disk is detached from the
  795. // instance).
  796. AutoDelete bool `json:"autoDelete,omitempty"`
  797. // Boot: Indicates that this is a boot disk. The virtual machine will
  798. // use the first partition of the disk for its root filesystem.
  799. Boot bool `json:"boot,omitempty"`
  800. // DeviceName: Specifies a unique device name of your choice that is
  801. // reflected into the /dev/disk/by-id/google-* tree of a Linux operating
  802. // system running within the instance. This name can be used to
  803. // reference the device for mounting, resizing, and so on, from within
  804. // the instance.
  805. //
  806. // If not specified, the server chooses a default device name to apply
  807. // to this disk, in the form persistent-disks-x, where x is a number
  808. // assigned by Google Compute Engine. This field is only applicable for
  809. // persistent disks.
  810. DeviceName string `json:"deviceName,omitempty"`
  811. // DiskEncryptionKey: Encrypts or decrypts a disk using a
  812. // customer-supplied encryption key.
  813. //
  814. // If you are creating a new disk, this field encrypts the new disk
  815. // using an encryption key that you provide. If you are attaching an
  816. // existing disk that is already encrypted, this field decrypts the disk
  817. // using the customer-supplied encryption key.
  818. //
  819. // If you encrypt a disk using a customer-supplied key, you must provide
  820. // the same key again when you attempt to use this resource at a later
  821. // time. For example, you must provide the key when you create a
  822. // snapshot or an image from the disk or when you attach the disk to a
  823. // virtual machine instance.
  824. //
  825. // If you do not provide an encryption key, then the disk will be
  826. // encrypted using an automatically generated key and you do not need to
  827. // provide a key to use the disk later.
  828. //
  829. // Instance templates do not store customer-supplied encryption keys, so
  830. // you cannot use your own keys to encrypt disks in a managed instance
  831. // group.
  832. DiskEncryptionKey *CustomerEncryptionKey `json:"diskEncryptionKey,omitempty"`
  833. // Index: Assigns a zero-based index to this disk, where 0 is reserved
  834. // for the boot disk. For example, if you have many disks attached to an
  835. // instance, each disk would have a unique index number. If not
  836. // specified, the server will choose an appropriate value.
  837. Index int64 `json:"index,omitempty"`
  838. // InitializeParams: [Input Only] Specifies the parameters for a new
  839. // disk that will be created alongside the new instance. Use
  840. // initialization parameters to create boot disks or local SSDs attached
  841. // to the new instance.
  842. //
  843. // This property is mutually exclusive with the source property; you can
  844. // only define one or the other, but not both.
  845. InitializeParams *AttachedDiskInitializeParams `json:"initializeParams,omitempty"`
  846. // Interface: Specifies the disk interface to use for attaching this
  847. // disk, which is either SCSI or NVME. The default is SCSI. Persistent
  848. // disks must always use SCSI and the request will fail if you attempt
  849. // to attach a persistent disk in any other format than SCSI. Local SSDs
  850. // can use either NVME or SCSI. For performance characteristics of SCSI
  851. // over NVMe, see Local SSD performance.
  852. //
  853. // Possible values:
  854. // "NVME"
  855. // "SCSI"
  856. Interface string `json:"interface,omitempty"`
  857. // Kind: [Output Only] Type of the resource. Always compute#attachedDisk
  858. // for attached disks.
  859. Kind string `json:"kind,omitempty"`
  860. // Licenses: [Output Only] Any valid publicly visible licenses.
  861. Licenses []string `json:"licenses,omitempty"`
  862. // Mode: The mode in which to attach this disk, either READ_WRITE or
  863. // READ_ONLY. If not specified, the default is to attach the disk in
  864. // READ_WRITE mode.
  865. //
  866. // Possible values:
  867. // "READ_ONLY"
  868. // "READ_WRITE"
  869. Mode string `json:"mode,omitempty"`
  870. // Source: Specifies a valid partial or full URL to an existing
  871. // Persistent Disk resource. When creating a new instance, one of
  872. // initializeParams.sourceImage or disks.source is required.
  873. //
  874. // If desired, you can also attach existing non-root persistent disks
  875. // using this property. This field is only applicable for persistent
  876. // disks.
  877. //
  878. // Note that for InstanceTemplate, specify the disk name, not the URL
  879. // for the disk.
  880. Source string `json:"source,omitempty"`
  881. // Type: Specifies the type of the disk, either SCRATCH or PERSISTENT.
  882. // If not specified, the default is PERSISTENT.
  883. //
  884. // Possible values:
  885. // "PERSISTENT"
  886. // "SCRATCH"
  887. Type string `json:"type,omitempty"`
  888. // ForceSendFields is a list of field names (e.g. "AutoDelete") to
  889. // unconditionally include in API requests. By default, fields with
  890. // empty values are omitted from API requests. However, any non-pointer,
  891. // non-interface field appearing in ForceSendFields will be sent to the
  892. // server regardless of whether the field is empty or not. This may be
  893. // used to include empty fields in Patch requests.
  894. ForceSendFields []string `json:"-"`
  895. // NullFields is a list of field names (e.g. "AutoDelete") to include in
  896. // API requests with the JSON null value. By default, fields with empty
  897. // values are omitted from API requests. However, any field with an
  898. // empty value appearing in NullFields will be sent to the server as
  899. // null. It is an error if a field in this list has a non-empty value.
  900. // This may be used to include null fields in Patch requests.
  901. NullFields []string `json:"-"`
  902. }
  903. func (s *AttachedDisk) MarshalJSON() ([]byte, error) {
  904. type noMethod AttachedDisk
  905. raw := noMethod(*s)
  906. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  907. }
  908. // AttachedDiskInitializeParams: [Input Only] Specifies the parameters
  909. // for a new disk that will be created alongside the new instance. Use
  910. // initialization parameters to create boot disks or local SSDs attached
  911. // to the new instance.
  912. //
  913. // This property is mutually exclusive with the source property; you can
  914. // only define one or the other, but not both.
  915. type AttachedDiskInitializeParams struct {
  916. // DiskName: Specifies the disk name. If not specified, the default is
  917. // to use the name of the instance.
  918. DiskName string `json:"diskName,omitempty"`
  919. // DiskSizeGb: Specifies the size of the disk in base-2 GB.
  920. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  921. // DiskType: Specifies the disk type to use to create the instance. If
  922. // not specified, the default is pd-standard, specified using the full
  923. // URL. For
  924. // example:
  925. //
  926. // https://www.googleapis.com/compute/v1/projects/project/zones
  927. // /zone/diskTypes/pd-standard
  928. //
  929. // Other values include pd-ssd and local-ssd. If you define this field,
  930. // you can provide either the full or partial URL. For example, the
  931. // following are valid values:
  932. // -
  933. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
  934. // - projects/project/zones/zone/diskTypes/diskType
  935. // - zones/zone/diskTypes/diskType Note that for InstanceTemplate, this
  936. // is the name of the disk type, not URL.
  937. DiskType string `json:"diskType,omitempty"`
  938. // SourceImage: The source image to create this disk. When creating a
  939. // new instance, one of initializeParams.sourceImage or disks.source is
  940. // required.
  941. //
  942. // To create a disk with one of the public operating system images,
  943. // specify the image by its family name. For example, specify
  944. // family/debian-8 to use the latest Debian 8
  945. // image:
  946. //
  947. // projects/debian-cloud/global/images/family/debian-8
  948. //
  949. // Alternatively, use a specific version of a public operating system
  950. // image:
  951. //
  952. // projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
  953. //
  954. // To create a disk with a private image that you created, specify the
  955. // image name in the following format:
  956. //
  957. // global/images/my-private-image
  958. //
  959. // You can also specify a private image by its image family, which
  960. // returns the latest version of the image in that family. Replace the
  961. // image name with
  962. // family/family-name:
  963. //
  964. // global/images/family/my-private-family
  965. //
  966. // If the source image is deleted later, this field will not be set.
  967. SourceImage string `json:"sourceImage,omitempty"`
  968. // SourceImageEncryptionKey: The customer-supplied encryption key of the
  969. // source image. Required if the source image is protected by a
  970. // customer-supplied encryption key.
  971. //
  972. // Instance templates do not store customer-supplied encryption keys, so
  973. // you cannot create disks for instances in a managed instance group if
  974. // the source images are encrypted with your own keys.
  975. SourceImageEncryptionKey *CustomerEncryptionKey `json:"sourceImageEncryptionKey,omitempty"`
  976. // ForceSendFields is a list of field names (e.g. "DiskName") to
  977. // unconditionally include in API requests. By default, fields with
  978. // empty values are omitted from API requests. However, any non-pointer,
  979. // non-interface field appearing in ForceSendFields will be sent to the
  980. // server regardless of whether the field is empty or not. This may be
  981. // used to include empty fields in Patch requests.
  982. ForceSendFields []string `json:"-"`
  983. // NullFields is a list of field names (e.g. "DiskName") to include in
  984. // API requests with the JSON null value. By default, fields with empty
  985. // values are omitted from API requests. However, any field with an
  986. // empty value appearing in NullFields will be sent to the server as
  987. // null. It is an error if a field in this list has a non-empty value.
  988. // This may be used to include null fields in Patch requests.
  989. NullFields []string `json:"-"`
  990. }
  991. func (s *AttachedDiskInitializeParams) MarshalJSON() ([]byte, error) {
  992. type noMethod AttachedDiskInitializeParams
  993. raw := noMethod(*s)
  994. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  995. }
  996. // Autoscaler: Represents an Autoscaler resource. Autoscalers allow you
  997. // to automatically scale virtual machine instances in managed instance
  998. // groups according to an autoscaling policy that you define. For more
  999. // information, read Autoscaling Groups of Instances.
  1000. type Autoscaler struct {
  1001. // AutoscalingPolicy: The configuration parameters for the autoscaling
  1002. // algorithm. You can define one or more of the policies for an
  1003. // autoscaler: cpuUtilization, customMetricUtilizations, and
  1004. // loadBalancingUtilization.
  1005. //
  1006. // If none of these are specified, the default will be to autoscale
  1007. // based on cpuUtilization to 0.6 or 60%.
  1008. AutoscalingPolicy *AutoscalingPolicy `json:"autoscalingPolicy,omitempty"`
  1009. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  1010. // format.
  1011. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  1012. // Description: An optional description of this resource. Provide this
  1013. // property when you create the resource.
  1014. Description string `json:"description,omitempty"`
  1015. // Id: [Output Only] The unique identifier for the resource. This
  1016. // identifier is defined by the server.
  1017. Id uint64 `json:"id,omitempty,string"`
  1018. // Kind: [Output Only] Type of the resource. Always compute#autoscaler
  1019. // for autoscalers.
  1020. Kind string `json:"kind,omitempty"`
  1021. // Name: Name of the resource. Provided by the client when the resource
  1022. // is created. The name must be 1-63 characters long, and comply with
  1023. // RFC1035. Specifically, the name must be 1-63 characters long and
  1024. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  1025. // the first character must be a lowercase letter, and all following
  1026. // characters must be a dash, lowercase letter, or digit, except the
  1027. // last character, which cannot be a dash.
  1028. Name string `json:"name,omitempty"`
  1029. // Region: [Output Only] URL of the region where the instance group
  1030. // resides (for autoscalers living in regional scope).
  1031. Region string `json:"region,omitempty"`
  1032. // SelfLink: [Output Only] Server-defined URL for the resource.
  1033. SelfLink string `json:"selfLink,omitempty"`
  1034. // Target: URL of the managed instance group that this autoscaler will
  1035. // scale.
  1036. Target string `json:"target,omitempty"`
  1037. // Zone: [Output Only] URL of the zone where the instance group resides
  1038. // (for autoscalers living in zonal scope).
  1039. Zone string `json:"zone,omitempty"`
  1040. // ServerResponse contains the HTTP response code and headers from the
  1041. // server.
  1042. googleapi.ServerResponse `json:"-"`
  1043. // ForceSendFields is a list of field names (e.g. "AutoscalingPolicy")
  1044. // to unconditionally include in API requests. By default, fields with
  1045. // empty values are omitted from API requests. However, any non-pointer,
  1046. // non-interface field appearing in ForceSendFields will be sent to the
  1047. // server regardless of whether the field is empty or not. This may be
  1048. // used to include empty fields in Patch requests.
  1049. ForceSendFields []string `json:"-"`
  1050. // NullFields is a list of field names (e.g. "AutoscalingPolicy") to
  1051. // include in API requests with the JSON null value. By default, fields
  1052. // with empty values are omitted from API requests. However, any field
  1053. // with an empty value appearing in NullFields will be sent to the
  1054. // server as null. It is an error if a field in this list has a
  1055. // non-empty value. This may be used to include null fields in Patch
  1056. // requests.
  1057. NullFields []string `json:"-"`
  1058. }
  1059. func (s *Autoscaler) MarshalJSON() ([]byte, error) {
  1060. type noMethod Autoscaler
  1061. raw := noMethod(*s)
  1062. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1063. }
  1064. type AutoscalerAggregatedList struct {
  1065. // Id: [Output Only] The unique identifier for the resource. This
  1066. // identifier is defined by the server.
  1067. Id string `json:"id,omitempty"`
  1068. // Items: A map of scoped autoscaler lists.
  1069. Items map[string]AutoscalersScopedList `json:"items,omitempty"`
  1070. // Kind: [Output Only] Type of resource. Always
  1071. // compute#autoscalerAggregatedList for aggregated lists of autoscalers.
  1072. Kind string `json:"kind,omitempty"`
  1073. // NextPageToken: [Output Only] This token allows you to get the next
  1074. // page of results for list requests. If the number of results is larger
  1075. // than maxResults, use the nextPageToken as a value for the query
  1076. // parameter pageToken in the next list request. Subsequent list
  1077. // requests will have their own nextPageToken to continue paging through
  1078. // the results.
  1079. NextPageToken string `json:"nextPageToken,omitempty"`
  1080. // SelfLink: [Output Only] Server-defined URL for this resource.
  1081. SelfLink string `json:"selfLink,omitempty"`
  1082. // ServerResponse contains the HTTP response code and headers from the
  1083. // server.
  1084. googleapi.ServerResponse `json:"-"`
  1085. // ForceSendFields is a list of field names (e.g. "Id") to
  1086. // unconditionally include in API requests. By default, fields with
  1087. // empty values are omitted from API requests. However, any non-pointer,
  1088. // non-interface field appearing in ForceSendFields will be sent to the
  1089. // server regardless of whether the field is empty or not. This may be
  1090. // used to include empty fields in Patch requests.
  1091. ForceSendFields []string `json:"-"`
  1092. // NullFields is a list of field names (e.g. "Id") to include in API
  1093. // requests with the JSON null value. By default, fields with empty
  1094. // values are omitted from API requests. However, any field with an
  1095. // empty value appearing in NullFields will be sent to the server as
  1096. // null. It is an error if a field in this list has a non-empty value.
  1097. // This may be used to include null fields in Patch requests.
  1098. NullFields []string `json:"-"`
  1099. }
  1100. func (s *AutoscalerAggregatedList) MarshalJSON() ([]byte, error) {
  1101. type noMethod AutoscalerAggregatedList
  1102. raw := noMethod(*s)
  1103. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1104. }
  1105. // AutoscalerList: Contains a list of Autoscaler resources.
  1106. type AutoscalerList struct {
  1107. // Id: [Output Only] The unique identifier for the resource. This
  1108. // identifier is defined by the server.
  1109. Id string `json:"id,omitempty"`
  1110. // Items: A list of Autoscaler resources.
  1111. Items []*Autoscaler `json:"items,omitempty"`
  1112. // Kind: [Output Only] Type of resource. Always compute#autoscalerList
  1113. // for lists of autoscalers.
  1114. Kind string `json:"kind,omitempty"`
  1115. // NextPageToken: [Output Only] This token allows you to get the next
  1116. // page of results for list requests. If the number of results is larger
  1117. // than maxResults, use the nextPageToken as a value for the query
  1118. // parameter pageToken in the next list request. Subsequent list
  1119. // requests will have their own nextPageToken to continue paging through
  1120. // the results.
  1121. NextPageToken string `json:"nextPageToken,omitempty"`
  1122. // SelfLink: [Output Only] Server-defined URL for this resource.
  1123. SelfLink string `json:"selfLink,omitempty"`
  1124. // ServerResponse contains the HTTP response code and headers from the
  1125. // server.
  1126. googleapi.ServerResponse `json:"-"`
  1127. // ForceSendFields is a list of field names (e.g. "Id") to
  1128. // unconditionally include in API requests. By default, fields with
  1129. // empty values are omitted from API requests. However, any non-pointer,
  1130. // non-interface field appearing in ForceSendFields will be sent to the
  1131. // server regardless of whether the field is empty or not. This may be
  1132. // used to include empty fields in Patch requests.
  1133. ForceSendFields []string `json:"-"`
  1134. // NullFields is a list of field names (e.g. "Id") to include in API
  1135. // requests with the JSON null value. By default, fields with empty
  1136. // values are omitted from API requests. However, any field with an
  1137. // empty value appearing in NullFields will be sent to the server as
  1138. // null. It is an error if a field in this list has a non-empty value.
  1139. // This may be used to include null fields in Patch requests.
  1140. NullFields []string `json:"-"`
  1141. }
  1142. func (s *AutoscalerList) MarshalJSON() ([]byte, error) {
  1143. type noMethod AutoscalerList
  1144. raw := noMethod(*s)
  1145. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1146. }
  1147. type AutoscalersScopedList struct {
  1148. // Autoscalers: [Output Only] List of autoscalers contained in this
  1149. // scope.
  1150. Autoscalers []*Autoscaler `json:"autoscalers,omitempty"`
  1151. // Warning: [Output Only] Informational warning which replaces the list
  1152. // of autoscalers when the list is empty.
  1153. Warning *AutoscalersScopedListWarning `json:"warning,omitempty"`
  1154. // ForceSendFields is a list of field names (e.g. "Autoscalers") to
  1155. // unconditionally include in API requests. By default, fields with
  1156. // empty values are omitted from API requests. However, any non-pointer,
  1157. // non-interface field appearing in ForceSendFields will be sent to the
  1158. // server regardless of whether the field is empty or not. This may be
  1159. // used to include empty fields in Patch requests.
  1160. ForceSendFields []string `json:"-"`
  1161. // NullFields is a list of field names (e.g. "Autoscalers") to include
  1162. // in API requests with the JSON null value. By default, fields with
  1163. // empty values are omitted from API requests. However, any field with
  1164. // an empty value appearing in NullFields will be sent to the server as
  1165. // null. It is an error if a field in this list has a non-empty value.
  1166. // This may be used to include null fields in Patch requests.
  1167. NullFields []string `json:"-"`
  1168. }
  1169. func (s *AutoscalersScopedList) MarshalJSON() ([]byte, error) {
  1170. type noMethod AutoscalersScopedList
  1171. raw := noMethod(*s)
  1172. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1173. }
  1174. // AutoscalersScopedListWarning: [Output Only] Informational warning
  1175. // which replaces the list of autoscalers when the list is empty.
  1176. type AutoscalersScopedListWarning struct {
  1177. // Code: [Output Only] A warning code, if applicable. For example,
  1178. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1179. // the response.
  1180. //
  1181. // Possible values:
  1182. // "CLEANUP_FAILED"
  1183. // "DEPRECATED_RESOURCE_USED"
  1184. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1185. // "FIELD_VALUE_OVERRIDEN"
  1186. // "INJECTED_KERNELS_DEPRECATED"
  1187. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1188. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1189. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1190. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1191. // "NEXT_HOP_NOT_RUNNING"
  1192. // "NOT_CRITICAL_ERROR"
  1193. // "NO_RESULTS_ON_PAGE"
  1194. // "REQUIRED_TOS_AGREEMENT"
  1195. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1196. // "RESOURCE_NOT_DELETED"
  1197. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1198. // "UNREACHABLE"
  1199. Code string `json:"code,omitempty"`
  1200. // Data: [Output Only] Metadata about this warning in key: value format.
  1201. // For example:
  1202. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1203. Data []*AutoscalersScopedListWarningData `json:"data,omitempty"`
  1204. // Message: [Output Only] A human-readable description of the warning
  1205. // code.
  1206. Message string `json:"message,omitempty"`
  1207. // ForceSendFields is a list of field names (e.g. "Code") to
  1208. // unconditionally include in API requests. By default, fields with
  1209. // empty values are omitted from API requests. However, any non-pointer,
  1210. // non-interface field appearing in ForceSendFields will be sent to the
  1211. // server regardless of whether the field is empty or not. This may be
  1212. // used to include empty fields in Patch requests.
  1213. ForceSendFields []string `json:"-"`
  1214. // NullFields is a list of field names (e.g. "Code") to include in API
  1215. // requests with the JSON null value. By default, fields with empty
  1216. // values are omitted from API requests. However, any field with an
  1217. // empty value appearing in NullFields will be sent to the server as
  1218. // null. It is an error if a field in this list has a non-empty value.
  1219. // This may be used to include null fields in Patch requests.
  1220. NullFields []string `json:"-"`
  1221. }
  1222. func (s *AutoscalersScopedListWarning) MarshalJSON() ([]byte, error) {
  1223. type noMethod AutoscalersScopedListWarning
  1224. raw := noMethod(*s)
  1225. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1226. }
  1227. type AutoscalersScopedListWarningData struct {
  1228. // Key: [Output Only] A key that provides more detail on the warning
  1229. // being returned. For example, for warnings where there are no results
  1230. // in a list request for a particular zone, this key might be scope and
  1231. // the key value might be the zone name. Other examples might be a key
  1232. // indicating a deprecated resource and a suggested replacement, or a
  1233. // warning about invalid network settings (for example, if an instance
  1234. // attempts to perform IP forwarding but is not enabled for IP
  1235. // forwarding).
  1236. Key string `json:"key,omitempty"`
  1237. // Value: [Output Only] A warning data value corresponding to the key.
  1238. Value string `json:"value,omitempty"`
  1239. // ForceSendFields is a list of field names (e.g. "Key") to
  1240. // unconditionally include in API requests. By default, fields with
  1241. // empty values are omitted from API requests. However, any non-pointer,
  1242. // non-interface field appearing in ForceSendFields will be sent to the
  1243. // server regardless of whether the field is empty or not. This may be
  1244. // used to include empty fields in Patch requests.
  1245. ForceSendFields []string `json:"-"`
  1246. // NullFields is a list of field names (e.g. "Key") to include in API
  1247. // requests with the JSON null value. By default, fields with empty
  1248. // values are omitted from API requests. However, any field with an
  1249. // empty value appearing in NullFields will be sent to the server as
  1250. // null. It is an error if a field in this list has a non-empty value.
  1251. // This may be used to include null fields in Patch requests.
  1252. NullFields []string `json:"-"`
  1253. }
  1254. func (s *AutoscalersScopedListWarningData) MarshalJSON() ([]byte, error) {
  1255. type noMethod AutoscalersScopedListWarningData
  1256. raw := noMethod(*s)
  1257. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1258. }
  1259. // AutoscalingPolicy: Cloud Autoscaler policy.
  1260. type AutoscalingPolicy struct {
  1261. // CoolDownPeriodSec: The number of seconds that the autoscaler should
  1262. // wait before it starts collecting information from a new instance.
  1263. // This prevents the autoscaler from collecting information when the
  1264. // instance is initializing, during which the collected usage would not
  1265. // be reliable. The default time autoscaler waits is 60
  1266. // seconds.
  1267. //
  1268. // Virtual machine initialization times might vary because of numerous
  1269. // factors. We recommend that you test how long an instance may take to
  1270. // initialize. To do this, create an instance and time the startup
  1271. // process.
  1272. CoolDownPeriodSec int64 `json:"coolDownPeriodSec,omitempty"`
  1273. // CpuUtilization: Defines the CPU utilization policy that allows the
  1274. // autoscaler to scale based on the average CPU utilization of a managed
  1275. // instance group.
  1276. CpuUtilization *AutoscalingPolicyCpuUtilization `json:"cpuUtilization,omitempty"`
  1277. // CustomMetricUtilizations: Configuration parameters of autoscaling
  1278. // based on a custom metric.
  1279. CustomMetricUtilizations []*AutoscalingPolicyCustomMetricUtilization `json:"customMetricUtilizations,omitempty"`
  1280. // LoadBalancingUtilization: Configuration parameters of autoscaling
  1281. // based on load balancer.
  1282. LoadBalancingUtilization *AutoscalingPolicyLoadBalancingUtilization `json:"loadBalancingUtilization,omitempty"`
  1283. // MaxNumReplicas: The maximum number of instances that the autoscaler
  1284. // can scale up to. This is required when creating or updating an
  1285. // autoscaler. The maximum number of replicas should not be lower than
  1286. // minimal number of replicas.
  1287. MaxNumReplicas int64 `json:"maxNumReplicas,omitempty"`
  1288. // MinNumReplicas: The minimum number of replicas that the autoscaler
  1289. // can scale down to. This cannot be less than 0. If not provided,
  1290. // autoscaler will choose a default value depending on maximum number of
  1291. // instances allowed.
  1292. MinNumReplicas int64 `json:"minNumReplicas,omitempty"`
  1293. // ForceSendFields is a list of field names (e.g. "CoolDownPeriodSec")
  1294. // to unconditionally include in API requests. By default, fields with
  1295. // empty values are omitted from API requests. However, any non-pointer,
  1296. // non-interface field appearing in ForceSendFields will be sent to the
  1297. // server regardless of whether the field is empty or not. This may be
  1298. // used to include empty fields in Patch requests.
  1299. ForceSendFields []string `json:"-"`
  1300. // NullFields is a list of field names (e.g. "CoolDownPeriodSec") to
  1301. // include in API requests with the JSON null value. By default, fields
  1302. // with empty values are omitted from API requests. However, any field
  1303. // with an empty value appearing in NullFields will be sent to the
  1304. // server as null. It is an error if a field in this list has a
  1305. // non-empty value. This may be used to include null fields in Patch
  1306. // requests.
  1307. NullFields []string `json:"-"`
  1308. }
  1309. func (s *AutoscalingPolicy) MarshalJSON() ([]byte, error) {
  1310. type noMethod AutoscalingPolicy
  1311. raw := noMethod(*s)
  1312. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1313. }
  1314. // AutoscalingPolicyCpuUtilization: CPU utilization policy.
  1315. type AutoscalingPolicyCpuUtilization struct {
  1316. // UtilizationTarget: The target CPU utilization that the autoscaler
  1317. // should maintain. Must be a float value in the range (0, 1]. If not
  1318. // specified, the default is 0.6.
  1319. //
  1320. // If the CPU level is below the target utilization, the autoscaler
  1321. // scales down the number of instances until it reaches the minimum
  1322. // number of instances you specified or until the average CPU of your
  1323. // instances reaches the target utilization.
  1324. //
  1325. // If the average CPU is above the target utilization, the autoscaler
  1326. // scales up until it reaches the maximum number of instances you
  1327. // specified or until the average utilization reaches the target
  1328. // utilization.
  1329. UtilizationTarget float64 `json:"utilizationTarget,omitempty"`
  1330. // ForceSendFields is a list of field names (e.g. "UtilizationTarget")
  1331. // to unconditionally include in API requests. By default, fields with
  1332. // empty values are omitted from API requests. However, any non-pointer,
  1333. // non-interface field appearing in ForceSendFields will be sent to the
  1334. // server regardless of whether the field is empty or not. This may be
  1335. // used to include empty fields in Patch requests.
  1336. ForceSendFields []string `json:"-"`
  1337. // NullFields is a list of field names (e.g. "UtilizationTarget") to
  1338. // include in API requests with the JSON null value. By default, fields
  1339. // with empty values are omitted from API requests. However, any field
  1340. // with an empty value appearing in NullFields will be sent to the
  1341. // server as null. It is an error if a field in this list has a
  1342. // non-empty value. This may be used to include null fields in Patch
  1343. // requests.
  1344. NullFields []string `json:"-"`
  1345. }
  1346. func (s *AutoscalingPolicyCpuUtilization) MarshalJSON() ([]byte, error) {
  1347. type noMethod AutoscalingPolicyCpuUtilization
  1348. raw := noMethod(*s)
  1349. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1350. }
  1351. func (s *AutoscalingPolicyCpuUtilization) UnmarshalJSON(data []byte) error {
  1352. type noMethod AutoscalingPolicyCpuUtilization
  1353. var s1 struct {
  1354. UtilizationTarget gensupport.JSONFloat64 `json:"utilizationTarget"`
  1355. *noMethod
  1356. }
  1357. s1.noMethod = (*noMethod)(s)
  1358. if err := json.Unmarshal(data, &s1); err != nil {
  1359. return err
  1360. }
  1361. s.UtilizationTarget = float64(s1.UtilizationTarget)
  1362. return nil
  1363. }
  1364. // AutoscalingPolicyCustomMetricUtilization: Custom utilization metric
  1365. // policy.
  1366. type AutoscalingPolicyCustomMetricUtilization struct {
  1367. // Metric: The identifier (type) of the Stackdriver Monitoring metric.
  1368. // The metric cannot have negative values and should be a utilization
  1369. // metric, which means that the number of virtual machines handling
  1370. // requests should increase or decrease proportionally to the
  1371. // metric.
  1372. //
  1373. // The metric must have a value type of INT64 or DOUBLE.
  1374. Metric string `json:"metric,omitempty"`
  1375. // UtilizationTarget: The target value of the metric that autoscaler
  1376. // should maintain. This must be a positive value.
  1377. //
  1378. // For example, a good metric to use as a utilization_target is
  1379. // compute.googleapis.com/instance/network/received_bytes_count. The
  1380. // autoscaler will work to keep this value constant for each of the
  1381. // instances.
  1382. UtilizationTarget float64 `json:"utilizationTarget,omitempty"`
  1383. // UtilizationTargetType: Defines how target utilization value is
  1384. // expressed for a Stackdriver Monitoring metric. Either GAUGE,
  1385. // DELTA_PER_SECOND, or DELTA_PER_MINUTE. If not specified, the default
  1386. // is GAUGE.
  1387. //
  1388. // Possible values:
  1389. // "DELTA_PER_MINUTE"
  1390. // "DELTA_PER_SECOND"
  1391. // "GAUGE"
  1392. UtilizationTargetType string `json:"utilizationTargetType,omitempty"`
  1393. // ForceSendFields is a list of field names (e.g. "Metric") to
  1394. // unconditionally include in API requests. By default, fields with
  1395. // empty values are omitted from API requests. However, any non-pointer,
  1396. // non-interface field appearing in ForceSendFields will be sent to the
  1397. // server regardless of whether the field is empty or not. This may be
  1398. // used to include empty fields in Patch requests.
  1399. ForceSendFields []string `json:"-"`
  1400. // NullFields is a list of field names (e.g. "Metric") to include in API
  1401. // requests with the JSON null value. By default, fields with empty
  1402. // values are omitted from API requests. However, any field with an
  1403. // empty value appearing in NullFields will be sent to the server as
  1404. // null. It is an error if a field in this list has a non-empty value.
  1405. // This may be used to include null fields in Patch requests.
  1406. NullFields []string `json:"-"`
  1407. }
  1408. func (s *AutoscalingPolicyCustomMetricUtilization) MarshalJSON() ([]byte, error) {
  1409. type noMethod AutoscalingPolicyCustomMetricUtilization
  1410. raw := noMethod(*s)
  1411. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1412. }
  1413. func (s *AutoscalingPolicyCustomMetricUtilization) UnmarshalJSON(data []byte) error {
  1414. type noMethod AutoscalingPolicyCustomMetricUtilization
  1415. var s1 struct {
  1416. UtilizationTarget gensupport.JSONFloat64 `json:"utilizationTarget"`
  1417. *noMethod
  1418. }
  1419. s1.noMethod = (*noMethod)(s)
  1420. if err := json.Unmarshal(data, &s1); err != nil {
  1421. return err
  1422. }
  1423. s.UtilizationTarget = float64(s1.UtilizationTarget)
  1424. return nil
  1425. }
  1426. // AutoscalingPolicyLoadBalancingUtilization: Configuration parameters
  1427. // of autoscaling based on load balancing.
  1428. type AutoscalingPolicyLoadBalancingUtilization struct {
  1429. // UtilizationTarget: Fraction of backend capacity utilization (set in
  1430. // HTTP(s) load balancing configuration) that autoscaler should
  1431. // maintain. Must be a positive float value. If not defined, the default
  1432. // is 0.8.
  1433. UtilizationTarget float64 `json:"utilizationTarget,omitempty"`
  1434. // ForceSendFields is a list of field names (e.g. "UtilizationTarget")
  1435. // to unconditionally include in API requests. By default, fields with
  1436. // empty values are omitted from API requests. However, any non-pointer,
  1437. // non-interface field appearing in ForceSendFields will be sent to the
  1438. // server regardless of whether the field is empty or not. This may be
  1439. // used to include empty fields in Patch requests.
  1440. ForceSendFields []string `json:"-"`
  1441. // NullFields is a list of field names (e.g. "UtilizationTarget") to
  1442. // include in API requests with the JSON null value. By default, fields
  1443. // with empty values are omitted from API requests. However, any field
  1444. // with an empty value appearing in NullFields will be sent to the
  1445. // server as null. It is an error if a field in this list has a
  1446. // non-empty value. This may be used to include null fields in Patch
  1447. // requests.
  1448. NullFields []string `json:"-"`
  1449. }
  1450. func (s *AutoscalingPolicyLoadBalancingUtilization) MarshalJSON() ([]byte, error) {
  1451. type noMethod AutoscalingPolicyLoadBalancingUtilization
  1452. raw := noMethod(*s)
  1453. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1454. }
  1455. func (s *AutoscalingPolicyLoadBalancingUtilization) UnmarshalJSON(data []byte) error {
  1456. type noMethod AutoscalingPolicyLoadBalancingUtilization
  1457. var s1 struct {
  1458. UtilizationTarget gensupport.JSONFloat64 `json:"utilizationTarget"`
  1459. *noMethod
  1460. }
  1461. s1.noMethod = (*noMethod)(s)
  1462. if err := json.Unmarshal(data, &s1); err != nil {
  1463. return err
  1464. }
  1465. s.UtilizationTarget = float64(s1.UtilizationTarget)
  1466. return nil
  1467. }
  1468. // Backend: Message containing information of one individual backend.
  1469. type Backend struct {
  1470. // BalancingMode: Specifies the balancing mode for this backend. For
  1471. // global HTTP(S) or TCP/SSL load balancing, the default is UTILIZATION.
  1472. // Valid values are UTILIZATION, RATE (for HTTP(S)) and CONNECTION (for
  1473. // TCP/SSL).
  1474. //
  1475. // This cannot be used for internal load balancing.
  1476. //
  1477. // Possible values:
  1478. // "CONNECTION"
  1479. // "RATE"
  1480. // "UTILIZATION"
  1481. BalancingMode string `json:"balancingMode,omitempty"`
  1482. // CapacityScaler: A multiplier applied to the group's maximum servicing
  1483. // capacity (based on UTILIZATION, RATE or CONNECTION). Default value is
  1484. // 1, which means the group will serve up to 100% of its configured
  1485. // capacity (depending on balancingMode). A setting of 0 means the group
  1486. // is completely drained, offering 0% of its available Capacity. Valid
  1487. // range is [0.0,1.0].
  1488. //
  1489. // This cannot be used for internal load balancing.
  1490. CapacityScaler float64 `json:"capacityScaler,omitempty"`
  1491. // Description: An optional description of this resource. Provide this
  1492. // property when you create the resource.
  1493. Description string `json:"description,omitempty"`
  1494. // Group: The fully-qualified URL of a zonal Instance Group resource.
  1495. // This instance group defines the list of instances that serve traffic.
  1496. // Member virtual machine instances from each instance group must live
  1497. // in the same zone as the instance group itself. No two backends in a
  1498. // backend service are allowed to use same Instance Group
  1499. // resource.
  1500. //
  1501. // Note that you must specify an Instance Group resource using the
  1502. // fully-qualified URL, rather than a partial URL.
  1503. //
  1504. // When the BackendService has load balancing scheme INTERNAL, the
  1505. // instance group must be in a zone within the same region as the
  1506. // BackendService.
  1507. Group string `json:"group,omitempty"`
  1508. // MaxConnections: The max number of simultaneous connections for the
  1509. // group. Can be used with either CONNECTION or UTILIZATION balancing
  1510. // modes. For CONNECTION mode, either maxConnections or
  1511. // maxConnectionsPerInstance must be set.
  1512. //
  1513. // This cannot be used for internal load balancing.
  1514. MaxConnections int64 `json:"maxConnections,omitempty"`
  1515. // MaxConnectionsPerInstance: The max number of simultaneous connections
  1516. // that a single backend instance can handle. This is used to calculate
  1517. // the capacity of the group. Can be used in either CONNECTION or
  1518. // UTILIZATION balancing modes. For CONNECTION mode, either
  1519. // maxConnections or maxConnectionsPerInstance must be set.
  1520. //
  1521. // This cannot be used for internal load balancing.
  1522. MaxConnectionsPerInstance int64 `json:"maxConnectionsPerInstance,omitempty"`
  1523. // MaxRate: The max requests per second (RPS) of the group. Can be used
  1524. // with either RATE or UTILIZATION balancing modes, but required if RATE
  1525. // mode. For RATE mode, either maxRate or maxRatePerInstance must be
  1526. // set.
  1527. //
  1528. // This cannot be used for internal load balancing.
  1529. MaxRate int64 `json:"maxRate,omitempty"`
  1530. // MaxRatePerInstance: The max requests per second (RPS) that a single
  1531. // backend instance can handle. This is used to calculate the capacity
  1532. // of the group. Can be used in either balancing mode. For RATE mode,
  1533. // either maxRate or maxRatePerInstance must be set.
  1534. //
  1535. // This cannot be used for internal load balancing.
  1536. MaxRatePerInstance float64 `json:"maxRatePerInstance,omitempty"`
  1537. // MaxUtilization: Used when balancingMode is UTILIZATION. This ratio
  1538. // defines the CPU utilization target for the group. The default is 0.8.
  1539. // Valid range is [0.0, 1.0].
  1540. //
  1541. // This cannot be used for internal load balancing.
  1542. MaxUtilization float64 `json:"maxUtilization,omitempty"`
  1543. // ForceSendFields is a list of field names (e.g. "BalancingMode") to
  1544. // unconditionally include in API requests. By default, fields with
  1545. // empty values are omitted from API requests. However, any non-pointer,
  1546. // non-interface field appearing in ForceSendFields will be sent to the
  1547. // server regardless of whether the field is empty or not. This may be
  1548. // used to include empty fields in Patch requests.
  1549. ForceSendFields []string `json:"-"`
  1550. // NullFields is a list of field names (e.g. "BalancingMode") to include
  1551. // in API requests with the JSON null value. By default, fields with
  1552. // empty values are omitted from API requests. However, any field with
  1553. // an empty value appearing in NullFields will be sent to the server as
  1554. // null. It is an error if a field in this list has a non-empty value.
  1555. // This may be used to include null fields in Patch requests.
  1556. NullFields []string `json:"-"`
  1557. }
  1558. func (s *Backend) MarshalJSON() ([]byte, error) {
  1559. type noMethod Backend
  1560. raw := noMethod(*s)
  1561. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1562. }
  1563. func (s *Backend) UnmarshalJSON(data []byte) error {
  1564. type noMethod Backend
  1565. var s1 struct {
  1566. CapacityScaler gensupport.JSONFloat64 `json:"capacityScaler"`
  1567. MaxRatePerInstance gensupport.JSONFloat64 `json:"maxRatePerInstance"`
  1568. MaxUtilization gensupport.JSONFloat64 `json:"maxUtilization"`
  1569. *noMethod
  1570. }
  1571. s1.noMethod = (*noMethod)(s)
  1572. if err := json.Unmarshal(data, &s1); err != nil {
  1573. return err
  1574. }
  1575. s.CapacityScaler = float64(s1.CapacityScaler)
  1576. s.MaxRatePerInstance = float64(s1.MaxRatePerInstance)
  1577. s.MaxUtilization = float64(s1.MaxUtilization)
  1578. return nil
  1579. }
  1580. // BackendBucket: A BackendBucket resource. This resource defines a
  1581. // Cloud Storage bucket.
  1582. type BackendBucket struct {
  1583. // BucketName: Cloud Storage bucket name.
  1584. BucketName string `json:"bucketName,omitempty"`
  1585. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  1586. // format.
  1587. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  1588. // Description: An optional textual description of the resource;
  1589. // provided by the client when the resource is created.
  1590. Description string `json:"description,omitempty"`
  1591. // EnableCdn: If true, enable Cloud CDN for this BackendBucket.
  1592. EnableCdn bool `json:"enableCdn,omitempty"`
  1593. // Id: [Output Only] Unique identifier for the resource; defined by the
  1594. // server.
  1595. Id uint64 `json:"id,omitempty,string"`
  1596. // Kind: Type of the resource.
  1597. Kind string `json:"kind,omitempty"`
  1598. // Name: Name of the resource. Provided by the client when the resource
  1599. // is created. The name must be 1-63 characters long, and comply with
  1600. // RFC1035. Specifically, the name must be 1-63 characters long and
  1601. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  1602. // the first character must be a lowercase letter, and all following
  1603. // characters must be a dash, lowercase letter, or digit, except the
  1604. // last character, which cannot be a dash.
  1605. Name string `json:"name,omitempty"`
  1606. // SelfLink: [Output Only] Server-defined URL for the resource.
  1607. SelfLink string `json:"selfLink,omitempty"`
  1608. // ServerResponse contains the HTTP response code and headers from the
  1609. // server.
  1610. googleapi.ServerResponse `json:"-"`
  1611. // ForceSendFields is a list of field names (e.g. "BucketName") to
  1612. // unconditionally include in API requests. By default, fields with
  1613. // empty values are omitted from API requests. However, any non-pointer,
  1614. // non-interface field appearing in ForceSendFields will be sent to the
  1615. // server regardless of whether the field is empty or not. This may be
  1616. // used to include empty fields in Patch requests.
  1617. ForceSendFields []string `json:"-"`
  1618. // NullFields is a list of field names (e.g. "BucketName") to include in
  1619. // API requests with the JSON null value. By default, fields with empty
  1620. // values are omitted from API requests. However, any field with an
  1621. // empty value appearing in NullFields will be sent to the server as
  1622. // null. It is an error if a field in this list has a non-empty value.
  1623. // This may be used to include null fields in Patch requests.
  1624. NullFields []string `json:"-"`
  1625. }
  1626. func (s *BackendBucket) MarshalJSON() ([]byte, error) {
  1627. type noMethod BackendBucket
  1628. raw := noMethod(*s)
  1629. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1630. }
  1631. // BackendBucketList: Contains a list of BackendBucket resources.
  1632. type BackendBucketList struct {
  1633. // Id: [Output Only] Unique identifier for the resource; defined by the
  1634. // server.
  1635. Id string `json:"id,omitempty"`
  1636. // Items: A list of BackendBucket resources.
  1637. Items []*BackendBucket `json:"items,omitempty"`
  1638. // Kind: Type of resource.
  1639. Kind string `json:"kind,omitempty"`
  1640. // NextPageToken: [Output Only] A token used to continue a truncated
  1641. // list request.
  1642. NextPageToken string `json:"nextPageToken,omitempty"`
  1643. // SelfLink: [Output Only] Server-defined URL for this resource.
  1644. SelfLink string `json:"selfLink,omitempty"`
  1645. // ServerResponse contains the HTTP response code and headers from the
  1646. // server.
  1647. googleapi.ServerResponse `json:"-"`
  1648. // ForceSendFields is a list of field names (e.g. "Id") to
  1649. // unconditionally include in API requests. By default, fields with
  1650. // empty values are omitted from API requests. However, any non-pointer,
  1651. // non-interface field appearing in ForceSendFields will be sent to the
  1652. // server regardless of whether the field is empty or not. This may be
  1653. // used to include empty fields in Patch requests.
  1654. ForceSendFields []string `json:"-"`
  1655. // NullFields is a list of field names (e.g. "Id") to include in API
  1656. // requests with the JSON null value. By default, fields with empty
  1657. // values are omitted from API requests. However, any field with an
  1658. // empty value appearing in NullFields will be sent to the server as
  1659. // null. It is an error if a field in this list has a non-empty value.
  1660. // This may be used to include null fields in Patch requests.
  1661. NullFields []string `json:"-"`
  1662. }
  1663. func (s *BackendBucketList) MarshalJSON() ([]byte, error) {
  1664. type noMethod BackendBucketList
  1665. raw := noMethod(*s)
  1666. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1667. }
  1668. // BackendService: A BackendService resource. This resource defines a
  1669. // group of backend virtual machines and their serving capacity.
  1670. type BackendService struct {
  1671. // AffinityCookieTtlSec: Lifetime of cookies in seconds if
  1672. // session_affinity is GENERATED_COOKIE. If set to 0, the cookie is
  1673. // non-persistent and lasts only until the end of the browser session
  1674. // (or equivalent). The maximum allowed value for TTL is one day.
  1675. //
  1676. // When the load balancing scheme is INTERNAL, this field is not used.
  1677. AffinityCookieTtlSec int64 `json:"affinityCookieTtlSec,omitempty"`
  1678. // Backends: The list of backends that serve this BackendService.
  1679. Backends []*Backend `json:"backends,omitempty"`
  1680. // CdnPolicy: Cloud CDN configuration for this BackendService.
  1681. CdnPolicy *BackendServiceCdnPolicy `json:"cdnPolicy,omitempty"`
  1682. ConnectionDraining *ConnectionDraining `json:"connectionDraining,omitempty"`
  1683. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  1684. // format.
  1685. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  1686. // Description: An optional description of this resource. Provide this
  1687. // property when you create the resource.
  1688. Description string `json:"description,omitempty"`
  1689. // EnableCDN: If true, enable Cloud CDN for this BackendService.
  1690. //
  1691. // When the load balancing scheme is INTERNAL, this field is not used.
  1692. EnableCDN bool `json:"enableCDN,omitempty"`
  1693. // Fingerprint: Fingerprint of this resource. A hash of the contents
  1694. // stored in this object. This field is used in optimistic locking. This
  1695. // field will be ignored when inserting a BackendService. An up-to-date
  1696. // fingerprint must be provided in order to update the BackendService.
  1697. Fingerprint string `json:"fingerprint,omitempty"`
  1698. // HealthChecks: The list of URLs to the HttpHealthCheck or
  1699. // HttpsHealthCheck resource for health checking this BackendService.
  1700. // Currently at most one health check can be specified, and a health
  1701. // check is required.
  1702. //
  1703. // For internal load balancing, a URL to a HealthCheck resource must be
  1704. // specified instead.
  1705. HealthChecks []string `json:"healthChecks,omitempty"`
  1706. Iap *BackendServiceIAP `json:"iap,omitempty"`
  1707. // Id: [Output Only] The unique identifier for the resource. This
  1708. // identifier is defined by the server.
  1709. Id uint64 `json:"id,omitempty,string"`
  1710. // Kind: [Output Only] Type of resource. Always compute#backendService
  1711. // for backend services.
  1712. Kind string `json:"kind,omitempty"`
  1713. // Possible values:
  1714. // "EXTERNAL"
  1715. // "INTERNAL"
  1716. // "INVALID_LOAD_BALANCING_SCHEME"
  1717. LoadBalancingScheme string `json:"loadBalancingScheme,omitempty"`
  1718. // Name: Name of the resource. Provided by the client when the resource
  1719. // is created. The name must be 1-63 characters long, and comply with
  1720. // RFC1035. Specifically, the name must be 1-63 characters long and
  1721. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  1722. // the first character must be a lowercase letter, and all following
  1723. // characters must be a dash, lowercase letter, or digit, except the
  1724. // last character, which cannot be a dash.
  1725. Name string `json:"name,omitempty"`
  1726. // Port: Deprecated in favor of portName. The TCP port to connect on the
  1727. // backend. The default value is 80.
  1728. //
  1729. // This cannot be used for internal load balancing.
  1730. Port int64 `json:"port,omitempty"`
  1731. // PortName: Name of backend port. The same name should appear in the
  1732. // instance groups referenced by this service. Required when the load
  1733. // balancing scheme is EXTERNAL.
  1734. //
  1735. // When the load balancing scheme is INTERNAL, this field is not used.
  1736. PortName string `json:"portName,omitempty"`
  1737. // Protocol: The protocol this BackendService uses to communicate with
  1738. // backends.
  1739. //
  1740. // Possible values are HTTP, HTTPS, TCP, and SSL. The default is
  1741. // HTTP.
  1742. //
  1743. // For internal load balancing, the possible values are TCP and UDP, and
  1744. // the default is TCP.
  1745. //
  1746. // Possible values:
  1747. // "HTTP"
  1748. // "HTTPS"
  1749. // "SSL"
  1750. // "TCP"
  1751. // "UDP"
  1752. Protocol string `json:"protocol,omitempty"`
  1753. // Region: [Output Only] URL of the region where the regional backend
  1754. // service resides. This field is not applicable to global backend
  1755. // services.
  1756. Region string `json:"region,omitempty"`
  1757. // SelfLink: [Output Only] Server-defined URL for the resource.
  1758. SelfLink string `json:"selfLink,omitempty"`
  1759. // SessionAffinity: Type of session affinity to use. The default is
  1760. // NONE.
  1761. //
  1762. // When the load balancing scheme is EXTERNAL, can be NONE, CLIENT_IP,
  1763. // or GENERATED_COOKIE.
  1764. //
  1765. // When the load balancing scheme is INTERNAL, can be NONE, CLIENT_IP,
  1766. // CLIENT_IP_PROTO, or CLIENT_IP_PORT_PROTO.
  1767. //
  1768. // When the protocol is UDP, this field is not used.
  1769. //
  1770. // Possible values:
  1771. // "CLIENT_IP"
  1772. // "CLIENT_IP_PORT_PROTO"
  1773. // "CLIENT_IP_PROTO"
  1774. // "GENERATED_COOKIE"
  1775. // "NONE"
  1776. SessionAffinity string `json:"sessionAffinity,omitempty"`
  1777. // TimeoutSec: How many seconds to wait for the backend before
  1778. // considering it a failed request. Default is 30 seconds.
  1779. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  1780. // ServerResponse contains the HTTP response code and headers from the
  1781. // server.
  1782. googleapi.ServerResponse `json:"-"`
  1783. // ForceSendFields is a list of field names (e.g.
  1784. // "AffinityCookieTtlSec") to unconditionally include in API requests.
  1785. // By default, fields with empty values are omitted from API requests.
  1786. // However, any non-pointer, non-interface field appearing in
  1787. // ForceSendFields will be sent to the server regardless of whether the
  1788. // field is empty or not. This may be used to include empty fields in
  1789. // Patch requests.
  1790. ForceSendFields []string `json:"-"`
  1791. // NullFields is a list of field names (e.g. "AffinityCookieTtlSec") to
  1792. // include in API requests with the JSON null value. By default, fields
  1793. // with empty values are omitted from API requests. However, any field
  1794. // with an empty value appearing in NullFields will be sent to the
  1795. // server as null. It is an error if a field in this list has a
  1796. // non-empty value. This may be used to include null fields in Patch
  1797. // requests.
  1798. NullFields []string `json:"-"`
  1799. }
  1800. func (s *BackendService) MarshalJSON() ([]byte, error) {
  1801. type noMethod BackendService
  1802. raw := noMethod(*s)
  1803. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1804. }
  1805. // BackendServiceAggregatedList: Contains a list of
  1806. // BackendServicesScopedList.
  1807. type BackendServiceAggregatedList struct {
  1808. // Id: [Output Only] Unique identifier for the resource; defined by the
  1809. // server.
  1810. Id string `json:"id,omitempty"`
  1811. // Items: A map of scoped BackendService lists.
  1812. Items map[string]BackendServicesScopedList `json:"items,omitempty"`
  1813. // Kind: Type of resource.
  1814. Kind string `json:"kind,omitempty"`
  1815. // NextPageToken: [Output Only] A token used to continue a truncated
  1816. // list request.
  1817. NextPageToken string `json:"nextPageToken,omitempty"`
  1818. // SelfLink: [Output Only] Server-defined URL for this resource.
  1819. SelfLink string `json:"selfLink,omitempty"`
  1820. // ServerResponse contains the HTTP response code and headers from the
  1821. // server.
  1822. googleapi.ServerResponse `json:"-"`
  1823. // ForceSendFields is a list of field names (e.g. "Id") to
  1824. // unconditionally include in API requests. By default, fields with
  1825. // empty values are omitted from API requests. However, any non-pointer,
  1826. // non-interface field appearing in ForceSendFields will be sent to the
  1827. // server regardless of whether the field is empty or not. This may be
  1828. // used to include empty fields in Patch requests.
  1829. ForceSendFields []string `json:"-"`
  1830. // NullFields is a list of field names (e.g. "Id") to include in API
  1831. // requests with the JSON null value. By default, fields with empty
  1832. // values are omitted from API requests. However, any field with an
  1833. // empty value appearing in NullFields will be sent to the server as
  1834. // null. It is an error if a field in this list has a non-empty value.
  1835. // This may be used to include null fields in Patch requests.
  1836. NullFields []string `json:"-"`
  1837. }
  1838. func (s *BackendServiceAggregatedList) MarshalJSON() ([]byte, error) {
  1839. type noMethod BackendServiceAggregatedList
  1840. raw := noMethod(*s)
  1841. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1842. }
  1843. // BackendServiceCdnPolicy: Message containing Cloud CDN configuration
  1844. // for a backend service.
  1845. type BackendServiceCdnPolicy struct {
  1846. // CacheKeyPolicy: The CacheKeyPolicy for this CdnPolicy.
  1847. CacheKeyPolicy *CacheKeyPolicy `json:"cacheKeyPolicy,omitempty"`
  1848. // ForceSendFields is a list of field names (e.g. "CacheKeyPolicy") to
  1849. // unconditionally include in API requests. By default, fields with
  1850. // empty values are omitted from API requests. However, any non-pointer,
  1851. // non-interface field appearing in ForceSendFields will be sent to the
  1852. // server regardless of whether the field is empty or not. This may be
  1853. // used to include empty fields in Patch requests.
  1854. ForceSendFields []string `json:"-"`
  1855. // NullFields is a list of field names (e.g. "CacheKeyPolicy") to
  1856. // include in API requests with the JSON null value. By default, fields
  1857. // with empty values are omitted from API requests. However, any field
  1858. // with an empty value appearing in NullFields will be sent to the
  1859. // server as null. It is an error if a field in this list has a
  1860. // non-empty value. This may be used to include null fields in Patch
  1861. // requests.
  1862. NullFields []string `json:"-"`
  1863. }
  1864. func (s *BackendServiceCdnPolicy) MarshalJSON() ([]byte, error) {
  1865. type noMethod BackendServiceCdnPolicy
  1866. raw := noMethod(*s)
  1867. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1868. }
  1869. type BackendServiceGroupHealth struct {
  1870. HealthStatus []*HealthStatus `json:"healthStatus,omitempty"`
  1871. // Kind: [Output Only] Type of resource. Always
  1872. // compute#backendServiceGroupHealth for the health of backend services.
  1873. Kind string `json:"kind,omitempty"`
  1874. // ServerResponse contains the HTTP response code and headers from the
  1875. // server.
  1876. googleapi.ServerResponse `json:"-"`
  1877. // ForceSendFields is a list of field names (e.g. "HealthStatus") to
  1878. // unconditionally include in API requests. By default, fields with
  1879. // empty values are omitted from API requests. However, any non-pointer,
  1880. // non-interface field appearing in ForceSendFields will be sent to the
  1881. // server regardless of whether the field is empty or not. This may be
  1882. // used to include empty fields in Patch requests.
  1883. ForceSendFields []string `json:"-"`
  1884. // NullFields is a list of field names (e.g. "HealthStatus") to include
  1885. // in API requests with the JSON null value. By default, fields with
  1886. // empty values are omitted from API requests. However, any field with
  1887. // an empty value appearing in NullFields will be sent to the server as
  1888. // null. It is an error if a field in this list has a non-empty value.
  1889. // This may be used to include null fields in Patch requests.
  1890. NullFields []string `json:"-"`
  1891. }
  1892. func (s *BackendServiceGroupHealth) MarshalJSON() ([]byte, error) {
  1893. type noMethod BackendServiceGroupHealth
  1894. raw := noMethod(*s)
  1895. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1896. }
  1897. // BackendServiceIAP: Identity-Aware Proxy
  1898. type BackendServiceIAP struct {
  1899. Enabled bool `json:"enabled,omitempty"`
  1900. Oauth2ClientId string `json:"oauth2ClientId,omitempty"`
  1901. Oauth2ClientSecret string `json:"oauth2ClientSecret,omitempty"`
  1902. // Oauth2ClientSecretSha256: [Output Only] SHA256 hash value for the
  1903. // field oauth2_client_secret above.
  1904. Oauth2ClientSecretSha256 string `json:"oauth2ClientSecretSha256,omitempty"`
  1905. // ForceSendFields is a list of field names (e.g. "Enabled") to
  1906. // unconditionally include in API requests. By default, fields with
  1907. // empty values are omitted from API requests. However, any non-pointer,
  1908. // non-interface field appearing in ForceSendFields will be sent to the
  1909. // server regardless of whether the field is empty or not. This may be
  1910. // used to include empty fields in Patch requests.
  1911. ForceSendFields []string `json:"-"`
  1912. // NullFields is a list of field names (e.g. "Enabled") to include in
  1913. // API requests with the JSON null value. By default, fields with empty
  1914. // values are omitted from API requests. However, any field with an
  1915. // empty value appearing in NullFields will be sent to the server as
  1916. // null. It is an error if a field in this list has a non-empty value.
  1917. // This may be used to include null fields in Patch requests.
  1918. NullFields []string `json:"-"`
  1919. }
  1920. func (s *BackendServiceIAP) MarshalJSON() ([]byte, error) {
  1921. type noMethod BackendServiceIAP
  1922. raw := noMethod(*s)
  1923. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1924. }
  1925. // BackendServiceList: Contains a list of BackendService resources.
  1926. type BackendServiceList struct {
  1927. // Id: [Output Only] Unique identifier for the resource; defined by the
  1928. // server.
  1929. Id string `json:"id,omitempty"`
  1930. // Items: A list of BackendService resources.
  1931. Items []*BackendService `json:"items,omitempty"`
  1932. // Kind: [Output Only] Type of resource. Always
  1933. // compute#backendServiceList for lists of backend services.
  1934. Kind string `json:"kind,omitempty"`
  1935. // NextPageToken: [Output Only] This token allows you to get the next
  1936. // page of results for list requests. If the number of results is larger
  1937. // than maxResults, use the nextPageToken as a value for the query
  1938. // parameter pageToken in the next list request. Subsequent list
  1939. // requests will have their own nextPageToken to continue paging through
  1940. // the results.
  1941. NextPageToken string `json:"nextPageToken,omitempty"`
  1942. // SelfLink: [Output Only] Server-defined URL for this resource.
  1943. SelfLink string `json:"selfLink,omitempty"`
  1944. // ServerResponse contains the HTTP response code and headers from the
  1945. // server.
  1946. googleapi.ServerResponse `json:"-"`
  1947. // ForceSendFields is a list of field names (e.g. "Id") to
  1948. // unconditionally include in API requests. By default, fields with
  1949. // empty values are omitted from API requests. However, any non-pointer,
  1950. // non-interface field appearing in ForceSendFields will be sent to the
  1951. // server regardless of whether the field is empty or not. This may be
  1952. // used to include empty fields in Patch requests.
  1953. ForceSendFields []string `json:"-"`
  1954. // NullFields is a list of field names (e.g. "Id") to include in API
  1955. // requests with the JSON null value. By default, fields with empty
  1956. // values are omitted from API requests. However, any field with an
  1957. // empty value appearing in NullFields will be sent to the server as
  1958. // null. It is an error if a field in this list has a non-empty value.
  1959. // This may be used to include null fields in Patch requests.
  1960. NullFields []string `json:"-"`
  1961. }
  1962. func (s *BackendServiceList) MarshalJSON() ([]byte, error) {
  1963. type noMethod BackendServiceList
  1964. raw := noMethod(*s)
  1965. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1966. }
  1967. type BackendServicesScopedList struct {
  1968. // BackendServices: List of BackendServices contained in this scope.
  1969. BackendServices []*BackendService `json:"backendServices,omitempty"`
  1970. // Warning: Informational warning which replaces the list of backend
  1971. // services when the list is empty.
  1972. Warning *BackendServicesScopedListWarning `json:"warning,omitempty"`
  1973. // ForceSendFields is a list of field names (e.g. "BackendServices") to
  1974. // unconditionally include in API requests. By default, fields with
  1975. // empty values are omitted from API requests. However, any non-pointer,
  1976. // non-interface field appearing in ForceSendFields will be sent to the
  1977. // server regardless of whether the field is empty or not. This may be
  1978. // used to include empty fields in Patch requests.
  1979. ForceSendFields []string `json:"-"`
  1980. // NullFields is a list of field names (e.g. "BackendServices") to
  1981. // include in API requests with the JSON null value. By default, fields
  1982. // with empty values are omitted from API requests. However, any field
  1983. // with an empty value appearing in NullFields will be sent to the
  1984. // server as null. It is an error if a field in this list has a
  1985. // non-empty value. This may be used to include null fields in Patch
  1986. // requests.
  1987. NullFields []string `json:"-"`
  1988. }
  1989. func (s *BackendServicesScopedList) MarshalJSON() ([]byte, error) {
  1990. type noMethod BackendServicesScopedList
  1991. raw := noMethod(*s)
  1992. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1993. }
  1994. // BackendServicesScopedListWarning: Informational warning which
  1995. // replaces the list of backend services when the list is empty.
  1996. type BackendServicesScopedListWarning struct {
  1997. // Code: [Output Only] A warning code, if applicable. For example,
  1998. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1999. // the response.
  2000. //
  2001. // Possible values:
  2002. // "CLEANUP_FAILED"
  2003. // "DEPRECATED_RESOURCE_USED"
  2004. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  2005. // "FIELD_VALUE_OVERRIDEN"
  2006. // "INJECTED_KERNELS_DEPRECATED"
  2007. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  2008. // "NEXT_HOP_CANNOT_IP_FORWARD"
  2009. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  2010. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  2011. // "NEXT_HOP_NOT_RUNNING"
  2012. // "NOT_CRITICAL_ERROR"
  2013. // "NO_RESULTS_ON_PAGE"
  2014. // "REQUIRED_TOS_AGREEMENT"
  2015. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  2016. // "RESOURCE_NOT_DELETED"
  2017. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  2018. // "UNREACHABLE"
  2019. Code string `json:"code,omitempty"`
  2020. // Data: [Output Only] Metadata about this warning in key: value format.
  2021. // For example:
  2022. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  2023. Data []*BackendServicesScopedListWarningData `json:"data,omitempty"`
  2024. // Message: [Output Only] A human-readable description of the warning
  2025. // code.
  2026. Message string `json:"message,omitempty"`
  2027. // ForceSendFields is a list of field names (e.g. "Code") to
  2028. // unconditionally include in API requests. By default, fields with
  2029. // empty values are omitted from API requests. However, any non-pointer,
  2030. // non-interface field appearing in ForceSendFields will be sent to the
  2031. // server regardless of whether the field is empty or not. This may be
  2032. // used to include empty fields in Patch requests.
  2033. ForceSendFields []string `json:"-"`
  2034. // NullFields is a list of field names (e.g. "Code") to include in API
  2035. // requests with the JSON null value. By default, fields with empty
  2036. // values are omitted from API requests. However, any field with an
  2037. // empty value appearing in NullFields will be sent to the server as
  2038. // null. It is an error if a field in this list has a non-empty value.
  2039. // This may be used to include null fields in Patch requests.
  2040. NullFields []string `json:"-"`
  2041. }
  2042. func (s *BackendServicesScopedListWarning) MarshalJSON() ([]byte, error) {
  2043. type noMethod BackendServicesScopedListWarning
  2044. raw := noMethod(*s)
  2045. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2046. }
  2047. type BackendServicesScopedListWarningData struct {
  2048. // Key: [Output Only] A key that provides more detail on the warning
  2049. // being returned. For example, for warnings where there are no results
  2050. // in a list request for a particular zone, this key might be scope and
  2051. // the key value might be the zone name. Other examples might be a key
  2052. // indicating a deprecated resource and a suggested replacement, or a
  2053. // warning about invalid network settings (for example, if an instance
  2054. // attempts to perform IP forwarding but is not enabled for IP
  2055. // forwarding).
  2056. Key string `json:"key,omitempty"`
  2057. // Value: [Output Only] A warning data value corresponding to the key.
  2058. Value string `json:"value,omitempty"`
  2059. // ForceSendFields is a list of field names (e.g. "Key") to
  2060. // unconditionally include in API requests. By default, fields with
  2061. // empty values are omitted from API requests. However, any non-pointer,
  2062. // non-interface field appearing in ForceSendFields will be sent to the
  2063. // server regardless of whether the field is empty or not. This may be
  2064. // used to include empty fields in Patch requests.
  2065. ForceSendFields []string `json:"-"`
  2066. // NullFields is a list of field names (e.g. "Key") to include in API
  2067. // requests with the JSON null value. By default, fields with empty
  2068. // values are omitted from API requests. However, any field with an
  2069. // empty value appearing in NullFields will be sent to the server as
  2070. // null. It is an error if a field in this list has a non-empty value.
  2071. // This may be used to include null fields in Patch requests.
  2072. NullFields []string `json:"-"`
  2073. }
  2074. func (s *BackendServicesScopedListWarningData) MarshalJSON() ([]byte, error) {
  2075. type noMethod BackendServicesScopedListWarningData
  2076. raw := noMethod(*s)
  2077. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2078. }
  2079. type CacheInvalidationRule struct {
  2080. // Host: If set, this invalidation rule will only apply to requests with
  2081. // a Host header matching host.
  2082. Host string `json:"host,omitempty"`
  2083. Path string `json:"path,omitempty"`
  2084. // ForceSendFields is a list of field names (e.g. "Host") to
  2085. // unconditionally include in API requests. By default, fields with
  2086. // empty values are omitted from API requests. However, any non-pointer,
  2087. // non-interface field appearing in ForceSendFields will be sent to the
  2088. // server regardless of whether the field is empty or not. This may be
  2089. // used to include empty fields in Patch requests.
  2090. ForceSendFields []string `json:"-"`
  2091. // NullFields is a list of field names (e.g. "Host") to include in API
  2092. // requests with the JSON null value. By default, fields with empty
  2093. // values are omitted from API requests. However, any field with an
  2094. // empty value appearing in NullFields will be sent to the server as
  2095. // null. It is an error if a field in this list has a non-empty value.
  2096. // This may be used to include null fields in Patch requests.
  2097. NullFields []string `json:"-"`
  2098. }
  2099. func (s *CacheInvalidationRule) MarshalJSON() ([]byte, error) {
  2100. type noMethod CacheInvalidationRule
  2101. raw := noMethod(*s)
  2102. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2103. }
  2104. // CacheKeyPolicy: Message containing what to include in the cache key
  2105. // for a request for Cloud CDN.
  2106. type CacheKeyPolicy struct {
  2107. // IncludeHost: If true, requests to different hosts will be cached
  2108. // separately.
  2109. IncludeHost bool `json:"includeHost,omitempty"`
  2110. // IncludeProtocol: If true, http and https requests will be cached
  2111. // separately.
  2112. IncludeProtocol bool `json:"includeProtocol,omitempty"`
  2113. // IncludeQueryString: If true, include query string parameters in the
  2114. // cache key according to query_string_whitelist and
  2115. // query_string_blacklist. If neither is set, the entire query string
  2116. // will be included. If false, the query string will be excluded from
  2117. // the cache key entirely.
  2118. IncludeQueryString bool `json:"includeQueryString,omitempty"`
  2119. // QueryStringBlacklist: Names of query string parameters to exclude in
  2120. // cache keys. All other parameters will be included. Either specify
  2121. // query_string_whitelist or query_string_blacklist, not both. '&' and
  2122. // '=' will be percent encoded and not treated as delimiters.
  2123. QueryStringBlacklist []string `json:"queryStringBlacklist,omitempty"`
  2124. // QueryStringWhitelist: Names of query string parameters to include in
  2125. // cache keys. All other parameters will be excluded. Either specify
  2126. // query_string_whitelist or query_string_blacklist, not both. '&' and
  2127. // '=' will be percent encoded and not treated as delimiters.
  2128. QueryStringWhitelist []string `json:"queryStringWhitelist,omitempty"`
  2129. // ForceSendFields is a list of field names (e.g. "IncludeHost") to
  2130. // unconditionally include in API requests. By default, fields with
  2131. // empty values are omitted from API requests. However, any non-pointer,
  2132. // non-interface field appearing in ForceSendFields will be sent to the
  2133. // server regardless of whether the field is empty or not. This may be
  2134. // used to include empty fields in Patch requests.
  2135. ForceSendFields []string `json:"-"`
  2136. // NullFields is a list of field names (e.g. "IncludeHost") to include
  2137. // in API requests with the JSON null value. By default, fields with
  2138. // empty values are omitted from API requests. However, any field with
  2139. // an empty value appearing in NullFields will be sent to the server as
  2140. // null. It is an error if a field in this list has a non-empty value.
  2141. // This may be used to include null fields in Patch requests.
  2142. NullFields []string `json:"-"`
  2143. }
  2144. func (s *CacheKeyPolicy) MarshalJSON() ([]byte, error) {
  2145. type noMethod CacheKeyPolicy
  2146. raw := noMethod(*s)
  2147. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2148. }
  2149. // ConnectionDraining: Message containing connection draining
  2150. // configuration.
  2151. type ConnectionDraining struct {
  2152. // DrainingTimeoutSec: Time for which instance will be drained (not
  2153. // accept new connections, but still work to finish started).
  2154. DrainingTimeoutSec int64 `json:"drainingTimeoutSec,omitempty"`
  2155. // ForceSendFields is a list of field names (e.g. "DrainingTimeoutSec")
  2156. // to unconditionally include in API requests. By default, fields with
  2157. // empty values are omitted from API requests. However, any non-pointer,
  2158. // non-interface field appearing in ForceSendFields will be sent to the
  2159. // server regardless of whether the field is empty or not. This may be
  2160. // used to include empty fields in Patch requests.
  2161. ForceSendFields []string `json:"-"`
  2162. // NullFields is a list of field names (e.g. "DrainingTimeoutSec") to
  2163. // include in API requests with the JSON null value. By default, fields
  2164. // with empty values are omitted from API requests. However, any field
  2165. // with an empty value appearing in NullFields will be sent to the
  2166. // server as null. It is an error if a field in this list has a
  2167. // non-empty value. This may be used to include null fields in Patch
  2168. // requests.
  2169. NullFields []string `json:"-"`
  2170. }
  2171. func (s *ConnectionDraining) MarshalJSON() ([]byte, error) {
  2172. type noMethod ConnectionDraining
  2173. raw := noMethod(*s)
  2174. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2175. }
  2176. // CustomerEncryptionKey: Represents a customer-supplied encryption key
  2177. type CustomerEncryptionKey struct {
  2178. // RawKey: Specifies a 256-bit customer-supplied encryption key, encoded
  2179. // in RFC 4648 base64 to either encrypt or decrypt this resource.
  2180. RawKey string `json:"rawKey,omitempty"`
  2181. // Sha256: [Output only] The RFC 4648 base64 encoded SHA-256 hash of the
  2182. // customer-supplied encryption key that protects this resource.
  2183. Sha256 string `json:"sha256,omitempty"`
  2184. // ForceSendFields is a list of field names (e.g. "RawKey") to
  2185. // unconditionally include in API requests. By default, fields with
  2186. // empty values are omitted from API requests. However, any non-pointer,
  2187. // non-interface field appearing in ForceSendFields will be sent to the
  2188. // server regardless of whether the field is empty or not. This may be
  2189. // used to include empty fields in Patch requests.
  2190. ForceSendFields []string `json:"-"`
  2191. // NullFields is a list of field names (e.g. "RawKey") to include in API
  2192. // requests with the JSON null value. By default, fields with empty
  2193. // values are omitted from API requests. However, any field with an
  2194. // empty value appearing in NullFields will be sent to the server as
  2195. // null. It is an error if a field in this list has a non-empty value.
  2196. // This may be used to include null fields in Patch requests.
  2197. NullFields []string `json:"-"`
  2198. }
  2199. func (s *CustomerEncryptionKey) MarshalJSON() ([]byte, error) {
  2200. type noMethod CustomerEncryptionKey
  2201. raw := noMethod(*s)
  2202. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2203. }
  2204. type CustomerEncryptionKeyProtectedDisk struct {
  2205. // DiskEncryptionKey: Decrypts data associated with the disk with a
  2206. // customer-supplied encryption key.
  2207. DiskEncryptionKey *CustomerEncryptionKey `json:"diskEncryptionKey,omitempty"`
  2208. // Source: Specifies a valid partial or full URL to an existing
  2209. // Persistent Disk resource. This field is only applicable for
  2210. // persistent disks.
  2211. Source string `json:"source,omitempty"`
  2212. // ForceSendFields is a list of field names (e.g. "DiskEncryptionKey")
  2213. // to unconditionally include in API requests. By default, fields with
  2214. // empty values are omitted from API requests. However, any non-pointer,
  2215. // non-interface field appearing in ForceSendFields will be sent to the
  2216. // server regardless of whether the field is empty or not. This may be
  2217. // used to include empty fields in Patch requests.
  2218. ForceSendFields []string `json:"-"`
  2219. // NullFields is a list of field names (e.g. "DiskEncryptionKey") to
  2220. // include in API requests with the JSON null value. By default, fields
  2221. // with empty values are omitted from API requests. However, any field
  2222. // with an empty value appearing in NullFields will be sent to the
  2223. // server as null. It is an error if a field in this list has a
  2224. // non-empty value. This may be used to include null fields in Patch
  2225. // requests.
  2226. NullFields []string `json:"-"`
  2227. }
  2228. func (s *CustomerEncryptionKeyProtectedDisk) MarshalJSON() ([]byte, error) {
  2229. type noMethod CustomerEncryptionKeyProtectedDisk
  2230. raw := noMethod(*s)
  2231. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2232. }
  2233. // DeprecationStatus: Deprecation status for a public resource.
  2234. type DeprecationStatus struct {
  2235. // Deleted: An optional RFC3339 timestamp on or after which the state of
  2236. // this resource is intended to change to DELETED. This is only
  2237. // informational and the status will not change unless the client
  2238. // explicitly changes it.
  2239. Deleted string `json:"deleted,omitempty"`
  2240. // Deprecated: An optional RFC3339 timestamp on or after which the state
  2241. // of this resource is intended to change to DEPRECATED. This is only
  2242. // informational and the status will not change unless the client
  2243. // explicitly changes it.
  2244. Deprecated string `json:"deprecated,omitempty"`
  2245. // Obsolete: An optional RFC3339 timestamp on or after which the state
  2246. // of this resource is intended to change to OBSOLETE. This is only
  2247. // informational and the status will not change unless the client
  2248. // explicitly changes it.
  2249. Obsolete string `json:"obsolete,omitempty"`
  2250. // Replacement: The URL of the suggested replacement for a deprecated
  2251. // resource. The suggested replacement resource must be the same kind of
  2252. // resource as the deprecated resource.
  2253. Replacement string `json:"replacement,omitempty"`
  2254. // State: The deprecation state of this resource. This can be
  2255. // DEPRECATED, OBSOLETE, or DELETED. Operations which create a new
  2256. // resource using a DEPRECATED resource will return successfully, but
  2257. // with a warning indicating the deprecated resource and recommending
  2258. // its replacement. Operations which use OBSOLETE or DELETED resources
  2259. // will be rejected and result in an error.
  2260. //
  2261. // Possible values:
  2262. // "DELETED"
  2263. // "DEPRECATED"
  2264. // "OBSOLETE"
  2265. State string `json:"state,omitempty"`
  2266. // ForceSendFields is a list of field names (e.g. "Deleted") to
  2267. // unconditionally include in API requests. By default, fields with
  2268. // empty values are omitted from API requests. However, any non-pointer,
  2269. // non-interface field appearing in ForceSendFields will be sent to the
  2270. // server regardless of whether the field is empty or not. This may be
  2271. // used to include empty fields in Patch requests.
  2272. ForceSendFields []string `json:"-"`
  2273. // NullFields is a list of field names (e.g. "Deleted") to include in
  2274. // API requests with the JSON null value. By default, fields with empty
  2275. // values are omitted from API requests. However, any field with an
  2276. // empty value appearing in NullFields will be sent to the server as
  2277. // null. It is an error if a field in this list has a non-empty value.
  2278. // This may be used to include null fields in Patch requests.
  2279. NullFields []string `json:"-"`
  2280. }
  2281. func (s *DeprecationStatus) MarshalJSON() ([]byte, error) {
  2282. type noMethod DeprecationStatus
  2283. raw := noMethod(*s)
  2284. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2285. }
  2286. // Disk: A Disk resource.
  2287. type Disk struct {
  2288. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  2289. // format.
  2290. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  2291. // Description: An optional description of this resource. Provide this
  2292. // property when you create the resource.
  2293. Description string `json:"description,omitempty"`
  2294. // DiskEncryptionKey: Encrypts the disk using a customer-supplied
  2295. // encryption key.
  2296. //
  2297. // After you encrypt a disk with a customer-supplied key, you must
  2298. // provide the same key if you use the disk later (e.g. to create a disk
  2299. // snapshot or an image, or to attach the disk to a virtual
  2300. // machine).
  2301. //
  2302. // Customer-supplied encryption keys do not protect access to metadata
  2303. // of the disk.
  2304. //
  2305. // If you do not provide an encryption key when creating the disk, then
  2306. // the disk will be encrypted using an automatically generated key and
  2307. // you do not need to provide a key to use the disk later.
  2308. DiskEncryptionKey *CustomerEncryptionKey `json:"diskEncryptionKey,omitempty"`
  2309. // Id: [Output Only] The unique identifier for the resource. This
  2310. // identifier is defined by the server.
  2311. Id uint64 `json:"id,omitempty,string"`
  2312. // Kind: [Output Only] Type of the resource. Always compute#disk for
  2313. // disks.
  2314. Kind string `json:"kind,omitempty"`
  2315. // LabelFingerprint: A fingerprint for the labels being applied to this
  2316. // disk, which is essentially a hash of the labels set used for
  2317. // optimistic locking. The fingerprint is initially generated by Compute
  2318. // Engine and changes after every request to modify or update labels.
  2319. // You must always provide an up-to-date fingerprint hash in order to
  2320. // update or change labels.
  2321. //
  2322. // To see the latest fingerprint, make a get() request to retrieve a
  2323. // disk.
  2324. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  2325. // Labels: Labels to apply to this disk. These can be later modified by
  2326. // the setLabels method.
  2327. Labels map[string]string `json:"labels,omitempty"`
  2328. // LastAttachTimestamp: [Output Only] Last attach timestamp in RFC3339
  2329. // text format.
  2330. LastAttachTimestamp string `json:"lastAttachTimestamp,omitempty"`
  2331. // LastDetachTimestamp: [Output Only] Last detach timestamp in RFC3339
  2332. // text format.
  2333. LastDetachTimestamp string `json:"lastDetachTimestamp,omitempty"`
  2334. // Licenses: Any applicable publicly visible licenses.
  2335. Licenses []string `json:"licenses,omitempty"`
  2336. // Name: Name of the resource. Provided by the client when the resource
  2337. // is created. The name must be 1-63 characters long, and comply with
  2338. // RFC1035. Specifically, the name must be 1-63 characters long and
  2339. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  2340. // the first character must be a lowercase letter, and all following
  2341. // characters must be a dash, lowercase letter, or digit, except the
  2342. // last character, which cannot be a dash.
  2343. Name string `json:"name,omitempty"`
  2344. // Options: Internal use only.
  2345. Options string `json:"options,omitempty"`
  2346. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  2347. // resource.
  2348. SelfLink string `json:"selfLink,omitempty"`
  2349. // SizeGb: Size of the persistent disk, specified in GB. You can specify
  2350. // this field when creating a persistent disk using the sourceImage or
  2351. // sourceSnapshot parameter, or specify it alone to create an empty
  2352. // persistent disk.
  2353. //
  2354. // If you specify this field along with sourceImage or sourceSnapshot,
  2355. // the value of sizeGb must not be less than the size of the sourceImage
  2356. // or the size of the snapshot.
  2357. SizeGb int64 `json:"sizeGb,omitempty,string"`
  2358. // SourceImage: The source image used to create this disk. If the source
  2359. // image is deleted, this field will not be set.
  2360. //
  2361. // To create a disk with one of the public operating system images,
  2362. // specify the image by its family name. For example, specify
  2363. // family/debian-8 to use the latest Debian 8
  2364. // image:
  2365. //
  2366. // projects/debian-cloud/global/images/family/debian-8
  2367. //
  2368. // Alternatively, use a specific version of a public operating system
  2369. // image:
  2370. //
  2371. // projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
  2372. //
  2373. // To create a disk with a private image that you created, specify the
  2374. // image name in the following format:
  2375. //
  2376. // global/images/my-private-image
  2377. //
  2378. // You can also specify a private image by its image family, which
  2379. // returns the latest version of the image in that family. Replace the
  2380. // image name with
  2381. // family/family-name:
  2382. //
  2383. // global/images/family/my-private-family
  2384. SourceImage string `json:"sourceImage,omitempty"`
  2385. // SourceImageEncryptionKey: The customer-supplied encryption key of the
  2386. // source image. Required if the source image is protected by a
  2387. // customer-supplied encryption key.
  2388. SourceImageEncryptionKey *CustomerEncryptionKey `json:"sourceImageEncryptionKey,omitempty"`
  2389. // SourceImageId: [Output Only] The ID value of the image used to create
  2390. // this disk. This value identifies the exact image that was used to
  2391. // create this persistent disk. For example, if you created the
  2392. // persistent disk from an image that was later deleted and recreated
  2393. // under the same name, the source image ID would identify the exact
  2394. // version of the image that was used.
  2395. SourceImageId string `json:"sourceImageId,omitempty"`
  2396. // SourceSnapshot: The source snapshot used to create this disk. You can
  2397. // provide this as a partial or full URL to the resource. For example,
  2398. // the following are valid values:
  2399. // -
  2400. // https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
  2401. // - projects/project/global/snapshots/snapshot
  2402. // - global/snapshots/snapshot
  2403. SourceSnapshot string `json:"sourceSnapshot,omitempty"`
  2404. // SourceSnapshotEncryptionKey: The customer-supplied encryption key of
  2405. // the source snapshot. Required if the source snapshot is protected by
  2406. // a customer-supplied encryption key.
  2407. SourceSnapshotEncryptionKey *CustomerEncryptionKey `json:"sourceSnapshotEncryptionKey,omitempty"`
  2408. // SourceSnapshotId: [Output Only] The unique ID of the snapshot used to
  2409. // create this disk. This value identifies the exact snapshot that was
  2410. // used to create this persistent disk. For example, if you created the
  2411. // persistent disk from a snapshot that was later deleted and recreated
  2412. // under the same name, the source snapshot ID would identify the exact
  2413. // version of the snapshot that was used.
  2414. SourceSnapshotId string `json:"sourceSnapshotId,omitempty"`
  2415. // Status: [Output Only] The status of disk creation.
  2416. //
  2417. // Possible values:
  2418. // "CREATING"
  2419. // "FAILED"
  2420. // "READY"
  2421. // "RESTORING"
  2422. Status string `json:"status,omitempty"`
  2423. // Type: URL of the disk type resource describing which disk type to use
  2424. // to create the disk. Provide this when creating the disk.
  2425. Type string `json:"type,omitempty"`
  2426. // Users: [Output Only] Links to the users of the disk (attached
  2427. // instances) in form: project/zones/zone/instances/instance
  2428. Users []string `json:"users,omitempty"`
  2429. // Zone: [Output Only] URL of the zone where the disk resides.
  2430. Zone string `json:"zone,omitempty"`
  2431. // ServerResponse contains the HTTP response code and headers from the
  2432. // server.
  2433. googleapi.ServerResponse `json:"-"`
  2434. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  2435. // to unconditionally include in API requests. By default, fields with
  2436. // empty values are omitted from API requests. However, any non-pointer,
  2437. // non-interface field appearing in ForceSendFields will be sent to the
  2438. // server regardless of whether the field is empty or not. This may be
  2439. // used to include empty fields in Patch requests.
  2440. ForceSendFields []string `json:"-"`
  2441. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  2442. // include in API requests with the JSON null value. By default, fields
  2443. // with empty values are omitted from API requests. However, any field
  2444. // with an empty value appearing in NullFields will be sent to the
  2445. // server as null. It is an error if a field in this list has a
  2446. // non-empty value. This may be used to include null fields in Patch
  2447. // requests.
  2448. NullFields []string `json:"-"`
  2449. }
  2450. func (s *Disk) MarshalJSON() ([]byte, error) {
  2451. type noMethod Disk
  2452. raw := noMethod(*s)
  2453. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2454. }
  2455. type DiskAggregatedList struct {
  2456. // Id: [Output Only] The unique identifier for the resource. This
  2457. // identifier is defined by the server.
  2458. Id string `json:"id,omitempty"`
  2459. // Items: [Output Only] A map of scoped disk lists.
  2460. Items map[string]DisksScopedList `json:"items,omitempty"`
  2461. // Kind: [Output Only] Type of resource. Always
  2462. // compute#diskAggregatedList for aggregated lists of persistent disks.
  2463. Kind string `json:"kind,omitempty"`
  2464. // NextPageToken: [Output Only] This token allows you to get the next
  2465. // page of results for list requests. If the number of results is larger
  2466. // than maxResults, use the nextPageToken as a value for the query
  2467. // parameter pageToken in the next list request. Subsequent list
  2468. // requests will have their own nextPageToken to continue paging through
  2469. // the results. Acceptable values are 0 to 500, inclusive. (Default:
  2470. // 500)
  2471. NextPageToken string `json:"nextPageToken,omitempty"`
  2472. // SelfLink: [Output Only] Server-defined URL for this resource.
  2473. SelfLink string `json:"selfLink,omitempty"`
  2474. // ServerResponse contains the HTTP response code and headers from the
  2475. // server.
  2476. googleapi.ServerResponse `json:"-"`
  2477. // ForceSendFields is a list of field names (e.g. "Id") to
  2478. // unconditionally include in API requests. By default, fields with
  2479. // empty values are omitted from API requests. However, any non-pointer,
  2480. // non-interface field appearing in ForceSendFields will be sent to the
  2481. // server regardless of whether the field is empty or not. This may be
  2482. // used to include empty fields in Patch requests.
  2483. ForceSendFields []string `json:"-"`
  2484. // NullFields is a list of field names (e.g. "Id") to include in API
  2485. // requests with the JSON null value. By default, fields with empty
  2486. // values are omitted from API requests. However, any field with an
  2487. // empty value appearing in NullFields will be sent to the server as
  2488. // null. It is an error if a field in this list has a non-empty value.
  2489. // This may be used to include null fields in Patch requests.
  2490. NullFields []string `json:"-"`
  2491. }
  2492. func (s *DiskAggregatedList) MarshalJSON() ([]byte, error) {
  2493. type noMethod DiskAggregatedList
  2494. raw := noMethod(*s)
  2495. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2496. }
  2497. // DiskList: A list of Disk resources.
  2498. type DiskList struct {
  2499. // Id: [Output Only] Unique identifier for the resource; defined by the
  2500. // server.
  2501. Id string `json:"id,omitempty"`
  2502. // Items: A list of Disk resources.
  2503. Items []*Disk `json:"items,omitempty"`
  2504. // Kind: [Output Only] Type of resource. Always compute#diskList for
  2505. // lists of disks.
  2506. Kind string `json:"kind,omitempty"`
  2507. // NextPageToken: This token allows you to get the next page of results
  2508. // for list requests. If the number of results is larger than
  2509. // maxResults, use the nextPageToken as a value for the query parameter
  2510. // pageToken in the next list request. Subsequent list requests will
  2511. // have their own nextPageToken to continue paging through the results.
  2512. NextPageToken string `json:"nextPageToken,omitempty"`
  2513. // SelfLink: [Output Only] Server-defined URL for this resource.
  2514. SelfLink string `json:"selfLink,omitempty"`
  2515. // ServerResponse contains the HTTP response code and headers from the
  2516. // server.
  2517. googleapi.ServerResponse `json:"-"`
  2518. // ForceSendFields is a list of field names (e.g. "Id") to
  2519. // unconditionally include in API requests. By default, fields with
  2520. // empty values are omitted from API requests. However, any non-pointer,
  2521. // non-interface field appearing in ForceSendFields will be sent to the
  2522. // server regardless of whether the field is empty or not. This may be
  2523. // used to include empty fields in Patch requests.
  2524. ForceSendFields []string `json:"-"`
  2525. // NullFields is a list of field names (e.g. "Id") to include in API
  2526. // requests with the JSON null value. By default, fields with empty
  2527. // values are omitted from API requests. However, any field with an
  2528. // empty value appearing in NullFields will be sent to the server as
  2529. // null. It is an error if a field in this list has a non-empty value.
  2530. // This may be used to include null fields in Patch requests.
  2531. NullFields []string `json:"-"`
  2532. }
  2533. func (s *DiskList) MarshalJSON() ([]byte, error) {
  2534. type noMethod DiskList
  2535. raw := noMethod(*s)
  2536. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2537. }
  2538. type DiskMoveRequest struct {
  2539. // DestinationZone: The URL of the destination zone to move the disk.
  2540. // This can be a full or partial URL. For example, the following are all
  2541. // valid URLs to a zone:
  2542. // - https://www.googleapis.com/compute/v1/projects/project/zones/zone
  2543. //
  2544. // - projects/project/zones/zone
  2545. // - zones/zone
  2546. DestinationZone string `json:"destinationZone,omitempty"`
  2547. // TargetDisk: The URL of the target disk to move. This can be a full or
  2548. // partial URL. For example, the following are all valid URLs to a disk:
  2549. //
  2550. // -
  2551. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk
  2552. // - projects/project/zones/zone/disks/disk
  2553. // - zones/zone/disks/disk
  2554. TargetDisk string `json:"targetDisk,omitempty"`
  2555. // ForceSendFields is a list of field names (e.g. "DestinationZone") to
  2556. // unconditionally include in API requests. By default, fields with
  2557. // empty values are omitted from API requests. However, any non-pointer,
  2558. // non-interface field appearing in ForceSendFields will be sent to the
  2559. // server regardless of whether the field is empty or not. This may be
  2560. // used to include empty fields in Patch requests.
  2561. ForceSendFields []string `json:"-"`
  2562. // NullFields is a list of field names (e.g. "DestinationZone") to
  2563. // include in API requests with the JSON null value. By default, fields
  2564. // with empty values are omitted from API requests. However, any field
  2565. // with an empty value appearing in NullFields will be sent to the
  2566. // server as null. It is an error if a field in this list has a
  2567. // non-empty value. This may be used to include null fields in Patch
  2568. // requests.
  2569. NullFields []string `json:"-"`
  2570. }
  2571. func (s *DiskMoveRequest) MarshalJSON() ([]byte, error) {
  2572. type noMethod DiskMoveRequest
  2573. raw := noMethod(*s)
  2574. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2575. }
  2576. // DiskType: A DiskType resource.
  2577. type DiskType struct {
  2578. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  2579. // format.
  2580. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  2581. // DefaultDiskSizeGb: [Output Only] Server-defined default disk size in
  2582. // GB.
  2583. DefaultDiskSizeGb int64 `json:"defaultDiskSizeGb,omitempty,string"`
  2584. // Deprecated: [Output Only] The deprecation status associated with this
  2585. // disk type.
  2586. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  2587. // Description: [Output Only] An optional description of this resource.
  2588. Description string `json:"description,omitempty"`
  2589. // Id: [Output Only] The unique identifier for the resource. This
  2590. // identifier is defined by the server.
  2591. Id uint64 `json:"id,omitempty,string"`
  2592. // Kind: [Output Only] Type of the resource. Always compute#diskType for
  2593. // disk types.
  2594. Kind string `json:"kind,omitempty"`
  2595. // Name: [Output Only] Name of the resource.
  2596. Name string `json:"name,omitempty"`
  2597. // SelfLink: [Output Only] Server-defined URL for the resource.
  2598. SelfLink string `json:"selfLink,omitempty"`
  2599. // ValidDiskSize: [Output Only] An optional textual description of the
  2600. // valid disk size, such as "10GB-10TB".
  2601. ValidDiskSize string `json:"validDiskSize,omitempty"`
  2602. // Zone: [Output Only] URL of the zone where the disk type resides.
  2603. Zone string `json:"zone,omitempty"`
  2604. // ServerResponse contains the HTTP response code and headers from the
  2605. // server.
  2606. googleapi.ServerResponse `json:"-"`
  2607. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  2608. // to unconditionally include in API requests. By default, fields with
  2609. // empty values are omitted from API requests. However, any non-pointer,
  2610. // non-interface field appearing in ForceSendFields will be sent to the
  2611. // server regardless of whether the field is empty or not. This may be
  2612. // used to include empty fields in Patch requests.
  2613. ForceSendFields []string `json:"-"`
  2614. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  2615. // include in API requests with the JSON null value. By default, fields
  2616. // with empty values are omitted from API requests. However, any field
  2617. // with an empty value appearing in NullFields will be sent to the
  2618. // server as null. It is an error if a field in this list has a
  2619. // non-empty value. This may be used to include null fields in Patch
  2620. // requests.
  2621. NullFields []string `json:"-"`
  2622. }
  2623. func (s *DiskType) MarshalJSON() ([]byte, error) {
  2624. type noMethod DiskType
  2625. raw := noMethod(*s)
  2626. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2627. }
  2628. type DiskTypeAggregatedList struct {
  2629. // Id: [Output Only] The unique identifier for the resource. This
  2630. // identifier is defined by the server.
  2631. Id string `json:"id,omitempty"`
  2632. // Items: [Output Only] A map of scoped disk type lists.
  2633. Items map[string]DiskTypesScopedList `json:"items,omitempty"`
  2634. // Kind: [Output Only] Type of resource. Always
  2635. // compute#diskTypeAggregatedList.
  2636. Kind string `json:"kind,omitempty"`
  2637. // NextPageToken: [Output Only] This token allows you to get the next
  2638. // page of results for list requests. If the number of results is larger
  2639. // than maxResults, use the nextPageToken as a value for the query
  2640. // parameter pageToken in the next list request. Subsequent list
  2641. // requests will have their own nextPageToken to continue paging through
  2642. // the results.
  2643. NextPageToken string `json:"nextPageToken,omitempty"`
  2644. // SelfLink: [Output Only] Server-defined URL for this resource.
  2645. SelfLink string `json:"selfLink,omitempty"`
  2646. // ServerResponse contains the HTTP response code and headers from the
  2647. // server.
  2648. googleapi.ServerResponse `json:"-"`
  2649. // ForceSendFields is a list of field names (e.g. "Id") to
  2650. // unconditionally include in API requests. By default, fields with
  2651. // empty values are omitted from API requests. However, any non-pointer,
  2652. // non-interface field appearing in ForceSendFields will be sent to the
  2653. // server regardless of whether the field is empty or not. This may be
  2654. // used to include empty fields in Patch requests.
  2655. ForceSendFields []string `json:"-"`
  2656. // NullFields is a list of field names (e.g. "Id") to include in API
  2657. // requests with the JSON null value. By default, fields with empty
  2658. // values are omitted from API requests. However, any field with an
  2659. // empty value appearing in NullFields will be sent to the server as
  2660. // null. It is an error if a field in this list has a non-empty value.
  2661. // This may be used to include null fields in Patch requests.
  2662. NullFields []string `json:"-"`
  2663. }
  2664. func (s *DiskTypeAggregatedList) MarshalJSON() ([]byte, error) {
  2665. type noMethod DiskTypeAggregatedList
  2666. raw := noMethod(*s)
  2667. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2668. }
  2669. // DiskTypeList: Contains a list of disk types.
  2670. type DiskTypeList struct {
  2671. // Id: [Output Only] The unique identifier for the resource. This
  2672. // identifier is defined by the server.
  2673. Id string `json:"id,omitempty"`
  2674. // Items: [Output Only] A list of Disk Type resources.
  2675. Items []*DiskType `json:"items,omitempty"`
  2676. // Kind: [Output Only] Type of resource. Always compute#diskTypeList for
  2677. // disk types.
  2678. Kind string `json:"kind,omitempty"`
  2679. // NextPageToken: [Output Only] This token allows you to get the next
  2680. // page of results for list requests. If the number of results is larger
  2681. // than maxResults, use the nextPageToken as a value for the query
  2682. // parameter pageToken in the next list request. Subsequent list
  2683. // requests will have their own nextPageToken to continue paging through
  2684. // the results.
  2685. NextPageToken string `json:"nextPageToken,omitempty"`
  2686. // SelfLink: [Output Only] Server-defined URL for this resource.
  2687. SelfLink string `json:"selfLink,omitempty"`
  2688. // ServerResponse contains the HTTP response code and headers from the
  2689. // server.
  2690. googleapi.ServerResponse `json:"-"`
  2691. // ForceSendFields is a list of field names (e.g. "Id") to
  2692. // unconditionally include in API requests. By default, fields with
  2693. // empty values are omitted from API requests. However, any non-pointer,
  2694. // non-interface field appearing in ForceSendFields will be sent to the
  2695. // server regardless of whether the field is empty or not. This may be
  2696. // used to include empty fields in Patch requests.
  2697. ForceSendFields []string `json:"-"`
  2698. // NullFields is a list of field names (e.g. "Id") to include in API
  2699. // requests with the JSON null value. By default, fields with empty
  2700. // values are omitted from API requests. However, any field with an
  2701. // empty value appearing in NullFields will be sent to the server as
  2702. // null. It is an error if a field in this list has a non-empty value.
  2703. // This may be used to include null fields in Patch requests.
  2704. NullFields []string `json:"-"`
  2705. }
  2706. func (s *DiskTypeList) MarshalJSON() ([]byte, error) {
  2707. type noMethod DiskTypeList
  2708. raw := noMethod(*s)
  2709. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2710. }
  2711. type DiskTypesScopedList struct {
  2712. // DiskTypes: [Output Only] List of disk types contained in this scope.
  2713. DiskTypes []*DiskType `json:"diskTypes,omitempty"`
  2714. // Warning: [Output Only] Informational warning which replaces the list
  2715. // of disk types when the list is empty.
  2716. Warning *DiskTypesScopedListWarning `json:"warning,omitempty"`
  2717. // ForceSendFields is a list of field names (e.g. "DiskTypes") to
  2718. // unconditionally include in API requests. By default, fields with
  2719. // empty values are omitted from API requests. However, any non-pointer,
  2720. // non-interface field appearing in ForceSendFields will be sent to the
  2721. // server regardless of whether the field is empty or not. This may be
  2722. // used to include empty fields in Patch requests.
  2723. ForceSendFields []string `json:"-"`
  2724. // NullFields is a list of field names (e.g. "DiskTypes") to include in
  2725. // API requests with the JSON null value. By default, fields with empty
  2726. // values are omitted from API requests. However, any field with an
  2727. // empty value appearing in NullFields will be sent to the server as
  2728. // null. It is an error if a field in this list has a non-empty value.
  2729. // This may be used to include null fields in Patch requests.
  2730. NullFields []string `json:"-"`
  2731. }
  2732. func (s *DiskTypesScopedList) MarshalJSON() ([]byte, error) {
  2733. type noMethod DiskTypesScopedList
  2734. raw := noMethod(*s)
  2735. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2736. }
  2737. // DiskTypesScopedListWarning: [Output Only] Informational warning which
  2738. // replaces the list of disk types when the list is empty.
  2739. type DiskTypesScopedListWarning struct {
  2740. // Code: [Output Only] A warning code, if applicable. For example,
  2741. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  2742. // the response.
  2743. //
  2744. // Possible values:
  2745. // "CLEANUP_FAILED"
  2746. // "DEPRECATED_RESOURCE_USED"
  2747. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  2748. // "FIELD_VALUE_OVERRIDEN"
  2749. // "INJECTED_KERNELS_DEPRECATED"
  2750. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  2751. // "NEXT_HOP_CANNOT_IP_FORWARD"
  2752. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  2753. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  2754. // "NEXT_HOP_NOT_RUNNING"
  2755. // "NOT_CRITICAL_ERROR"
  2756. // "NO_RESULTS_ON_PAGE"
  2757. // "REQUIRED_TOS_AGREEMENT"
  2758. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  2759. // "RESOURCE_NOT_DELETED"
  2760. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  2761. // "UNREACHABLE"
  2762. Code string `json:"code,omitempty"`
  2763. // Data: [Output Only] Metadata about this warning in key: value format.
  2764. // For example:
  2765. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  2766. Data []*DiskTypesScopedListWarningData `json:"data,omitempty"`
  2767. // Message: [Output Only] A human-readable description of the warning
  2768. // code.
  2769. Message string `json:"message,omitempty"`
  2770. // ForceSendFields is a list of field names (e.g. "Code") to
  2771. // unconditionally include in API requests. By default, fields with
  2772. // empty values are omitted from API requests. However, any non-pointer,
  2773. // non-interface field appearing in ForceSendFields will be sent to the
  2774. // server regardless of whether the field is empty or not. This may be
  2775. // used to include empty fields in Patch requests.
  2776. ForceSendFields []string `json:"-"`
  2777. // NullFields is a list of field names (e.g. "Code") to include in API
  2778. // requests with the JSON null value. By default, fields with empty
  2779. // values are omitted from API requests. However, any field with an
  2780. // empty value appearing in NullFields will be sent to the server as
  2781. // null. It is an error if a field in this list has a non-empty value.
  2782. // This may be used to include null fields in Patch requests.
  2783. NullFields []string `json:"-"`
  2784. }
  2785. func (s *DiskTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  2786. type noMethod DiskTypesScopedListWarning
  2787. raw := noMethod(*s)
  2788. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2789. }
  2790. type DiskTypesScopedListWarningData struct {
  2791. // Key: [Output Only] A key that provides more detail on the warning
  2792. // being returned. For example, for warnings where there are no results
  2793. // in a list request for a particular zone, this key might be scope and
  2794. // the key value might be the zone name. Other examples might be a key
  2795. // indicating a deprecated resource and a suggested replacement, or a
  2796. // warning about invalid network settings (for example, if an instance
  2797. // attempts to perform IP forwarding but is not enabled for IP
  2798. // forwarding).
  2799. Key string `json:"key,omitempty"`
  2800. // Value: [Output Only] A warning data value corresponding to the key.
  2801. Value string `json:"value,omitempty"`
  2802. // ForceSendFields is a list of field names (e.g. "Key") to
  2803. // unconditionally include in API requests. By default, fields with
  2804. // empty values are omitted from API requests. However, any non-pointer,
  2805. // non-interface field appearing in ForceSendFields will be sent to the
  2806. // server regardless of whether the field is empty or not. This may be
  2807. // used to include empty fields in Patch requests.
  2808. ForceSendFields []string `json:"-"`
  2809. // NullFields is a list of field names (e.g. "Key") to include in API
  2810. // requests with the JSON null value. By default, fields with empty
  2811. // values are omitted from API requests. However, any field with an
  2812. // empty value appearing in NullFields will be sent to the server as
  2813. // null. It is an error if a field in this list has a non-empty value.
  2814. // This may be used to include null fields in Patch requests.
  2815. NullFields []string `json:"-"`
  2816. }
  2817. func (s *DiskTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  2818. type noMethod DiskTypesScopedListWarningData
  2819. raw := noMethod(*s)
  2820. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2821. }
  2822. type DisksResizeRequest struct {
  2823. // SizeGb: The new size of the persistent disk, which is specified in
  2824. // GB.
  2825. SizeGb int64 `json:"sizeGb,omitempty,string"`
  2826. // ForceSendFields is a list of field names (e.g. "SizeGb") to
  2827. // unconditionally include in API requests. By default, fields with
  2828. // empty values are omitted from API requests. However, any non-pointer,
  2829. // non-interface field appearing in ForceSendFields will be sent to the
  2830. // server regardless of whether the field is empty or not. This may be
  2831. // used to include empty fields in Patch requests.
  2832. ForceSendFields []string `json:"-"`
  2833. // NullFields is a list of field names (e.g. "SizeGb") to include in API
  2834. // requests with the JSON null value. By default, fields with empty
  2835. // values are omitted from API requests. However, any field with an
  2836. // empty value appearing in NullFields will be sent to the server as
  2837. // null. It is an error if a field in this list has a non-empty value.
  2838. // This may be used to include null fields in Patch requests.
  2839. NullFields []string `json:"-"`
  2840. }
  2841. func (s *DisksResizeRequest) MarshalJSON() ([]byte, error) {
  2842. type noMethod DisksResizeRequest
  2843. raw := noMethod(*s)
  2844. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2845. }
  2846. type DisksScopedList struct {
  2847. // Disks: [Output Only] List of disks contained in this scope.
  2848. Disks []*Disk `json:"disks,omitempty"`
  2849. // Warning: [Output Only] Informational warning which replaces the list
  2850. // of disks when the list is empty.
  2851. Warning *DisksScopedListWarning `json:"warning,omitempty"`
  2852. // ForceSendFields is a list of field names (e.g. "Disks") to
  2853. // unconditionally include in API requests. By default, fields with
  2854. // empty values are omitted from API requests. However, any non-pointer,
  2855. // non-interface field appearing in ForceSendFields will be sent to the
  2856. // server regardless of whether the field is empty or not. This may be
  2857. // used to include empty fields in Patch requests.
  2858. ForceSendFields []string `json:"-"`
  2859. // NullFields is a list of field names (e.g. "Disks") to include in API
  2860. // requests with the JSON null value. By default, fields with empty
  2861. // values are omitted from API requests. However, any field with an
  2862. // empty value appearing in NullFields will be sent to the server as
  2863. // null. It is an error if a field in this list has a non-empty value.
  2864. // This may be used to include null fields in Patch requests.
  2865. NullFields []string `json:"-"`
  2866. }
  2867. func (s *DisksScopedList) MarshalJSON() ([]byte, error) {
  2868. type noMethod DisksScopedList
  2869. raw := noMethod(*s)
  2870. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2871. }
  2872. // DisksScopedListWarning: [Output Only] Informational warning which
  2873. // replaces the list of disks when the list is empty.
  2874. type DisksScopedListWarning struct {
  2875. // Code: [Output Only] A warning code, if applicable. For example,
  2876. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  2877. // the response.
  2878. //
  2879. // Possible values:
  2880. // "CLEANUP_FAILED"
  2881. // "DEPRECATED_RESOURCE_USED"
  2882. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  2883. // "FIELD_VALUE_OVERRIDEN"
  2884. // "INJECTED_KERNELS_DEPRECATED"
  2885. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  2886. // "NEXT_HOP_CANNOT_IP_FORWARD"
  2887. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  2888. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  2889. // "NEXT_HOP_NOT_RUNNING"
  2890. // "NOT_CRITICAL_ERROR"
  2891. // "NO_RESULTS_ON_PAGE"
  2892. // "REQUIRED_TOS_AGREEMENT"
  2893. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  2894. // "RESOURCE_NOT_DELETED"
  2895. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  2896. // "UNREACHABLE"
  2897. Code string `json:"code,omitempty"`
  2898. // Data: [Output Only] Metadata about this warning in key: value format.
  2899. // For example:
  2900. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  2901. Data []*DisksScopedListWarningData `json:"data,omitempty"`
  2902. // Message: [Output Only] A human-readable description of the warning
  2903. // code.
  2904. Message string `json:"message,omitempty"`
  2905. // ForceSendFields is a list of field names (e.g. "Code") to
  2906. // unconditionally include in API requests. By default, fields with
  2907. // empty values are omitted from API requests. However, any non-pointer,
  2908. // non-interface field appearing in ForceSendFields will be sent to the
  2909. // server regardless of whether the field is empty or not. This may be
  2910. // used to include empty fields in Patch requests.
  2911. ForceSendFields []string `json:"-"`
  2912. // NullFields is a list of field names (e.g. "Code") to include in API
  2913. // requests with the JSON null value. By default, fields with empty
  2914. // values are omitted from API requests. However, any field with an
  2915. // empty value appearing in NullFields will be sent to the server as
  2916. // null. It is an error if a field in this list has a non-empty value.
  2917. // This may be used to include null fields in Patch requests.
  2918. NullFields []string `json:"-"`
  2919. }
  2920. func (s *DisksScopedListWarning) MarshalJSON() ([]byte, error) {
  2921. type noMethod DisksScopedListWarning
  2922. raw := noMethod(*s)
  2923. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2924. }
  2925. type DisksScopedListWarningData struct {
  2926. // Key: [Output Only] A key that provides more detail on the warning
  2927. // being returned. For example, for warnings where there are no results
  2928. // in a list request for a particular zone, this key might be scope and
  2929. // the key value might be the zone name. Other examples might be a key
  2930. // indicating a deprecated resource and a suggested replacement, or a
  2931. // warning about invalid network settings (for example, if an instance
  2932. // attempts to perform IP forwarding but is not enabled for IP
  2933. // forwarding).
  2934. Key string `json:"key,omitempty"`
  2935. // Value: [Output Only] A warning data value corresponding to the key.
  2936. Value string `json:"value,omitempty"`
  2937. // ForceSendFields is a list of field names (e.g. "Key") to
  2938. // unconditionally include in API requests. By default, fields with
  2939. // empty values are omitted from API requests. However, any non-pointer,
  2940. // non-interface field appearing in ForceSendFields will be sent to the
  2941. // server regardless of whether the field is empty or not. This may be
  2942. // used to include empty fields in Patch requests.
  2943. ForceSendFields []string `json:"-"`
  2944. // NullFields is a list of field names (e.g. "Key") to include in API
  2945. // requests with the JSON null value. By default, fields with empty
  2946. // values are omitted from API requests. However, any field with an
  2947. // empty value appearing in NullFields will be sent to the server as
  2948. // null. It is an error if a field in this list has a non-empty value.
  2949. // This may be used to include null fields in Patch requests.
  2950. NullFields []string `json:"-"`
  2951. }
  2952. func (s *DisksScopedListWarningData) MarshalJSON() ([]byte, error) {
  2953. type noMethod DisksScopedListWarningData
  2954. raw := noMethod(*s)
  2955. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2956. }
  2957. // Firewall: Represents a Firewall resource.
  2958. type Firewall struct {
  2959. // Allowed: The list of ALLOW rules specified by this firewall. Each
  2960. // rule specifies a protocol and port-range tuple that describes a
  2961. // permitted connection.
  2962. Allowed []*FirewallAllowed `json:"allowed,omitempty"`
  2963. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  2964. // format.
  2965. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  2966. // Description: An optional description of this resource. Provide this
  2967. // property when you create the resource.
  2968. Description string `json:"description,omitempty"`
  2969. // Id: [Output Only] The unique identifier for the resource. This
  2970. // identifier is defined by the server.
  2971. Id uint64 `json:"id,omitempty,string"`
  2972. // Kind: [Output Only] Type of the resource. Always compute#firewall for
  2973. // firewall rules.
  2974. Kind string `json:"kind,omitempty"`
  2975. // Name: Name of the resource; provided by the client when the resource
  2976. // is created. The name must be 1-63 characters long, and comply with
  2977. // RFC1035. Specifically, the name must be 1-63 characters long and
  2978. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  2979. // the first character must be a lowercase letter, and all following
  2980. // characters must be a dash, lowercase letter, or digit, except the
  2981. // last character, which cannot be a dash.
  2982. Name string `json:"name,omitempty"`
  2983. // Network: URL of the network resource for this firewall rule. If not
  2984. // specified when creating a firewall rule, the default network is
  2985. // used:
  2986. // global/networks/default
  2987. // If you choose to specify this property, you can specify the network
  2988. // as a full or partial URL. For example, the following are all valid
  2989. // URLs:
  2990. // -
  2991. // https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network
  2992. // - projects/myproject/global/networks/my-network
  2993. // - global/networks/default
  2994. Network string `json:"network,omitempty"`
  2995. // SelfLink: [Output Only] Server-defined URL for the resource.
  2996. SelfLink string `json:"selfLink,omitempty"`
  2997. // SourceRanges: If source ranges are specified, the firewall will apply
  2998. // only to traffic that has source IP address in these ranges. These
  2999. // ranges must be expressed in CIDR format. One or both of sourceRanges
  3000. // and sourceTags may be set. If both properties are set, the firewall
  3001. // will apply to traffic that has source IP address within sourceRanges
  3002. // OR the source IP that belongs to a tag listed in the sourceTags
  3003. // property. The connection does not need to match both properties for
  3004. // the firewall to apply. Only IPv4 is supported.
  3005. SourceRanges []string `json:"sourceRanges,omitempty"`
  3006. // SourceTags: If source tags are specified, the firewall will apply
  3007. // only to traffic with source IP that belongs to a tag listed in source
  3008. // tags. Source tags cannot be used to control traffic to an instance's
  3009. // external IP address. Because tags are associated with an instance,
  3010. // not an IP address. One or both of sourceRanges and sourceTags may be
  3011. // set. If both properties are set, the firewall will apply to traffic
  3012. // that has source IP address within sourceRanges OR the source IP that
  3013. // belongs to a tag listed in the sourceTags property. The connection
  3014. // does not need to match both properties for the firewall to apply.
  3015. SourceTags []string `json:"sourceTags,omitempty"`
  3016. // TargetTags: A list of instance tags indicating sets of instances
  3017. // located in the network that may make network connections as specified
  3018. // in allowed[]. If no targetTags are specified, the firewall rule
  3019. // applies to all instances on the specified network.
  3020. TargetTags []string `json:"targetTags,omitempty"`
  3021. // ServerResponse contains the HTTP response code and headers from the
  3022. // server.
  3023. googleapi.ServerResponse `json:"-"`
  3024. // ForceSendFields is a list of field names (e.g. "Allowed") to
  3025. // unconditionally include in API requests. By default, fields with
  3026. // empty values are omitted from API requests. However, any non-pointer,
  3027. // non-interface field appearing in ForceSendFields will be sent to the
  3028. // server regardless of whether the field is empty or not. This may be
  3029. // used to include empty fields in Patch requests.
  3030. ForceSendFields []string `json:"-"`
  3031. // NullFields is a list of field names (e.g. "Allowed") to include in
  3032. // API requests with the JSON null value. By default, fields with empty
  3033. // values are omitted from API requests. However, any field with an
  3034. // empty value appearing in NullFields will be sent to the server as
  3035. // null. It is an error if a field in this list has a non-empty value.
  3036. // This may be used to include null fields in Patch requests.
  3037. NullFields []string `json:"-"`
  3038. }
  3039. func (s *Firewall) MarshalJSON() ([]byte, error) {
  3040. type noMethod Firewall
  3041. raw := noMethod(*s)
  3042. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3043. }
  3044. type FirewallAllowed struct {
  3045. // IPProtocol: The IP protocol to which this rule applies. The protocol
  3046. // type is required when creating a firewall rule. This value can either
  3047. // be one of the following well known protocol strings (tcp, udp, icmp,
  3048. // esp, ah, sctp), or the IP protocol number.
  3049. IPProtocol string `json:"IPProtocol,omitempty"`
  3050. // Ports: An optional list of ports to which this rule applies. This
  3051. // field is only applicable for UDP or TCP protocol. Each entry must be
  3052. // either an integer or a range. If not specified, this rule applies to
  3053. // connections through any port.
  3054. //
  3055. // Example inputs include: ["22"], ["80","443"], and ["12345-12349"].
  3056. Ports []string `json:"ports,omitempty"`
  3057. // ForceSendFields is a list of field names (e.g. "IPProtocol") to
  3058. // unconditionally include in API requests. By default, fields with
  3059. // empty values are omitted from API requests. However, any non-pointer,
  3060. // non-interface field appearing in ForceSendFields will be sent to the
  3061. // server regardless of whether the field is empty or not. This may be
  3062. // used to include empty fields in Patch requests.
  3063. ForceSendFields []string `json:"-"`
  3064. // NullFields is a list of field names (e.g. "IPProtocol") to include in
  3065. // API requests with the JSON null value. By default, fields with empty
  3066. // values are omitted from API requests. However, any field with an
  3067. // empty value appearing in NullFields will be sent to the server as
  3068. // null. It is an error if a field in this list has a non-empty value.
  3069. // This may be used to include null fields in Patch requests.
  3070. NullFields []string `json:"-"`
  3071. }
  3072. func (s *FirewallAllowed) MarshalJSON() ([]byte, error) {
  3073. type noMethod FirewallAllowed
  3074. raw := noMethod(*s)
  3075. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3076. }
  3077. // FirewallList: Contains a list of firewalls.
  3078. type FirewallList struct {
  3079. // Id: [Output Only] The unique identifier for the resource. This
  3080. // identifier is defined by the server.
  3081. Id string `json:"id,omitempty"`
  3082. // Items: [Output Only] A list of Firewall resources.
  3083. Items []*Firewall `json:"items,omitempty"`
  3084. // Kind: [Output Only] Type of resource. Always compute#firewallList for
  3085. // lists of firewalls.
  3086. Kind string `json:"kind,omitempty"`
  3087. // NextPageToken: [Output Only] This token allows you to get the next
  3088. // page of results for list requests. If the number of results is larger
  3089. // than maxResults, use the nextPageToken as a value for the query
  3090. // parameter pageToken in the next list request. Subsequent list
  3091. // requests will have their own nextPageToken to continue paging through
  3092. // the results.
  3093. NextPageToken string `json:"nextPageToken,omitempty"`
  3094. // SelfLink: [Output Only] Server-defined URL for this resource.
  3095. SelfLink string `json:"selfLink,omitempty"`
  3096. // ServerResponse contains the HTTP response code and headers from the
  3097. // server.
  3098. googleapi.ServerResponse `json:"-"`
  3099. // ForceSendFields is a list of field names (e.g. "Id") to
  3100. // unconditionally include in API requests. By default, fields with
  3101. // empty values are omitted from API requests. However, any non-pointer,
  3102. // non-interface field appearing in ForceSendFields will be sent to the
  3103. // server regardless of whether the field is empty or not. This may be
  3104. // used to include empty fields in Patch requests.
  3105. ForceSendFields []string `json:"-"`
  3106. // NullFields is a list of field names (e.g. "Id") to include in API
  3107. // requests with the JSON null value. By default, fields with empty
  3108. // values are omitted from API requests. However, any field with an
  3109. // empty value appearing in NullFields will be sent to the server as
  3110. // null. It is an error if a field in this list has a non-empty value.
  3111. // This may be used to include null fields in Patch requests.
  3112. NullFields []string `json:"-"`
  3113. }
  3114. func (s *FirewallList) MarshalJSON() ([]byte, error) {
  3115. type noMethod FirewallList
  3116. raw := noMethod(*s)
  3117. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3118. }
  3119. // ForwardingRule: A ForwardingRule resource. A ForwardingRule resource
  3120. // specifies which pool of target virtual machines to forward a packet
  3121. // to if it matches the given [IPAddress, IPProtocol, ports] tuple.
  3122. type ForwardingRule struct {
  3123. // IPAddress: The IP address that this forwarding rule is serving on
  3124. // behalf of.
  3125. //
  3126. // For global forwarding rules, the address must be a global IP. For
  3127. // regional forwarding rules, the address must live in the same region
  3128. // as the forwarding rule. By default, this field is empty and an
  3129. // ephemeral IPv4 address from the same scope (global or regional) will
  3130. // be assigned. A regional forwarding rule supports IPv4 only. A global
  3131. // forwarding rule supports either IPv4 or IPv6.
  3132. //
  3133. // When the load balancing scheme is INTERNAL, this can only be an RFC
  3134. // 1918 IP address belonging to the network/subnetwork configured for
  3135. // the forwarding rule. A reserved address cannot be used. If the field
  3136. // is empty, the IP address will be automatically allocated from the
  3137. // internal IP range of the subnetwork or network configured for this
  3138. // forwarding rule.
  3139. IPAddress string `json:"IPAddress,omitempty"`
  3140. // IPProtocol: The IP protocol to which this rule applies. Valid options
  3141. // are TCP, UDP, ESP, AH, SCTP or ICMP.
  3142. //
  3143. // When the load balancing scheme is INTERNAL, only TCP and UDP are
  3144. // valid.
  3145. //
  3146. // Possible values:
  3147. // "AH"
  3148. // "ESP"
  3149. // "ICMP"
  3150. // "SCTP"
  3151. // "TCP"
  3152. // "UDP"
  3153. IPProtocol string `json:"IPProtocol,omitempty"`
  3154. // BackendService: This field is not used for external load
  3155. // balancing.
  3156. //
  3157. // For internal load balancing, this field identifies the BackendService
  3158. // resource to receive the matched traffic.
  3159. BackendService string `json:"backendService,omitempty"`
  3160. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  3161. // format.
  3162. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  3163. // Description: An optional description of this resource. Provide this
  3164. // property when you create the resource.
  3165. Description string `json:"description,omitempty"`
  3166. // Id: [Output Only] The unique identifier for the resource. This
  3167. // identifier is defined by the server.
  3168. Id uint64 `json:"id,omitempty,string"`
  3169. // IpVersion: The IP Version that will be used by this forwarding rule.
  3170. // Valid options are IPV4 or IPV6. This can only be specified for a
  3171. // global forwarding rule.
  3172. //
  3173. // Possible values:
  3174. // "IPV4"
  3175. // "IPV6"
  3176. // "UNSPECIFIED_VERSION"
  3177. IpVersion string `json:"ipVersion,omitempty"`
  3178. // Kind: [Output Only] Type of the resource. Always
  3179. // compute#forwardingRule for Forwarding Rule resources.
  3180. Kind string `json:"kind,omitempty"`
  3181. // LoadBalancingScheme: This signifies what the ForwardingRule will be
  3182. // used for and can only take the following values: INTERNAL, EXTERNAL
  3183. // The value of INTERNAL means that this will be used for Internal
  3184. // Network Load Balancing (TCP, UDP). The value of EXTERNAL means that
  3185. // this will be used for External Load Balancing (HTTP(S) LB, External
  3186. // TCP/UDP LB, SSL Proxy)
  3187. //
  3188. // Possible values:
  3189. // "EXTERNAL"
  3190. // "INTERNAL"
  3191. // "INVALID"
  3192. LoadBalancingScheme string `json:"loadBalancingScheme,omitempty"`
  3193. // Name: Name of the resource; provided by the client when the resource
  3194. // is created. The name must be 1-63 characters long, and comply with
  3195. // RFC1035. Specifically, the name must be 1-63 characters long and
  3196. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  3197. // the first character must be a lowercase letter, and all following
  3198. // characters must be a dash, lowercase letter, or digit, except the
  3199. // last character, which cannot be a dash.
  3200. Name string `json:"name,omitempty"`
  3201. // Network: This field is not used for external load balancing.
  3202. //
  3203. // For internal load balancing, this field identifies the network that
  3204. // the load balanced IP should belong to for this Forwarding Rule. If
  3205. // this field is not specified, the default network will be used.
  3206. Network string `json:"network,omitempty"`
  3207. // PortRange: This field is used along with the target field for
  3208. // TargetHttpProxy, TargetHttpsProxy, TargetSslProxy, TargetTcpProxy,
  3209. // TargetVpnGateway, TargetPool, TargetInstance.
  3210. //
  3211. // Applicable only when IPProtocol is TCP, UDP, or SCTP, only packets
  3212. // addressed to ports in the specified range will be forwarded to
  3213. // target. Forwarding rules with the same [IPAddress, IPProtocol] pair
  3214. // must have disjoint port ranges.
  3215. //
  3216. // Some types of forwarding target have constraints on the acceptable
  3217. // ports:
  3218. // - TargetHttpProxy: 80, 8080
  3219. // - TargetHttpsProxy: 443
  3220. // - TargetTcpProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993, 995
  3221. //
  3222. // - TargetSslProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993, 995
  3223. //
  3224. // - TargetVpnGateway: 500, 4500
  3225. // -
  3226. PortRange string `json:"portRange,omitempty"`
  3227. // Ports: This field is used along with the backend_service field for
  3228. // internal load balancing.
  3229. //
  3230. // When the load balancing scheme is INTERNAL, a single port or a comma
  3231. // separated list of ports can be configured. Only packets addressed to
  3232. // these ports will be forwarded to the backends configured with this
  3233. // forwarding rule.
  3234. //
  3235. // You may specify a maximum of up to 5 ports.
  3236. Ports []string `json:"ports,omitempty"`
  3237. // Region: [Output Only] URL of the region where the regional forwarding
  3238. // rule resides. This field is not applicable to global forwarding
  3239. // rules.
  3240. Region string `json:"region,omitempty"`
  3241. // SelfLink: [Output Only] Server-defined URL for the resource.
  3242. SelfLink string `json:"selfLink,omitempty"`
  3243. // Subnetwork: This field is not used for external load balancing.
  3244. //
  3245. // For internal load balancing, this field identifies the subnetwork
  3246. // that the load balanced IP should belong to for this Forwarding
  3247. // Rule.
  3248. //
  3249. // If the network specified is in auto subnet mode, this field is
  3250. // optional. However, if the network is in custom subnet mode, a
  3251. // subnetwork must be specified.
  3252. Subnetwork string `json:"subnetwork,omitempty"`
  3253. // Target: The URL of the target resource to receive the matched
  3254. // traffic. For regional forwarding rules, this target must live in the
  3255. // same region as the forwarding rule. For global forwarding rules, this
  3256. // target must be a global load balancing resource. The forwarded
  3257. // traffic must be of a type appropriate to the target object.
  3258. //
  3259. // This field is not used for internal load balancing.
  3260. Target string `json:"target,omitempty"`
  3261. // ServerResponse contains the HTTP response code and headers from the
  3262. // server.
  3263. googleapi.ServerResponse `json:"-"`
  3264. // ForceSendFields is a list of field names (e.g. "IPAddress") to
  3265. // unconditionally include in API requests. By default, fields with
  3266. // empty values are omitted from API requests. However, any non-pointer,
  3267. // non-interface field appearing in ForceSendFields will be sent to the
  3268. // server regardless of whether the field is empty or not. This may be
  3269. // used to include empty fields in Patch requests.
  3270. ForceSendFields []string `json:"-"`
  3271. // NullFields is a list of field names (e.g. "IPAddress") to include in
  3272. // API requests with the JSON null value. By default, fields with empty
  3273. // values are omitted from API requests. However, any field with an
  3274. // empty value appearing in NullFields will be sent to the server as
  3275. // null. It is an error if a field in this list has a non-empty value.
  3276. // This may be used to include null fields in Patch requests.
  3277. NullFields []string `json:"-"`
  3278. }
  3279. func (s *ForwardingRule) MarshalJSON() ([]byte, error) {
  3280. type noMethod ForwardingRule
  3281. raw := noMethod(*s)
  3282. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3283. }
  3284. type ForwardingRuleAggregatedList struct {
  3285. // Id: [Output Only] The unique identifier for the resource. This
  3286. // identifier is defined by the server.
  3287. Id string `json:"id,omitempty"`
  3288. // Items: A map of scoped forwarding rule lists.
  3289. Items map[string]ForwardingRulesScopedList `json:"items,omitempty"`
  3290. // Kind: [Output Only] Type of resource. Always
  3291. // compute#forwardingRuleAggregatedList for lists of forwarding rules.
  3292. Kind string `json:"kind,omitempty"`
  3293. // NextPageToken: [Output Only] This token allows you to get the next
  3294. // page of results for list requests. If the number of results is larger
  3295. // than maxResults, use the nextPageToken as a value for the query
  3296. // parameter pageToken in the next list request. Subsequent list
  3297. // requests will have their own nextPageToken to continue paging through
  3298. // the results.
  3299. NextPageToken string `json:"nextPageToken,omitempty"`
  3300. // SelfLink: [Output Only] Server-defined URL for this resource.
  3301. SelfLink string `json:"selfLink,omitempty"`
  3302. // ServerResponse contains the HTTP response code and headers from the
  3303. // server.
  3304. googleapi.ServerResponse `json:"-"`
  3305. // ForceSendFields is a list of field names (e.g. "Id") to
  3306. // unconditionally include in API requests. By default, fields with
  3307. // empty values are omitted from API requests. However, any non-pointer,
  3308. // non-interface field appearing in ForceSendFields will be sent to the
  3309. // server regardless of whether the field is empty or not. This may be
  3310. // used to include empty fields in Patch requests.
  3311. ForceSendFields []string `json:"-"`
  3312. // NullFields is a list of field names (e.g. "Id") to include in API
  3313. // requests with the JSON null value. By default, fields with empty
  3314. // values are omitted from API requests. However, any field with an
  3315. // empty value appearing in NullFields will be sent to the server as
  3316. // null. It is an error if a field in this list has a non-empty value.
  3317. // This may be used to include null fields in Patch requests.
  3318. NullFields []string `json:"-"`
  3319. }
  3320. func (s *ForwardingRuleAggregatedList) MarshalJSON() ([]byte, error) {
  3321. type noMethod ForwardingRuleAggregatedList
  3322. raw := noMethod(*s)
  3323. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3324. }
  3325. // ForwardingRuleList: Contains a list of ForwardingRule resources.
  3326. type ForwardingRuleList struct {
  3327. // Id: [Output Only] Unique identifier for the resource. Set by the
  3328. // server.
  3329. Id string `json:"id,omitempty"`
  3330. // Items: A list of ForwardingRule resources.
  3331. Items []*ForwardingRule `json:"items,omitempty"`
  3332. // Kind: Type of resource.
  3333. Kind string `json:"kind,omitempty"`
  3334. // NextPageToken: [Output Only] This token allows you to get the next
  3335. // page of results for list requests. If the number of results is larger
  3336. // than maxResults, use the nextPageToken as a value for the query
  3337. // parameter pageToken in the next list request. Subsequent list
  3338. // requests will have their own nextPageToken to continue paging through
  3339. // the results.
  3340. NextPageToken string `json:"nextPageToken,omitempty"`
  3341. // SelfLink: [Output Only] Server-defined URL for this resource.
  3342. SelfLink string `json:"selfLink,omitempty"`
  3343. // ServerResponse contains the HTTP response code and headers from the
  3344. // server.
  3345. googleapi.ServerResponse `json:"-"`
  3346. // ForceSendFields is a list of field names (e.g. "Id") to
  3347. // unconditionally include in API requests. By default, fields with
  3348. // empty values are omitted from API requests. However, any non-pointer,
  3349. // non-interface field appearing in ForceSendFields will be sent to the
  3350. // server regardless of whether the field is empty or not. This may be
  3351. // used to include empty fields in Patch requests.
  3352. ForceSendFields []string `json:"-"`
  3353. // NullFields is a list of field names (e.g. "Id") to include in API
  3354. // requests with the JSON null value. By default, fields with empty
  3355. // values are omitted from API requests. However, any field with an
  3356. // empty value appearing in NullFields will be sent to the server as
  3357. // null. It is an error if a field in this list has a non-empty value.
  3358. // This may be used to include null fields in Patch requests.
  3359. NullFields []string `json:"-"`
  3360. }
  3361. func (s *ForwardingRuleList) MarshalJSON() ([]byte, error) {
  3362. type noMethod ForwardingRuleList
  3363. raw := noMethod(*s)
  3364. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3365. }
  3366. type ForwardingRulesScopedList struct {
  3367. // ForwardingRules: List of forwarding rules contained in this scope.
  3368. ForwardingRules []*ForwardingRule `json:"forwardingRules,omitempty"`
  3369. // Warning: Informational warning which replaces the list of forwarding
  3370. // rules when the list is empty.
  3371. Warning *ForwardingRulesScopedListWarning `json:"warning,omitempty"`
  3372. // ForceSendFields is a list of field names (e.g. "ForwardingRules") to
  3373. // unconditionally include in API requests. By default, fields with
  3374. // empty values are omitted from API requests. However, any non-pointer,
  3375. // non-interface field appearing in ForceSendFields will be sent to the
  3376. // server regardless of whether the field is empty or not. This may be
  3377. // used to include empty fields in Patch requests.
  3378. ForceSendFields []string `json:"-"`
  3379. // NullFields is a list of field names (e.g. "ForwardingRules") to
  3380. // include in API requests with the JSON null value. By default, fields
  3381. // with empty values are omitted from API requests. However, any field
  3382. // with an empty value appearing in NullFields will be sent to the
  3383. // server as null. It is an error if a field in this list has a
  3384. // non-empty value. This may be used to include null fields in Patch
  3385. // requests.
  3386. NullFields []string `json:"-"`
  3387. }
  3388. func (s *ForwardingRulesScopedList) MarshalJSON() ([]byte, error) {
  3389. type noMethod ForwardingRulesScopedList
  3390. raw := noMethod(*s)
  3391. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3392. }
  3393. // ForwardingRulesScopedListWarning: Informational warning which
  3394. // replaces the list of forwarding rules when the list is empty.
  3395. type ForwardingRulesScopedListWarning struct {
  3396. // Code: [Output Only] A warning code, if applicable. For example,
  3397. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  3398. // the response.
  3399. //
  3400. // Possible values:
  3401. // "CLEANUP_FAILED"
  3402. // "DEPRECATED_RESOURCE_USED"
  3403. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  3404. // "FIELD_VALUE_OVERRIDEN"
  3405. // "INJECTED_KERNELS_DEPRECATED"
  3406. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  3407. // "NEXT_HOP_CANNOT_IP_FORWARD"
  3408. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  3409. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  3410. // "NEXT_HOP_NOT_RUNNING"
  3411. // "NOT_CRITICAL_ERROR"
  3412. // "NO_RESULTS_ON_PAGE"
  3413. // "REQUIRED_TOS_AGREEMENT"
  3414. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  3415. // "RESOURCE_NOT_DELETED"
  3416. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  3417. // "UNREACHABLE"
  3418. Code string `json:"code,omitempty"`
  3419. // Data: [Output Only] Metadata about this warning in key: value format.
  3420. // For example:
  3421. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  3422. Data []*ForwardingRulesScopedListWarningData `json:"data,omitempty"`
  3423. // Message: [Output Only] A human-readable description of the warning
  3424. // code.
  3425. Message string `json:"message,omitempty"`
  3426. // ForceSendFields is a list of field names (e.g. "Code") to
  3427. // unconditionally include in API requests. By default, fields with
  3428. // empty values are omitted from API requests. However, any non-pointer,
  3429. // non-interface field appearing in ForceSendFields will be sent to the
  3430. // server regardless of whether the field is empty or not. This may be
  3431. // used to include empty fields in Patch requests.
  3432. ForceSendFields []string `json:"-"`
  3433. // NullFields is a list of field names (e.g. "Code") to include in API
  3434. // requests with the JSON null value. By default, fields with empty
  3435. // values are omitted from API requests. However, any field with an
  3436. // empty value appearing in NullFields will be sent to the server as
  3437. // null. It is an error if a field in this list has a non-empty value.
  3438. // This may be used to include null fields in Patch requests.
  3439. NullFields []string `json:"-"`
  3440. }
  3441. func (s *ForwardingRulesScopedListWarning) MarshalJSON() ([]byte, error) {
  3442. type noMethod ForwardingRulesScopedListWarning
  3443. raw := noMethod(*s)
  3444. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3445. }
  3446. type ForwardingRulesScopedListWarningData struct {
  3447. // Key: [Output Only] A key that provides more detail on the warning
  3448. // being returned. For example, for warnings where there are no results
  3449. // in a list request for a particular zone, this key might be scope and
  3450. // the key value might be the zone name. Other examples might be a key
  3451. // indicating a deprecated resource and a suggested replacement, or a
  3452. // warning about invalid network settings (for example, if an instance
  3453. // attempts to perform IP forwarding but is not enabled for IP
  3454. // forwarding).
  3455. Key string `json:"key,omitempty"`
  3456. // Value: [Output Only] A warning data value corresponding to the key.
  3457. Value string `json:"value,omitempty"`
  3458. // ForceSendFields is a list of field names (e.g. "Key") to
  3459. // unconditionally include in API requests. By default, fields with
  3460. // empty values are omitted from API requests. However, any non-pointer,
  3461. // non-interface field appearing in ForceSendFields will be sent to the
  3462. // server regardless of whether the field is empty or not. This may be
  3463. // used to include empty fields in Patch requests.
  3464. ForceSendFields []string `json:"-"`
  3465. // NullFields is a list of field names (e.g. "Key") to include in API
  3466. // requests with the JSON null value. By default, fields with empty
  3467. // values are omitted from API requests. However, any field with an
  3468. // empty value appearing in NullFields will be sent to the server as
  3469. // null. It is an error if a field in this list has a non-empty value.
  3470. // This may be used to include null fields in Patch requests.
  3471. NullFields []string `json:"-"`
  3472. }
  3473. func (s *ForwardingRulesScopedListWarningData) MarshalJSON() ([]byte, error) {
  3474. type noMethod ForwardingRulesScopedListWarningData
  3475. raw := noMethod(*s)
  3476. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3477. }
  3478. type GlobalSetLabelsRequest struct {
  3479. // LabelFingerprint: The fingerprint of the previous set of labels for
  3480. // this resource, used to detect conflicts. The fingerprint is initially
  3481. // generated by Compute Engine and changes after every request to modify
  3482. // or update labels. You must always provide an up-to-date fingerprint
  3483. // hash when updating or changing labels. Make a get() request to the
  3484. // resource to get the latest fingerprint.
  3485. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  3486. // Labels: A list of labels to apply for this resource. Each label key &
  3487. // value must comply with RFC1035. Specifically, the name must be 1-63
  3488. // characters long and match the regular expression
  3489. // [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a
  3490. // lowercase letter, and all following characters must be a dash,
  3491. // lowercase letter, or digit, except the last character, which cannot
  3492. // be a dash. For example, "webserver-frontend": "images". A label value
  3493. // can also be empty (e.g. "my-label": "").
  3494. Labels map[string]string `json:"labels,omitempty"`
  3495. // ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
  3496. // unconditionally include in API requests. By default, fields with
  3497. // empty values are omitted from API requests. However, any non-pointer,
  3498. // non-interface field appearing in ForceSendFields will be sent to the
  3499. // server regardless of whether the field is empty or not. This may be
  3500. // used to include empty fields in Patch requests.
  3501. ForceSendFields []string `json:"-"`
  3502. // NullFields is a list of field names (e.g. "LabelFingerprint") to
  3503. // include in API requests with the JSON null value. By default, fields
  3504. // with empty values are omitted from API requests. However, any field
  3505. // with an empty value appearing in NullFields will be sent to the
  3506. // server as null. It is an error if a field in this list has a
  3507. // non-empty value. This may be used to include null fields in Patch
  3508. // requests.
  3509. NullFields []string `json:"-"`
  3510. }
  3511. func (s *GlobalSetLabelsRequest) MarshalJSON() ([]byte, error) {
  3512. type noMethod GlobalSetLabelsRequest
  3513. raw := noMethod(*s)
  3514. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3515. }
  3516. // GuestOsFeature: Guest OS features.
  3517. type GuestOsFeature struct {
  3518. // Type: The type of supported feature. Currenty only
  3519. // VIRTIO_SCSI_MULTIQUEUE is supported. For newer Windows images, the
  3520. // server might also populate this property with the value WINDOWS to
  3521. // indicate that this is a Windows image. This value is purely
  3522. // informational and does not enable or disable any features.
  3523. //
  3524. // Possible values:
  3525. // "FEATURE_TYPE_UNSPECIFIED"
  3526. // "VIRTIO_SCSI_MULTIQUEUE"
  3527. // "WINDOWS"
  3528. Type string `json:"type,omitempty"`
  3529. // ForceSendFields is a list of field names (e.g. "Type") to
  3530. // unconditionally include in API requests. By default, fields with
  3531. // empty values are omitted from API requests. However, any non-pointer,
  3532. // non-interface field appearing in ForceSendFields will be sent to the
  3533. // server regardless of whether the field is empty or not. This may be
  3534. // used to include empty fields in Patch requests.
  3535. ForceSendFields []string `json:"-"`
  3536. // NullFields is a list of field names (e.g. "Type") to include in API
  3537. // requests with the JSON null value. By default, fields with empty
  3538. // values are omitted from API requests. However, any field with an
  3539. // empty value appearing in NullFields will be sent to the server as
  3540. // null. It is an error if a field in this list has a non-empty value.
  3541. // This may be used to include null fields in Patch requests.
  3542. NullFields []string `json:"-"`
  3543. }
  3544. func (s *GuestOsFeature) MarshalJSON() ([]byte, error) {
  3545. type noMethod GuestOsFeature
  3546. raw := noMethod(*s)
  3547. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3548. }
  3549. type HTTPHealthCheck struct {
  3550. // Host: The value of the host header in the HTTP health check request.
  3551. // If left empty (default value), the IP on behalf of which this health
  3552. // check is performed will be used.
  3553. Host string `json:"host,omitempty"`
  3554. // Port: The TCP port number for the health check request. The default
  3555. // value is 80. Valid values are 1 through 65535.
  3556. Port int64 `json:"port,omitempty"`
  3557. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  3558. // both port and port_name are defined, port takes precedence.
  3559. PortName string `json:"portName,omitempty"`
  3560. // ProxyHeader: Specifies the type of proxy header to append before
  3561. // sending data to the backend, either NONE or PROXY_V1. The default is
  3562. // NONE.
  3563. //
  3564. // Possible values:
  3565. // "NONE"
  3566. // "PROXY_V1"
  3567. ProxyHeader string `json:"proxyHeader,omitempty"`
  3568. // RequestPath: The request path of the HTTP health check request. The
  3569. // default value is /.
  3570. RequestPath string `json:"requestPath,omitempty"`
  3571. // ForceSendFields is a list of field names (e.g. "Host") to
  3572. // unconditionally include in API requests. By default, fields with
  3573. // empty values are omitted from API requests. However, any non-pointer,
  3574. // non-interface field appearing in ForceSendFields will be sent to the
  3575. // server regardless of whether the field is empty or not. This may be
  3576. // used to include empty fields in Patch requests.
  3577. ForceSendFields []string `json:"-"`
  3578. // NullFields is a list of field names (e.g. "Host") to include in API
  3579. // requests with the JSON null value. By default, fields with empty
  3580. // values are omitted from API requests. However, any field with an
  3581. // empty value appearing in NullFields will be sent to the server as
  3582. // null. It is an error if a field in this list has a non-empty value.
  3583. // This may be used to include null fields in Patch requests.
  3584. NullFields []string `json:"-"`
  3585. }
  3586. func (s *HTTPHealthCheck) MarshalJSON() ([]byte, error) {
  3587. type noMethod HTTPHealthCheck
  3588. raw := noMethod(*s)
  3589. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3590. }
  3591. type HTTPSHealthCheck struct {
  3592. // Host: The value of the host header in the HTTPS health check request.
  3593. // If left empty (default value), the IP on behalf of which this health
  3594. // check is performed will be used.
  3595. Host string `json:"host,omitempty"`
  3596. // Port: The TCP port number for the health check request. The default
  3597. // value is 443. Valid values are 1 through 65535.
  3598. Port int64 `json:"port,omitempty"`
  3599. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  3600. // both port and port_name are defined, port takes precedence.
  3601. PortName string `json:"portName,omitempty"`
  3602. // ProxyHeader: Specifies the type of proxy header to append before
  3603. // sending data to the backend, either NONE or PROXY_V1. The default is
  3604. // NONE.
  3605. //
  3606. // Possible values:
  3607. // "NONE"
  3608. // "PROXY_V1"
  3609. ProxyHeader string `json:"proxyHeader,omitempty"`
  3610. // RequestPath: The request path of the HTTPS health check request. The
  3611. // default value is /.
  3612. RequestPath string `json:"requestPath,omitempty"`
  3613. // ForceSendFields is a list of field names (e.g. "Host") to
  3614. // unconditionally include in API requests. By default, fields with
  3615. // empty values are omitted from API requests. However, any non-pointer,
  3616. // non-interface field appearing in ForceSendFields will be sent to the
  3617. // server regardless of whether the field is empty or not. This may be
  3618. // used to include empty fields in Patch requests.
  3619. ForceSendFields []string `json:"-"`
  3620. // NullFields is a list of field names (e.g. "Host") to include in API
  3621. // requests with the JSON null value. By default, fields with empty
  3622. // values are omitted from API requests. However, any field with an
  3623. // empty value appearing in NullFields will be sent to the server as
  3624. // null. It is an error if a field in this list has a non-empty value.
  3625. // This may be used to include null fields in Patch requests.
  3626. NullFields []string `json:"-"`
  3627. }
  3628. func (s *HTTPSHealthCheck) MarshalJSON() ([]byte, error) {
  3629. type noMethod HTTPSHealthCheck
  3630. raw := noMethod(*s)
  3631. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3632. }
  3633. // HealthCheck: An HealthCheck resource. This resource defines a
  3634. // template for how individual virtual machines should be checked for
  3635. // health, via one of the supported protocols.
  3636. type HealthCheck struct {
  3637. // CheckIntervalSec: How often (in seconds) to send a health check. The
  3638. // default value is 5 seconds.
  3639. CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"`
  3640. // CreationTimestamp: [Output Only] Creation timestamp in 3339 text
  3641. // format.
  3642. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  3643. // Description: An optional description of this resource. Provide this
  3644. // property when you create the resource.
  3645. Description string `json:"description,omitempty"`
  3646. // HealthyThreshold: A so-far unhealthy instance will be marked healthy
  3647. // after this many consecutive successes. The default value is 2.
  3648. HealthyThreshold int64 `json:"healthyThreshold,omitempty"`
  3649. HttpHealthCheck *HTTPHealthCheck `json:"httpHealthCheck,omitempty"`
  3650. HttpsHealthCheck *HTTPSHealthCheck `json:"httpsHealthCheck,omitempty"`
  3651. // Id: [Output Only] The unique identifier for the resource. This
  3652. // identifier is defined by the server.
  3653. Id uint64 `json:"id,omitempty,string"`
  3654. // Kind: Type of the resource.
  3655. Kind string `json:"kind,omitempty"`
  3656. // Name: Name of the resource. Provided by the client when the resource
  3657. // is created. The name must be 1-63 characters long, and comply with
  3658. // RFC1035. Specifically, the name must be 1-63 characters long and
  3659. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  3660. // the first character must be a lowercase letter, and all following
  3661. // characters must be a dash, lowercase letter, or digit, except the
  3662. // last character, which cannot be a dash.
  3663. Name string `json:"name,omitempty"`
  3664. // SelfLink: [Output Only] Server-defined URL for the resource.
  3665. SelfLink string `json:"selfLink,omitempty"`
  3666. SslHealthCheck *SSLHealthCheck `json:"sslHealthCheck,omitempty"`
  3667. TcpHealthCheck *TCPHealthCheck `json:"tcpHealthCheck,omitempty"`
  3668. // TimeoutSec: How long (in seconds) to wait before claiming failure.
  3669. // The default value is 5 seconds. It is invalid for timeoutSec to have
  3670. // greater value than checkIntervalSec.
  3671. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  3672. // Type: Specifies the type of the healthCheck, either TCP, SSL, HTTP or
  3673. // HTTPS. If not specified, the default is TCP. Exactly one of the
  3674. // protocol-specific health check field must be specified, which must
  3675. // match type field.
  3676. //
  3677. // Possible values:
  3678. // "HTTP"
  3679. // "HTTPS"
  3680. // "INVALID"
  3681. // "SSL"
  3682. // "TCP"
  3683. Type string `json:"type,omitempty"`
  3684. // UnhealthyThreshold: A so-far healthy instance will be marked
  3685. // unhealthy after this many consecutive failures. The default value is
  3686. // 2.
  3687. UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"`
  3688. // ServerResponse contains the HTTP response code and headers from the
  3689. // server.
  3690. googleapi.ServerResponse `json:"-"`
  3691. // ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to
  3692. // unconditionally include in API requests. By default, fields with
  3693. // empty values are omitted from API requests. However, any non-pointer,
  3694. // non-interface field appearing in ForceSendFields will be sent to the
  3695. // server regardless of whether the field is empty or not. This may be
  3696. // used to include empty fields in Patch requests.
  3697. ForceSendFields []string `json:"-"`
  3698. // NullFields is a list of field names (e.g. "CheckIntervalSec") to
  3699. // include in API requests with the JSON null value. By default, fields
  3700. // with empty values are omitted from API requests. However, any field
  3701. // with an empty value appearing in NullFields will be sent to the
  3702. // server as null. It is an error if a field in this list has a
  3703. // non-empty value. This may be used to include null fields in Patch
  3704. // requests.
  3705. NullFields []string `json:"-"`
  3706. }
  3707. func (s *HealthCheck) MarshalJSON() ([]byte, error) {
  3708. type noMethod HealthCheck
  3709. raw := noMethod(*s)
  3710. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3711. }
  3712. // HealthCheckList: Contains a list of HealthCheck resources.
  3713. type HealthCheckList struct {
  3714. // Id: [Output Only] The unique identifier for the resource. This
  3715. // identifier is defined by the server.
  3716. Id string `json:"id,omitempty"`
  3717. // Items: A list of HealthCheck resources.
  3718. Items []*HealthCheck `json:"items,omitempty"`
  3719. // Kind: Type of resource.
  3720. Kind string `json:"kind,omitempty"`
  3721. // NextPageToken: [Output Only] This token allows you to get the next
  3722. // page of results for list requests. If the number of results is larger
  3723. // than maxResults, use the nextPageToken as a value for the query
  3724. // parameter pageToken in the next list request. Subsequent list
  3725. // requests will have their own nextPageToken to continue paging through
  3726. // the results.
  3727. NextPageToken string `json:"nextPageToken,omitempty"`
  3728. // SelfLink: [Output Only] Server-defined URL for this resource.
  3729. SelfLink string `json:"selfLink,omitempty"`
  3730. // ServerResponse contains the HTTP response code and headers from the
  3731. // server.
  3732. googleapi.ServerResponse `json:"-"`
  3733. // ForceSendFields is a list of field names (e.g. "Id") to
  3734. // unconditionally include in API requests. By default, fields with
  3735. // empty values are omitted from API requests. However, any non-pointer,
  3736. // non-interface field appearing in ForceSendFields will be sent to the
  3737. // server regardless of whether the field is empty or not. This may be
  3738. // used to include empty fields in Patch requests.
  3739. ForceSendFields []string `json:"-"`
  3740. // NullFields is a list of field names (e.g. "Id") to include in API
  3741. // requests with the JSON null value. By default, fields with empty
  3742. // values are omitted from API requests. However, any field with an
  3743. // empty value appearing in NullFields will be sent to the server as
  3744. // null. It is an error if a field in this list has a non-empty value.
  3745. // This may be used to include null fields in Patch requests.
  3746. NullFields []string `json:"-"`
  3747. }
  3748. func (s *HealthCheckList) MarshalJSON() ([]byte, error) {
  3749. type noMethod HealthCheckList
  3750. raw := noMethod(*s)
  3751. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3752. }
  3753. // HealthCheckReference: A full or valid partial URL to a health check.
  3754. // For example, the following are valid URLs:
  3755. // -
  3756. // https://www.googleapis.com/compute/beta/projects/project-id/global/httpHealthChecks/health-check
  3757. // - projects/project-id/global/httpHealthChecks/health-check
  3758. // - global/httpHealthChecks/health-check
  3759. type HealthCheckReference struct {
  3760. HealthCheck string `json:"healthCheck,omitempty"`
  3761. // ForceSendFields is a list of field names (e.g. "HealthCheck") to
  3762. // unconditionally include in API requests. By default, fields with
  3763. // empty values are omitted from API requests. However, any non-pointer,
  3764. // non-interface field appearing in ForceSendFields will be sent to the
  3765. // server regardless of whether the field is empty or not. This may be
  3766. // used to include empty fields in Patch requests.
  3767. ForceSendFields []string `json:"-"`
  3768. // NullFields is a list of field names (e.g. "HealthCheck") to include
  3769. // in API requests with the JSON null value. By default, fields with
  3770. // empty values are omitted from API requests. However, any field with
  3771. // an empty value appearing in NullFields will be sent to the server as
  3772. // null. It is an error if a field in this list has a non-empty value.
  3773. // This may be used to include null fields in Patch requests.
  3774. NullFields []string `json:"-"`
  3775. }
  3776. func (s *HealthCheckReference) MarshalJSON() ([]byte, error) {
  3777. type noMethod HealthCheckReference
  3778. raw := noMethod(*s)
  3779. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3780. }
  3781. type HealthStatus struct {
  3782. // HealthState: Health state of the instance.
  3783. //
  3784. // Possible values:
  3785. // "HEALTHY"
  3786. // "UNHEALTHY"
  3787. HealthState string `json:"healthState,omitempty"`
  3788. // Instance: URL of the instance resource.
  3789. Instance string `json:"instance,omitempty"`
  3790. // IpAddress: The IP address represented by this resource.
  3791. IpAddress string `json:"ipAddress,omitempty"`
  3792. // Port: The port on the instance.
  3793. Port int64 `json:"port,omitempty"`
  3794. // ForceSendFields is a list of field names (e.g. "HealthState") to
  3795. // unconditionally include in API requests. By default, fields with
  3796. // empty values are omitted from API requests. However, any non-pointer,
  3797. // non-interface field appearing in ForceSendFields will be sent to the
  3798. // server regardless of whether the field is empty or not. This may be
  3799. // used to include empty fields in Patch requests.
  3800. ForceSendFields []string `json:"-"`
  3801. // NullFields is a list of field names (e.g. "HealthState") to include
  3802. // in API requests with the JSON null value. By default, fields with
  3803. // empty values are omitted from API requests. However, any field with
  3804. // an empty value appearing in NullFields will be sent to the server as
  3805. // null. It is an error if a field in this list has a non-empty value.
  3806. // This may be used to include null fields in Patch requests.
  3807. NullFields []string `json:"-"`
  3808. }
  3809. func (s *HealthStatus) MarshalJSON() ([]byte, error) {
  3810. type noMethod HealthStatus
  3811. raw := noMethod(*s)
  3812. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3813. }
  3814. // HostRule: UrlMaps A host-matching rule for a URL. If matched, will
  3815. // use the named PathMatcher to select the BackendService.
  3816. type HostRule struct {
  3817. // Description: An optional description of this resource. Provide this
  3818. // property when you create the resource.
  3819. Description string `json:"description,omitempty"`
  3820. // Hosts: The list of host patterns to match. They must be valid
  3821. // hostnames, except * will match any string of ([a-z0-9-.]*). In that
  3822. // case, * must be the first character and must be followed in the
  3823. // pattern by either - or ..
  3824. Hosts []string `json:"hosts,omitempty"`
  3825. // PathMatcher: The name of the PathMatcher to use to match the path
  3826. // portion of the URL if the hostRule matches the URL's host portion.
  3827. PathMatcher string `json:"pathMatcher,omitempty"`
  3828. // ForceSendFields is a list of field names (e.g. "Description") to
  3829. // unconditionally include in API requests. By default, fields with
  3830. // empty values are omitted from API requests. However, any non-pointer,
  3831. // non-interface field appearing in ForceSendFields will be sent to the
  3832. // server regardless of whether the field is empty or not. This may be
  3833. // used to include empty fields in Patch requests.
  3834. ForceSendFields []string `json:"-"`
  3835. // NullFields is a list of field names (e.g. "Description") to include
  3836. // in API requests with the JSON null value. By default, fields with
  3837. // empty values are omitted from API requests. However, any field with
  3838. // an empty value appearing in NullFields will be sent to the server as
  3839. // null. It is an error if a field in this list has a non-empty value.
  3840. // This may be used to include null fields in Patch requests.
  3841. NullFields []string `json:"-"`
  3842. }
  3843. func (s *HostRule) MarshalJSON() ([]byte, error) {
  3844. type noMethod HostRule
  3845. raw := noMethod(*s)
  3846. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3847. }
  3848. // HttpHealthCheck: An HttpHealthCheck resource. This resource defines a
  3849. // template for how individual instances should be checked for health,
  3850. // via HTTP.
  3851. type HttpHealthCheck struct {
  3852. // CheckIntervalSec: How often (in seconds) to send a health check. The
  3853. // default value is 5 seconds.
  3854. CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"`
  3855. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  3856. // format.
  3857. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  3858. // Description: An optional description of this resource. Provide this
  3859. // property when you create the resource.
  3860. Description string `json:"description,omitempty"`
  3861. // HealthyThreshold: A so-far unhealthy instance will be marked healthy
  3862. // after this many consecutive successes. The default value is 2.
  3863. HealthyThreshold int64 `json:"healthyThreshold,omitempty"`
  3864. // Host: The value of the host header in the HTTP health check request.
  3865. // If left empty (default value), the public IP on behalf of which this
  3866. // health check is performed will be used.
  3867. Host string `json:"host,omitempty"`
  3868. // Id: [Output Only] The unique identifier for the resource. This
  3869. // identifier is defined by the server.
  3870. Id uint64 `json:"id,omitempty,string"`
  3871. // Kind: [Output Only] Type of the resource. Always
  3872. // compute#httpHealthCheck for HTTP health checks.
  3873. Kind string `json:"kind,omitempty"`
  3874. // Name: Name of the resource. Provided by the client when the resource
  3875. // is created. The name must be 1-63 characters long, and comply with
  3876. // RFC1035. Specifically, the name must be 1-63 characters long and
  3877. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  3878. // the first character must be a lowercase letter, and all following
  3879. // characters must be a dash, lowercase letter, or digit, except the
  3880. // last character, which cannot be a dash.
  3881. Name string `json:"name,omitempty"`
  3882. // Port: The TCP port number for the HTTP health check request. The
  3883. // default value is 80.
  3884. Port int64 `json:"port,omitempty"`
  3885. // RequestPath: The request path of the HTTP health check request. The
  3886. // default value is /.
  3887. RequestPath string `json:"requestPath,omitempty"`
  3888. // SelfLink: [Output Only] Server-defined URL for the resource.
  3889. SelfLink string `json:"selfLink,omitempty"`
  3890. // TimeoutSec: How long (in seconds) to wait before claiming failure.
  3891. // The default value is 5 seconds. It is invalid for timeoutSec to have
  3892. // greater value than checkIntervalSec.
  3893. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  3894. // UnhealthyThreshold: A so-far healthy instance will be marked
  3895. // unhealthy after this many consecutive failures. The default value is
  3896. // 2.
  3897. UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"`
  3898. // ServerResponse contains the HTTP response code and headers from the
  3899. // server.
  3900. googleapi.ServerResponse `json:"-"`
  3901. // ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to
  3902. // unconditionally include in API requests. By default, fields with
  3903. // empty values are omitted from API requests. However, any non-pointer,
  3904. // non-interface field appearing in ForceSendFields will be sent to the
  3905. // server regardless of whether the field is empty or not. This may be
  3906. // used to include empty fields in Patch requests.
  3907. ForceSendFields []string `json:"-"`
  3908. // NullFields is a list of field names (e.g. "CheckIntervalSec") to
  3909. // include in API requests with the JSON null value. By default, fields
  3910. // with empty values are omitted from API requests. However, any field
  3911. // with an empty value appearing in NullFields will be sent to the
  3912. // server as null. It is an error if a field in this list has a
  3913. // non-empty value. This may be used to include null fields in Patch
  3914. // requests.
  3915. NullFields []string `json:"-"`
  3916. }
  3917. func (s *HttpHealthCheck) MarshalJSON() ([]byte, error) {
  3918. type noMethod HttpHealthCheck
  3919. raw := noMethod(*s)
  3920. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3921. }
  3922. // HttpHealthCheckList: Contains a list of HttpHealthCheck resources.
  3923. type HttpHealthCheckList struct {
  3924. // Id: [Output Only] Unique identifier for the resource. Defined by the
  3925. // server.
  3926. Id string `json:"id,omitempty"`
  3927. // Items: A list of HttpHealthCheck resources.
  3928. Items []*HttpHealthCheck `json:"items,omitempty"`
  3929. // Kind: Type of resource.
  3930. Kind string `json:"kind,omitempty"`
  3931. // NextPageToken: [Output Only] This token allows you to get the next
  3932. // page of results for list requests. If the number of results is larger
  3933. // than maxResults, use the nextPageToken as a value for the query
  3934. // parameter pageToken in the next list request. Subsequent list
  3935. // requests will have their own nextPageToken to continue paging through
  3936. // the results.
  3937. NextPageToken string `json:"nextPageToken,omitempty"`
  3938. // SelfLink: [Output Only] Server-defined URL for this resource.
  3939. SelfLink string `json:"selfLink,omitempty"`
  3940. // ServerResponse contains the HTTP response code and headers from the
  3941. // server.
  3942. googleapi.ServerResponse `json:"-"`
  3943. // ForceSendFields is a list of field names (e.g. "Id") to
  3944. // unconditionally include in API requests. By default, fields with
  3945. // empty values are omitted from API requests. However, any non-pointer,
  3946. // non-interface field appearing in ForceSendFields will be sent to the
  3947. // server regardless of whether the field is empty or not. This may be
  3948. // used to include empty fields in Patch requests.
  3949. ForceSendFields []string `json:"-"`
  3950. // NullFields is a list of field names (e.g. "Id") to include in API
  3951. // requests with the JSON null value. By default, fields with empty
  3952. // values are omitted from API requests. However, any field with an
  3953. // empty value appearing in NullFields will be sent to the server as
  3954. // null. It is an error if a field in this list has a non-empty value.
  3955. // This may be used to include null fields in Patch requests.
  3956. NullFields []string `json:"-"`
  3957. }
  3958. func (s *HttpHealthCheckList) MarshalJSON() ([]byte, error) {
  3959. type noMethod HttpHealthCheckList
  3960. raw := noMethod(*s)
  3961. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3962. }
  3963. // HttpsHealthCheck: An HttpsHealthCheck resource. This resource defines
  3964. // a template for how individual instances should be checked for health,
  3965. // via HTTPS.
  3966. type HttpsHealthCheck struct {
  3967. // CheckIntervalSec: How often (in seconds) to send a health check. The
  3968. // default value is 5 seconds.
  3969. CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"`
  3970. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  3971. // format.
  3972. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  3973. // Description: An optional description of this resource. Provide this
  3974. // property when you create the resource.
  3975. Description string `json:"description,omitempty"`
  3976. // HealthyThreshold: A so-far unhealthy instance will be marked healthy
  3977. // after this many consecutive successes. The default value is 2.
  3978. HealthyThreshold int64 `json:"healthyThreshold,omitempty"`
  3979. // Host: The value of the host header in the HTTPS health check request.
  3980. // If left empty (default value), the public IP on behalf of which this
  3981. // health check is performed will be used.
  3982. Host string `json:"host,omitempty"`
  3983. // Id: [Output Only] The unique identifier for the resource. This
  3984. // identifier is defined by the server.
  3985. Id uint64 `json:"id,omitempty,string"`
  3986. // Kind: Type of the resource.
  3987. Kind string `json:"kind,omitempty"`
  3988. // Name: Name of the resource. Provided by the client when the resource
  3989. // is created. The name must be 1-63 characters long, and comply with
  3990. // RFC1035. Specifically, the name must be 1-63 characters long and
  3991. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  3992. // the first character must be a lowercase letter, and all following
  3993. // characters must be a dash, lowercase letter, or digit, except the
  3994. // last character, which cannot be a dash.
  3995. Name string `json:"name,omitempty"`
  3996. // Port: The TCP port number for the HTTPS health check request. The
  3997. // default value is 443.
  3998. Port int64 `json:"port,omitempty"`
  3999. // RequestPath: The request path of the HTTPS health check request. The
  4000. // default value is "/".
  4001. RequestPath string `json:"requestPath,omitempty"`
  4002. // SelfLink: [Output Only] Server-defined URL for the resource.
  4003. SelfLink string `json:"selfLink,omitempty"`
  4004. // TimeoutSec: How long (in seconds) to wait before claiming failure.
  4005. // The default value is 5 seconds. It is invalid for timeoutSec to have
  4006. // a greater value than checkIntervalSec.
  4007. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  4008. // UnhealthyThreshold: A so-far healthy instance will be marked
  4009. // unhealthy after this many consecutive failures. The default value is
  4010. // 2.
  4011. UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"`
  4012. // ServerResponse contains the HTTP response code and headers from the
  4013. // server.
  4014. googleapi.ServerResponse `json:"-"`
  4015. // ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to
  4016. // unconditionally include in API requests. By default, fields with
  4017. // empty values are omitted from API requests. However, any non-pointer,
  4018. // non-interface field appearing in ForceSendFields will be sent to the
  4019. // server regardless of whether the field is empty or not. This may be
  4020. // used to include empty fields in Patch requests.
  4021. ForceSendFields []string `json:"-"`
  4022. // NullFields is a list of field names (e.g. "CheckIntervalSec") to
  4023. // include in API requests with the JSON null value. By default, fields
  4024. // with empty values are omitted from API requests. However, any field
  4025. // with an empty value appearing in NullFields will be sent to the
  4026. // server as null. It is an error if a field in this list has a
  4027. // non-empty value. This may be used to include null fields in Patch
  4028. // requests.
  4029. NullFields []string `json:"-"`
  4030. }
  4031. func (s *HttpsHealthCheck) MarshalJSON() ([]byte, error) {
  4032. type noMethod HttpsHealthCheck
  4033. raw := noMethod(*s)
  4034. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4035. }
  4036. // HttpsHealthCheckList: Contains a list of HttpsHealthCheck resources.
  4037. type HttpsHealthCheckList struct {
  4038. // Id: [Output Only] Unique identifier for the resource; defined by the
  4039. // server.
  4040. Id string `json:"id,omitempty"`
  4041. // Items: A list of HttpsHealthCheck resources.
  4042. Items []*HttpsHealthCheck `json:"items,omitempty"`
  4043. // Kind: Type of resource.
  4044. Kind string `json:"kind,omitempty"`
  4045. // NextPageToken: [Output Only] This token allows you to get the next
  4046. // page of results for list requests. If the number of results is larger
  4047. // than maxResults, use the nextPageToken as a value for the query
  4048. // parameter pageToken in the next list request. Subsequent list
  4049. // requests will have their own nextPageToken to continue paging through
  4050. // the results.
  4051. NextPageToken string `json:"nextPageToken,omitempty"`
  4052. // SelfLink: [Output Only] Server-defined URL for this resource.
  4053. SelfLink string `json:"selfLink,omitempty"`
  4054. // ServerResponse contains the HTTP response code and headers from the
  4055. // server.
  4056. googleapi.ServerResponse `json:"-"`
  4057. // ForceSendFields is a list of field names (e.g. "Id") to
  4058. // unconditionally include in API requests. By default, fields with
  4059. // empty values are omitted from API requests. However, any non-pointer,
  4060. // non-interface field appearing in ForceSendFields will be sent to the
  4061. // server regardless of whether the field is empty or not. This may be
  4062. // used to include empty fields in Patch requests.
  4063. ForceSendFields []string `json:"-"`
  4064. // NullFields is a list of field names (e.g. "Id") to include in API
  4065. // requests with the JSON null value. By default, fields with empty
  4066. // values are omitted from API requests. However, any field with an
  4067. // empty value appearing in NullFields will be sent to the server as
  4068. // null. It is an error if a field in this list has a non-empty value.
  4069. // This may be used to include null fields in Patch requests.
  4070. NullFields []string `json:"-"`
  4071. }
  4072. func (s *HttpsHealthCheckList) MarshalJSON() ([]byte, error) {
  4073. type noMethod HttpsHealthCheckList
  4074. raw := noMethod(*s)
  4075. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4076. }
  4077. // Image: An Image resource.
  4078. type Image struct {
  4079. // ArchiveSizeBytes: Size of the image tar.gz archive stored in Google
  4080. // Cloud Storage (in bytes).
  4081. ArchiveSizeBytes int64 `json:"archiveSizeBytes,omitempty,string"`
  4082. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  4083. // format.
  4084. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  4085. // Deprecated: The deprecation status associated with this image.
  4086. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  4087. // Description: An optional description of this resource. Provide this
  4088. // property when you create the resource.
  4089. Description string `json:"description,omitempty"`
  4090. // DiskSizeGb: Size of the image when restored onto a persistent disk
  4091. // (in GB).
  4092. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  4093. // Family: The name of the image family to which this image belongs. You
  4094. // can create disks by specifying an image family instead of a specific
  4095. // image name. The image family always returns its latest image that is
  4096. // not deprecated. The name of the image family must comply with
  4097. // RFC1035.
  4098. Family string `json:"family,omitempty"`
  4099. // GuestOsFeatures: A list of features to enable on the guest OS.
  4100. // Applicable for bootable images only. Currently, only one feature can
  4101. // be enabled, VIRTIO_SCSI_MULTIQUEUE, which allows each virtual CPU to
  4102. // have its own queue. For Windows images, you can only enable
  4103. // VIRTIO_SCSI_MULTIQUEUE on images with driver version 1.2.0.1621 or
  4104. // higher. Linux images with kernel versions 3.17 and higher will
  4105. // support VIRTIO_SCSI_MULTIQUEUE.
  4106. //
  4107. // For new Windows images, the server might also populate this field
  4108. // with the value WINDOWS, to indicate that this is a Windows image.
  4109. // This value is purely informational and does not enable or disable any
  4110. // features.
  4111. GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
  4112. // Id: [Output Only] The unique identifier for the resource. This
  4113. // identifier is defined by the server.
  4114. Id uint64 `json:"id,omitempty,string"`
  4115. // ImageEncryptionKey: Encrypts the image using a customer-supplied
  4116. // encryption key.
  4117. //
  4118. // After you encrypt an image with a customer-supplied key, you must
  4119. // provide the same key if you use the image later (e.g. to create a
  4120. // disk from the image).
  4121. //
  4122. // Customer-supplied encryption keys do not protect access to metadata
  4123. // of the disk.
  4124. //
  4125. // If you do not provide an encryption key when creating the image, then
  4126. // the disk will be encrypted using an automatically generated key and
  4127. // you do not need to provide a key to use the image later.
  4128. ImageEncryptionKey *CustomerEncryptionKey `json:"imageEncryptionKey,omitempty"`
  4129. // Kind: [Output Only] Type of the resource. Always compute#image for
  4130. // images.
  4131. Kind string `json:"kind,omitempty"`
  4132. // LabelFingerprint: A fingerprint for the labels being applied to this
  4133. // image, which is essentially a hash of the labels used for optimistic
  4134. // locking. The fingerprint is initially generated by Compute Engine and
  4135. // changes after every request to modify or update labels. You must
  4136. // always provide an up-to-date fingerprint hash in order to update or
  4137. // change labels.
  4138. //
  4139. // To see the latest fingerprint, make a get() request to retrieve an
  4140. // image.
  4141. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  4142. // Labels: Labels to apply to this image. These can be later modified by
  4143. // the setLabels method.
  4144. Labels map[string]string `json:"labels,omitempty"`
  4145. // Licenses: Any applicable license URI.
  4146. Licenses []string `json:"licenses,omitempty"`
  4147. // Name: Name of the resource; provided by the client when the resource
  4148. // is created. The name must be 1-63 characters long, and comply with
  4149. // RFC1035. Specifically, the name must be 1-63 characters long and
  4150. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  4151. // the first character must be a lowercase letter, and all following
  4152. // characters must be a dash, lowercase letter, or digit, except the
  4153. // last character, which cannot be a dash.
  4154. Name string `json:"name,omitempty"`
  4155. // RawDisk: The parameters of the raw disk image.
  4156. RawDisk *ImageRawDisk `json:"rawDisk,omitempty"`
  4157. // SelfLink: [Output Only] Server-defined URL for the resource.
  4158. SelfLink string `json:"selfLink,omitempty"`
  4159. // SourceDisk: URL of the source disk used to create this image. This
  4160. // can be a full or valid partial URL. You must provide either this
  4161. // property or the rawDisk.source property but not both to create an
  4162. // image. For example, the following are valid values:
  4163. // -
  4164. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk
  4165. // - projects/project/zones/zone/disks/disk
  4166. // - zones/zone/disks/disk
  4167. SourceDisk string `json:"sourceDisk,omitempty"`
  4168. // SourceDiskEncryptionKey: The customer-supplied encryption key of the
  4169. // source disk. Required if the source disk is protected by a
  4170. // customer-supplied encryption key.
  4171. SourceDiskEncryptionKey *CustomerEncryptionKey `json:"sourceDiskEncryptionKey,omitempty"`
  4172. // SourceDiskId: The ID value of the disk used to create this image.
  4173. // This value may be used to determine whether the image was taken from
  4174. // the current or a previous instance of a given disk name.
  4175. SourceDiskId string `json:"sourceDiskId,omitempty"`
  4176. // SourceType: The type of the image used to create this disk. The
  4177. // default and only value is RAW
  4178. //
  4179. // Possible values:
  4180. // "RAW" (default)
  4181. SourceType string `json:"sourceType,omitempty"`
  4182. // Status: [Output Only] The status of the image. An image can be used
  4183. // to create other resources, such as instances, only after the image
  4184. // has been successfully created and the status is set to READY.
  4185. // Possible values are FAILED, PENDING, or READY.
  4186. //
  4187. // Possible values:
  4188. // "FAILED"
  4189. // "PENDING"
  4190. // "READY"
  4191. Status string `json:"status,omitempty"`
  4192. // ServerResponse contains the HTTP response code and headers from the
  4193. // server.
  4194. googleapi.ServerResponse `json:"-"`
  4195. // ForceSendFields is a list of field names (e.g. "ArchiveSizeBytes") to
  4196. // unconditionally include in API requests. By default, fields with
  4197. // empty values are omitted from API requests. However, any non-pointer,
  4198. // non-interface field appearing in ForceSendFields will be sent to the
  4199. // server regardless of whether the field is empty or not. This may be
  4200. // used to include empty fields in Patch requests.
  4201. ForceSendFields []string `json:"-"`
  4202. // NullFields is a list of field names (e.g. "ArchiveSizeBytes") to
  4203. // include in API requests with the JSON null value. By default, fields
  4204. // with empty values are omitted from API requests. However, any field
  4205. // with an empty value appearing in NullFields will be sent to the
  4206. // server as null. It is an error if a field in this list has a
  4207. // non-empty value. This may be used to include null fields in Patch
  4208. // requests.
  4209. NullFields []string `json:"-"`
  4210. }
  4211. func (s *Image) MarshalJSON() ([]byte, error) {
  4212. type noMethod Image
  4213. raw := noMethod(*s)
  4214. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4215. }
  4216. // ImageRawDisk: The parameters of the raw disk image.
  4217. type ImageRawDisk struct {
  4218. // ContainerType: The format used to encode and transmit the block
  4219. // device, which should be TAR. This is just a container and
  4220. // transmission format and not a runtime format. Provided by the client
  4221. // when the disk image is created.
  4222. //
  4223. // Possible values:
  4224. // "TAR"
  4225. ContainerType string `json:"containerType,omitempty"`
  4226. // Sha1Checksum: An optional SHA1 checksum of the disk image before
  4227. // unpackaging; provided by the client when the disk image is created.
  4228. Sha1Checksum string `json:"sha1Checksum,omitempty"`
  4229. // Source: The full Google Cloud Storage URL where the disk image is
  4230. // stored. You must provide either this property or the sourceDisk
  4231. // property but not both.
  4232. Source string `json:"source,omitempty"`
  4233. // ForceSendFields is a list of field names (e.g. "ContainerType") to
  4234. // unconditionally include in API requests. By default, fields with
  4235. // empty values are omitted from API requests. However, any non-pointer,
  4236. // non-interface field appearing in ForceSendFields will be sent to the
  4237. // server regardless of whether the field is empty or not. This may be
  4238. // used to include empty fields in Patch requests.
  4239. ForceSendFields []string `json:"-"`
  4240. // NullFields is a list of field names (e.g. "ContainerType") to include
  4241. // in API requests with the JSON null value. By default, fields with
  4242. // empty values are omitted from API requests. However, any field with
  4243. // an empty value appearing in NullFields will be sent to the server as
  4244. // null. It is an error if a field in this list has a non-empty value.
  4245. // This may be used to include null fields in Patch requests.
  4246. NullFields []string `json:"-"`
  4247. }
  4248. func (s *ImageRawDisk) MarshalJSON() ([]byte, error) {
  4249. type noMethod ImageRawDisk
  4250. raw := noMethod(*s)
  4251. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4252. }
  4253. // ImageList: Contains a list of images.
  4254. type ImageList struct {
  4255. // Id: [Output Only] The unique identifier for the resource. This
  4256. // identifier is defined by the server.
  4257. Id string `json:"id,omitempty"`
  4258. // Items: [Output Only] A list of Image resources.
  4259. Items []*Image `json:"items,omitempty"`
  4260. // Kind: Type of resource.
  4261. Kind string `json:"kind,omitempty"`
  4262. // NextPageToken: [Output Only] This token allows you to get the next
  4263. // page of results for list requests. If the number of results is larger
  4264. // than maxResults, use the nextPageToken as a value for the query
  4265. // parameter pageToken in the next list request. Subsequent list
  4266. // requests will have their own nextPageToken to continue paging through
  4267. // the results.
  4268. NextPageToken string `json:"nextPageToken,omitempty"`
  4269. // SelfLink: [Output Only] Server-defined URL for this resource.
  4270. SelfLink string `json:"selfLink,omitempty"`
  4271. // ServerResponse contains the HTTP response code and headers from the
  4272. // server.
  4273. googleapi.ServerResponse `json:"-"`
  4274. // ForceSendFields is a list of field names (e.g. "Id") to
  4275. // unconditionally include in API requests. By default, fields with
  4276. // empty values are omitted from API requests. However, any non-pointer,
  4277. // non-interface field appearing in ForceSendFields will be sent to the
  4278. // server regardless of whether the field is empty or not. This may be
  4279. // used to include empty fields in Patch requests.
  4280. ForceSendFields []string `json:"-"`
  4281. // NullFields is a list of field names (e.g. "Id") to include in API
  4282. // requests with the JSON null value. By default, fields with empty
  4283. // values are omitted from API requests. However, any field with an
  4284. // empty value appearing in NullFields will be sent to the server as
  4285. // null. It is an error if a field in this list has a non-empty value.
  4286. // This may be used to include null fields in Patch requests.
  4287. NullFields []string `json:"-"`
  4288. }
  4289. func (s *ImageList) MarshalJSON() ([]byte, error) {
  4290. type noMethod ImageList
  4291. raw := noMethod(*s)
  4292. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4293. }
  4294. // Instance: An Instance resource.
  4295. type Instance struct {
  4296. // CanIpForward: Allows this instance to send and receive packets with
  4297. // non-matching destination or source IPs. This is required if you plan
  4298. // to use this instance to forward routes. For more information, see
  4299. // Enabling IP Forwarding.
  4300. CanIpForward bool `json:"canIpForward,omitempty"`
  4301. // CpuPlatform: [Output Only] The CPU platform used by this instance.
  4302. CpuPlatform string `json:"cpuPlatform,omitempty"`
  4303. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  4304. // format.
  4305. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  4306. // Description: An optional description of this resource. Provide this
  4307. // property when you create the resource.
  4308. Description string `json:"description,omitempty"`
  4309. // Disks: Array of disks associated with this instance. Persistent disks
  4310. // must be created before you can assign them.
  4311. Disks []*AttachedDisk `json:"disks,omitempty"`
  4312. // Id: [Output Only] The unique identifier for the resource. This
  4313. // identifier is defined by the server.
  4314. Id uint64 `json:"id,omitempty,string"`
  4315. // Kind: [Output Only] Type of the resource. Always compute#instance for
  4316. // instances.
  4317. Kind string `json:"kind,omitempty"`
  4318. // LabelFingerprint: A fingerprint for this request, which is
  4319. // essentially a hash of the metadata's contents and used for optimistic
  4320. // locking. The fingerprint is initially generated by Compute Engine and
  4321. // changes after every request to modify or update metadata. You must
  4322. // always provide an up-to-date fingerprint hash in order to update or
  4323. // change metadata.
  4324. //
  4325. // To see the latest fingerprint, make get() request to the instance.
  4326. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  4327. // Labels: Labels to apply to this instance. These can be later modified
  4328. // by the setLabels method.
  4329. Labels map[string]string `json:"labels,omitempty"`
  4330. // MachineType: Full or partial URL of the machine type resource to use
  4331. // for this instance, in the format:
  4332. // zones/zone/machineTypes/machine-type. This is provided by the client
  4333. // when the instance is created. For example, the following is a valid
  4334. // partial url to a predefined machine
  4335. // type:
  4336. //
  4337. // zones/us-central1-f/machineTypes/n1-standard-1
  4338. //
  4339. // To create a custom machine type, provide a URL to a machine type in
  4340. // the following format, where CPUS is 1 or an even number up to 32 (2,
  4341. // 4, 6, ... 24, etc), and MEMORY is the total memory for this instance.
  4342. // Memory must be a multiple of 256 MB and must be supplied in MB (e.g.
  4343. // 5 GB of memory is 5120
  4344. // MB):
  4345. //
  4346. // zones/zone/machineTypes/custom-CPUS-MEMORY
  4347. //
  4348. // For example: zones/us-central1-f/machineTypes/custom-4-5120
  4349. //
  4350. // For a full list of restrictions, read the Specifications for custom
  4351. // machine types.
  4352. MachineType string `json:"machineType,omitempty"`
  4353. // Metadata: The metadata key/value pairs assigned to this instance.
  4354. // This includes custom metadata and predefined keys.
  4355. Metadata *Metadata `json:"metadata,omitempty"`
  4356. // Name: The name of the resource, provided by the client when initially
  4357. // creating the resource. The resource name must be 1-63 characters
  4358. // long, and comply with RFC1035. Specifically, the name must be 1-63
  4359. // characters long and match the regular expression
  4360. // [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a
  4361. // lowercase letter, and all following characters must be a dash,
  4362. // lowercase letter, or digit, except the last character, which cannot
  4363. // be a dash.
  4364. Name string `json:"name,omitempty"`
  4365. // NetworkInterfaces: An array of configurations for this interface.
  4366. // This specifies how this interface is configured to interact with
  4367. // other network services, such as connecting to the internet. Only one
  4368. // interface is supported per instance.
  4369. NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"`
  4370. // Scheduling: Sets the scheduling options for this instance.
  4371. Scheduling *Scheduling `json:"scheduling,omitempty"`
  4372. // SelfLink: [Output Only] Server-defined URL for this resource.
  4373. SelfLink string `json:"selfLink,omitempty"`
  4374. // ServiceAccounts: A list of service accounts, with their specified
  4375. // scopes, authorized for this instance. Only one service account per VM
  4376. // instance is supported.
  4377. //
  4378. // Service accounts generate access tokens that can be accessed through
  4379. // the metadata server and used to authenticate applications on the
  4380. // instance. See Service Accounts for more information.
  4381. ServiceAccounts []*ServiceAccount `json:"serviceAccounts,omitempty"`
  4382. // StartRestricted: [Output Only] Whether a VM has been restricted for
  4383. // start because Compute Engine has detected suspicious activity.
  4384. StartRestricted bool `json:"startRestricted,omitempty"`
  4385. // Status: [Output Only] The status of the instance. One of the
  4386. // following values: PROVISIONING, STAGING, RUNNING, STOPPING,
  4387. // SUSPENDING, SUSPENDED, and TERMINATED.
  4388. //
  4389. // Possible values:
  4390. // "PROVISIONING"
  4391. // "RUNNING"
  4392. // "STAGING"
  4393. // "STOPPED"
  4394. // "STOPPING"
  4395. // "SUSPENDED"
  4396. // "SUSPENDING"
  4397. // "TERMINATED"
  4398. Status string `json:"status,omitempty"`
  4399. // StatusMessage: [Output Only] An optional, human-readable explanation
  4400. // of the status.
  4401. StatusMessage string `json:"statusMessage,omitempty"`
  4402. // Tags: A list of tags to apply to this instance. Tags are used to
  4403. // identify valid sources or targets for network firewalls and are
  4404. // specified by the client during instance creation. The tags can be
  4405. // later modified by the setTags method. Each tag within the list must
  4406. // comply with RFC1035.
  4407. Tags *Tags `json:"tags,omitempty"`
  4408. // Zone: [Output Only] URL of the zone where the instance resides.
  4409. Zone string `json:"zone,omitempty"`
  4410. // ServerResponse contains the HTTP response code and headers from the
  4411. // server.
  4412. googleapi.ServerResponse `json:"-"`
  4413. // ForceSendFields is a list of field names (e.g. "CanIpForward") to
  4414. // unconditionally include in API requests. By default, fields with
  4415. // empty values are omitted from API requests. However, any non-pointer,
  4416. // non-interface field appearing in ForceSendFields will be sent to the
  4417. // server regardless of whether the field is empty or not. This may be
  4418. // used to include empty fields in Patch requests.
  4419. ForceSendFields []string `json:"-"`
  4420. // NullFields is a list of field names (e.g. "CanIpForward") to include
  4421. // in API requests with the JSON null value. By default, fields with
  4422. // empty values are omitted from API requests. However, any field with
  4423. // an empty value appearing in NullFields will be sent to the server as
  4424. // null. It is an error if a field in this list has a non-empty value.
  4425. // This may be used to include null fields in Patch requests.
  4426. NullFields []string `json:"-"`
  4427. }
  4428. func (s *Instance) MarshalJSON() ([]byte, error) {
  4429. type noMethod Instance
  4430. raw := noMethod(*s)
  4431. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4432. }
  4433. type InstanceAggregatedList struct {
  4434. // Id: [Output Only] The unique identifier for the resource. This
  4435. // identifier is defined by the server.
  4436. Id string `json:"id,omitempty"`
  4437. // Items: [Output Only] A map of scoped instance lists.
  4438. Items map[string]InstancesScopedList `json:"items,omitempty"`
  4439. // Kind: [Output Only] Type of resource. Always
  4440. // compute#instanceAggregatedList for aggregated lists of Instance
  4441. // resources.
  4442. Kind string `json:"kind,omitempty"`
  4443. // NextPageToken: [Output Only] This token allows you to get the next
  4444. // page of results for list requests. If the number of results is larger
  4445. // than maxResults, use the nextPageToken as a value for the query
  4446. // parameter pageToken in the next list request. Subsequent list
  4447. // requests will have their own nextPageToken to continue paging through
  4448. // the results.
  4449. NextPageToken string `json:"nextPageToken,omitempty"`
  4450. // SelfLink: [Output Only] Server-defined URL for this resource.
  4451. SelfLink string `json:"selfLink,omitempty"`
  4452. // ServerResponse contains the HTTP response code and headers from the
  4453. // server.
  4454. googleapi.ServerResponse `json:"-"`
  4455. // ForceSendFields is a list of field names (e.g. "Id") to
  4456. // unconditionally include in API requests. By default, fields with
  4457. // empty values are omitted from API requests. However, any non-pointer,
  4458. // non-interface field appearing in ForceSendFields will be sent to the
  4459. // server regardless of whether the field is empty or not. This may be
  4460. // used to include empty fields in Patch requests.
  4461. ForceSendFields []string `json:"-"`
  4462. // NullFields is a list of field names (e.g. "Id") to include in API
  4463. // requests with the JSON null value. By default, fields with empty
  4464. // values are omitted from API requests. However, any field with an
  4465. // empty value appearing in NullFields will be sent to the server as
  4466. // null. It is an error if a field in this list has a non-empty value.
  4467. // This may be used to include null fields in Patch requests.
  4468. NullFields []string `json:"-"`
  4469. }
  4470. func (s *InstanceAggregatedList) MarshalJSON() ([]byte, error) {
  4471. type noMethod InstanceAggregatedList
  4472. raw := noMethod(*s)
  4473. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4474. }
  4475. type InstanceGroup struct {
  4476. // CreationTimestamp: [Output Only] The creation timestamp for this
  4477. // instance group in RFC3339 text format.
  4478. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  4479. // Description: An optional description of this resource. Provide this
  4480. // property when you create the resource.
  4481. Description string `json:"description,omitempty"`
  4482. // Fingerprint: [Output Only] The fingerprint of the named ports. The
  4483. // system uses this fingerprint to detect conflicts when multiple users
  4484. // change the named ports concurrently.
  4485. Fingerprint string `json:"fingerprint,omitempty"`
  4486. // Id: [Output Only] A unique identifier for this instance group,
  4487. // generated by the server.
  4488. Id uint64 `json:"id,omitempty,string"`
  4489. // Kind: [Output Only] The resource type, which is always
  4490. // compute#instanceGroup for instance groups.
  4491. Kind string `json:"kind,omitempty"`
  4492. // Name: The name of the instance group. The name must be 1-63
  4493. // characters long, and comply with RFC1035.
  4494. Name string `json:"name,omitempty"`
  4495. // NamedPorts: Assigns a name to a port number. For example: {name:
  4496. // "http", port: 80}
  4497. //
  4498. // This allows the system to reference ports by the assigned name
  4499. // instead of a port number. Named ports can also contain multiple
  4500. // ports. For example: [{name: "http", port: 80},{name: "http", port:
  4501. // 8080}]
  4502. //
  4503. // Named ports apply to all instances in this instance group.
  4504. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  4505. // Network: The URL of the network to which all instances in the
  4506. // instance group belong.
  4507. Network string `json:"network,omitempty"`
  4508. // Region: The URL of the region where the instance group is located
  4509. // (for regional resources).
  4510. Region string `json:"region,omitempty"`
  4511. // SelfLink: [Output Only] The URL for this instance group. The server
  4512. // generates this URL.
  4513. SelfLink string `json:"selfLink,omitempty"`
  4514. // Size: [Output Only] The total number of instances in the instance
  4515. // group.
  4516. Size int64 `json:"size,omitempty"`
  4517. // Subnetwork: The URL of the subnetwork to which all instances in the
  4518. // instance group belong.
  4519. Subnetwork string `json:"subnetwork,omitempty"`
  4520. // Zone: [Output Only] The URL of the zone where the instance group is
  4521. // located (for zonal resources).
  4522. Zone string `json:"zone,omitempty"`
  4523. // ServerResponse contains the HTTP response code and headers from the
  4524. // server.
  4525. googleapi.ServerResponse `json:"-"`
  4526. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  4527. // to unconditionally include in API requests. By default, fields with
  4528. // empty values are omitted from API requests. However, any non-pointer,
  4529. // non-interface field appearing in ForceSendFields will be sent to the
  4530. // server regardless of whether the field is empty or not. This may be
  4531. // used to include empty fields in Patch requests.
  4532. ForceSendFields []string `json:"-"`
  4533. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  4534. // include in API requests with the JSON null value. By default, fields
  4535. // with empty values are omitted from API requests. However, any field
  4536. // with an empty value appearing in NullFields will be sent to the
  4537. // server as null. It is an error if a field in this list has a
  4538. // non-empty value. This may be used to include null fields in Patch
  4539. // requests.
  4540. NullFields []string `json:"-"`
  4541. }
  4542. func (s *InstanceGroup) MarshalJSON() ([]byte, error) {
  4543. type noMethod InstanceGroup
  4544. raw := noMethod(*s)
  4545. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4546. }
  4547. type InstanceGroupAggregatedList struct {
  4548. // Id: [Output Only] A unique identifier for this aggregated list of
  4549. // instance groups. The server generates this identifier.
  4550. Id string `json:"id,omitempty"`
  4551. // Items: A map of scoped instance group lists.
  4552. Items map[string]InstanceGroupsScopedList `json:"items,omitempty"`
  4553. // Kind: [Output Only] The resource type, which is always
  4554. // compute#instanceGroupAggregatedList for aggregated lists of instance
  4555. // groups.
  4556. Kind string `json:"kind,omitempty"`
  4557. // NextPageToken: [Output Only] This token allows you to get the next
  4558. // page of results for list requests. If the number of results is larger
  4559. // than maxResults, use the nextPageToken as a value for the query
  4560. // parameter pageToken in the next list request. Subsequent list
  4561. // requests will have their own nextPageToken to continue paging through
  4562. // the results.
  4563. NextPageToken string `json:"nextPageToken,omitempty"`
  4564. // SelfLink: [Output Only] The URL for this resource type. The server
  4565. // generates this URL.
  4566. SelfLink string `json:"selfLink,omitempty"`
  4567. // ServerResponse contains the HTTP response code and headers from the
  4568. // server.
  4569. googleapi.ServerResponse `json:"-"`
  4570. // ForceSendFields is a list of field names (e.g. "Id") to
  4571. // unconditionally include in API requests. By default, fields with
  4572. // empty values are omitted from API requests. However, any non-pointer,
  4573. // non-interface field appearing in ForceSendFields will be sent to the
  4574. // server regardless of whether the field is empty or not. This may be
  4575. // used to include empty fields in Patch requests.
  4576. ForceSendFields []string `json:"-"`
  4577. // NullFields is a list of field names (e.g. "Id") to include in API
  4578. // requests with the JSON null value. By default, fields with empty
  4579. // values are omitted from API requests. However, any field with an
  4580. // empty value appearing in NullFields will be sent to the server as
  4581. // null. It is an error if a field in this list has a non-empty value.
  4582. // This may be used to include null fields in Patch requests.
  4583. NullFields []string `json:"-"`
  4584. }
  4585. func (s *InstanceGroupAggregatedList) MarshalJSON() ([]byte, error) {
  4586. type noMethod InstanceGroupAggregatedList
  4587. raw := noMethod(*s)
  4588. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4589. }
  4590. // InstanceGroupList: A list of InstanceGroup resources.
  4591. type InstanceGroupList struct {
  4592. // Id: [Output Only] A unique identifier for this list of instance
  4593. // groups. The server generates this identifier.
  4594. Id string `json:"id,omitempty"`
  4595. // Items: A list of instance groups.
  4596. Items []*InstanceGroup `json:"items,omitempty"`
  4597. // Kind: [Output Only] The resource type, which is always
  4598. // compute#instanceGroupList for instance group lists.
  4599. Kind string `json:"kind,omitempty"`
  4600. // NextPageToken: [Output Only] This token allows you to get the next
  4601. // page of results for list requests. If the number of results is larger
  4602. // than maxResults, use the nextPageToken as a value for the query
  4603. // parameter pageToken in the next list request. Subsequent list
  4604. // requests will have their own nextPageToken to continue paging through
  4605. // the results.
  4606. NextPageToken string `json:"nextPageToken,omitempty"`
  4607. // SelfLink: [Output Only] The URL for this resource type. The server
  4608. // generates this URL.
  4609. SelfLink string `json:"selfLink,omitempty"`
  4610. // ServerResponse contains the HTTP response code and headers from the
  4611. // server.
  4612. googleapi.ServerResponse `json:"-"`
  4613. // ForceSendFields is a list of field names (e.g. "Id") to
  4614. // unconditionally include in API requests. By default, fields with
  4615. // empty values are omitted from API requests. However, any non-pointer,
  4616. // non-interface field appearing in ForceSendFields will be sent to the
  4617. // server regardless of whether the field is empty or not. This may be
  4618. // used to include empty fields in Patch requests.
  4619. ForceSendFields []string `json:"-"`
  4620. // NullFields is a list of field names (e.g. "Id") to include in API
  4621. // requests with the JSON null value. By default, fields with empty
  4622. // values are omitted from API requests. However, any field with an
  4623. // empty value appearing in NullFields will be sent to the server as
  4624. // null. It is an error if a field in this list has a non-empty value.
  4625. // This may be used to include null fields in Patch requests.
  4626. NullFields []string `json:"-"`
  4627. }
  4628. func (s *InstanceGroupList) MarshalJSON() ([]byte, error) {
  4629. type noMethod InstanceGroupList
  4630. raw := noMethod(*s)
  4631. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4632. }
  4633. // InstanceGroupManager: An Instance Group Manager resource.
  4634. type InstanceGroupManager struct {
  4635. // BaseInstanceName: The base instance name to use for instances in this
  4636. // group. The value must be 1-58 characters long. Instances are named by
  4637. // appending a hyphen and a random four-character string to the base
  4638. // instance name. The base instance name must comply with RFC1035.
  4639. BaseInstanceName string `json:"baseInstanceName,omitempty"`
  4640. // CreationTimestamp: [Output Only] The creation timestamp for this
  4641. // managed instance group in RFC3339 text format.
  4642. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  4643. // CurrentActions: [Output Only] The list of instance actions and the
  4644. // number of instances in this managed instance group that are scheduled
  4645. // for each of those actions.
  4646. CurrentActions *InstanceGroupManagerActionsSummary `json:"currentActions,omitempty"`
  4647. // Description: An optional description of this resource. Provide this
  4648. // property when you create the resource.
  4649. Description string `json:"description,omitempty"`
  4650. // Fingerprint: [Output Only] The fingerprint of the resource data. You
  4651. // can use this optional field for optimistic locking when you update
  4652. // the resource.
  4653. Fingerprint string `json:"fingerprint,omitempty"`
  4654. // Id: [Output Only] A unique identifier for this resource type. The
  4655. // server generates this identifier.
  4656. Id uint64 `json:"id,omitempty,string"`
  4657. // InstanceGroup: [Output Only] The URL of the Instance Group resource.
  4658. InstanceGroup string `json:"instanceGroup,omitempty"`
  4659. // InstanceTemplate: The URL of the instance template that is specified
  4660. // for this managed instance group. The group uses this template to
  4661. // create all new instances in the managed instance group.
  4662. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  4663. // Kind: [Output Only] The resource type, which is always
  4664. // compute#instanceGroupManager for managed instance groups.
  4665. Kind string `json:"kind,omitempty"`
  4666. // Name: The name of the managed instance group. The name must be 1-63
  4667. // characters long, and comply with RFC1035.
  4668. Name string `json:"name,omitempty"`
  4669. // NamedPorts: Named ports configured for the Instance Groups
  4670. // complementary to this Instance Group Manager.
  4671. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  4672. // Region: [Output Only] The URL of the region where the managed
  4673. // instance group resides (for regional resources).
  4674. Region string `json:"region,omitempty"`
  4675. // SelfLink: [Output Only] The URL for this managed instance group. The
  4676. // server defines this URL.
  4677. SelfLink string `json:"selfLink,omitempty"`
  4678. // TargetPools: The URLs for all TargetPool resources to which instances
  4679. // in the instanceGroup field are added. The target pools automatically
  4680. // apply to all of the instances in the managed instance group.
  4681. TargetPools []string `json:"targetPools,omitempty"`
  4682. // TargetSize: The target number of running instances for this managed
  4683. // instance group. Deleting or abandoning instances reduces this number.
  4684. // Resizing the group changes this number.
  4685. TargetSize int64 `json:"targetSize,omitempty"`
  4686. // Zone: [Output Only] The URL of the zone where the managed instance
  4687. // group is located (for zonal resources).
  4688. Zone string `json:"zone,omitempty"`
  4689. // ServerResponse contains the HTTP response code and headers from the
  4690. // server.
  4691. googleapi.ServerResponse `json:"-"`
  4692. // ForceSendFields is a list of field names (e.g. "BaseInstanceName") to
  4693. // unconditionally include in API requests. By default, fields with
  4694. // empty values are omitted from API requests. However, any non-pointer,
  4695. // non-interface field appearing in ForceSendFields will be sent to the
  4696. // server regardless of whether the field is empty or not. This may be
  4697. // used to include empty fields in Patch requests.
  4698. ForceSendFields []string `json:"-"`
  4699. // NullFields is a list of field names (e.g. "BaseInstanceName") to
  4700. // include in API requests with the JSON null value. By default, fields
  4701. // with empty values are omitted from API requests. However, any field
  4702. // with an empty value appearing in NullFields will be sent to the
  4703. // server as null. It is an error if a field in this list has a
  4704. // non-empty value. This may be used to include null fields in Patch
  4705. // requests.
  4706. NullFields []string `json:"-"`
  4707. }
  4708. func (s *InstanceGroupManager) MarshalJSON() ([]byte, error) {
  4709. type noMethod InstanceGroupManager
  4710. raw := noMethod(*s)
  4711. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4712. }
  4713. type InstanceGroupManagerActionsSummary struct {
  4714. // Abandoning: [Output Only] The total number of instances in the
  4715. // managed instance group that are scheduled to be abandoned. Abandoning
  4716. // an instance removes it from the managed instance group without
  4717. // deleting it.
  4718. Abandoning int64 `json:"abandoning,omitempty"`
  4719. // Creating: [Output Only] The number of instances in the managed
  4720. // instance group that are scheduled to be created or are currently
  4721. // being created. If the group fails to create any of these instances,
  4722. // it tries again until it creates the instance successfully.
  4723. //
  4724. // If you have disabled creation retries, this field will not be
  4725. // populated; instead, the creatingWithoutRetries field will be
  4726. // populated.
  4727. Creating int64 `json:"creating,omitempty"`
  4728. // CreatingWithoutRetries: [Output Only] The number of instances that
  4729. // the managed instance group will attempt to create. The group attempts
  4730. // to create each instance only once. If the group fails to create any
  4731. // of these instances, it decreases the group's targetSize value
  4732. // accordingly.
  4733. CreatingWithoutRetries int64 `json:"creatingWithoutRetries,omitempty"`
  4734. // Deleting: [Output Only] The number of instances in the managed
  4735. // instance group that are scheduled to be deleted or are currently
  4736. // being deleted.
  4737. Deleting int64 `json:"deleting,omitempty"`
  4738. // None: [Output Only] The number of instances in the managed instance
  4739. // group that are running and have no scheduled actions.
  4740. None int64 `json:"none,omitempty"`
  4741. // Recreating: [Output Only] The number of instances in the managed
  4742. // instance group that are scheduled to be recreated or are currently
  4743. // being being recreated. Recreating an instance deletes the existing
  4744. // root persistent disk and creates a new disk from the image that is
  4745. // defined in the instance template.
  4746. Recreating int64 `json:"recreating,omitempty"`
  4747. // Refreshing: [Output Only] The number of instances in the managed
  4748. // instance group that are being reconfigured with properties that do
  4749. // not require a restart or a recreate action. For example, setting or
  4750. // removing target pools for the instance.
  4751. Refreshing int64 `json:"refreshing,omitempty"`
  4752. // Restarting: [Output Only] The number of instances in the managed
  4753. // instance group that are scheduled to be restarted or are currently
  4754. // being restarted.
  4755. Restarting int64 `json:"restarting,omitempty"`
  4756. // ForceSendFields is a list of field names (e.g. "Abandoning") to
  4757. // unconditionally include in API requests. By default, fields with
  4758. // empty values are omitted from API requests. However, any non-pointer,
  4759. // non-interface field appearing in ForceSendFields will be sent to the
  4760. // server regardless of whether the field is empty or not. This may be
  4761. // used to include empty fields in Patch requests.
  4762. ForceSendFields []string `json:"-"`
  4763. // NullFields is a list of field names (e.g. "Abandoning") to include in
  4764. // API requests with the JSON null value. By default, fields with empty
  4765. // values are omitted from API requests. However, any field with an
  4766. // empty value appearing in NullFields will be sent to the server as
  4767. // null. It is an error if a field in this list has a non-empty value.
  4768. // This may be used to include null fields in Patch requests.
  4769. NullFields []string `json:"-"`
  4770. }
  4771. func (s *InstanceGroupManagerActionsSummary) MarshalJSON() ([]byte, error) {
  4772. type noMethod InstanceGroupManagerActionsSummary
  4773. raw := noMethod(*s)
  4774. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4775. }
  4776. type InstanceGroupManagerAggregatedList struct {
  4777. // Id: [Output Only] A unique identifier for this aggregated list of
  4778. // managed instance groups. The server generates this identifier.
  4779. Id string `json:"id,omitempty"`
  4780. // Items: [Output Only] A map of filtered managed instance group lists.
  4781. Items map[string]InstanceGroupManagersScopedList `json:"items,omitempty"`
  4782. // Kind: [Output Only] The resource type, which is always
  4783. // compute#instanceGroupManagerAggregatedList for an aggregated list of
  4784. // managed instance groups.
  4785. Kind string `json:"kind,omitempty"`
  4786. // NextPageToken: [Output Only] This token allows you to get the next
  4787. // page of results for list requests. If the number of results is larger
  4788. // than maxResults, use the nextPageToken as a value for the query
  4789. // parameter pageToken in the next list request. Subsequent list
  4790. // requests will have their own nextPageToken to continue paging through
  4791. // the results.
  4792. NextPageToken string `json:"nextPageToken,omitempty"`
  4793. // SelfLink: [Output Only] The URL for this resource type. The server
  4794. // generates this URL.
  4795. SelfLink string `json:"selfLink,omitempty"`
  4796. // ServerResponse contains the HTTP response code and headers from the
  4797. // server.
  4798. googleapi.ServerResponse `json:"-"`
  4799. // ForceSendFields is a list of field names (e.g. "Id") to
  4800. // unconditionally include in API requests. By default, fields with
  4801. // empty values are omitted from API requests. However, any non-pointer,
  4802. // non-interface field appearing in ForceSendFields will be sent to the
  4803. // server regardless of whether the field is empty or not. This may be
  4804. // used to include empty fields in Patch requests.
  4805. ForceSendFields []string `json:"-"`
  4806. // NullFields is a list of field names (e.g. "Id") to include in API
  4807. // requests with the JSON null value. By default, fields with empty
  4808. // values are omitted from API requests. However, any field with an
  4809. // empty value appearing in NullFields will be sent to the server as
  4810. // null. It is an error if a field in this list has a non-empty value.
  4811. // This may be used to include null fields in Patch requests.
  4812. NullFields []string `json:"-"`
  4813. }
  4814. func (s *InstanceGroupManagerAggregatedList) MarshalJSON() ([]byte, error) {
  4815. type noMethod InstanceGroupManagerAggregatedList
  4816. raw := noMethod(*s)
  4817. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4818. }
  4819. // InstanceGroupManagerList: [Output Only] A list of managed instance
  4820. // groups.
  4821. type InstanceGroupManagerList struct {
  4822. // Id: [Output Only] A unique identifier for this resource type. The
  4823. // server generates this identifier.
  4824. Id string `json:"id,omitempty"`
  4825. // Items: [Output Only] A list of managed instance groups.
  4826. Items []*InstanceGroupManager `json:"items,omitempty"`
  4827. // Kind: [Output Only] The resource type, which is always
  4828. // compute#instanceGroupManagerList for a list of managed instance
  4829. // groups.
  4830. Kind string `json:"kind,omitempty"`
  4831. // NextPageToken: [Output Only] This token allows you to get the next
  4832. // page of results for list requests. If the number of results is larger
  4833. // than maxResults, use the nextPageToken as a value for the query
  4834. // parameter pageToken in the next list request. Subsequent list
  4835. // requests will have their own nextPageToken to continue paging through
  4836. // the results.
  4837. NextPageToken string `json:"nextPageToken,omitempty"`
  4838. // SelfLink: [Output Only] Server-defined URL for this resource.
  4839. SelfLink string `json:"selfLink,omitempty"`
  4840. // ServerResponse contains the HTTP response code and headers from the
  4841. // server.
  4842. googleapi.ServerResponse `json:"-"`
  4843. // ForceSendFields is a list of field names (e.g. "Id") to
  4844. // unconditionally include in API requests. By default, fields with
  4845. // empty values are omitted from API requests. However, any non-pointer,
  4846. // non-interface field appearing in ForceSendFields will be sent to the
  4847. // server regardless of whether the field is empty or not. This may be
  4848. // used to include empty fields in Patch requests.
  4849. ForceSendFields []string `json:"-"`
  4850. // NullFields is a list of field names (e.g. "Id") to include in API
  4851. // requests with the JSON null value. By default, fields with empty
  4852. // values are omitted from API requests. However, any field with an
  4853. // empty value appearing in NullFields will be sent to the server as
  4854. // null. It is an error if a field in this list has a non-empty value.
  4855. // This may be used to include null fields in Patch requests.
  4856. NullFields []string `json:"-"`
  4857. }
  4858. func (s *InstanceGroupManagerList) MarshalJSON() ([]byte, error) {
  4859. type noMethod InstanceGroupManagerList
  4860. raw := noMethod(*s)
  4861. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4862. }
  4863. type InstanceGroupManagersAbandonInstancesRequest struct {
  4864. // Instances: The URLs of one or more instances to abandon. This can be
  4865. // a full URL or a partial URL, such as
  4866. // zones/[ZONE]/instances/[INSTANCE_NAME].
  4867. Instances []string `json:"instances,omitempty"`
  4868. // ForceSendFields is a list of field names (e.g. "Instances") to
  4869. // unconditionally include in API requests. By default, fields with
  4870. // empty values are omitted from API requests. However, any non-pointer,
  4871. // non-interface field appearing in ForceSendFields will be sent to the
  4872. // server regardless of whether the field is empty or not. This may be
  4873. // used to include empty fields in Patch requests.
  4874. ForceSendFields []string `json:"-"`
  4875. // NullFields is a list of field names (e.g. "Instances") to include in
  4876. // API requests with the JSON null value. By default, fields with empty
  4877. // values are omitted from API requests. However, any field with an
  4878. // empty value appearing in NullFields will be sent to the server as
  4879. // null. It is an error if a field in this list has a non-empty value.
  4880. // This may be used to include null fields in Patch requests.
  4881. NullFields []string `json:"-"`
  4882. }
  4883. func (s *InstanceGroupManagersAbandonInstancesRequest) MarshalJSON() ([]byte, error) {
  4884. type noMethod InstanceGroupManagersAbandonInstancesRequest
  4885. raw := noMethod(*s)
  4886. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4887. }
  4888. type InstanceGroupManagersDeleteInstancesRequest struct {
  4889. // Instances: The URLs of one or more instances to delete. This can be a
  4890. // full URL or a partial URL, such as
  4891. // zones/[ZONE]/instances/[INSTANCE_NAME].
  4892. Instances []string `json:"instances,omitempty"`
  4893. // ForceSendFields is a list of field names (e.g. "Instances") to
  4894. // unconditionally include in API requests. By default, fields with
  4895. // empty values are omitted from API requests. However, any non-pointer,
  4896. // non-interface field appearing in ForceSendFields will be sent to the
  4897. // server regardless of whether the field is empty or not. This may be
  4898. // used to include empty fields in Patch requests.
  4899. ForceSendFields []string `json:"-"`
  4900. // NullFields is a list of field names (e.g. "Instances") to include in
  4901. // API requests with the JSON null value. By default, fields with empty
  4902. // values are omitted from API requests. However, any field with an
  4903. // empty value appearing in NullFields will be sent to the server as
  4904. // null. It is an error if a field in this list has a non-empty value.
  4905. // This may be used to include null fields in Patch requests.
  4906. NullFields []string `json:"-"`
  4907. }
  4908. func (s *InstanceGroupManagersDeleteInstancesRequest) MarshalJSON() ([]byte, error) {
  4909. type noMethod InstanceGroupManagersDeleteInstancesRequest
  4910. raw := noMethod(*s)
  4911. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4912. }
  4913. type InstanceGroupManagersListManagedInstancesResponse struct {
  4914. // ManagedInstances: [Output Only] The list of instances in the managed
  4915. // instance group.
  4916. ManagedInstances []*ManagedInstance `json:"managedInstances,omitempty"`
  4917. // ServerResponse contains the HTTP response code and headers from the
  4918. // server.
  4919. googleapi.ServerResponse `json:"-"`
  4920. // ForceSendFields is a list of field names (e.g. "ManagedInstances") to
  4921. // unconditionally include in API requests. By default, fields with
  4922. // empty values are omitted from API requests. However, any non-pointer,
  4923. // non-interface field appearing in ForceSendFields will be sent to the
  4924. // server regardless of whether the field is empty or not. This may be
  4925. // used to include empty fields in Patch requests.
  4926. ForceSendFields []string `json:"-"`
  4927. // NullFields is a list of field names (e.g. "ManagedInstances") to
  4928. // include in API requests with the JSON null value. By default, fields
  4929. // with empty values are omitted from API requests. However, any field
  4930. // with an empty value appearing in NullFields will be sent to the
  4931. // server as null. It is an error if a field in this list has a
  4932. // non-empty value. This may be used to include null fields in Patch
  4933. // requests.
  4934. NullFields []string `json:"-"`
  4935. }
  4936. func (s *InstanceGroupManagersListManagedInstancesResponse) MarshalJSON() ([]byte, error) {
  4937. type noMethod InstanceGroupManagersListManagedInstancesResponse
  4938. raw := noMethod(*s)
  4939. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4940. }
  4941. type InstanceGroupManagersRecreateInstancesRequest struct {
  4942. // Instances: The URLs of one or more instances to recreate. This can be
  4943. // a full URL or a partial URL, such as
  4944. // zones/[ZONE]/instances/[INSTANCE_NAME].
  4945. Instances []string `json:"instances,omitempty"`
  4946. // ForceSendFields is a list of field names (e.g. "Instances") to
  4947. // unconditionally include in API requests. By default, fields with
  4948. // empty values are omitted from API requests. However, any non-pointer,
  4949. // non-interface field appearing in ForceSendFields will be sent to the
  4950. // server regardless of whether the field is empty or not. This may be
  4951. // used to include empty fields in Patch requests.
  4952. ForceSendFields []string `json:"-"`
  4953. // NullFields is a list of field names (e.g. "Instances") to include in
  4954. // API requests with the JSON null value. By default, fields with empty
  4955. // values are omitted from API requests. However, any field with an
  4956. // empty value appearing in NullFields will be sent to the server as
  4957. // null. It is an error if a field in this list has a non-empty value.
  4958. // This may be used to include null fields in Patch requests.
  4959. NullFields []string `json:"-"`
  4960. }
  4961. func (s *InstanceGroupManagersRecreateInstancesRequest) MarshalJSON() ([]byte, error) {
  4962. type noMethod InstanceGroupManagersRecreateInstancesRequest
  4963. raw := noMethod(*s)
  4964. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4965. }
  4966. type InstanceGroupManagersScopedList struct {
  4967. // InstanceGroupManagers: [Output Only] The list of managed instance
  4968. // groups that are contained in the specified project and zone.
  4969. InstanceGroupManagers []*InstanceGroupManager `json:"instanceGroupManagers,omitempty"`
  4970. // Warning: [Output Only] The warning that replaces the list of managed
  4971. // instance groups when the list is empty.
  4972. Warning *InstanceGroupManagersScopedListWarning `json:"warning,omitempty"`
  4973. // ForceSendFields is a list of field names (e.g.
  4974. // "InstanceGroupManagers") to unconditionally include in API requests.
  4975. // By default, fields with empty values are omitted from API requests.
  4976. // However, any non-pointer, non-interface field appearing in
  4977. // ForceSendFields will be sent to the server regardless of whether the
  4978. // field is empty or not. This may be used to include empty fields in
  4979. // Patch requests.
  4980. ForceSendFields []string `json:"-"`
  4981. // NullFields is a list of field names (e.g. "InstanceGroupManagers") to
  4982. // include in API requests with the JSON null value. By default, fields
  4983. // with empty values are omitted from API requests. However, any field
  4984. // with an empty value appearing in NullFields will be sent to the
  4985. // server as null. It is an error if a field in this list has a
  4986. // non-empty value. This may be used to include null fields in Patch
  4987. // requests.
  4988. NullFields []string `json:"-"`
  4989. }
  4990. func (s *InstanceGroupManagersScopedList) MarshalJSON() ([]byte, error) {
  4991. type noMethod InstanceGroupManagersScopedList
  4992. raw := noMethod(*s)
  4993. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4994. }
  4995. // InstanceGroupManagersScopedListWarning: [Output Only] The warning
  4996. // that replaces the list of managed instance groups when the list is
  4997. // empty.
  4998. type InstanceGroupManagersScopedListWarning struct {
  4999. // Code: [Output Only] A warning code, if applicable. For example,
  5000. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5001. // the response.
  5002. //
  5003. // Possible values:
  5004. // "CLEANUP_FAILED"
  5005. // "DEPRECATED_RESOURCE_USED"
  5006. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5007. // "FIELD_VALUE_OVERRIDEN"
  5008. // "INJECTED_KERNELS_DEPRECATED"
  5009. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5010. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5011. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5012. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5013. // "NEXT_HOP_NOT_RUNNING"
  5014. // "NOT_CRITICAL_ERROR"
  5015. // "NO_RESULTS_ON_PAGE"
  5016. // "REQUIRED_TOS_AGREEMENT"
  5017. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  5018. // "RESOURCE_NOT_DELETED"
  5019. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5020. // "UNREACHABLE"
  5021. Code string `json:"code,omitempty"`
  5022. // Data: [Output Only] Metadata about this warning in key: value format.
  5023. // For example:
  5024. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5025. Data []*InstanceGroupManagersScopedListWarningData `json:"data,omitempty"`
  5026. // Message: [Output Only] A human-readable description of the warning
  5027. // code.
  5028. Message string `json:"message,omitempty"`
  5029. // ForceSendFields is a list of field names (e.g. "Code") to
  5030. // unconditionally include in API requests. By default, fields with
  5031. // empty values are omitted from API requests. However, any non-pointer,
  5032. // non-interface field appearing in ForceSendFields will be sent to the
  5033. // server regardless of whether the field is empty or not. This may be
  5034. // used to include empty fields in Patch requests.
  5035. ForceSendFields []string `json:"-"`
  5036. // NullFields is a list of field names (e.g. "Code") to include in API
  5037. // requests with the JSON null value. By default, fields with empty
  5038. // values are omitted from API requests. However, any field with an
  5039. // empty value appearing in NullFields will be sent to the server as
  5040. // null. It is an error if a field in this list has a non-empty value.
  5041. // This may be used to include null fields in Patch requests.
  5042. NullFields []string `json:"-"`
  5043. }
  5044. func (s *InstanceGroupManagersScopedListWarning) MarshalJSON() ([]byte, error) {
  5045. type noMethod InstanceGroupManagersScopedListWarning
  5046. raw := noMethod(*s)
  5047. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5048. }
  5049. type InstanceGroupManagersScopedListWarningData struct {
  5050. // Key: [Output Only] A key that provides more detail on the warning
  5051. // being returned. For example, for warnings where there are no results
  5052. // in a list request for a particular zone, this key might be scope and
  5053. // the key value might be the zone name. Other examples might be a key
  5054. // indicating a deprecated resource and a suggested replacement, or a
  5055. // warning about invalid network settings (for example, if an instance
  5056. // attempts to perform IP forwarding but is not enabled for IP
  5057. // forwarding).
  5058. Key string `json:"key,omitempty"`
  5059. // Value: [Output Only] A warning data value corresponding to the key.
  5060. Value string `json:"value,omitempty"`
  5061. // ForceSendFields is a list of field names (e.g. "Key") to
  5062. // unconditionally include in API requests. By default, fields with
  5063. // empty values are omitted from API requests. However, any non-pointer,
  5064. // non-interface field appearing in ForceSendFields will be sent to the
  5065. // server regardless of whether the field is empty or not. This may be
  5066. // used to include empty fields in Patch requests.
  5067. ForceSendFields []string `json:"-"`
  5068. // NullFields is a list of field names (e.g. "Key") to include in API
  5069. // requests with the JSON null value. By default, fields with empty
  5070. // values are omitted from API requests. However, any field with an
  5071. // empty value appearing in NullFields will be sent to the server as
  5072. // null. It is an error if a field in this list has a non-empty value.
  5073. // This may be used to include null fields in Patch requests.
  5074. NullFields []string `json:"-"`
  5075. }
  5076. func (s *InstanceGroupManagersScopedListWarningData) MarshalJSON() ([]byte, error) {
  5077. type noMethod InstanceGroupManagersScopedListWarningData
  5078. raw := noMethod(*s)
  5079. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5080. }
  5081. type InstanceGroupManagersSetInstanceTemplateRequest struct {
  5082. // InstanceTemplate: The URL of the instance template that is specified
  5083. // for this managed instance group. The group uses this template to
  5084. // create all new instances in the managed instance group.
  5085. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  5086. // ForceSendFields is a list of field names (e.g. "InstanceTemplate") to
  5087. // unconditionally include in API requests. By default, fields with
  5088. // empty values are omitted from API requests. However, any non-pointer,
  5089. // non-interface field appearing in ForceSendFields will be sent to the
  5090. // server regardless of whether the field is empty or not. This may be
  5091. // used to include empty fields in Patch requests.
  5092. ForceSendFields []string `json:"-"`
  5093. // NullFields is a list of field names (e.g. "InstanceTemplate") to
  5094. // include in API requests with the JSON null value. By default, fields
  5095. // with empty values are omitted from API requests. However, any field
  5096. // with an empty value appearing in NullFields will be sent to the
  5097. // server as null. It is an error if a field in this list has a
  5098. // non-empty value. This may be used to include null fields in Patch
  5099. // requests.
  5100. NullFields []string `json:"-"`
  5101. }
  5102. func (s *InstanceGroupManagersSetInstanceTemplateRequest) MarshalJSON() ([]byte, error) {
  5103. type noMethod InstanceGroupManagersSetInstanceTemplateRequest
  5104. raw := noMethod(*s)
  5105. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5106. }
  5107. type InstanceGroupManagersSetTargetPoolsRequest struct {
  5108. // Fingerprint: The fingerprint of the target pools information. Use
  5109. // this optional property to prevent conflicts when multiple users
  5110. // change the target pools settings concurrently. Obtain the fingerprint
  5111. // with the instanceGroupManagers.get method. Then, include the
  5112. // fingerprint in your request to ensure that you do not overwrite
  5113. // changes that were applied from another concurrent request.
  5114. Fingerprint string `json:"fingerprint,omitempty"`
  5115. // TargetPools: The list of target pool URLs that instances in this
  5116. // managed instance group belong to. The managed instance group applies
  5117. // these target pools to all of the instances in the group. Existing
  5118. // instances and new instances in the group all receive these target
  5119. // pool settings.
  5120. TargetPools []string `json:"targetPools,omitempty"`
  5121. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  5122. // unconditionally include in API requests. By default, fields with
  5123. // empty values are omitted from API requests. However, any non-pointer,
  5124. // non-interface field appearing in ForceSendFields will be sent to the
  5125. // server regardless of whether the field is empty or not. This may be
  5126. // used to include empty fields in Patch requests.
  5127. ForceSendFields []string `json:"-"`
  5128. // NullFields is a list of field names (e.g. "Fingerprint") to include
  5129. // in API requests with the JSON null value. By default, fields with
  5130. // empty values are omitted from API requests. However, any field with
  5131. // an empty value appearing in NullFields will be sent to the server as
  5132. // null. It is an error if a field in this list has a non-empty value.
  5133. // This may be used to include null fields in Patch requests.
  5134. NullFields []string `json:"-"`
  5135. }
  5136. func (s *InstanceGroupManagersSetTargetPoolsRequest) MarshalJSON() ([]byte, error) {
  5137. type noMethod InstanceGroupManagersSetTargetPoolsRequest
  5138. raw := noMethod(*s)
  5139. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5140. }
  5141. type InstanceGroupsAddInstancesRequest struct {
  5142. // Instances: The list of instances to add to the instance group.
  5143. Instances []*InstanceReference `json:"instances,omitempty"`
  5144. // ForceSendFields is a list of field names (e.g. "Instances") to
  5145. // unconditionally include in API requests. By default, fields with
  5146. // empty values are omitted from API requests. However, any non-pointer,
  5147. // non-interface field appearing in ForceSendFields will be sent to the
  5148. // server regardless of whether the field is empty or not. This may be
  5149. // used to include empty fields in Patch requests.
  5150. ForceSendFields []string `json:"-"`
  5151. // NullFields is a list of field names (e.g. "Instances") to include in
  5152. // API requests with the JSON null value. By default, fields with empty
  5153. // values are omitted from API requests. However, any field with an
  5154. // empty value appearing in NullFields will be sent to the server as
  5155. // null. It is an error if a field in this list has a non-empty value.
  5156. // This may be used to include null fields in Patch requests.
  5157. NullFields []string `json:"-"`
  5158. }
  5159. func (s *InstanceGroupsAddInstancesRequest) MarshalJSON() ([]byte, error) {
  5160. type noMethod InstanceGroupsAddInstancesRequest
  5161. raw := noMethod(*s)
  5162. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5163. }
  5164. type InstanceGroupsListInstances struct {
  5165. // Id: [Output Only] A unique identifier for this list of instances in
  5166. // the specified instance group. The server generates this identifier.
  5167. Id string `json:"id,omitempty"`
  5168. // Items: [Output Only] A list of instances and any named ports that are
  5169. // assigned to those instances.
  5170. Items []*InstanceWithNamedPorts `json:"items,omitempty"`
  5171. // Kind: [Output Only] The resource type, which is always
  5172. // compute#instanceGroupsListInstances for the list of instances in the
  5173. // specified instance group.
  5174. Kind string `json:"kind,omitempty"`
  5175. // NextPageToken: [Output Only] This token allows you to get the next
  5176. // page of results for list requests. If the number of results is larger
  5177. // than maxResults, use the nextPageToken as a value for the query
  5178. // parameter pageToken in the next list request. Subsequent list
  5179. // requests will have their own nextPageToken to continue paging through
  5180. // the results.
  5181. NextPageToken string `json:"nextPageToken,omitempty"`
  5182. // SelfLink: [Output Only] The URL for this list of instances in the
  5183. // specified instance groups. The server generates this URL.
  5184. SelfLink string `json:"selfLink,omitempty"`
  5185. // ServerResponse contains the HTTP response code and headers from the
  5186. // server.
  5187. googleapi.ServerResponse `json:"-"`
  5188. // ForceSendFields is a list of field names (e.g. "Id") to
  5189. // unconditionally include in API requests. By default, fields with
  5190. // empty values are omitted from API requests. However, any non-pointer,
  5191. // non-interface field appearing in ForceSendFields will be sent to the
  5192. // server regardless of whether the field is empty or not. This may be
  5193. // used to include empty fields in Patch requests.
  5194. ForceSendFields []string `json:"-"`
  5195. // NullFields is a list of field names (e.g. "Id") to include in API
  5196. // requests with the JSON null value. By default, fields with empty
  5197. // values are omitted from API requests. However, any field with an
  5198. // empty value appearing in NullFields will be sent to the server as
  5199. // null. It is an error if a field in this list has a non-empty value.
  5200. // This may be used to include null fields in Patch requests.
  5201. NullFields []string `json:"-"`
  5202. }
  5203. func (s *InstanceGroupsListInstances) MarshalJSON() ([]byte, error) {
  5204. type noMethod InstanceGroupsListInstances
  5205. raw := noMethod(*s)
  5206. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5207. }
  5208. type InstanceGroupsListInstancesRequest struct {
  5209. // InstanceState: A filter for the state of the instances in the
  5210. // instance group. Valid options are ALL or RUNNING. If you do not
  5211. // specify this parameter the list includes all instances regardless of
  5212. // their state.
  5213. //
  5214. // Possible values:
  5215. // "ALL"
  5216. // "RUNNING"
  5217. InstanceState string `json:"instanceState,omitempty"`
  5218. // ForceSendFields is a list of field names (e.g. "InstanceState") to
  5219. // unconditionally include in API requests. By default, fields with
  5220. // empty values are omitted from API requests. However, any non-pointer,
  5221. // non-interface field appearing in ForceSendFields will be sent to the
  5222. // server regardless of whether the field is empty or not. This may be
  5223. // used to include empty fields in Patch requests.
  5224. ForceSendFields []string `json:"-"`
  5225. // NullFields is a list of field names (e.g. "InstanceState") to include
  5226. // in API requests with the JSON null value. By default, fields with
  5227. // empty values are omitted from API requests. However, any field with
  5228. // an empty value appearing in NullFields will be sent to the server as
  5229. // null. It is an error if a field in this list has a non-empty value.
  5230. // This may be used to include null fields in Patch requests.
  5231. NullFields []string `json:"-"`
  5232. }
  5233. func (s *InstanceGroupsListInstancesRequest) MarshalJSON() ([]byte, error) {
  5234. type noMethod InstanceGroupsListInstancesRequest
  5235. raw := noMethod(*s)
  5236. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5237. }
  5238. type InstanceGroupsRemoveInstancesRequest struct {
  5239. // Instances: The list of instances to remove from the instance group.
  5240. Instances []*InstanceReference `json:"instances,omitempty"`
  5241. // ForceSendFields is a list of field names (e.g. "Instances") to
  5242. // unconditionally include in API requests. By default, fields with
  5243. // empty values are omitted from API requests. However, any non-pointer,
  5244. // non-interface field appearing in ForceSendFields will be sent to the
  5245. // server regardless of whether the field is empty or not. This may be
  5246. // used to include empty fields in Patch requests.
  5247. ForceSendFields []string `json:"-"`
  5248. // NullFields is a list of field names (e.g. "Instances") to include in
  5249. // API requests with the JSON null value. By default, fields with empty
  5250. // values are omitted from API requests. However, any field with an
  5251. // empty value appearing in NullFields will be sent to the server as
  5252. // null. It is an error if a field in this list has a non-empty value.
  5253. // This may be used to include null fields in Patch requests.
  5254. NullFields []string `json:"-"`
  5255. }
  5256. func (s *InstanceGroupsRemoveInstancesRequest) MarshalJSON() ([]byte, error) {
  5257. type noMethod InstanceGroupsRemoveInstancesRequest
  5258. raw := noMethod(*s)
  5259. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5260. }
  5261. type InstanceGroupsScopedList struct {
  5262. // InstanceGroups: [Output Only] The list of instance groups that are
  5263. // contained in this scope.
  5264. InstanceGroups []*InstanceGroup `json:"instanceGroups,omitempty"`
  5265. // Warning: [Output Only] An informational warning that replaces the
  5266. // list of instance groups when the list is empty.
  5267. Warning *InstanceGroupsScopedListWarning `json:"warning,omitempty"`
  5268. // ForceSendFields is a list of field names (e.g. "InstanceGroups") to
  5269. // unconditionally include in API requests. By default, fields with
  5270. // empty values are omitted from API requests. However, any non-pointer,
  5271. // non-interface field appearing in ForceSendFields will be sent to the
  5272. // server regardless of whether the field is empty or not. This may be
  5273. // used to include empty fields in Patch requests.
  5274. ForceSendFields []string `json:"-"`
  5275. // NullFields is a list of field names (e.g. "InstanceGroups") to
  5276. // include in API requests with the JSON null value. By default, fields
  5277. // with empty values are omitted from API requests. However, any field
  5278. // with an empty value appearing in NullFields will be sent to the
  5279. // server as null. It is an error if a field in this list has a
  5280. // non-empty value. This may be used to include null fields in Patch
  5281. // requests.
  5282. NullFields []string `json:"-"`
  5283. }
  5284. func (s *InstanceGroupsScopedList) MarshalJSON() ([]byte, error) {
  5285. type noMethod InstanceGroupsScopedList
  5286. raw := noMethod(*s)
  5287. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5288. }
  5289. // InstanceGroupsScopedListWarning: [Output Only] An informational
  5290. // warning that replaces the list of instance groups when the list is
  5291. // empty.
  5292. type InstanceGroupsScopedListWarning struct {
  5293. // Code: [Output Only] A warning code, if applicable. For example,
  5294. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5295. // the response.
  5296. //
  5297. // Possible values:
  5298. // "CLEANUP_FAILED"
  5299. // "DEPRECATED_RESOURCE_USED"
  5300. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5301. // "FIELD_VALUE_OVERRIDEN"
  5302. // "INJECTED_KERNELS_DEPRECATED"
  5303. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5304. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5305. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5306. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5307. // "NEXT_HOP_NOT_RUNNING"
  5308. // "NOT_CRITICAL_ERROR"
  5309. // "NO_RESULTS_ON_PAGE"
  5310. // "REQUIRED_TOS_AGREEMENT"
  5311. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  5312. // "RESOURCE_NOT_DELETED"
  5313. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5314. // "UNREACHABLE"
  5315. Code string `json:"code,omitempty"`
  5316. // Data: [Output Only] Metadata about this warning in key: value format.
  5317. // For example:
  5318. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5319. Data []*InstanceGroupsScopedListWarningData `json:"data,omitempty"`
  5320. // Message: [Output Only] A human-readable description of the warning
  5321. // code.
  5322. Message string `json:"message,omitempty"`
  5323. // ForceSendFields is a list of field names (e.g. "Code") to
  5324. // unconditionally include in API requests. By default, fields with
  5325. // empty values are omitted from API requests. However, any non-pointer,
  5326. // non-interface field appearing in ForceSendFields will be sent to the
  5327. // server regardless of whether the field is empty or not. This may be
  5328. // used to include empty fields in Patch requests.
  5329. ForceSendFields []string `json:"-"`
  5330. // NullFields is a list of field names (e.g. "Code") to include in API
  5331. // requests with the JSON null value. By default, fields with empty
  5332. // values are omitted from API requests. However, any field with an
  5333. // empty value appearing in NullFields will be sent to the server as
  5334. // null. It is an error if a field in this list has a non-empty value.
  5335. // This may be used to include null fields in Patch requests.
  5336. NullFields []string `json:"-"`
  5337. }
  5338. func (s *InstanceGroupsScopedListWarning) MarshalJSON() ([]byte, error) {
  5339. type noMethod InstanceGroupsScopedListWarning
  5340. raw := noMethod(*s)
  5341. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5342. }
  5343. type InstanceGroupsScopedListWarningData struct {
  5344. // Key: [Output Only] A key that provides more detail on the warning
  5345. // being returned. For example, for warnings where there are no results
  5346. // in a list request for a particular zone, this key might be scope and
  5347. // the key value might be the zone name. Other examples might be a key
  5348. // indicating a deprecated resource and a suggested replacement, or a
  5349. // warning about invalid network settings (for example, if an instance
  5350. // attempts to perform IP forwarding but is not enabled for IP
  5351. // forwarding).
  5352. Key string `json:"key,omitempty"`
  5353. // Value: [Output Only] A warning data value corresponding to the key.
  5354. Value string `json:"value,omitempty"`
  5355. // ForceSendFields is a list of field names (e.g. "Key") to
  5356. // unconditionally include in API requests. By default, fields with
  5357. // empty values are omitted from API requests. However, any non-pointer,
  5358. // non-interface field appearing in ForceSendFields will be sent to the
  5359. // server regardless of whether the field is empty or not. This may be
  5360. // used to include empty fields in Patch requests.
  5361. ForceSendFields []string `json:"-"`
  5362. // NullFields is a list of field names (e.g. "Key") to include in API
  5363. // requests with the JSON null value. By default, fields with empty
  5364. // values are omitted from API requests. However, any field with an
  5365. // empty value appearing in NullFields will be sent to the server as
  5366. // null. It is an error if a field in this list has a non-empty value.
  5367. // This may be used to include null fields in Patch requests.
  5368. NullFields []string `json:"-"`
  5369. }
  5370. func (s *InstanceGroupsScopedListWarningData) MarshalJSON() ([]byte, error) {
  5371. type noMethod InstanceGroupsScopedListWarningData
  5372. raw := noMethod(*s)
  5373. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5374. }
  5375. type InstanceGroupsSetNamedPortsRequest struct {
  5376. // Fingerprint: The fingerprint of the named ports information for this
  5377. // instance group. Use this optional property to prevent conflicts when
  5378. // multiple users change the named ports settings concurrently. Obtain
  5379. // the fingerprint with the instanceGroups.get method. Then, include the
  5380. // fingerprint in your request to ensure that you do not overwrite
  5381. // changes that were applied from another concurrent request.
  5382. Fingerprint string `json:"fingerprint,omitempty"`
  5383. // NamedPorts: The list of named ports to set for this instance group.
  5384. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  5385. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  5386. // unconditionally include in API requests. By default, fields with
  5387. // empty values are omitted from API requests. However, any non-pointer,
  5388. // non-interface field appearing in ForceSendFields will be sent to the
  5389. // server regardless of whether the field is empty or not. This may be
  5390. // used to include empty fields in Patch requests.
  5391. ForceSendFields []string `json:"-"`
  5392. // NullFields is a list of field names (e.g. "Fingerprint") to include
  5393. // in API requests with the JSON null value. By default, fields with
  5394. // empty values are omitted from API requests. However, any field with
  5395. // an empty value appearing in NullFields will be sent to the server as
  5396. // null. It is an error if a field in this list has a non-empty value.
  5397. // This may be used to include null fields in Patch requests.
  5398. NullFields []string `json:"-"`
  5399. }
  5400. func (s *InstanceGroupsSetNamedPortsRequest) MarshalJSON() ([]byte, error) {
  5401. type noMethod InstanceGroupsSetNamedPortsRequest
  5402. raw := noMethod(*s)
  5403. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5404. }
  5405. // InstanceList: Contains a list of instances.
  5406. type InstanceList struct {
  5407. // Id: [Output Only] The unique identifier for the resource. This
  5408. // identifier is defined by the server.
  5409. Id string `json:"id,omitempty"`
  5410. // Items: [Output Only] A list of instances.
  5411. Items []*Instance `json:"items,omitempty"`
  5412. // Kind: [Output Only] Type of resource. Always compute#instanceList for
  5413. // lists of Instance resources.
  5414. Kind string `json:"kind,omitempty"`
  5415. // NextPageToken: [Output Only] This token allows you to get the next
  5416. // page of results for list requests. If the number of results is larger
  5417. // than maxResults, use the nextPageToken as a value for the query
  5418. // parameter pageToken in the next list request. Subsequent list
  5419. // requests will have their own nextPageToken to continue paging through
  5420. // the results.
  5421. NextPageToken string `json:"nextPageToken,omitempty"`
  5422. // SelfLink: [Output Only] Server-defined URL for this resource.
  5423. SelfLink string `json:"selfLink,omitempty"`
  5424. // ServerResponse contains the HTTP response code and headers from the
  5425. // server.
  5426. googleapi.ServerResponse `json:"-"`
  5427. // ForceSendFields is a list of field names (e.g. "Id") to
  5428. // unconditionally include in API requests. By default, fields with
  5429. // empty values are omitted from API requests. However, any non-pointer,
  5430. // non-interface field appearing in ForceSendFields will be sent to the
  5431. // server regardless of whether the field is empty or not. This may be
  5432. // used to include empty fields in Patch requests.
  5433. ForceSendFields []string `json:"-"`
  5434. // NullFields is a list of field names (e.g. "Id") to include in API
  5435. // requests with the JSON null value. By default, fields with empty
  5436. // values are omitted from API requests. However, any field with an
  5437. // empty value appearing in NullFields will be sent to the server as
  5438. // null. It is an error if a field in this list has a non-empty value.
  5439. // This may be used to include null fields in Patch requests.
  5440. NullFields []string `json:"-"`
  5441. }
  5442. func (s *InstanceList) MarshalJSON() ([]byte, error) {
  5443. type noMethod InstanceList
  5444. raw := noMethod(*s)
  5445. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5446. }
  5447. type InstanceMoveRequest struct {
  5448. // DestinationZone: The URL of the destination zone to move the
  5449. // instance. This can be a full or partial URL. For example, the
  5450. // following are all valid URLs to a zone:
  5451. // - https://www.googleapis.com/compute/v1/projects/project/zones/zone
  5452. //
  5453. // - projects/project/zones/zone
  5454. // - zones/zone
  5455. DestinationZone string `json:"destinationZone,omitempty"`
  5456. // TargetInstance: The URL of the target instance to move. This can be a
  5457. // full or partial URL. For example, the following are all valid URLs to
  5458. // an instance:
  5459. // -
  5460. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance
  5461. // - projects/project/zones/zone/instances/instance
  5462. // - zones/zone/instances/instance
  5463. TargetInstance string `json:"targetInstance,omitempty"`
  5464. // ForceSendFields is a list of field names (e.g. "DestinationZone") to
  5465. // unconditionally include in API requests. By default, fields with
  5466. // empty values are omitted from API requests. However, any non-pointer,
  5467. // non-interface field appearing in ForceSendFields will be sent to the
  5468. // server regardless of whether the field is empty or not. This may be
  5469. // used to include empty fields in Patch requests.
  5470. ForceSendFields []string `json:"-"`
  5471. // NullFields is a list of field names (e.g. "DestinationZone") to
  5472. // include in API requests with the JSON null value. By default, fields
  5473. // with empty values are omitted from API requests. However, any field
  5474. // with an empty value appearing in NullFields will be sent to the
  5475. // server as null. It is an error if a field in this list has a
  5476. // non-empty value. This may be used to include null fields in Patch
  5477. // requests.
  5478. NullFields []string `json:"-"`
  5479. }
  5480. func (s *InstanceMoveRequest) MarshalJSON() ([]byte, error) {
  5481. type noMethod InstanceMoveRequest
  5482. raw := noMethod(*s)
  5483. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5484. }
  5485. type InstanceProperties struct {
  5486. // CanIpForward: Enables instances created based on this template to
  5487. // send packets with source IP addresses other than their own and
  5488. // receive packets with destination IP addresses other than their own.
  5489. // If these instances will be used as an IP gateway or it will be set as
  5490. // the next-hop in a Route resource, specify true. If unsure, leave this
  5491. // set to false. See the Enable IP forwarding documentation for more
  5492. // information.
  5493. CanIpForward bool `json:"canIpForward,omitempty"`
  5494. // Description: An optional text description for the instances that are
  5495. // created from this instance template.
  5496. Description string `json:"description,omitempty"`
  5497. // Disks: An array of disks that are associated with the instances that
  5498. // are created from this template.
  5499. Disks []*AttachedDisk `json:"disks,omitempty"`
  5500. // Labels: Labels to apply to instances that are created from this
  5501. // template.
  5502. Labels map[string]string `json:"labels,omitempty"`
  5503. // MachineType: The machine type to use for instances that are created
  5504. // from this template.
  5505. MachineType string `json:"machineType,omitempty"`
  5506. // Metadata: The metadata key/value pairs to assign to instances that
  5507. // are created from this template. These pairs can consist of custom
  5508. // metadata or predefined keys. See Project and instance metadata for
  5509. // more information.
  5510. Metadata *Metadata `json:"metadata,omitempty"`
  5511. // NetworkInterfaces: An array of network access configurations for this
  5512. // interface.
  5513. NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"`
  5514. // Scheduling: Specifies the scheduling options for the instances that
  5515. // are created from this template.
  5516. Scheduling *Scheduling `json:"scheduling,omitempty"`
  5517. // ServiceAccounts: A list of service accounts with specified scopes.
  5518. // Access tokens for these service accounts are available to the
  5519. // instances that are created from this template. Use metadata queries
  5520. // to obtain the access tokens for these instances.
  5521. ServiceAccounts []*ServiceAccount `json:"serviceAccounts,omitempty"`
  5522. // Tags: A list of tags to apply to the instances that are created from
  5523. // this template. The tags identify valid sources or targets for network
  5524. // firewalls. The setTags method can modify this list of tags. Each tag
  5525. // within the list must comply with RFC1035.
  5526. Tags *Tags `json:"tags,omitempty"`
  5527. // ForceSendFields is a list of field names (e.g. "CanIpForward") to
  5528. // unconditionally include in API requests. By default, fields with
  5529. // empty values are omitted from API requests. However, any non-pointer,
  5530. // non-interface field appearing in ForceSendFields will be sent to the
  5531. // server regardless of whether the field is empty or not. This may be
  5532. // used to include empty fields in Patch requests.
  5533. ForceSendFields []string `json:"-"`
  5534. // NullFields is a list of field names (e.g. "CanIpForward") to include
  5535. // in API requests with the JSON null value. By default, fields with
  5536. // empty values are omitted from API requests. However, any field with
  5537. // an empty value appearing in NullFields will be sent to the server as
  5538. // null. It is an error if a field in this list has a non-empty value.
  5539. // This may be used to include null fields in Patch requests.
  5540. NullFields []string `json:"-"`
  5541. }
  5542. func (s *InstanceProperties) MarshalJSON() ([]byte, error) {
  5543. type noMethod InstanceProperties
  5544. raw := noMethod(*s)
  5545. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5546. }
  5547. type InstanceReference struct {
  5548. // Instance: The URL for a specific instance.
  5549. Instance string `json:"instance,omitempty"`
  5550. // ForceSendFields is a list of field names (e.g. "Instance") to
  5551. // unconditionally include in API requests. By default, fields with
  5552. // empty values are omitted from API requests. However, any non-pointer,
  5553. // non-interface field appearing in ForceSendFields will be sent to the
  5554. // server regardless of whether the field is empty or not. This may be
  5555. // used to include empty fields in Patch requests.
  5556. ForceSendFields []string `json:"-"`
  5557. // NullFields is a list of field names (e.g. "Instance") to include in
  5558. // API requests with the JSON null value. By default, fields with empty
  5559. // values are omitted from API requests. However, any field with an
  5560. // empty value appearing in NullFields will be sent to the server as
  5561. // null. It is an error if a field in this list has a non-empty value.
  5562. // This may be used to include null fields in Patch requests.
  5563. NullFields []string `json:"-"`
  5564. }
  5565. func (s *InstanceReference) MarshalJSON() ([]byte, error) {
  5566. type noMethod InstanceReference
  5567. raw := noMethod(*s)
  5568. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5569. }
  5570. // InstanceTemplate: An Instance Template resource.
  5571. type InstanceTemplate struct {
  5572. // CreationTimestamp: [Output Only] The creation timestamp for this
  5573. // instance template in RFC3339 text format.
  5574. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  5575. // Description: An optional description of this resource. Provide this
  5576. // property when you create the resource.
  5577. Description string `json:"description,omitempty"`
  5578. // Id: [Output Only] A unique identifier for this instance template. The
  5579. // server defines this identifier.
  5580. Id uint64 `json:"id,omitempty,string"`
  5581. // Kind: [Output Only] The resource type, which is always
  5582. // compute#instanceTemplate for instance templates.
  5583. Kind string `json:"kind,omitempty"`
  5584. // Name: Name of the resource; provided by the client when the resource
  5585. // is created. The name must be 1-63 characters long, and comply with
  5586. // RFC1035. Specifically, the name must be 1-63 characters long and
  5587. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  5588. // the first character must be a lowercase letter, and all following
  5589. // characters must be a dash, lowercase letter, or digit, except the
  5590. // last character, which cannot be a dash.
  5591. Name string `json:"name,omitempty"`
  5592. // Properties: The instance properties for this instance template.
  5593. Properties *InstanceProperties `json:"properties,omitempty"`
  5594. // SelfLink: [Output Only] The URL for this instance template. The
  5595. // server defines this URL.
  5596. SelfLink string `json:"selfLink,omitempty"`
  5597. // ServerResponse contains the HTTP response code and headers from the
  5598. // server.
  5599. googleapi.ServerResponse `json:"-"`
  5600. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  5601. // to unconditionally include in API requests. By default, fields with
  5602. // empty values are omitted from API requests. However, any non-pointer,
  5603. // non-interface field appearing in ForceSendFields will be sent to the
  5604. // server regardless of whether the field is empty or not. This may be
  5605. // used to include empty fields in Patch requests.
  5606. ForceSendFields []string `json:"-"`
  5607. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  5608. // include in API requests with the JSON null value. By default, fields
  5609. // with empty values are omitted from API requests. However, any field
  5610. // with an empty value appearing in NullFields will be sent to the
  5611. // server as null. It is an error if a field in this list has a
  5612. // non-empty value. This may be used to include null fields in Patch
  5613. // requests.
  5614. NullFields []string `json:"-"`
  5615. }
  5616. func (s *InstanceTemplate) MarshalJSON() ([]byte, error) {
  5617. type noMethod InstanceTemplate
  5618. raw := noMethod(*s)
  5619. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5620. }
  5621. // InstanceTemplateList: A list of instance templates.
  5622. type InstanceTemplateList struct {
  5623. // Id: [Output Only] A unique identifier for this instance template. The
  5624. // server defines this identifier.
  5625. Id string `json:"id,omitempty"`
  5626. // Items: [Output Only] list of InstanceTemplate resources.
  5627. Items []*InstanceTemplate `json:"items,omitempty"`
  5628. // Kind: [Output Only] The resource type, which is always
  5629. // compute#instanceTemplatesListResponse for instance template lists.
  5630. Kind string `json:"kind,omitempty"`
  5631. // NextPageToken: [Output Only] This token allows you to get the next
  5632. // page of results for list requests. If the number of results is larger
  5633. // than maxResults, use the nextPageToken as a value for the query
  5634. // parameter pageToken in the next list request. Subsequent list
  5635. // requests will have their own nextPageToken to continue paging through
  5636. // the results.
  5637. NextPageToken string `json:"nextPageToken,omitempty"`
  5638. // SelfLink: [Output Only] The URL for this instance template list. The
  5639. // server defines this URL.
  5640. SelfLink string `json:"selfLink,omitempty"`
  5641. // ServerResponse contains the HTTP response code and headers from the
  5642. // server.
  5643. googleapi.ServerResponse `json:"-"`
  5644. // ForceSendFields is a list of field names (e.g. "Id") to
  5645. // unconditionally include in API requests. By default, fields with
  5646. // empty values are omitted from API requests. However, any non-pointer,
  5647. // non-interface field appearing in ForceSendFields will be sent to the
  5648. // server regardless of whether the field is empty or not. This may be
  5649. // used to include empty fields in Patch requests.
  5650. ForceSendFields []string `json:"-"`
  5651. // NullFields is a list of field names (e.g. "Id") to include in API
  5652. // requests with the JSON null value. By default, fields with empty
  5653. // values are omitted from API requests. However, any field with an
  5654. // empty value appearing in NullFields will be sent to the server as
  5655. // null. It is an error if a field in this list has a non-empty value.
  5656. // This may be used to include null fields in Patch requests.
  5657. NullFields []string `json:"-"`
  5658. }
  5659. func (s *InstanceTemplateList) MarshalJSON() ([]byte, error) {
  5660. type noMethod InstanceTemplateList
  5661. raw := noMethod(*s)
  5662. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5663. }
  5664. type InstanceWithNamedPorts struct {
  5665. // Instance: [Output Only] The URL of the instance.
  5666. Instance string `json:"instance,omitempty"`
  5667. // NamedPorts: [Output Only] The named ports that belong to this
  5668. // instance group.
  5669. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  5670. // Status: [Output Only] The status of the instance.
  5671. //
  5672. // Possible values:
  5673. // "PROVISIONING"
  5674. // "RUNNING"
  5675. // "STAGING"
  5676. // "STOPPED"
  5677. // "STOPPING"
  5678. // "SUSPENDED"
  5679. // "SUSPENDING"
  5680. // "TERMINATED"
  5681. Status string `json:"status,omitempty"`
  5682. // ForceSendFields is a list of field names (e.g. "Instance") to
  5683. // unconditionally include in API requests. By default, fields with
  5684. // empty values are omitted from API requests. However, any non-pointer,
  5685. // non-interface field appearing in ForceSendFields will be sent to the
  5686. // server regardless of whether the field is empty or not. This may be
  5687. // used to include empty fields in Patch requests.
  5688. ForceSendFields []string `json:"-"`
  5689. // NullFields is a list of field names (e.g. "Instance") to include in
  5690. // API requests with the JSON null value. By default, fields with empty
  5691. // values are omitted from API requests. However, any field with an
  5692. // empty value appearing in NullFields will be sent to the server as
  5693. // null. It is an error if a field in this list has a non-empty value.
  5694. // This may be used to include null fields in Patch requests.
  5695. NullFields []string `json:"-"`
  5696. }
  5697. func (s *InstanceWithNamedPorts) MarshalJSON() ([]byte, error) {
  5698. type noMethod InstanceWithNamedPorts
  5699. raw := noMethod(*s)
  5700. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5701. }
  5702. type InstancesScopedList struct {
  5703. // Instances: [Output Only] List of instances contained in this scope.
  5704. Instances []*Instance `json:"instances,omitempty"`
  5705. // Warning: [Output Only] Informational warning which replaces the list
  5706. // of instances when the list is empty.
  5707. Warning *InstancesScopedListWarning `json:"warning,omitempty"`
  5708. // ForceSendFields is a list of field names (e.g. "Instances") to
  5709. // unconditionally include in API requests. By default, fields with
  5710. // empty values are omitted from API requests. However, any non-pointer,
  5711. // non-interface field appearing in ForceSendFields will be sent to the
  5712. // server regardless of whether the field is empty or not. This may be
  5713. // used to include empty fields in Patch requests.
  5714. ForceSendFields []string `json:"-"`
  5715. // NullFields is a list of field names (e.g. "Instances") to include in
  5716. // API requests with the JSON null value. By default, fields with empty
  5717. // values are omitted from API requests. However, any field with an
  5718. // empty value appearing in NullFields will be sent to the server as
  5719. // null. It is an error if a field in this list has a non-empty value.
  5720. // This may be used to include null fields in Patch requests.
  5721. NullFields []string `json:"-"`
  5722. }
  5723. func (s *InstancesScopedList) MarshalJSON() ([]byte, error) {
  5724. type noMethod InstancesScopedList
  5725. raw := noMethod(*s)
  5726. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5727. }
  5728. // InstancesScopedListWarning: [Output Only] Informational warning which
  5729. // replaces the list of instances when the list is empty.
  5730. type InstancesScopedListWarning struct {
  5731. // Code: [Output Only] A warning code, if applicable. For example,
  5732. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5733. // the response.
  5734. //
  5735. // Possible values:
  5736. // "CLEANUP_FAILED"
  5737. // "DEPRECATED_RESOURCE_USED"
  5738. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5739. // "FIELD_VALUE_OVERRIDEN"
  5740. // "INJECTED_KERNELS_DEPRECATED"
  5741. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5742. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5743. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5744. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5745. // "NEXT_HOP_NOT_RUNNING"
  5746. // "NOT_CRITICAL_ERROR"
  5747. // "NO_RESULTS_ON_PAGE"
  5748. // "REQUIRED_TOS_AGREEMENT"
  5749. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  5750. // "RESOURCE_NOT_DELETED"
  5751. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5752. // "UNREACHABLE"
  5753. Code string `json:"code,omitempty"`
  5754. // Data: [Output Only] Metadata about this warning in key: value format.
  5755. // For example:
  5756. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5757. Data []*InstancesScopedListWarningData `json:"data,omitempty"`
  5758. // Message: [Output Only] A human-readable description of the warning
  5759. // code.
  5760. Message string `json:"message,omitempty"`
  5761. // ForceSendFields is a list of field names (e.g. "Code") to
  5762. // unconditionally include in API requests. By default, fields with
  5763. // empty values are omitted from API requests. However, any non-pointer,
  5764. // non-interface field appearing in ForceSendFields will be sent to the
  5765. // server regardless of whether the field is empty or not. This may be
  5766. // used to include empty fields in Patch requests.
  5767. ForceSendFields []string `json:"-"`
  5768. // NullFields is a list of field names (e.g. "Code") to include in API
  5769. // requests with the JSON null value. By default, fields with empty
  5770. // values are omitted from API requests. However, any field with an
  5771. // empty value appearing in NullFields will be sent to the server as
  5772. // null. It is an error if a field in this list has a non-empty value.
  5773. // This may be used to include null fields in Patch requests.
  5774. NullFields []string `json:"-"`
  5775. }
  5776. func (s *InstancesScopedListWarning) MarshalJSON() ([]byte, error) {
  5777. type noMethod InstancesScopedListWarning
  5778. raw := noMethod(*s)
  5779. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5780. }
  5781. type InstancesScopedListWarningData struct {
  5782. // Key: [Output Only] A key that provides more detail on the warning
  5783. // being returned. For example, for warnings where there are no results
  5784. // in a list request for a particular zone, this key might be scope and
  5785. // the key value might be the zone name. Other examples might be a key
  5786. // indicating a deprecated resource and a suggested replacement, or a
  5787. // warning about invalid network settings (for example, if an instance
  5788. // attempts to perform IP forwarding but is not enabled for IP
  5789. // forwarding).
  5790. Key string `json:"key,omitempty"`
  5791. // Value: [Output Only] A warning data value corresponding to the key.
  5792. Value string `json:"value,omitempty"`
  5793. // ForceSendFields is a list of field names (e.g. "Key") to
  5794. // unconditionally include in API requests. By default, fields with
  5795. // empty values are omitted from API requests. However, any non-pointer,
  5796. // non-interface field appearing in ForceSendFields will be sent to the
  5797. // server regardless of whether the field is empty or not. This may be
  5798. // used to include empty fields in Patch requests.
  5799. ForceSendFields []string `json:"-"`
  5800. // NullFields is a list of field names (e.g. "Key") to include in API
  5801. // requests with the JSON null value. By default, fields with empty
  5802. // values are omitted from API requests. However, any field with an
  5803. // empty value appearing in NullFields will be sent to the server as
  5804. // null. It is an error if a field in this list has a non-empty value.
  5805. // This may be used to include null fields in Patch requests.
  5806. NullFields []string `json:"-"`
  5807. }
  5808. func (s *InstancesScopedListWarningData) MarshalJSON() ([]byte, error) {
  5809. type noMethod InstancesScopedListWarningData
  5810. raw := noMethod(*s)
  5811. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5812. }
  5813. type InstancesSetLabelsRequest struct {
  5814. // LabelFingerprint: Fingerprint of the previous set of labels for this
  5815. // resource, used to prevent conflicts. Provide the latest fingerprint
  5816. // value when making a request to add or change labels.
  5817. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  5818. Labels map[string]string `json:"labels,omitempty"`
  5819. // ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
  5820. // unconditionally include in API requests. By default, fields with
  5821. // empty values are omitted from API requests. However, any non-pointer,
  5822. // non-interface field appearing in ForceSendFields will be sent to the
  5823. // server regardless of whether the field is empty or not. This may be
  5824. // used to include empty fields in Patch requests.
  5825. ForceSendFields []string `json:"-"`
  5826. // NullFields is a list of field names (e.g. "LabelFingerprint") to
  5827. // include in API requests with the JSON null value. By default, fields
  5828. // with empty values are omitted from API requests. However, any field
  5829. // with an empty value appearing in NullFields will be sent to the
  5830. // server as null. It is an error if a field in this list has a
  5831. // non-empty value. This may be used to include null fields in Patch
  5832. // requests.
  5833. NullFields []string `json:"-"`
  5834. }
  5835. func (s *InstancesSetLabelsRequest) MarshalJSON() ([]byte, error) {
  5836. type noMethod InstancesSetLabelsRequest
  5837. raw := noMethod(*s)
  5838. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5839. }
  5840. type InstancesSetMachineTypeRequest struct {
  5841. // MachineType: Full or partial URL of the machine type resource. See
  5842. // Machine Types for a full list of machine types. For example:
  5843. // zones/us-central1-f/machineTypes/n1-standard-1
  5844. MachineType string `json:"machineType,omitempty"`
  5845. // ForceSendFields is a list of field names (e.g. "MachineType") to
  5846. // unconditionally include in API requests. By default, fields with
  5847. // empty values are omitted from API requests. However, any non-pointer,
  5848. // non-interface field appearing in ForceSendFields will be sent to the
  5849. // server regardless of whether the field is empty or not. This may be
  5850. // used to include empty fields in Patch requests.
  5851. ForceSendFields []string `json:"-"`
  5852. // NullFields is a list of field names (e.g. "MachineType") to include
  5853. // in API requests with the JSON null value. By default, fields with
  5854. // empty values are omitted from API requests. However, any field with
  5855. // an empty value appearing in NullFields will be sent to the server as
  5856. // null. It is an error if a field in this list has a non-empty value.
  5857. // This may be used to include null fields in Patch requests.
  5858. NullFields []string `json:"-"`
  5859. }
  5860. func (s *InstancesSetMachineTypeRequest) MarshalJSON() ([]byte, error) {
  5861. type noMethod InstancesSetMachineTypeRequest
  5862. raw := noMethod(*s)
  5863. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5864. }
  5865. type InstancesSetServiceAccountRequest struct {
  5866. // Email: Email address of the service account.
  5867. Email string `json:"email,omitempty"`
  5868. // Scopes: The list of scopes to be made available for this service
  5869. // account.
  5870. Scopes []string `json:"scopes,omitempty"`
  5871. // ForceSendFields is a list of field names (e.g. "Email") to
  5872. // unconditionally include in API requests. By default, fields with
  5873. // empty values are omitted from API requests. However, any non-pointer,
  5874. // non-interface field appearing in ForceSendFields will be sent to the
  5875. // server regardless of whether the field is empty or not. This may be
  5876. // used to include empty fields in Patch requests.
  5877. ForceSendFields []string `json:"-"`
  5878. // NullFields is a list of field names (e.g. "Email") to include in API
  5879. // requests with the JSON null value. By default, fields with empty
  5880. // values are omitted from API requests. However, any field with an
  5881. // empty value appearing in NullFields will be sent to the server as
  5882. // null. It is an error if a field in this list has a non-empty value.
  5883. // This may be used to include null fields in Patch requests.
  5884. NullFields []string `json:"-"`
  5885. }
  5886. func (s *InstancesSetServiceAccountRequest) MarshalJSON() ([]byte, error) {
  5887. type noMethod InstancesSetServiceAccountRequest
  5888. raw := noMethod(*s)
  5889. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5890. }
  5891. type InstancesStartWithEncryptionKeyRequest struct {
  5892. // Disks: Array of disks associated with this instance that are
  5893. // protected with a customer-supplied encryption key.
  5894. //
  5895. // In order to start the instance, the disk url and its corresponding
  5896. // key must be provided.
  5897. //
  5898. // If the disk is not protected with a customer-supplied encryption key
  5899. // it should not be specified.
  5900. Disks []*CustomerEncryptionKeyProtectedDisk `json:"disks,omitempty"`
  5901. // ForceSendFields is a list of field names (e.g. "Disks") to
  5902. // unconditionally include in API requests. By default, fields with
  5903. // empty values are omitted from API requests. However, any non-pointer,
  5904. // non-interface field appearing in ForceSendFields will be sent to the
  5905. // server regardless of whether the field is empty or not. This may be
  5906. // used to include empty fields in Patch requests.
  5907. ForceSendFields []string `json:"-"`
  5908. // NullFields is a list of field names (e.g. "Disks") to include in API
  5909. // requests with the JSON null value. By default, fields with empty
  5910. // values are omitted from API requests. However, any field with an
  5911. // empty value appearing in NullFields will be sent to the server as
  5912. // null. It is an error if a field in this list has a non-empty value.
  5913. // This may be used to include null fields in Patch requests.
  5914. NullFields []string `json:"-"`
  5915. }
  5916. func (s *InstancesStartWithEncryptionKeyRequest) MarshalJSON() ([]byte, error) {
  5917. type noMethod InstancesStartWithEncryptionKeyRequest
  5918. raw := noMethod(*s)
  5919. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5920. }
  5921. // License: A license resource.
  5922. type License struct {
  5923. // ChargesUseFee: [Output Only] Deprecated. This field no longer
  5924. // reflects whether a license charges a usage fee.
  5925. ChargesUseFee bool `json:"chargesUseFee,omitempty"`
  5926. // Kind: [Output Only] Type of resource. Always compute#license for
  5927. // licenses.
  5928. Kind string `json:"kind,omitempty"`
  5929. // Name: [Output Only] Name of the resource. The name is 1-63 characters
  5930. // long and complies with RFC1035.
  5931. Name string `json:"name,omitempty"`
  5932. // SelfLink: [Output Only] Server-defined URL for the resource.
  5933. SelfLink string `json:"selfLink,omitempty"`
  5934. // ServerResponse contains the HTTP response code and headers from the
  5935. // server.
  5936. googleapi.ServerResponse `json:"-"`
  5937. // ForceSendFields is a list of field names (e.g. "ChargesUseFee") to
  5938. // unconditionally include in API requests. By default, fields with
  5939. // empty values are omitted from API requests. However, any non-pointer,
  5940. // non-interface field appearing in ForceSendFields will be sent to the
  5941. // server regardless of whether the field is empty or not. This may be
  5942. // used to include empty fields in Patch requests.
  5943. ForceSendFields []string `json:"-"`
  5944. // NullFields is a list of field names (e.g. "ChargesUseFee") to include
  5945. // in API requests with the JSON null value. By default, fields with
  5946. // empty values are omitted from API requests. However, any field with
  5947. // an empty value appearing in NullFields will be sent to the server as
  5948. // null. It is an error if a field in this list has a non-empty value.
  5949. // This may be used to include null fields in Patch requests.
  5950. NullFields []string `json:"-"`
  5951. }
  5952. func (s *License) MarshalJSON() ([]byte, error) {
  5953. type noMethod License
  5954. raw := noMethod(*s)
  5955. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5956. }
  5957. // MachineType: A Machine Type resource.
  5958. type MachineType struct {
  5959. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  5960. // format.
  5961. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  5962. // Deprecated: [Output Only] The deprecation status associated with this
  5963. // machine type.
  5964. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  5965. // Description: [Output Only] An optional textual description of the
  5966. // resource.
  5967. Description string `json:"description,omitempty"`
  5968. // GuestCpus: [Output Only] The number of virtual CPUs that are
  5969. // available to the instance.
  5970. GuestCpus int64 `json:"guestCpus,omitempty"`
  5971. // Id: [Output Only] The unique identifier for the resource. This
  5972. // identifier is defined by the server.
  5973. Id uint64 `json:"id,omitempty,string"`
  5974. // ImageSpaceGb: [Deprecated] This property is deprecated and will never
  5975. // be populated with any relevant values.
  5976. ImageSpaceGb int64 `json:"imageSpaceGb,omitempty"`
  5977. // IsSharedCpu: [Output Only] Whether this machine type has a shared
  5978. // CPU. See Shared-core machine types for more information.
  5979. IsSharedCpu bool `json:"isSharedCpu,omitempty"`
  5980. // Kind: [Output Only] The type of the resource. Always
  5981. // compute#machineType for machine types.
  5982. Kind string `json:"kind,omitempty"`
  5983. // MaximumPersistentDisks: [Output Only] Maximum persistent disks
  5984. // allowed.
  5985. MaximumPersistentDisks int64 `json:"maximumPersistentDisks,omitempty"`
  5986. // MaximumPersistentDisksSizeGb: [Output Only] Maximum total persistent
  5987. // disks size (GB) allowed.
  5988. MaximumPersistentDisksSizeGb int64 `json:"maximumPersistentDisksSizeGb,omitempty,string"`
  5989. // MemoryMb: [Output Only] The amount of physical memory available to
  5990. // the instance, defined in MB.
  5991. MemoryMb int64 `json:"memoryMb,omitempty"`
  5992. // Name: [Output Only] Name of the resource.
  5993. Name string `json:"name,omitempty"`
  5994. // ScratchDisks: [Output Only] List of extended scratch disks assigned
  5995. // to the instance.
  5996. ScratchDisks []*MachineTypeScratchDisks `json:"scratchDisks,omitempty"`
  5997. // SelfLink: [Output Only] Server-defined URL for the resource.
  5998. SelfLink string `json:"selfLink,omitempty"`
  5999. // Zone: [Output Only] The name of the zone where the machine type
  6000. // resides, such as us-central1-a.
  6001. Zone string `json:"zone,omitempty"`
  6002. // ServerResponse contains the HTTP response code and headers from the
  6003. // server.
  6004. googleapi.ServerResponse `json:"-"`
  6005. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  6006. // to unconditionally include in API requests. By default, fields with
  6007. // empty values are omitted from API requests. However, any non-pointer,
  6008. // non-interface field appearing in ForceSendFields will be sent to the
  6009. // server regardless of whether the field is empty or not. This may be
  6010. // used to include empty fields in Patch requests.
  6011. ForceSendFields []string `json:"-"`
  6012. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  6013. // include in API requests with the JSON null value. By default, fields
  6014. // with empty values are omitted from API requests. However, any field
  6015. // with an empty value appearing in NullFields will be sent to the
  6016. // server as null. It is an error if a field in this list has a
  6017. // non-empty value. This may be used to include null fields in Patch
  6018. // requests.
  6019. NullFields []string `json:"-"`
  6020. }
  6021. func (s *MachineType) MarshalJSON() ([]byte, error) {
  6022. type noMethod MachineType
  6023. raw := noMethod(*s)
  6024. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6025. }
  6026. type MachineTypeScratchDisks struct {
  6027. // DiskGb: Size of the scratch disk, defined in GB.
  6028. DiskGb int64 `json:"diskGb,omitempty"`
  6029. // ForceSendFields is a list of field names (e.g. "DiskGb") to
  6030. // unconditionally include in API requests. By default, fields with
  6031. // empty values are omitted from API requests. However, any non-pointer,
  6032. // non-interface field appearing in ForceSendFields will be sent to the
  6033. // server regardless of whether the field is empty or not. This may be
  6034. // used to include empty fields in Patch requests.
  6035. ForceSendFields []string `json:"-"`
  6036. // NullFields is a list of field names (e.g. "DiskGb") to include in API
  6037. // requests with the JSON null value. By default, fields with empty
  6038. // values are omitted from API requests. However, any field with an
  6039. // empty value appearing in NullFields will be sent to the server as
  6040. // null. It is an error if a field in this list has a non-empty value.
  6041. // This may be used to include null fields in Patch requests.
  6042. NullFields []string `json:"-"`
  6043. }
  6044. func (s *MachineTypeScratchDisks) MarshalJSON() ([]byte, error) {
  6045. type noMethod MachineTypeScratchDisks
  6046. raw := noMethod(*s)
  6047. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6048. }
  6049. type MachineTypeAggregatedList struct {
  6050. // Id: [Output Only] The unique identifier for the resource. This
  6051. // identifier is defined by the server.
  6052. Id string `json:"id,omitempty"`
  6053. // Items: [Output Only] A map of scoped machine type lists.
  6054. Items map[string]MachineTypesScopedList `json:"items,omitempty"`
  6055. // Kind: [Output Only] Type of resource. Always
  6056. // compute#machineTypeAggregatedList for aggregated lists of machine
  6057. // types.
  6058. Kind string `json:"kind,omitempty"`
  6059. // NextPageToken: [Output Only] This token allows you to get the next
  6060. // page of results for list requests. If the number of results is larger
  6061. // than maxResults, use the nextPageToken as a value for the query
  6062. // parameter pageToken in the next list request. Subsequent list
  6063. // requests will have their own nextPageToken to continue paging through
  6064. // the results.
  6065. NextPageToken string `json:"nextPageToken,omitempty"`
  6066. // SelfLink: [Output Only] Server-defined URL for this resource.
  6067. SelfLink string `json:"selfLink,omitempty"`
  6068. // ServerResponse contains the HTTP response code and headers from the
  6069. // server.
  6070. googleapi.ServerResponse `json:"-"`
  6071. // ForceSendFields is a list of field names (e.g. "Id") to
  6072. // unconditionally include in API requests. By default, fields with
  6073. // empty values are omitted from API requests. However, any non-pointer,
  6074. // non-interface field appearing in ForceSendFields will be sent to the
  6075. // server regardless of whether the field is empty or not. This may be
  6076. // used to include empty fields in Patch requests.
  6077. ForceSendFields []string `json:"-"`
  6078. // NullFields is a list of field names (e.g. "Id") to include in API
  6079. // requests with the JSON null value. By default, fields with empty
  6080. // values are omitted from API requests. However, any field with an
  6081. // empty value appearing in NullFields will be sent to the server as
  6082. // null. It is an error if a field in this list has a non-empty value.
  6083. // This may be used to include null fields in Patch requests.
  6084. NullFields []string `json:"-"`
  6085. }
  6086. func (s *MachineTypeAggregatedList) MarshalJSON() ([]byte, error) {
  6087. type noMethod MachineTypeAggregatedList
  6088. raw := noMethod(*s)
  6089. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6090. }
  6091. // MachineTypeList: Contains a list of machine types.
  6092. type MachineTypeList struct {
  6093. // Id: [Output Only] The unique identifier for the resource. This
  6094. // identifier is defined by the server.
  6095. Id string `json:"id,omitempty"`
  6096. // Items: [Output Only] A list of Machine Type resources.
  6097. Items []*MachineType `json:"items,omitempty"`
  6098. // Kind: [Output Only] Type of resource. Always compute#machineTypeList
  6099. // for lists of machine types.
  6100. Kind string `json:"kind,omitempty"`
  6101. // NextPageToken: [Output Only] This token allows you to get the next
  6102. // page of results for list requests. If the number of results is larger
  6103. // than maxResults, use the nextPageToken as a value for the query
  6104. // parameter pageToken in the next list request. Subsequent list
  6105. // requests will have their own nextPageToken to continue paging through
  6106. // the results.
  6107. NextPageToken string `json:"nextPageToken,omitempty"`
  6108. // SelfLink: [Output Only] Server-defined URL for this resource.
  6109. SelfLink string `json:"selfLink,omitempty"`
  6110. // ServerResponse contains the HTTP response code and headers from the
  6111. // server.
  6112. googleapi.ServerResponse `json:"-"`
  6113. // ForceSendFields is a list of field names (e.g. "Id") to
  6114. // unconditionally include in API requests. By default, fields with
  6115. // empty values are omitted from API requests. However, any non-pointer,
  6116. // non-interface field appearing in ForceSendFields will be sent to the
  6117. // server regardless of whether the field is empty or not. This may be
  6118. // used to include empty fields in Patch requests.
  6119. ForceSendFields []string `json:"-"`
  6120. // NullFields is a list of field names (e.g. "Id") to include in API
  6121. // requests with the JSON null value. By default, fields with empty
  6122. // values are omitted from API requests. However, any field with an
  6123. // empty value appearing in NullFields will be sent to the server as
  6124. // null. It is an error if a field in this list has a non-empty value.
  6125. // This may be used to include null fields in Patch requests.
  6126. NullFields []string `json:"-"`
  6127. }
  6128. func (s *MachineTypeList) MarshalJSON() ([]byte, error) {
  6129. type noMethod MachineTypeList
  6130. raw := noMethod(*s)
  6131. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6132. }
  6133. type MachineTypesScopedList struct {
  6134. // MachineTypes: [Output Only] List of machine types contained in this
  6135. // scope.
  6136. MachineTypes []*MachineType `json:"machineTypes,omitempty"`
  6137. // Warning: [Output Only] An informational warning that appears when the
  6138. // machine types list is empty.
  6139. Warning *MachineTypesScopedListWarning `json:"warning,omitempty"`
  6140. // ForceSendFields is a list of field names (e.g. "MachineTypes") to
  6141. // unconditionally include in API requests. By default, fields with
  6142. // empty values are omitted from API requests. However, any non-pointer,
  6143. // non-interface field appearing in ForceSendFields will be sent to the
  6144. // server regardless of whether the field is empty or not. This may be
  6145. // used to include empty fields in Patch requests.
  6146. ForceSendFields []string `json:"-"`
  6147. // NullFields is a list of field names (e.g. "MachineTypes") to include
  6148. // in API requests with the JSON null value. By default, fields with
  6149. // empty values are omitted from API requests. However, any field with
  6150. // an empty value appearing in NullFields will be sent to the server as
  6151. // null. It is an error if a field in this list has a non-empty value.
  6152. // This may be used to include null fields in Patch requests.
  6153. NullFields []string `json:"-"`
  6154. }
  6155. func (s *MachineTypesScopedList) MarshalJSON() ([]byte, error) {
  6156. type noMethod MachineTypesScopedList
  6157. raw := noMethod(*s)
  6158. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6159. }
  6160. // MachineTypesScopedListWarning: [Output Only] An informational warning
  6161. // that appears when the machine types list is empty.
  6162. type MachineTypesScopedListWarning struct {
  6163. // Code: [Output Only] A warning code, if applicable. For example,
  6164. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6165. // the response.
  6166. //
  6167. // Possible values:
  6168. // "CLEANUP_FAILED"
  6169. // "DEPRECATED_RESOURCE_USED"
  6170. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6171. // "FIELD_VALUE_OVERRIDEN"
  6172. // "INJECTED_KERNELS_DEPRECATED"
  6173. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6174. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6175. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6176. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6177. // "NEXT_HOP_NOT_RUNNING"
  6178. // "NOT_CRITICAL_ERROR"
  6179. // "NO_RESULTS_ON_PAGE"
  6180. // "REQUIRED_TOS_AGREEMENT"
  6181. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  6182. // "RESOURCE_NOT_DELETED"
  6183. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6184. // "UNREACHABLE"
  6185. Code string `json:"code,omitempty"`
  6186. // Data: [Output Only] Metadata about this warning in key: value format.
  6187. // For example:
  6188. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6189. Data []*MachineTypesScopedListWarningData `json:"data,omitempty"`
  6190. // Message: [Output Only] A human-readable description of the warning
  6191. // code.
  6192. Message string `json:"message,omitempty"`
  6193. // ForceSendFields is a list of field names (e.g. "Code") to
  6194. // unconditionally include in API requests. By default, fields with
  6195. // empty values are omitted from API requests. However, any non-pointer,
  6196. // non-interface field appearing in ForceSendFields will be sent to the
  6197. // server regardless of whether the field is empty or not. This may be
  6198. // used to include empty fields in Patch requests.
  6199. ForceSendFields []string `json:"-"`
  6200. // NullFields is a list of field names (e.g. "Code") to include in API
  6201. // requests with the JSON null value. By default, fields with empty
  6202. // values are omitted from API requests. However, any field with an
  6203. // empty value appearing in NullFields will be sent to the server as
  6204. // null. It is an error if a field in this list has a non-empty value.
  6205. // This may be used to include null fields in Patch requests.
  6206. NullFields []string `json:"-"`
  6207. }
  6208. func (s *MachineTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  6209. type noMethod MachineTypesScopedListWarning
  6210. raw := noMethod(*s)
  6211. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6212. }
  6213. type MachineTypesScopedListWarningData struct {
  6214. // Key: [Output Only] A key that provides more detail on the warning
  6215. // being returned. For example, for warnings where there are no results
  6216. // in a list request for a particular zone, this key might be scope and
  6217. // the key value might be the zone name. Other examples might be a key
  6218. // indicating a deprecated resource and a suggested replacement, or a
  6219. // warning about invalid network settings (for example, if an instance
  6220. // attempts to perform IP forwarding but is not enabled for IP
  6221. // forwarding).
  6222. Key string `json:"key,omitempty"`
  6223. // Value: [Output Only] A warning data value corresponding to the key.
  6224. Value string `json:"value,omitempty"`
  6225. // ForceSendFields is a list of field names (e.g. "Key") to
  6226. // unconditionally include in API requests. By default, fields with
  6227. // empty values are omitted from API requests. However, any non-pointer,
  6228. // non-interface field appearing in ForceSendFields will be sent to the
  6229. // server regardless of whether the field is empty or not. This may be
  6230. // used to include empty fields in Patch requests.
  6231. ForceSendFields []string `json:"-"`
  6232. // NullFields is a list of field names (e.g. "Key") to include in API
  6233. // requests with the JSON null value. By default, fields with empty
  6234. // values are omitted from API requests. However, any field with an
  6235. // empty value appearing in NullFields will be sent to the server as
  6236. // null. It is an error if a field in this list has a non-empty value.
  6237. // This may be used to include null fields in Patch requests.
  6238. NullFields []string `json:"-"`
  6239. }
  6240. func (s *MachineTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  6241. type noMethod MachineTypesScopedListWarningData
  6242. raw := noMethod(*s)
  6243. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6244. }
  6245. type ManagedInstance struct {
  6246. // CurrentAction: [Output Only] The current action that the managed
  6247. // instance group has scheduled for the instance. Possible values:
  6248. // - NONE The instance is running, and the managed instance group does
  6249. // not have any scheduled actions for this instance.
  6250. // - CREATING The managed instance group is creating this instance. If
  6251. // the group fails to create this instance, it will try again until it
  6252. // is successful.
  6253. // - CREATING_WITHOUT_RETRIES The managed instance group is attempting
  6254. // to create this instance only once. If the group fails to create this
  6255. // instance, it does not try again and the group's targetSize value is
  6256. // decreased instead.
  6257. // - RECREATING The managed instance group is recreating this instance.
  6258. //
  6259. // - DELETING The managed instance group is permanently deleting this
  6260. // instance.
  6261. // - ABANDONING The managed instance group is abandoning this instance.
  6262. // The instance will be removed from the instance group and from any
  6263. // target pools that are associated with this group.
  6264. // - RESTARTING The managed instance group is restarting the instance.
  6265. //
  6266. // - REFRESHING The managed instance group is applying configuration
  6267. // changes to the instance without stopping it. For example, the group
  6268. // can update the target pool list for an instance without stopping that
  6269. // instance.
  6270. //
  6271. // Possible values:
  6272. // "ABANDONING"
  6273. // "CREATING"
  6274. // "CREATING_WITHOUT_RETRIES"
  6275. // "DELETING"
  6276. // "NONE"
  6277. // "RECREATING"
  6278. // "REFRESHING"
  6279. // "RESTARTING"
  6280. CurrentAction string `json:"currentAction,omitempty"`
  6281. // Id: [Output only] The unique identifier for this resource. This field
  6282. // is empty when instance does not exist.
  6283. Id uint64 `json:"id,omitempty,string"`
  6284. // Instance: [Output Only] The URL of the instance. The URL can exist
  6285. // even if the instance has not yet been created.
  6286. Instance string `json:"instance,omitempty"`
  6287. // InstanceStatus: [Output Only] The status of the instance. This field
  6288. // is empty when the instance does not exist.
  6289. //
  6290. // Possible values:
  6291. // "PROVISIONING"
  6292. // "RUNNING"
  6293. // "STAGING"
  6294. // "STOPPED"
  6295. // "STOPPING"
  6296. // "SUSPENDED"
  6297. // "SUSPENDING"
  6298. // "TERMINATED"
  6299. InstanceStatus string `json:"instanceStatus,omitempty"`
  6300. // LastAttempt: [Output Only] Information about the last attempt to
  6301. // create or delete the instance.
  6302. LastAttempt *ManagedInstanceLastAttempt `json:"lastAttempt,omitempty"`
  6303. // ForceSendFields is a list of field names (e.g. "CurrentAction") to
  6304. // unconditionally include in API requests. By default, fields with
  6305. // empty values are omitted from API requests. However, any non-pointer,
  6306. // non-interface field appearing in ForceSendFields will be sent to the
  6307. // server regardless of whether the field is empty or not. This may be
  6308. // used to include empty fields in Patch requests.
  6309. ForceSendFields []string `json:"-"`
  6310. // NullFields is a list of field names (e.g. "CurrentAction") to include
  6311. // in API requests with the JSON null value. By default, fields with
  6312. // empty values are omitted from API requests. However, any field with
  6313. // an empty value appearing in NullFields will be sent to the server as
  6314. // null. It is an error if a field in this list has a non-empty value.
  6315. // This may be used to include null fields in Patch requests.
  6316. NullFields []string `json:"-"`
  6317. }
  6318. func (s *ManagedInstance) MarshalJSON() ([]byte, error) {
  6319. type noMethod ManagedInstance
  6320. raw := noMethod(*s)
  6321. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6322. }
  6323. type ManagedInstanceLastAttempt struct {
  6324. // Errors: [Output Only] Encountered errors during the last attempt to
  6325. // create or delete the instance.
  6326. Errors *ManagedInstanceLastAttemptErrors `json:"errors,omitempty"`
  6327. // ForceSendFields is a list of field names (e.g. "Errors") to
  6328. // unconditionally include in API requests. By default, fields with
  6329. // empty values are omitted from API requests. However, any non-pointer,
  6330. // non-interface field appearing in ForceSendFields will be sent to the
  6331. // server regardless of whether the field is empty or not. This may be
  6332. // used to include empty fields in Patch requests.
  6333. ForceSendFields []string `json:"-"`
  6334. // NullFields is a list of field names (e.g. "Errors") to include in API
  6335. // requests with the JSON null value. By default, fields with empty
  6336. // values are omitted from API requests. However, any field with an
  6337. // empty value appearing in NullFields will be sent to the server as
  6338. // null. It is an error if a field in this list has a non-empty value.
  6339. // This may be used to include null fields in Patch requests.
  6340. NullFields []string `json:"-"`
  6341. }
  6342. func (s *ManagedInstanceLastAttempt) MarshalJSON() ([]byte, error) {
  6343. type noMethod ManagedInstanceLastAttempt
  6344. raw := noMethod(*s)
  6345. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6346. }
  6347. // ManagedInstanceLastAttemptErrors: [Output Only] Encountered errors
  6348. // during the last attempt to create or delete the instance.
  6349. type ManagedInstanceLastAttemptErrors struct {
  6350. // Errors: [Output Only] The array of errors encountered while
  6351. // processing this operation.
  6352. Errors []*ManagedInstanceLastAttemptErrorsErrors `json:"errors,omitempty"`
  6353. // ForceSendFields is a list of field names (e.g. "Errors") to
  6354. // unconditionally include in API requests. By default, fields with
  6355. // empty values are omitted from API requests. However, any non-pointer,
  6356. // non-interface field appearing in ForceSendFields will be sent to the
  6357. // server regardless of whether the field is empty or not. This may be
  6358. // used to include empty fields in Patch requests.
  6359. ForceSendFields []string `json:"-"`
  6360. // NullFields is a list of field names (e.g. "Errors") to include in API
  6361. // requests with the JSON null value. By default, fields with empty
  6362. // values are omitted from API requests. However, any field with an
  6363. // empty value appearing in NullFields will be sent to the server as
  6364. // null. It is an error if a field in this list has a non-empty value.
  6365. // This may be used to include null fields in Patch requests.
  6366. NullFields []string `json:"-"`
  6367. }
  6368. func (s *ManagedInstanceLastAttemptErrors) MarshalJSON() ([]byte, error) {
  6369. type noMethod ManagedInstanceLastAttemptErrors
  6370. raw := noMethod(*s)
  6371. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6372. }
  6373. type ManagedInstanceLastAttemptErrorsErrors struct {
  6374. // Code: [Output Only] The error type identifier for this error.
  6375. Code string `json:"code,omitempty"`
  6376. // Location: [Output Only] Indicates the field in the request that
  6377. // caused the error. This property is optional.
  6378. Location string `json:"location,omitempty"`
  6379. // Message: [Output Only] An optional, human-readable error message.
  6380. Message string `json:"message,omitempty"`
  6381. // ForceSendFields is a list of field names (e.g. "Code") to
  6382. // unconditionally include in API requests. By default, fields with
  6383. // empty values are omitted from API requests. However, any non-pointer,
  6384. // non-interface field appearing in ForceSendFields will be sent to the
  6385. // server regardless of whether the field is empty or not. This may be
  6386. // used to include empty fields in Patch requests.
  6387. ForceSendFields []string `json:"-"`
  6388. // NullFields is a list of field names (e.g. "Code") to include in API
  6389. // requests with the JSON null value. By default, fields with empty
  6390. // values are omitted from API requests. However, any field with an
  6391. // empty value appearing in NullFields will be sent to the server as
  6392. // null. It is an error if a field in this list has a non-empty value.
  6393. // This may be used to include null fields in Patch requests.
  6394. NullFields []string `json:"-"`
  6395. }
  6396. func (s *ManagedInstanceLastAttemptErrorsErrors) MarshalJSON() ([]byte, error) {
  6397. type noMethod ManagedInstanceLastAttemptErrorsErrors
  6398. raw := noMethod(*s)
  6399. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6400. }
  6401. // Metadata: A metadata key/value entry.
  6402. type Metadata struct {
  6403. // Fingerprint: Specifies a fingerprint for this request, which is
  6404. // essentially a hash of the metadata's contents and used for optimistic
  6405. // locking. The fingerprint is initially generated by Compute Engine and
  6406. // changes after every request to modify or update metadata. You must
  6407. // always provide an up-to-date fingerprint hash in order to update or
  6408. // change metadata.
  6409. Fingerprint string `json:"fingerprint,omitempty"`
  6410. // Items: Array of key/value pairs. The total size of all keys and
  6411. // values must be less than 512 KB.
  6412. Items []*MetadataItems `json:"items,omitempty"`
  6413. // Kind: [Output Only] Type of the resource. Always compute#metadata for
  6414. // metadata.
  6415. Kind string `json:"kind,omitempty"`
  6416. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  6417. // unconditionally include in API requests. By default, fields with
  6418. // empty values are omitted from API requests. However, any non-pointer,
  6419. // non-interface field appearing in ForceSendFields will be sent to the
  6420. // server regardless of whether the field is empty or not. This may be
  6421. // used to include empty fields in Patch requests.
  6422. ForceSendFields []string `json:"-"`
  6423. // NullFields is a list of field names (e.g. "Fingerprint") to include
  6424. // in API requests with the JSON null value. By default, fields with
  6425. // empty values are omitted from API requests. However, any field with
  6426. // an empty value appearing in NullFields will be sent to the server as
  6427. // null. It is an error if a field in this list has a non-empty value.
  6428. // This may be used to include null fields in Patch requests.
  6429. NullFields []string `json:"-"`
  6430. }
  6431. func (s *Metadata) MarshalJSON() ([]byte, error) {
  6432. type noMethod Metadata
  6433. raw := noMethod(*s)
  6434. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6435. }
  6436. type MetadataItems struct {
  6437. // Key: Key for the metadata entry. Keys must conform to the following
  6438. // regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is
  6439. // reflected as part of a URL in the metadata server. Additionally, to
  6440. // avoid ambiguity, keys must not conflict with any other metadata keys
  6441. // for the project.
  6442. Key string `json:"key,omitempty"`
  6443. // Value: Value for the metadata entry. These are free-form strings, and
  6444. // only have meaning as interpreted by the image running in the
  6445. // instance. The only restriction placed on values is that their size
  6446. // must be less than or equal to 32768 bytes.
  6447. Value *string `json:"value,omitempty"`
  6448. // ForceSendFields is a list of field names (e.g. "Key") to
  6449. // unconditionally include in API requests. By default, fields with
  6450. // empty values are omitted from API requests. However, any non-pointer,
  6451. // non-interface field appearing in ForceSendFields will be sent to the
  6452. // server regardless of whether the field is empty or not. This may be
  6453. // used to include empty fields in Patch requests.
  6454. ForceSendFields []string `json:"-"`
  6455. // NullFields is a list of field names (e.g. "Key") to include in API
  6456. // requests with the JSON null value. By default, fields with empty
  6457. // values are omitted from API requests. However, any field with an
  6458. // empty value appearing in NullFields will be sent to the server as
  6459. // null. It is an error if a field in this list has a non-empty value.
  6460. // This may be used to include null fields in Patch requests.
  6461. NullFields []string `json:"-"`
  6462. }
  6463. func (s *MetadataItems) MarshalJSON() ([]byte, error) {
  6464. type noMethod MetadataItems
  6465. raw := noMethod(*s)
  6466. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6467. }
  6468. // NamedPort: The named port. For example: .
  6469. type NamedPort struct {
  6470. // Name: The name for this named port. The name must be 1-63 characters
  6471. // long, and comply with RFC1035.
  6472. Name string `json:"name,omitempty"`
  6473. // Port: The port number, which can be a value between 1 and 65535.
  6474. Port int64 `json:"port,omitempty"`
  6475. // ForceSendFields is a list of field names (e.g. "Name") to
  6476. // unconditionally include in API requests. By default, fields with
  6477. // empty values are omitted from API requests. However, any non-pointer,
  6478. // non-interface field appearing in ForceSendFields will be sent to the
  6479. // server regardless of whether the field is empty or not. This may be
  6480. // used to include empty fields in Patch requests.
  6481. ForceSendFields []string `json:"-"`
  6482. // NullFields is a list of field names (e.g. "Name") to include in API
  6483. // requests with the JSON null value. By default, fields with empty
  6484. // values are omitted from API requests. However, any field with an
  6485. // empty value appearing in NullFields will be sent to the server as
  6486. // null. It is an error if a field in this list has a non-empty value.
  6487. // This may be used to include null fields in Patch requests.
  6488. NullFields []string `json:"-"`
  6489. }
  6490. func (s *NamedPort) MarshalJSON() ([]byte, error) {
  6491. type noMethod NamedPort
  6492. raw := noMethod(*s)
  6493. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6494. }
  6495. // Network: Represents a Network resource. Read Networks and Firewalls
  6496. // for more information.
  6497. type Network struct {
  6498. // IPv4Range: The range of internal addresses that are legal on this
  6499. // network. This range is a CIDR specification, for example:
  6500. // 192.168.0.0/16. Provided by the client when the network is created.
  6501. IPv4Range string `json:"IPv4Range,omitempty"`
  6502. // AutoCreateSubnetworks: When set to true, the network is created in
  6503. // "auto subnet mode". When set to false, the network is in "custom
  6504. // subnet mode".
  6505. //
  6506. // In "auto subnet mode", a newly created network is assigned the
  6507. // default CIDR of 10.128.0.0/9 and it automatically creates one
  6508. // subnetwork per region.
  6509. AutoCreateSubnetworks bool `json:"autoCreateSubnetworks,omitempty"`
  6510. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  6511. // format.
  6512. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  6513. // Description: An optional description of this resource. Provide this
  6514. // property when you create the resource.
  6515. Description string `json:"description,omitempty"`
  6516. // GatewayIPv4: A gateway address for default routing to other networks.
  6517. // This value is read only and is selected by the Google Compute Engine,
  6518. // typically as the first usable address in the IPv4Range.
  6519. GatewayIPv4 string `json:"gatewayIPv4,omitempty"`
  6520. // Id: [Output Only] The unique identifier for the resource. This
  6521. // identifier is defined by the server.
  6522. Id uint64 `json:"id,omitempty,string"`
  6523. // Kind: [Output Only] Type of the resource. Always compute#network for
  6524. // networks.
  6525. Kind string `json:"kind,omitempty"`
  6526. // Name: Name of the resource. Provided by the client when the resource
  6527. // is created. The name must be 1-63 characters long, and comply with
  6528. // RFC1035. Specifically, the name must be 1-63 characters long and
  6529. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  6530. // the first character must be a lowercase letter, and all following
  6531. // characters must be a dash, lowercase letter, or digit, except the
  6532. // last character, which cannot be a dash.
  6533. Name string `json:"name,omitempty"`
  6534. // Peerings: [Output Only] List of network peerings for the resource.
  6535. Peerings []*NetworkPeering `json:"peerings,omitempty"`
  6536. // SelfLink: [Output Only] Server-defined URL for the resource.
  6537. SelfLink string `json:"selfLink,omitempty"`
  6538. // Subnetworks: [Output Only] Server-defined fully-qualified URLs for
  6539. // all subnetworks in this network.
  6540. Subnetworks []string `json:"subnetworks,omitempty"`
  6541. // ServerResponse contains the HTTP response code and headers from the
  6542. // server.
  6543. googleapi.ServerResponse `json:"-"`
  6544. // ForceSendFields is a list of field names (e.g. "IPv4Range") to
  6545. // unconditionally include in API requests. By default, fields with
  6546. // empty values are omitted from API requests. However, any non-pointer,
  6547. // non-interface field appearing in ForceSendFields will be sent to the
  6548. // server regardless of whether the field is empty or not. This may be
  6549. // used to include empty fields in Patch requests.
  6550. ForceSendFields []string `json:"-"`
  6551. // NullFields is a list of field names (e.g. "IPv4Range") to include in
  6552. // API requests with the JSON null value. By default, fields with empty
  6553. // values are omitted from API requests. However, any field with an
  6554. // empty value appearing in NullFields will be sent to the server as
  6555. // null. It is an error if a field in this list has a non-empty value.
  6556. // This may be used to include null fields in Patch requests.
  6557. NullFields []string `json:"-"`
  6558. }
  6559. func (s *Network) MarshalJSON() ([]byte, error) {
  6560. type noMethod Network
  6561. raw := noMethod(*s)
  6562. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6563. }
  6564. // NetworkInterface: A network interface resource attached to an
  6565. // instance.
  6566. type NetworkInterface struct {
  6567. // AccessConfigs: An array of configurations for this interface.
  6568. // Currently, only one access config, ONE_TO_ONE_NAT, is supported. If
  6569. // there are no accessConfigs specified, then this instance will have no
  6570. // external internet access.
  6571. AccessConfigs []*AccessConfig `json:"accessConfigs,omitempty"`
  6572. // Kind: [Output Only] Type of the resource. Always
  6573. // compute#networkInterface for network interfaces.
  6574. Kind string `json:"kind,omitempty"`
  6575. // Name: [Output Only] The name of the network interface, generated by
  6576. // the server. For network devices, these are eth0, eth1, etc.
  6577. Name string `json:"name,omitempty"`
  6578. // Network: URL of the network resource for this instance. When creating
  6579. // an instance, if neither the network nor the subnetwork is specified,
  6580. // the default network global/networks/default is used; if the network
  6581. // is not specified but the subnetwork is specified, the network is
  6582. // inferred.
  6583. //
  6584. // This field is optional when creating a firewall rule. If not
  6585. // specified when creating a firewall rule, the default network
  6586. // global/networks/default is used.
  6587. //
  6588. // If you specify this property, you can specify the network as a full
  6589. // or partial URL. For example, the following are all valid URLs:
  6590. // -
  6591. // https://www.googleapis.com/compute/v1/projects/project/global/networks/network
  6592. // - projects/project/global/networks/network
  6593. // - global/networks/default
  6594. Network string `json:"network,omitempty"`
  6595. // NetworkIP: An IPv4 internal network address to assign to the instance
  6596. // for this network interface. If not specified by the user, an unused
  6597. // internal IP is assigned by the system.
  6598. NetworkIP string `json:"networkIP,omitempty"`
  6599. // Subnetwork: The URL of the Subnetwork resource for this instance. If
  6600. // the network resource is in legacy mode, do not provide this property.
  6601. // If the network is in auto subnet mode, providing the subnetwork is
  6602. // optional. If the network is in custom subnet mode, then this field
  6603. // should be specified. If you specify this property, you can specify
  6604. // the subnetwork as a full or partial URL. For example, the following
  6605. // are all valid URLs:
  6606. // -
  6607. // https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork
  6608. // - regions/region/subnetworks/subnetwork
  6609. Subnetwork string `json:"subnetwork,omitempty"`
  6610. // ForceSendFields is a list of field names (e.g. "AccessConfigs") to
  6611. // unconditionally include in API requests. By default, fields with
  6612. // empty values are omitted from API requests. However, any non-pointer,
  6613. // non-interface field appearing in ForceSendFields will be sent to the
  6614. // server regardless of whether the field is empty or not. This may be
  6615. // used to include empty fields in Patch requests.
  6616. ForceSendFields []string `json:"-"`
  6617. // NullFields is a list of field names (e.g. "AccessConfigs") to include
  6618. // in API requests with the JSON null value. By default, fields with
  6619. // empty values are omitted from API requests. However, any field with
  6620. // an empty value appearing in NullFields will be sent to the server as
  6621. // null. It is an error if a field in this list has a non-empty value.
  6622. // This may be used to include null fields in Patch requests.
  6623. NullFields []string `json:"-"`
  6624. }
  6625. func (s *NetworkInterface) MarshalJSON() ([]byte, error) {
  6626. type noMethod NetworkInterface
  6627. raw := noMethod(*s)
  6628. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6629. }
  6630. // NetworkList: Contains a list of networks.
  6631. type NetworkList struct {
  6632. // Id: [Output Only] The unique identifier for the resource. This
  6633. // identifier is defined by the server.
  6634. Id string `json:"id,omitempty"`
  6635. // Items: [Output Only] A list of Network resources.
  6636. Items []*Network `json:"items,omitempty"`
  6637. // Kind: [Output Only] Type of resource. Always compute#networkList for
  6638. // lists of networks.
  6639. Kind string `json:"kind,omitempty"`
  6640. // NextPageToken: [Output Only] This token allows you to get the next
  6641. // page of results for list requests. If the number of results is larger
  6642. // than maxResults, use the nextPageToken as a value for the query
  6643. // parameter pageToken in the next list request. Subsequent list
  6644. // requests will have their own nextPageToken to continue paging through
  6645. // the results.
  6646. NextPageToken string `json:"nextPageToken,omitempty"`
  6647. // SelfLink: [Output Only] Server-defined URL for this resource.
  6648. SelfLink string `json:"selfLink,omitempty"`
  6649. // ServerResponse contains the HTTP response code and headers from the
  6650. // server.
  6651. googleapi.ServerResponse `json:"-"`
  6652. // ForceSendFields is a list of field names (e.g. "Id") to
  6653. // unconditionally include in API requests. By default, fields with
  6654. // empty values are omitted from API requests. However, any non-pointer,
  6655. // non-interface field appearing in ForceSendFields will be sent to the
  6656. // server regardless of whether the field is empty or not. This may be
  6657. // used to include empty fields in Patch requests.
  6658. ForceSendFields []string `json:"-"`
  6659. // NullFields is a list of field names (e.g. "Id") to include in API
  6660. // requests with the JSON null value. By default, fields with empty
  6661. // values are omitted from API requests. However, any field with an
  6662. // empty value appearing in NullFields will be sent to the server as
  6663. // null. It is an error if a field in this list has a non-empty value.
  6664. // This may be used to include null fields in Patch requests.
  6665. NullFields []string `json:"-"`
  6666. }
  6667. func (s *NetworkList) MarshalJSON() ([]byte, error) {
  6668. type noMethod NetworkList
  6669. raw := noMethod(*s)
  6670. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6671. }
  6672. // NetworkPeering: A network peering attached to a network resource. The
  6673. // message includes the peering name, peer network, peering state, and a
  6674. // flag indicating whether Google Compute Engine should automatically
  6675. // create routes for the peering.
  6676. type NetworkPeering struct {
  6677. // AutoCreateRoutes: Whether full mesh connectivity is created and
  6678. // managed automatically. When it is set to true, Google Compute Engine
  6679. // will automatically create and manage the routes between two networks
  6680. // when the state is ACTIVE. Otherwise, user needs to create routes
  6681. // manually to route packets to peer network.
  6682. AutoCreateRoutes bool `json:"autoCreateRoutes,omitempty"`
  6683. // Name: Name of this peering. Provided by the client when the peering
  6684. // is created. The name must comply with RFC1035. Specifically, the name
  6685. // must be 1-63 characters long and match regular expression
  6686. // [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a
  6687. // lowercase letter, and all the following characters must be a dash,
  6688. // lowercase letter, or digit, except the last character, which cannot
  6689. // be a dash.
  6690. Name string `json:"name,omitempty"`
  6691. // Network: The URL of the peer network. It can be either full URL or
  6692. // partial URL. The peer network may belong to a different project. If
  6693. // the partial URL does not contain project, it is assumed that the peer
  6694. // network is in the same project as the current network.
  6695. Network string `json:"network,omitempty"`
  6696. // State: [Output Only] State for the peering.
  6697. //
  6698. // Possible values:
  6699. // "ACTIVE"
  6700. // "INACTIVE"
  6701. State string `json:"state,omitempty"`
  6702. // StateDetails: [Output Only] Details about the current state of the
  6703. // peering.
  6704. StateDetails string `json:"stateDetails,omitempty"`
  6705. // ForceSendFields is a list of field names (e.g. "AutoCreateRoutes") to
  6706. // unconditionally include in API requests. By default, fields with
  6707. // empty values are omitted from API requests. However, any non-pointer,
  6708. // non-interface field appearing in ForceSendFields will be sent to the
  6709. // server regardless of whether the field is empty or not. This may be
  6710. // used to include empty fields in Patch requests.
  6711. ForceSendFields []string `json:"-"`
  6712. // NullFields is a list of field names (e.g. "AutoCreateRoutes") to
  6713. // include in API requests with the JSON null value. By default, fields
  6714. // with empty values are omitted from API requests. However, any field
  6715. // with an empty value appearing in NullFields will be sent to the
  6716. // server as null. It is an error if a field in this list has a
  6717. // non-empty value. This may be used to include null fields in Patch
  6718. // requests.
  6719. NullFields []string `json:"-"`
  6720. }
  6721. func (s *NetworkPeering) MarshalJSON() ([]byte, error) {
  6722. type noMethod NetworkPeering
  6723. raw := noMethod(*s)
  6724. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6725. }
  6726. type NetworksAddPeeringRequest struct {
  6727. // AutoCreateRoutes: Whether Google Compute Engine manages the routes
  6728. // automatically.
  6729. AutoCreateRoutes bool `json:"autoCreateRoutes,omitempty"`
  6730. // Name: Name of the peering, which should conform to RFC1035.
  6731. Name string `json:"name,omitempty"`
  6732. // PeerNetwork: URL of the peer network. It can be either full URL or
  6733. // partial URL. The peer network may belong to a different project. If
  6734. // the partial URL does not contain project, it is assumed that the peer
  6735. // network is in the same project as the current network.
  6736. PeerNetwork string `json:"peerNetwork,omitempty"`
  6737. // ForceSendFields is a list of field names (e.g. "AutoCreateRoutes") to
  6738. // unconditionally include in API requests. By default, fields with
  6739. // empty values are omitted from API requests. However, any non-pointer,
  6740. // non-interface field appearing in ForceSendFields will be sent to the
  6741. // server regardless of whether the field is empty or not. This may be
  6742. // used to include empty fields in Patch requests.
  6743. ForceSendFields []string `json:"-"`
  6744. // NullFields is a list of field names (e.g. "AutoCreateRoutes") to
  6745. // include in API requests with the JSON null value. By default, fields
  6746. // with empty values are omitted from API requests. However, any field
  6747. // with an empty value appearing in NullFields will be sent to the
  6748. // server as null. It is an error if a field in this list has a
  6749. // non-empty value. This may be used to include null fields in Patch
  6750. // requests.
  6751. NullFields []string `json:"-"`
  6752. }
  6753. func (s *NetworksAddPeeringRequest) MarshalJSON() ([]byte, error) {
  6754. type noMethod NetworksAddPeeringRequest
  6755. raw := noMethod(*s)
  6756. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6757. }
  6758. type NetworksRemovePeeringRequest struct {
  6759. // Name: Name of the peering, which should conform to RFC1035.
  6760. Name string `json:"name,omitempty"`
  6761. // ForceSendFields is a list of field names (e.g. "Name") to
  6762. // unconditionally include in API requests. By default, fields with
  6763. // empty values are omitted from API requests. However, any non-pointer,
  6764. // non-interface field appearing in ForceSendFields will be sent to the
  6765. // server regardless of whether the field is empty or not. This may be
  6766. // used to include empty fields in Patch requests.
  6767. ForceSendFields []string `json:"-"`
  6768. // NullFields is a list of field names (e.g. "Name") to include in API
  6769. // requests with the JSON null value. By default, fields with empty
  6770. // values are omitted from API requests. However, any field with an
  6771. // empty value appearing in NullFields will be sent to the server as
  6772. // null. It is an error if a field in this list has a non-empty value.
  6773. // This may be used to include null fields in Patch requests.
  6774. NullFields []string `json:"-"`
  6775. }
  6776. func (s *NetworksRemovePeeringRequest) MarshalJSON() ([]byte, error) {
  6777. type noMethod NetworksRemovePeeringRequest
  6778. raw := noMethod(*s)
  6779. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6780. }
  6781. // Operation: An Operation resource, used to manage asynchronous API
  6782. // requests.
  6783. type Operation struct {
  6784. // ClientOperationId: [Output Only] Reserved for future use.
  6785. ClientOperationId string `json:"clientOperationId,omitempty"`
  6786. // CreationTimestamp: [Deprecated] This field is deprecated.
  6787. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  6788. // Description: [Output Only] A textual description of the operation,
  6789. // which is set when the operation is created.
  6790. Description string `json:"description,omitempty"`
  6791. // EndTime: [Output Only] The time that this operation was completed.
  6792. // This value is in RFC3339 text format.
  6793. EndTime string `json:"endTime,omitempty"`
  6794. // Error: [Output Only] If errors are generated during processing of the
  6795. // operation, this field will be populated.
  6796. Error *OperationError `json:"error,omitempty"`
  6797. // HttpErrorMessage: [Output Only] If the operation fails, this field
  6798. // contains the HTTP error message that was returned, such as NOT FOUND.
  6799. HttpErrorMessage string `json:"httpErrorMessage,omitempty"`
  6800. // HttpErrorStatusCode: [Output Only] If the operation fails, this field
  6801. // contains the HTTP error status code that was returned. For example, a
  6802. // 404 means the resource was not found.
  6803. HttpErrorStatusCode int64 `json:"httpErrorStatusCode,omitempty"`
  6804. // Id: [Output Only] The unique identifier for the resource. This
  6805. // identifier is defined by the server.
  6806. Id uint64 `json:"id,omitempty,string"`
  6807. // InsertTime: [Output Only] The time that this operation was requested.
  6808. // This value is in RFC3339 text format.
  6809. InsertTime string `json:"insertTime,omitempty"`
  6810. // Kind: [Output Only] Type of the resource. Always compute#operation
  6811. // for Operation resources.
  6812. Kind string `json:"kind,omitempty"`
  6813. // Name: [Output Only] Name of the resource.
  6814. Name string `json:"name,omitempty"`
  6815. // OperationType: [Output Only] The type of operation, such as insert,
  6816. // update, or delete, and so on.
  6817. OperationType string `json:"operationType,omitempty"`
  6818. // Progress: [Output Only] An optional progress indicator that ranges
  6819. // from 0 to 100. There is no requirement that this be linear or support
  6820. // any granularity of operations. This should not be used to guess when
  6821. // the operation will be complete. This number should monotonically
  6822. // increase as the operation progresses.
  6823. Progress int64 `json:"progress,omitempty"`
  6824. // Region: [Output Only] The URL of the region where the operation
  6825. // resides. Only available when performing regional operations.
  6826. Region string `json:"region,omitempty"`
  6827. // SelfLink: [Output Only] Server-defined URL for the resource.
  6828. SelfLink string `json:"selfLink,omitempty"`
  6829. // StartTime: [Output Only] The time that this operation was started by
  6830. // the server. This value is in RFC3339 text format.
  6831. StartTime string `json:"startTime,omitempty"`
  6832. // Status: [Output Only] The status of the operation, which can be one
  6833. // of the following: PENDING, RUNNING, or DONE.
  6834. //
  6835. // Possible values:
  6836. // "DONE"
  6837. // "PENDING"
  6838. // "RUNNING"
  6839. Status string `json:"status,omitempty"`
  6840. // StatusMessage: [Output Only] An optional textual description of the
  6841. // current status of the operation.
  6842. StatusMessage string `json:"statusMessage,omitempty"`
  6843. // TargetId: [Output Only] The unique target ID, which identifies a
  6844. // specific incarnation of the target resource.
  6845. TargetId uint64 `json:"targetId,omitempty,string"`
  6846. // TargetLink: [Output Only] The URL of the resource that the operation
  6847. // modifies. For operations related to creating a snapshot, this points
  6848. // to the persistent disk that the snapshot was created from.
  6849. TargetLink string `json:"targetLink,omitempty"`
  6850. // User: [Output Only] User who requested the operation, for example:
  6851. // user@example.com.
  6852. User string `json:"user,omitempty"`
  6853. // Warnings: [Output Only] If warning messages are generated during
  6854. // processing of the operation, this field will be populated.
  6855. Warnings []*OperationWarnings `json:"warnings,omitempty"`
  6856. // Zone: [Output Only] The URL of the zone where the operation resides.
  6857. // Only available when performing per-zone operations.
  6858. Zone string `json:"zone,omitempty"`
  6859. // ServerResponse contains the HTTP response code and headers from the
  6860. // server.
  6861. googleapi.ServerResponse `json:"-"`
  6862. // ForceSendFields is a list of field names (e.g. "ClientOperationId")
  6863. // to unconditionally include in API requests. By default, fields with
  6864. // empty values are omitted from API requests. However, any non-pointer,
  6865. // non-interface field appearing in ForceSendFields will be sent to the
  6866. // server regardless of whether the field is empty or not. This may be
  6867. // used to include empty fields in Patch requests.
  6868. ForceSendFields []string `json:"-"`
  6869. // NullFields is a list of field names (e.g. "ClientOperationId") to
  6870. // include in API requests with the JSON null value. By default, fields
  6871. // with empty values are omitted from API requests. However, any field
  6872. // with an empty value appearing in NullFields will be sent to the
  6873. // server as null. It is an error if a field in this list has a
  6874. // non-empty value. This may be used to include null fields in Patch
  6875. // requests.
  6876. NullFields []string `json:"-"`
  6877. }
  6878. func (s *Operation) MarshalJSON() ([]byte, error) {
  6879. type noMethod Operation
  6880. raw := noMethod(*s)
  6881. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6882. }
  6883. // OperationError: [Output Only] If errors are generated during
  6884. // processing of the operation, this field will be populated.
  6885. type OperationError struct {
  6886. // Errors: [Output Only] The array of errors encountered while
  6887. // processing this operation.
  6888. Errors []*OperationErrorErrors `json:"errors,omitempty"`
  6889. // ForceSendFields is a list of field names (e.g. "Errors") to
  6890. // unconditionally include in API requests. By default, fields with
  6891. // empty values are omitted from API requests. However, any non-pointer,
  6892. // non-interface field appearing in ForceSendFields will be sent to the
  6893. // server regardless of whether the field is empty or not. This may be
  6894. // used to include empty fields in Patch requests.
  6895. ForceSendFields []string `json:"-"`
  6896. // NullFields is a list of field names (e.g. "Errors") to include in API
  6897. // requests with the JSON null value. By default, fields with empty
  6898. // values are omitted from API requests. However, any field with an
  6899. // empty value appearing in NullFields will be sent to the server as
  6900. // null. It is an error if a field in this list has a non-empty value.
  6901. // This may be used to include null fields in Patch requests.
  6902. NullFields []string `json:"-"`
  6903. }
  6904. func (s *OperationError) MarshalJSON() ([]byte, error) {
  6905. type noMethod OperationError
  6906. raw := noMethod(*s)
  6907. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6908. }
  6909. type OperationErrorErrors struct {
  6910. // Code: [Output Only] The error type identifier for this error.
  6911. Code string `json:"code,omitempty"`
  6912. // Location: [Output Only] Indicates the field in the request that
  6913. // caused the error. This property is optional.
  6914. Location string `json:"location,omitempty"`
  6915. // Message: [Output Only] An optional, human-readable error message.
  6916. Message string `json:"message,omitempty"`
  6917. // ForceSendFields is a list of field names (e.g. "Code") to
  6918. // unconditionally include in API requests. By default, fields with
  6919. // empty values are omitted from API requests. However, any non-pointer,
  6920. // non-interface field appearing in ForceSendFields will be sent to the
  6921. // server regardless of whether the field is empty or not. This may be
  6922. // used to include empty fields in Patch requests.
  6923. ForceSendFields []string `json:"-"`
  6924. // NullFields is a list of field names (e.g. "Code") to include in API
  6925. // requests with the JSON null value. By default, fields with empty
  6926. // values are omitted from API requests. However, any field with an
  6927. // empty value appearing in NullFields will be sent to the server as
  6928. // null. It is an error if a field in this list has a non-empty value.
  6929. // This may be used to include null fields in Patch requests.
  6930. NullFields []string `json:"-"`
  6931. }
  6932. func (s *OperationErrorErrors) MarshalJSON() ([]byte, error) {
  6933. type noMethod OperationErrorErrors
  6934. raw := noMethod(*s)
  6935. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6936. }
  6937. type OperationWarnings struct {
  6938. // Code: [Output Only] A warning code, if applicable. For example,
  6939. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6940. // the response.
  6941. //
  6942. // Possible values:
  6943. // "CLEANUP_FAILED"
  6944. // "DEPRECATED_RESOURCE_USED"
  6945. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6946. // "FIELD_VALUE_OVERRIDEN"
  6947. // "INJECTED_KERNELS_DEPRECATED"
  6948. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6949. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6950. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6951. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6952. // "NEXT_HOP_NOT_RUNNING"
  6953. // "NOT_CRITICAL_ERROR"
  6954. // "NO_RESULTS_ON_PAGE"
  6955. // "REQUIRED_TOS_AGREEMENT"
  6956. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  6957. // "RESOURCE_NOT_DELETED"
  6958. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6959. // "UNREACHABLE"
  6960. Code string `json:"code,omitempty"`
  6961. // Data: [Output Only] Metadata about this warning in key: value format.
  6962. // For example:
  6963. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6964. Data []*OperationWarningsData `json:"data,omitempty"`
  6965. // Message: [Output Only] A human-readable description of the warning
  6966. // code.
  6967. Message string `json:"message,omitempty"`
  6968. // ForceSendFields is a list of field names (e.g. "Code") to
  6969. // unconditionally include in API requests. By default, fields with
  6970. // empty values are omitted from API requests. However, any non-pointer,
  6971. // non-interface field appearing in ForceSendFields will be sent to the
  6972. // server regardless of whether the field is empty or not. This may be
  6973. // used to include empty fields in Patch requests.
  6974. ForceSendFields []string `json:"-"`
  6975. // NullFields is a list of field names (e.g. "Code") to include in API
  6976. // requests with the JSON null value. By default, fields with empty
  6977. // values are omitted from API requests. However, any field with an
  6978. // empty value appearing in NullFields will be sent to the server as
  6979. // null. It is an error if a field in this list has a non-empty value.
  6980. // This may be used to include null fields in Patch requests.
  6981. NullFields []string `json:"-"`
  6982. }
  6983. func (s *OperationWarnings) MarshalJSON() ([]byte, error) {
  6984. type noMethod OperationWarnings
  6985. raw := noMethod(*s)
  6986. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6987. }
  6988. type OperationWarningsData struct {
  6989. // Key: [Output Only] A key that provides more detail on the warning
  6990. // being returned. For example, for warnings where there are no results
  6991. // in a list request for a particular zone, this key might be scope and
  6992. // the key value might be the zone name. Other examples might be a key
  6993. // indicating a deprecated resource and a suggested replacement, or a
  6994. // warning about invalid network settings (for example, if an instance
  6995. // attempts to perform IP forwarding but is not enabled for IP
  6996. // forwarding).
  6997. Key string `json:"key,omitempty"`
  6998. // Value: [Output Only] A warning data value corresponding to the key.
  6999. Value string `json:"value,omitempty"`
  7000. // ForceSendFields is a list of field names (e.g. "Key") to
  7001. // unconditionally include in API requests. By default, fields with
  7002. // empty values are omitted from API requests. However, any non-pointer,
  7003. // non-interface field appearing in ForceSendFields will be sent to the
  7004. // server regardless of whether the field is empty or not. This may be
  7005. // used to include empty fields in Patch requests.
  7006. ForceSendFields []string `json:"-"`
  7007. // NullFields is a list of field names (e.g. "Key") to include in API
  7008. // requests with the JSON null value. By default, fields with empty
  7009. // values are omitted from API requests. However, any field with an
  7010. // empty value appearing in NullFields will be sent to the server as
  7011. // null. It is an error if a field in this list has a non-empty value.
  7012. // This may be used to include null fields in Patch requests.
  7013. NullFields []string `json:"-"`
  7014. }
  7015. func (s *OperationWarningsData) MarshalJSON() ([]byte, error) {
  7016. type noMethod OperationWarningsData
  7017. raw := noMethod(*s)
  7018. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7019. }
  7020. type OperationAggregatedList struct {
  7021. // Id: [Output Only] The unique identifier for the resource. This
  7022. // identifier is defined by the server.
  7023. Id string `json:"id,omitempty"`
  7024. // Items: [Output Only] A map of scoped operation lists.
  7025. Items map[string]OperationsScopedList `json:"items,omitempty"`
  7026. // Kind: [Output Only] Type of resource. Always
  7027. // compute#operationAggregatedList for aggregated lists of operations.
  7028. Kind string `json:"kind,omitempty"`
  7029. // NextPageToken: [Output Only] This token allows you to get the next
  7030. // page of results for list requests. If the number of results is larger
  7031. // than maxResults, use the nextPageToken as a value for the query
  7032. // parameter pageToken in the next list request. Subsequent list
  7033. // requests will have their own nextPageToken to continue paging through
  7034. // the results.
  7035. NextPageToken string `json:"nextPageToken,omitempty"`
  7036. // SelfLink: [Output Only] Server-defined URL for this resource.
  7037. SelfLink string `json:"selfLink,omitempty"`
  7038. // ServerResponse contains the HTTP response code and headers from the
  7039. // server.
  7040. googleapi.ServerResponse `json:"-"`
  7041. // ForceSendFields is a list of field names (e.g. "Id") to
  7042. // unconditionally include in API requests. By default, fields with
  7043. // empty values are omitted from API requests. However, any non-pointer,
  7044. // non-interface field appearing in ForceSendFields will be sent to the
  7045. // server regardless of whether the field is empty or not. This may be
  7046. // used to include empty fields in Patch requests.
  7047. ForceSendFields []string `json:"-"`
  7048. // NullFields is a list of field names (e.g. "Id") to include in API
  7049. // requests with the JSON null value. By default, fields with empty
  7050. // values are omitted from API requests. However, any field with an
  7051. // empty value appearing in NullFields will be sent to the server as
  7052. // null. It is an error if a field in this list has a non-empty value.
  7053. // This may be used to include null fields in Patch requests.
  7054. NullFields []string `json:"-"`
  7055. }
  7056. func (s *OperationAggregatedList) MarshalJSON() ([]byte, error) {
  7057. type noMethod OperationAggregatedList
  7058. raw := noMethod(*s)
  7059. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7060. }
  7061. // OperationList: Contains a list of Operation resources.
  7062. type OperationList struct {
  7063. // Id: [Output Only] The unique identifier for the resource. This
  7064. // identifier is defined by the server.
  7065. Id string `json:"id,omitempty"`
  7066. // Items: [Output Only] A list of Operation resources.
  7067. Items []*Operation `json:"items,omitempty"`
  7068. // Kind: [Output Only] Type of resource. Always compute#operations for
  7069. // Operations resource.
  7070. Kind string `json:"kind,omitempty"`
  7071. // NextPageToken: [Output Only] This token allows you to get the next
  7072. // page of results for list requests. If the number of results is larger
  7073. // than maxResults, use the nextPageToken as a value for the query
  7074. // parameter pageToken in the next list request. Subsequent list
  7075. // requests will have their own nextPageToken to continue paging through
  7076. // the results.
  7077. NextPageToken string `json:"nextPageToken,omitempty"`
  7078. // SelfLink: [Output Only] Server-defined URL for this resource.
  7079. SelfLink string `json:"selfLink,omitempty"`
  7080. // ServerResponse contains the HTTP response code and headers from the
  7081. // server.
  7082. googleapi.ServerResponse `json:"-"`
  7083. // ForceSendFields is a list of field names (e.g. "Id") to
  7084. // unconditionally include in API requests. By default, fields with
  7085. // empty values are omitted from API requests. However, any non-pointer,
  7086. // non-interface field appearing in ForceSendFields will be sent to the
  7087. // server regardless of whether the field is empty or not. This may be
  7088. // used to include empty fields in Patch requests.
  7089. ForceSendFields []string `json:"-"`
  7090. // NullFields is a list of field names (e.g. "Id") to include in API
  7091. // requests with the JSON null value. By default, fields with empty
  7092. // values are omitted from API requests. However, any field with an
  7093. // empty value appearing in NullFields will be sent to the server as
  7094. // null. It is an error if a field in this list has a non-empty value.
  7095. // This may be used to include null fields in Patch requests.
  7096. NullFields []string `json:"-"`
  7097. }
  7098. func (s *OperationList) MarshalJSON() ([]byte, error) {
  7099. type noMethod OperationList
  7100. raw := noMethod(*s)
  7101. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7102. }
  7103. type OperationsScopedList struct {
  7104. // Operations: [Output Only] List of operations contained in this scope.
  7105. Operations []*Operation `json:"operations,omitempty"`
  7106. // Warning: [Output Only] Informational warning which replaces the list
  7107. // of operations when the list is empty.
  7108. Warning *OperationsScopedListWarning `json:"warning,omitempty"`
  7109. // ForceSendFields is a list of field names (e.g. "Operations") to
  7110. // unconditionally include in API requests. By default, fields with
  7111. // empty values are omitted from API requests. However, any non-pointer,
  7112. // non-interface field appearing in ForceSendFields will be sent to the
  7113. // server regardless of whether the field is empty or not. This may be
  7114. // used to include empty fields in Patch requests.
  7115. ForceSendFields []string `json:"-"`
  7116. // NullFields is a list of field names (e.g. "Operations") to include in
  7117. // API requests with the JSON null value. By default, fields with empty
  7118. // values are omitted from API requests. However, any field with an
  7119. // empty value appearing in NullFields will be sent to the server as
  7120. // null. It is an error if a field in this list has a non-empty value.
  7121. // This may be used to include null fields in Patch requests.
  7122. NullFields []string `json:"-"`
  7123. }
  7124. func (s *OperationsScopedList) MarshalJSON() ([]byte, error) {
  7125. type noMethod OperationsScopedList
  7126. raw := noMethod(*s)
  7127. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7128. }
  7129. // OperationsScopedListWarning: [Output Only] Informational warning
  7130. // which replaces the list of operations when the list is empty.
  7131. type OperationsScopedListWarning struct {
  7132. // Code: [Output Only] A warning code, if applicable. For example,
  7133. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  7134. // the response.
  7135. //
  7136. // Possible values:
  7137. // "CLEANUP_FAILED"
  7138. // "DEPRECATED_RESOURCE_USED"
  7139. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  7140. // "FIELD_VALUE_OVERRIDEN"
  7141. // "INJECTED_KERNELS_DEPRECATED"
  7142. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  7143. // "NEXT_HOP_CANNOT_IP_FORWARD"
  7144. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  7145. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  7146. // "NEXT_HOP_NOT_RUNNING"
  7147. // "NOT_CRITICAL_ERROR"
  7148. // "NO_RESULTS_ON_PAGE"
  7149. // "REQUIRED_TOS_AGREEMENT"
  7150. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  7151. // "RESOURCE_NOT_DELETED"
  7152. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  7153. // "UNREACHABLE"
  7154. Code string `json:"code,omitempty"`
  7155. // Data: [Output Only] Metadata about this warning in key: value format.
  7156. // For example:
  7157. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  7158. Data []*OperationsScopedListWarningData `json:"data,omitempty"`
  7159. // Message: [Output Only] A human-readable description of the warning
  7160. // code.
  7161. Message string `json:"message,omitempty"`
  7162. // ForceSendFields is a list of field names (e.g. "Code") to
  7163. // unconditionally include in API requests. By default, fields with
  7164. // empty values are omitted from API requests. However, any non-pointer,
  7165. // non-interface field appearing in ForceSendFields will be sent to the
  7166. // server regardless of whether the field is empty or not. This may be
  7167. // used to include empty fields in Patch requests.
  7168. ForceSendFields []string `json:"-"`
  7169. // NullFields is a list of field names (e.g. "Code") to include in API
  7170. // requests with the JSON null value. By default, fields with empty
  7171. // values are omitted from API requests. However, any field with an
  7172. // empty value appearing in NullFields will be sent to the server as
  7173. // null. It is an error if a field in this list has a non-empty value.
  7174. // This may be used to include null fields in Patch requests.
  7175. NullFields []string `json:"-"`
  7176. }
  7177. func (s *OperationsScopedListWarning) MarshalJSON() ([]byte, error) {
  7178. type noMethod OperationsScopedListWarning
  7179. raw := noMethod(*s)
  7180. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7181. }
  7182. type OperationsScopedListWarningData struct {
  7183. // Key: [Output Only] A key that provides more detail on the warning
  7184. // being returned. For example, for warnings where there are no results
  7185. // in a list request for a particular zone, this key might be scope and
  7186. // the key value might be the zone name. Other examples might be a key
  7187. // indicating a deprecated resource and a suggested replacement, or a
  7188. // warning about invalid network settings (for example, if an instance
  7189. // attempts to perform IP forwarding but is not enabled for IP
  7190. // forwarding).
  7191. Key string `json:"key,omitempty"`
  7192. // Value: [Output Only] A warning data value corresponding to the key.
  7193. Value string `json:"value,omitempty"`
  7194. // ForceSendFields is a list of field names (e.g. "Key") to
  7195. // unconditionally include in API requests. By default, fields with
  7196. // empty values are omitted from API requests. However, any non-pointer,
  7197. // non-interface field appearing in ForceSendFields will be sent to the
  7198. // server regardless of whether the field is empty or not. This may be
  7199. // used to include empty fields in Patch requests.
  7200. ForceSendFields []string `json:"-"`
  7201. // NullFields is a list of field names (e.g. "Key") to include in API
  7202. // requests with the JSON null value. By default, fields with empty
  7203. // values are omitted from API requests. However, any field with an
  7204. // empty value appearing in NullFields will be sent to the server as
  7205. // null. It is an error if a field in this list has a non-empty value.
  7206. // This may be used to include null fields in Patch requests.
  7207. NullFields []string `json:"-"`
  7208. }
  7209. func (s *OperationsScopedListWarningData) MarshalJSON() ([]byte, error) {
  7210. type noMethod OperationsScopedListWarningData
  7211. raw := noMethod(*s)
  7212. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7213. }
  7214. // PathMatcher: A matcher for the path portion of the URL. The
  7215. // BackendService from the longest-matched rule will serve the URL. If
  7216. // no rule was matched, the default service will be used.
  7217. type PathMatcher struct {
  7218. // DefaultService: The full or partial URL to the BackendService
  7219. // resource. This will be used if none of the pathRules defined by this
  7220. // PathMatcher is matched by the URL's path portion. For example, the
  7221. // following are all valid URLs to a BackendService resource:
  7222. // -
  7223. // https://www.googleapis.com/compute/v1/projects/project/global/backendServices/backendService
  7224. // - compute/v1/projects/project/global/backendServices/backendService
  7225. //
  7226. // - global/backendServices/backendService
  7227. DefaultService string `json:"defaultService,omitempty"`
  7228. // Description: An optional description of this resource. Provide this
  7229. // property when you create the resource.
  7230. Description string `json:"description,omitempty"`
  7231. // Name: The name to which this PathMatcher is referred by the HostRule.
  7232. Name string `json:"name,omitempty"`
  7233. // PathRules: The list of path rules.
  7234. PathRules []*PathRule `json:"pathRules,omitempty"`
  7235. // ForceSendFields is a list of field names (e.g. "DefaultService") to
  7236. // unconditionally include in API requests. By default, fields with
  7237. // empty values are omitted from API requests. However, any non-pointer,
  7238. // non-interface field appearing in ForceSendFields will be sent to the
  7239. // server regardless of whether the field is empty or not. This may be
  7240. // used to include empty fields in Patch requests.
  7241. ForceSendFields []string `json:"-"`
  7242. // NullFields is a list of field names (e.g. "DefaultService") to
  7243. // include in API requests with the JSON null value. By default, fields
  7244. // with empty values are omitted from API requests. However, any field
  7245. // with an empty value appearing in NullFields will be sent to the
  7246. // server as null. It is an error if a field in this list has a
  7247. // non-empty value. This may be used to include null fields in Patch
  7248. // requests.
  7249. NullFields []string `json:"-"`
  7250. }
  7251. func (s *PathMatcher) MarshalJSON() ([]byte, error) {
  7252. type noMethod PathMatcher
  7253. raw := noMethod(*s)
  7254. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7255. }
  7256. // PathRule: A path-matching rule for a URL. If matched, will use the
  7257. // specified BackendService to handle the traffic arriving at this URL.
  7258. type PathRule struct {
  7259. // Paths: The list of path patterns to match. Each must start with / and
  7260. // the only place a * is allowed is at the end following a /. The string
  7261. // fed to the path matcher does not include any text after the first ?
  7262. // or #, and those chars are not allowed here.
  7263. Paths []string `json:"paths,omitempty"`
  7264. // Service: The URL of the BackendService resource if this rule is
  7265. // matched.
  7266. Service string `json:"service,omitempty"`
  7267. // ForceSendFields is a list of field names (e.g. "Paths") to
  7268. // unconditionally include in API requests. By default, fields with
  7269. // empty values are omitted from API requests. However, any non-pointer,
  7270. // non-interface field appearing in ForceSendFields will be sent to the
  7271. // server regardless of whether the field is empty or not. This may be
  7272. // used to include empty fields in Patch requests.
  7273. ForceSendFields []string `json:"-"`
  7274. // NullFields is a list of field names (e.g. "Paths") to include in API
  7275. // requests with the JSON null value. By default, fields with empty
  7276. // values are omitted from API requests. However, any field with an
  7277. // empty value appearing in NullFields will be sent to the server as
  7278. // null. It is an error if a field in this list has a non-empty value.
  7279. // This may be used to include null fields in Patch requests.
  7280. NullFields []string `json:"-"`
  7281. }
  7282. func (s *PathRule) MarshalJSON() ([]byte, error) {
  7283. type noMethod PathRule
  7284. raw := noMethod(*s)
  7285. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7286. }
  7287. // Project: A Project resource. Projects can only be created in the
  7288. // Google Cloud Platform Console. Unless marked otherwise, values can
  7289. // only be modified in the console.
  7290. type Project struct {
  7291. // CommonInstanceMetadata: Metadata key/value pairs available to all
  7292. // instances contained in this project. See Custom metadata for more
  7293. // information.
  7294. CommonInstanceMetadata *Metadata `json:"commonInstanceMetadata,omitempty"`
  7295. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  7296. // format.
  7297. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  7298. // DefaultServiceAccount: [Output Only] Default service account used by
  7299. // VMs running in this project.
  7300. DefaultServiceAccount string `json:"defaultServiceAccount,omitempty"`
  7301. // Description: An optional textual description of the resource.
  7302. Description string `json:"description,omitempty"`
  7303. // EnabledFeatures: Restricted features enabled for use on this project.
  7304. EnabledFeatures []string `json:"enabledFeatures,omitempty"`
  7305. // Id: [Output Only] The unique identifier for the resource. This
  7306. // identifier is defined by the server. This is not the project ID, and
  7307. // is just a unique ID used by Compute Engine to identify resources.
  7308. Id uint64 `json:"id,omitempty,string"`
  7309. // Kind: [Output Only] Type of the resource. Always compute#project for
  7310. // projects.
  7311. Kind string `json:"kind,omitempty"`
  7312. // Name: The project ID. For example: my-example-project. Use the
  7313. // project ID to make requests to Compute Engine.
  7314. Name string `json:"name,omitempty"`
  7315. // Quotas: [Output Only] Quotas assigned to this project.
  7316. Quotas []*Quota `json:"quotas,omitempty"`
  7317. // SelfLink: [Output Only] Server-defined URL for the resource.
  7318. SelfLink string `json:"selfLink,omitempty"`
  7319. // UsageExportLocation: The naming prefix for daily usage reports and
  7320. // the Google Cloud Storage bucket where they are stored.
  7321. UsageExportLocation *UsageExportLocation `json:"usageExportLocation,omitempty"`
  7322. // XpnProjectStatus: [Output Only] The role this project has in a Cross
  7323. // Project Network (XPN) configuration. Currently only HOST projects are
  7324. // differentiated.
  7325. //
  7326. // Possible values:
  7327. // "HOST"
  7328. // "UNSPECIFIED_XPN_PROJECT_STATUS"
  7329. XpnProjectStatus string `json:"xpnProjectStatus,omitempty"`
  7330. // ServerResponse contains the HTTP response code and headers from the
  7331. // server.
  7332. googleapi.ServerResponse `json:"-"`
  7333. // ForceSendFields is a list of field names (e.g.
  7334. // "CommonInstanceMetadata") to unconditionally include in API requests.
  7335. // By default, fields with empty values are omitted from API requests.
  7336. // However, any non-pointer, non-interface field appearing in
  7337. // ForceSendFields will be sent to the server regardless of whether the
  7338. // field is empty or not. This may be used to include empty fields in
  7339. // Patch requests.
  7340. ForceSendFields []string `json:"-"`
  7341. // NullFields is a list of field names (e.g. "CommonInstanceMetadata")
  7342. // to include in API requests with the JSON null value. By default,
  7343. // fields with empty values are omitted from API requests. However, any
  7344. // field with an empty value appearing in NullFields will be sent to the
  7345. // server as null. It is an error if a field in this list has a
  7346. // non-empty value. This may be used to include null fields in Patch
  7347. // requests.
  7348. NullFields []string `json:"-"`
  7349. }
  7350. func (s *Project) MarshalJSON() ([]byte, error) {
  7351. type noMethod Project
  7352. raw := noMethod(*s)
  7353. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7354. }
  7355. type ProjectsDisableXpnResourceRequest struct {
  7356. // XpnResource: XPN resource ID.
  7357. XpnResource *XpnResourceId `json:"xpnResource,omitempty"`
  7358. // ForceSendFields is a list of field names (e.g. "XpnResource") to
  7359. // unconditionally include in API requests. By default, fields with
  7360. // empty values are omitted from API requests. However, any non-pointer,
  7361. // non-interface field appearing in ForceSendFields will be sent to the
  7362. // server regardless of whether the field is empty or not. This may be
  7363. // used to include empty fields in Patch requests.
  7364. ForceSendFields []string `json:"-"`
  7365. // NullFields is a list of field names (e.g. "XpnResource") to include
  7366. // in API requests with the JSON null value. By default, fields with
  7367. // empty values are omitted from API requests. However, any field with
  7368. // an empty value appearing in NullFields will be sent to the server as
  7369. // null. It is an error if a field in this list has a non-empty value.
  7370. // This may be used to include null fields in Patch requests.
  7371. NullFields []string `json:"-"`
  7372. }
  7373. func (s *ProjectsDisableXpnResourceRequest) MarshalJSON() ([]byte, error) {
  7374. type noMethod ProjectsDisableXpnResourceRequest
  7375. raw := noMethod(*s)
  7376. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7377. }
  7378. type ProjectsEnableXpnResourceRequest struct {
  7379. // XpnResource: XPN resource ID.
  7380. XpnResource *XpnResourceId `json:"xpnResource,omitempty"`
  7381. // ForceSendFields is a list of field names (e.g. "XpnResource") to
  7382. // unconditionally include in API requests. By default, fields with
  7383. // empty values are omitted from API requests. However, any non-pointer,
  7384. // non-interface field appearing in ForceSendFields will be sent to the
  7385. // server regardless of whether the field is empty or not. This may be
  7386. // used to include empty fields in Patch requests.
  7387. ForceSendFields []string `json:"-"`
  7388. // NullFields is a list of field names (e.g. "XpnResource") to include
  7389. // in API requests with the JSON null value. By default, fields with
  7390. // empty values are omitted from API requests. However, any field with
  7391. // an empty value appearing in NullFields will be sent to the server as
  7392. // null. It is an error if a field in this list has a non-empty value.
  7393. // This may be used to include null fields in Patch requests.
  7394. NullFields []string `json:"-"`
  7395. }
  7396. func (s *ProjectsEnableXpnResourceRequest) MarshalJSON() ([]byte, error) {
  7397. type noMethod ProjectsEnableXpnResourceRequest
  7398. raw := noMethod(*s)
  7399. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7400. }
  7401. type ProjectsGetXpnResources struct {
  7402. // Kind: [Output Only] Type of resource. Always
  7403. // compute#projectsGetXpnResources for lists of XPN resources.
  7404. Kind string `json:"kind,omitempty"`
  7405. // NextPageToken: [Output Only] This token allows you to get the next
  7406. // page of results for list requests. If the number of results is larger
  7407. // than maxResults, use the nextPageToken as a value for the query
  7408. // parameter pageToken in the next list request. Subsequent list
  7409. // requests will have their own nextPageToken to continue paging through
  7410. // the results.
  7411. NextPageToken string `json:"nextPageToken,omitempty"`
  7412. // Resources: XPN resources attached to this project as their XPN host.
  7413. Resources []*XpnResourceId `json:"resources,omitempty"`
  7414. // ServerResponse contains the HTTP response code and headers from the
  7415. // server.
  7416. googleapi.ServerResponse `json:"-"`
  7417. // ForceSendFields is a list of field names (e.g. "Kind") to
  7418. // unconditionally include in API requests. By default, fields with
  7419. // empty values are omitted from API requests. However, any non-pointer,
  7420. // non-interface field appearing in ForceSendFields will be sent to the
  7421. // server regardless of whether the field is empty or not. This may be
  7422. // used to include empty fields in Patch requests.
  7423. ForceSendFields []string `json:"-"`
  7424. // NullFields is a list of field names (e.g. "Kind") to include in API
  7425. // requests with the JSON null value. By default, fields with empty
  7426. // values are omitted from API requests. However, any field with an
  7427. // empty value appearing in NullFields will be sent to the server as
  7428. // null. It is an error if a field in this list has a non-empty value.
  7429. // This may be used to include null fields in Patch requests.
  7430. NullFields []string `json:"-"`
  7431. }
  7432. func (s *ProjectsGetXpnResources) MarshalJSON() ([]byte, error) {
  7433. type noMethod ProjectsGetXpnResources
  7434. raw := noMethod(*s)
  7435. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7436. }
  7437. type ProjectsListXpnHostsRequest struct {
  7438. // Organization: Optional organization ID managed by Cloud Resource
  7439. // Manager, for which to list XPN host projects. If not specified, the
  7440. // organization will be inferred from the project.
  7441. Organization string `json:"organization,omitempty"`
  7442. // ForceSendFields is a list of field names (e.g. "Organization") to
  7443. // unconditionally include in API requests. By default, fields with
  7444. // empty values are omitted from API requests. However, any non-pointer,
  7445. // non-interface field appearing in ForceSendFields will be sent to the
  7446. // server regardless of whether the field is empty or not. This may be
  7447. // used to include empty fields in Patch requests.
  7448. ForceSendFields []string `json:"-"`
  7449. // NullFields is a list of field names (e.g. "Organization") to include
  7450. // in API requests with the JSON null value. By default, fields with
  7451. // empty values are omitted from API requests. However, any field with
  7452. // an empty value appearing in NullFields will be sent to the server as
  7453. // null. It is an error if a field in this list has a non-empty value.
  7454. // This may be used to include null fields in Patch requests.
  7455. NullFields []string `json:"-"`
  7456. }
  7457. func (s *ProjectsListXpnHostsRequest) MarshalJSON() ([]byte, error) {
  7458. type noMethod ProjectsListXpnHostsRequest
  7459. raw := noMethod(*s)
  7460. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7461. }
  7462. // Quota: A quotas entry.
  7463. type Quota struct {
  7464. // Limit: [Output Only] Quota limit for this metric.
  7465. Limit float64 `json:"limit,omitempty"`
  7466. // Metric: [Output Only] Name of the quota metric.
  7467. //
  7468. // Possible values:
  7469. // "AUTOSCALERS"
  7470. // "BACKEND_BUCKETS"
  7471. // "BACKEND_SERVICES"
  7472. // "CPUS"
  7473. // "CPUS_ALL_REGIONS"
  7474. // "DISKS_TOTAL_GB"
  7475. // "FIREWALLS"
  7476. // "FORWARDING_RULES"
  7477. // "HEALTH_CHECKS"
  7478. // "IMAGES"
  7479. // "INSTANCES"
  7480. // "INSTANCE_GROUPS"
  7481. // "INSTANCE_GROUP_MANAGERS"
  7482. // "INSTANCE_TEMPLATES"
  7483. // "IN_USE_ADDRESSES"
  7484. // "LOCAL_SSD_TOTAL_GB"
  7485. // "NETWORKS"
  7486. // "NVIDIA_K80_GPUS"
  7487. // "PREEMPTIBLE_CPUS"
  7488. // "REGIONAL_AUTOSCALERS"
  7489. // "REGIONAL_INSTANCE_GROUP_MANAGERS"
  7490. // "ROUTERS"
  7491. // "ROUTES"
  7492. // "SNAPSHOTS"
  7493. // "SSD_TOTAL_GB"
  7494. // "SSL_CERTIFICATES"
  7495. // "STATIC_ADDRESSES"
  7496. // "SUBNETWORKS"
  7497. // "TARGET_HTTPS_PROXIES"
  7498. // "TARGET_HTTP_PROXIES"
  7499. // "TARGET_INSTANCES"
  7500. // "TARGET_POOLS"
  7501. // "TARGET_SSL_PROXIES"
  7502. // "TARGET_VPN_GATEWAYS"
  7503. // "URL_MAPS"
  7504. // "VPN_TUNNELS"
  7505. Metric string `json:"metric,omitempty"`
  7506. // Usage: [Output Only] Current usage of this metric.
  7507. Usage float64 `json:"usage,omitempty"`
  7508. // ForceSendFields is a list of field names (e.g. "Limit") to
  7509. // unconditionally include in API requests. By default, fields with
  7510. // empty values are omitted from API requests. However, any non-pointer,
  7511. // non-interface field appearing in ForceSendFields will be sent to the
  7512. // server regardless of whether the field is empty or not. This may be
  7513. // used to include empty fields in Patch requests.
  7514. ForceSendFields []string `json:"-"`
  7515. // NullFields is a list of field names (e.g. "Limit") to include in API
  7516. // requests with the JSON null value. By default, fields with empty
  7517. // values are omitted from API requests. However, any field with an
  7518. // empty value appearing in NullFields will be sent to the server as
  7519. // null. It is an error if a field in this list has a non-empty value.
  7520. // This may be used to include null fields in Patch requests.
  7521. NullFields []string `json:"-"`
  7522. }
  7523. func (s *Quota) MarshalJSON() ([]byte, error) {
  7524. type noMethod Quota
  7525. raw := noMethod(*s)
  7526. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7527. }
  7528. func (s *Quota) UnmarshalJSON(data []byte) error {
  7529. type noMethod Quota
  7530. var s1 struct {
  7531. Limit gensupport.JSONFloat64 `json:"limit"`
  7532. Usage gensupport.JSONFloat64 `json:"usage"`
  7533. *noMethod
  7534. }
  7535. s1.noMethod = (*noMethod)(s)
  7536. if err := json.Unmarshal(data, &s1); err != nil {
  7537. return err
  7538. }
  7539. s.Limit = float64(s1.Limit)
  7540. s.Usage = float64(s1.Usage)
  7541. return nil
  7542. }
  7543. // Region: Region resource.
  7544. type Region struct {
  7545. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  7546. // format.
  7547. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  7548. // Deprecated: [Output Only] The deprecation status associated with this
  7549. // region.
  7550. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  7551. // Description: [Output Only] Textual description of the resource.
  7552. Description string `json:"description,omitempty"`
  7553. // Id: [Output Only] The unique identifier for the resource. This
  7554. // identifier is defined by the server.
  7555. Id uint64 `json:"id,omitempty,string"`
  7556. // Kind: [Output Only] Type of the resource. Always compute#region for
  7557. // regions.
  7558. Kind string `json:"kind,omitempty"`
  7559. // Name: [Output Only] Name of the resource.
  7560. Name string `json:"name,omitempty"`
  7561. // Quotas: [Output Only] Quotas assigned to this region.
  7562. Quotas []*Quota `json:"quotas,omitempty"`
  7563. // SelfLink: [Output Only] Server-defined URL for the resource.
  7564. SelfLink string `json:"selfLink,omitempty"`
  7565. // Status: [Output Only] Status of the region, either UP or DOWN.
  7566. //
  7567. // Possible values:
  7568. // "DOWN"
  7569. // "UP"
  7570. Status string `json:"status,omitempty"`
  7571. // Zones: [Output Only] A list of zones available in this region, in the
  7572. // form of resource URLs.
  7573. Zones []string `json:"zones,omitempty"`
  7574. // ServerResponse contains the HTTP response code and headers from the
  7575. // server.
  7576. googleapi.ServerResponse `json:"-"`
  7577. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  7578. // to unconditionally include in API requests. By default, fields with
  7579. // empty values are omitted from API requests. However, any non-pointer,
  7580. // non-interface field appearing in ForceSendFields will be sent to the
  7581. // server regardless of whether the field is empty or not. This may be
  7582. // used to include empty fields in Patch requests.
  7583. ForceSendFields []string `json:"-"`
  7584. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  7585. // include in API requests with the JSON null value. By default, fields
  7586. // with empty values are omitted from API requests. However, any field
  7587. // with an empty value appearing in NullFields will be sent to the
  7588. // server as null. It is an error if a field in this list has a
  7589. // non-empty value. This may be used to include null fields in Patch
  7590. // requests.
  7591. NullFields []string `json:"-"`
  7592. }
  7593. func (s *Region) MarshalJSON() ([]byte, error) {
  7594. type noMethod Region
  7595. raw := noMethod(*s)
  7596. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7597. }
  7598. // RegionAutoscalerList: Contains a list of autoscalers.
  7599. type RegionAutoscalerList struct {
  7600. // Id: [Output Only] The unique identifier for the resource. This
  7601. // identifier is defined by the server.
  7602. Id string `json:"id,omitempty"`
  7603. // Items: A list of autoscalers.
  7604. Items []*Autoscaler `json:"items,omitempty"`
  7605. // Kind: Type of resource.
  7606. Kind string `json:"kind,omitempty"`
  7607. // NextPageToken: [Output Only] A token used to continue a truncated
  7608. // list request.
  7609. NextPageToken string `json:"nextPageToken,omitempty"`
  7610. // SelfLink: [Output Only] Server-defined URL for this resource.
  7611. SelfLink string `json:"selfLink,omitempty"`
  7612. // ServerResponse contains the HTTP response code and headers from the
  7613. // server.
  7614. googleapi.ServerResponse `json:"-"`
  7615. // ForceSendFields is a list of field names (e.g. "Id") to
  7616. // unconditionally include in API requests. By default, fields with
  7617. // empty values are omitted from API requests. However, any non-pointer,
  7618. // non-interface field appearing in ForceSendFields will be sent to the
  7619. // server regardless of whether the field is empty or not. This may be
  7620. // used to include empty fields in Patch requests.
  7621. ForceSendFields []string `json:"-"`
  7622. // NullFields is a list of field names (e.g. "Id") to include in API
  7623. // requests with the JSON null value. By default, fields with empty
  7624. // values are omitted from API requests. However, any field with an
  7625. // empty value appearing in NullFields will be sent to the server as
  7626. // null. It is an error if a field in this list has a non-empty value.
  7627. // This may be used to include null fields in Patch requests.
  7628. NullFields []string `json:"-"`
  7629. }
  7630. func (s *RegionAutoscalerList) MarshalJSON() ([]byte, error) {
  7631. type noMethod RegionAutoscalerList
  7632. raw := noMethod(*s)
  7633. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7634. }
  7635. // RegionInstanceGroupList: Contains a list of InstanceGroup resources.
  7636. type RegionInstanceGroupList struct {
  7637. // Id: [Output Only] The unique identifier for the resource. This
  7638. // identifier is defined by the server.
  7639. Id string `json:"id,omitempty"`
  7640. // Items: A list of InstanceGroup resources.
  7641. Items []*InstanceGroup `json:"items,omitempty"`
  7642. // Kind: The resource type.
  7643. Kind string `json:"kind,omitempty"`
  7644. // NextPageToken: [Output Only] This token allows you to get the next
  7645. // page of results for list requests. If the number of results is larger
  7646. // than maxResults, use the nextPageToken as a value for the query
  7647. // parameter pageToken in the next list request. Subsequent list
  7648. // requests will have their own nextPageToken to continue paging through
  7649. // the results.
  7650. NextPageToken string `json:"nextPageToken,omitempty"`
  7651. // SelfLink: [Output Only] The URL for this resource type. The server
  7652. // generates this URL.
  7653. SelfLink string `json:"selfLink,omitempty"`
  7654. // ServerResponse contains the HTTP response code and headers from the
  7655. // server.
  7656. googleapi.ServerResponse `json:"-"`
  7657. // ForceSendFields is a list of field names (e.g. "Id") to
  7658. // unconditionally include in API requests. By default, fields with
  7659. // empty values are omitted from API requests. However, any non-pointer,
  7660. // non-interface field appearing in ForceSendFields will be sent to the
  7661. // server regardless of whether the field is empty or not. This may be
  7662. // used to include empty fields in Patch requests.
  7663. ForceSendFields []string `json:"-"`
  7664. // NullFields is a list of field names (e.g. "Id") to include in API
  7665. // requests with the JSON null value. By default, fields with empty
  7666. // values are omitted from API requests. However, any field with an
  7667. // empty value appearing in NullFields will be sent to the server as
  7668. // null. It is an error if a field in this list has a non-empty value.
  7669. // This may be used to include null fields in Patch requests.
  7670. NullFields []string `json:"-"`
  7671. }
  7672. func (s *RegionInstanceGroupList) MarshalJSON() ([]byte, error) {
  7673. type noMethod RegionInstanceGroupList
  7674. raw := noMethod(*s)
  7675. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7676. }
  7677. // RegionInstanceGroupManagerList: Contains a list of managed instance
  7678. // groups.
  7679. type RegionInstanceGroupManagerList struct {
  7680. // Id: [Output Only] The unique identifier for the resource. This
  7681. // identifier is defined by the server.
  7682. Id string `json:"id,omitempty"`
  7683. // Items: A list of managed instance groups.
  7684. Items []*InstanceGroupManager `json:"items,omitempty"`
  7685. // Kind: [Output Only] The resource type, which is always
  7686. // compute#instanceGroupManagerList for a list of managed instance
  7687. // groups that exist in th regional scope.
  7688. Kind string `json:"kind,omitempty"`
  7689. // NextPageToken: [Output only] A token used to continue a truncated
  7690. // list request.
  7691. NextPageToken string `json:"nextPageToken,omitempty"`
  7692. // SelfLink: [Output only] The URL for this resource type. The server
  7693. // generates this URL.
  7694. SelfLink string `json:"selfLink,omitempty"`
  7695. // ServerResponse contains the HTTP response code and headers from the
  7696. // server.
  7697. googleapi.ServerResponse `json:"-"`
  7698. // ForceSendFields is a list of field names (e.g. "Id") to
  7699. // unconditionally include in API requests. By default, fields with
  7700. // empty values are omitted from API requests. However, any non-pointer,
  7701. // non-interface field appearing in ForceSendFields will be sent to the
  7702. // server regardless of whether the field is empty or not. This may be
  7703. // used to include empty fields in Patch requests.
  7704. ForceSendFields []string `json:"-"`
  7705. // NullFields is a list of field names (e.g. "Id") to include in API
  7706. // requests with the JSON null value. By default, fields with empty
  7707. // values are omitted from API requests. However, any field with an
  7708. // empty value appearing in NullFields will be sent to the server as
  7709. // null. It is an error if a field in this list has a non-empty value.
  7710. // This may be used to include null fields in Patch requests.
  7711. NullFields []string `json:"-"`
  7712. }
  7713. func (s *RegionInstanceGroupManagerList) MarshalJSON() ([]byte, error) {
  7714. type noMethod RegionInstanceGroupManagerList
  7715. raw := noMethod(*s)
  7716. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7717. }
  7718. type RegionInstanceGroupManagersAbandonInstancesRequest struct {
  7719. // Instances: The URLs of one or more instances to abandon. This can be
  7720. // a full URL or a partial URL, such as
  7721. // zones/[ZONE]/instances/[INSTANCE_NAME].
  7722. Instances []string `json:"instances,omitempty"`
  7723. // ForceSendFields is a list of field names (e.g. "Instances") to
  7724. // unconditionally include in API requests. By default, fields with
  7725. // empty values are omitted from API requests. However, any non-pointer,
  7726. // non-interface field appearing in ForceSendFields will be sent to the
  7727. // server regardless of whether the field is empty or not. This may be
  7728. // used to include empty fields in Patch requests.
  7729. ForceSendFields []string `json:"-"`
  7730. // NullFields is a list of field names (e.g. "Instances") to include in
  7731. // API requests with the JSON null value. By default, fields with empty
  7732. // values are omitted from API requests. However, any field with an
  7733. // empty value appearing in NullFields will be sent to the server as
  7734. // null. It is an error if a field in this list has a non-empty value.
  7735. // This may be used to include null fields in Patch requests.
  7736. NullFields []string `json:"-"`
  7737. }
  7738. func (s *RegionInstanceGroupManagersAbandonInstancesRequest) MarshalJSON() ([]byte, error) {
  7739. type noMethod RegionInstanceGroupManagersAbandonInstancesRequest
  7740. raw := noMethod(*s)
  7741. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7742. }
  7743. type RegionInstanceGroupManagersDeleteInstancesRequest struct {
  7744. // Instances: The URLs of one or more instances to delete. This can be a
  7745. // full URL or a partial URL, such as
  7746. // zones/[ZONE]/instances/[INSTANCE_NAME].
  7747. Instances []string `json:"instances,omitempty"`
  7748. // ForceSendFields is a list of field names (e.g. "Instances") to
  7749. // unconditionally include in API requests. By default, fields with
  7750. // empty values are omitted from API requests. However, any non-pointer,
  7751. // non-interface field appearing in ForceSendFields will be sent to the
  7752. // server regardless of whether the field is empty or not. This may be
  7753. // used to include empty fields in Patch requests.
  7754. ForceSendFields []string `json:"-"`
  7755. // NullFields is a list of field names (e.g. "Instances") to include in
  7756. // API requests with the JSON null value. By default, fields with empty
  7757. // values are omitted from API requests. However, any field with an
  7758. // empty value appearing in NullFields will be sent to the server as
  7759. // null. It is an error if a field in this list has a non-empty value.
  7760. // This may be used to include null fields in Patch requests.
  7761. NullFields []string `json:"-"`
  7762. }
  7763. func (s *RegionInstanceGroupManagersDeleteInstancesRequest) MarshalJSON() ([]byte, error) {
  7764. type noMethod RegionInstanceGroupManagersDeleteInstancesRequest
  7765. raw := noMethod(*s)
  7766. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7767. }
  7768. type RegionInstanceGroupManagersListInstancesResponse struct {
  7769. // ManagedInstances: List of managed instances.
  7770. ManagedInstances []*ManagedInstance `json:"managedInstances,omitempty"`
  7771. // ServerResponse contains the HTTP response code and headers from the
  7772. // server.
  7773. googleapi.ServerResponse `json:"-"`
  7774. // ForceSendFields is a list of field names (e.g. "ManagedInstances") to
  7775. // unconditionally include in API requests. By default, fields with
  7776. // empty values are omitted from API requests. However, any non-pointer,
  7777. // non-interface field appearing in ForceSendFields will be sent to the
  7778. // server regardless of whether the field is empty or not. This may be
  7779. // used to include empty fields in Patch requests.
  7780. ForceSendFields []string `json:"-"`
  7781. // NullFields is a list of field names (e.g. "ManagedInstances") to
  7782. // include in API requests with the JSON null value. By default, fields
  7783. // with empty values are omitted from API requests. However, any field
  7784. // with an empty value appearing in NullFields will be sent to the
  7785. // server as null. It is an error if a field in this list has a
  7786. // non-empty value. This may be used to include null fields in Patch
  7787. // requests.
  7788. NullFields []string `json:"-"`
  7789. }
  7790. func (s *RegionInstanceGroupManagersListInstancesResponse) MarshalJSON() ([]byte, error) {
  7791. type noMethod RegionInstanceGroupManagersListInstancesResponse
  7792. raw := noMethod(*s)
  7793. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7794. }
  7795. type RegionInstanceGroupManagersRecreateRequest struct {
  7796. // Instances: The URLs of one or more instances to recreate. This can be
  7797. // a full URL or a partial URL, such as
  7798. // zones/[ZONE]/instances/[INSTANCE_NAME].
  7799. Instances []string `json:"instances,omitempty"`
  7800. // ForceSendFields is a list of field names (e.g. "Instances") to
  7801. // unconditionally include in API requests. By default, fields with
  7802. // empty values are omitted from API requests. However, any non-pointer,
  7803. // non-interface field appearing in ForceSendFields will be sent to the
  7804. // server regardless of whether the field is empty or not. This may be
  7805. // used to include empty fields in Patch requests.
  7806. ForceSendFields []string `json:"-"`
  7807. // NullFields is a list of field names (e.g. "Instances") to include in
  7808. // API requests with the JSON null value. By default, fields with empty
  7809. // values are omitted from API requests. However, any field with an
  7810. // empty value appearing in NullFields will be sent to the server as
  7811. // null. It is an error if a field in this list has a non-empty value.
  7812. // This may be used to include null fields in Patch requests.
  7813. NullFields []string `json:"-"`
  7814. }
  7815. func (s *RegionInstanceGroupManagersRecreateRequest) MarshalJSON() ([]byte, error) {
  7816. type noMethod RegionInstanceGroupManagersRecreateRequest
  7817. raw := noMethod(*s)
  7818. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7819. }
  7820. type RegionInstanceGroupManagersSetTargetPoolsRequest struct {
  7821. // Fingerprint: Fingerprint of the target pools information, which is a
  7822. // hash of the contents. This field is used for optimistic locking when
  7823. // you update the target pool entries. This field is optional.
  7824. Fingerprint string `json:"fingerprint,omitempty"`
  7825. // TargetPools: The URL of all TargetPool resources to which instances
  7826. // in the instanceGroup field are added. The target pools automatically
  7827. // apply to all of the instances in the managed instance group.
  7828. TargetPools []string `json:"targetPools,omitempty"`
  7829. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  7830. // unconditionally include in API requests. By default, fields with
  7831. // empty values are omitted from API requests. However, any non-pointer,
  7832. // non-interface field appearing in ForceSendFields will be sent to the
  7833. // server regardless of whether the field is empty or not. This may be
  7834. // used to include empty fields in Patch requests.
  7835. ForceSendFields []string `json:"-"`
  7836. // NullFields is a list of field names (e.g. "Fingerprint") to include
  7837. // in API requests with the JSON null value. By default, fields with
  7838. // empty values are omitted from API requests. However, any field with
  7839. // an empty value appearing in NullFields will be sent to the server as
  7840. // null. It is an error if a field in this list has a non-empty value.
  7841. // This may be used to include null fields in Patch requests.
  7842. NullFields []string `json:"-"`
  7843. }
  7844. func (s *RegionInstanceGroupManagersSetTargetPoolsRequest) MarshalJSON() ([]byte, error) {
  7845. type noMethod RegionInstanceGroupManagersSetTargetPoolsRequest
  7846. raw := noMethod(*s)
  7847. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7848. }
  7849. type RegionInstanceGroupManagersSetTemplateRequest struct {
  7850. // InstanceTemplate: URL of the InstanceTemplate resource from which all
  7851. // new instances will be created.
  7852. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  7853. // ForceSendFields is a list of field names (e.g. "InstanceTemplate") to
  7854. // unconditionally include in API requests. By default, fields with
  7855. // empty values are omitted from API requests. However, any non-pointer,
  7856. // non-interface field appearing in ForceSendFields will be sent to the
  7857. // server regardless of whether the field is empty or not. This may be
  7858. // used to include empty fields in Patch requests.
  7859. ForceSendFields []string `json:"-"`
  7860. // NullFields is a list of field names (e.g. "InstanceTemplate") to
  7861. // include in API requests with the JSON null value. By default, fields
  7862. // with empty values are omitted from API requests. However, any field
  7863. // with an empty value appearing in NullFields will be sent to the
  7864. // server as null. It is an error if a field in this list has a
  7865. // non-empty value. This may be used to include null fields in Patch
  7866. // requests.
  7867. NullFields []string `json:"-"`
  7868. }
  7869. func (s *RegionInstanceGroupManagersSetTemplateRequest) MarshalJSON() ([]byte, error) {
  7870. type noMethod RegionInstanceGroupManagersSetTemplateRequest
  7871. raw := noMethod(*s)
  7872. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7873. }
  7874. type RegionInstanceGroupsListInstances struct {
  7875. // Id: [Output Only] Unique identifier for the resource. Defined by the
  7876. // server.
  7877. Id string `json:"id,omitempty"`
  7878. // Items: A list of instances and any named ports that are assigned to
  7879. // those instances.
  7880. Items []*InstanceWithNamedPorts `json:"items,omitempty"`
  7881. // Kind: The resource type.
  7882. Kind string `json:"kind,omitempty"`
  7883. // NextPageToken: [Output Only] This token allows you to get the next
  7884. // page of results for list requests. If the number of results is larger
  7885. // than maxResults, use the nextPageToken as a value for the query
  7886. // parameter pageToken in the next list request. Subsequent list
  7887. // requests will have their own nextPageToken to continue paging through
  7888. // the results.
  7889. NextPageToken string `json:"nextPageToken,omitempty"`
  7890. // SelfLink: [Output Only] Server-defined URL for the resource.
  7891. SelfLink string `json:"selfLink,omitempty"`
  7892. // ServerResponse contains the HTTP response code and headers from the
  7893. // server.
  7894. googleapi.ServerResponse `json:"-"`
  7895. // ForceSendFields is a list of field names (e.g. "Id") to
  7896. // unconditionally include in API requests. By default, fields with
  7897. // empty values are omitted from API requests. However, any non-pointer,
  7898. // non-interface field appearing in ForceSendFields will be sent to the
  7899. // server regardless of whether the field is empty or not. This may be
  7900. // used to include empty fields in Patch requests.
  7901. ForceSendFields []string `json:"-"`
  7902. // NullFields is a list of field names (e.g. "Id") to include in API
  7903. // requests with the JSON null value. By default, fields with empty
  7904. // values are omitted from API requests. However, any field with an
  7905. // empty value appearing in NullFields will be sent to the server as
  7906. // null. It is an error if a field in this list has a non-empty value.
  7907. // This may be used to include null fields in Patch requests.
  7908. NullFields []string `json:"-"`
  7909. }
  7910. func (s *RegionInstanceGroupsListInstances) MarshalJSON() ([]byte, error) {
  7911. type noMethod RegionInstanceGroupsListInstances
  7912. raw := noMethod(*s)
  7913. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7914. }
  7915. type RegionInstanceGroupsListInstancesRequest struct {
  7916. // InstanceState: Instances in which state should be returned. Valid
  7917. // options are: 'ALL', 'RUNNING'. By default, it lists all instances.
  7918. //
  7919. // Possible values:
  7920. // "ALL"
  7921. // "RUNNING"
  7922. InstanceState string `json:"instanceState,omitempty"`
  7923. // PortName: Name of port user is interested in. It is optional. If it
  7924. // is set, only information about this ports will be returned. If it is
  7925. // not set, all the named ports will be returned. Always lists all
  7926. // instances.
  7927. PortName string `json:"portName,omitempty"`
  7928. // ForceSendFields is a list of field names (e.g. "InstanceState") to
  7929. // unconditionally include in API requests. By default, fields with
  7930. // empty values are omitted from API requests. However, any non-pointer,
  7931. // non-interface field appearing in ForceSendFields will be sent to the
  7932. // server regardless of whether the field is empty or not. This may be
  7933. // used to include empty fields in Patch requests.
  7934. ForceSendFields []string `json:"-"`
  7935. // NullFields is a list of field names (e.g. "InstanceState") to include
  7936. // in API requests with the JSON null value. By default, fields with
  7937. // empty values are omitted from API requests. However, any field with
  7938. // an empty value appearing in NullFields will be sent to the server as
  7939. // null. It is an error if a field in this list has a non-empty value.
  7940. // This may be used to include null fields in Patch requests.
  7941. NullFields []string `json:"-"`
  7942. }
  7943. func (s *RegionInstanceGroupsListInstancesRequest) MarshalJSON() ([]byte, error) {
  7944. type noMethod RegionInstanceGroupsListInstancesRequest
  7945. raw := noMethod(*s)
  7946. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7947. }
  7948. type RegionInstanceGroupsSetNamedPortsRequest struct {
  7949. // Fingerprint: The fingerprint of the named ports information for this
  7950. // instance group. Use this optional property to prevent conflicts when
  7951. // multiple users change the named ports settings concurrently. Obtain
  7952. // the fingerprint with the instanceGroups.get method. Then, include the
  7953. // fingerprint in your request to ensure that you do not overwrite
  7954. // changes that were applied from another concurrent request.
  7955. Fingerprint string `json:"fingerprint,omitempty"`
  7956. // NamedPorts: The list of named ports to set for this instance group.
  7957. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  7958. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  7959. // unconditionally include in API requests. By default, fields with
  7960. // empty values are omitted from API requests. However, any non-pointer,
  7961. // non-interface field appearing in ForceSendFields will be sent to the
  7962. // server regardless of whether the field is empty or not. This may be
  7963. // used to include empty fields in Patch requests.
  7964. ForceSendFields []string `json:"-"`
  7965. // NullFields is a list of field names (e.g. "Fingerprint") to include
  7966. // in API requests with the JSON null value. By default, fields with
  7967. // empty values are omitted from API requests. However, any field with
  7968. // an empty value appearing in NullFields will be sent to the server as
  7969. // null. It is an error if a field in this list has a non-empty value.
  7970. // This may be used to include null fields in Patch requests.
  7971. NullFields []string `json:"-"`
  7972. }
  7973. func (s *RegionInstanceGroupsSetNamedPortsRequest) MarshalJSON() ([]byte, error) {
  7974. type noMethod RegionInstanceGroupsSetNamedPortsRequest
  7975. raw := noMethod(*s)
  7976. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7977. }
  7978. // RegionList: Contains a list of region resources.
  7979. type RegionList struct {
  7980. // Id: [Output Only] The unique identifier for the resource. This
  7981. // identifier is defined by the server.
  7982. Id string `json:"id,omitempty"`
  7983. // Items: [Output Only] A list of Region resources.
  7984. Items []*Region `json:"items,omitempty"`
  7985. // Kind: [Output Only] Type of resource. Always compute#regionList for
  7986. // lists of regions.
  7987. Kind string `json:"kind,omitempty"`
  7988. // NextPageToken: [Output Only] This token allows you to get the next
  7989. // page of results for list requests. If the number of results is larger
  7990. // than maxResults, use the nextPageToken as a value for the query
  7991. // parameter pageToken in the next list request. Subsequent list
  7992. // requests will have their own nextPageToken to continue paging through
  7993. // the results.
  7994. NextPageToken string `json:"nextPageToken,omitempty"`
  7995. // SelfLink: [Output Only] Server-defined URL for this resource.
  7996. SelfLink string `json:"selfLink,omitempty"`
  7997. // ServerResponse contains the HTTP response code and headers from the
  7998. // server.
  7999. googleapi.ServerResponse `json:"-"`
  8000. // ForceSendFields is a list of field names (e.g. "Id") to
  8001. // unconditionally include in API requests. By default, fields with
  8002. // empty values are omitted from API requests. However, any non-pointer,
  8003. // non-interface field appearing in ForceSendFields will be sent to the
  8004. // server regardless of whether the field is empty or not. This may be
  8005. // used to include empty fields in Patch requests.
  8006. ForceSendFields []string `json:"-"`
  8007. // NullFields is a list of field names (e.g. "Id") to include in API
  8008. // requests with the JSON null value. By default, fields with empty
  8009. // values are omitted from API requests. However, any field with an
  8010. // empty value appearing in NullFields will be sent to the server as
  8011. // null. It is an error if a field in this list has a non-empty value.
  8012. // This may be used to include null fields in Patch requests.
  8013. NullFields []string `json:"-"`
  8014. }
  8015. func (s *RegionList) MarshalJSON() ([]byte, error) {
  8016. type noMethod RegionList
  8017. raw := noMethod(*s)
  8018. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8019. }
  8020. type ResourceGroupReference struct {
  8021. // Group: A URI referencing one of the instance groups listed in the
  8022. // backend service.
  8023. Group string `json:"group,omitempty"`
  8024. // ForceSendFields is a list of field names (e.g. "Group") to
  8025. // unconditionally include in API requests. By default, fields with
  8026. // empty values are omitted from API requests. However, any non-pointer,
  8027. // non-interface field appearing in ForceSendFields will be sent to the
  8028. // server regardless of whether the field is empty or not. This may be
  8029. // used to include empty fields in Patch requests.
  8030. ForceSendFields []string `json:"-"`
  8031. // NullFields is a list of field names (e.g. "Group") to include in API
  8032. // requests with the JSON null value. By default, fields with empty
  8033. // values are omitted from API requests. However, any field with an
  8034. // empty value appearing in NullFields will be sent to the server as
  8035. // null. It is an error if a field in this list has a non-empty value.
  8036. // This may be used to include null fields in Patch requests.
  8037. NullFields []string `json:"-"`
  8038. }
  8039. func (s *ResourceGroupReference) MarshalJSON() ([]byte, error) {
  8040. type noMethod ResourceGroupReference
  8041. raw := noMethod(*s)
  8042. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8043. }
  8044. // Route: Represents a Route resource. A route specifies how certain
  8045. // packets should be handled by the network. Routes are associated with
  8046. // instances by tags and the set of routes for a particular instance is
  8047. // called its routing table.
  8048. //
  8049. // For each packet leaving an instance, the system searches that
  8050. // instance's routing table for a single best matching route. Routes
  8051. // match packets by destination IP address, preferring smaller or more
  8052. // specific ranges over larger ones. If there is a tie, the system
  8053. // selects the route with the smallest priority value. If there is still
  8054. // a tie, it uses the layer three and four packet headers to select just
  8055. // one of the remaining matching routes. The packet is then forwarded as
  8056. // specified by the nextHop field of the winning route - either to
  8057. // another instance destination, an instance gateway, or a Google
  8058. // Compute Engine-operated gateway.
  8059. //
  8060. // Packets that do not match any route in the sending instance's routing
  8061. // table are dropped.
  8062. type Route struct {
  8063. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  8064. // format.
  8065. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  8066. // Description: An optional description of this resource. Provide this
  8067. // property when you create the resource.
  8068. Description string `json:"description,omitempty"`
  8069. // DestRange: The destination range of outgoing packets that this route
  8070. // applies to. Only IPv4 is supported.
  8071. DestRange string `json:"destRange,omitempty"`
  8072. // Id: [Output Only] The unique identifier for the resource. This
  8073. // identifier is defined by the server.
  8074. Id uint64 `json:"id,omitempty,string"`
  8075. // Kind: [Output Only] Type of this resource. Always compute#routes for
  8076. // Route resources.
  8077. Kind string `json:"kind,omitempty"`
  8078. // Name: Name of the resource. Provided by the client when the resource
  8079. // is created. The name must be 1-63 characters long, and comply with
  8080. // RFC1035. Specifically, the name must be 1-63 characters long and
  8081. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  8082. // the first character must be a lowercase letter, and all following
  8083. // characters must be a dash, lowercase letter, or digit, except the
  8084. // last character, which cannot be a dash.
  8085. Name string `json:"name,omitempty"`
  8086. // Network: Fully-qualified URL of the network that this route applies
  8087. // to.
  8088. Network string `json:"network,omitempty"`
  8089. // NextHopGateway: The URL to a gateway that should handle matching
  8090. // packets. You can only specify the internet gateway using a full or
  8091. // partial valid URL:
  8092. // projects/<project-id>/global/gateways/default-internet-gateway
  8093. NextHopGateway string `json:"nextHopGateway,omitempty"`
  8094. // NextHopInstance: The URL to an instance that should handle matching
  8095. // packets. You can specify this as a full or partial URL. For
  8096. // example:
  8097. // https://www.googleapis.com/compute/v1/projects/project/zones/
  8098. // zone/instances/
  8099. NextHopInstance string `json:"nextHopInstance,omitempty"`
  8100. // NextHopIp: The network IP address of an instance that should handle
  8101. // matching packets. Only IPv4 is supported.
  8102. NextHopIp string `json:"nextHopIp,omitempty"`
  8103. // NextHopNetwork: The URL of the local network if it should handle
  8104. // matching packets.
  8105. NextHopNetwork string `json:"nextHopNetwork,omitempty"`
  8106. // NextHopPeering: [Output Only] The network peering name that should
  8107. // handle matching packets, which should conform to RFC1035.
  8108. NextHopPeering string `json:"nextHopPeering,omitempty"`
  8109. // NextHopVpnTunnel: The URL to a VpnTunnel that should handle matching
  8110. // packets.
  8111. NextHopVpnTunnel string `json:"nextHopVpnTunnel,omitempty"`
  8112. // Priority: The priority of this route. Priority is used to break ties
  8113. // in cases where there is more than one matching route of equal prefix
  8114. // length. In the case of two routes with equal prefix length, the one
  8115. // with the lowest-numbered priority value wins. Default value is 1000.
  8116. // Valid range is 0 through 65535.
  8117. Priority int64 `json:"priority,omitempty"`
  8118. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  8119. // resource.
  8120. SelfLink string `json:"selfLink,omitempty"`
  8121. // Tags: A list of instance tags to which this route applies.
  8122. Tags []string `json:"tags,omitempty"`
  8123. // Warnings: [Output Only] If potential misconfigurations are detected
  8124. // for this route, this field will be populated with warning messages.
  8125. Warnings []*RouteWarnings `json:"warnings,omitempty"`
  8126. // ServerResponse contains the HTTP response code and headers from the
  8127. // server.
  8128. googleapi.ServerResponse `json:"-"`
  8129. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  8130. // to unconditionally include in API requests. By default, fields with
  8131. // empty values are omitted from API requests. However, any non-pointer,
  8132. // non-interface field appearing in ForceSendFields will be sent to the
  8133. // server regardless of whether the field is empty or not. This may be
  8134. // used to include empty fields in Patch requests.
  8135. ForceSendFields []string `json:"-"`
  8136. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  8137. // include in API requests with the JSON null value. By default, fields
  8138. // with empty values are omitted from API requests. However, any field
  8139. // with an empty value appearing in NullFields will be sent to the
  8140. // server as null. It is an error if a field in this list has a
  8141. // non-empty value. This may be used to include null fields in Patch
  8142. // requests.
  8143. NullFields []string `json:"-"`
  8144. }
  8145. func (s *Route) MarshalJSON() ([]byte, error) {
  8146. type noMethod Route
  8147. raw := noMethod(*s)
  8148. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8149. }
  8150. type RouteWarnings struct {
  8151. // Code: [Output Only] A warning code, if applicable. For example,
  8152. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  8153. // the response.
  8154. //
  8155. // Possible values:
  8156. // "CLEANUP_FAILED"
  8157. // "DEPRECATED_RESOURCE_USED"
  8158. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  8159. // "FIELD_VALUE_OVERRIDEN"
  8160. // "INJECTED_KERNELS_DEPRECATED"
  8161. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  8162. // "NEXT_HOP_CANNOT_IP_FORWARD"
  8163. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  8164. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  8165. // "NEXT_HOP_NOT_RUNNING"
  8166. // "NOT_CRITICAL_ERROR"
  8167. // "NO_RESULTS_ON_PAGE"
  8168. // "REQUIRED_TOS_AGREEMENT"
  8169. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  8170. // "RESOURCE_NOT_DELETED"
  8171. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  8172. // "UNREACHABLE"
  8173. Code string `json:"code,omitempty"`
  8174. // Data: [Output Only] Metadata about this warning in key: value format.
  8175. // For example:
  8176. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  8177. Data []*RouteWarningsData `json:"data,omitempty"`
  8178. // Message: [Output Only] A human-readable description of the warning
  8179. // code.
  8180. Message string `json:"message,omitempty"`
  8181. // ForceSendFields is a list of field names (e.g. "Code") to
  8182. // unconditionally include in API requests. By default, fields with
  8183. // empty values are omitted from API requests. However, any non-pointer,
  8184. // non-interface field appearing in ForceSendFields will be sent to the
  8185. // server regardless of whether the field is empty or not. This may be
  8186. // used to include empty fields in Patch requests.
  8187. ForceSendFields []string `json:"-"`
  8188. // NullFields is a list of field names (e.g. "Code") to include in API
  8189. // requests with the JSON null value. By default, fields with empty
  8190. // values are omitted from API requests. However, any field with an
  8191. // empty value appearing in NullFields will be sent to the server as
  8192. // null. It is an error if a field in this list has a non-empty value.
  8193. // This may be used to include null fields in Patch requests.
  8194. NullFields []string `json:"-"`
  8195. }
  8196. func (s *RouteWarnings) MarshalJSON() ([]byte, error) {
  8197. type noMethod RouteWarnings
  8198. raw := noMethod(*s)
  8199. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8200. }
  8201. type RouteWarningsData struct {
  8202. // Key: [Output Only] A key that provides more detail on the warning
  8203. // being returned. For example, for warnings where there are no results
  8204. // in a list request for a particular zone, this key might be scope and
  8205. // the key value might be the zone name. Other examples might be a key
  8206. // indicating a deprecated resource and a suggested replacement, or a
  8207. // warning about invalid network settings (for example, if an instance
  8208. // attempts to perform IP forwarding but is not enabled for IP
  8209. // forwarding).
  8210. Key string `json:"key,omitempty"`
  8211. // Value: [Output Only] A warning data value corresponding to the key.
  8212. Value string `json:"value,omitempty"`
  8213. // ForceSendFields is a list of field names (e.g. "Key") to
  8214. // unconditionally include in API requests. By default, fields with
  8215. // empty values are omitted from API requests. However, any non-pointer,
  8216. // non-interface field appearing in ForceSendFields will be sent to the
  8217. // server regardless of whether the field is empty or not. This may be
  8218. // used to include empty fields in Patch requests.
  8219. ForceSendFields []string `json:"-"`
  8220. // NullFields is a list of field names (e.g. "Key") to include in API
  8221. // requests with the JSON null value. By default, fields with empty
  8222. // values are omitted from API requests. However, any field with an
  8223. // empty value appearing in NullFields will be sent to the server as
  8224. // null. It is an error if a field in this list has a non-empty value.
  8225. // This may be used to include null fields in Patch requests.
  8226. NullFields []string `json:"-"`
  8227. }
  8228. func (s *RouteWarningsData) MarshalJSON() ([]byte, error) {
  8229. type noMethod RouteWarningsData
  8230. raw := noMethod(*s)
  8231. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8232. }
  8233. // RouteList: Contains a list of Route resources.
  8234. type RouteList struct {
  8235. // Id: [Output Only] Unique identifier for the resource. Defined by the
  8236. // server.
  8237. Id string `json:"id,omitempty"`
  8238. // Items: [Output Only] A list of Route resources.
  8239. Items []*Route `json:"items,omitempty"`
  8240. // Kind: Type of resource.
  8241. Kind string `json:"kind,omitempty"`
  8242. // NextPageToken: [Output Only] This token allows you to get the next
  8243. // page of results for list requests. If the number of results is larger
  8244. // than maxResults, use the nextPageToken as a value for the query
  8245. // parameter pageToken in the next list request. Subsequent list
  8246. // requests will have their own nextPageToken to continue paging through
  8247. // the results.
  8248. NextPageToken string `json:"nextPageToken,omitempty"`
  8249. // SelfLink: [Output Only] Server-defined URL for this resource.
  8250. SelfLink string `json:"selfLink,omitempty"`
  8251. // ServerResponse contains the HTTP response code and headers from the
  8252. // server.
  8253. googleapi.ServerResponse `json:"-"`
  8254. // ForceSendFields is a list of field names (e.g. "Id") to
  8255. // unconditionally include in API requests. By default, fields with
  8256. // empty values are omitted from API requests. However, any non-pointer,
  8257. // non-interface field appearing in ForceSendFields will be sent to the
  8258. // server regardless of whether the field is empty or not. This may be
  8259. // used to include empty fields in Patch requests.
  8260. ForceSendFields []string `json:"-"`
  8261. // NullFields is a list of field names (e.g. "Id") to include in API
  8262. // requests with the JSON null value. By default, fields with empty
  8263. // values are omitted from API requests. However, any field with an
  8264. // empty value appearing in NullFields will be sent to the server as
  8265. // null. It is an error if a field in this list has a non-empty value.
  8266. // This may be used to include null fields in Patch requests.
  8267. NullFields []string `json:"-"`
  8268. }
  8269. func (s *RouteList) MarshalJSON() ([]byte, error) {
  8270. type noMethod RouteList
  8271. raw := noMethod(*s)
  8272. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8273. }
  8274. // Router: Router resource.
  8275. type Router struct {
  8276. // Bgp: BGP information specific to this router.
  8277. Bgp *RouterBgp `json:"bgp,omitempty"`
  8278. // BgpPeers: BGP information that needs to be configured into the
  8279. // routing stack to establish the BGP peering. It must specify peer ASN
  8280. // and either interface name, IP, or peer IP. Please refer to RFC4273.
  8281. BgpPeers []*RouterBgpPeer `json:"bgpPeers,omitempty"`
  8282. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  8283. // format.
  8284. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  8285. // Description: An optional description of this resource. Provide this
  8286. // property when you create the resource.
  8287. Description string `json:"description,omitempty"`
  8288. // Id: [Output Only] The unique identifier for the resource. This
  8289. // identifier is defined by the server.
  8290. Id uint64 `json:"id,omitempty,string"`
  8291. // Interfaces: Router interfaces. Each interface requires either one
  8292. // linked resource (e.g. linkedVpnTunnel), or IP address and IP address
  8293. // range (e.g. ipRange), or both.
  8294. Interfaces []*RouterInterface `json:"interfaces,omitempty"`
  8295. // Kind: [Output Only] Type of resource. Always compute#router for
  8296. // routers.
  8297. Kind string `json:"kind,omitempty"`
  8298. // Name: Name of the resource. Provided by the client when the resource
  8299. // is created. The name must be 1-63 characters long, and comply with
  8300. // RFC1035. Specifically, the name must be 1-63 characters long and
  8301. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  8302. // the first character must be a lowercase letter, and all following
  8303. // characters must be a dash, lowercase letter, or digit, except the
  8304. // last character, which cannot be a dash.
  8305. Name string `json:"name,omitempty"`
  8306. // Network: URI of the network to which this router belongs.
  8307. Network string `json:"network,omitempty"`
  8308. // Region: [Output Only] URI of the region where the router resides.
  8309. Region string `json:"region,omitempty"`
  8310. // SelfLink: [Output Only] Server-defined URL for the resource.
  8311. SelfLink string `json:"selfLink,omitempty"`
  8312. // ServerResponse contains the HTTP response code and headers from the
  8313. // server.
  8314. googleapi.ServerResponse `json:"-"`
  8315. // ForceSendFields is a list of field names (e.g. "Bgp") to
  8316. // unconditionally include in API requests. By default, fields with
  8317. // empty values are omitted from API requests. However, any non-pointer,
  8318. // non-interface field appearing in ForceSendFields will be sent to the
  8319. // server regardless of whether the field is empty or not. This may be
  8320. // used to include empty fields in Patch requests.
  8321. ForceSendFields []string `json:"-"`
  8322. // NullFields is a list of field names (e.g. "Bgp") to include in API
  8323. // requests with the JSON null value. By default, fields with empty
  8324. // values are omitted from API requests. However, any field with an
  8325. // empty value appearing in NullFields will be sent to the server as
  8326. // null. It is an error if a field in this list has a non-empty value.
  8327. // This may be used to include null fields in Patch requests.
  8328. NullFields []string `json:"-"`
  8329. }
  8330. func (s *Router) MarshalJSON() ([]byte, error) {
  8331. type noMethod Router
  8332. raw := noMethod(*s)
  8333. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8334. }
  8335. // RouterAggregatedList: Contains a list of routers.
  8336. type RouterAggregatedList struct {
  8337. // Id: [Output Only] The unique identifier for the resource. This
  8338. // identifier is defined by the server.
  8339. Id string `json:"id,omitempty"`
  8340. // Items: A map of scoped router lists.
  8341. Items map[string]RoutersScopedList `json:"items,omitempty"`
  8342. // Kind: Type of resource.
  8343. Kind string `json:"kind,omitempty"`
  8344. // NextPageToken: [Output Only] This token allows you to get the next
  8345. // page of results for list requests. If the number of results is larger
  8346. // than maxResults, use the nextPageToken as a value for the query
  8347. // parameter pageToken in the next list request. Subsequent list
  8348. // requests will have their own nextPageToken to continue paging through
  8349. // the results.
  8350. NextPageToken string `json:"nextPageToken,omitempty"`
  8351. // SelfLink: [Output Only] Server-defined URL for this resource.
  8352. SelfLink string `json:"selfLink,omitempty"`
  8353. // ServerResponse contains the HTTP response code and headers from the
  8354. // server.
  8355. googleapi.ServerResponse `json:"-"`
  8356. // ForceSendFields is a list of field names (e.g. "Id") to
  8357. // unconditionally include in API requests. By default, fields with
  8358. // empty values are omitted from API requests. However, any non-pointer,
  8359. // non-interface field appearing in ForceSendFields will be sent to the
  8360. // server regardless of whether the field is empty or not. This may be
  8361. // used to include empty fields in Patch requests.
  8362. ForceSendFields []string `json:"-"`
  8363. // NullFields is a list of field names (e.g. "Id") to include in API
  8364. // requests with the JSON null value. By default, fields with empty
  8365. // values are omitted from API requests. However, any field with an
  8366. // empty value appearing in NullFields will be sent to the server as
  8367. // null. It is an error if a field in this list has a non-empty value.
  8368. // This may be used to include null fields in Patch requests.
  8369. NullFields []string `json:"-"`
  8370. }
  8371. func (s *RouterAggregatedList) MarshalJSON() ([]byte, error) {
  8372. type noMethod RouterAggregatedList
  8373. raw := noMethod(*s)
  8374. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8375. }
  8376. type RouterBgp struct {
  8377. // Asn: Local BGP Autonomous System Number (ASN). Must be an RFC6996
  8378. // private ASN, either 16-bit or 32-bit. The value will be fixed for
  8379. // this router resource. All VPN tunnels that link to this router will
  8380. // have the same local ASN.
  8381. Asn int64 `json:"asn,omitempty"`
  8382. // ForceSendFields is a list of field names (e.g. "Asn") to
  8383. // unconditionally include in API requests. By default, fields with
  8384. // empty values are omitted from API requests. However, any non-pointer,
  8385. // non-interface field appearing in ForceSendFields will be sent to the
  8386. // server regardless of whether the field is empty or not. This may be
  8387. // used to include empty fields in Patch requests.
  8388. ForceSendFields []string `json:"-"`
  8389. // NullFields is a list of field names (e.g. "Asn") to include in API
  8390. // requests with the JSON null value. By default, fields with empty
  8391. // values are omitted from API requests. However, any field with an
  8392. // empty value appearing in NullFields will be sent to the server as
  8393. // null. It is an error if a field in this list has a non-empty value.
  8394. // This may be used to include null fields in Patch requests.
  8395. NullFields []string `json:"-"`
  8396. }
  8397. func (s *RouterBgp) MarshalJSON() ([]byte, error) {
  8398. type noMethod RouterBgp
  8399. raw := noMethod(*s)
  8400. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8401. }
  8402. type RouterBgpPeer struct {
  8403. // AdvertisedRoutePriority: The priority of routes advertised to this
  8404. // BGP peer. In the case where there is more than one matching route of
  8405. // maximum length, the routes with lowest priority value win.
  8406. AdvertisedRoutePriority int64 `json:"advertisedRoutePriority,omitempty"`
  8407. // InterfaceName: Name of the interface the BGP peer is associated with.
  8408. InterfaceName string `json:"interfaceName,omitempty"`
  8409. // IpAddress: IP address of the interface inside Google Cloud Platform.
  8410. // Only IPv4 is supported.
  8411. IpAddress string `json:"ipAddress,omitempty"`
  8412. // Name: Name of this BGP peer. The name must be 1-63 characters long
  8413. // and comply with RFC1035.
  8414. Name string `json:"name,omitempty"`
  8415. // PeerAsn: Peer BGP Autonomous System Number (ASN). For VPN use case,
  8416. // this value can be different for every tunnel.
  8417. PeerAsn int64 `json:"peerAsn,omitempty"`
  8418. // PeerIpAddress: IP address of the BGP interface outside Google cloud.
  8419. // Only IPv4 is supported.
  8420. PeerIpAddress string `json:"peerIpAddress,omitempty"`
  8421. // ForceSendFields is a list of field names (e.g.
  8422. // "AdvertisedRoutePriority") to unconditionally include in API
  8423. // requests. By default, fields with empty values are omitted from API
  8424. // requests. However, any non-pointer, non-interface field appearing in
  8425. // ForceSendFields will be sent to the server regardless of whether the
  8426. // field is empty or not. This may be used to include empty fields in
  8427. // Patch requests.
  8428. ForceSendFields []string `json:"-"`
  8429. // NullFields is a list of field names (e.g. "AdvertisedRoutePriority")
  8430. // to include in API requests with the JSON null value. By default,
  8431. // fields with empty values are omitted from API requests. However, any
  8432. // field with an empty value appearing in NullFields will be sent to the
  8433. // server as null. It is an error if a field in this list has a
  8434. // non-empty value. This may be used to include null fields in Patch
  8435. // requests.
  8436. NullFields []string `json:"-"`
  8437. }
  8438. func (s *RouterBgpPeer) MarshalJSON() ([]byte, error) {
  8439. type noMethod RouterBgpPeer
  8440. raw := noMethod(*s)
  8441. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8442. }
  8443. type RouterInterface struct {
  8444. // IpRange: IP address and range of the interface. The IP range must be
  8445. // in the RFC3927 link-local IP space. The value must be a
  8446. // CIDR-formatted string, for example: 169.254.0.1/30. NOTE: Do not
  8447. // truncate the address as it represents the IP address of the
  8448. // interface.
  8449. IpRange string `json:"ipRange,omitempty"`
  8450. // LinkedVpnTunnel: URI of the linked VPN tunnel. It must be in the same
  8451. // region as the router. Each interface can have at most one linked
  8452. // resource and it could either be a VPN Tunnel or an interconnect
  8453. // attachment.
  8454. LinkedVpnTunnel string `json:"linkedVpnTunnel,omitempty"`
  8455. // Name: Name of this interface entry. The name must be 1-63 characters
  8456. // long and comply with RFC1035.
  8457. Name string `json:"name,omitempty"`
  8458. // ForceSendFields is a list of field names (e.g. "IpRange") to
  8459. // unconditionally include in API requests. By default, fields with
  8460. // empty values are omitted from API requests. However, any non-pointer,
  8461. // non-interface field appearing in ForceSendFields will be sent to the
  8462. // server regardless of whether the field is empty or not. This may be
  8463. // used to include empty fields in Patch requests.
  8464. ForceSendFields []string `json:"-"`
  8465. // NullFields is a list of field names (e.g. "IpRange") to include in
  8466. // API requests with the JSON null value. By default, fields with empty
  8467. // values are omitted from API requests. However, any field with an
  8468. // empty value appearing in NullFields will be sent to the server as
  8469. // null. It is an error if a field in this list has a non-empty value.
  8470. // This may be used to include null fields in Patch requests.
  8471. NullFields []string `json:"-"`
  8472. }
  8473. func (s *RouterInterface) MarshalJSON() ([]byte, error) {
  8474. type noMethod RouterInterface
  8475. raw := noMethod(*s)
  8476. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8477. }
  8478. // RouterList: Contains a list of Router resources.
  8479. type RouterList struct {
  8480. // Id: [Output Only] The unique identifier for the resource. This
  8481. // identifier is defined by the server.
  8482. Id string `json:"id,omitempty"`
  8483. // Items: A list of Router resources.
  8484. Items []*Router `json:"items,omitempty"`
  8485. // Kind: [Output Only] Type of resource. Always compute#router for
  8486. // routers.
  8487. Kind string `json:"kind,omitempty"`
  8488. // NextPageToken: [Output Only] This token allows you to get the next
  8489. // page of results for list requests. If the number of results is larger
  8490. // than maxResults, use the nextPageToken as a value for the query
  8491. // parameter pageToken in the next list request. Subsequent list
  8492. // requests will have their own nextPageToken to continue paging through
  8493. // the results.
  8494. NextPageToken string `json:"nextPageToken,omitempty"`
  8495. // SelfLink: [Output Only] Server-defined URL for this resource.
  8496. SelfLink string `json:"selfLink,omitempty"`
  8497. // ServerResponse contains the HTTP response code and headers from the
  8498. // server.
  8499. googleapi.ServerResponse `json:"-"`
  8500. // ForceSendFields is a list of field names (e.g. "Id") to
  8501. // unconditionally include in API requests. By default, fields with
  8502. // empty values are omitted from API requests. However, any non-pointer,
  8503. // non-interface field appearing in ForceSendFields will be sent to the
  8504. // server regardless of whether the field is empty or not. This may be
  8505. // used to include empty fields in Patch requests.
  8506. ForceSendFields []string `json:"-"`
  8507. // NullFields is a list of field names (e.g. "Id") to include in API
  8508. // requests with the JSON null value. By default, fields with empty
  8509. // values are omitted from API requests. However, any field with an
  8510. // empty value appearing in NullFields will be sent to the server as
  8511. // null. It is an error if a field in this list has a non-empty value.
  8512. // This may be used to include null fields in Patch requests.
  8513. NullFields []string `json:"-"`
  8514. }
  8515. func (s *RouterList) MarshalJSON() ([]byte, error) {
  8516. type noMethod RouterList
  8517. raw := noMethod(*s)
  8518. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8519. }
  8520. type RouterStatus struct {
  8521. // BestRoutes: Best routes for this router's network.
  8522. BestRoutes []*Route `json:"bestRoutes,omitempty"`
  8523. // BestRoutesForRouter: Best routes learned by this router.
  8524. BestRoutesForRouter []*Route `json:"bestRoutesForRouter,omitempty"`
  8525. BgpPeerStatus []*RouterStatusBgpPeerStatus `json:"bgpPeerStatus,omitempty"`
  8526. // Network: URI of the network to which this router belongs.
  8527. Network string `json:"network,omitempty"`
  8528. // ForceSendFields is a list of field names (e.g. "BestRoutes") to
  8529. // unconditionally include in API requests. By default, fields with
  8530. // empty values are omitted from API requests. However, any non-pointer,
  8531. // non-interface field appearing in ForceSendFields will be sent to the
  8532. // server regardless of whether the field is empty or not. This may be
  8533. // used to include empty fields in Patch requests.
  8534. ForceSendFields []string `json:"-"`
  8535. // NullFields is a list of field names (e.g. "BestRoutes") to include in
  8536. // API requests with the JSON null value. By default, fields with empty
  8537. // values are omitted from API requests. However, any field with an
  8538. // empty value appearing in NullFields will be sent to the server as
  8539. // null. It is an error if a field in this list has a non-empty value.
  8540. // This may be used to include null fields in Patch requests.
  8541. NullFields []string `json:"-"`
  8542. }
  8543. func (s *RouterStatus) MarshalJSON() ([]byte, error) {
  8544. type noMethod RouterStatus
  8545. raw := noMethod(*s)
  8546. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8547. }
  8548. type RouterStatusBgpPeerStatus struct {
  8549. // AdvertisedRoutes: Routes that were advertised to the remote BGP peer
  8550. AdvertisedRoutes []*Route `json:"advertisedRoutes,omitempty"`
  8551. // IpAddress: IP address of the local BGP interface.
  8552. IpAddress string `json:"ipAddress,omitempty"`
  8553. // LinkedVpnTunnel: URL of the VPN tunnel that this BGP peer controls.
  8554. LinkedVpnTunnel string `json:"linkedVpnTunnel,omitempty"`
  8555. // Name: Name of this BGP peer. Unique within the Routers resource.
  8556. Name string `json:"name,omitempty"`
  8557. // NumLearnedRoutes: Number of routes learned from the remote BGP Peer.
  8558. NumLearnedRoutes int64 `json:"numLearnedRoutes,omitempty"`
  8559. // PeerIpAddress: IP address of the remote BGP interface.
  8560. PeerIpAddress string `json:"peerIpAddress,omitempty"`
  8561. // State: BGP state as specified in RFC1771.
  8562. State string `json:"state,omitempty"`
  8563. // Status: Status of the BGP peer: {UP, DOWN}
  8564. //
  8565. // Possible values:
  8566. // "DOWN"
  8567. // "UNKNOWN"
  8568. // "UP"
  8569. Status string `json:"status,omitempty"`
  8570. // Uptime: Time this session has been up. Format: 14 years, 51 weeks, 6
  8571. // days, 23 hours, 59 minutes, 59 seconds
  8572. Uptime string `json:"uptime,omitempty"`
  8573. // UptimeSeconds: Time this session has been up, in seconds. Format: 145
  8574. UptimeSeconds string `json:"uptimeSeconds,omitempty"`
  8575. // ForceSendFields is a list of field names (e.g. "AdvertisedRoutes") to
  8576. // unconditionally include in API requests. By default, fields with
  8577. // empty values are omitted from API requests. However, any non-pointer,
  8578. // non-interface field appearing in ForceSendFields will be sent to the
  8579. // server regardless of whether the field is empty or not. This may be
  8580. // used to include empty fields in Patch requests.
  8581. ForceSendFields []string `json:"-"`
  8582. // NullFields is a list of field names (e.g. "AdvertisedRoutes") to
  8583. // include in API requests with the JSON null value. By default, fields
  8584. // with empty values are omitted from API requests. However, any field
  8585. // with an empty value appearing in NullFields will be sent to the
  8586. // server as null. It is an error if a field in this list has a
  8587. // non-empty value. This may be used to include null fields in Patch
  8588. // requests.
  8589. NullFields []string `json:"-"`
  8590. }
  8591. func (s *RouterStatusBgpPeerStatus) MarshalJSON() ([]byte, error) {
  8592. type noMethod RouterStatusBgpPeerStatus
  8593. raw := noMethod(*s)
  8594. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8595. }
  8596. type RouterStatusResponse struct {
  8597. // Kind: Type of resource.
  8598. Kind string `json:"kind,omitempty"`
  8599. Result *RouterStatus `json:"result,omitempty"`
  8600. // ServerResponse contains the HTTP response code and headers from the
  8601. // server.
  8602. googleapi.ServerResponse `json:"-"`
  8603. // ForceSendFields is a list of field names (e.g. "Kind") to
  8604. // unconditionally include in API requests. By default, fields with
  8605. // empty values are omitted from API requests. However, any non-pointer,
  8606. // non-interface field appearing in ForceSendFields will be sent to the
  8607. // server regardless of whether the field is empty or not. This may be
  8608. // used to include empty fields in Patch requests.
  8609. ForceSendFields []string `json:"-"`
  8610. // NullFields is a list of field names (e.g. "Kind") to include in API
  8611. // requests with the JSON null value. By default, fields with empty
  8612. // values are omitted from API requests. However, any field with an
  8613. // empty value appearing in NullFields will be sent to the server as
  8614. // null. It is an error if a field in this list has a non-empty value.
  8615. // This may be used to include null fields in Patch requests.
  8616. NullFields []string `json:"-"`
  8617. }
  8618. func (s *RouterStatusResponse) MarshalJSON() ([]byte, error) {
  8619. type noMethod RouterStatusResponse
  8620. raw := noMethod(*s)
  8621. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8622. }
  8623. type RoutersPreviewResponse struct {
  8624. // Resource: Preview of given router.
  8625. Resource *Router `json:"resource,omitempty"`
  8626. // ServerResponse contains the HTTP response code and headers from the
  8627. // server.
  8628. googleapi.ServerResponse `json:"-"`
  8629. // ForceSendFields is a list of field names (e.g. "Resource") to
  8630. // unconditionally include in API requests. By default, fields with
  8631. // empty values are omitted from API requests. However, any non-pointer,
  8632. // non-interface field appearing in ForceSendFields will be sent to the
  8633. // server regardless of whether the field is empty or not. This may be
  8634. // used to include empty fields in Patch requests.
  8635. ForceSendFields []string `json:"-"`
  8636. // NullFields is a list of field names (e.g. "Resource") to include in
  8637. // API requests with the JSON null value. By default, fields with empty
  8638. // values are omitted from API requests. However, any field with an
  8639. // empty value appearing in NullFields will be sent to the server as
  8640. // null. It is an error if a field in this list has a non-empty value.
  8641. // This may be used to include null fields in Patch requests.
  8642. NullFields []string `json:"-"`
  8643. }
  8644. func (s *RoutersPreviewResponse) MarshalJSON() ([]byte, error) {
  8645. type noMethod RoutersPreviewResponse
  8646. raw := noMethod(*s)
  8647. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8648. }
  8649. type RoutersScopedList struct {
  8650. // Routers: List of routers contained in this scope.
  8651. Routers []*Router `json:"routers,omitempty"`
  8652. // Warning: Informational warning which replaces the list of routers
  8653. // when the list is empty.
  8654. Warning *RoutersScopedListWarning `json:"warning,omitempty"`
  8655. // ForceSendFields is a list of field names (e.g. "Routers") to
  8656. // unconditionally include in API requests. By default, fields with
  8657. // empty values are omitted from API requests. However, any non-pointer,
  8658. // non-interface field appearing in ForceSendFields will be sent to the
  8659. // server regardless of whether the field is empty or not. This may be
  8660. // used to include empty fields in Patch requests.
  8661. ForceSendFields []string `json:"-"`
  8662. // NullFields is a list of field names (e.g. "Routers") to include in
  8663. // API requests with the JSON null value. By default, fields with empty
  8664. // values are omitted from API requests. However, any field with an
  8665. // empty value appearing in NullFields will be sent to the server as
  8666. // null. It is an error if a field in this list has a non-empty value.
  8667. // This may be used to include null fields in Patch requests.
  8668. NullFields []string `json:"-"`
  8669. }
  8670. func (s *RoutersScopedList) MarshalJSON() ([]byte, error) {
  8671. type noMethod RoutersScopedList
  8672. raw := noMethod(*s)
  8673. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8674. }
  8675. // RoutersScopedListWarning: Informational warning which replaces the
  8676. // list of routers when the list is empty.
  8677. type RoutersScopedListWarning struct {
  8678. // Code: [Output Only] A warning code, if applicable. For example,
  8679. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  8680. // the response.
  8681. //
  8682. // Possible values:
  8683. // "CLEANUP_FAILED"
  8684. // "DEPRECATED_RESOURCE_USED"
  8685. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  8686. // "FIELD_VALUE_OVERRIDEN"
  8687. // "INJECTED_KERNELS_DEPRECATED"
  8688. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  8689. // "NEXT_HOP_CANNOT_IP_FORWARD"
  8690. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  8691. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  8692. // "NEXT_HOP_NOT_RUNNING"
  8693. // "NOT_CRITICAL_ERROR"
  8694. // "NO_RESULTS_ON_PAGE"
  8695. // "REQUIRED_TOS_AGREEMENT"
  8696. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  8697. // "RESOURCE_NOT_DELETED"
  8698. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  8699. // "UNREACHABLE"
  8700. Code string `json:"code,omitempty"`
  8701. // Data: [Output Only] Metadata about this warning in key: value format.
  8702. // For example:
  8703. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  8704. Data []*RoutersScopedListWarningData `json:"data,omitempty"`
  8705. // Message: [Output Only] A human-readable description of the warning
  8706. // code.
  8707. Message string `json:"message,omitempty"`
  8708. // ForceSendFields is a list of field names (e.g. "Code") to
  8709. // unconditionally include in API requests. By default, fields with
  8710. // empty values are omitted from API requests. However, any non-pointer,
  8711. // non-interface field appearing in ForceSendFields will be sent to the
  8712. // server regardless of whether the field is empty or not. This may be
  8713. // used to include empty fields in Patch requests.
  8714. ForceSendFields []string `json:"-"`
  8715. // NullFields is a list of field names (e.g. "Code") to include in API
  8716. // requests with the JSON null value. By default, fields with empty
  8717. // values are omitted from API requests. However, any field with an
  8718. // empty value appearing in NullFields will be sent to the server as
  8719. // null. It is an error if a field in this list has a non-empty value.
  8720. // This may be used to include null fields in Patch requests.
  8721. NullFields []string `json:"-"`
  8722. }
  8723. func (s *RoutersScopedListWarning) MarshalJSON() ([]byte, error) {
  8724. type noMethod RoutersScopedListWarning
  8725. raw := noMethod(*s)
  8726. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8727. }
  8728. type RoutersScopedListWarningData struct {
  8729. // Key: [Output Only] A key that provides more detail on the warning
  8730. // being returned. For example, for warnings where there are no results
  8731. // in a list request for a particular zone, this key might be scope and
  8732. // the key value might be the zone name. Other examples might be a key
  8733. // indicating a deprecated resource and a suggested replacement, or a
  8734. // warning about invalid network settings (for example, if an instance
  8735. // attempts to perform IP forwarding but is not enabled for IP
  8736. // forwarding).
  8737. Key string `json:"key,omitempty"`
  8738. // Value: [Output Only] A warning data value corresponding to the key.
  8739. Value string `json:"value,omitempty"`
  8740. // ForceSendFields is a list of field names (e.g. "Key") to
  8741. // unconditionally include in API requests. By default, fields with
  8742. // empty values are omitted from API requests. However, any non-pointer,
  8743. // non-interface field appearing in ForceSendFields will be sent to the
  8744. // server regardless of whether the field is empty or not. This may be
  8745. // used to include empty fields in Patch requests.
  8746. ForceSendFields []string `json:"-"`
  8747. // NullFields is a list of field names (e.g. "Key") to include in API
  8748. // requests with the JSON null value. By default, fields with empty
  8749. // values are omitted from API requests. However, any field with an
  8750. // empty value appearing in NullFields will be sent to the server as
  8751. // null. It is an error if a field in this list has a non-empty value.
  8752. // This may be used to include null fields in Patch requests.
  8753. NullFields []string `json:"-"`
  8754. }
  8755. func (s *RoutersScopedListWarningData) MarshalJSON() ([]byte, error) {
  8756. type noMethod RoutersScopedListWarningData
  8757. raw := noMethod(*s)
  8758. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8759. }
  8760. type SSLHealthCheck struct {
  8761. // Port: The TCP port number for the health check request. The default
  8762. // value is 443. Valid values are 1 through 65535.
  8763. Port int64 `json:"port,omitempty"`
  8764. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  8765. // both port and port_name are defined, port takes precedence.
  8766. PortName string `json:"portName,omitempty"`
  8767. // ProxyHeader: Specifies the type of proxy header to append before
  8768. // sending data to the backend, either NONE or PROXY_V1. The default is
  8769. // NONE.
  8770. //
  8771. // Possible values:
  8772. // "NONE"
  8773. // "PROXY_V1"
  8774. ProxyHeader string `json:"proxyHeader,omitempty"`
  8775. // Request: The application data to send once the SSL connection has
  8776. // been established (default value is empty). If both request and
  8777. // response are empty, the connection establishment alone will indicate
  8778. // health. The request data can only be ASCII.
  8779. Request string `json:"request,omitempty"`
  8780. // Response: The bytes to match against the beginning of the response
  8781. // data. If left empty (the default value), any response will indicate
  8782. // health. The response data can only be ASCII.
  8783. Response string `json:"response,omitempty"`
  8784. // ForceSendFields is a list of field names (e.g. "Port") to
  8785. // unconditionally include in API requests. By default, fields with
  8786. // empty values are omitted from API requests. However, any non-pointer,
  8787. // non-interface field appearing in ForceSendFields will be sent to the
  8788. // server regardless of whether the field is empty or not. This may be
  8789. // used to include empty fields in Patch requests.
  8790. ForceSendFields []string `json:"-"`
  8791. // NullFields is a list of field names (e.g. "Port") to include in API
  8792. // requests with the JSON null value. By default, fields with empty
  8793. // values are omitted from API requests. However, any field with an
  8794. // empty value appearing in NullFields will be sent to the server as
  8795. // null. It is an error if a field in this list has a non-empty value.
  8796. // This may be used to include null fields in Patch requests.
  8797. NullFields []string `json:"-"`
  8798. }
  8799. func (s *SSLHealthCheck) MarshalJSON() ([]byte, error) {
  8800. type noMethod SSLHealthCheck
  8801. raw := noMethod(*s)
  8802. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8803. }
  8804. // Scheduling: Sets the scheduling options for an Instance.
  8805. type Scheduling struct {
  8806. // AutomaticRestart: Specifies whether the instance should be
  8807. // automatically restarted if it is terminated by Compute Engine (not
  8808. // terminated by a user). You can only set the automatic restart option
  8809. // for standard instances. Preemptible instances cannot be automatically
  8810. // restarted.
  8811. //
  8812. // By default, this is set to true so an instance is automatically
  8813. // restarted if it is terminated by Compute Engine.
  8814. AutomaticRestart *bool `json:"automaticRestart,omitempty"`
  8815. // OnHostMaintenance: Defines the maintenance behavior for this
  8816. // instance. For standard instances, the default behavior is MIGRATE.
  8817. // For preemptible instances, the default and only possible behavior is
  8818. // TERMINATE. For more information, see Setting Instance Scheduling
  8819. // Options.
  8820. //
  8821. // Possible values:
  8822. // "MIGRATE"
  8823. // "TERMINATE"
  8824. OnHostMaintenance string `json:"onHostMaintenance,omitempty"`
  8825. // Preemptible: Defines whether the instance is preemptible. This can
  8826. // only be set during instance creation, it cannot be set or changed
  8827. // after the instance has been created.
  8828. Preemptible bool `json:"preemptible,omitempty"`
  8829. // ForceSendFields is a list of field names (e.g. "AutomaticRestart") to
  8830. // unconditionally include in API requests. By default, fields with
  8831. // empty values are omitted from API requests. However, any non-pointer,
  8832. // non-interface field appearing in ForceSendFields will be sent to the
  8833. // server regardless of whether the field is empty or not. This may be
  8834. // used to include empty fields in Patch requests.
  8835. ForceSendFields []string `json:"-"`
  8836. // NullFields is a list of field names (e.g. "AutomaticRestart") to
  8837. // include in API requests with the JSON null value. By default, fields
  8838. // with empty values are omitted from API requests. However, any field
  8839. // with an empty value appearing in NullFields will be sent to the
  8840. // server as null. It is an error if a field in this list has a
  8841. // non-empty value. This may be used to include null fields in Patch
  8842. // requests.
  8843. NullFields []string `json:"-"`
  8844. }
  8845. func (s *Scheduling) MarshalJSON() ([]byte, error) {
  8846. type noMethod Scheduling
  8847. raw := noMethod(*s)
  8848. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8849. }
  8850. // SerialPortOutput: An instance's serial console output.
  8851. type SerialPortOutput struct {
  8852. // Contents: [Output Only] The contents of the console output.
  8853. Contents string `json:"contents,omitempty"`
  8854. // Kind: [Output Only] Type of the resource. Always
  8855. // compute#serialPortOutput for serial port output.
  8856. Kind string `json:"kind,omitempty"`
  8857. // Next: [Output Only] The position of the next byte of content from the
  8858. // serial console output. Use this value in the next request as the
  8859. // start parameter.
  8860. Next int64 `json:"next,omitempty,string"`
  8861. // SelfLink: [Output Only] Server-defined URL for this resource.
  8862. SelfLink string `json:"selfLink,omitempty"`
  8863. // Start: The starting byte position of the output that was returned.
  8864. // This should match the start parameter sent with the request. If the
  8865. // serial console output exceeds the size of the buffer, older output
  8866. // will be overwritten by newer content and the start values will be
  8867. // mismatched.
  8868. Start int64 `json:"start,omitempty,string"`
  8869. // ServerResponse contains the HTTP response code and headers from the
  8870. // server.
  8871. googleapi.ServerResponse `json:"-"`
  8872. // ForceSendFields is a list of field names (e.g. "Contents") to
  8873. // unconditionally include in API requests. By default, fields with
  8874. // empty values are omitted from API requests. However, any non-pointer,
  8875. // non-interface field appearing in ForceSendFields will be sent to the
  8876. // server regardless of whether the field is empty or not. This may be
  8877. // used to include empty fields in Patch requests.
  8878. ForceSendFields []string `json:"-"`
  8879. // NullFields is a list of field names (e.g. "Contents") to include in
  8880. // API requests with the JSON null value. By default, fields with empty
  8881. // values are omitted from API requests. However, any field with an
  8882. // empty value appearing in NullFields will be sent to the server as
  8883. // null. It is an error if a field in this list has a non-empty value.
  8884. // This may be used to include null fields in Patch requests.
  8885. NullFields []string `json:"-"`
  8886. }
  8887. func (s *SerialPortOutput) MarshalJSON() ([]byte, error) {
  8888. type noMethod SerialPortOutput
  8889. raw := noMethod(*s)
  8890. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8891. }
  8892. // ServiceAccount: A service account.
  8893. type ServiceAccount struct {
  8894. // Email: Email address of the service account.
  8895. Email string `json:"email,omitempty"`
  8896. // Scopes: The list of scopes to be made available for this service
  8897. // account.
  8898. Scopes []string `json:"scopes,omitempty"`
  8899. // ForceSendFields is a list of field names (e.g. "Email") to
  8900. // unconditionally include in API requests. By default, fields with
  8901. // empty values are omitted from API requests. However, any non-pointer,
  8902. // non-interface field appearing in ForceSendFields will be sent to the
  8903. // server regardless of whether the field is empty or not. This may be
  8904. // used to include empty fields in Patch requests.
  8905. ForceSendFields []string `json:"-"`
  8906. // NullFields is a list of field names (e.g. "Email") to include in API
  8907. // requests with the JSON null value. By default, fields with empty
  8908. // values are omitted from API requests. However, any field with an
  8909. // empty value appearing in NullFields will be sent to the server as
  8910. // null. It is an error if a field in this list has a non-empty value.
  8911. // This may be used to include null fields in Patch requests.
  8912. NullFields []string `json:"-"`
  8913. }
  8914. func (s *ServiceAccount) MarshalJSON() ([]byte, error) {
  8915. type noMethod ServiceAccount
  8916. raw := noMethod(*s)
  8917. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8918. }
  8919. // Snapshot: A persistent disk snapshot resource.
  8920. type Snapshot struct {
  8921. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  8922. // format.
  8923. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  8924. // Description: An optional description of this resource. Provide this
  8925. // property when you create the resource.
  8926. Description string `json:"description,omitempty"`
  8927. // DiskSizeGb: [Output Only] Size of the snapshot, specified in GB.
  8928. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  8929. // Id: [Output Only] The unique identifier for the resource. This
  8930. // identifier is defined by the server.
  8931. Id uint64 `json:"id,omitempty,string"`
  8932. // Kind: [Output Only] Type of the resource. Always compute#snapshot for
  8933. // Snapshot resources.
  8934. Kind string `json:"kind,omitempty"`
  8935. // LabelFingerprint: A fingerprint for the labels being applied to this
  8936. // snapshot, which is essentially a hash of the labels set used for
  8937. // optimistic locking. The fingerprint is initially generated by Compute
  8938. // Engine and changes after every request to modify or update labels.
  8939. // You must always provide an up-to-date fingerprint hash in order to
  8940. // update or change labels.
  8941. //
  8942. // To see the latest fingerprint, make a get() request to retrieve a
  8943. // snapshot.
  8944. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  8945. // Labels: Labels to apply to this snapshot. These can be later modified
  8946. // by the setLabels method. Label values may be empty.
  8947. Labels map[string]string `json:"labels,omitempty"`
  8948. // Licenses: [Output Only] A list of public visible licenses that apply
  8949. // to this snapshot. This can be because the original image had licenses
  8950. // attached (such as a Windows image).
  8951. Licenses []string `json:"licenses,omitempty"`
  8952. // Name: Name of the resource; provided by the client when the resource
  8953. // is created. The name must be 1-63 characters long, and comply with
  8954. // RFC1035. Specifically, the name must be 1-63 characters long and
  8955. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  8956. // the first character must be a lowercase letter, and all following
  8957. // characters must be a dash, lowercase letter, or digit, except the
  8958. // last character, which cannot be a dash.
  8959. Name string `json:"name,omitempty"`
  8960. // SelfLink: [Output Only] Server-defined URL for the resource.
  8961. SelfLink string `json:"selfLink,omitempty"`
  8962. // SnapshotEncryptionKey: Encrypts the snapshot using a
  8963. // customer-supplied encryption key.
  8964. //
  8965. // After you encrypt a snapshot using a customer-supplied key, you must
  8966. // provide the same key if you use the image later For example, you must
  8967. // provide the encryption key when you create a disk from the encrypted
  8968. // snapshot in a future request.
  8969. //
  8970. // Customer-supplied encryption keys do not protect access to metadata
  8971. // of the disk.
  8972. //
  8973. // If you do not provide an encryption key when creating the snapshot,
  8974. // then the snapshot will be encrypted using an automatically generated
  8975. // key and you do not need to provide a key to use the snapshot later.
  8976. SnapshotEncryptionKey *CustomerEncryptionKey `json:"snapshotEncryptionKey,omitempty"`
  8977. // SourceDisk: [Output Only] The source disk used to create this
  8978. // snapshot.
  8979. SourceDisk string `json:"sourceDisk,omitempty"`
  8980. // SourceDiskEncryptionKey: The customer-supplied encryption key of the
  8981. // source disk. Required if the source disk is protected by a
  8982. // customer-supplied encryption key.
  8983. SourceDiskEncryptionKey *CustomerEncryptionKey `json:"sourceDiskEncryptionKey,omitempty"`
  8984. // SourceDiskId: [Output Only] The ID value of the disk used to create
  8985. // this snapshot. This value may be used to determine whether the
  8986. // snapshot was taken from the current or a previous instance of a given
  8987. // disk name.
  8988. SourceDiskId string `json:"sourceDiskId,omitempty"`
  8989. // Status: [Output Only] The status of the snapshot. This can be
  8990. // CREATING, DELETING, FAILED, READY, or UPLOADING.
  8991. //
  8992. // Possible values:
  8993. // "CREATING"
  8994. // "DELETING"
  8995. // "FAILED"
  8996. // "READY"
  8997. // "UPLOADING"
  8998. Status string `json:"status,omitempty"`
  8999. // StorageBytes: [Output Only] A size of the the storage used by the
  9000. // snapshot. As snapshots share storage, this number is expected to
  9001. // change with snapshot creation/deletion.
  9002. StorageBytes int64 `json:"storageBytes,omitempty,string"`
  9003. // StorageBytesStatus: [Output Only] An indicator whether storageBytes
  9004. // is in a stable state or it is being adjusted as a result of shared
  9005. // storage reallocation. This status can either be UPDATING, meaning the
  9006. // size of the snapshot is being updated, or UP_TO_DATE, meaning the
  9007. // size of the snapshot is up-to-date.
  9008. //
  9009. // Possible values:
  9010. // "UPDATING"
  9011. // "UP_TO_DATE"
  9012. StorageBytesStatus string `json:"storageBytesStatus,omitempty"`
  9013. // ServerResponse contains the HTTP response code and headers from the
  9014. // server.
  9015. googleapi.ServerResponse `json:"-"`
  9016. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  9017. // to unconditionally include in API requests. By default, fields with
  9018. // empty values are omitted from API requests. However, any non-pointer,
  9019. // non-interface field appearing in ForceSendFields will be sent to the
  9020. // server regardless of whether the field is empty or not. This may be
  9021. // used to include empty fields in Patch requests.
  9022. ForceSendFields []string `json:"-"`
  9023. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  9024. // include in API requests with the JSON null value. By default, fields
  9025. // with empty values are omitted from API requests. However, any field
  9026. // with an empty value appearing in NullFields will be sent to the
  9027. // server as null. It is an error if a field in this list has a
  9028. // non-empty value. This may be used to include null fields in Patch
  9029. // requests.
  9030. NullFields []string `json:"-"`
  9031. }
  9032. func (s *Snapshot) MarshalJSON() ([]byte, error) {
  9033. type noMethod Snapshot
  9034. raw := noMethod(*s)
  9035. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9036. }
  9037. // SnapshotList: Contains a list of Snapshot resources.
  9038. type SnapshotList struct {
  9039. // Id: [Output Only] The unique identifier for the resource. This
  9040. // identifier is defined by the server.
  9041. Id string `json:"id,omitempty"`
  9042. // Items: [Output Only] A list of Snapshot resources.
  9043. Items []*Snapshot `json:"items,omitempty"`
  9044. // Kind: Type of resource.
  9045. Kind string `json:"kind,omitempty"`
  9046. // NextPageToken: [Output Only] This token allows you to get the next
  9047. // page of results for list requests. If the number of results is larger
  9048. // than maxResults, use the nextPageToken as a value for the query
  9049. // parameter pageToken in the next list request. Subsequent list
  9050. // requests will have their own nextPageToken to continue paging through
  9051. // the results.
  9052. NextPageToken string `json:"nextPageToken,omitempty"`
  9053. // SelfLink: [Output Only] Server-defined URL for this resource.
  9054. SelfLink string `json:"selfLink,omitempty"`
  9055. // ServerResponse contains the HTTP response code and headers from the
  9056. // server.
  9057. googleapi.ServerResponse `json:"-"`
  9058. // ForceSendFields is a list of field names (e.g. "Id") to
  9059. // unconditionally include in API requests. By default, fields with
  9060. // empty values are omitted from API requests. However, any non-pointer,
  9061. // non-interface field appearing in ForceSendFields will be sent to the
  9062. // server regardless of whether the field is empty or not. This may be
  9063. // used to include empty fields in Patch requests.
  9064. ForceSendFields []string `json:"-"`
  9065. // NullFields is a list of field names (e.g. "Id") to include in API
  9066. // requests with the JSON null value. By default, fields with empty
  9067. // values are omitted from API requests. However, any field with an
  9068. // empty value appearing in NullFields will be sent to the server as
  9069. // null. It is an error if a field in this list has a non-empty value.
  9070. // This may be used to include null fields in Patch requests.
  9071. NullFields []string `json:"-"`
  9072. }
  9073. func (s *SnapshotList) MarshalJSON() ([]byte, error) {
  9074. type noMethod SnapshotList
  9075. raw := noMethod(*s)
  9076. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9077. }
  9078. // SslCertificate: An SslCertificate resource. This resource provides a
  9079. // mechanism to upload an SSL key and certificate to the load balancer
  9080. // to serve secure connections from the user.
  9081. type SslCertificate struct {
  9082. // Certificate: A local certificate file. The certificate must be in PEM
  9083. // format. The certificate chain must be no greater than 5 certs long.
  9084. // The chain must include at least one intermediate cert.
  9085. Certificate string `json:"certificate,omitempty"`
  9086. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  9087. // format.
  9088. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  9089. // Description: An optional description of this resource. Provide this
  9090. // property when you create the resource.
  9091. Description string `json:"description,omitempty"`
  9092. // Id: [Output Only] The unique identifier for the resource. This
  9093. // identifier is defined by the server.
  9094. Id uint64 `json:"id,omitempty,string"`
  9095. // Kind: [Output Only] Type of the resource. Always
  9096. // compute#sslCertificate for SSL certificates.
  9097. Kind string `json:"kind,omitempty"`
  9098. // Name: Name of the resource. Provided by the client when the resource
  9099. // is created. The name must be 1-63 characters long, and comply with
  9100. // RFC1035. Specifically, the name must be 1-63 characters long and
  9101. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  9102. // the first character must be a lowercase letter, and all following
  9103. // characters must be a dash, lowercase letter, or digit, except the
  9104. // last character, which cannot be a dash.
  9105. Name string `json:"name,omitempty"`
  9106. // PrivateKey: A write-only private key in PEM format. Only insert
  9107. // requests will include this field.
  9108. PrivateKey string `json:"privateKey,omitempty"`
  9109. // SelfLink: [Output only] Server-defined URL for the resource.
  9110. SelfLink string `json:"selfLink,omitempty"`
  9111. // ServerResponse contains the HTTP response code and headers from the
  9112. // server.
  9113. googleapi.ServerResponse `json:"-"`
  9114. // ForceSendFields is a list of field names (e.g. "Certificate") to
  9115. // unconditionally include in API requests. By default, fields with
  9116. // empty values are omitted from API requests. However, any non-pointer,
  9117. // non-interface field appearing in ForceSendFields will be sent to the
  9118. // server regardless of whether the field is empty or not. This may be
  9119. // used to include empty fields in Patch requests.
  9120. ForceSendFields []string `json:"-"`
  9121. // NullFields is a list of field names (e.g. "Certificate") to include
  9122. // in API requests with the JSON null value. By default, fields with
  9123. // empty values are omitted from API requests. However, any field with
  9124. // an empty value appearing in NullFields will be sent to the server as
  9125. // null. It is an error if a field in this list has a non-empty value.
  9126. // This may be used to include null fields in Patch requests.
  9127. NullFields []string `json:"-"`
  9128. }
  9129. func (s *SslCertificate) MarshalJSON() ([]byte, error) {
  9130. type noMethod SslCertificate
  9131. raw := noMethod(*s)
  9132. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9133. }
  9134. // SslCertificateList: Contains a list of SslCertificate resources.
  9135. type SslCertificateList struct {
  9136. // Id: [Output Only] Unique identifier for the resource. Defined by the
  9137. // server.
  9138. Id string `json:"id,omitempty"`
  9139. // Items: A list of SslCertificate resources.
  9140. Items []*SslCertificate `json:"items,omitempty"`
  9141. // Kind: Type of resource.
  9142. Kind string `json:"kind,omitempty"`
  9143. // NextPageToken: [Output Only] This token allows you to get the next
  9144. // page of results for list requests. If the number of results is larger
  9145. // than maxResults, use the nextPageToken as a value for the query
  9146. // parameter pageToken in the next list request. Subsequent list
  9147. // requests will have their own nextPageToken to continue paging through
  9148. // the results.
  9149. NextPageToken string `json:"nextPageToken,omitempty"`
  9150. // SelfLink: [Output Only] Server-defined URL for this resource.
  9151. SelfLink string `json:"selfLink,omitempty"`
  9152. // ServerResponse contains the HTTP response code and headers from the
  9153. // server.
  9154. googleapi.ServerResponse `json:"-"`
  9155. // ForceSendFields is a list of field names (e.g. "Id") to
  9156. // unconditionally include in API requests. By default, fields with
  9157. // empty values are omitted from API requests. However, any non-pointer,
  9158. // non-interface field appearing in ForceSendFields will be sent to the
  9159. // server regardless of whether the field is empty or not. This may be
  9160. // used to include empty fields in Patch requests.
  9161. ForceSendFields []string `json:"-"`
  9162. // NullFields is a list of field names (e.g. "Id") to include in API
  9163. // requests with the JSON null value. By default, fields with empty
  9164. // values are omitted from API requests. However, any field with an
  9165. // empty value appearing in NullFields will be sent to the server as
  9166. // null. It is an error if a field in this list has a non-empty value.
  9167. // This may be used to include null fields in Patch requests.
  9168. NullFields []string `json:"-"`
  9169. }
  9170. func (s *SslCertificateList) MarshalJSON() ([]byte, error) {
  9171. type noMethod SslCertificateList
  9172. raw := noMethod(*s)
  9173. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9174. }
  9175. // Subnetwork: A Subnetwork resource.
  9176. type Subnetwork struct {
  9177. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  9178. // format.
  9179. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  9180. // Description: An optional description of this resource. Provide this
  9181. // property when you create the resource. This field can be set only at
  9182. // resource creation time.
  9183. Description string `json:"description,omitempty"`
  9184. // GatewayAddress: [Output Only] The gateway address for default routes
  9185. // to reach destination addresses outside this subnetwork. This field
  9186. // can be set only at resource creation time.
  9187. GatewayAddress string `json:"gatewayAddress,omitempty"`
  9188. // Id: [Output Only] The unique identifier for the resource. This
  9189. // identifier is defined by the server.
  9190. Id uint64 `json:"id,omitempty,string"`
  9191. // IpCidrRange: The range of internal addresses that are owned by this
  9192. // subnetwork. Provide this property when you create the subnetwork. For
  9193. // example, 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and
  9194. // non-overlapping within a network. Only IPv4 is supported. This field
  9195. // can be set only at resource creation time.
  9196. IpCidrRange string `json:"ipCidrRange,omitempty"`
  9197. // Kind: [Output Only] Type of the resource. Always compute#subnetwork
  9198. // for Subnetwork resources.
  9199. Kind string `json:"kind,omitempty"`
  9200. // Name: The name of the resource, provided by the client when initially
  9201. // creating the resource. The name must be 1-63 characters long, and
  9202. // comply with RFC1035. Specifically, the name must be 1-63 characters
  9203. // long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])?
  9204. // which means the first character must be a lowercase letter, and all
  9205. // following characters must be a dash, lowercase letter, or digit,
  9206. // except the last character, which cannot be a dash.
  9207. Name string `json:"name,omitempty"`
  9208. // Network: The URL of the network to which this subnetwork belongs,
  9209. // provided by the client when initially creating the subnetwork. Only
  9210. // networks that are in the distributed mode can have subnetworks. This
  9211. // field can be set only at resource creation time.
  9212. Network string `json:"network,omitempty"`
  9213. // PrivateIpGoogleAccess: Whether the VMs in this subnet can access
  9214. // Google services without assigned external IP addresses. This field
  9215. // can be both set at resource creation time and updated using
  9216. // setPrivateIpGoogleAccess.
  9217. PrivateIpGoogleAccess bool `json:"privateIpGoogleAccess,omitempty"`
  9218. // Region: URL of the region where the Subnetwork resides. This field
  9219. // can be set only at resource creation time.
  9220. Region string `json:"region,omitempty"`
  9221. // SelfLink: [Output Only] Server-defined URL for the resource.
  9222. SelfLink string `json:"selfLink,omitempty"`
  9223. // ServerResponse contains the HTTP response code and headers from the
  9224. // server.
  9225. googleapi.ServerResponse `json:"-"`
  9226. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  9227. // to unconditionally include in API requests. By default, fields with
  9228. // empty values are omitted from API requests. However, any non-pointer,
  9229. // non-interface field appearing in ForceSendFields will be sent to the
  9230. // server regardless of whether the field is empty or not. This may be
  9231. // used to include empty fields in Patch requests.
  9232. ForceSendFields []string `json:"-"`
  9233. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  9234. // include in API requests with the JSON null value. By default, fields
  9235. // with empty values are omitted from API requests. However, any field
  9236. // with an empty value appearing in NullFields will be sent to the
  9237. // server as null. It is an error if a field in this list has a
  9238. // non-empty value. This may be used to include null fields in Patch
  9239. // requests.
  9240. NullFields []string `json:"-"`
  9241. }
  9242. func (s *Subnetwork) MarshalJSON() ([]byte, error) {
  9243. type noMethod Subnetwork
  9244. raw := noMethod(*s)
  9245. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9246. }
  9247. type SubnetworkAggregatedList struct {
  9248. // Id: [Output Only] The unique identifier for the resource. This
  9249. // identifier is defined by the server.
  9250. Id string `json:"id,omitempty"`
  9251. // Items: [Output] A map of scoped Subnetwork lists.
  9252. Items map[string]SubnetworksScopedList `json:"items,omitempty"`
  9253. // Kind: [Output Only] Type of resource. Always
  9254. // compute#subnetworkAggregatedList for aggregated lists of subnetworks.
  9255. Kind string `json:"kind,omitempty"`
  9256. // NextPageToken: [Output Only] This token allows you to get the next
  9257. // page of results for list requests. If the number of results is larger
  9258. // than maxResults, use the nextPageToken as a value for the query
  9259. // parameter pageToken in the next list request. Subsequent list
  9260. // requests will have their own nextPageToken to continue paging through
  9261. // the results.
  9262. NextPageToken string `json:"nextPageToken,omitempty"`
  9263. // SelfLink: [Output Only] Server-defined URL for this resource.
  9264. SelfLink string `json:"selfLink,omitempty"`
  9265. // ServerResponse contains the HTTP response code and headers from the
  9266. // server.
  9267. googleapi.ServerResponse `json:"-"`
  9268. // ForceSendFields is a list of field names (e.g. "Id") to
  9269. // unconditionally include in API requests. By default, fields with
  9270. // empty values are omitted from API requests. However, any non-pointer,
  9271. // non-interface field appearing in ForceSendFields will be sent to the
  9272. // server regardless of whether the field is empty or not. This may be
  9273. // used to include empty fields in Patch requests.
  9274. ForceSendFields []string `json:"-"`
  9275. // NullFields is a list of field names (e.g. "Id") to include in API
  9276. // requests with the JSON null value. By default, fields with empty
  9277. // values are omitted from API requests. However, any field with an
  9278. // empty value appearing in NullFields will be sent to the server as
  9279. // null. It is an error if a field in this list has a non-empty value.
  9280. // This may be used to include null fields in Patch requests.
  9281. NullFields []string `json:"-"`
  9282. }
  9283. func (s *SubnetworkAggregatedList) MarshalJSON() ([]byte, error) {
  9284. type noMethod SubnetworkAggregatedList
  9285. raw := noMethod(*s)
  9286. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9287. }
  9288. // SubnetworkList: Contains a list of Subnetwork resources.
  9289. type SubnetworkList struct {
  9290. // Id: [Output Only] The unique identifier for the resource. This
  9291. // identifier is defined by the server.
  9292. Id string `json:"id,omitempty"`
  9293. // Items: The Subnetwork resources.
  9294. Items []*Subnetwork `json:"items,omitempty"`
  9295. // Kind: [Output Only] Type of resource. Always compute#subnetworkList
  9296. // for lists of subnetworks.
  9297. Kind string `json:"kind,omitempty"`
  9298. // NextPageToken: [Output Only] This token allows you to get the next
  9299. // page of results for list requests. If the number of results is larger
  9300. // than maxResults, use the nextPageToken as a value for the query
  9301. // parameter pageToken in the next list request. Subsequent list
  9302. // requests will have their own nextPageToken to continue paging through
  9303. // the results.
  9304. NextPageToken string `json:"nextPageToken,omitempty"`
  9305. // SelfLink: [Output Only] Server-defined URL for this resource.
  9306. SelfLink string `json:"selfLink,omitempty"`
  9307. // ServerResponse contains the HTTP response code and headers from the
  9308. // server.
  9309. googleapi.ServerResponse `json:"-"`
  9310. // ForceSendFields is a list of field names (e.g. "Id") to
  9311. // unconditionally include in API requests. By default, fields with
  9312. // empty values are omitted from API requests. However, any non-pointer,
  9313. // non-interface field appearing in ForceSendFields will be sent to the
  9314. // server regardless of whether the field is empty or not. This may be
  9315. // used to include empty fields in Patch requests.
  9316. ForceSendFields []string `json:"-"`
  9317. // NullFields is a list of field names (e.g. "Id") to include in API
  9318. // requests with the JSON null value. By default, fields with empty
  9319. // values are omitted from API requests. However, any field with an
  9320. // empty value appearing in NullFields will be sent to the server as
  9321. // null. It is an error if a field in this list has a non-empty value.
  9322. // This may be used to include null fields in Patch requests.
  9323. NullFields []string `json:"-"`
  9324. }
  9325. func (s *SubnetworkList) MarshalJSON() ([]byte, error) {
  9326. type noMethod SubnetworkList
  9327. raw := noMethod(*s)
  9328. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9329. }
  9330. type SubnetworksExpandIpCidrRangeRequest struct {
  9331. // IpCidrRange: The IP (in CIDR format or netmask) of internal addresses
  9332. // that are legal on this Subnetwork. This range should be disjoint from
  9333. // other subnetworks within this network. This range can only be larger
  9334. // than (i.e. a superset of) the range previously defined before the
  9335. // update.
  9336. IpCidrRange string `json:"ipCidrRange,omitempty"`
  9337. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  9338. // unconditionally include in API requests. By default, fields with
  9339. // empty values are omitted from API requests. However, any non-pointer,
  9340. // non-interface field appearing in ForceSendFields will be sent to the
  9341. // server regardless of whether the field is empty or not. This may be
  9342. // used to include empty fields in Patch requests.
  9343. ForceSendFields []string `json:"-"`
  9344. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  9345. // in API requests with the JSON null value. By default, fields with
  9346. // empty values are omitted from API requests. However, any field with
  9347. // an empty value appearing in NullFields will be sent to the server as
  9348. // null. It is an error if a field in this list has a non-empty value.
  9349. // This may be used to include null fields in Patch requests.
  9350. NullFields []string `json:"-"`
  9351. }
  9352. func (s *SubnetworksExpandIpCidrRangeRequest) MarshalJSON() ([]byte, error) {
  9353. type noMethod SubnetworksExpandIpCidrRangeRequest
  9354. raw := noMethod(*s)
  9355. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9356. }
  9357. type SubnetworksScopedList struct {
  9358. // Subnetworks: List of subnetworks contained in this scope.
  9359. Subnetworks []*Subnetwork `json:"subnetworks,omitempty"`
  9360. // Warning: An informational warning that appears when the list of
  9361. // addresses is empty.
  9362. Warning *SubnetworksScopedListWarning `json:"warning,omitempty"`
  9363. // ForceSendFields is a list of field names (e.g. "Subnetworks") to
  9364. // unconditionally include in API requests. By default, fields with
  9365. // empty values are omitted from API requests. However, any non-pointer,
  9366. // non-interface field appearing in ForceSendFields will be sent to the
  9367. // server regardless of whether the field is empty or not. This may be
  9368. // used to include empty fields in Patch requests.
  9369. ForceSendFields []string `json:"-"`
  9370. // NullFields is a list of field names (e.g. "Subnetworks") to include
  9371. // in API requests with the JSON null value. By default, fields with
  9372. // empty values are omitted from API requests. However, any field with
  9373. // an empty value appearing in NullFields will be sent to the server as
  9374. // null. It is an error if a field in this list has a non-empty value.
  9375. // This may be used to include null fields in Patch requests.
  9376. NullFields []string `json:"-"`
  9377. }
  9378. func (s *SubnetworksScopedList) MarshalJSON() ([]byte, error) {
  9379. type noMethod SubnetworksScopedList
  9380. raw := noMethod(*s)
  9381. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9382. }
  9383. // SubnetworksScopedListWarning: An informational warning that appears
  9384. // when the list of addresses is empty.
  9385. type SubnetworksScopedListWarning struct {
  9386. // Code: [Output Only] A warning code, if applicable. For example,
  9387. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  9388. // the response.
  9389. //
  9390. // Possible values:
  9391. // "CLEANUP_FAILED"
  9392. // "DEPRECATED_RESOURCE_USED"
  9393. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  9394. // "FIELD_VALUE_OVERRIDEN"
  9395. // "INJECTED_KERNELS_DEPRECATED"
  9396. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  9397. // "NEXT_HOP_CANNOT_IP_FORWARD"
  9398. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  9399. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  9400. // "NEXT_HOP_NOT_RUNNING"
  9401. // "NOT_CRITICAL_ERROR"
  9402. // "NO_RESULTS_ON_PAGE"
  9403. // "REQUIRED_TOS_AGREEMENT"
  9404. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  9405. // "RESOURCE_NOT_DELETED"
  9406. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  9407. // "UNREACHABLE"
  9408. Code string `json:"code,omitempty"`
  9409. // Data: [Output Only] Metadata about this warning in key: value format.
  9410. // For example:
  9411. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  9412. Data []*SubnetworksScopedListWarningData `json:"data,omitempty"`
  9413. // Message: [Output Only] A human-readable description of the warning
  9414. // code.
  9415. Message string `json:"message,omitempty"`
  9416. // ForceSendFields is a list of field names (e.g. "Code") to
  9417. // unconditionally include in API requests. By default, fields with
  9418. // empty values are omitted from API requests. However, any non-pointer,
  9419. // non-interface field appearing in ForceSendFields will be sent to the
  9420. // server regardless of whether the field is empty or not. This may be
  9421. // used to include empty fields in Patch requests.
  9422. ForceSendFields []string `json:"-"`
  9423. // NullFields is a list of field names (e.g. "Code") to include in API
  9424. // requests with the JSON null value. By default, fields with empty
  9425. // values are omitted from API requests. However, any field with an
  9426. // empty value appearing in NullFields will be sent to the server as
  9427. // null. It is an error if a field in this list has a non-empty value.
  9428. // This may be used to include null fields in Patch requests.
  9429. NullFields []string `json:"-"`
  9430. }
  9431. func (s *SubnetworksScopedListWarning) MarshalJSON() ([]byte, error) {
  9432. type noMethod SubnetworksScopedListWarning
  9433. raw := noMethod(*s)
  9434. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9435. }
  9436. type SubnetworksScopedListWarningData struct {
  9437. // Key: [Output Only] A key that provides more detail on the warning
  9438. // being returned. For example, for warnings where there are no results
  9439. // in a list request for a particular zone, this key might be scope and
  9440. // the key value might be the zone name. Other examples might be a key
  9441. // indicating a deprecated resource and a suggested replacement, or a
  9442. // warning about invalid network settings (for example, if an instance
  9443. // attempts to perform IP forwarding but is not enabled for IP
  9444. // forwarding).
  9445. Key string `json:"key,omitempty"`
  9446. // Value: [Output Only] A warning data value corresponding to the key.
  9447. Value string `json:"value,omitempty"`
  9448. // ForceSendFields is a list of field names (e.g. "Key") to
  9449. // unconditionally include in API requests. By default, fields with
  9450. // empty values are omitted from API requests. However, any non-pointer,
  9451. // non-interface field appearing in ForceSendFields will be sent to the
  9452. // server regardless of whether the field is empty or not. This may be
  9453. // used to include empty fields in Patch requests.
  9454. ForceSendFields []string `json:"-"`
  9455. // NullFields is a list of field names (e.g. "Key") to include in API
  9456. // requests with the JSON null value. By default, fields with empty
  9457. // values are omitted from API requests. However, any field with an
  9458. // empty value appearing in NullFields will be sent to the server as
  9459. // null. It is an error if a field in this list has a non-empty value.
  9460. // This may be used to include null fields in Patch requests.
  9461. NullFields []string `json:"-"`
  9462. }
  9463. func (s *SubnetworksScopedListWarningData) MarshalJSON() ([]byte, error) {
  9464. type noMethod SubnetworksScopedListWarningData
  9465. raw := noMethod(*s)
  9466. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9467. }
  9468. type SubnetworksSetPrivateIpGoogleAccessRequest struct {
  9469. PrivateIpGoogleAccess bool `json:"privateIpGoogleAccess,omitempty"`
  9470. // ForceSendFields is a list of field names (e.g.
  9471. // "PrivateIpGoogleAccess") to unconditionally include in API requests.
  9472. // By default, fields with empty values are omitted from API requests.
  9473. // However, any non-pointer, non-interface field appearing in
  9474. // ForceSendFields will be sent to the server regardless of whether the
  9475. // field is empty or not. This may be used to include empty fields in
  9476. // Patch requests.
  9477. ForceSendFields []string `json:"-"`
  9478. // NullFields is a list of field names (e.g. "PrivateIpGoogleAccess") to
  9479. // include in API requests with the JSON null value. By default, fields
  9480. // with empty values are omitted from API requests. However, any field
  9481. // with an empty value appearing in NullFields will be sent to the
  9482. // server as null. It is an error if a field in this list has a
  9483. // non-empty value. This may be used to include null fields in Patch
  9484. // requests.
  9485. NullFields []string `json:"-"`
  9486. }
  9487. func (s *SubnetworksSetPrivateIpGoogleAccessRequest) MarshalJSON() ([]byte, error) {
  9488. type noMethod SubnetworksSetPrivateIpGoogleAccessRequest
  9489. raw := noMethod(*s)
  9490. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9491. }
  9492. type TCPHealthCheck struct {
  9493. // Port: The TCP port number for the health check request. The default
  9494. // value is 80. Valid values are 1 through 65535.
  9495. Port int64 `json:"port,omitempty"`
  9496. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  9497. // both port and port_name are defined, port takes precedence.
  9498. PortName string `json:"portName,omitempty"`
  9499. // ProxyHeader: Specifies the type of proxy header to append before
  9500. // sending data to the backend, either NONE or PROXY_V1. The default is
  9501. // NONE.
  9502. //
  9503. // Possible values:
  9504. // "NONE"
  9505. // "PROXY_V1"
  9506. ProxyHeader string `json:"proxyHeader,omitempty"`
  9507. // Request: The application data to send once the TCP connection has
  9508. // been established (default value is empty). If both request and
  9509. // response are empty, the connection establishment alone will indicate
  9510. // health. The request data can only be ASCII.
  9511. Request string `json:"request,omitempty"`
  9512. // Response: The bytes to match against the beginning of the response
  9513. // data. If left empty (the default value), any response will indicate
  9514. // health. The response data can only be ASCII.
  9515. Response string `json:"response,omitempty"`
  9516. // ForceSendFields is a list of field names (e.g. "Port") to
  9517. // unconditionally include in API requests. By default, fields with
  9518. // empty values are omitted from API requests. However, any non-pointer,
  9519. // non-interface field appearing in ForceSendFields will be sent to the
  9520. // server regardless of whether the field is empty or not. This may be
  9521. // used to include empty fields in Patch requests.
  9522. ForceSendFields []string `json:"-"`
  9523. // NullFields is a list of field names (e.g. "Port") to include in API
  9524. // requests with the JSON null value. By default, fields with empty
  9525. // values are omitted from API requests. However, any field with an
  9526. // empty value appearing in NullFields will be sent to the server as
  9527. // null. It is an error if a field in this list has a non-empty value.
  9528. // This may be used to include null fields in Patch requests.
  9529. NullFields []string `json:"-"`
  9530. }
  9531. func (s *TCPHealthCheck) MarshalJSON() ([]byte, error) {
  9532. type noMethod TCPHealthCheck
  9533. raw := noMethod(*s)
  9534. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9535. }
  9536. // Tags: A set of instance tags.
  9537. type Tags struct {
  9538. // Fingerprint: Specifies a fingerprint for this request, which is
  9539. // essentially a hash of the metadata's contents and used for optimistic
  9540. // locking. The fingerprint is initially generated by Compute Engine and
  9541. // changes after every request to modify or update metadata. You must
  9542. // always provide an up-to-date fingerprint hash in order to update or
  9543. // change metadata.
  9544. //
  9545. // To see the latest fingerprint, make get() request to the instance.
  9546. Fingerprint string `json:"fingerprint,omitempty"`
  9547. // Items: An array of tags. Each tag must be 1-63 characters long, and
  9548. // comply with RFC1035.
  9549. Items []string `json:"items,omitempty"`
  9550. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  9551. // unconditionally include in API requests. By default, fields with
  9552. // empty values are omitted from API requests. However, any non-pointer,
  9553. // non-interface field appearing in ForceSendFields will be sent to the
  9554. // server regardless of whether the field is empty or not. This may be
  9555. // used to include empty fields in Patch requests.
  9556. ForceSendFields []string `json:"-"`
  9557. // NullFields is a list of field names (e.g. "Fingerprint") to include
  9558. // in API requests with the JSON null value. By default, fields with
  9559. // empty values are omitted from API requests. However, any field with
  9560. // an empty value appearing in NullFields will be sent to the server as
  9561. // null. It is an error if a field in this list has a non-empty value.
  9562. // This may be used to include null fields in Patch requests.
  9563. NullFields []string `json:"-"`
  9564. }
  9565. func (s *Tags) MarshalJSON() ([]byte, error) {
  9566. type noMethod Tags
  9567. raw := noMethod(*s)
  9568. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9569. }
  9570. // TargetHttpProxy: A TargetHttpProxy resource. This resource defines an
  9571. // HTTP proxy.
  9572. type TargetHttpProxy struct {
  9573. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  9574. // format.
  9575. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  9576. // Description: An optional description of this resource. Provide this
  9577. // property when you create the resource.
  9578. Description string `json:"description,omitempty"`
  9579. // Id: [Output Only] The unique identifier for the resource. This
  9580. // identifier is defined by the server.
  9581. Id uint64 `json:"id,omitempty,string"`
  9582. // Kind: [Output Only] Type of resource. Always compute#targetHttpProxy
  9583. // for target HTTP proxies.
  9584. Kind string `json:"kind,omitempty"`
  9585. // Name: Name of the resource. Provided by the client when the resource
  9586. // is created. The name must be 1-63 characters long, and comply with
  9587. // RFC1035. Specifically, the name must be 1-63 characters long and
  9588. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  9589. // the first character must be a lowercase letter, and all following
  9590. // characters must be a dash, lowercase letter, or digit, except the
  9591. // last character, which cannot be a dash.
  9592. Name string `json:"name,omitempty"`
  9593. // SelfLink: [Output Only] Server-defined URL for the resource.
  9594. SelfLink string `json:"selfLink,omitempty"`
  9595. // UrlMap: URL to the UrlMap resource that defines the mapping from URL
  9596. // to the BackendService.
  9597. UrlMap string `json:"urlMap,omitempty"`
  9598. // ServerResponse contains the HTTP response code and headers from the
  9599. // server.
  9600. googleapi.ServerResponse `json:"-"`
  9601. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  9602. // to unconditionally include in API requests. By default, fields with
  9603. // empty values are omitted from API requests. However, any non-pointer,
  9604. // non-interface field appearing in ForceSendFields will be sent to the
  9605. // server regardless of whether the field is empty or not. This may be
  9606. // used to include empty fields in Patch requests.
  9607. ForceSendFields []string `json:"-"`
  9608. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  9609. // include in API requests with the JSON null value. By default, fields
  9610. // with empty values are omitted from API requests. However, any field
  9611. // with an empty value appearing in NullFields will be sent to the
  9612. // server as null. It is an error if a field in this list has a
  9613. // non-empty value. This may be used to include null fields in Patch
  9614. // requests.
  9615. NullFields []string `json:"-"`
  9616. }
  9617. func (s *TargetHttpProxy) MarshalJSON() ([]byte, error) {
  9618. type noMethod TargetHttpProxy
  9619. raw := noMethod(*s)
  9620. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9621. }
  9622. // TargetHttpProxyList: A list of TargetHttpProxy resources.
  9623. type TargetHttpProxyList struct {
  9624. // Id: [Output Only] The unique identifier for the resource. This
  9625. // identifier is defined by the server.
  9626. Id string `json:"id,omitempty"`
  9627. // Items: A list of TargetHttpProxy resources.
  9628. Items []*TargetHttpProxy `json:"items,omitempty"`
  9629. // Kind: Type of resource. Always compute#targetHttpProxyList for lists
  9630. // of target HTTP proxies.
  9631. Kind string `json:"kind,omitempty"`
  9632. // NextPageToken: [Output Only] This token allows you to get the next
  9633. // page of results for list requests. If the number of results is larger
  9634. // than maxResults, use the nextPageToken as a value for the query
  9635. // parameter pageToken in the next list request. Subsequent list
  9636. // requests will have their own nextPageToken to continue paging through
  9637. // the results.
  9638. NextPageToken string `json:"nextPageToken,omitempty"`
  9639. // SelfLink: [Output Only] Server-defined URL for this resource.
  9640. SelfLink string `json:"selfLink,omitempty"`
  9641. // ServerResponse contains the HTTP response code and headers from the
  9642. // server.
  9643. googleapi.ServerResponse `json:"-"`
  9644. // ForceSendFields is a list of field names (e.g. "Id") to
  9645. // unconditionally include in API requests. By default, fields with
  9646. // empty values are omitted from API requests. However, any non-pointer,
  9647. // non-interface field appearing in ForceSendFields will be sent to the
  9648. // server regardless of whether the field is empty or not. This may be
  9649. // used to include empty fields in Patch requests.
  9650. ForceSendFields []string `json:"-"`
  9651. // NullFields is a list of field names (e.g. "Id") to include in API
  9652. // requests with the JSON null value. By default, fields with empty
  9653. // values are omitted from API requests. However, any field with an
  9654. // empty value appearing in NullFields will be sent to the server as
  9655. // null. It is an error if a field in this list has a non-empty value.
  9656. // This may be used to include null fields in Patch requests.
  9657. NullFields []string `json:"-"`
  9658. }
  9659. func (s *TargetHttpProxyList) MarshalJSON() ([]byte, error) {
  9660. type noMethod TargetHttpProxyList
  9661. raw := noMethod(*s)
  9662. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9663. }
  9664. type TargetHttpsProxiesSetSslCertificatesRequest struct {
  9665. // SslCertificates: New set of SslCertificate resources to associate
  9666. // with this TargetHttpsProxy resource. Currently exactly one
  9667. // SslCertificate resource must be specified.
  9668. SslCertificates []string `json:"sslCertificates,omitempty"`
  9669. // ForceSendFields is a list of field names (e.g. "SslCertificates") to
  9670. // unconditionally include in API requests. By default, fields with
  9671. // empty values are omitted from API requests. However, any non-pointer,
  9672. // non-interface field appearing in ForceSendFields will be sent to the
  9673. // server regardless of whether the field is empty or not. This may be
  9674. // used to include empty fields in Patch requests.
  9675. ForceSendFields []string `json:"-"`
  9676. // NullFields is a list of field names (e.g. "SslCertificates") to
  9677. // include in API requests with the JSON null value. By default, fields
  9678. // with empty values are omitted from API requests. However, any field
  9679. // with an empty value appearing in NullFields will be sent to the
  9680. // server as null. It is an error if a field in this list has a
  9681. // non-empty value. This may be used to include null fields in Patch
  9682. // requests.
  9683. NullFields []string `json:"-"`
  9684. }
  9685. func (s *TargetHttpsProxiesSetSslCertificatesRequest) MarshalJSON() ([]byte, error) {
  9686. type noMethod TargetHttpsProxiesSetSslCertificatesRequest
  9687. raw := noMethod(*s)
  9688. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9689. }
  9690. // TargetHttpsProxy: A TargetHttpsProxy resource. This resource defines
  9691. // an HTTPS proxy.
  9692. type TargetHttpsProxy struct {
  9693. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  9694. // format.
  9695. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  9696. // Description: An optional description of this resource. Provide this
  9697. // property when you create the resource.
  9698. Description string `json:"description,omitempty"`
  9699. // Id: [Output Only] The unique identifier for the resource. This
  9700. // identifier is defined by the server.
  9701. Id uint64 `json:"id,omitempty,string"`
  9702. // Kind: [Output Only] Type of resource. Always compute#targetHttpsProxy
  9703. // for target HTTPS proxies.
  9704. Kind string `json:"kind,omitempty"`
  9705. // Name: Name of the resource. Provided by the client when the resource
  9706. // is created. The name must be 1-63 characters long, and comply with
  9707. // RFC1035. Specifically, the name must be 1-63 characters long and
  9708. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  9709. // the first character must be a lowercase letter, and all following
  9710. // characters must be a dash, lowercase letter, or digit, except the
  9711. // last character, which cannot be a dash.
  9712. Name string `json:"name,omitempty"`
  9713. // SelfLink: [Output Only] Server-defined URL for the resource.
  9714. SelfLink string `json:"selfLink,omitempty"`
  9715. // SslCertificates: URLs to SslCertificate resources that are used to
  9716. // authenticate connections between users and the load balancer.
  9717. // Currently, exactly one SSL certificate must be specified.
  9718. SslCertificates []string `json:"sslCertificates,omitempty"`
  9719. // UrlMap: A fully-qualified or valid partial URL to the UrlMap resource
  9720. // that defines the mapping from URL to the BackendService. For example,
  9721. // the following are all valid URLs for specifying a URL map:
  9722. // -
  9723. // https://www.googleapis.compute/v1/projects/project/global/urlMaps/url-map
  9724. // - projects/project/global/urlMaps/url-map
  9725. // - global/urlMaps/url-map
  9726. UrlMap string `json:"urlMap,omitempty"`
  9727. // ServerResponse contains the HTTP response code and headers from the
  9728. // server.
  9729. googleapi.ServerResponse `json:"-"`
  9730. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  9731. // to unconditionally include in API requests. By default, fields with
  9732. // empty values are omitted from API requests. However, any non-pointer,
  9733. // non-interface field appearing in ForceSendFields will be sent to the
  9734. // server regardless of whether the field is empty or not. This may be
  9735. // used to include empty fields in Patch requests.
  9736. ForceSendFields []string `json:"-"`
  9737. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  9738. // include in API requests with the JSON null value. By default, fields
  9739. // with empty values are omitted from API requests. However, any field
  9740. // with an empty value appearing in NullFields will be sent to the
  9741. // server as null. It is an error if a field in this list has a
  9742. // non-empty value. This may be used to include null fields in Patch
  9743. // requests.
  9744. NullFields []string `json:"-"`
  9745. }
  9746. func (s *TargetHttpsProxy) MarshalJSON() ([]byte, error) {
  9747. type noMethod TargetHttpsProxy
  9748. raw := noMethod(*s)
  9749. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9750. }
  9751. // TargetHttpsProxyList: Contains a list of TargetHttpsProxy resources.
  9752. type TargetHttpsProxyList struct {
  9753. // Id: [Output Only] The unique identifier for the resource. This
  9754. // identifier is defined by the server.
  9755. Id string `json:"id,omitempty"`
  9756. // Items: A list of TargetHttpsProxy resources.
  9757. Items []*TargetHttpsProxy `json:"items,omitempty"`
  9758. // Kind: Type of resource. Always compute#targetHttpsProxyList for lists
  9759. // of target HTTPS proxies.
  9760. Kind string `json:"kind,omitempty"`
  9761. // NextPageToken: [Output Only] This token allows you to get the next
  9762. // page of results for list requests. If the number of results is larger
  9763. // than maxResults, use the nextPageToken as a value for the query
  9764. // parameter pageToken in the next list request. Subsequent list
  9765. // requests will have their own nextPageToken to continue paging through
  9766. // the results.
  9767. NextPageToken string `json:"nextPageToken,omitempty"`
  9768. // SelfLink: [Output Only] Server-defined URL for this resource.
  9769. SelfLink string `json:"selfLink,omitempty"`
  9770. // ServerResponse contains the HTTP response code and headers from the
  9771. // server.
  9772. googleapi.ServerResponse `json:"-"`
  9773. // ForceSendFields is a list of field names (e.g. "Id") to
  9774. // unconditionally include in API requests. By default, fields with
  9775. // empty values are omitted from API requests. However, any non-pointer,
  9776. // non-interface field appearing in ForceSendFields will be sent to the
  9777. // server regardless of whether the field is empty or not. This may be
  9778. // used to include empty fields in Patch requests.
  9779. ForceSendFields []string `json:"-"`
  9780. // NullFields is a list of field names (e.g. "Id") to include in API
  9781. // requests with the JSON null value. By default, fields with empty
  9782. // values are omitted from API requests. However, any field with an
  9783. // empty value appearing in NullFields will be sent to the server as
  9784. // null. It is an error if a field in this list has a non-empty value.
  9785. // This may be used to include null fields in Patch requests.
  9786. NullFields []string `json:"-"`
  9787. }
  9788. func (s *TargetHttpsProxyList) MarshalJSON() ([]byte, error) {
  9789. type noMethod TargetHttpsProxyList
  9790. raw := noMethod(*s)
  9791. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9792. }
  9793. // TargetInstance: A TargetInstance resource. This resource defines an
  9794. // endpoint instance that terminates traffic of certain protocols.
  9795. type TargetInstance struct {
  9796. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  9797. // format.
  9798. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  9799. // Description: An optional description of this resource. Provide this
  9800. // property when you create the resource.
  9801. Description string `json:"description,omitempty"`
  9802. // Id: [Output Only] The unique identifier for the resource. This
  9803. // identifier is defined by the server.
  9804. Id uint64 `json:"id,omitempty,string"`
  9805. // Instance: A URL to the virtual machine instance that handles traffic
  9806. // for this target instance. When creating a target instance, you can
  9807. // provide the fully-qualified URL or a valid partial URL to the desired
  9808. // virtual machine. For example, the following are all valid URLs:
  9809. // -
  9810. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance
  9811. // - projects/project/zones/zone/instances/instance
  9812. // - zones/zone/instances/instance
  9813. Instance string `json:"instance,omitempty"`
  9814. // Kind: [Output Only] The type of the resource. Always
  9815. // compute#targetInstance for target instances.
  9816. Kind string `json:"kind,omitempty"`
  9817. // Name: Name of the resource. Provided by the client when the resource
  9818. // is created. The name must be 1-63 characters long, and comply with
  9819. // RFC1035. Specifically, the name must be 1-63 characters long and
  9820. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  9821. // the first character must be a lowercase letter, and all following
  9822. // characters must be a dash, lowercase letter, or digit, except the
  9823. // last character, which cannot be a dash.
  9824. Name string `json:"name,omitempty"`
  9825. // NatPolicy: NAT option controlling how IPs are NAT'ed to the instance.
  9826. // Currently only NO_NAT (default value) is supported.
  9827. //
  9828. // Possible values:
  9829. // "NO_NAT"
  9830. NatPolicy string `json:"natPolicy,omitempty"`
  9831. // SelfLink: [Output Only] Server-defined URL for the resource.
  9832. SelfLink string `json:"selfLink,omitempty"`
  9833. // Zone: [Output Only] URL of the zone where the target instance
  9834. // resides.
  9835. Zone string `json:"zone,omitempty"`
  9836. // ServerResponse contains the HTTP response code and headers from the
  9837. // server.
  9838. googleapi.ServerResponse `json:"-"`
  9839. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  9840. // to unconditionally include in API requests. By default, fields with
  9841. // empty values are omitted from API requests. However, any non-pointer,
  9842. // non-interface field appearing in ForceSendFields will be sent to the
  9843. // server regardless of whether the field is empty or not. This may be
  9844. // used to include empty fields in Patch requests.
  9845. ForceSendFields []string `json:"-"`
  9846. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  9847. // include in API requests with the JSON null value. By default, fields
  9848. // with empty values are omitted from API requests. However, any field
  9849. // with an empty value appearing in NullFields will be sent to the
  9850. // server as null. It is an error if a field in this list has a
  9851. // non-empty value. This may be used to include null fields in Patch
  9852. // requests.
  9853. NullFields []string `json:"-"`
  9854. }
  9855. func (s *TargetInstance) MarshalJSON() ([]byte, error) {
  9856. type noMethod TargetInstance
  9857. raw := noMethod(*s)
  9858. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9859. }
  9860. type TargetInstanceAggregatedList struct {
  9861. // Id: [Output Only] Unique identifier for the resource; defined by the
  9862. // server.
  9863. Id string `json:"id,omitempty"`
  9864. // Items: A map of scoped target instance lists.
  9865. Items map[string]TargetInstancesScopedList `json:"items,omitempty"`
  9866. // Kind: Type of resource.
  9867. Kind string `json:"kind,omitempty"`
  9868. // NextPageToken: [Output Only] This token allows you to get the next
  9869. // page of results for list requests. If the number of results is larger
  9870. // than maxResults, use the nextPageToken as a value for the query
  9871. // parameter pageToken in the next list request. Subsequent list
  9872. // requests will have their own nextPageToken to continue paging through
  9873. // the results.
  9874. NextPageToken string `json:"nextPageToken,omitempty"`
  9875. // SelfLink: [Output Only] Server-defined URL for this resource.
  9876. SelfLink string `json:"selfLink,omitempty"`
  9877. // ServerResponse contains the HTTP response code and headers from the
  9878. // server.
  9879. googleapi.ServerResponse `json:"-"`
  9880. // ForceSendFields is a list of field names (e.g. "Id") to
  9881. // unconditionally include in API requests. By default, fields with
  9882. // empty values are omitted from API requests. However, any non-pointer,
  9883. // non-interface field appearing in ForceSendFields will be sent to the
  9884. // server regardless of whether the field is empty or not. This may be
  9885. // used to include empty fields in Patch requests.
  9886. ForceSendFields []string `json:"-"`
  9887. // NullFields is a list of field names (e.g. "Id") to include in API
  9888. // requests with the JSON null value. By default, fields with empty
  9889. // values are omitted from API requests. However, any field with an
  9890. // empty value appearing in NullFields will be sent to the server as
  9891. // null. It is an error if a field in this list has a non-empty value.
  9892. // This may be used to include null fields in Patch requests.
  9893. NullFields []string `json:"-"`
  9894. }
  9895. func (s *TargetInstanceAggregatedList) MarshalJSON() ([]byte, error) {
  9896. type noMethod TargetInstanceAggregatedList
  9897. raw := noMethod(*s)
  9898. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9899. }
  9900. // TargetInstanceList: Contains a list of TargetInstance resources.
  9901. type TargetInstanceList struct {
  9902. // Id: [Output Only] The unique identifier for the resource. This
  9903. // identifier is defined by the server.
  9904. Id string `json:"id,omitempty"`
  9905. // Items: A list of TargetInstance resources.
  9906. Items []*TargetInstance `json:"items,omitempty"`
  9907. // Kind: Type of resource.
  9908. Kind string `json:"kind,omitempty"`
  9909. // NextPageToken: [Output Only] This token allows you to get the next
  9910. // page of results for list requests. If the number of results is larger
  9911. // than maxResults, use the nextPageToken as a value for the query
  9912. // parameter pageToken in the next list request. Subsequent list
  9913. // requests will have their own nextPageToken to continue paging through
  9914. // the results.
  9915. NextPageToken string `json:"nextPageToken,omitempty"`
  9916. // SelfLink: [Output Only] Server-defined URL for this resource.
  9917. SelfLink string `json:"selfLink,omitempty"`
  9918. // ServerResponse contains the HTTP response code and headers from the
  9919. // server.
  9920. googleapi.ServerResponse `json:"-"`
  9921. // ForceSendFields is a list of field names (e.g. "Id") to
  9922. // unconditionally include in API requests. By default, fields with
  9923. // empty values are omitted from API requests. However, any non-pointer,
  9924. // non-interface field appearing in ForceSendFields will be sent to the
  9925. // server regardless of whether the field is empty or not. This may be
  9926. // used to include empty fields in Patch requests.
  9927. ForceSendFields []string `json:"-"`
  9928. // NullFields is a list of field names (e.g. "Id") to include in API
  9929. // requests with the JSON null value. By default, fields with empty
  9930. // values are omitted from API requests. However, any field with an
  9931. // empty value appearing in NullFields will be sent to the server as
  9932. // null. It is an error if a field in this list has a non-empty value.
  9933. // This may be used to include null fields in Patch requests.
  9934. NullFields []string `json:"-"`
  9935. }
  9936. func (s *TargetInstanceList) MarshalJSON() ([]byte, error) {
  9937. type noMethod TargetInstanceList
  9938. raw := noMethod(*s)
  9939. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9940. }
  9941. type TargetInstancesScopedList struct {
  9942. // TargetInstances: List of target instances contained in this scope.
  9943. TargetInstances []*TargetInstance `json:"targetInstances,omitempty"`
  9944. // Warning: Informational warning which replaces the list of addresses
  9945. // when the list is empty.
  9946. Warning *TargetInstancesScopedListWarning `json:"warning,omitempty"`
  9947. // ForceSendFields is a list of field names (e.g. "TargetInstances") to
  9948. // unconditionally include in API requests. By default, fields with
  9949. // empty values are omitted from API requests. However, any non-pointer,
  9950. // non-interface field appearing in ForceSendFields will be sent to the
  9951. // server regardless of whether the field is empty or not. This may be
  9952. // used to include empty fields in Patch requests.
  9953. ForceSendFields []string `json:"-"`
  9954. // NullFields is a list of field names (e.g. "TargetInstances") to
  9955. // include in API requests with the JSON null value. By default, fields
  9956. // with empty values are omitted from API requests. However, any field
  9957. // with an empty value appearing in NullFields will be sent to the
  9958. // server as null. It is an error if a field in this list has a
  9959. // non-empty value. This may be used to include null fields in Patch
  9960. // requests.
  9961. NullFields []string `json:"-"`
  9962. }
  9963. func (s *TargetInstancesScopedList) MarshalJSON() ([]byte, error) {
  9964. type noMethod TargetInstancesScopedList
  9965. raw := noMethod(*s)
  9966. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9967. }
  9968. // TargetInstancesScopedListWarning: Informational warning which
  9969. // replaces the list of addresses when the list is empty.
  9970. type TargetInstancesScopedListWarning struct {
  9971. // Code: [Output Only] A warning code, if applicable. For example,
  9972. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  9973. // the response.
  9974. //
  9975. // Possible values:
  9976. // "CLEANUP_FAILED"
  9977. // "DEPRECATED_RESOURCE_USED"
  9978. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  9979. // "FIELD_VALUE_OVERRIDEN"
  9980. // "INJECTED_KERNELS_DEPRECATED"
  9981. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  9982. // "NEXT_HOP_CANNOT_IP_FORWARD"
  9983. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  9984. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  9985. // "NEXT_HOP_NOT_RUNNING"
  9986. // "NOT_CRITICAL_ERROR"
  9987. // "NO_RESULTS_ON_PAGE"
  9988. // "REQUIRED_TOS_AGREEMENT"
  9989. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  9990. // "RESOURCE_NOT_DELETED"
  9991. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  9992. // "UNREACHABLE"
  9993. Code string `json:"code,omitempty"`
  9994. // Data: [Output Only] Metadata about this warning in key: value format.
  9995. // For example:
  9996. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  9997. Data []*TargetInstancesScopedListWarningData `json:"data,omitempty"`
  9998. // Message: [Output Only] A human-readable description of the warning
  9999. // code.
  10000. Message string `json:"message,omitempty"`
  10001. // ForceSendFields is a list of field names (e.g. "Code") to
  10002. // unconditionally include in API requests. By default, fields with
  10003. // empty values are omitted from API requests. However, any non-pointer,
  10004. // non-interface field appearing in ForceSendFields will be sent to the
  10005. // server regardless of whether the field is empty or not. This may be
  10006. // used to include empty fields in Patch requests.
  10007. ForceSendFields []string `json:"-"`
  10008. // NullFields is a list of field names (e.g. "Code") to include in API
  10009. // requests with the JSON null value. By default, fields with empty
  10010. // values are omitted from API requests. However, any field with an
  10011. // empty value appearing in NullFields will be sent to the server as
  10012. // null. It is an error if a field in this list has a non-empty value.
  10013. // This may be used to include null fields in Patch requests.
  10014. NullFields []string `json:"-"`
  10015. }
  10016. func (s *TargetInstancesScopedListWarning) MarshalJSON() ([]byte, error) {
  10017. type noMethod TargetInstancesScopedListWarning
  10018. raw := noMethod(*s)
  10019. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10020. }
  10021. type TargetInstancesScopedListWarningData struct {
  10022. // Key: [Output Only] A key that provides more detail on the warning
  10023. // being returned. For example, for warnings where there are no results
  10024. // in a list request for a particular zone, this key might be scope and
  10025. // the key value might be the zone name. Other examples might be a key
  10026. // indicating a deprecated resource and a suggested replacement, or a
  10027. // warning about invalid network settings (for example, if an instance
  10028. // attempts to perform IP forwarding but is not enabled for IP
  10029. // forwarding).
  10030. Key string `json:"key,omitempty"`
  10031. // Value: [Output Only] A warning data value corresponding to the key.
  10032. Value string `json:"value,omitempty"`
  10033. // ForceSendFields is a list of field names (e.g. "Key") to
  10034. // unconditionally include in API requests. By default, fields with
  10035. // empty values are omitted from API requests. However, any non-pointer,
  10036. // non-interface field appearing in ForceSendFields will be sent to the
  10037. // server regardless of whether the field is empty or not. This may be
  10038. // used to include empty fields in Patch requests.
  10039. ForceSendFields []string `json:"-"`
  10040. // NullFields is a list of field names (e.g. "Key") to include in API
  10041. // requests with the JSON null value. By default, fields with empty
  10042. // values are omitted from API requests. However, any field with an
  10043. // empty value appearing in NullFields will be sent to the server as
  10044. // null. It is an error if a field in this list has a non-empty value.
  10045. // This may be used to include null fields in Patch requests.
  10046. NullFields []string `json:"-"`
  10047. }
  10048. func (s *TargetInstancesScopedListWarningData) MarshalJSON() ([]byte, error) {
  10049. type noMethod TargetInstancesScopedListWarningData
  10050. raw := noMethod(*s)
  10051. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10052. }
  10053. // TargetPool: A TargetPool resource. This resource defines a pool of
  10054. // instances, an associated HttpHealthCheck resource, and the fallback
  10055. // target pool.
  10056. type TargetPool struct {
  10057. // BackupPool: This field is applicable only when the containing target
  10058. // pool is serving a forwarding rule as the primary pool, and its
  10059. // failoverRatio field is properly set to a value between [0,
  10060. // 1].
  10061. //
  10062. // backupPool and failoverRatio together define the fallback behavior of
  10063. // the primary target pool: if the ratio of the healthy instances in the
  10064. // primary pool is at or below failoverRatio, traffic arriving at the
  10065. // load-balanced IP will be directed to the backup pool.
  10066. //
  10067. // In case where failoverRatio and backupPool are not set, or all the
  10068. // instances in the backup pool are unhealthy, the traffic will be
  10069. // directed back to the primary pool in the "force" mode, where traffic
  10070. // will be spread to the healthy instances with the best effort, or to
  10071. // all instances when no instance is healthy.
  10072. BackupPool string `json:"backupPool,omitempty"`
  10073. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  10074. // format.
  10075. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  10076. // Description: An optional description of this resource. Provide this
  10077. // property when you create the resource.
  10078. Description string `json:"description,omitempty"`
  10079. // FailoverRatio: This field is applicable only when the containing
  10080. // target pool is serving a forwarding rule as the primary pool (i.e.,
  10081. // not as a backup pool to some other target pool). The value of the
  10082. // field must be in [0, 1].
  10083. //
  10084. // If set, backupPool must also be set. They together define the
  10085. // fallback behavior of the primary target pool: if the ratio of the
  10086. // healthy instances in the primary pool is at or below this number,
  10087. // traffic arriving at the load-balanced IP will be directed to the
  10088. // backup pool.
  10089. //
  10090. // In case where failoverRatio is not set or all the instances in the
  10091. // backup pool are unhealthy, the traffic will be directed back to the
  10092. // primary pool in the "force" mode, where traffic will be spread to the
  10093. // healthy instances with the best effort, or to all instances when no
  10094. // instance is healthy.
  10095. FailoverRatio float64 `json:"failoverRatio,omitempty"`
  10096. // HealthChecks: The URL of the HttpHealthCheck resource. A member
  10097. // instance in this pool is considered healthy if and only if the health
  10098. // checks pass. An empty list means all member instances will be
  10099. // considered healthy at all times. Only HttpHealthChecks are supported.
  10100. // Only one health check may be specified.
  10101. HealthChecks []string `json:"healthChecks,omitempty"`
  10102. // Id: [Output Only] The unique identifier for the resource. This
  10103. // identifier is defined by the server.
  10104. Id uint64 `json:"id,omitempty,string"`
  10105. // Instances: A list of resource URLs to the virtual machine instances
  10106. // serving this pool. They must live in zones contained in the same
  10107. // region as this pool.
  10108. Instances []string `json:"instances,omitempty"`
  10109. // Kind: [Output Only] Type of the resource. Always compute#targetPool
  10110. // for target pools.
  10111. Kind string `json:"kind,omitempty"`
  10112. // Name: Name of the resource. Provided by the client when the resource
  10113. // is created. The name must be 1-63 characters long, and comply with
  10114. // RFC1035. Specifically, the name must be 1-63 characters long and
  10115. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  10116. // the first character must be a lowercase letter, and all following
  10117. // characters must be a dash, lowercase letter, or digit, except the
  10118. // last character, which cannot be a dash.
  10119. Name string `json:"name,omitempty"`
  10120. // Region: [Output Only] URL of the region where the target pool
  10121. // resides.
  10122. Region string `json:"region,omitempty"`
  10123. // SelfLink: [Output Only] Server-defined URL for the resource.
  10124. SelfLink string `json:"selfLink,omitempty"`
  10125. // SessionAffinity: Sesssion affinity option, must be one of the
  10126. // following values:
  10127. // NONE: Connections from the same client IP may go to any instance in
  10128. // the pool.
  10129. // CLIENT_IP: Connections from the same client IP will go to the same
  10130. // instance in the pool while that instance remains
  10131. // healthy.
  10132. // CLIENT_IP_PROTO: Connections from the same client IP with the same IP
  10133. // protocol will go to the same instance in the pool while that instance
  10134. // remains healthy.
  10135. //
  10136. // Possible values:
  10137. // "CLIENT_IP"
  10138. // "CLIENT_IP_PORT_PROTO"
  10139. // "CLIENT_IP_PROTO"
  10140. // "GENERATED_COOKIE"
  10141. // "NONE"
  10142. SessionAffinity string `json:"sessionAffinity,omitempty"`
  10143. // ServerResponse contains the HTTP response code and headers from the
  10144. // server.
  10145. googleapi.ServerResponse `json:"-"`
  10146. // ForceSendFields is a list of field names (e.g. "BackupPool") to
  10147. // unconditionally include in API requests. By default, fields with
  10148. // empty values are omitted from API requests. However, any non-pointer,
  10149. // non-interface field appearing in ForceSendFields will be sent to the
  10150. // server regardless of whether the field is empty or not. This may be
  10151. // used to include empty fields in Patch requests.
  10152. ForceSendFields []string `json:"-"`
  10153. // NullFields is a list of field names (e.g. "BackupPool") to include in
  10154. // API requests with the JSON null value. By default, fields with empty
  10155. // values are omitted from API requests. However, any field with an
  10156. // empty value appearing in NullFields will be sent to the server as
  10157. // null. It is an error if a field in this list has a non-empty value.
  10158. // This may be used to include null fields in Patch requests.
  10159. NullFields []string `json:"-"`
  10160. }
  10161. func (s *TargetPool) MarshalJSON() ([]byte, error) {
  10162. type noMethod TargetPool
  10163. raw := noMethod(*s)
  10164. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10165. }
  10166. func (s *TargetPool) UnmarshalJSON(data []byte) error {
  10167. type noMethod TargetPool
  10168. var s1 struct {
  10169. FailoverRatio gensupport.JSONFloat64 `json:"failoverRatio"`
  10170. *noMethod
  10171. }
  10172. s1.noMethod = (*noMethod)(s)
  10173. if err := json.Unmarshal(data, &s1); err != nil {
  10174. return err
  10175. }
  10176. s.FailoverRatio = float64(s1.FailoverRatio)
  10177. return nil
  10178. }
  10179. type TargetPoolAggregatedList struct {
  10180. // Id: [Output Only] Unique identifier for the resource. Defined by the
  10181. // server.
  10182. Id string `json:"id,omitempty"`
  10183. // Items: [Output Only] A map of scoped target pool lists.
  10184. Items map[string]TargetPoolsScopedList `json:"items,omitempty"`
  10185. // Kind: [Output Only] Type of resource. Always
  10186. // compute#targetPoolAggregatedList for aggregated lists of target
  10187. // pools.
  10188. Kind string `json:"kind,omitempty"`
  10189. // NextPageToken: [Output Only] This token allows you to get the next
  10190. // page of results for list requests. If the number of results is larger
  10191. // than maxResults, use the nextPageToken as a value for the query
  10192. // parameter pageToken in the next list request. Subsequent list
  10193. // requests will have their own nextPageToken to continue paging through
  10194. // the results.
  10195. NextPageToken string `json:"nextPageToken,omitempty"`
  10196. // SelfLink: [Output Only] Server-defined URL for this resource.
  10197. SelfLink string `json:"selfLink,omitempty"`
  10198. // ServerResponse contains the HTTP response code and headers from the
  10199. // server.
  10200. googleapi.ServerResponse `json:"-"`
  10201. // ForceSendFields is a list of field names (e.g. "Id") to
  10202. // unconditionally include in API requests. By default, fields with
  10203. // empty values are omitted from API requests. However, any non-pointer,
  10204. // non-interface field appearing in ForceSendFields will be sent to the
  10205. // server regardless of whether the field is empty or not. This may be
  10206. // used to include empty fields in Patch requests.
  10207. ForceSendFields []string `json:"-"`
  10208. // NullFields is a list of field names (e.g. "Id") to include in API
  10209. // requests with the JSON null value. By default, fields with empty
  10210. // values are omitted from API requests. However, any field with an
  10211. // empty value appearing in NullFields will be sent to the server as
  10212. // null. It is an error if a field in this list has a non-empty value.
  10213. // This may be used to include null fields in Patch requests.
  10214. NullFields []string `json:"-"`
  10215. }
  10216. func (s *TargetPoolAggregatedList) MarshalJSON() ([]byte, error) {
  10217. type noMethod TargetPoolAggregatedList
  10218. raw := noMethod(*s)
  10219. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10220. }
  10221. type TargetPoolInstanceHealth struct {
  10222. HealthStatus []*HealthStatus `json:"healthStatus,omitempty"`
  10223. // Kind: [Output Only] Type of resource. Always
  10224. // compute#targetPoolInstanceHealth when checking the health of an
  10225. // instance.
  10226. Kind string `json:"kind,omitempty"`
  10227. // ServerResponse contains the HTTP response code and headers from the
  10228. // server.
  10229. googleapi.ServerResponse `json:"-"`
  10230. // ForceSendFields is a list of field names (e.g. "HealthStatus") to
  10231. // unconditionally include in API requests. By default, fields with
  10232. // empty values are omitted from API requests. However, any non-pointer,
  10233. // non-interface field appearing in ForceSendFields will be sent to the
  10234. // server regardless of whether the field is empty or not. This may be
  10235. // used to include empty fields in Patch requests.
  10236. ForceSendFields []string `json:"-"`
  10237. // NullFields is a list of field names (e.g. "HealthStatus") to include
  10238. // in API requests with the JSON null value. By default, fields with
  10239. // empty values are omitted from API requests. However, any field with
  10240. // an empty value appearing in NullFields will be sent to the server as
  10241. // null. It is an error if a field in this list has a non-empty value.
  10242. // This may be used to include null fields in Patch requests.
  10243. NullFields []string `json:"-"`
  10244. }
  10245. func (s *TargetPoolInstanceHealth) MarshalJSON() ([]byte, error) {
  10246. type noMethod TargetPoolInstanceHealth
  10247. raw := noMethod(*s)
  10248. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10249. }
  10250. // TargetPoolList: Contains a list of TargetPool resources.
  10251. type TargetPoolList struct {
  10252. // Id: [Output Only] Unique identifier for the resource. Defined by the
  10253. // server.
  10254. Id string `json:"id,omitempty"`
  10255. // Items: A list of TargetPool resources.
  10256. Items []*TargetPool `json:"items,omitempty"`
  10257. // Kind: [Output Only] Type of resource. Always compute#targetPoolList
  10258. // for lists of target pools.
  10259. Kind string `json:"kind,omitempty"`
  10260. // NextPageToken: [Output Only] This token allows you to get the next
  10261. // page of results for list requests. If the number of results is larger
  10262. // than maxResults, use the nextPageToken as a value for the query
  10263. // parameter pageToken in the next list request. Subsequent list
  10264. // requests will have their own nextPageToken to continue paging through
  10265. // the results.
  10266. NextPageToken string `json:"nextPageToken,omitempty"`
  10267. // SelfLink: [Output Only] Server-defined URL for this resource.
  10268. SelfLink string `json:"selfLink,omitempty"`
  10269. // ServerResponse contains the HTTP response code and headers from the
  10270. // server.
  10271. googleapi.ServerResponse `json:"-"`
  10272. // ForceSendFields is a list of field names (e.g. "Id") to
  10273. // unconditionally include in API requests. By default, fields with
  10274. // empty values are omitted from API requests. However, any non-pointer,
  10275. // non-interface field appearing in ForceSendFields will be sent to the
  10276. // server regardless of whether the field is empty or not. This may be
  10277. // used to include empty fields in Patch requests.
  10278. ForceSendFields []string `json:"-"`
  10279. // NullFields is a list of field names (e.g. "Id") to include in API
  10280. // requests with the JSON null value. By default, fields with empty
  10281. // values are omitted from API requests. However, any field with an
  10282. // empty value appearing in NullFields will be sent to the server as
  10283. // null. It is an error if a field in this list has a non-empty value.
  10284. // This may be used to include null fields in Patch requests.
  10285. NullFields []string `json:"-"`
  10286. }
  10287. func (s *TargetPoolList) MarshalJSON() ([]byte, error) {
  10288. type noMethod TargetPoolList
  10289. raw := noMethod(*s)
  10290. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10291. }
  10292. type TargetPoolsAddHealthCheckRequest struct {
  10293. // HealthChecks: The HttpHealthCheck to add to the target pool.
  10294. HealthChecks []*HealthCheckReference `json:"healthChecks,omitempty"`
  10295. // ForceSendFields is a list of field names (e.g. "HealthChecks") to
  10296. // unconditionally include in API requests. By default, fields with
  10297. // empty values are omitted from API requests. However, any non-pointer,
  10298. // non-interface field appearing in ForceSendFields will be sent to the
  10299. // server regardless of whether the field is empty or not. This may be
  10300. // used to include empty fields in Patch requests.
  10301. ForceSendFields []string `json:"-"`
  10302. // NullFields is a list of field names (e.g. "HealthChecks") to include
  10303. // in API requests with the JSON null value. By default, fields with
  10304. // empty values are omitted from API requests. However, any field with
  10305. // an empty value appearing in NullFields will be sent to the server as
  10306. // null. It is an error if a field in this list has a non-empty value.
  10307. // This may be used to include null fields in Patch requests.
  10308. NullFields []string `json:"-"`
  10309. }
  10310. func (s *TargetPoolsAddHealthCheckRequest) MarshalJSON() ([]byte, error) {
  10311. type noMethod TargetPoolsAddHealthCheckRequest
  10312. raw := noMethod(*s)
  10313. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10314. }
  10315. type TargetPoolsAddInstanceRequest struct {
  10316. // Instances: A full or partial URL to an instance to add to this target
  10317. // pool. This can be a full or partial URL. For example, the following
  10318. // are valid URLs:
  10319. // -
  10320. // https://www.googleapis.com/compute/v1/projects/project-id/zones/zone/instances/instance-name
  10321. // - projects/project-id/zones/zone/instances/instance-name
  10322. // - zones/zone/instances/instance-name
  10323. Instances []*InstanceReference `json:"instances,omitempty"`
  10324. // ForceSendFields is a list of field names (e.g. "Instances") to
  10325. // unconditionally include in API requests. By default, fields with
  10326. // empty values are omitted from API requests. However, any non-pointer,
  10327. // non-interface field appearing in ForceSendFields will be sent to the
  10328. // server regardless of whether the field is empty or not. This may be
  10329. // used to include empty fields in Patch requests.
  10330. ForceSendFields []string `json:"-"`
  10331. // NullFields is a list of field names (e.g. "Instances") to include in
  10332. // API requests with the JSON null value. By default, fields with empty
  10333. // values are omitted from API requests. However, any field with an
  10334. // empty value appearing in NullFields will be sent to the server as
  10335. // null. It is an error if a field in this list has a non-empty value.
  10336. // This may be used to include null fields in Patch requests.
  10337. NullFields []string `json:"-"`
  10338. }
  10339. func (s *TargetPoolsAddInstanceRequest) MarshalJSON() ([]byte, error) {
  10340. type noMethod TargetPoolsAddInstanceRequest
  10341. raw := noMethod(*s)
  10342. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10343. }
  10344. type TargetPoolsRemoveHealthCheckRequest struct {
  10345. // HealthChecks: Health check URL to be removed. This can be a full or
  10346. // valid partial URL. For example, the following are valid URLs:
  10347. // -
  10348. // https://www.googleapis.com/compute/beta/projects/project/global/httpHealthChecks/health-check
  10349. // - projects/project/global/httpHealthChecks/health-check
  10350. // - global/httpHealthChecks/health-check
  10351. HealthChecks []*HealthCheckReference `json:"healthChecks,omitempty"`
  10352. // ForceSendFields is a list of field names (e.g. "HealthChecks") to
  10353. // unconditionally include in API requests. By default, fields with
  10354. // empty values are omitted from API requests. However, any non-pointer,
  10355. // non-interface field appearing in ForceSendFields will be sent to the
  10356. // server regardless of whether the field is empty or not. This may be
  10357. // used to include empty fields in Patch requests.
  10358. ForceSendFields []string `json:"-"`
  10359. // NullFields is a list of field names (e.g. "HealthChecks") to include
  10360. // in API requests with the JSON null value. By default, fields with
  10361. // empty values are omitted from API requests. However, any field with
  10362. // an empty value appearing in NullFields will be sent to the server as
  10363. // null. It is an error if a field in this list has a non-empty value.
  10364. // This may be used to include null fields in Patch requests.
  10365. NullFields []string `json:"-"`
  10366. }
  10367. func (s *TargetPoolsRemoveHealthCheckRequest) MarshalJSON() ([]byte, error) {
  10368. type noMethod TargetPoolsRemoveHealthCheckRequest
  10369. raw := noMethod(*s)
  10370. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10371. }
  10372. type TargetPoolsRemoveInstanceRequest struct {
  10373. // Instances: URLs of the instances to be removed from target pool.
  10374. Instances []*InstanceReference `json:"instances,omitempty"`
  10375. // ForceSendFields is a list of field names (e.g. "Instances") to
  10376. // unconditionally include in API requests. By default, fields with
  10377. // empty values are omitted from API requests. However, any non-pointer,
  10378. // non-interface field appearing in ForceSendFields will be sent to the
  10379. // server regardless of whether the field is empty or not. This may be
  10380. // used to include empty fields in Patch requests.
  10381. ForceSendFields []string `json:"-"`
  10382. // NullFields is a list of field names (e.g. "Instances") to include in
  10383. // API requests with the JSON null value. By default, fields with empty
  10384. // values are omitted from API requests. However, any field with an
  10385. // empty value appearing in NullFields will be sent to the server as
  10386. // null. It is an error if a field in this list has a non-empty value.
  10387. // This may be used to include null fields in Patch requests.
  10388. NullFields []string `json:"-"`
  10389. }
  10390. func (s *TargetPoolsRemoveInstanceRequest) MarshalJSON() ([]byte, error) {
  10391. type noMethod TargetPoolsRemoveInstanceRequest
  10392. raw := noMethod(*s)
  10393. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10394. }
  10395. type TargetPoolsScopedList struct {
  10396. // TargetPools: List of target pools contained in this scope.
  10397. TargetPools []*TargetPool `json:"targetPools,omitempty"`
  10398. // Warning: Informational warning which replaces the list of addresses
  10399. // when the list is empty.
  10400. Warning *TargetPoolsScopedListWarning `json:"warning,omitempty"`
  10401. // ForceSendFields is a list of field names (e.g. "TargetPools") to
  10402. // unconditionally include in API requests. By default, fields with
  10403. // empty values are omitted from API requests. However, any non-pointer,
  10404. // non-interface field appearing in ForceSendFields will be sent to the
  10405. // server regardless of whether the field is empty or not. This may be
  10406. // used to include empty fields in Patch requests.
  10407. ForceSendFields []string `json:"-"`
  10408. // NullFields is a list of field names (e.g. "TargetPools") to include
  10409. // in API requests with the JSON null value. By default, fields with
  10410. // empty values are omitted from API requests. However, any field with
  10411. // an empty value appearing in NullFields will be sent to the server as
  10412. // null. It is an error if a field in this list has a non-empty value.
  10413. // This may be used to include null fields in Patch requests.
  10414. NullFields []string `json:"-"`
  10415. }
  10416. func (s *TargetPoolsScopedList) MarshalJSON() ([]byte, error) {
  10417. type noMethod TargetPoolsScopedList
  10418. raw := noMethod(*s)
  10419. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10420. }
  10421. // TargetPoolsScopedListWarning: Informational warning which replaces
  10422. // the list of addresses when the list is empty.
  10423. type TargetPoolsScopedListWarning struct {
  10424. // Code: [Output Only] A warning code, if applicable. For example,
  10425. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  10426. // the response.
  10427. //
  10428. // Possible values:
  10429. // "CLEANUP_FAILED"
  10430. // "DEPRECATED_RESOURCE_USED"
  10431. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  10432. // "FIELD_VALUE_OVERRIDEN"
  10433. // "INJECTED_KERNELS_DEPRECATED"
  10434. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  10435. // "NEXT_HOP_CANNOT_IP_FORWARD"
  10436. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  10437. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  10438. // "NEXT_HOP_NOT_RUNNING"
  10439. // "NOT_CRITICAL_ERROR"
  10440. // "NO_RESULTS_ON_PAGE"
  10441. // "REQUIRED_TOS_AGREEMENT"
  10442. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  10443. // "RESOURCE_NOT_DELETED"
  10444. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  10445. // "UNREACHABLE"
  10446. Code string `json:"code,omitempty"`
  10447. // Data: [Output Only] Metadata about this warning in key: value format.
  10448. // For example:
  10449. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  10450. Data []*TargetPoolsScopedListWarningData `json:"data,omitempty"`
  10451. // Message: [Output Only] A human-readable description of the warning
  10452. // code.
  10453. Message string `json:"message,omitempty"`
  10454. // ForceSendFields is a list of field names (e.g. "Code") to
  10455. // unconditionally include in API requests. By default, fields with
  10456. // empty values are omitted from API requests. However, any non-pointer,
  10457. // non-interface field appearing in ForceSendFields will be sent to the
  10458. // server regardless of whether the field is empty or not. This may be
  10459. // used to include empty fields in Patch requests.
  10460. ForceSendFields []string `json:"-"`
  10461. // NullFields is a list of field names (e.g. "Code") to include in API
  10462. // requests with the JSON null value. By default, fields with empty
  10463. // values are omitted from API requests. However, any field with an
  10464. // empty value appearing in NullFields will be sent to the server as
  10465. // null. It is an error if a field in this list has a non-empty value.
  10466. // This may be used to include null fields in Patch requests.
  10467. NullFields []string `json:"-"`
  10468. }
  10469. func (s *TargetPoolsScopedListWarning) MarshalJSON() ([]byte, error) {
  10470. type noMethod TargetPoolsScopedListWarning
  10471. raw := noMethod(*s)
  10472. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10473. }
  10474. type TargetPoolsScopedListWarningData struct {
  10475. // Key: [Output Only] A key that provides more detail on the warning
  10476. // being returned. For example, for warnings where there are no results
  10477. // in a list request for a particular zone, this key might be scope and
  10478. // the key value might be the zone name. Other examples might be a key
  10479. // indicating a deprecated resource and a suggested replacement, or a
  10480. // warning about invalid network settings (for example, if an instance
  10481. // attempts to perform IP forwarding but is not enabled for IP
  10482. // forwarding).
  10483. Key string `json:"key,omitempty"`
  10484. // Value: [Output Only] A warning data value corresponding to the key.
  10485. Value string `json:"value,omitempty"`
  10486. // ForceSendFields is a list of field names (e.g. "Key") to
  10487. // unconditionally include in API requests. By default, fields with
  10488. // empty values are omitted from API requests. However, any non-pointer,
  10489. // non-interface field appearing in ForceSendFields will be sent to the
  10490. // server regardless of whether the field is empty or not. This may be
  10491. // used to include empty fields in Patch requests.
  10492. ForceSendFields []string `json:"-"`
  10493. // NullFields is a list of field names (e.g. "Key") to include in API
  10494. // requests with the JSON null value. By default, fields with empty
  10495. // values are omitted from API requests. However, any field with an
  10496. // empty value appearing in NullFields will be sent to the server as
  10497. // null. It is an error if a field in this list has a non-empty value.
  10498. // This may be used to include null fields in Patch requests.
  10499. NullFields []string `json:"-"`
  10500. }
  10501. func (s *TargetPoolsScopedListWarningData) MarshalJSON() ([]byte, error) {
  10502. type noMethod TargetPoolsScopedListWarningData
  10503. raw := noMethod(*s)
  10504. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10505. }
  10506. type TargetReference struct {
  10507. Target string `json:"target,omitempty"`
  10508. // ForceSendFields is a list of field names (e.g. "Target") to
  10509. // unconditionally include in API requests. By default, fields with
  10510. // empty values are omitted from API requests. However, any non-pointer,
  10511. // non-interface field appearing in ForceSendFields will be sent to the
  10512. // server regardless of whether the field is empty or not. This may be
  10513. // used to include empty fields in Patch requests.
  10514. ForceSendFields []string `json:"-"`
  10515. // NullFields is a list of field names (e.g. "Target") to include in API
  10516. // requests with the JSON null value. By default, fields with empty
  10517. // values are omitted from API requests. However, any field with an
  10518. // empty value appearing in NullFields will be sent to the server as
  10519. // null. It is an error if a field in this list has a non-empty value.
  10520. // This may be used to include null fields in Patch requests.
  10521. NullFields []string `json:"-"`
  10522. }
  10523. func (s *TargetReference) MarshalJSON() ([]byte, error) {
  10524. type noMethod TargetReference
  10525. raw := noMethod(*s)
  10526. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10527. }
  10528. type TargetSslProxiesSetBackendServiceRequest struct {
  10529. // Service: The URL of the new BackendService resource for the
  10530. // targetSslProxy.
  10531. Service string `json:"service,omitempty"`
  10532. // ForceSendFields is a list of field names (e.g. "Service") to
  10533. // unconditionally include in API requests. By default, fields with
  10534. // empty values are omitted from API requests. However, any non-pointer,
  10535. // non-interface field appearing in ForceSendFields will be sent to the
  10536. // server regardless of whether the field is empty or not. This may be
  10537. // used to include empty fields in Patch requests.
  10538. ForceSendFields []string `json:"-"`
  10539. // NullFields is a list of field names (e.g. "Service") to include in
  10540. // API requests with the JSON null value. By default, fields with empty
  10541. // values are omitted from API requests. However, any field with an
  10542. // empty value appearing in NullFields will be sent to the server as
  10543. // null. It is an error if a field in this list has a non-empty value.
  10544. // This may be used to include null fields in Patch requests.
  10545. NullFields []string `json:"-"`
  10546. }
  10547. func (s *TargetSslProxiesSetBackendServiceRequest) MarshalJSON() ([]byte, error) {
  10548. type noMethod TargetSslProxiesSetBackendServiceRequest
  10549. raw := noMethod(*s)
  10550. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10551. }
  10552. type TargetSslProxiesSetProxyHeaderRequest struct {
  10553. // ProxyHeader: The new type of proxy header to append before sending
  10554. // data to the backend. NONE or PROXY_V1 are allowed.
  10555. //
  10556. // Possible values:
  10557. // "NONE"
  10558. // "PROXY_V1"
  10559. ProxyHeader string `json:"proxyHeader,omitempty"`
  10560. // ForceSendFields is a list of field names (e.g. "ProxyHeader") to
  10561. // unconditionally include in API requests. By default, fields with
  10562. // empty values are omitted from API requests. However, any non-pointer,
  10563. // non-interface field appearing in ForceSendFields will be sent to the
  10564. // server regardless of whether the field is empty or not. This may be
  10565. // used to include empty fields in Patch requests.
  10566. ForceSendFields []string `json:"-"`
  10567. // NullFields is a list of field names (e.g. "ProxyHeader") to include
  10568. // in API requests with the JSON null value. By default, fields with
  10569. // empty values are omitted from API requests. However, any field with
  10570. // an empty value appearing in NullFields will be sent to the server as
  10571. // null. It is an error if a field in this list has a non-empty value.
  10572. // This may be used to include null fields in Patch requests.
  10573. NullFields []string `json:"-"`
  10574. }
  10575. func (s *TargetSslProxiesSetProxyHeaderRequest) MarshalJSON() ([]byte, error) {
  10576. type noMethod TargetSslProxiesSetProxyHeaderRequest
  10577. raw := noMethod(*s)
  10578. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10579. }
  10580. type TargetSslProxiesSetSslCertificatesRequest struct {
  10581. // SslCertificates: New set of URLs to SslCertificate resources to
  10582. // associate with this TargetSslProxy. Currently exactly one ssl
  10583. // certificate must be specified.
  10584. SslCertificates []string `json:"sslCertificates,omitempty"`
  10585. // ForceSendFields is a list of field names (e.g. "SslCertificates") to
  10586. // unconditionally include in API requests. By default, fields with
  10587. // empty values are omitted from API requests. However, any non-pointer,
  10588. // non-interface field appearing in ForceSendFields will be sent to the
  10589. // server regardless of whether the field is empty or not. This may be
  10590. // used to include empty fields in Patch requests.
  10591. ForceSendFields []string `json:"-"`
  10592. // NullFields is a list of field names (e.g. "SslCertificates") to
  10593. // include in API requests with the JSON null value. By default, fields
  10594. // with empty values are omitted from API requests. However, any field
  10595. // with an empty value appearing in NullFields will be sent to the
  10596. // server as null. It is an error if a field in this list has a
  10597. // non-empty value. This may be used to include null fields in Patch
  10598. // requests.
  10599. NullFields []string `json:"-"`
  10600. }
  10601. func (s *TargetSslProxiesSetSslCertificatesRequest) MarshalJSON() ([]byte, error) {
  10602. type noMethod TargetSslProxiesSetSslCertificatesRequest
  10603. raw := noMethod(*s)
  10604. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10605. }
  10606. // TargetSslProxy: A TargetSslProxy resource. This resource defines an
  10607. // SSL proxy.
  10608. type TargetSslProxy struct {
  10609. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  10610. // format.
  10611. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  10612. // Description: An optional description of this resource. Provide this
  10613. // property when you create the resource.
  10614. Description string `json:"description,omitempty"`
  10615. // Id: [Output Only] The unique identifier for the resource. This
  10616. // identifier is defined by the server.
  10617. Id uint64 `json:"id,omitempty,string"`
  10618. // Kind: [Output Only] Type of the resource. Always
  10619. // compute#targetSslProxy for target SSL proxies.
  10620. Kind string `json:"kind,omitempty"`
  10621. // Name: Name of the resource. Provided by the client when the resource
  10622. // is created. The name must be 1-63 characters long, and comply with
  10623. // RFC1035. Specifically, the name must be 1-63 characters long and
  10624. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  10625. // the first character must be a lowercase letter, and all following
  10626. // characters must be a dash, lowercase letter, or digit, except the
  10627. // last character, which cannot be a dash.
  10628. Name string `json:"name,omitempty"`
  10629. // ProxyHeader: Specifies the type of proxy header to append before
  10630. // sending data to the backend, either NONE or PROXY_V1. The default is
  10631. // NONE.
  10632. //
  10633. // Possible values:
  10634. // "NONE"
  10635. // "PROXY_V1"
  10636. ProxyHeader string `json:"proxyHeader,omitempty"`
  10637. // SelfLink: [Output Only] Server-defined URL for the resource.
  10638. SelfLink string `json:"selfLink,omitempty"`
  10639. // Service: URL to the BackendService resource.
  10640. Service string `json:"service,omitempty"`
  10641. // SslCertificates: URLs to SslCertificate resources that are used to
  10642. // authenticate connections to Backends. Currently exactly one SSL
  10643. // certificate must be specified.
  10644. SslCertificates []string `json:"sslCertificates,omitempty"`
  10645. // ServerResponse contains the HTTP response code and headers from the
  10646. // server.
  10647. googleapi.ServerResponse `json:"-"`
  10648. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  10649. // to unconditionally include in API requests. By default, fields with
  10650. // empty values are omitted from API requests. However, any non-pointer,
  10651. // non-interface field appearing in ForceSendFields will be sent to the
  10652. // server regardless of whether the field is empty or not. This may be
  10653. // used to include empty fields in Patch requests.
  10654. ForceSendFields []string `json:"-"`
  10655. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  10656. // include in API requests with the JSON null value. By default, fields
  10657. // with empty values are omitted from API requests. However, any field
  10658. // with an empty value appearing in NullFields will be sent to the
  10659. // server as null. It is an error if a field in this list has a
  10660. // non-empty value. This may be used to include null fields in Patch
  10661. // requests.
  10662. NullFields []string `json:"-"`
  10663. }
  10664. func (s *TargetSslProxy) MarshalJSON() ([]byte, error) {
  10665. type noMethod TargetSslProxy
  10666. raw := noMethod(*s)
  10667. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10668. }
  10669. // TargetSslProxyList: Contains a list of TargetSslProxy resources.
  10670. type TargetSslProxyList struct {
  10671. // Id: [Output Only] The unique identifier for the resource. This
  10672. // identifier is defined by the server.
  10673. Id string `json:"id,omitempty"`
  10674. // Items: A list of TargetSslProxy resources.
  10675. Items []*TargetSslProxy `json:"items,omitempty"`
  10676. // Kind: Type of resource.
  10677. Kind string `json:"kind,omitempty"`
  10678. // NextPageToken: [Output Only] This token allows you to get the next
  10679. // page of results for list requests. If the number of results is larger
  10680. // than maxResults, use the nextPageToken as a value for the query
  10681. // parameter pageToken in the next list request. Subsequent list
  10682. // requests will have their own nextPageToken to continue paging through
  10683. // the results.
  10684. NextPageToken string `json:"nextPageToken,omitempty"`
  10685. // SelfLink: [Output Only] Server-defined URL for this resource.
  10686. SelfLink string `json:"selfLink,omitempty"`
  10687. // ServerResponse contains the HTTP response code and headers from the
  10688. // server.
  10689. googleapi.ServerResponse `json:"-"`
  10690. // ForceSendFields is a list of field names (e.g. "Id") to
  10691. // unconditionally include in API requests. By default, fields with
  10692. // empty values are omitted from API requests. However, any non-pointer,
  10693. // non-interface field appearing in ForceSendFields will be sent to the
  10694. // server regardless of whether the field is empty or not. This may be
  10695. // used to include empty fields in Patch requests.
  10696. ForceSendFields []string `json:"-"`
  10697. // NullFields is a list of field names (e.g. "Id") to include in API
  10698. // requests with the JSON null value. By default, fields with empty
  10699. // values are omitted from API requests. However, any field with an
  10700. // empty value appearing in NullFields will be sent to the server as
  10701. // null. It is an error if a field in this list has a non-empty value.
  10702. // This may be used to include null fields in Patch requests.
  10703. NullFields []string `json:"-"`
  10704. }
  10705. func (s *TargetSslProxyList) MarshalJSON() ([]byte, error) {
  10706. type noMethod TargetSslProxyList
  10707. raw := noMethod(*s)
  10708. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10709. }
  10710. type TargetTcpProxiesSetBackendServiceRequest struct {
  10711. // Service: The URL of the new BackendService resource for the
  10712. // targetTcpProxy.
  10713. Service string `json:"service,omitempty"`
  10714. // ForceSendFields is a list of field names (e.g. "Service") to
  10715. // unconditionally include in API requests. By default, fields with
  10716. // empty values are omitted from API requests. However, any non-pointer,
  10717. // non-interface field appearing in ForceSendFields will be sent to the
  10718. // server regardless of whether the field is empty or not. This may be
  10719. // used to include empty fields in Patch requests.
  10720. ForceSendFields []string `json:"-"`
  10721. // NullFields is a list of field names (e.g. "Service") to include in
  10722. // API requests with the JSON null value. By default, fields with empty
  10723. // values are omitted from API requests. However, any field with an
  10724. // empty value appearing in NullFields will be sent to the server as
  10725. // null. It is an error if a field in this list has a non-empty value.
  10726. // This may be used to include null fields in Patch requests.
  10727. NullFields []string `json:"-"`
  10728. }
  10729. func (s *TargetTcpProxiesSetBackendServiceRequest) MarshalJSON() ([]byte, error) {
  10730. type noMethod TargetTcpProxiesSetBackendServiceRequest
  10731. raw := noMethod(*s)
  10732. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10733. }
  10734. type TargetTcpProxiesSetProxyHeaderRequest struct {
  10735. // ProxyHeader: The new type of proxy header to append before sending
  10736. // data to the backend. NONE or PROXY_V1 are allowed.
  10737. //
  10738. // Possible values:
  10739. // "NONE"
  10740. // "PROXY_V1"
  10741. ProxyHeader string `json:"proxyHeader,omitempty"`
  10742. // ForceSendFields is a list of field names (e.g. "ProxyHeader") to
  10743. // unconditionally include in API requests. By default, fields with
  10744. // empty values are omitted from API requests. However, any non-pointer,
  10745. // non-interface field appearing in ForceSendFields will be sent to the
  10746. // server regardless of whether the field is empty or not. This may be
  10747. // used to include empty fields in Patch requests.
  10748. ForceSendFields []string `json:"-"`
  10749. // NullFields is a list of field names (e.g. "ProxyHeader") to include
  10750. // in API requests with the JSON null value. By default, fields with
  10751. // empty values are omitted from API requests. However, any field with
  10752. // an empty value appearing in NullFields will be sent to the server as
  10753. // null. It is an error if a field in this list has a non-empty value.
  10754. // This may be used to include null fields in Patch requests.
  10755. NullFields []string `json:"-"`
  10756. }
  10757. func (s *TargetTcpProxiesSetProxyHeaderRequest) MarshalJSON() ([]byte, error) {
  10758. type noMethod TargetTcpProxiesSetProxyHeaderRequest
  10759. raw := noMethod(*s)
  10760. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10761. }
  10762. // TargetTcpProxy: A TargetTcpProxy resource. This resource defines a
  10763. // TCP proxy.
  10764. type TargetTcpProxy struct {
  10765. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  10766. // format.
  10767. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  10768. // Description: An optional description of this resource. Provide this
  10769. // property when you create the resource.
  10770. Description string `json:"description,omitempty"`
  10771. // Id: [Output Only] The unique identifier for the resource. This
  10772. // identifier is defined by the server.
  10773. Id uint64 `json:"id,omitempty,string"`
  10774. // Kind: [Output Only] Type of the resource. Always
  10775. // compute#targetTcpProxy for target TCP proxies.
  10776. Kind string `json:"kind,omitempty"`
  10777. // Name: Name of the resource. Provided by the client when the resource
  10778. // is created. The name must be 1-63 characters long, and comply with
  10779. // RFC1035. Specifically, the name must be 1-63 characters long and
  10780. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  10781. // the first character must be a lowercase letter, and all following
  10782. // characters must be a dash, lowercase letter, or digit, except the
  10783. // last character, which cannot be a dash.
  10784. Name string `json:"name,omitempty"`
  10785. // ProxyHeader: Specifies the type of proxy header to append before
  10786. // sending data to the backend, either NONE or PROXY_V1. The default is
  10787. // NONE.
  10788. //
  10789. // Possible values:
  10790. // "NONE"
  10791. // "PROXY_V1"
  10792. ProxyHeader string `json:"proxyHeader,omitempty"`
  10793. // SelfLink: [Output Only] Server-defined URL for the resource.
  10794. SelfLink string `json:"selfLink,omitempty"`
  10795. // Service: URL to the BackendService resource.
  10796. Service string `json:"service,omitempty"`
  10797. // ServerResponse contains the HTTP response code and headers from the
  10798. // server.
  10799. googleapi.ServerResponse `json:"-"`
  10800. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  10801. // to unconditionally include in API requests. By default, fields with
  10802. // empty values are omitted from API requests. However, any non-pointer,
  10803. // non-interface field appearing in ForceSendFields will be sent to the
  10804. // server regardless of whether the field is empty or not. This may be
  10805. // used to include empty fields in Patch requests.
  10806. ForceSendFields []string `json:"-"`
  10807. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  10808. // include in API requests with the JSON null value. By default, fields
  10809. // with empty values are omitted from API requests. However, any field
  10810. // with an empty value appearing in NullFields will be sent to the
  10811. // server as null. It is an error if a field in this list has a
  10812. // non-empty value. This may be used to include null fields in Patch
  10813. // requests.
  10814. NullFields []string `json:"-"`
  10815. }
  10816. func (s *TargetTcpProxy) MarshalJSON() ([]byte, error) {
  10817. type noMethod TargetTcpProxy
  10818. raw := noMethod(*s)
  10819. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10820. }
  10821. // TargetTcpProxyList: Contains a list of TargetTcpProxy resources.
  10822. type TargetTcpProxyList struct {
  10823. // Id: [Output Only] The unique identifier for the resource. This
  10824. // identifier is defined by the server.
  10825. Id string `json:"id,omitempty"`
  10826. // Items: A list of TargetTcpProxy resources.
  10827. Items []*TargetTcpProxy `json:"items,omitempty"`
  10828. // Kind: Type of resource.
  10829. Kind string `json:"kind,omitempty"`
  10830. // NextPageToken: [Output Only] This token allows you to get the next
  10831. // page of results for list requests. If the number of results is larger
  10832. // than maxResults, use the nextPageToken as a value for the query
  10833. // parameter pageToken in the next list request. Subsequent list
  10834. // requests will have their own nextPageToken to continue paging through
  10835. // the results.
  10836. NextPageToken string `json:"nextPageToken,omitempty"`
  10837. // SelfLink: [Output Only] Server-defined URL for this resource.
  10838. SelfLink string `json:"selfLink,omitempty"`
  10839. // ServerResponse contains the HTTP response code and headers from the
  10840. // server.
  10841. googleapi.ServerResponse `json:"-"`
  10842. // ForceSendFields is a list of field names (e.g. "Id") to
  10843. // unconditionally include in API requests. By default, fields with
  10844. // empty values are omitted from API requests. However, any non-pointer,
  10845. // non-interface field appearing in ForceSendFields will be sent to the
  10846. // server regardless of whether the field is empty or not. This may be
  10847. // used to include empty fields in Patch requests.
  10848. ForceSendFields []string `json:"-"`
  10849. // NullFields is a list of field names (e.g. "Id") to include in API
  10850. // requests with the JSON null value. By default, fields with empty
  10851. // values are omitted from API requests. However, any field with an
  10852. // empty value appearing in NullFields will be sent to the server as
  10853. // null. It is an error if a field in this list has a non-empty value.
  10854. // This may be used to include null fields in Patch requests.
  10855. NullFields []string `json:"-"`
  10856. }
  10857. func (s *TargetTcpProxyList) MarshalJSON() ([]byte, error) {
  10858. type noMethod TargetTcpProxyList
  10859. raw := noMethod(*s)
  10860. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10861. }
  10862. // TargetVpnGateway: Represents a Target VPN gateway resource.
  10863. type TargetVpnGateway struct {
  10864. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  10865. // format.
  10866. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  10867. // Description: An optional description of this resource. Provide this
  10868. // property when you create the resource.
  10869. Description string `json:"description,omitempty"`
  10870. // ForwardingRules: [Output Only] A list of URLs to the ForwardingRule
  10871. // resources. ForwardingRules are created using
  10872. // compute.forwardingRules.insert and associated to a VPN gateway.
  10873. ForwardingRules []string `json:"forwardingRules,omitempty"`
  10874. // Id: [Output Only] The unique identifier for the resource. This
  10875. // identifier is defined by the server.
  10876. Id uint64 `json:"id,omitempty,string"`
  10877. // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway
  10878. // for target VPN gateways.
  10879. Kind string `json:"kind,omitempty"`
  10880. // Name: Name of the resource. Provided by the client when the resource
  10881. // is created. The name must be 1-63 characters long, and comply with
  10882. // RFC1035. Specifically, the name must be 1-63 characters long and
  10883. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  10884. // the first character must be a lowercase letter, and all following
  10885. // characters must be a dash, lowercase letter, or digit, except the
  10886. // last character, which cannot be a dash.
  10887. Name string `json:"name,omitempty"`
  10888. // Network: URL of the network to which this VPN gateway is attached.
  10889. // Provided by the client when the VPN gateway is created.
  10890. Network string `json:"network,omitempty"`
  10891. // Region: [Output Only] URL of the region where the target VPN gateway
  10892. // resides.
  10893. Region string `json:"region,omitempty"`
  10894. // SelfLink: [Output Only] Server-defined URL for the resource.
  10895. SelfLink string `json:"selfLink,omitempty"`
  10896. // Status: [Output Only] The status of the VPN gateway.
  10897. //
  10898. // Possible values:
  10899. // "CREATING"
  10900. // "DELETING"
  10901. // "FAILED"
  10902. // "READY"
  10903. Status string `json:"status,omitempty"`
  10904. // Tunnels: [Output Only] A list of URLs to VpnTunnel resources.
  10905. // VpnTunnels are created using compute.vpntunnels.insert method and
  10906. // associated to a VPN gateway.
  10907. Tunnels []string `json:"tunnels,omitempty"`
  10908. // ServerResponse contains the HTTP response code and headers from the
  10909. // server.
  10910. googleapi.ServerResponse `json:"-"`
  10911. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  10912. // to unconditionally include in API requests. By default, fields with
  10913. // empty values are omitted from API requests. However, any non-pointer,
  10914. // non-interface field appearing in ForceSendFields will be sent to the
  10915. // server regardless of whether the field is empty or not. This may be
  10916. // used to include empty fields in Patch requests.
  10917. ForceSendFields []string `json:"-"`
  10918. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  10919. // include in API requests with the JSON null value. By default, fields
  10920. // with empty values are omitted from API requests. However, any field
  10921. // with an empty value appearing in NullFields will be sent to the
  10922. // server as null. It is an error if a field in this list has a
  10923. // non-empty value. This may be used to include null fields in Patch
  10924. // requests.
  10925. NullFields []string `json:"-"`
  10926. }
  10927. func (s *TargetVpnGateway) MarshalJSON() ([]byte, error) {
  10928. type noMethod TargetVpnGateway
  10929. raw := noMethod(*s)
  10930. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10931. }
  10932. type TargetVpnGatewayAggregatedList struct {
  10933. // Id: [Output Only] The unique identifier for the resource. This
  10934. // identifier is defined by the server.
  10935. Id string `json:"id,omitempty"`
  10936. // Items: A map of scoped target vpn gateway lists.
  10937. Items map[string]TargetVpnGatewaysScopedList `json:"items,omitempty"`
  10938. // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway
  10939. // for target VPN gateways.
  10940. Kind string `json:"kind,omitempty"`
  10941. // NextPageToken: [Output Only] This token allows you to get the next
  10942. // page of results for list requests. If the number of results is larger
  10943. // than maxResults, use the nextPageToken as a value for the query
  10944. // parameter pageToken in the next list request. Subsequent list
  10945. // requests will have their own nextPageToken to continue paging through
  10946. // the results.
  10947. NextPageToken string `json:"nextPageToken,omitempty"`
  10948. // SelfLink: [Output Only] Server-defined URL for this resource.
  10949. SelfLink string `json:"selfLink,omitempty"`
  10950. // ServerResponse contains the HTTP response code and headers from the
  10951. // server.
  10952. googleapi.ServerResponse `json:"-"`
  10953. // ForceSendFields is a list of field names (e.g. "Id") to
  10954. // unconditionally include in API requests. By default, fields with
  10955. // empty values are omitted from API requests. However, any non-pointer,
  10956. // non-interface field appearing in ForceSendFields will be sent to the
  10957. // server regardless of whether the field is empty or not. This may be
  10958. // used to include empty fields in Patch requests.
  10959. ForceSendFields []string `json:"-"`
  10960. // NullFields is a list of field names (e.g. "Id") to include in API
  10961. // requests with the JSON null value. By default, fields with empty
  10962. // values are omitted from API requests. However, any field with an
  10963. // empty value appearing in NullFields will be sent to the server as
  10964. // null. It is an error if a field in this list has a non-empty value.
  10965. // This may be used to include null fields in Patch requests.
  10966. NullFields []string `json:"-"`
  10967. }
  10968. func (s *TargetVpnGatewayAggregatedList) MarshalJSON() ([]byte, error) {
  10969. type noMethod TargetVpnGatewayAggregatedList
  10970. raw := noMethod(*s)
  10971. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10972. }
  10973. // TargetVpnGatewayList: Contains a list of TargetVpnGateway resources.
  10974. type TargetVpnGatewayList struct {
  10975. // Id: [Output Only] The unique identifier for the resource. This
  10976. // identifier is defined by the server.
  10977. Id string `json:"id,omitempty"`
  10978. // Items: [Output Only] A list of TargetVpnGateway resources.
  10979. Items []*TargetVpnGateway `json:"items,omitempty"`
  10980. // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway
  10981. // for target VPN gateways.
  10982. Kind string `json:"kind,omitempty"`
  10983. // NextPageToken: [Output Only] This token allows you to get the next
  10984. // page of results for list requests. If the number of results is larger
  10985. // than maxResults, use the nextPageToken as a value for the query
  10986. // parameter pageToken in the next list request. Subsequent list
  10987. // requests will have their own nextPageToken to continue paging through
  10988. // the results.
  10989. NextPageToken string `json:"nextPageToken,omitempty"`
  10990. // SelfLink: [Output Only] Server-defined URL for this resource.
  10991. SelfLink string `json:"selfLink,omitempty"`
  10992. // ServerResponse contains the HTTP response code and headers from the
  10993. // server.
  10994. googleapi.ServerResponse `json:"-"`
  10995. // ForceSendFields is a list of field names (e.g. "Id") to
  10996. // unconditionally include in API requests. By default, fields with
  10997. // empty values are omitted from API requests. However, any non-pointer,
  10998. // non-interface field appearing in ForceSendFields will be sent to the
  10999. // server regardless of whether the field is empty or not. This may be
  11000. // used to include empty fields in Patch requests.
  11001. ForceSendFields []string `json:"-"`
  11002. // NullFields is a list of field names (e.g. "Id") to include in API
  11003. // requests with the JSON null value. By default, fields with empty
  11004. // values are omitted from API requests. However, any field with an
  11005. // empty value appearing in NullFields will be sent to the server as
  11006. // null. It is an error if a field in this list has a non-empty value.
  11007. // This may be used to include null fields in Patch requests.
  11008. NullFields []string `json:"-"`
  11009. }
  11010. func (s *TargetVpnGatewayList) MarshalJSON() ([]byte, error) {
  11011. type noMethod TargetVpnGatewayList
  11012. raw := noMethod(*s)
  11013. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11014. }
  11015. type TargetVpnGatewaysScopedList struct {
  11016. // TargetVpnGateways: [Output Only] List of target vpn gateways
  11017. // contained in this scope.
  11018. TargetVpnGateways []*TargetVpnGateway `json:"targetVpnGateways,omitempty"`
  11019. // Warning: [Output Only] Informational warning which replaces the list
  11020. // of addresses when the list is empty.
  11021. Warning *TargetVpnGatewaysScopedListWarning `json:"warning,omitempty"`
  11022. // ForceSendFields is a list of field names (e.g. "TargetVpnGateways")
  11023. // to unconditionally include in API requests. By default, fields with
  11024. // empty values are omitted from API requests. However, any non-pointer,
  11025. // non-interface field appearing in ForceSendFields will be sent to the
  11026. // server regardless of whether the field is empty or not. This may be
  11027. // used to include empty fields in Patch requests.
  11028. ForceSendFields []string `json:"-"`
  11029. // NullFields is a list of field names (e.g. "TargetVpnGateways") to
  11030. // include in API requests with the JSON null value. By default, fields
  11031. // with empty values are omitted from API requests. However, any field
  11032. // with an empty value appearing in NullFields will be sent to the
  11033. // server as null. It is an error if a field in this list has a
  11034. // non-empty value. This may be used to include null fields in Patch
  11035. // requests.
  11036. NullFields []string `json:"-"`
  11037. }
  11038. func (s *TargetVpnGatewaysScopedList) MarshalJSON() ([]byte, error) {
  11039. type noMethod TargetVpnGatewaysScopedList
  11040. raw := noMethod(*s)
  11041. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11042. }
  11043. // TargetVpnGatewaysScopedListWarning: [Output Only] Informational
  11044. // warning which replaces the list of addresses when the list is empty.
  11045. type TargetVpnGatewaysScopedListWarning struct {
  11046. // Code: [Output Only] A warning code, if applicable. For example,
  11047. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  11048. // the response.
  11049. //
  11050. // Possible values:
  11051. // "CLEANUP_FAILED"
  11052. // "DEPRECATED_RESOURCE_USED"
  11053. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  11054. // "FIELD_VALUE_OVERRIDEN"
  11055. // "INJECTED_KERNELS_DEPRECATED"
  11056. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  11057. // "NEXT_HOP_CANNOT_IP_FORWARD"
  11058. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  11059. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  11060. // "NEXT_HOP_NOT_RUNNING"
  11061. // "NOT_CRITICAL_ERROR"
  11062. // "NO_RESULTS_ON_PAGE"
  11063. // "REQUIRED_TOS_AGREEMENT"
  11064. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  11065. // "RESOURCE_NOT_DELETED"
  11066. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  11067. // "UNREACHABLE"
  11068. Code string `json:"code,omitempty"`
  11069. // Data: [Output Only] Metadata about this warning in key: value format.
  11070. // For example:
  11071. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  11072. Data []*TargetVpnGatewaysScopedListWarningData `json:"data,omitempty"`
  11073. // Message: [Output Only] A human-readable description of the warning
  11074. // code.
  11075. Message string `json:"message,omitempty"`
  11076. // ForceSendFields is a list of field names (e.g. "Code") to
  11077. // unconditionally include in API requests. By default, fields with
  11078. // empty values are omitted from API requests. However, any non-pointer,
  11079. // non-interface field appearing in ForceSendFields will be sent to the
  11080. // server regardless of whether the field is empty or not. This may be
  11081. // used to include empty fields in Patch requests.
  11082. ForceSendFields []string `json:"-"`
  11083. // NullFields is a list of field names (e.g. "Code") to include in API
  11084. // requests with the JSON null value. By default, fields with empty
  11085. // values are omitted from API requests. However, any field with an
  11086. // empty value appearing in NullFields will be sent to the server as
  11087. // null. It is an error if a field in this list has a non-empty value.
  11088. // This may be used to include null fields in Patch requests.
  11089. NullFields []string `json:"-"`
  11090. }
  11091. func (s *TargetVpnGatewaysScopedListWarning) MarshalJSON() ([]byte, error) {
  11092. type noMethod TargetVpnGatewaysScopedListWarning
  11093. raw := noMethod(*s)
  11094. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11095. }
  11096. type TargetVpnGatewaysScopedListWarningData struct {
  11097. // Key: [Output Only] A key that provides more detail on the warning
  11098. // being returned. For example, for warnings where there are no results
  11099. // in a list request for a particular zone, this key might be scope and
  11100. // the key value might be the zone name. Other examples might be a key
  11101. // indicating a deprecated resource and a suggested replacement, or a
  11102. // warning about invalid network settings (for example, if an instance
  11103. // attempts to perform IP forwarding but is not enabled for IP
  11104. // forwarding).
  11105. Key string `json:"key,omitempty"`
  11106. // Value: [Output Only] A warning data value corresponding to the key.
  11107. Value string `json:"value,omitempty"`
  11108. // ForceSendFields is a list of field names (e.g. "Key") to
  11109. // unconditionally include in API requests. By default, fields with
  11110. // empty values are omitted from API requests. However, any non-pointer,
  11111. // non-interface field appearing in ForceSendFields will be sent to the
  11112. // server regardless of whether the field is empty or not. This may be
  11113. // used to include empty fields in Patch requests.
  11114. ForceSendFields []string `json:"-"`
  11115. // NullFields is a list of field names (e.g. "Key") to include in API
  11116. // requests with the JSON null value. By default, fields with empty
  11117. // values are omitted from API requests. However, any field with an
  11118. // empty value appearing in NullFields will be sent to the server as
  11119. // null. It is an error if a field in this list has a non-empty value.
  11120. // This may be used to include null fields in Patch requests.
  11121. NullFields []string `json:"-"`
  11122. }
  11123. func (s *TargetVpnGatewaysScopedListWarningData) MarshalJSON() ([]byte, error) {
  11124. type noMethod TargetVpnGatewaysScopedListWarningData
  11125. raw := noMethod(*s)
  11126. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11127. }
  11128. type TestFailure struct {
  11129. ActualService string `json:"actualService,omitempty"`
  11130. ExpectedService string `json:"expectedService,omitempty"`
  11131. Host string `json:"host,omitempty"`
  11132. Path string `json:"path,omitempty"`
  11133. // ForceSendFields is a list of field names (e.g. "ActualService") to
  11134. // unconditionally include in API requests. By default, fields with
  11135. // empty values are omitted from API requests. However, any non-pointer,
  11136. // non-interface field appearing in ForceSendFields will be sent to the
  11137. // server regardless of whether the field is empty or not. This may be
  11138. // used to include empty fields in Patch requests.
  11139. ForceSendFields []string `json:"-"`
  11140. // NullFields is a list of field names (e.g. "ActualService") to include
  11141. // in API requests with the JSON null value. By default, fields with
  11142. // empty values are omitted from API requests. However, any field with
  11143. // an empty value appearing in NullFields will be sent to the server as
  11144. // null. It is an error if a field in this list has a non-empty value.
  11145. // This may be used to include null fields in Patch requests.
  11146. NullFields []string `json:"-"`
  11147. }
  11148. func (s *TestFailure) MarshalJSON() ([]byte, error) {
  11149. type noMethod TestFailure
  11150. raw := noMethod(*s)
  11151. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11152. }
  11153. // UrlMap: A UrlMap resource. This resource defines the mapping from URL
  11154. // to the BackendService resource, based on the "longest-match" of the
  11155. // URL's host and path.
  11156. type UrlMap struct {
  11157. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  11158. // format.
  11159. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  11160. // DefaultService: The URL of the BackendService resource if none of the
  11161. // hostRules match.
  11162. DefaultService string `json:"defaultService,omitempty"`
  11163. // Description: An optional description of this resource. Provide this
  11164. // property when you create the resource.
  11165. Description string `json:"description,omitempty"`
  11166. // Fingerprint: Fingerprint of this resource. A hash of the contents
  11167. // stored in this object. This field is used in optimistic locking. This
  11168. // field will be ignored when inserting a UrlMap. An up-to-date
  11169. // fingerprint must be provided in order to update the UrlMap.
  11170. Fingerprint string `json:"fingerprint,omitempty"`
  11171. // HostRules: The list of HostRules to use against the URL.
  11172. HostRules []*HostRule `json:"hostRules,omitempty"`
  11173. // Id: [Output Only] The unique identifier for the resource. This
  11174. // identifier is defined by the server.
  11175. Id uint64 `json:"id,omitempty,string"`
  11176. // Kind: [Output Only] Type of the resource. Always compute#urlMaps for
  11177. // url maps.
  11178. Kind string `json:"kind,omitempty"`
  11179. // Name: Name of the resource. Provided by the client when the resource
  11180. // is created. The name must be 1-63 characters long, and comply with
  11181. // RFC1035. Specifically, the name must be 1-63 characters long and
  11182. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  11183. // the first character must be a lowercase letter, and all following
  11184. // characters must be a dash, lowercase letter, or digit, except the
  11185. // last character, which cannot be a dash.
  11186. Name string `json:"name,omitempty"`
  11187. // PathMatchers: The list of named PathMatchers to use against the URL.
  11188. PathMatchers []*PathMatcher `json:"pathMatchers,omitempty"`
  11189. // SelfLink: [Output Only] Server-defined URL for the resource.
  11190. SelfLink string `json:"selfLink,omitempty"`
  11191. // Tests: The list of expected URL mappings. Request to update this
  11192. // UrlMap will succeed only if all of the test cases pass.
  11193. Tests []*UrlMapTest `json:"tests,omitempty"`
  11194. // ServerResponse contains the HTTP response code and headers from the
  11195. // server.
  11196. googleapi.ServerResponse `json:"-"`
  11197. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  11198. // to unconditionally include in API requests. By default, fields with
  11199. // empty values are omitted from API requests. However, any non-pointer,
  11200. // non-interface field appearing in ForceSendFields will be sent to the
  11201. // server regardless of whether the field is empty or not. This may be
  11202. // used to include empty fields in Patch requests.
  11203. ForceSendFields []string `json:"-"`
  11204. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  11205. // include in API requests with the JSON null value. By default, fields
  11206. // with empty values are omitted from API requests. However, any field
  11207. // with an empty value appearing in NullFields will be sent to the
  11208. // server as null. It is an error if a field in this list has a
  11209. // non-empty value. This may be used to include null fields in Patch
  11210. // requests.
  11211. NullFields []string `json:"-"`
  11212. }
  11213. func (s *UrlMap) MarshalJSON() ([]byte, error) {
  11214. type noMethod UrlMap
  11215. raw := noMethod(*s)
  11216. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11217. }
  11218. // UrlMapList: Contains a list of UrlMap resources.
  11219. type UrlMapList struct {
  11220. // Id: [Output Only] Unique identifier for the resource. Set by the
  11221. // server.
  11222. Id string `json:"id,omitempty"`
  11223. // Items: A list of UrlMap resources.
  11224. Items []*UrlMap `json:"items,omitempty"`
  11225. // Kind: Type of resource.
  11226. Kind string `json:"kind,omitempty"`
  11227. // NextPageToken: [Output Only] This token allows you to get the next
  11228. // page of results for list requests. If the number of results is larger
  11229. // than maxResults, use the nextPageToken as a value for the query
  11230. // parameter pageToken in the next list request. Subsequent list
  11231. // requests will have their own nextPageToken to continue paging through
  11232. // the results.
  11233. NextPageToken string `json:"nextPageToken,omitempty"`
  11234. // SelfLink: [Output Only] Server-defined URL for this resource.
  11235. SelfLink string `json:"selfLink,omitempty"`
  11236. // ServerResponse contains the HTTP response code and headers from the
  11237. // server.
  11238. googleapi.ServerResponse `json:"-"`
  11239. // ForceSendFields is a list of field names (e.g. "Id") to
  11240. // unconditionally include in API requests. By default, fields with
  11241. // empty values are omitted from API requests. However, any non-pointer,
  11242. // non-interface field appearing in ForceSendFields will be sent to the
  11243. // server regardless of whether the field is empty or not. This may be
  11244. // used to include empty fields in Patch requests.
  11245. ForceSendFields []string `json:"-"`
  11246. // NullFields is a list of field names (e.g. "Id") to include in API
  11247. // requests with the JSON null value. By default, fields with empty
  11248. // values are omitted from API requests. However, any field with an
  11249. // empty value appearing in NullFields will be sent to the server as
  11250. // null. It is an error if a field in this list has a non-empty value.
  11251. // This may be used to include null fields in Patch requests.
  11252. NullFields []string `json:"-"`
  11253. }
  11254. func (s *UrlMapList) MarshalJSON() ([]byte, error) {
  11255. type noMethod UrlMapList
  11256. raw := noMethod(*s)
  11257. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11258. }
  11259. type UrlMapReference struct {
  11260. UrlMap string `json:"urlMap,omitempty"`
  11261. // ForceSendFields is a list of field names (e.g. "UrlMap") to
  11262. // unconditionally include in API requests. By default, fields with
  11263. // empty values are omitted from API requests. However, any non-pointer,
  11264. // non-interface field appearing in ForceSendFields will be sent to the
  11265. // server regardless of whether the field is empty or not. This may be
  11266. // used to include empty fields in Patch requests.
  11267. ForceSendFields []string `json:"-"`
  11268. // NullFields is a list of field names (e.g. "UrlMap") to include in API
  11269. // requests with the JSON null value. By default, fields with empty
  11270. // values are omitted from API requests. However, any field with an
  11271. // empty value appearing in NullFields will be sent to the server as
  11272. // null. It is an error if a field in this list has a non-empty value.
  11273. // This may be used to include null fields in Patch requests.
  11274. NullFields []string `json:"-"`
  11275. }
  11276. func (s *UrlMapReference) MarshalJSON() ([]byte, error) {
  11277. type noMethod UrlMapReference
  11278. raw := noMethod(*s)
  11279. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11280. }
  11281. // UrlMapTest: Message for the expected URL mappings.
  11282. type UrlMapTest struct {
  11283. // Description: Description of this test case.
  11284. Description string `json:"description,omitempty"`
  11285. // Host: Host portion of the URL.
  11286. Host string `json:"host,omitempty"`
  11287. // Path: Path portion of the URL.
  11288. Path string `json:"path,omitempty"`
  11289. // Service: Expected BackendService resource the given URL should be
  11290. // mapped to.
  11291. Service string `json:"service,omitempty"`
  11292. // ForceSendFields is a list of field names (e.g. "Description") to
  11293. // unconditionally include in API requests. By default, fields with
  11294. // empty values are omitted from API requests. However, any non-pointer,
  11295. // non-interface field appearing in ForceSendFields will be sent to the
  11296. // server regardless of whether the field is empty or not. This may be
  11297. // used to include empty fields in Patch requests.
  11298. ForceSendFields []string `json:"-"`
  11299. // NullFields is a list of field names (e.g. "Description") to include
  11300. // in API requests with the JSON null value. By default, fields with
  11301. // empty values are omitted from API requests. However, any field with
  11302. // an empty value appearing in NullFields will be sent to the server as
  11303. // null. It is an error if a field in this list has a non-empty value.
  11304. // This may be used to include null fields in Patch requests.
  11305. NullFields []string `json:"-"`
  11306. }
  11307. func (s *UrlMapTest) MarshalJSON() ([]byte, error) {
  11308. type noMethod UrlMapTest
  11309. raw := noMethod(*s)
  11310. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11311. }
  11312. // UrlMapValidationResult: Message representing the validation result
  11313. // for a UrlMap.
  11314. type UrlMapValidationResult struct {
  11315. LoadErrors []string `json:"loadErrors,omitempty"`
  11316. // LoadSucceeded: Whether the given UrlMap can be successfully loaded.
  11317. // If false, 'loadErrors' indicates the reasons.
  11318. LoadSucceeded bool `json:"loadSucceeded,omitempty"`
  11319. TestFailures []*TestFailure `json:"testFailures,omitempty"`
  11320. // TestPassed: If successfully loaded, this field indicates whether the
  11321. // test passed. If false, 'testFailures's indicate the reason of
  11322. // failure.
  11323. TestPassed bool `json:"testPassed,omitempty"`
  11324. // ForceSendFields is a list of field names (e.g. "LoadErrors") to
  11325. // unconditionally include in API requests. By default, fields with
  11326. // empty values are omitted from API requests. However, any non-pointer,
  11327. // non-interface field appearing in ForceSendFields will be sent to the
  11328. // server regardless of whether the field is empty or not. This may be
  11329. // used to include empty fields in Patch requests.
  11330. ForceSendFields []string `json:"-"`
  11331. // NullFields is a list of field names (e.g. "LoadErrors") to include in
  11332. // API requests with the JSON null value. By default, fields with empty
  11333. // values are omitted from API requests. However, any field with an
  11334. // empty value appearing in NullFields will be sent to the server as
  11335. // null. It is an error if a field in this list has a non-empty value.
  11336. // This may be used to include null fields in Patch requests.
  11337. NullFields []string `json:"-"`
  11338. }
  11339. func (s *UrlMapValidationResult) MarshalJSON() ([]byte, error) {
  11340. type noMethod UrlMapValidationResult
  11341. raw := noMethod(*s)
  11342. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11343. }
  11344. type UrlMapsValidateRequest struct {
  11345. // Resource: Content of the UrlMap to be validated.
  11346. Resource *UrlMap `json:"resource,omitempty"`
  11347. // ForceSendFields is a list of field names (e.g. "Resource") to
  11348. // unconditionally include in API requests. By default, fields with
  11349. // empty values are omitted from API requests. However, any non-pointer,
  11350. // non-interface field appearing in ForceSendFields will be sent to the
  11351. // server regardless of whether the field is empty or not. This may be
  11352. // used to include empty fields in Patch requests.
  11353. ForceSendFields []string `json:"-"`
  11354. // NullFields is a list of field names (e.g. "Resource") to include in
  11355. // API requests with the JSON null value. By default, fields with empty
  11356. // values are omitted from API requests. However, any field with an
  11357. // empty value appearing in NullFields will be sent to the server as
  11358. // null. It is an error if a field in this list has a non-empty value.
  11359. // This may be used to include null fields in Patch requests.
  11360. NullFields []string `json:"-"`
  11361. }
  11362. func (s *UrlMapsValidateRequest) MarshalJSON() ([]byte, error) {
  11363. type noMethod UrlMapsValidateRequest
  11364. raw := noMethod(*s)
  11365. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11366. }
  11367. type UrlMapsValidateResponse struct {
  11368. Result *UrlMapValidationResult `json:"result,omitempty"`
  11369. // ServerResponse contains the HTTP response code and headers from the
  11370. // server.
  11371. googleapi.ServerResponse `json:"-"`
  11372. // ForceSendFields is a list of field names (e.g. "Result") to
  11373. // unconditionally include in API requests. By default, fields with
  11374. // empty values are omitted from API requests. However, any non-pointer,
  11375. // non-interface field appearing in ForceSendFields will be sent to the
  11376. // server regardless of whether the field is empty or not. This may be
  11377. // used to include empty fields in Patch requests.
  11378. ForceSendFields []string `json:"-"`
  11379. // NullFields is a list of field names (e.g. "Result") to include in API
  11380. // requests with the JSON null value. By default, fields with empty
  11381. // values are omitted from API requests. However, any field with an
  11382. // empty value appearing in NullFields will be sent to the server as
  11383. // null. It is an error if a field in this list has a non-empty value.
  11384. // This may be used to include null fields in Patch requests.
  11385. NullFields []string `json:"-"`
  11386. }
  11387. func (s *UrlMapsValidateResponse) MarshalJSON() ([]byte, error) {
  11388. type noMethod UrlMapsValidateResponse
  11389. raw := noMethod(*s)
  11390. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11391. }
  11392. // UsageExportLocation: The location in Cloud Storage and naming method
  11393. // of the daily usage report. Contains bucket_name and report_name
  11394. // prefix.
  11395. type UsageExportLocation struct {
  11396. // BucketName: The name of an existing bucket in Cloud Storage where the
  11397. // usage report object is stored. The Google Service Account is granted
  11398. // write access to this bucket. This can either be the bucket name by
  11399. // itself, such as example-bucket, or the bucket name with gs:// or
  11400. // https://storage.googleapis.com/ in front of it, such as
  11401. // gs://example-bucket.
  11402. BucketName string `json:"bucketName,omitempty"`
  11403. // ReportNamePrefix: An optional prefix for the name of the usage report
  11404. // object stored in bucketName. If not supplied, defaults to usage. The
  11405. // report is stored as a CSV file named
  11406. // report_name_prefix_gce_YYYYMMDD.csv where YYYYMMDD is the day of the
  11407. // usage according to Pacific Time. If you supply a prefix, it should
  11408. // conform to Cloud Storage object naming conventions.
  11409. ReportNamePrefix string `json:"reportNamePrefix,omitempty"`
  11410. // ForceSendFields is a list of field names (e.g. "BucketName") to
  11411. // unconditionally include in API requests. By default, fields with
  11412. // empty values are omitted from API requests. However, any non-pointer,
  11413. // non-interface field appearing in ForceSendFields will be sent to the
  11414. // server regardless of whether the field is empty or not. This may be
  11415. // used to include empty fields in Patch requests.
  11416. ForceSendFields []string `json:"-"`
  11417. // NullFields is a list of field names (e.g. "BucketName") to include in
  11418. // API requests with the JSON null value. By default, fields with empty
  11419. // values are omitted from API requests. However, any field with an
  11420. // empty value appearing in NullFields will be sent to the server as
  11421. // null. It is an error if a field in this list has a non-empty value.
  11422. // This may be used to include null fields in Patch requests.
  11423. NullFields []string `json:"-"`
  11424. }
  11425. func (s *UsageExportLocation) MarshalJSON() ([]byte, error) {
  11426. type noMethod UsageExportLocation
  11427. raw := noMethod(*s)
  11428. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11429. }
  11430. type VpnTunnel struct {
  11431. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  11432. // format.
  11433. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  11434. // Description: An optional description of this resource. Provide this
  11435. // property when you create the resource.
  11436. Description string `json:"description,omitempty"`
  11437. // DetailedStatus: [Output Only] Detailed status message for the VPN
  11438. // tunnel.
  11439. DetailedStatus string `json:"detailedStatus,omitempty"`
  11440. // Id: [Output Only] The unique identifier for the resource. This
  11441. // identifier is defined by the server.
  11442. Id uint64 `json:"id,omitempty,string"`
  11443. // IkeVersion: IKE protocol version to use when establishing the VPN
  11444. // tunnel with peer VPN gateway. Acceptable IKE versions are 1 or 2.
  11445. // Default version is 2.
  11446. IkeVersion int64 `json:"ikeVersion,omitempty"`
  11447. // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for
  11448. // VPN tunnels.
  11449. Kind string `json:"kind,omitempty"`
  11450. // LocalTrafficSelector: Local traffic selector to use when establishing
  11451. // the VPN tunnel with peer VPN gateway. The value should be a CIDR
  11452. // formatted string, for example: 192.168.0.0/16. The ranges should be
  11453. // disjoint. Only IPv4 is supported.
  11454. LocalTrafficSelector []string `json:"localTrafficSelector,omitempty"`
  11455. // Name: Name of the resource. Provided by the client when the resource
  11456. // is created. The name must be 1-63 characters long, and comply with
  11457. // RFC1035. Specifically, the name must be 1-63 characters long and
  11458. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  11459. // the first character must be a lowercase letter, and all following
  11460. // characters must be a dash, lowercase letter, or digit, except the
  11461. // last character, which cannot be a dash.
  11462. Name string `json:"name,omitempty"`
  11463. // PeerIp: IP address of the peer VPN gateway. Only IPv4 is supported.
  11464. PeerIp string `json:"peerIp,omitempty"`
  11465. // Region: [Output Only] URL of the region where the VPN tunnel resides.
  11466. Region string `json:"region,omitempty"`
  11467. // RemoteTrafficSelector: Remote traffic selectors to use when
  11468. // establishing the VPN tunnel with peer VPN gateway. The value should
  11469. // be a CIDR formatted string, for example: 192.168.0.0/16. The ranges
  11470. // should be disjoint. Only IPv4 is supported.
  11471. RemoteTrafficSelector []string `json:"remoteTrafficSelector,omitempty"`
  11472. // Router: URL of router resource to be used for dynamic routing.
  11473. Router string `json:"router,omitempty"`
  11474. // SelfLink: [Output Only] Server-defined URL for the resource.
  11475. SelfLink string `json:"selfLink,omitempty"`
  11476. // SharedSecret: Shared secret used to set the secure session between
  11477. // the Cloud VPN gateway and the peer VPN gateway.
  11478. SharedSecret string `json:"sharedSecret,omitempty"`
  11479. // SharedSecretHash: Hash of the shared secret.
  11480. SharedSecretHash string `json:"sharedSecretHash,omitempty"`
  11481. // Status: [Output Only] The status of the VPN tunnel.
  11482. //
  11483. // Possible values:
  11484. // "ALLOCATING_RESOURCES"
  11485. // "AUTHORIZATION_ERROR"
  11486. // "DEPROVISIONING"
  11487. // "ESTABLISHED"
  11488. // "FAILED"
  11489. // "FIRST_HANDSHAKE"
  11490. // "NEGOTIATION_FAILURE"
  11491. // "NETWORK_ERROR"
  11492. // "NO_INCOMING_PACKETS"
  11493. // "PROVISIONING"
  11494. // "REJECTED"
  11495. // "WAITING_FOR_FULL_CONFIG"
  11496. Status string `json:"status,omitempty"`
  11497. // TargetVpnGateway: URL of the VPN gateway with which this VPN tunnel
  11498. // is associated. Provided by the client when the VPN tunnel is created.
  11499. TargetVpnGateway string `json:"targetVpnGateway,omitempty"`
  11500. // ServerResponse contains the HTTP response code and headers from the
  11501. // server.
  11502. googleapi.ServerResponse `json:"-"`
  11503. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  11504. // to unconditionally include in API requests. By default, fields with
  11505. // empty values are omitted from API requests. However, any non-pointer,
  11506. // non-interface field appearing in ForceSendFields will be sent to the
  11507. // server regardless of whether the field is empty or not. This may be
  11508. // used to include empty fields in Patch requests.
  11509. ForceSendFields []string `json:"-"`
  11510. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  11511. // include in API requests with the JSON null value. By default, fields
  11512. // with empty values are omitted from API requests. However, any field
  11513. // with an empty value appearing in NullFields will be sent to the
  11514. // server as null. It is an error if a field in this list has a
  11515. // non-empty value. This may be used to include null fields in Patch
  11516. // requests.
  11517. NullFields []string `json:"-"`
  11518. }
  11519. func (s *VpnTunnel) MarshalJSON() ([]byte, error) {
  11520. type noMethod VpnTunnel
  11521. raw := noMethod(*s)
  11522. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11523. }
  11524. type VpnTunnelAggregatedList struct {
  11525. // Id: [Output Only] The unique identifier for the resource. This
  11526. // identifier is defined by the server.
  11527. Id string `json:"id,omitempty"`
  11528. // Items: [Output Only] A map of scoped vpn tunnel lists.
  11529. Items map[string]VpnTunnelsScopedList `json:"items,omitempty"`
  11530. // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for
  11531. // VPN tunnels.
  11532. Kind string `json:"kind,omitempty"`
  11533. // NextPageToken: [Output Only] This token allows you to get the next
  11534. // page of results for list requests. If the number of results is larger
  11535. // than maxResults, use the nextPageToken as a value for the query
  11536. // parameter pageToken in the next list request. Subsequent list
  11537. // requests will have their own nextPageToken to continue paging through
  11538. // the results.
  11539. NextPageToken string `json:"nextPageToken,omitempty"`
  11540. // SelfLink: [Output Only] Server-defined URL for this resource.
  11541. SelfLink string `json:"selfLink,omitempty"`
  11542. // ServerResponse contains the HTTP response code and headers from the
  11543. // server.
  11544. googleapi.ServerResponse `json:"-"`
  11545. // ForceSendFields is a list of field names (e.g. "Id") to
  11546. // unconditionally include in API requests. By default, fields with
  11547. // empty values are omitted from API requests. However, any non-pointer,
  11548. // non-interface field appearing in ForceSendFields will be sent to the
  11549. // server regardless of whether the field is empty or not. This may be
  11550. // used to include empty fields in Patch requests.
  11551. ForceSendFields []string `json:"-"`
  11552. // NullFields is a list of field names (e.g. "Id") to include in API
  11553. // requests with the JSON null value. By default, fields with empty
  11554. // values are omitted from API requests. However, any field with an
  11555. // empty value appearing in NullFields will be sent to the server as
  11556. // null. It is an error if a field in this list has a non-empty value.
  11557. // This may be used to include null fields in Patch requests.
  11558. NullFields []string `json:"-"`
  11559. }
  11560. func (s *VpnTunnelAggregatedList) MarshalJSON() ([]byte, error) {
  11561. type noMethod VpnTunnelAggregatedList
  11562. raw := noMethod(*s)
  11563. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11564. }
  11565. // VpnTunnelList: Contains a list of VpnTunnel resources.
  11566. type VpnTunnelList struct {
  11567. // Id: [Output Only] The unique identifier for the resource. This
  11568. // identifier is defined by the server.
  11569. Id string `json:"id,omitempty"`
  11570. // Items: [Output Only] A list of VpnTunnel resources.
  11571. Items []*VpnTunnel `json:"items,omitempty"`
  11572. // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for
  11573. // VPN tunnels.
  11574. Kind string `json:"kind,omitempty"`
  11575. // NextPageToken: [Output Only] This token allows you to get the next
  11576. // page of results for list requests. If the number of results is larger
  11577. // than maxResults, use the nextPageToken as a value for the query
  11578. // parameter pageToken in the next list request. Subsequent list
  11579. // requests will have their own nextPageToken to continue paging through
  11580. // the results.
  11581. NextPageToken string `json:"nextPageToken,omitempty"`
  11582. // SelfLink: [Output Only] Server-defined URL for this resource.
  11583. SelfLink string `json:"selfLink,omitempty"`
  11584. // ServerResponse contains the HTTP response code and headers from the
  11585. // server.
  11586. googleapi.ServerResponse `json:"-"`
  11587. // ForceSendFields is a list of field names (e.g. "Id") to
  11588. // unconditionally include in API requests. By default, fields with
  11589. // empty values are omitted from API requests. However, any non-pointer,
  11590. // non-interface field appearing in ForceSendFields will be sent to the
  11591. // server regardless of whether the field is empty or not. This may be
  11592. // used to include empty fields in Patch requests.
  11593. ForceSendFields []string `json:"-"`
  11594. // NullFields is a list of field names (e.g. "Id") to include in API
  11595. // requests with the JSON null value. By default, fields with empty
  11596. // values are omitted from API requests. However, any field with an
  11597. // empty value appearing in NullFields will be sent to the server as
  11598. // null. It is an error if a field in this list has a non-empty value.
  11599. // This may be used to include null fields in Patch requests.
  11600. NullFields []string `json:"-"`
  11601. }
  11602. func (s *VpnTunnelList) MarshalJSON() ([]byte, error) {
  11603. type noMethod VpnTunnelList
  11604. raw := noMethod(*s)
  11605. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11606. }
  11607. type VpnTunnelsScopedList struct {
  11608. // VpnTunnels: List of vpn tunnels contained in this scope.
  11609. VpnTunnels []*VpnTunnel `json:"vpnTunnels,omitempty"`
  11610. // Warning: Informational warning which replaces the list of addresses
  11611. // when the list is empty.
  11612. Warning *VpnTunnelsScopedListWarning `json:"warning,omitempty"`
  11613. // ForceSendFields is a list of field names (e.g. "VpnTunnels") to
  11614. // unconditionally include in API requests. By default, fields with
  11615. // empty values are omitted from API requests. However, any non-pointer,
  11616. // non-interface field appearing in ForceSendFields will be sent to the
  11617. // server regardless of whether the field is empty or not. This may be
  11618. // used to include empty fields in Patch requests.
  11619. ForceSendFields []string `json:"-"`
  11620. // NullFields is a list of field names (e.g. "VpnTunnels") to include in
  11621. // API requests with the JSON null value. By default, fields with empty
  11622. // values are omitted from API requests. However, any field with an
  11623. // empty value appearing in NullFields will be sent to the server as
  11624. // null. It is an error if a field in this list has a non-empty value.
  11625. // This may be used to include null fields in Patch requests.
  11626. NullFields []string `json:"-"`
  11627. }
  11628. func (s *VpnTunnelsScopedList) MarshalJSON() ([]byte, error) {
  11629. type noMethod VpnTunnelsScopedList
  11630. raw := noMethod(*s)
  11631. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11632. }
  11633. // VpnTunnelsScopedListWarning: Informational warning which replaces the
  11634. // list of addresses when the list is empty.
  11635. type VpnTunnelsScopedListWarning struct {
  11636. // Code: [Output Only] A warning code, if applicable. For example,
  11637. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  11638. // the response.
  11639. //
  11640. // Possible values:
  11641. // "CLEANUP_FAILED"
  11642. // "DEPRECATED_RESOURCE_USED"
  11643. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  11644. // "FIELD_VALUE_OVERRIDEN"
  11645. // "INJECTED_KERNELS_DEPRECATED"
  11646. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  11647. // "NEXT_HOP_CANNOT_IP_FORWARD"
  11648. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  11649. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  11650. // "NEXT_HOP_NOT_RUNNING"
  11651. // "NOT_CRITICAL_ERROR"
  11652. // "NO_RESULTS_ON_PAGE"
  11653. // "REQUIRED_TOS_AGREEMENT"
  11654. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  11655. // "RESOURCE_NOT_DELETED"
  11656. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  11657. // "UNREACHABLE"
  11658. Code string `json:"code,omitempty"`
  11659. // Data: [Output Only] Metadata about this warning in key: value format.
  11660. // For example:
  11661. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  11662. Data []*VpnTunnelsScopedListWarningData `json:"data,omitempty"`
  11663. // Message: [Output Only] A human-readable description of the warning
  11664. // code.
  11665. Message string `json:"message,omitempty"`
  11666. // ForceSendFields is a list of field names (e.g. "Code") to
  11667. // unconditionally include in API requests. By default, fields with
  11668. // empty values are omitted from API requests. However, any non-pointer,
  11669. // non-interface field appearing in ForceSendFields will be sent to the
  11670. // server regardless of whether the field is empty or not. This may be
  11671. // used to include empty fields in Patch requests.
  11672. ForceSendFields []string `json:"-"`
  11673. // NullFields is a list of field names (e.g. "Code") to include in API
  11674. // requests with the JSON null value. By default, fields with empty
  11675. // values are omitted from API requests. However, any field with an
  11676. // empty value appearing in NullFields will be sent to the server as
  11677. // null. It is an error if a field in this list has a non-empty value.
  11678. // This may be used to include null fields in Patch requests.
  11679. NullFields []string `json:"-"`
  11680. }
  11681. func (s *VpnTunnelsScopedListWarning) MarshalJSON() ([]byte, error) {
  11682. type noMethod VpnTunnelsScopedListWarning
  11683. raw := noMethod(*s)
  11684. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11685. }
  11686. type VpnTunnelsScopedListWarningData struct {
  11687. // Key: [Output Only] A key that provides more detail on the warning
  11688. // being returned. For example, for warnings where there are no results
  11689. // in a list request for a particular zone, this key might be scope and
  11690. // the key value might be the zone name. Other examples might be a key
  11691. // indicating a deprecated resource and a suggested replacement, or a
  11692. // warning about invalid network settings (for example, if an instance
  11693. // attempts to perform IP forwarding but is not enabled for IP
  11694. // forwarding).
  11695. Key string `json:"key,omitempty"`
  11696. // Value: [Output Only] A warning data value corresponding to the key.
  11697. Value string `json:"value,omitempty"`
  11698. // ForceSendFields is a list of field names (e.g. "Key") to
  11699. // unconditionally include in API requests. By default, fields with
  11700. // empty values are omitted from API requests. However, any non-pointer,
  11701. // non-interface field appearing in ForceSendFields will be sent to the
  11702. // server regardless of whether the field is empty or not. This may be
  11703. // used to include empty fields in Patch requests.
  11704. ForceSendFields []string `json:"-"`
  11705. // NullFields is a list of field names (e.g. "Key") to include in API
  11706. // requests with the JSON null value. By default, fields with empty
  11707. // values are omitted from API requests. However, any field with an
  11708. // empty value appearing in NullFields will be sent to the server as
  11709. // null. It is an error if a field in this list has a non-empty value.
  11710. // This may be used to include null fields in Patch requests.
  11711. NullFields []string `json:"-"`
  11712. }
  11713. func (s *VpnTunnelsScopedListWarningData) MarshalJSON() ([]byte, error) {
  11714. type noMethod VpnTunnelsScopedListWarningData
  11715. raw := noMethod(*s)
  11716. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11717. }
  11718. type XpnHostList struct {
  11719. // Id: [Output Only] The unique identifier for the resource. This
  11720. // identifier is defined by the server.
  11721. Id string `json:"id,omitempty"`
  11722. // Items: [Output Only] A list of XPN host project URLs.
  11723. Items []*Project `json:"items,omitempty"`
  11724. // Kind: [Output Only] Type of resource. Always compute#xpnHostList for
  11725. // lists of XPN hosts.
  11726. Kind string `json:"kind,omitempty"`
  11727. // NextPageToken: [Output Only] This token allows you to get the next
  11728. // page of results for list requests. If the number of results is larger
  11729. // than maxResults, use the nextPageToken as a value for the query
  11730. // parameter pageToken in the next list request. Subsequent list
  11731. // requests will have their own nextPageToken to continue paging through
  11732. // the results.
  11733. NextPageToken string `json:"nextPageToken,omitempty"`
  11734. // SelfLink: [Output Only] Server-defined URL for this resource.
  11735. SelfLink string `json:"selfLink,omitempty"`
  11736. // ServerResponse contains the HTTP response code and headers from the
  11737. // server.
  11738. googleapi.ServerResponse `json:"-"`
  11739. // ForceSendFields is a list of field names (e.g. "Id") to
  11740. // unconditionally include in API requests. By default, fields with
  11741. // empty values are omitted from API requests. However, any non-pointer,
  11742. // non-interface field appearing in ForceSendFields will be sent to the
  11743. // server regardless of whether the field is empty or not. This may be
  11744. // used to include empty fields in Patch requests.
  11745. ForceSendFields []string `json:"-"`
  11746. // NullFields is a list of field names (e.g. "Id") to include in API
  11747. // requests with the JSON null value. By default, fields with empty
  11748. // values are omitted from API requests. However, any field with an
  11749. // empty value appearing in NullFields will be sent to the server as
  11750. // null. It is an error if a field in this list has a non-empty value.
  11751. // This may be used to include null fields in Patch requests.
  11752. NullFields []string `json:"-"`
  11753. }
  11754. func (s *XpnHostList) MarshalJSON() ([]byte, error) {
  11755. type noMethod XpnHostList
  11756. raw := noMethod(*s)
  11757. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11758. }
  11759. // XpnResourceId: XpnResourceId
  11760. type XpnResourceId struct {
  11761. // Id: The ID of the XPN resource. In the case of projects, this field
  11762. // matches the project's name, not the canonical ID.
  11763. Id string `json:"id,omitempty"`
  11764. // Type: The type of the XPN resource.
  11765. //
  11766. // Possible values:
  11767. // "PROJECT"
  11768. // "XPN_RESOURCE_TYPE_UNSPECIFIED"
  11769. Type string `json:"type,omitempty"`
  11770. // ForceSendFields is a list of field names (e.g. "Id") to
  11771. // unconditionally include in API requests. By default, fields with
  11772. // empty values are omitted from API requests. However, any non-pointer,
  11773. // non-interface field appearing in ForceSendFields will be sent to the
  11774. // server regardless of whether the field is empty or not. This may be
  11775. // used to include empty fields in Patch requests.
  11776. ForceSendFields []string `json:"-"`
  11777. // NullFields is a list of field names (e.g. "Id") to include in API
  11778. // requests with the JSON null value. By default, fields with empty
  11779. // values are omitted from API requests. However, any field with an
  11780. // empty value appearing in NullFields will be sent to the server as
  11781. // null. It is an error if a field in this list has a non-empty value.
  11782. // This may be used to include null fields in Patch requests.
  11783. NullFields []string `json:"-"`
  11784. }
  11785. func (s *XpnResourceId) MarshalJSON() ([]byte, error) {
  11786. type noMethod XpnResourceId
  11787. raw := noMethod(*s)
  11788. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11789. }
  11790. // Zone: A Zone resource.
  11791. type Zone struct {
  11792. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  11793. // format.
  11794. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  11795. // Deprecated: [Output Only] The deprecation status associated with this
  11796. // zone.
  11797. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  11798. // Description: [Output Only] Textual description of the resource.
  11799. Description string `json:"description,omitempty"`
  11800. // Id: [Output Only] The unique identifier for the resource. This
  11801. // identifier is defined by the server.
  11802. Id uint64 `json:"id,omitempty,string"`
  11803. // Kind: [Output Only] Type of the resource. Always compute#zone for
  11804. // zones.
  11805. Kind string `json:"kind,omitempty"`
  11806. // Name: [Output Only] Name of the resource.
  11807. Name string `json:"name,omitempty"`
  11808. // Region: [Output Only] Full URL reference to the region which hosts
  11809. // the zone.
  11810. Region string `json:"region,omitempty"`
  11811. // SelfLink: [Output Only] Server-defined URL for the resource.
  11812. SelfLink string `json:"selfLink,omitempty"`
  11813. // Status: [Output Only] Status of the zone, either UP or DOWN.
  11814. //
  11815. // Possible values:
  11816. // "DOWN"
  11817. // "UP"
  11818. Status string `json:"status,omitempty"`
  11819. // ServerResponse contains the HTTP response code and headers from the
  11820. // server.
  11821. googleapi.ServerResponse `json:"-"`
  11822. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  11823. // to unconditionally include in API requests. By default, fields with
  11824. // empty values are omitted from API requests. However, any non-pointer,
  11825. // non-interface field appearing in ForceSendFields will be sent to the
  11826. // server regardless of whether the field is empty or not. This may be
  11827. // used to include empty fields in Patch requests.
  11828. ForceSendFields []string `json:"-"`
  11829. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  11830. // include in API requests with the JSON null value. By default, fields
  11831. // with empty values are omitted from API requests. However, any field
  11832. // with an empty value appearing in NullFields will be sent to the
  11833. // server as null. It is an error if a field in this list has a
  11834. // non-empty value. This may be used to include null fields in Patch
  11835. // requests.
  11836. NullFields []string `json:"-"`
  11837. }
  11838. func (s *Zone) MarshalJSON() ([]byte, error) {
  11839. type noMethod Zone
  11840. raw := noMethod(*s)
  11841. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11842. }
  11843. // ZoneList: Contains a list of zone resources.
  11844. type ZoneList struct {
  11845. // Id: [Output Only] Unique identifier for the resource; defined by the
  11846. // server.
  11847. Id string `json:"id,omitempty"`
  11848. // Items: [Output Only] A list of Zone resources.
  11849. Items []*Zone `json:"items,omitempty"`
  11850. // Kind: Type of resource.
  11851. Kind string `json:"kind,omitempty"`
  11852. // NextPageToken: [Output Only] This token allows you to get the next
  11853. // page of results for list requests. If the number of results is larger
  11854. // than maxResults, use the nextPageToken as a value for the query
  11855. // parameter pageToken in the next list request. Subsequent list
  11856. // requests will have their own nextPageToken to continue paging through
  11857. // the results.
  11858. NextPageToken string `json:"nextPageToken,omitempty"`
  11859. // SelfLink: [Output Only] Server-defined URL for this resource.
  11860. SelfLink string `json:"selfLink,omitempty"`
  11861. // ServerResponse contains the HTTP response code and headers from the
  11862. // server.
  11863. googleapi.ServerResponse `json:"-"`
  11864. // ForceSendFields is a list of field names (e.g. "Id") to
  11865. // unconditionally include in API requests. By default, fields with
  11866. // empty values are omitted from API requests. However, any non-pointer,
  11867. // non-interface field appearing in ForceSendFields will be sent to the
  11868. // server regardless of whether the field is empty or not. This may be
  11869. // used to include empty fields in Patch requests.
  11870. ForceSendFields []string `json:"-"`
  11871. // NullFields is a list of field names (e.g. "Id") to include in API
  11872. // requests with the JSON null value. By default, fields with empty
  11873. // values are omitted from API requests. However, any field with an
  11874. // empty value appearing in NullFields will be sent to the server as
  11875. // null. It is an error if a field in this list has a non-empty value.
  11876. // This may be used to include null fields in Patch requests.
  11877. NullFields []string `json:"-"`
  11878. }
  11879. func (s *ZoneList) MarshalJSON() ([]byte, error) {
  11880. type noMethod ZoneList
  11881. raw := noMethod(*s)
  11882. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11883. }
  11884. type ZoneSetLabelsRequest struct {
  11885. // LabelFingerprint: The fingerprint of the previous set of labels for
  11886. // this resource, used to detect conflicts. The fingerprint is initially
  11887. // generated by Compute Engine and changes after every request to modify
  11888. // or update labels. You must always provide an up-to-date fingerprint
  11889. // hash in order to update or change labels. Make a get() request to the
  11890. // resource to get the latest fingerprint.
  11891. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  11892. // Labels: The labels to set for this resource.
  11893. Labels map[string]string `json:"labels,omitempty"`
  11894. // ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
  11895. // unconditionally include in API requests. By default, fields with
  11896. // empty values are omitted from API requests. However, any non-pointer,
  11897. // non-interface field appearing in ForceSendFields will be sent to the
  11898. // server regardless of whether the field is empty or not. This may be
  11899. // used to include empty fields in Patch requests.
  11900. ForceSendFields []string `json:"-"`
  11901. // NullFields is a list of field names (e.g. "LabelFingerprint") to
  11902. // include in API requests with the JSON null value. By default, fields
  11903. // with empty values are omitted from API requests. However, any field
  11904. // with an empty value appearing in NullFields will be sent to the
  11905. // server as null. It is an error if a field in this list has a
  11906. // non-empty value. This may be used to include null fields in Patch
  11907. // requests.
  11908. NullFields []string `json:"-"`
  11909. }
  11910. func (s *ZoneSetLabelsRequest) MarshalJSON() ([]byte, error) {
  11911. type noMethod ZoneSetLabelsRequest
  11912. raw := noMethod(*s)
  11913. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11914. }
  11915. // method id "compute.addresses.aggregatedList":
  11916. type AddressesAggregatedListCall struct {
  11917. s *Service
  11918. project string
  11919. urlParams_ gensupport.URLParams
  11920. ifNoneMatch_ string
  11921. ctx_ context.Context
  11922. header_ http.Header
  11923. }
  11924. // AggregatedList: Retrieves an aggregated list of addresses.
  11925. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/aggregatedList
  11926. func (r *AddressesService) AggregatedList(project string) *AddressesAggregatedListCall {
  11927. c := &AddressesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11928. c.project = project
  11929. return c
  11930. }
  11931. // Filter sets the optional parameter "filter": Sets a filter
  11932. // {expression} for filtering listed resources. Your {expression} must
  11933. // be in the format: field_name comparison_string literal_string.
  11934. //
  11935. // The field_name is the name of the field you want to compare. Only
  11936. // atomic field types are supported (string, number, boolean). The
  11937. // comparison_string must be either eq (equals) or ne (not equals). The
  11938. // literal_string is the string value to filter to. The literal value
  11939. // must be valid for the type of field you are filtering by (string,
  11940. // number, boolean). For string fields, the literal value is interpreted
  11941. // as a regular expression using RE2 syntax. The literal value must
  11942. // match the entire field.
  11943. //
  11944. // For example, to filter for instances that do not have a name of
  11945. // example-instance, you would use name ne example-instance.
  11946. //
  11947. // You can filter on nested fields. For example, you could filter on
  11948. // instances that have set the scheduling.automaticRestart field to
  11949. // true. Use filtering on nested fields to take advantage of labels to
  11950. // organize and search for results based on label values.
  11951. //
  11952. // To filter on multiple expressions, provide each separate expression
  11953. // within parentheses. For example, (scheduling.automaticRestart eq
  11954. // true) (zone eq us-central1-f). Multiple expressions are treated as
  11955. // AND expressions, meaning that resources must match all expressions to
  11956. // pass the filters.
  11957. func (c *AddressesAggregatedListCall) Filter(filter string) *AddressesAggregatedListCall {
  11958. c.urlParams_.Set("filter", filter)
  11959. return c
  11960. }
  11961. // MaxResults sets the optional parameter "maxResults": The maximum
  11962. // number of results per page that should be returned. If the number of
  11963. // available results is larger than maxResults, Compute Engine returns a
  11964. // nextPageToken that can be used to get the next page of results in
  11965. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  11966. // (Default: 500)
  11967. func (c *AddressesAggregatedListCall) MaxResults(maxResults int64) *AddressesAggregatedListCall {
  11968. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  11969. return c
  11970. }
  11971. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  11972. // a certain order. By default, results are returned in alphanumerical
  11973. // order based on the resource name.
  11974. //
  11975. // You can also sort results in descending order based on the creation
  11976. // timestamp using orderBy="creationTimestamp desc". This sorts results
  11977. // based on the creationTimestamp field in reverse chronological order
  11978. // (newest result first). Use this to sort resources like operations so
  11979. // that the newest operation is returned first.
  11980. //
  11981. // Currently, only sorting by name or creationTimestamp desc is
  11982. // supported.
  11983. func (c *AddressesAggregatedListCall) OrderBy(orderBy string) *AddressesAggregatedListCall {
  11984. c.urlParams_.Set("orderBy", orderBy)
  11985. return c
  11986. }
  11987. // PageToken sets the optional parameter "pageToken": Specifies a page
  11988. // token to use. Set pageToken to the nextPageToken returned by a
  11989. // previous list request to get the next page of results.
  11990. func (c *AddressesAggregatedListCall) PageToken(pageToken string) *AddressesAggregatedListCall {
  11991. c.urlParams_.Set("pageToken", pageToken)
  11992. return c
  11993. }
  11994. // Fields allows partial responses to be retrieved. See
  11995. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11996. // for more information.
  11997. func (c *AddressesAggregatedListCall) Fields(s ...googleapi.Field) *AddressesAggregatedListCall {
  11998. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11999. return c
  12000. }
  12001. // IfNoneMatch sets the optional parameter which makes the operation
  12002. // fail if the object's ETag matches the given value. This is useful for
  12003. // getting updates only after the object has changed since the last
  12004. // request. Use googleapi.IsNotModified to check whether the response
  12005. // error from Do is the result of In-None-Match.
  12006. func (c *AddressesAggregatedListCall) IfNoneMatch(entityTag string) *AddressesAggregatedListCall {
  12007. c.ifNoneMatch_ = entityTag
  12008. return c
  12009. }
  12010. // Context sets the context to be used in this call's Do method. Any
  12011. // pending HTTP request will be aborted if the provided context is
  12012. // canceled.
  12013. func (c *AddressesAggregatedListCall) Context(ctx context.Context) *AddressesAggregatedListCall {
  12014. c.ctx_ = ctx
  12015. return c
  12016. }
  12017. // Header returns an http.Header that can be modified by the caller to
  12018. // add HTTP headers to the request.
  12019. func (c *AddressesAggregatedListCall) Header() http.Header {
  12020. if c.header_ == nil {
  12021. c.header_ = make(http.Header)
  12022. }
  12023. return c.header_
  12024. }
  12025. func (c *AddressesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  12026. reqHeaders := make(http.Header)
  12027. for k, v := range c.header_ {
  12028. reqHeaders[k] = v
  12029. }
  12030. reqHeaders.Set("User-Agent", c.s.userAgent())
  12031. if c.ifNoneMatch_ != "" {
  12032. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12033. }
  12034. var body io.Reader = nil
  12035. c.urlParams_.Set("alt", alt)
  12036. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/addresses")
  12037. urls += "?" + c.urlParams_.Encode()
  12038. req, _ := http.NewRequest("GET", urls, body)
  12039. req.Header = reqHeaders
  12040. googleapi.Expand(req.URL, map[string]string{
  12041. "project": c.project,
  12042. })
  12043. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12044. }
  12045. // Do executes the "compute.addresses.aggregatedList" call.
  12046. // Exactly one of *AddressAggregatedList or error will be non-nil. Any
  12047. // non-2xx status code is an error. Response headers are in either
  12048. // *AddressAggregatedList.ServerResponse.Header or (if a response was
  12049. // returned at all) in error.(*googleapi.Error).Header. Use
  12050. // googleapi.IsNotModified to check whether the returned error was
  12051. // because http.StatusNotModified was returned.
  12052. func (c *AddressesAggregatedListCall) Do(opts ...googleapi.CallOption) (*AddressAggregatedList, error) {
  12053. gensupport.SetOptions(c.urlParams_, opts...)
  12054. res, err := c.doRequest("json")
  12055. if res != nil && res.StatusCode == http.StatusNotModified {
  12056. if res.Body != nil {
  12057. res.Body.Close()
  12058. }
  12059. return nil, &googleapi.Error{
  12060. Code: res.StatusCode,
  12061. Header: res.Header,
  12062. }
  12063. }
  12064. if err != nil {
  12065. return nil, err
  12066. }
  12067. defer googleapi.CloseBody(res)
  12068. if err := googleapi.CheckResponse(res); err != nil {
  12069. return nil, err
  12070. }
  12071. ret := &AddressAggregatedList{
  12072. ServerResponse: googleapi.ServerResponse{
  12073. Header: res.Header,
  12074. HTTPStatusCode: res.StatusCode,
  12075. },
  12076. }
  12077. target := &ret
  12078. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  12079. return nil, err
  12080. }
  12081. return ret, nil
  12082. // {
  12083. // "description": "Retrieves an aggregated list of addresses.",
  12084. // "httpMethod": "GET",
  12085. // "id": "compute.addresses.aggregatedList",
  12086. // "parameterOrder": [
  12087. // "project"
  12088. // ],
  12089. // "parameters": {
  12090. // "filter": {
  12091. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  12092. // "location": "query",
  12093. // "type": "string"
  12094. // },
  12095. // "maxResults": {
  12096. // "default": "500",
  12097. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  12098. // "format": "uint32",
  12099. // "location": "query",
  12100. // "minimum": "0",
  12101. // "type": "integer"
  12102. // },
  12103. // "orderBy": {
  12104. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  12105. // "location": "query",
  12106. // "type": "string"
  12107. // },
  12108. // "pageToken": {
  12109. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  12110. // "location": "query",
  12111. // "type": "string"
  12112. // },
  12113. // "project": {
  12114. // "description": "Project ID for this request.",
  12115. // "location": "path",
  12116. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  12117. // "required": true,
  12118. // "type": "string"
  12119. // }
  12120. // },
  12121. // "path": "{project}/aggregated/addresses",
  12122. // "response": {
  12123. // "$ref": "AddressAggregatedList"
  12124. // },
  12125. // "scopes": [
  12126. // "https://www.googleapis.com/auth/cloud-platform",
  12127. // "https://www.googleapis.com/auth/compute",
  12128. // "https://www.googleapis.com/auth/compute.readonly"
  12129. // ]
  12130. // }
  12131. }
  12132. // Pages invokes f for each page of results.
  12133. // A non-nil error returned from f will halt the iteration.
  12134. // The provided context supersedes any context provided to the Context method.
  12135. func (c *AddressesAggregatedListCall) Pages(ctx context.Context, f func(*AddressAggregatedList) error) error {
  12136. c.ctx_ = ctx
  12137. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  12138. for {
  12139. x, err := c.Do()
  12140. if err != nil {
  12141. return err
  12142. }
  12143. if err := f(x); err != nil {
  12144. return err
  12145. }
  12146. if x.NextPageToken == "" {
  12147. return nil
  12148. }
  12149. c.PageToken(x.NextPageToken)
  12150. }
  12151. }
  12152. // method id "compute.addresses.delete":
  12153. type AddressesDeleteCall struct {
  12154. s *Service
  12155. project string
  12156. region string
  12157. address string
  12158. urlParams_ gensupport.URLParams
  12159. ctx_ context.Context
  12160. header_ http.Header
  12161. }
  12162. // Delete: Deletes the specified address resource.
  12163. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/delete
  12164. func (r *AddressesService) Delete(project string, region string, address string) *AddressesDeleteCall {
  12165. c := &AddressesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12166. c.project = project
  12167. c.region = region
  12168. c.address = address
  12169. return c
  12170. }
  12171. // Fields allows partial responses to be retrieved. See
  12172. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12173. // for more information.
  12174. func (c *AddressesDeleteCall) Fields(s ...googleapi.Field) *AddressesDeleteCall {
  12175. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12176. return c
  12177. }
  12178. // Context sets the context to be used in this call's Do method. Any
  12179. // pending HTTP request will be aborted if the provided context is
  12180. // canceled.
  12181. func (c *AddressesDeleteCall) Context(ctx context.Context) *AddressesDeleteCall {
  12182. c.ctx_ = ctx
  12183. return c
  12184. }
  12185. // Header returns an http.Header that can be modified by the caller to
  12186. // add HTTP headers to the request.
  12187. func (c *AddressesDeleteCall) Header() http.Header {
  12188. if c.header_ == nil {
  12189. c.header_ = make(http.Header)
  12190. }
  12191. return c.header_
  12192. }
  12193. func (c *AddressesDeleteCall) doRequest(alt string) (*http.Response, error) {
  12194. reqHeaders := make(http.Header)
  12195. for k, v := range c.header_ {
  12196. reqHeaders[k] = v
  12197. }
  12198. reqHeaders.Set("User-Agent", c.s.userAgent())
  12199. var body io.Reader = nil
  12200. c.urlParams_.Set("alt", alt)
  12201. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{address}")
  12202. urls += "?" + c.urlParams_.Encode()
  12203. req, _ := http.NewRequest("DELETE", urls, body)
  12204. req.Header = reqHeaders
  12205. googleapi.Expand(req.URL, map[string]string{
  12206. "project": c.project,
  12207. "region": c.region,
  12208. "address": c.address,
  12209. })
  12210. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12211. }
  12212. // Do executes the "compute.addresses.delete" call.
  12213. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  12214. // status code is an error. Response headers are in either
  12215. // *Operation.ServerResponse.Header or (if a response was returned at
  12216. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  12217. // to check whether the returned error was because
  12218. // http.StatusNotModified was returned.
  12219. func (c *AddressesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  12220. gensupport.SetOptions(c.urlParams_, opts...)
  12221. res, err := c.doRequest("json")
  12222. if res != nil && res.StatusCode == http.StatusNotModified {
  12223. if res.Body != nil {
  12224. res.Body.Close()
  12225. }
  12226. return nil, &googleapi.Error{
  12227. Code: res.StatusCode,
  12228. Header: res.Header,
  12229. }
  12230. }
  12231. if err != nil {
  12232. return nil, err
  12233. }
  12234. defer googleapi.CloseBody(res)
  12235. if err := googleapi.CheckResponse(res); err != nil {
  12236. return nil, err
  12237. }
  12238. ret := &Operation{
  12239. ServerResponse: googleapi.ServerResponse{
  12240. Header: res.Header,
  12241. HTTPStatusCode: res.StatusCode,
  12242. },
  12243. }
  12244. target := &ret
  12245. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  12246. return nil, err
  12247. }
  12248. return ret, nil
  12249. // {
  12250. // "description": "Deletes the specified address resource.",
  12251. // "httpMethod": "DELETE",
  12252. // "id": "compute.addresses.delete",
  12253. // "parameterOrder": [
  12254. // "project",
  12255. // "region",
  12256. // "address"
  12257. // ],
  12258. // "parameters": {
  12259. // "address": {
  12260. // "description": "Name of the address resource to delete.",
  12261. // "location": "path",
  12262. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  12263. // "required": true,
  12264. // "type": "string"
  12265. // },
  12266. // "project": {
  12267. // "description": "Project ID for this request.",
  12268. // "location": "path",
  12269. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  12270. // "required": true,
  12271. // "type": "string"
  12272. // },
  12273. // "region": {
  12274. // "description": "Name of the region for this request.",
  12275. // "location": "path",
  12276. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  12277. // "required": true,
  12278. // "type": "string"
  12279. // }
  12280. // },
  12281. // "path": "{project}/regions/{region}/addresses/{address}",
  12282. // "response": {
  12283. // "$ref": "Operation"
  12284. // },
  12285. // "scopes": [
  12286. // "https://www.googleapis.com/auth/cloud-platform",
  12287. // "https://www.googleapis.com/auth/compute"
  12288. // ]
  12289. // }
  12290. }
  12291. // method id "compute.addresses.get":
  12292. type AddressesGetCall struct {
  12293. s *Service
  12294. project string
  12295. region string
  12296. address string
  12297. urlParams_ gensupport.URLParams
  12298. ifNoneMatch_ string
  12299. ctx_ context.Context
  12300. header_ http.Header
  12301. }
  12302. // Get: Returns the specified address resource.
  12303. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/get
  12304. func (r *AddressesService) Get(project string, region string, address string) *AddressesGetCall {
  12305. c := &AddressesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12306. c.project = project
  12307. c.region = region
  12308. c.address = address
  12309. return c
  12310. }
  12311. // Fields allows partial responses to be retrieved. See
  12312. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12313. // for more information.
  12314. func (c *AddressesGetCall) Fields(s ...googleapi.Field) *AddressesGetCall {
  12315. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12316. return c
  12317. }
  12318. // IfNoneMatch sets the optional parameter which makes the operation
  12319. // fail if the object's ETag matches the given value. This is useful for
  12320. // getting updates only after the object has changed since the last
  12321. // request. Use googleapi.IsNotModified to check whether the response
  12322. // error from Do is the result of In-None-Match.
  12323. func (c *AddressesGetCall) IfNoneMatch(entityTag string) *AddressesGetCall {
  12324. c.ifNoneMatch_ = entityTag
  12325. return c
  12326. }
  12327. // Context sets the context to be used in this call's Do method. Any
  12328. // pending HTTP request will be aborted if the provided context is
  12329. // canceled.
  12330. func (c *AddressesGetCall) Context(ctx context.Context) *AddressesGetCall {
  12331. c.ctx_ = ctx
  12332. return c
  12333. }
  12334. // Header returns an http.Header that can be modified by the caller to
  12335. // add HTTP headers to the request.
  12336. func (c *AddressesGetCall) Header() http.Header {
  12337. if c.header_ == nil {
  12338. c.header_ = make(http.Header)
  12339. }
  12340. return c.header_
  12341. }
  12342. func (c *AddressesGetCall) doRequest(alt string) (*http.Response, error) {
  12343. reqHeaders := make(http.Header)
  12344. for k, v := range c.header_ {
  12345. reqHeaders[k] = v
  12346. }
  12347. reqHeaders.Set("User-Agent", c.s.userAgent())
  12348. if c.ifNoneMatch_ != "" {
  12349. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12350. }
  12351. var body io.Reader = nil
  12352. c.urlParams_.Set("alt", alt)
  12353. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{address}")
  12354. urls += "?" + c.urlParams_.Encode()
  12355. req, _ := http.NewRequest("GET", urls, body)
  12356. req.Header = reqHeaders
  12357. googleapi.Expand(req.URL, map[string]string{
  12358. "project": c.project,
  12359. "region": c.region,
  12360. "address": c.address,
  12361. })
  12362. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12363. }
  12364. // Do executes the "compute.addresses.get" call.
  12365. // Exactly one of *Address or error will be non-nil. Any non-2xx status
  12366. // code is an error. Response headers are in either
  12367. // *Address.ServerResponse.Header or (if a response was returned at all)
  12368. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  12369. // check whether the returned error was because http.StatusNotModified
  12370. // was returned.
  12371. func (c *AddressesGetCall) Do(opts ...googleapi.CallOption) (*Address, error) {
  12372. gensupport.SetOptions(c.urlParams_, opts...)
  12373. res, err := c.doRequest("json")
  12374. if res != nil && res.StatusCode == http.StatusNotModified {
  12375. if res.Body != nil {
  12376. res.Body.Close()
  12377. }
  12378. return nil, &googleapi.Error{
  12379. Code: res.StatusCode,
  12380. Header: res.Header,
  12381. }
  12382. }
  12383. if err != nil {
  12384. return nil, err
  12385. }
  12386. defer googleapi.CloseBody(res)
  12387. if err := googleapi.CheckResponse(res); err != nil {
  12388. return nil, err
  12389. }
  12390. ret := &Address{
  12391. ServerResponse: googleapi.ServerResponse{
  12392. Header: res.Header,
  12393. HTTPStatusCode: res.StatusCode,
  12394. },
  12395. }
  12396. target := &ret
  12397. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  12398. return nil, err
  12399. }
  12400. return ret, nil
  12401. // {
  12402. // "description": "Returns the specified address resource.",
  12403. // "httpMethod": "GET",
  12404. // "id": "compute.addresses.get",
  12405. // "parameterOrder": [
  12406. // "project",
  12407. // "region",
  12408. // "address"
  12409. // ],
  12410. // "parameters": {
  12411. // "address": {
  12412. // "description": "Name of the address resource to return.",
  12413. // "location": "path",
  12414. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  12415. // "required": true,
  12416. // "type": "string"
  12417. // },
  12418. // "project": {
  12419. // "description": "Project ID for this request.",
  12420. // "location": "path",
  12421. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  12422. // "required": true,
  12423. // "type": "string"
  12424. // },
  12425. // "region": {
  12426. // "description": "Name of the region for this request.",
  12427. // "location": "path",
  12428. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  12429. // "required": true,
  12430. // "type": "string"
  12431. // }
  12432. // },
  12433. // "path": "{project}/regions/{region}/addresses/{address}",
  12434. // "response": {
  12435. // "$ref": "Address"
  12436. // },
  12437. // "scopes": [
  12438. // "https://www.googleapis.com/auth/cloud-platform",
  12439. // "https://www.googleapis.com/auth/compute",
  12440. // "https://www.googleapis.com/auth/compute.readonly"
  12441. // ]
  12442. // }
  12443. }
  12444. // method id "compute.addresses.insert":
  12445. type AddressesInsertCall struct {
  12446. s *Service
  12447. project string
  12448. region string
  12449. address *Address
  12450. urlParams_ gensupport.URLParams
  12451. ctx_ context.Context
  12452. header_ http.Header
  12453. }
  12454. // Insert: Creates an address resource in the specified project using
  12455. // the data included in the request.
  12456. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/insert
  12457. func (r *AddressesService) Insert(project string, region string, address *Address) *AddressesInsertCall {
  12458. c := &AddressesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12459. c.project = project
  12460. c.region = region
  12461. c.address = address
  12462. return c
  12463. }
  12464. // Fields allows partial responses to be retrieved. See
  12465. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12466. // for more information.
  12467. func (c *AddressesInsertCall) Fields(s ...googleapi.Field) *AddressesInsertCall {
  12468. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12469. return c
  12470. }
  12471. // Context sets the context to be used in this call's Do method. Any
  12472. // pending HTTP request will be aborted if the provided context is
  12473. // canceled.
  12474. func (c *AddressesInsertCall) Context(ctx context.Context) *AddressesInsertCall {
  12475. c.ctx_ = ctx
  12476. return c
  12477. }
  12478. // Header returns an http.Header that can be modified by the caller to
  12479. // add HTTP headers to the request.
  12480. func (c *AddressesInsertCall) Header() http.Header {
  12481. if c.header_ == nil {
  12482. c.header_ = make(http.Header)
  12483. }
  12484. return c.header_
  12485. }
  12486. func (c *AddressesInsertCall) doRequest(alt string) (*http.Response, error) {
  12487. reqHeaders := make(http.Header)
  12488. for k, v := range c.header_ {
  12489. reqHeaders[k] = v
  12490. }
  12491. reqHeaders.Set("User-Agent", c.s.userAgent())
  12492. var body io.Reader = nil
  12493. body, err := googleapi.WithoutDataWrapper.JSONReader(c.address)
  12494. if err != nil {
  12495. return nil, err
  12496. }
  12497. reqHeaders.Set("Content-Type", "application/json")
  12498. c.urlParams_.Set("alt", alt)
  12499. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses")
  12500. urls += "?" + c.urlParams_.Encode()
  12501. req, _ := http.NewRequest("POST", urls, body)
  12502. req.Header = reqHeaders
  12503. googleapi.Expand(req.URL, map[string]string{
  12504. "project": c.project,
  12505. "region": c.region,
  12506. })
  12507. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12508. }
  12509. // Do executes the "compute.addresses.insert" call.
  12510. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  12511. // status code is an error. Response headers are in either
  12512. // *Operation.ServerResponse.Header or (if a response was returned at
  12513. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  12514. // to check whether the returned error was because
  12515. // http.StatusNotModified was returned.
  12516. func (c *AddressesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  12517. gensupport.SetOptions(c.urlParams_, opts...)
  12518. res, err := c.doRequest("json")
  12519. if res != nil && res.StatusCode == http.StatusNotModified {
  12520. if res.Body != nil {
  12521. res.Body.Close()
  12522. }
  12523. return nil, &googleapi.Error{
  12524. Code: res.StatusCode,
  12525. Header: res.Header,
  12526. }
  12527. }
  12528. if err != nil {
  12529. return nil, err
  12530. }
  12531. defer googleapi.CloseBody(res)
  12532. if err := googleapi.CheckResponse(res); err != nil {
  12533. return nil, err
  12534. }
  12535. ret := &Operation{
  12536. ServerResponse: googleapi.ServerResponse{
  12537. Header: res.Header,
  12538. HTTPStatusCode: res.StatusCode,
  12539. },
  12540. }
  12541. target := &ret
  12542. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  12543. return nil, err
  12544. }
  12545. return ret, nil
  12546. // {
  12547. // "description": "Creates an address resource in the specified project using the data included in the request.",
  12548. // "httpMethod": "POST",
  12549. // "id": "compute.addresses.insert",
  12550. // "parameterOrder": [
  12551. // "project",
  12552. // "region"
  12553. // ],
  12554. // "parameters": {
  12555. // "project": {
  12556. // "description": "Project ID for this request.",
  12557. // "location": "path",
  12558. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  12559. // "required": true,
  12560. // "type": "string"
  12561. // },
  12562. // "region": {
  12563. // "description": "Name of the region for this request.",
  12564. // "location": "path",
  12565. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  12566. // "required": true,
  12567. // "type": "string"
  12568. // }
  12569. // },
  12570. // "path": "{project}/regions/{region}/addresses",
  12571. // "request": {
  12572. // "$ref": "Address"
  12573. // },
  12574. // "response": {
  12575. // "$ref": "Operation"
  12576. // },
  12577. // "scopes": [
  12578. // "https://www.googleapis.com/auth/cloud-platform",
  12579. // "https://www.googleapis.com/auth/compute"
  12580. // ]
  12581. // }
  12582. }
  12583. // method id "compute.addresses.list":
  12584. type AddressesListCall struct {
  12585. s *Service
  12586. project string
  12587. region string
  12588. urlParams_ gensupport.URLParams
  12589. ifNoneMatch_ string
  12590. ctx_ context.Context
  12591. header_ http.Header
  12592. }
  12593. // List: Retrieves a list of addresses contained within the specified
  12594. // region.
  12595. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/list
  12596. func (r *AddressesService) List(project string, region string) *AddressesListCall {
  12597. c := &AddressesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12598. c.project = project
  12599. c.region = region
  12600. return c
  12601. }
  12602. // Filter sets the optional parameter "filter": Sets a filter
  12603. // {expression} for filtering listed resources. Your {expression} must
  12604. // be in the format: field_name comparison_string literal_string.
  12605. //
  12606. // The field_name is the name of the field you want to compare. Only
  12607. // atomic field types are supported (string, number, boolean). The
  12608. // comparison_string must be either eq (equals) or ne (not equals). The
  12609. // literal_string is the string value to filter to. The literal value
  12610. // must be valid for the type of field you are filtering by (string,
  12611. // number, boolean). For string fields, the literal value is interpreted
  12612. // as a regular expression using RE2 syntax. The literal value must
  12613. // match the entire field.
  12614. //
  12615. // For example, to filter for instances that do not have a name of
  12616. // example-instance, you would use name ne example-instance.
  12617. //
  12618. // You can filter on nested fields. For example, you could filter on
  12619. // instances that have set the scheduling.automaticRestart field to
  12620. // true. Use filtering on nested fields to take advantage of labels to
  12621. // organize and search for results based on label values.
  12622. //
  12623. // To filter on multiple expressions, provide each separate expression
  12624. // within parentheses. For example, (scheduling.automaticRestart eq
  12625. // true) (zone eq us-central1-f). Multiple expressions are treated as
  12626. // AND expressions, meaning that resources must match all expressions to
  12627. // pass the filters.
  12628. func (c *AddressesListCall) Filter(filter string) *AddressesListCall {
  12629. c.urlParams_.Set("filter", filter)
  12630. return c
  12631. }
  12632. // MaxResults sets the optional parameter "maxResults": The maximum
  12633. // number of results per page that should be returned. If the number of
  12634. // available results is larger than maxResults, Compute Engine returns a
  12635. // nextPageToken that can be used to get the next page of results in
  12636. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  12637. // (Default: 500)
  12638. func (c *AddressesListCall) MaxResults(maxResults int64) *AddressesListCall {
  12639. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  12640. return c
  12641. }
  12642. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  12643. // a certain order. By default, results are returned in alphanumerical
  12644. // order based on the resource name.
  12645. //
  12646. // You can also sort results in descending order based on the creation
  12647. // timestamp using orderBy="creationTimestamp desc". This sorts results
  12648. // based on the creationTimestamp field in reverse chronological order
  12649. // (newest result first). Use this to sort resources like operations so
  12650. // that the newest operation is returned first.
  12651. //
  12652. // Currently, only sorting by name or creationTimestamp desc is
  12653. // supported.
  12654. func (c *AddressesListCall) OrderBy(orderBy string) *AddressesListCall {
  12655. c.urlParams_.Set("orderBy", orderBy)
  12656. return c
  12657. }
  12658. // PageToken sets the optional parameter "pageToken": Specifies a page
  12659. // token to use. Set pageToken to the nextPageToken returned by a
  12660. // previous list request to get the next page of results.
  12661. func (c *AddressesListCall) PageToken(pageToken string) *AddressesListCall {
  12662. c.urlParams_.Set("pageToken", pageToken)
  12663. return c
  12664. }
  12665. // Fields allows partial responses to be retrieved. See
  12666. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12667. // for more information.
  12668. func (c *AddressesListCall) Fields(s ...googleapi.Field) *AddressesListCall {
  12669. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12670. return c
  12671. }
  12672. // IfNoneMatch sets the optional parameter which makes the operation
  12673. // fail if the object's ETag matches the given value. This is useful for
  12674. // getting updates only after the object has changed since the last
  12675. // request. Use googleapi.IsNotModified to check whether the response
  12676. // error from Do is the result of In-None-Match.
  12677. func (c *AddressesListCall) IfNoneMatch(entityTag string) *AddressesListCall {
  12678. c.ifNoneMatch_ = entityTag
  12679. return c
  12680. }
  12681. // Context sets the context to be used in this call's Do method. Any
  12682. // pending HTTP request will be aborted if the provided context is
  12683. // canceled.
  12684. func (c *AddressesListCall) Context(ctx context.Context) *AddressesListCall {
  12685. c.ctx_ = ctx
  12686. return c
  12687. }
  12688. // Header returns an http.Header that can be modified by the caller to
  12689. // add HTTP headers to the request.
  12690. func (c *AddressesListCall) Header() http.Header {
  12691. if c.header_ == nil {
  12692. c.header_ = make(http.Header)
  12693. }
  12694. return c.header_
  12695. }
  12696. func (c *AddressesListCall) doRequest(alt string) (*http.Response, error) {
  12697. reqHeaders := make(http.Header)
  12698. for k, v := range c.header_ {
  12699. reqHeaders[k] = v
  12700. }
  12701. reqHeaders.Set("User-Agent", c.s.userAgent())
  12702. if c.ifNoneMatch_ != "" {
  12703. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12704. }
  12705. var body io.Reader = nil
  12706. c.urlParams_.Set("alt", alt)
  12707. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses")
  12708. urls += "?" + c.urlParams_.Encode()
  12709. req, _ := http.NewRequest("GET", urls, body)
  12710. req.Header = reqHeaders
  12711. googleapi.Expand(req.URL, map[string]string{
  12712. "project": c.project,
  12713. "region": c.region,
  12714. })
  12715. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12716. }
  12717. // Do executes the "compute.addresses.list" call.
  12718. // Exactly one of *AddressList or error will be non-nil. Any non-2xx
  12719. // status code is an error. Response headers are in either
  12720. // *AddressList.ServerResponse.Header or (if a response was returned at
  12721. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  12722. // to check whether the returned error was because
  12723. // http.StatusNotModified was returned.
  12724. func (c *AddressesListCall) Do(opts ...googleapi.CallOption) (*AddressList, error) {
  12725. gensupport.SetOptions(c.urlParams_, opts...)
  12726. res, err := c.doRequest("json")
  12727. if res != nil && res.StatusCode == http.StatusNotModified {
  12728. if res.Body != nil {
  12729. res.Body.Close()
  12730. }
  12731. return nil, &googleapi.Error{
  12732. Code: res.StatusCode,
  12733. Header: res.Header,
  12734. }
  12735. }
  12736. if err != nil {
  12737. return nil, err
  12738. }
  12739. defer googleapi.CloseBody(res)
  12740. if err := googleapi.CheckResponse(res); err != nil {
  12741. return nil, err
  12742. }
  12743. ret := &AddressList{
  12744. ServerResponse: googleapi.ServerResponse{
  12745. Header: res.Header,
  12746. HTTPStatusCode: res.StatusCode,
  12747. },
  12748. }
  12749. target := &ret
  12750. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  12751. return nil, err
  12752. }
  12753. return ret, nil
  12754. // {
  12755. // "description": "Retrieves a list of addresses contained within the specified region.",
  12756. // "httpMethod": "GET",
  12757. // "id": "compute.addresses.list",
  12758. // "parameterOrder": [
  12759. // "project",
  12760. // "region"
  12761. // ],
  12762. // "parameters": {
  12763. // "filter": {
  12764. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  12765. // "location": "query",
  12766. // "type": "string"
  12767. // },
  12768. // "maxResults": {
  12769. // "default": "500",
  12770. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  12771. // "format": "uint32",
  12772. // "location": "query",
  12773. // "minimum": "0",
  12774. // "type": "integer"
  12775. // },
  12776. // "orderBy": {
  12777. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  12778. // "location": "query",
  12779. // "type": "string"
  12780. // },
  12781. // "pageToken": {
  12782. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  12783. // "location": "query",
  12784. // "type": "string"
  12785. // },
  12786. // "project": {
  12787. // "description": "Project ID for this request.",
  12788. // "location": "path",
  12789. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  12790. // "required": true,
  12791. // "type": "string"
  12792. // },
  12793. // "region": {
  12794. // "description": "Name of the region for this request.",
  12795. // "location": "path",
  12796. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  12797. // "required": true,
  12798. // "type": "string"
  12799. // }
  12800. // },
  12801. // "path": "{project}/regions/{region}/addresses",
  12802. // "response": {
  12803. // "$ref": "AddressList"
  12804. // },
  12805. // "scopes": [
  12806. // "https://www.googleapis.com/auth/cloud-platform",
  12807. // "https://www.googleapis.com/auth/compute",
  12808. // "https://www.googleapis.com/auth/compute.readonly"
  12809. // ]
  12810. // }
  12811. }
  12812. // Pages invokes f for each page of results.
  12813. // A non-nil error returned from f will halt the iteration.
  12814. // The provided context supersedes any context provided to the Context method.
  12815. func (c *AddressesListCall) Pages(ctx context.Context, f func(*AddressList) error) error {
  12816. c.ctx_ = ctx
  12817. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  12818. for {
  12819. x, err := c.Do()
  12820. if err != nil {
  12821. return err
  12822. }
  12823. if err := f(x); err != nil {
  12824. return err
  12825. }
  12826. if x.NextPageToken == "" {
  12827. return nil
  12828. }
  12829. c.PageToken(x.NextPageToken)
  12830. }
  12831. }
  12832. // method id "compute.autoscalers.aggregatedList":
  12833. type AutoscalersAggregatedListCall struct {
  12834. s *Service
  12835. project string
  12836. urlParams_ gensupport.URLParams
  12837. ifNoneMatch_ string
  12838. ctx_ context.Context
  12839. header_ http.Header
  12840. }
  12841. // AggregatedList: Retrieves an aggregated list of autoscalers.
  12842. func (r *AutoscalersService) AggregatedList(project string) *AutoscalersAggregatedListCall {
  12843. c := &AutoscalersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12844. c.project = project
  12845. return c
  12846. }
  12847. // Filter sets the optional parameter "filter": Sets a filter
  12848. // {expression} for filtering listed resources. Your {expression} must
  12849. // be in the format: field_name comparison_string literal_string.
  12850. //
  12851. // The field_name is the name of the field you want to compare. Only
  12852. // atomic field types are supported (string, number, boolean). The
  12853. // comparison_string must be either eq (equals) or ne (not equals). The
  12854. // literal_string is the string value to filter to. The literal value
  12855. // must be valid for the type of field you are filtering by (string,
  12856. // number, boolean). For string fields, the literal value is interpreted
  12857. // as a regular expression using RE2 syntax. The literal value must
  12858. // match the entire field.
  12859. //
  12860. // For example, to filter for instances that do not have a name of
  12861. // example-instance, you would use name ne example-instance.
  12862. //
  12863. // You can filter on nested fields. For example, you could filter on
  12864. // instances that have set the scheduling.automaticRestart field to
  12865. // true. Use filtering on nested fields to take advantage of labels to
  12866. // organize and search for results based on label values.
  12867. //
  12868. // To filter on multiple expressions, provide each separate expression
  12869. // within parentheses. For example, (scheduling.automaticRestart eq
  12870. // true) (zone eq us-central1-f). Multiple expressions are treated as
  12871. // AND expressions, meaning that resources must match all expressions to
  12872. // pass the filters.
  12873. func (c *AutoscalersAggregatedListCall) Filter(filter string) *AutoscalersAggregatedListCall {
  12874. c.urlParams_.Set("filter", filter)
  12875. return c
  12876. }
  12877. // MaxResults sets the optional parameter "maxResults": The maximum
  12878. // number of results per page that should be returned. If the number of
  12879. // available results is larger than maxResults, Compute Engine returns a
  12880. // nextPageToken that can be used to get the next page of results in
  12881. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  12882. // (Default: 500)
  12883. func (c *AutoscalersAggregatedListCall) MaxResults(maxResults int64) *AutoscalersAggregatedListCall {
  12884. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  12885. return c
  12886. }
  12887. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  12888. // a certain order. By default, results are returned in alphanumerical
  12889. // order based on the resource name.
  12890. //
  12891. // You can also sort results in descending order based on the creation
  12892. // timestamp using orderBy="creationTimestamp desc". This sorts results
  12893. // based on the creationTimestamp field in reverse chronological order
  12894. // (newest result first). Use this to sort resources like operations so
  12895. // that the newest operation is returned first.
  12896. //
  12897. // Currently, only sorting by name or creationTimestamp desc is
  12898. // supported.
  12899. func (c *AutoscalersAggregatedListCall) OrderBy(orderBy string) *AutoscalersAggregatedListCall {
  12900. c.urlParams_.Set("orderBy", orderBy)
  12901. return c
  12902. }
  12903. // PageToken sets the optional parameter "pageToken": Specifies a page
  12904. // token to use. Set pageToken to the nextPageToken returned by a
  12905. // previous list request to get the next page of results.
  12906. func (c *AutoscalersAggregatedListCall) PageToken(pageToken string) *AutoscalersAggregatedListCall {
  12907. c.urlParams_.Set("pageToken", pageToken)
  12908. return c
  12909. }
  12910. // Fields allows partial responses to be retrieved. See
  12911. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12912. // for more information.
  12913. func (c *AutoscalersAggregatedListCall) Fields(s ...googleapi.Field) *AutoscalersAggregatedListCall {
  12914. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12915. return c
  12916. }
  12917. // IfNoneMatch sets the optional parameter which makes the operation
  12918. // fail if the object's ETag matches the given value. This is useful for
  12919. // getting updates only after the object has changed since the last
  12920. // request. Use googleapi.IsNotModified to check whether the response
  12921. // error from Do is the result of In-None-Match.
  12922. func (c *AutoscalersAggregatedListCall) IfNoneMatch(entityTag string) *AutoscalersAggregatedListCall {
  12923. c.ifNoneMatch_ = entityTag
  12924. return c
  12925. }
  12926. // Context sets the context to be used in this call's Do method. Any
  12927. // pending HTTP request will be aborted if the provided context is
  12928. // canceled.
  12929. func (c *AutoscalersAggregatedListCall) Context(ctx context.Context) *AutoscalersAggregatedListCall {
  12930. c.ctx_ = ctx
  12931. return c
  12932. }
  12933. // Header returns an http.Header that can be modified by the caller to
  12934. // add HTTP headers to the request.
  12935. func (c *AutoscalersAggregatedListCall) Header() http.Header {
  12936. if c.header_ == nil {
  12937. c.header_ = make(http.Header)
  12938. }
  12939. return c.header_
  12940. }
  12941. func (c *AutoscalersAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  12942. reqHeaders := make(http.Header)
  12943. for k, v := range c.header_ {
  12944. reqHeaders[k] = v
  12945. }
  12946. reqHeaders.Set("User-Agent", c.s.userAgent())
  12947. if c.ifNoneMatch_ != "" {
  12948. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12949. }
  12950. var body io.Reader = nil
  12951. c.urlParams_.Set("alt", alt)
  12952. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/autoscalers")
  12953. urls += "?" + c.urlParams_.Encode()
  12954. req, _ := http.NewRequest("GET", urls, body)
  12955. req.Header = reqHeaders
  12956. googleapi.Expand(req.URL, map[string]string{
  12957. "project": c.project,
  12958. })
  12959. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12960. }
  12961. // Do executes the "compute.autoscalers.aggregatedList" call.
  12962. // Exactly one of *AutoscalerAggregatedList or error will be non-nil.
  12963. // Any non-2xx status code is an error. Response headers are in either
  12964. // *AutoscalerAggregatedList.ServerResponse.Header or (if a response was
  12965. // returned at all) in error.(*googleapi.Error).Header. Use
  12966. // googleapi.IsNotModified to check whether the returned error was
  12967. // because http.StatusNotModified was returned.
  12968. func (c *AutoscalersAggregatedListCall) Do(opts ...googleapi.CallOption) (*AutoscalerAggregatedList, error) {
  12969. gensupport.SetOptions(c.urlParams_, opts...)
  12970. res, err := c.doRequest("json")
  12971. if res != nil && res.StatusCode == http.StatusNotModified {
  12972. if res.Body != nil {
  12973. res.Body.Close()
  12974. }
  12975. return nil, &googleapi.Error{
  12976. Code: res.StatusCode,
  12977. Header: res.Header,
  12978. }
  12979. }
  12980. if err != nil {
  12981. return nil, err
  12982. }
  12983. defer googleapi.CloseBody(res)
  12984. if err := googleapi.CheckResponse(res); err != nil {
  12985. return nil, err
  12986. }
  12987. ret := &AutoscalerAggregatedList{
  12988. ServerResponse: googleapi.ServerResponse{
  12989. Header: res.Header,
  12990. HTTPStatusCode: res.StatusCode,
  12991. },
  12992. }
  12993. target := &ret
  12994. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  12995. return nil, err
  12996. }
  12997. return ret, nil
  12998. // {
  12999. // "description": "Retrieves an aggregated list of autoscalers.",
  13000. // "httpMethod": "GET",
  13001. // "id": "compute.autoscalers.aggregatedList",
  13002. // "parameterOrder": [
  13003. // "project"
  13004. // ],
  13005. // "parameters": {
  13006. // "filter": {
  13007. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  13008. // "location": "query",
  13009. // "type": "string"
  13010. // },
  13011. // "maxResults": {
  13012. // "default": "500",
  13013. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  13014. // "format": "uint32",
  13015. // "location": "query",
  13016. // "minimum": "0",
  13017. // "type": "integer"
  13018. // },
  13019. // "orderBy": {
  13020. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  13021. // "location": "query",
  13022. // "type": "string"
  13023. // },
  13024. // "pageToken": {
  13025. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  13026. // "location": "query",
  13027. // "type": "string"
  13028. // },
  13029. // "project": {
  13030. // "description": "Project ID for this request.",
  13031. // "location": "path",
  13032. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  13033. // "required": true,
  13034. // "type": "string"
  13035. // }
  13036. // },
  13037. // "path": "{project}/aggregated/autoscalers",
  13038. // "response": {
  13039. // "$ref": "AutoscalerAggregatedList"
  13040. // },
  13041. // "scopes": [
  13042. // "https://www.googleapis.com/auth/cloud-platform",
  13043. // "https://www.googleapis.com/auth/compute",
  13044. // "https://www.googleapis.com/auth/compute.readonly"
  13045. // ]
  13046. // }
  13047. }
  13048. // Pages invokes f for each page of results.
  13049. // A non-nil error returned from f will halt the iteration.
  13050. // The provided context supersedes any context provided to the Context method.
  13051. func (c *AutoscalersAggregatedListCall) Pages(ctx context.Context, f func(*AutoscalerAggregatedList) error) error {
  13052. c.ctx_ = ctx
  13053. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  13054. for {
  13055. x, err := c.Do()
  13056. if err != nil {
  13057. return err
  13058. }
  13059. if err := f(x); err != nil {
  13060. return err
  13061. }
  13062. if x.NextPageToken == "" {
  13063. return nil
  13064. }
  13065. c.PageToken(x.NextPageToken)
  13066. }
  13067. }
  13068. // method id "compute.autoscalers.delete":
  13069. type AutoscalersDeleteCall struct {
  13070. s *Service
  13071. project string
  13072. zone string
  13073. autoscaler string
  13074. urlParams_ gensupport.URLParams
  13075. ctx_ context.Context
  13076. header_ http.Header
  13077. }
  13078. // Delete: Deletes the specified autoscaler.
  13079. func (r *AutoscalersService) Delete(project string, zone string, autoscaler string) *AutoscalersDeleteCall {
  13080. c := &AutoscalersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13081. c.project = project
  13082. c.zone = zone
  13083. c.autoscaler = autoscaler
  13084. return c
  13085. }
  13086. // Fields allows partial responses to be retrieved. See
  13087. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13088. // for more information.
  13089. func (c *AutoscalersDeleteCall) Fields(s ...googleapi.Field) *AutoscalersDeleteCall {
  13090. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13091. return c
  13092. }
  13093. // Context sets the context to be used in this call's Do method. Any
  13094. // pending HTTP request will be aborted if the provided context is
  13095. // canceled.
  13096. func (c *AutoscalersDeleteCall) Context(ctx context.Context) *AutoscalersDeleteCall {
  13097. c.ctx_ = ctx
  13098. return c
  13099. }
  13100. // Header returns an http.Header that can be modified by the caller to
  13101. // add HTTP headers to the request.
  13102. func (c *AutoscalersDeleteCall) Header() http.Header {
  13103. if c.header_ == nil {
  13104. c.header_ = make(http.Header)
  13105. }
  13106. return c.header_
  13107. }
  13108. func (c *AutoscalersDeleteCall) doRequest(alt string) (*http.Response, error) {
  13109. reqHeaders := make(http.Header)
  13110. for k, v := range c.header_ {
  13111. reqHeaders[k] = v
  13112. }
  13113. reqHeaders.Set("User-Agent", c.s.userAgent())
  13114. var body io.Reader = nil
  13115. c.urlParams_.Set("alt", alt)
  13116. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers/{autoscaler}")
  13117. urls += "?" + c.urlParams_.Encode()
  13118. req, _ := http.NewRequest("DELETE", urls, body)
  13119. req.Header = reqHeaders
  13120. googleapi.Expand(req.URL, map[string]string{
  13121. "project": c.project,
  13122. "zone": c.zone,
  13123. "autoscaler": c.autoscaler,
  13124. })
  13125. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13126. }
  13127. // Do executes the "compute.autoscalers.delete" call.
  13128. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  13129. // status code is an error. Response headers are in either
  13130. // *Operation.ServerResponse.Header or (if a response was returned at
  13131. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  13132. // to check whether the returned error was because
  13133. // http.StatusNotModified was returned.
  13134. func (c *AutoscalersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  13135. gensupport.SetOptions(c.urlParams_, opts...)
  13136. res, err := c.doRequest("json")
  13137. if res != nil && res.StatusCode == http.StatusNotModified {
  13138. if res.Body != nil {
  13139. res.Body.Close()
  13140. }
  13141. return nil, &googleapi.Error{
  13142. Code: res.StatusCode,
  13143. Header: res.Header,
  13144. }
  13145. }
  13146. if err != nil {
  13147. return nil, err
  13148. }
  13149. defer googleapi.CloseBody(res)
  13150. if err := googleapi.CheckResponse(res); err != nil {
  13151. return nil, err
  13152. }
  13153. ret := &Operation{
  13154. ServerResponse: googleapi.ServerResponse{
  13155. Header: res.Header,
  13156. HTTPStatusCode: res.StatusCode,
  13157. },
  13158. }
  13159. target := &ret
  13160. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  13161. return nil, err
  13162. }
  13163. return ret, nil
  13164. // {
  13165. // "description": "Deletes the specified autoscaler.",
  13166. // "httpMethod": "DELETE",
  13167. // "id": "compute.autoscalers.delete",
  13168. // "parameterOrder": [
  13169. // "project",
  13170. // "zone",
  13171. // "autoscaler"
  13172. // ],
  13173. // "parameters": {
  13174. // "autoscaler": {
  13175. // "description": "Name of the autoscaler to delete.",
  13176. // "location": "path",
  13177. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  13178. // "required": true,
  13179. // "type": "string"
  13180. // },
  13181. // "project": {
  13182. // "description": "Project ID for this request.",
  13183. // "location": "path",
  13184. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  13185. // "required": true,
  13186. // "type": "string"
  13187. // },
  13188. // "zone": {
  13189. // "description": "Name of the zone for this request.",
  13190. // "location": "path",
  13191. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  13192. // "required": true,
  13193. // "type": "string"
  13194. // }
  13195. // },
  13196. // "path": "{project}/zones/{zone}/autoscalers/{autoscaler}",
  13197. // "response": {
  13198. // "$ref": "Operation"
  13199. // },
  13200. // "scopes": [
  13201. // "https://www.googleapis.com/auth/cloud-platform",
  13202. // "https://www.googleapis.com/auth/compute"
  13203. // ]
  13204. // }
  13205. }
  13206. // method id "compute.autoscalers.get":
  13207. type AutoscalersGetCall struct {
  13208. s *Service
  13209. project string
  13210. zone string
  13211. autoscaler string
  13212. urlParams_ gensupport.URLParams
  13213. ifNoneMatch_ string
  13214. ctx_ context.Context
  13215. header_ http.Header
  13216. }
  13217. // Get: Returns the specified autoscaler resource. Get a list of
  13218. // available autoscalers by making a list() request.
  13219. func (r *AutoscalersService) Get(project string, zone string, autoscaler string) *AutoscalersGetCall {
  13220. c := &AutoscalersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13221. c.project = project
  13222. c.zone = zone
  13223. c.autoscaler = autoscaler
  13224. return c
  13225. }
  13226. // Fields allows partial responses to be retrieved. See
  13227. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13228. // for more information.
  13229. func (c *AutoscalersGetCall) Fields(s ...googleapi.Field) *AutoscalersGetCall {
  13230. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13231. return c
  13232. }
  13233. // IfNoneMatch sets the optional parameter which makes the operation
  13234. // fail if the object's ETag matches the given value. This is useful for
  13235. // getting updates only after the object has changed since the last
  13236. // request. Use googleapi.IsNotModified to check whether the response
  13237. // error from Do is the result of In-None-Match.
  13238. func (c *AutoscalersGetCall) IfNoneMatch(entityTag string) *AutoscalersGetCall {
  13239. c.ifNoneMatch_ = entityTag
  13240. return c
  13241. }
  13242. // Context sets the context to be used in this call's Do method. Any
  13243. // pending HTTP request will be aborted if the provided context is
  13244. // canceled.
  13245. func (c *AutoscalersGetCall) Context(ctx context.Context) *AutoscalersGetCall {
  13246. c.ctx_ = ctx
  13247. return c
  13248. }
  13249. // Header returns an http.Header that can be modified by the caller to
  13250. // add HTTP headers to the request.
  13251. func (c *AutoscalersGetCall) Header() http.Header {
  13252. if c.header_ == nil {
  13253. c.header_ = make(http.Header)
  13254. }
  13255. return c.header_
  13256. }
  13257. func (c *AutoscalersGetCall) doRequest(alt string) (*http.Response, error) {
  13258. reqHeaders := make(http.Header)
  13259. for k, v := range c.header_ {
  13260. reqHeaders[k] = v
  13261. }
  13262. reqHeaders.Set("User-Agent", c.s.userAgent())
  13263. if c.ifNoneMatch_ != "" {
  13264. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13265. }
  13266. var body io.Reader = nil
  13267. c.urlParams_.Set("alt", alt)
  13268. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers/{autoscaler}")
  13269. urls += "?" + c.urlParams_.Encode()
  13270. req, _ := http.NewRequest("GET", urls, body)
  13271. req.Header = reqHeaders
  13272. googleapi.Expand(req.URL, map[string]string{
  13273. "project": c.project,
  13274. "zone": c.zone,
  13275. "autoscaler": c.autoscaler,
  13276. })
  13277. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13278. }
  13279. // Do executes the "compute.autoscalers.get" call.
  13280. // Exactly one of *Autoscaler or error will be non-nil. Any non-2xx
  13281. // status code is an error. Response headers are in either
  13282. // *Autoscaler.ServerResponse.Header or (if a response was returned at
  13283. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  13284. // to check whether the returned error was because
  13285. // http.StatusNotModified was returned.
  13286. func (c *AutoscalersGetCall) Do(opts ...googleapi.CallOption) (*Autoscaler, error) {
  13287. gensupport.SetOptions(c.urlParams_, opts...)
  13288. res, err := c.doRequest("json")
  13289. if res != nil && res.StatusCode == http.StatusNotModified {
  13290. if res.Body != nil {
  13291. res.Body.Close()
  13292. }
  13293. return nil, &googleapi.Error{
  13294. Code: res.StatusCode,
  13295. Header: res.Header,
  13296. }
  13297. }
  13298. if err != nil {
  13299. return nil, err
  13300. }
  13301. defer googleapi.CloseBody(res)
  13302. if err := googleapi.CheckResponse(res); err != nil {
  13303. return nil, err
  13304. }
  13305. ret := &Autoscaler{
  13306. ServerResponse: googleapi.ServerResponse{
  13307. Header: res.Header,
  13308. HTTPStatusCode: res.StatusCode,
  13309. },
  13310. }
  13311. target := &ret
  13312. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  13313. return nil, err
  13314. }
  13315. return ret, nil
  13316. // {
  13317. // "description": "Returns the specified autoscaler resource. Get a list of available autoscalers by making a list() request.",
  13318. // "httpMethod": "GET",
  13319. // "id": "compute.autoscalers.get",
  13320. // "parameterOrder": [
  13321. // "project",
  13322. // "zone",
  13323. // "autoscaler"
  13324. // ],
  13325. // "parameters": {
  13326. // "autoscaler": {
  13327. // "description": "Name of the autoscaler to return.",
  13328. // "location": "path",
  13329. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  13330. // "required": true,
  13331. // "type": "string"
  13332. // },
  13333. // "project": {
  13334. // "description": "Project ID for this request.",
  13335. // "location": "path",
  13336. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  13337. // "required": true,
  13338. // "type": "string"
  13339. // },
  13340. // "zone": {
  13341. // "description": "Name of the zone for this request.",
  13342. // "location": "path",
  13343. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  13344. // "required": true,
  13345. // "type": "string"
  13346. // }
  13347. // },
  13348. // "path": "{project}/zones/{zone}/autoscalers/{autoscaler}",
  13349. // "response": {
  13350. // "$ref": "Autoscaler"
  13351. // },
  13352. // "scopes": [
  13353. // "https://www.googleapis.com/auth/cloud-platform",
  13354. // "https://www.googleapis.com/auth/compute",
  13355. // "https://www.googleapis.com/auth/compute.readonly"
  13356. // ]
  13357. // }
  13358. }
  13359. // method id "compute.autoscalers.insert":
  13360. type AutoscalersInsertCall struct {
  13361. s *Service
  13362. project string
  13363. zone string
  13364. autoscaler *Autoscaler
  13365. urlParams_ gensupport.URLParams
  13366. ctx_ context.Context
  13367. header_ http.Header
  13368. }
  13369. // Insert: Creates an autoscaler in the specified project using the data
  13370. // included in the request.
  13371. func (r *AutoscalersService) Insert(project string, zone string, autoscaler *Autoscaler) *AutoscalersInsertCall {
  13372. c := &AutoscalersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13373. c.project = project
  13374. c.zone = zone
  13375. c.autoscaler = autoscaler
  13376. return c
  13377. }
  13378. // Fields allows partial responses to be retrieved. See
  13379. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13380. // for more information.
  13381. func (c *AutoscalersInsertCall) Fields(s ...googleapi.Field) *AutoscalersInsertCall {
  13382. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13383. return c
  13384. }
  13385. // Context sets the context to be used in this call's Do method. Any
  13386. // pending HTTP request will be aborted if the provided context is
  13387. // canceled.
  13388. func (c *AutoscalersInsertCall) Context(ctx context.Context) *AutoscalersInsertCall {
  13389. c.ctx_ = ctx
  13390. return c
  13391. }
  13392. // Header returns an http.Header that can be modified by the caller to
  13393. // add HTTP headers to the request.
  13394. func (c *AutoscalersInsertCall) Header() http.Header {
  13395. if c.header_ == nil {
  13396. c.header_ = make(http.Header)
  13397. }
  13398. return c.header_
  13399. }
  13400. func (c *AutoscalersInsertCall) doRequest(alt string) (*http.Response, error) {
  13401. reqHeaders := make(http.Header)
  13402. for k, v := range c.header_ {
  13403. reqHeaders[k] = v
  13404. }
  13405. reqHeaders.Set("User-Agent", c.s.userAgent())
  13406. var body io.Reader = nil
  13407. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  13408. if err != nil {
  13409. return nil, err
  13410. }
  13411. reqHeaders.Set("Content-Type", "application/json")
  13412. c.urlParams_.Set("alt", alt)
  13413. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  13414. urls += "?" + c.urlParams_.Encode()
  13415. req, _ := http.NewRequest("POST", urls, body)
  13416. req.Header = reqHeaders
  13417. googleapi.Expand(req.URL, map[string]string{
  13418. "project": c.project,
  13419. "zone": c.zone,
  13420. })
  13421. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13422. }
  13423. // Do executes the "compute.autoscalers.insert" call.
  13424. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  13425. // status code is an error. Response headers are in either
  13426. // *Operation.ServerResponse.Header or (if a response was returned at
  13427. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  13428. // to check whether the returned error was because
  13429. // http.StatusNotModified was returned.
  13430. func (c *AutoscalersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  13431. gensupport.SetOptions(c.urlParams_, opts...)
  13432. res, err := c.doRequest("json")
  13433. if res != nil && res.StatusCode == http.StatusNotModified {
  13434. if res.Body != nil {
  13435. res.Body.Close()
  13436. }
  13437. return nil, &googleapi.Error{
  13438. Code: res.StatusCode,
  13439. Header: res.Header,
  13440. }
  13441. }
  13442. if err != nil {
  13443. return nil, err
  13444. }
  13445. defer googleapi.CloseBody(res)
  13446. if err := googleapi.CheckResponse(res); err != nil {
  13447. return nil, err
  13448. }
  13449. ret := &Operation{
  13450. ServerResponse: googleapi.ServerResponse{
  13451. Header: res.Header,
  13452. HTTPStatusCode: res.StatusCode,
  13453. },
  13454. }
  13455. target := &ret
  13456. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  13457. return nil, err
  13458. }
  13459. return ret, nil
  13460. // {
  13461. // "description": "Creates an autoscaler in the specified project using the data included in the request.",
  13462. // "httpMethod": "POST",
  13463. // "id": "compute.autoscalers.insert",
  13464. // "parameterOrder": [
  13465. // "project",
  13466. // "zone"
  13467. // ],
  13468. // "parameters": {
  13469. // "project": {
  13470. // "description": "Project ID for this request.",
  13471. // "location": "path",
  13472. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  13473. // "required": true,
  13474. // "type": "string"
  13475. // },
  13476. // "zone": {
  13477. // "description": "Name of the zone for this request.",
  13478. // "location": "path",
  13479. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  13480. // "required": true,
  13481. // "type": "string"
  13482. // }
  13483. // },
  13484. // "path": "{project}/zones/{zone}/autoscalers",
  13485. // "request": {
  13486. // "$ref": "Autoscaler"
  13487. // },
  13488. // "response": {
  13489. // "$ref": "Operation"
  13490. // },
  13491. // "scopes": [
  13492. // "https://www.googleapis.com/auth/cloud-platform",
  13493. // "https://www.googleapis.com/auth/compute"
  13494. // ]
  13495. // }
  13496. }
  13497. // method id "compute.autoscalers.list":
  13498. type AutoscalersListCall struct {
  13499. s *Service
  13500. project string
  13501. zone string
  13502. urlParams_ gensupport.URLParams
  13503. ifNoneMatch_ string
  13504. ctx_ context.Context
  13505. header_ http.Header
  13506. }
  13507. // List: Retrieves a list of autoscalers contained within the specified
  13508. // zone.
  13509. func (r *AutoscalersService) List(project string, zone string) *AutoscalersListCall {
  13510. c := &AutoscalersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13511. c.project = project
  13512. c.zone = zone
  13513. return c
  13514. }
  13515. // Filter sets the optional parameter "filter": Sets a filter
  13516. // {expression} for filtering listed resources. Your {expression} must
  13517. // be in the format: field_name comparison_string literal_string.
  13518. //
  13519. // The field_name is the name of the field you want to compare. Only
  13520. // atomic field types are supported (string, number, boolean). The
  13521. // comparison_string must be either eq (equals) or ne (not equals). The
  13522. // literal_string is the string value to filter to. The literal value
  13523. // must be valid for the type of field you are filtering by (string,
  13524. // number, boolean). For string fields, the literal value is interpreted
  13525. // as a regular expression using RE2 syntax. The literal value must
  13526. // match the entire field.
  13527. //
  13528. // For example, to filter for instances that do not have a name of
  13529. // example-instance, you would use name ne example-instance.
  13530. //
  13531. // You can filter on nested fields. For example, you could filter on
  13532. // instances that have set the scheduling.automaticRestart field to
  13533. // true. Use filtering on nested fields to take advantage of labels to
  13534. // organize and search for results based on label values.
  13535. //
  13536. // To filter on multiple expressions, provide each separate expression
  13537. // within parentheses. For example, (scheduling.automaticRestart eq
  13538. // true) (zone eq us-central1-f). Multiple expressions are treated as
  13539. // AND expressions, meaning that resources must match all expressions to
  13540. // pass the filters.
  13541. func (c *AutoscalersListCall) Filter(filter string) *AutoscalersListCall {
  13542. c.urlParams_.Set("filter", filter)
  13543. return c
  13544. }
  13545. // MaxResults sets the optional parameter "maxResults": The maximum
  13546. // number of results per page that should be returned. If the number of
  13547. // available results is larger than maxResults, Compute Engine returns a
  13548. // nextPageToken that can be used to get the next page of results in
  13549. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  13550. // (Default: 500)
  13551. func (c *AutoscalersListCall) MaxResults(maxResults int64) *AutoscalersListCall {
  13552. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  13553. return c
  13554. }
  13555. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  13556. // a certain order. By default, results are returned in alphanumerical
  13557. // order based on the resource name.
  13558. //
  13559. // You can also sort results in descending order based on the creation
  13560. // timestamp using orderBy="creationTimestamp desc". This sorts results
  13561. // based on the creationTimestamp field in reverse chronological order
  13562. // (newest result first). Use this to sort resources like operations so
  13563. // that the newest operation is returned first.
  13564. //
  13565. // Currently, only sorting by name or creationTimestamp desc is
  13566. // supported.
  13567. func (c *AutoscalersListCall) OrderBy(orderBy string) *AutoscalersListCall {
  13568. c.urlParams_.Set("orderBy", orderBy)
  13569. return c
  13570. }
  13571. // PageToken sets the optional parameter "pageToken": Specifies a page
  13572. // token to use. Set pageToken to the nextPageToken returned by a
  13573. // previous list request to get the next page of results.
  13574. func (c *AutoscalersListCall) PageToken(pageToken string) *AutoscalersListCall {
  13575. c.urlParams_.Set("pageToken", pageToken)
  13576. return c
  13577. }
  13578. // Fields allows partial responses to be retrieved. See
  13579. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13580. // for more information.
  13581. func (c *AutoscalersListCall) Fields(s ...googleapi.Field) *AutoscalersListCall {
  13582. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13583. return c
  13584. }
  13585. // IfNoneMatch sets the optional parameter which makes the operation
  13586. // fail if the object's ETag matches the given value. This is useful for
  13587. // getting updates only after the object has changed since the last
  13588. // request. Use googleapi.IsNotModified to check whether the response
  13589. // error from Do is the result of In-None-Match.
  13590. func (c *AutoscalersListCall) IfNoneMatch(entityTag string) *AutoscalersListCall {
  13591. c.ifNoneMatch_ = entityTag
  13592. return c
  13593. }
  13594. // Context sets the context to be used in this call's Do method. Any
  13595. // pending HTTP request will be aborted if the provided context is
  13596. // canceled.
  13597. func (c *AutoscalersListCall) Context(ctx context.Context) *AutoscalersListCall {
  13598. c.ctx_ = ctx
  13599. return c
  13600. }
  13601. // Header returns an http.Header that can be modified by the caller to
  13602. // add HTTP headers to the request.
  13603. func (c *AutoscalersListCall) Header() http.Header {
  13604. if c.header_ == nil {
  13605. c.header_ = make(http.Header)
  13606. }
  13607. return c.header_
  13608. }
  13609. func (c *AutoscalersListCall) doRequest(alt string) (*http.Response, error) {
  13610. reqHeaders := make(http.Header)
  13611. for k, v := range c.header_ {
  13612. reqHeaders[k] = v
  13613. }
  13614. reqHeaders.Set("User-Agent", c.s.userAgent())
  13615. if c.ifNoneMatch_ != "" {
  13616. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13617. }
  13618. var body io.Reader = nil
  13619. c.urlParams_.Set("alt", alt)
  13620. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  13621. urls += "?" + c.urlParams_.Encode()
  13622. req, _ := http.NewRequest("GET", urls, body)
  13623. req.Header = reqHeaders
  13624. googleapi.Expand(req.URL, map[string]string{
  13625. "project": c.project,
  13626. "zone": c.zone,
  13627. })
  13628. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13629. }
  13630. // Do executes the "compute.autoscalers.list" call.
  13631. // Exactly one of *AutoscalerList or error will be non-nil. Any non-2xx
  13632. // status code is an error. Response headers are in either
  13633. // *AutoscalerList.ServerResponse.Header or (if a response was returned
  13634. // at all) in error.(*googleapi.Error).Header. Use
  13635. // googleapi.IsNotModified to check whether the returned error was
  13636. // because http.StatusNotModified was returned.
  13637. func (c *AutoscalersListCall) Do(opts ...googleapi.CallOption) (*AutoscalerList, error) {
  13638. gensupport.SetOptions(c.urlParams_, opts...)
  13639. res, err := c.doRequest("json")
  13640. if res != nil && res.StatusCode == http.StatusNotModified {
  13641. if res.Body != nil {
  13642. res.Body.Close()
  13643. }
  13644. return nil, &googleapi.Error{
  13645. Code: res.StatusCode,
  13646. Header: res.Header,
  13647. }
  13648. }
  13649. if err != nil {
  13650. return nil, err
  13651. }
  13652. defer googleapi.CloseBody(res)
  13653. if err := googleapi.CheckResponse(res); err != nil {
  13654. return nil, err
  13655. }
  13656. ret := &AutoscalerList{
  13657. ServerResponse: googleapi.ServerResponse{
  13658. Header: res.Header,
  13659. HTTPStatusCode: res.StatusCode,
  13660. },
  13661. }
  13662. target := &ret
  13663. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  13664. return nil, err
  13665. }
  13666. return ret, nil
  13667. // {
  13668. // "description": "Retrieves a list of autoscalers contained within the specified zone.",
  13669. // "httpMethod": "GET",
  13670. // "id": "compute.autoscalers.list",
  13671. // "parameterOrder": [
  13672. // "project",
  13673. // "zone"
  13674. // ],
  13675. // "parameters": {
  13676. // "filter": {
  13677. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  13678. // "location": "query",
  13679. // "type": "string"
  13680. // },
  13681. // "maxResults": {
  13682. // "default": "500",
  13683. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  13684. // "format": "uint32",
  13685. // "location": "query",
  13686. // "minimum": "0",
  13687. // "type": "integer"
  13688. // },
  13689. // "orderBy": {
  13690. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  13691. // "location": "query",
  13692. // "type": "string"
  13693. // },
  13694. // "pageToken": {
  13695. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  13696. // "location": "query",
  13697. // "type": "string"
  13698. // },
  13699. // "project": {
  13700. // "description": "Project ID for this request.",
  13701. // "location": "path",
  13702. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  13703. // "required": true,
  13704. // "type": "string"
  13705. // },
  13706. // "zone": {
  13707. // "description": "Name of the zone for this request.",
  13708. // "location": "path",
  13709. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  13710. // "required": true,
  13711. // "type": "string"
  13712. // }
  13713. // },
  13714. // "path": "{project}/zones/{zone}/autoscalers",
  13715. // "response": {
  13716. // "$ref": "AutoscalerList"
  13717. // },
  13718. // "scopes": [
  13719. // "https://www.googleapis.com/auth/cloud-platform",
  13720. // "https://www.googleapis.com/auth/compute",
  13721. // "https://www.googleapis.com/auth/compute.readonly"
  13722. // ]
  13723. // }
  13724. }
  13725. // Pages invokes f for each page of results.
  13726. // A non-nil error returned from f will halt the iteration.
  13727. // The provided context supersedes any context provided to the Context method.
  13728. func (c *AutoscalersListCall) Pages(ctx context.Context, f func(*AutoscalerList) error) error {
  13729. c.ctx_ = ctx
  13730. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  13731. for {
  13732. x, err := c.Do()
  13733. if err != nil {
  13734. return err
  13735. }
  13736. if err := f(x); err != nil {
  13737. return err
  13738. }
  13739. if x.NextPageToken == "" {
  13740. return nil
  13741. }
  13742. c.PageToken(x.NextPageToken)
  13743. }
  13744. }
  13745. // method id "compute.autoscalers.patch":
  13746. type AutoscalersPatchCall struct {
  13747. s *Service
  13748. project string
  13749. zone string
  13750. autoscaler *Autoscaler
  13751. urlParams_ gensupport.URLParams
  13752. ctx_ context.Context
  13753. header_ http.Header
  13754. }
  13755. // Patch: Updates an autoscaler in the specified project using the data
  13756. // included in the request. This method supports patch semantics.
  13757. func (r *AutoscalersService) Patch(project string, zone string, autoscaler *Autoscaler) *AutoscalersPatchCall {
  13758. c := &AutoscalersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13759. c.project = project
  13760. c.zone = zone
  13761. c.autoscaler = autoscaler
  13762. return c
  13763. }
  13764. // Autoscaler sets the optional parameter "autoscaler": Name of the
  13765. // autoscaler to patch.
  13766. func (c *AutoscalersPatchCall) Autoscaler(autoscaler string) *AutoscalersPatchCall {
  13767. c.urlParams_.Set("autoscaler", autoscaler)
  13768. return c
  13769. }
  13770. // Fields allows partial responses to be retrieved. See
  13771. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13772. // for more information.
  13773. func (c *AutoscalersPatchCall) Fields(s ...googleapi.Field) *AutoscalersPatchCall {
  13774. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13775. return c
  13776. }
  13777. // Context sets the context to be used in this call's Do method. Any
  13778. // pending HTTP request will be aborted if the provided context is
  13779. // canceled.
  13780. func (c *AutoscalersPatchCall) Context(ctx context.Context) *AutoscalersPatchCall {
  13781. c.ctx_ = ctx
  13782. return c
  13783. }
  13784. // Header returns an http.Header that can be modified by the caller to
  13785. // add HTTP headers to the request.
  13786. func (c *AutoscalersPatchCall) Header() http.Header {
  13787. if c.header_ == nil {
  13788. c.header_ = make(http.Header)
  13789. }
  13790. return c.header_
  13791. }
  13792. func (c *AutoscalersPatchCall) doRequest(alt string) (*http.Response, error) {
  13793. reqHeaders := make(http.Header)
  13794. for k, v := range c.header_ {
  13795. reqHeaders[k] = v
  13796. }
  13797. reqHeaders.Set("User-Agent", c.s.userAgent())
  13798. var body io.Reader = nil
  13799. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  13800. if err != nil {
  13801. return nil, err
  13802. }
  13803. reqHeaders.Set("Content-Type", "application/json")
  13804. c.urlParams_.Set("alt", alt)
  13805. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  13806. urls += "?" + c.urlParams_.Encode()
  13807. req, _ := http.NewRequest("PATCH", urls, body)
  13808. req.Header = reqHeaders
  13809. googleapi.Expand(req.URL, map[string]string{
  13810. "project": c.project,
  13811. "zone": c.zone,
  13812. })
  13813. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13814. }
  13815. // Do executes the "compute.autoscalers.patch" call.
  13816. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  13817. // status code is an error. Response headers are in either
  13818. // *Operation.ServerResponse.Header or (if a response was returned at
  13819. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  13820. // to check whether the returned error was because
  13821. // http.StatusNotModified was returned.
  13822. func (c *AutoscalersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  13823. gensupport.SetOptions(c.urlParams_, opts...)
  13824. res, err := c.doRequest("json")
  13825. if res != nil && res.StatusCode == http.StatusNotModified {
  13826. if res.Body != nil {
  13827. res.Body.Close()
  13828. }
  13829. return nil, &googleapi.Error{
  13830. Code: res.StatusCode,
  13831. Header: res.Header,
  13832. }
  13833. }
  13834. if err != nil {
  13835. return nil, err
  13836. }
  13837. defer googleapi.CloseBody(res)
  13838. if err := googleapi.CheckResponse(res); err != nil {
  13839. return nil, err
  13840. }
  13841. ret := &Operation{
  13842. ServerResponse: googleapi.ServerResponse{
  13843. Header: res.Header,
  13844. HTTPStatusCode: res.StatusCode,
  13845. },
  13846. }
  13847. target := &ret
  13848. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  13849. return nil, err
  13850. }
  13851. return ret, nil
  13852. // {
  13853. // "description": "Updates an autoscaler in the specified project using the data included in the request. This method supports patch semantics.",
  13854. // "httpMethod": "PATCH",
  13855. // "id": "compute.autoscalers.patch",
  13856. // "parameterOrder": [
  13857. // "project",
  13858. // "zone"
  13859. // ],
  13860. // "parameters": {
  13861. // "autoscaler": {
  13862. // "description": "Name of the autoscaler to patch.",
  13863. // "location": "query",
  13864. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  13865. // "type": "string"
  13866. // },
  13867. // "project": {
  13868. // "description": "Project ID for this request.",
  13869. // "location": "path",
  13870. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  13871. // "required": true,
  13872. // "type": "string"
  13873. // },
  13874. // "zone": {
  13875. // "description": "Name of the zone for this request.",
  13876. // "location": "path",
  13877. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  13878. // "required": true,
  13879. // "type": "string"
  13880. // }
  13881. // },
  13882. // "path": "{project}/zones/{zone}/autoscalers",
  13883. // "request": {
  13884. // "$ref": "Autoscaler"
  13885. // },
  13886. // "response": {
  13887. // "$ref": "Operation"
  13888. // },
  13889. // "scopes": [
  13890. // "https://www.googleapis.com/auth/cloud-platform",
  13891. // "https://www.googleapis.com/auth/compute",
  13892. // "https://www.googleapis.com/auth/compute.readonly"
  13893. // ]
  13894. // }
  13895. }
  13896. // method id "compute.autoscalers.update":
  13897. type AutoscalersUpdateCall struct {
  13898. s *Service
  13899. project string
  13900. zone string
  13901. autoscaler *Autoscaler
  13902. urlParams_ gensupport.URLParams
  13903. ctx_ context.Context
  13904. header_ http.Header
  13905. }
  13906. // Update: Updates an autoscaler in the specified project using the data
  13907. // included in the request.
  13908. func (r *AutoscalersService) Update(project string, zone string, autoscaler *Autoscaler) *AutoscalersUpdateCall {
  13909. c := &AutoscalersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13910. c.project = project
  13911. c.zone = zone
  13912. c.autoscaler = autoscaler
  13913. return c
  13914. }
  13915. // Autoscaler sets the optional parameter "autoscaler": Name of the
  13916. // autoscaler to update.
  13917. func (c *AutoscalersUpdateCall) Autoscaler(autoscaler string) *AutoscalersUpdateCall {
  13918. c.urlParams_.Set("autoscaler", autoscaler)
  13919. return c
  13920. }
  13921. // Fields allows partial responses to be retrieved. See
  13922. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13923. // for more information.
  13924. func (c *AutoscalersUpdateCall) Fields(s ...googleapi.Field) *AutoscalersUpdateCall {
  13925. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13926. return c
  13927. }
  13928. // Context sets the context to be used in this call's Do method. Any
  13929. // pending HTTP request will be aborted if the provided context is
  13930. // canceled.
  13931. func (c *AutoscalersUpdateCall) Context(ctx context.Context) *AutoscalersUpdateCall {
  13932. c.ctx_ = ctx
  13933. return c
  13934. }
  13935. // Header returns an http.Header that can be modified by the caller to
  13936. // add HTTP headers to the request.
  13937. func (c *AutoscalersUpdateCall) Header() http.Header {
  13938. if c.header_ == nil {
  13939. c.header_ = make(http.Header)
  13940. }
  13941. return c.header_
  13942. }
  13943. func (c *AutoscalersUpdateCall) doRequest(alt string) (*http.Response, error) {
  13944. reqHeaders := make(http.Header)
  13945. for k, v := range c.header_ {
  13946. reqHeaders[k] = v
  13947. }
  13948. reqHeaders.Set("User-Agent", c.s.userAgent())
  13949. var body io.Reader = nil
  13950. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  13951. if err != nil {
  13952. return nil, err
  13953. }
  13954. reqHeaders.Set("Content-Type", "application/json")
  13955. c.urlParams_.Set("alt", alt)
  13956. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  13957. urls += "?" + c.urlParams_.Encode()
  13958. req, _ := http.NewRequest("PUT", urls, body)
  13959. req.Header = reqHeaders
  13960. googleapi.Expand(req.URL, map[string]string{
  13961. "project": c.project,
  13962. "zone": c.zone,
  13963. })
  13964. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13965. }
  13966. // Do executes the "compute.autoscalers.update" call.
  13967. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  13968. // status code is an error. Response headers are in either
  13969. // *Operation.ServerResponse.Header or (if a response was returned at
  13970. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  13971. // to check whether the returned error was because
  13972. // http.StatusNotModified was returned.
  13973. func (c *AutoscalersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  13974. gensupport.SetOptions(c.urlParams_, opts...)
  13975. res, err := c.doRequest("json")
  13976. if res != nil && res.StatusCode == http.StatusNotModified {
  13977. if res.Body != nil {
  13978. res.Body.Close()
  13979. }
  13980. return nil, &googleapi.Error{
  13981. Code: res.StatusCode,
  13982. Header: res.Header,
  13983. }
  13984. }
  13985. if err != nil {
  13986. return nil, err
  13987. }
  13988. defer googleapi.CloseBody(res)
  13989. if err := googleapi.CheckResponse(res); err != nil {
  13990. return nil, err
  13991. }
  13992. ret := &Operation{
  13993. ServerResponse: googleapi.ServerResponse{
  13994. Header: res.Header,
  13995. HTTPStatusCode: res.StatusCode,
  13996. },
  13997. }
  13998. target := &ret
  13999. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  14000. return nil, err
  14001. }
  14002. return ret, nil
  14003. // {
  14004. // "description": "Updates an autoscaler in the specified project using the data included in the request.",
  14005. // "httpMethod": "PUT",
  14006. // "id": "compute.autoscalers.update",
  14007. // "parameterOrder": [
  14008. // "project",
  14009. // "zone"
  14010. // ],
  14011. // "parameters": {
  14012. // "autoscaler": {
  14013. // "description": "Name of the autoscaler to update.",
  14014. // "location": "query",
  14015. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  14016. // "type": "string"
  14017. // },
  14018. // "project": {
  14019. // "description": "Project ID for this request.",
  14020. // "location": "path",
  14021. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  14022. // "required": true,
  14023. // "type": "string"
  14024. // },
  14025. // "zone": {
  14026. // "description": "Name of the zone for this request.",
  14027. // "location": "path",
  14028. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  14029. // "required": true,
  14030. // "type": "string"
  14031. // }
  14032. // },
  14033. // "path": "{project}/zones/{zone}/autoscalers",
  14034. // "request": {
  14035. // "$ref": "Autoscaler"
  14036. // },
  14037. // "response": {
  14038. // "$ref": "Operation"
  14039. // },
  14040. // "scopes": [
  14041. // "https://www.googleapis.com/auth/cloud-platform",
  14042. // "https://www.googleapis.com/auth/compute"
  14043. // ]
  14044. // }
  14045. }
  14046. // method id "compute.backendBuckets.delete":
  14047. type BackendBucketsDeleteCall struct {
  14048. s *Service
  14049. project string
  14050. backendBucket string
  14051. urlParams_ gensupport.URLParams
  14052. ctx_ context.Context
  14053. header_ http.Header
  14054. }
  14055. // Delete: Deletes the specified BackendBucket resource.
  14056. func (r *BackendBucketsService) Delete(project string, backendBucket string) *BackendBucketsDeleteCall {
  14057. c := &BackendBucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14058. c.project = project
  14059. c.backendBucket = backendBucket
  14060. return c
  14061. }
  14062. // Fields allows partial responses to be retrieved. See
  14063. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14064. // for more information.
  14065. func (c *BackendBucketsDeleteCall) Fields(s ...googleapi.Field) *BackendBucketsDeleteCall {
  14066. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14067. return c
  14068. }
  14069. // Context sets the context to be used in this call's Do method. Any
  14070. // pending HTTP request will be aborted if the provided context is
  14071. // canceled.
  14072. func (c *BackendBucketsDeleteCall) Context(ctx context.Context) *BackendBucketsDeleteCall {
  14073. c.ctx_ = ctx
  14074. return c
  14075. }
  14076. // Header returns an http.Header that can be modified by the caller to
  14077. // add HTTP headers to the request.
  14078. func (c *BackendBucketsDeleteCall) Header() http.Header {
  14079. if c.header_ == nil {
  14080. c.header_ = make(http.Header)
  14081. }
  14082. return c.header_
  14083. }
  14084. func (c *BackendBucketsDeleteCall) doRequest(alt string) (*http.Response, error) {
  14085. reqHeaders := make(http.Header)
  14086. for k, v := range c.header_ {
  14087. reqHeaders[k] = v
  14088. }
  14089. reqHeaders.Set("User-Agent", c.s.userAgent())
  14090. var body io.Reader = nil
  14091. c.urlParams_.Set("alt", alt)
  14092. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}")
  14093. urls += "?" + c.urlParams_.Encode()
  14094. req, _ := http.NewRequest("DELETE", urls, body)
  14095. req.Header = reqHeaders
  14096. googleapi.Expand(req.URL, map[string]string{
  14097. "project": c.project,
  14098. "backendBucket": c.backendBucket,
  14099. })
  14100. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14101. }
  14102. // Do executes the "compute.backendBuckets.delete" call.
  14103. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  14104. // status code is an error. Response headers are in either
  14105. // *Operation.ServerResponse.Header or (if a response was returned at
  14106. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  14107. // to check whether the returned error was because
  14108. // http.StatusNotModified was returned.
  14109. func (c *BackendBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  14110. gensupport.SetOptions(c.urlParams_, opts...)
  14111. res, err := c.doRequest("json")
  14112. if res != nil && res.StatusCode == http.StatusNotModified {
  14113. if res.Body != nil {
  14114. res.Body.Close()
  14115. }
  14116. return nil, &googleapi.Error{
  14117. Code: res.StatusCode,
  14118. Header: res.Header,
  14119. }
  14120. }
  14121. if err != nil {
  14122. return nil, err
  14123. }
  14124. defer googleapi.CloseBody(res)
  14125. if err := googleapi.CheckResponse(res); err != nil {
  14126. return nil, err
  14127. }
  14128. ret := &Operation{
  14129. ServerResponse: googleapi.ServerResponse{
  14130. Header: res.Header,
  14131. HTTPStatusCode: res.StatusCode,
  14132. },
  14133. }
  14134. target := &ret
  14135. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  14136. return nil, err
  14137. }
  14138. return ret, nil
  14139. // {
  14140. // "description": "Deletes the specified BackendBucket resource.",
  14141. // "httpMethod": "DELETE",
  14142. // "id": "compute.backendBuckets.delete",
  14143. // "parameterOrder": [
  14144. // "project",
  14145. // "backendBucket"
  14146. // ],
  14147. // "parameters": {
  14148. // "backendBucket": {
  14149. // "description": "Name of the BackendBucket resource to delete.",
  14150. // "location": "path",
  14151. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  14152. // "required": true,
  14153. // "type": "string"
  14154. // },
  14155. // "project": {
  14156. // "description": "Project ID for this request.",
  14157. // "location": "path",
  14158. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  14159. // "required": true,
  14160. // "type": "string"
  14161. // }
  14162. // },
  14163. // "path": "{project}/global/backendBuckets/{backendBucket}",
  14164. // "response": {
  14165. // "$ref": "Operation"
  14166. // },
  14167. // "scopes": [
  14168. // "https://www.googleapis.com/auth/cloud-platform",
  14169. // "https://www.googleapis.com/auth/compute"
  14170. // ]
  14171. // }
  14172. }
  14173. // method id "compute.backendBuckets.get":
  14174. type BackendBucketsGetCall struct {
  14175. s *Service
  14176. project string
  14177. backendBucket string
  14178. urlParams_ gensupport.URLParams
  14179. ifNoneMatch_ string
  14180. ctx_ context.Context
  14181. header_ http.Header
  14182. }
  14183. // Get: Returns the specified BackendBucket resource. Get a list of
  14184. // available backend buckets by making a list() request.
  14185. func (r *BackendBucketsService) Get(project string, backendBucket string) *BackendBucketsGetCall {
  14186. c := &BackendBucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14187. c.project = project
  14188. c.backendBucket = backendBucket
  14189. return c
  14190. }
  14191. // Fields allows partial responses to be retrieved. See
  14192. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14193. // for more information.
  14194. func (c *BackendBucketsGetCall) Fields(s ...googleapi.Field) *BackendBucketsGetCall {
  14195. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14196. return c
  14197. }
  14198. // IfNoneMatch sets the optional parameter which makes the operation
  14199. // fail if the object's ETag matches the given value. This is useful for
  14200. // getting updates only after the object has changed since the last
  14201. // request. Use googleapi.IsNotModified to check whether the response
  14202. // error from Do is the result of In-None-Match.
  14203. func (c *BackendBucketsGetCall) IfNoneMatch(entityTag string) *BackendBucketsGetCall {
  14204. c.ifNoneMatch_ = entityTag
  14205. return c
  14206. }
  14207. // Context sets the context to be used in this call's Do method. Any
  14208. // pending HTTP request will be aborted if the provided context is
  14209. // canceled.
  14210. func (c *BackendBucketsGetCall) Context(ctx context.Context) *BackendBucketsGetCall {
  14211. c.ctx_ = ctx
  14212. return c
  14213. }
  14214. // Header returns an http.Header that can be modified by the caller to
  14215. // add HTTP headers to the request.
  14216. func (c *BackendBucketsGetCall) Header() http.Header {
  14217. if c.header_ == nil {
  14218. c.header_ = make(http.Header)
  14219. }
  14220. return c.header_
  14221. }
  14222. func (c *BackendBucketsGetCall) doRequest(alt string) (*http.Response, error) {
  14223. reqHeaders := make(http.Header)
  14224. for k, v := range c.header_ {
  14225. reqHeaders[k] = v
  14226. }
  14227. reqHeaders.Set("User-Agent", c.s.userAgent())
  14228. if c.ifNoneMatch_ != "" {
  14229. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  14230. }
  14231. var body io.Reader = nil
  14232. c.urlParams_.Set("alt", alt)
  14233. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}")
  14234. urls += "?" + c.urlParams_.Encode()
  14235. req, _ := http.NewRequest("GET", urls, body)
  14236. req.Header = reqHeaders
  14237. googleapi.Expand(req.URL, map[string]string{
  14238. "project": c.project,
  14239. "backendBucket": c.backendBucket,
  14240. })
  14241. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14242. }
  14243. // Do executes the "compute.backendBuckets.get" call.
  14244. // Exactly one of *BackendBucket or error will be non-nil. Any non-2xx
  14245. // status code is an error. Response headers are in either
  14246. // *BackendBucket.ServerResponse.Header or (if a response was returned
  14247. // at all) in error.(*googleapi.Error).Header. Use
  14248. // googleapi.IsNotModified to check whether the returned error was
  14249. // because http.StatusNotModified was returned.
  14250. func (c *BackendBucketsGetCall) Do(opts ...googleapi.CallOption) (*BackendBucket, error) {
  14251. gensupport.SetOptions(c.urlParams_, opts...)
  14252. res, err := c.doRequest("json")
  14253. if res != nil && res.StatusCode == http.StatusNotModified {
  14254. if res.Body != nil {
  14255. res.Body.Close()
  14256. }
  14257. return nil, &googleapi.Error{
  14258. Code: res.StatusCode,
  14259. Header: res.Header,
  14260. }
  14261. }
  14262. if err != nil {
  14263. return nil, err
  14264. }
  14265. defer googleapi.CloseBody(res)
  14266. if err := googleapi.CheckResponse(res); err != nil {
  14267. return nil, err
  14268. }
  14269. ret := &BackendBucket{
  14270. ServerResponse: googleapi.ServerResponse{
  14271. Header: res.Header,
  14272. HTTPStatusCode: res.StatusCode,
  14273. },
  14274. }
  14275. target := &ret
  14276. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  14277. return nil, err
  14278. }
  14279. return ret, nil
  14280. // {
  14281. // "description": "Returns the specified BackendBucket resource. Get a list of available backend buckets by making a list() request.",
  14282. // "httpMethod": "GET",
  14283. // "id": "compute.backendBuckets.get",
  14284. // "parameterOrder": [
  14285. // "project",
  14286. // "backendBucket"
  14287. // ],
  14288. // "parameters": {
  14289. // "backendBucket": {
  14290. // "description": "Name of the BackendBucket resource to return.",
  14291. // "location": "path",
  14292. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  14293. // "required": true,
  14294. // "type": "string"
  14295. // },
  14296. // "project": {
  14297. // "description": "Project ID for this request.",
  14298. // "location": "path",
  14299. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  14300. // "required": true,
  14301. // "type": "string"
  14302. // }
  14303. // },
  14304. // "path": "{project}/global/backendBuckets/{backendBucket}",
  14305. // "response": {
  14306. // "$ref": "BackendBucket"
  14307. // },
  14308. // "scopes": [
  14309. // "https://www.googleapis.com/auth/cloud-platform",
  14310. // "https://www.googleapis.com/auth/compute",
  14311. // "https://www.googleapis.com/auth/compute.readonly"
  14312. // ]
  14313. // }
  14314. }
  14315. // method id "compute.backendBuckets.insert":
  14316. type BackendBucketsInsertCall struct {
  14317. s *Service
  14318. project string
  14319. backendbucket *BackendBucket
  14320. urlParams_ gensupport.URLParams
  14321. ctx_ context.Context
  14322. header_ http.Header
  14323. }
  14324. // Insert: Creates a BackendBucket resource in the specified project
  14325. // using the data included in the request.
  14326. func (r *BackendBucketsService) Insert(project string, backendbucket *BackendBucket) *BackendBucketsInsertCall {
  14327. c := &BackendBucketsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14328. c.project = project
  14329. c.backendbucket = backendbucket
  14330. return c
  14331. }
  14332. // Fields allows partial responses to be retrieved. See
  14333. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14334. // for more information.
  14335. func (c *BackendBucketsInsertCall) Fields(s ...googleapi.Field) *BackendBucketsInsertCall {
  14336. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14337. return c
  14338. }
  14339. // Context sets the context to be used in this call's Do method. Any
  14340. // pending HTTP request will be aborted if the provided context is
  14341. // canceled.
  14342. func (c *BackendBucketsInsertCall) Context(ctx context.Context) *BackendBucketsInsertCall {
  14343. c.ctx_ = ctx
  14344. return c
  14345. }
  14346. // Header returns an http.Header that can be modified by the caller to
  14347. // add HTTP headers to the request.
  14348. func (c *BackendBucketsInsertCall) Header() http.Header {
  14349. if c.header_ == nil {
  14350. c.header_ = make(http.Header)
  14351. }
  14352. return c.header_
  14353. }
  14354. func (c *BackendBucketsInsertCall) doRequest(alt string) (*http.Response, error) {
  14355. reqHeaders := make(http.Header)
  14356. for k, v := range c.header_ {
  14357. reqHeaders[k] = v
  14358. }
  14359. reqHeaders.Set("User-Agent", c.s.userAgent())
  14360. var body io.Reader = nil
  14361. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket)
  14362. if err != nil {
  14363. return nil, err
  14364. }
  14365. reqHeaders.Set("Content-Type", "application/json")
  14366. c.urlParams_.Set("alt", alt)
  14367. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets")
  14368. urls += "?" + c.urlParams_.Encode()
  14369. req, _ := http.NewRequest("POST", urls, body)
  14370. req.Header = reqHeaders
  14371. googleapi.Expand(req.URL, map[string]string{
  14372. "project": c.project,
  14373. })
  14374. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14375. }
  14376. // Do executes the "compute.backendBuckets.insert" call.
  14377. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  14378. // status code is an error. Response headers are in either
  14379. // *Operation.ServerResponse.Header or (if a response was returned at
  14380. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  14381. // to check whether the returned error was because
  14382. // http.StatusNotModified was returned.
  14383. func (c *BackendBucketsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  14384. gensupport.SetOptions(c.urlParams_, opts...)
  14385. res, err := c.doRequest("json")
  14386. if res != nil && res.StatusCode == http.StatusNotModified {
  14387. if res.Body != nil {
  14388. res.Body.Close()
  14389. }
  14390. return nil, &googleapi.Error{
  14391. Code: res.StatusCode,
  14392. Header: res.Header,
  14393. }
  14394. }
  14395. if err != nil {
  14396. return nil, err
  14397. }
  14398. defer googleapi.CloseBody(res)
  14399. if err := googleapi.CheckResponse(res); err != nil {
  14400. return nil, err
  14401. }
  14402. ret := &Operation{
  14403. ServerResponse: googleapi.ServerResponse{
  14404. Header: res.Header,
  14405. HTTPStatusCode: res.StatusCode,
  14406. },
  14407. }
  14408. target := &ret
  14409. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  14410. return nil, err
  14411. }
  14412. return ret, nil
  14413. // {
  14414. // "description": "Creates a BackendBucket resource in the specified project using the data included in the request.",
  14415. // "httpMethod": "POST",
  14416. // "id": "compute.backendBuckets.insert",
  14417. // "parameterOrder": [
  14418. // "project"
  14419. // ],
  14420. // "parameters": {
  14421. // "project": {
  14422. // "description": "Project ID for this request.",
  14423. // "location": "path",
  14424. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  14425. // "required": true,
  14426. // "type": "string"
  14427. // }
  14428. // },
  14429. // "path": "{project}/global/backendBuckets",
  14430. // "request": {
  14431. // "$ref": "BackendBucket"
  14432. // },
  14433. // "response": {
  14434. // "$ref": "Operation"
  14435. // },
  14436. // "scopes": [
  14437. // "https://www.googleapis.com/auth/cloud-platform",
  14438. // "https://www.googleapis.com/auth/compute"
  14439. // ]
  14440. // }
  14441. }
  14442. // method id "compute.backendBuckets.list":
  14443. type BackendBucketsListCall struct {
  14444. s *Service
  14445. project string
  14446. urlParams_ gensupport.URLParams
  14447. ifNoneMatch_ string
  14448. ctx_ context.Context
  14449. header_ http.Header
  14450. }
  14451. // List: Retrieves the list of BackendBucket resources available to the
  14452. // specified project.
  14453. func (r *BackendBucketsService) List(project string) *BackendBucketsListCall {
  14454. c := &BackendBucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14455. c.project = project
  14456. return c
  14457. }
  14458. // Filter sets the optional parameter "filter": Sets a filter
  14459. // {expression} for filtering listed resources. Your {expression} must
  14460. // be in the format: field_name comparison_string literal_string.
  14461. //
  14462. // The field_name is the name of the field you want to compare. Only
  14463. // atomic field types are supported (string, number, boolean). The
  14464. // comparison_string must be either eq (equals) or ne (not equals). The
  14465. // literal_string is the string value to filter to. The literal value
  14466. // must be valid for the type of field you are filtering by (string,
  14467. // number, boolean). For string fields, the literal value is interpreted
  14468. // as a regular expression using RE2 syntax. The literal value must
  14469. // match the entire field.
  14470. //
  14471. // For example, to filter for instances that do not have a name of
  14472. // example-instance, you would use name ne example-instance.
  14473. //
  14474. // You can filter on nested fields. For example, you could filter on
  14475. // instances that have set the scheduling.automaticRestart field to
  14476. // true. Use filtering on nested fields to take advantage of labels to
  14477. // organize and search for results based on label values.
  14478. //
  14479. // To filter on multiple expressions, provide each separate expression
  14480. // within parentheses. For example, (scheduling.automaticRestart eq
  14481. // true) (zone eq us-central1-f). Multiple expressions are treated as
  14482. // AND expressions, meaning that resources must match all expressions to
  14483. // pass the filters.
  14484. func (c *BackendBucketsListCall) Filter(filter string) *BackendBucketsListCall {
  14485. c.urlParams_.Set("filter", filter)
  14486. return c
  14487. }
  14488. // MaxResults sets the optional parameter "maxResults": The maximum
  14489. // number of results per page that should be returned. If the number of
  14490. // available results is larger than maxResults, Compute Engine returns a
  14491. // nextPageToken that can be used to get the next page of results in
  14492. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  14493. // (Default: 500)
  14494. func (c *BackendBucketsListCall) MaxResults(maxResults int64) *BackendBucketsListCall {
  14495. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  14496. return c
  14497. }
  14498. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  14499. // a certain order. By default, results are returned in alphanumerical
  14500. // order based on the resource name.
  14501. //
  14502. // You can also sort results in descending order based on the creation
  14503. // timestamp using orderBy="creationTimestamp desc". This sorts results
  14504. // based on the creationTimestamp field in reverse chronological order
  14505. // (newest result first). Use this to sort resources like operations so
  14506. // that the newest operation is returned first.
  14507. //
  14508. // Currently, only sorting by name or creationTimestamp desc is
  14509. // supported.
  14510. func (c *BackendBucketsListCall) OrderBy(orderBy string) *BackendBucketsListCall {
  14511. c.urlParams_.Set("orderBy", orderBy)
  14512. return c
  14513. }
  14514. // PageToken sets the optional parameter "pageToken": Specifies a page
  14515. // token to use. Set pageToken to the nextPageToken returned by a
  14516. // previous list request to get the next page of results.
  14517. func (c *BackendBucketsListCall) PageToken(pageToken string) *BackendBucketsListCall {
  14518. c.urlParams_.Set("pageToken", pageToken)
  14519. return c
  14520. }
  14521. // Fields allows partial responses to be retrieved. See
  14522. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14523. // for more information.
  14524. func (c *BackendBucketsListCall) Fields(s ...googleapi.Field) *BackendBucketsListCall {
  14525. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14526. return c
  14527. }
  14528. // IfNoneMatch sets the optional parameter which makes the operation
  14529. // fail if the object's ETag matches the given value. This is useful for
  14530. // getting updates only after the object has changed since the last
  14531. // request. Use googleapi.IsNotModified to check whether the response
  14532. // error from Do is the result of In-None-Match.
  14533. func (c *BackendBucketsListCall) IfNoneMatch(entityTag string) *BackendBucketsListCall {
  14534. c.ifNoneMatch_ = entityTag
  14535. return c
  14536. }
  14537. // Context sets the context to be used in this call's Do method. Any
  14538. // pending HTTP request will be aborted if the provided context is
  14539. // canceled.
  14540. func (c *BackendBucketsListCall) Context(ctx context.Context) *BackendBucketsListCall {
  14541. c.ctx_ = ctx
  14542. return c
  14543. }
  14544. // Header returns an http.Header that can be modified by the caller to
  14545. // add HTTP headers to the request.
  14546. func (c *BackendBucketsListCall) Header() http.Header {
  14547. if c.header_ == nil {
  14548. c.header_ = make(http.Header)
  14549. }
  14550. return c.header_
  14551. }
  14552. func (c *BackendBucketsListCall) doRequest(alt string) (*http.Response, error) {
  14553. reqHeaders := make(http.Header)
  14554. for k, v := range c.header_ {
  14555. reqHeaders[k] = v
  14556. }
  14557. reqHeaders.Set("User-Agent", c.s.userAgent())
  14558. if c.ifNoneMatch_ != "" {
  14559. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  14560. }
  14561. var body io.Reader = nil
  14562. c.urlParams_.Set("alt", alt)
  14563. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets")
  14564. urls += "?" + c.urlParams_.Encode()
  14565. req, _ := http.NewRequest("GET", urls, body)
  14566. req.Header = reqHeaders
  14567. googleapi.Expand(req.URL, map[string]string{
  14568. "project": c.project,
  14569. })
  14570. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14571. }
  14572. // Do executes the "compute.backendBuckets.list" call.
  14573. // Exactly one of *BackendBucketList or error will be non-nil. Any
  14574. // non-2xx status code is an error. Response headers are in either
  14575. // *BackendBucketList.ServerResponse.Header or (if a response was
  14576. // returned at all) in error.(*googleapi.Error).Header. Use
  14577. // googleapi.IsNotModified to check whether the returned error was
  14578. // because http.StatusNotModified was returned.
  14579. func (c *BackendBucketsListCall) Do(opts ...googleapi.CallOption) (*BackendBucketList, error) {
  14580. gensupport.SetOptions(c.urlParams_, opts...)
  14581. res, err := c.doRequest("json")
  14582. if res != nil && res.StatusCode == http.StatusNotModified {
  14583. if res.Body != nil {
  14584. res.Body.Close()
  14585. }
  14586. return nil, &googleapi.Error{
  14587. Code: res.StatusCode,
  14588. Header: res.Header,
  14589. }
  14590. }
  14591. if err != nil {
  14592. return nil, err
  14593. }
  14594. defer googleapi.CloseBody(res)
  14595. if err := googleapi.CheckResponse(res); err != nil {
  14596. return nil, err
  14597. }
  14598. ret := &BackendBucketList{
  14599. ServerResponse: googleapi.ServerResponse{
  14600. Header: res.Header,
  14601. HTTPStatusCode: res.StatusCode,
  14602. },
  14603. }
  14604. target := &ret
  14605. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  14606. return nil, err
  14607. }
  14608. return ret, nil
  14609. // {
  14610. // "description": "Retrieves the list of BackendBucket resources available to the specified project.",
  14611. // "httpMethod": "GET",
  14612. // "id": "compute.backendBuckets.list",
  14613. // "parameterOrder": [
  14614. // "project"
  14615. // ],
  14616. // "parameters": {
  14617. // "filter": {
  14618. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  14619. // "location": "query",
  14620. // "type": "string"
  14621. // },
  14622. // "maxResults": {
  14623. // "default": "500",
  14624. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  14625. // "format": "uint32",
  14626. // "location": "query",
  14627. // "minimum": "0",
  14628. // "type": "integer"
  14629. // },
  14630. // "orderBy": {
  14631. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  14632. // "location": "query",
  14633. // "type": "string"
  14634. // },
  14635. // "pageToken": {
  14636. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  14637. // "location": "query",
  14638. // "type": "string"
  14639. // },
  14640. // "project": {
  14641. // "description": "Project ID for this request.",
  14642. // "location": "path",
  14643. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  14644. // "required": true,
  14645. // "type": "string"
  14646. // }
  14647. // },
  14648. // "path": "{project}/global/backendBuckets",
  14649. // "response": {
  14650. // "$ref": "BackendBucketList"
  14651. // },
  14652. // "scopes": [
  14653. // "https://www.googleapis.com/auth/cloud-platform",
  14654. // "https://www.googleapis.com/auth/compute",
  14655. // "https://www.googleapis.com/auth/compute.readonly"
  14656. // ]
  14657. // }
  14658. }
  14659. // Pages invokes f for each page of results.
  14660. // A non-nil error returned from f will halt the iteration.
  14661. // The provided context supersedes any context provided to the Context method.
  14662. func (c *BackendBucketsListCall) Pages(ctx context.Context, f func(*BackendBucketList) error) error {
  14663. c.ctx_ = ctx
  14664. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  14665. for {
  14666. x, err := c.Do()
  14667. if err != nil {
  14668. return err
  14669. }
  14670. if err := f(x); err != nil {
  14671. return err
  14672. }
  14673. if x.NextPageToken == "" {
  14674. return nil
  14675. }
  14676. c.PageToken(x.NextPageToken)
  14677. }
  14678. }
  14679. // method id "compute.backendBuckets.patch":
  14680. type BackendBucketsPatchCall struct {
  14681. s *Service
  14682. project string
  14683. backendBucket string
  14684. backendbucket *BackendBucket
  14685. urlParams_ gensupport.URLParams
  14686. ctx_ context.Context
  14687. header_ http.Header
  14688. }
  14689. // Patch: Updates the specified BackendBucket resource with the data
  14690. // included in the request. This method supports patch semantics.
  14691. func (r *BackendBucketsService) Patch(project string, backendBucket string, backendbucket *BackendBucket) *BackendBucketsPatchCall {
  14692. c := &BackendBucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14693. c.project = project
  14694. c.backendBucket = backendBucket
  14695. c.backendbucket = backendbucket
  14696. return c
  14697. }
  14698. // Fields allows partial responses to be retrieved. See
  14699. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14700. // for more information.
  14701. func (c *BackendBucketsPatchCall) Fields(s ...googleapi.Field) *BackendBucketsPatchCall {
  14702. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14703. return c
  14704. }
  14705. // Context sets the context to be used in this call's Do method. Any
  14706. // pending HTTP request will be aborted if the provided context is
  14707. // canceled.
  14708. func (c *BackendBucketsPatchCall) Context(ctx context.Context) *BackendBucketsPatchCall {
  14709. c.ctx_ = ctx
  14710. return c
  14711. }
  14712. // Header returns an http.Header that can be modified by the caller to
  14713. // add HTTP headers to the request.
  14714. func (c *BackendBucketsPatchCall) Header() http.Header {
  14715. if c.header_ == nil {
  14716. c.header_ = make(http.Header)
  14717. }
  14718. return c.header_
  14719. }
  14720. func (c *BackendBucketsPatchCall) doRequest(alt string) (*http.Response, error) {
  14721. reqHeaders := make(http.Header)
  14722. for k, v := range c.header_ {
  14723. reqHeaders[k] = v
  14724. }
  14725. reqHeaders.Set("User-Agent", c.s.userAgent())
  14726. var body io.Reader = nil
  14727. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket)
  14728. if err != nil {
  14729. return nil, err
  14730. }
  14731. reqHeaders.Set("Content-Type", "application/json")
  14732. c.urlParams_.Set("alt", alt)
  14733. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}")
  14734. urls += "?" + c.urlParams_.Encode()
  14735. req, _ := http.NewRequest("PATCH", urls, body)
  14736. req.Header = reqHeaders
  14737. googleapi.Expand(req.URL, map[string]string{
  14738. "project": c.project,
  14739. "backendBucket": c.backendBucket,
  14740. })
  14741. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14742. }
  14743. // Do executes the "compute.backendBuckets.patch" call.
  14744. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  14745. // status code is an error. Response headers are in either
  14746. // *Operation.ServerResponse.Header or (if a response was returned at
  14747. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  14748. // to check whether the returned error was because
  14749. // http.StatusNotModified was returned.
  14750. func (c *BackendBucketsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  14751. gensupport.SetOptions(c.urlParams_, opts...)
  14752. res, err := c.doRequest("json")
  14753. if res != nil && res.StatusCode == http.StatusNotModified {
  14754. if res.Body != nil {
  14755. res.Body.Close()
  14756. }
  14757. return nil, &googleapi.Error{
  14758. Code: res.StatusCode,
  14759. Header: res.Header,
  14760. }
  14761. }
  14762. if err != nil {
  14763. return nil, err
  14764. }
  14765. defer googleapi.CloseBody(res)
  14766. if err := googleapi.CheckResponse(res); err != nil {
  14767. return nil, err
  14768. }
  14769. ret := &Operation{
  14770. ServerResponse: googleapi.ServerResponse{
  14771. Header: res.Header,
  14772. HTTPStatusCode: res.StatusCode,
  14773. },
  14774. }
  14775. target := &ret
  14776. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  14777. return nil, err
  14778. }
  14779. return ret, nil
  14780. // {
  14781. // "description": "Updates the specified BackendBucket resource with the data included in the request. This method supports patch semantics.",
  14782. // "httpMethod": "PATCH",
  14783. // "id": "compute.backendBuckets.patch",
  14784. // "parameterOrder": [
  14785. // "project",
  14786. // "backendBucket"
  14787. // ],
  14788. // "parameters": {
  14789. // "backendBucket": {
  14790. // "description": "Name of the BackendBucket resource to patch.",
  14791. // "location": "path",
  14792. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  14793. // "required": true,
  14794. // "type": "string"
  14795. // },
  14796. // "project": {
  14797. // "description": "Project ID for this request.",
  14798. // "location": "path",
  14799. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  14800. // "required": true,
  14801. // "type": "string"
  14802. // }
  14803. // },
  14804. // "path": "{project}/global/backendBuckets/{backendBucket}",
  14805. // "request": {
  14806. // "$ref": "BackendBucket"
  14807. // },
  14808. // "response": {
  14809. // "$ref": "Operation"
  14810. // },
  14811. // "scopes": [
  14812. // "https://www.googleapis.com/auth/cloud-platform",
  14813. // "https://www.googleapis.com/auth/compute",
  14814. // "https://www.googleapis.com/auth/compute.readonly"
  14815. // ]
  14816. // }
  14817. }
  14818. // method id "compute.backendBuckets.update":
  14819. type BackendBucketsUpdateCall struct {
  14820. s *Service
  14821. project string
  14822. backendBucket string
  14823. backendbucket *BackendBucket
  14824. urlParams_ gensupport.URLParams
  14825. ctx_ context.Context
  14826. header_ http.Header
  14827. }
  14828. // Update: Updates the specified BackendBucket resource with the data
  14829. // included in the request.
  14830. func (r *BackendBucketsService) Update(project string, backendBucket string, backendbucket *BackendBucket) *BackendBucketsUpdateCall {
  14831. c := &BackendBucketsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14832. c.project = project
  14833. c.backendBucket = backendBucket
  14834. c.backendbucket = backendbucket
  14835. return c
  14836. }
  14837. // Fields allows partial responses to be retrieved. See
  14838. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14839. // for more information.
  14840. func (c *BackendBucketsUpdateCall) Fields(s ...googleapi.Field) *BackendBucketsUpdateCall {
  14841. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14842. return c
  14843. }
  14844. // Context sets the context to be used in this call's Do method. Any
  14845. // pending HTTP request will be aborted if the provided context is
  14846. // canceled.
  14847. func (c *BackendBucketsUpdateCall) Context(ctx context.Context) *BackendBucketsUpdateCall {
  14848. c.ctx_ = ctx
  14849. return c
  14850. }
  14851. // Header returns an http.Header that can be modified by the caller to
  14852. // add HTTP headers to the request.
  14853. func (c *BackendBucketsUpdateCall) Header() http.Header {
  14854. if c.header_ == nil {
  14855. c.header_ = make(http.Header)
  14856. }
  14857. return c.header_
  14858. }
  14859. func (c *BackendBucketsUpdateCall) doRequest(alt string) (*http.Response, error) {
  14860. reqHeaders := make(http.Header)
  14861. for k, v := range c.header_ {
  14862. reqHeaders[k] = v
  14863. }
  14864. reqHeaders.Set("User-Agent", c.s.userAgent())
  14865. var body io.Reader = nil
  14866. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket)
  14867. if err != nil {
  14868. return nil, err
  14869. }
  14870. reqHeaders.Set("Content-Type", "application/json")
  14871. c.urlParams_.Set("alt", alt)
  14872. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}")
  14873. urls += "?" + c.urlParams_.Encode()
  14874. req, _ := http.NewRequest("PUT", urls, body)
  14875. req.Header = reqHeaders
  14876. googleapi.Expand(req.URL, map[string]string{
  14877. "project": c.project,
  14878. "backendBucket": c.backendBucket,
  14879. })
  14880. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14881. }
  14882. // Do executes the "compute.backendBuckets.update" call.
  14883. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  14884. // status code is an error. Response headers are in either
  14885. // *Operation.ServerResponse.Header or (if a response was returned at
  14886. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  14887. // to check whether the returned error was because
  14888. // http.StatusNotModified was returned.
  14889. func (c *BackendBucketsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  14890. gensupport.SetOptions(c.urlParams_, opts...)
  14891. res, err := c.doRequest("json")
  14892. if res != nil && res.StatusCode == http.StatusNotModified {
  14893. if res.Body != nil {
  14894. res.Body.Close()
  14895. }
  14896. return nil, &googleapi.Error{
  14897. Code: res.StatusCode,
  14898. Header: res.Header,
  14899. }
  14900. }
  14901. if err != nil {
  14902. return nil, err
  14903. }
  14904. defer googleapi.CloseBody(res)
  14905. if err := googleapi.CheckResponse(res); err != nil {
  14906. return nil, err
  14907. }
  14908. ret := &Operation{
  14909. ServerResponse: googleapi.ServerResponse{
  14910. Header: res.Header,
  14911. HTTPStatusCode: res.StatusCode,
  14912. },
  14913. }
  14914. target := &ret
  14915. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  14916. return nil, err
  14917. }
  14918. return ret, nil
  14919. // {
  14920. // "description": "Updates the specified BackendBucket resource with the data included in the request.",
  14921. // "httpMethod": "PUT",
  14922. // "id": "compute.backendBuckets.update",
  14923. // "parameterOrder": [
  14924. // "project",
  14925. // "backendBucket"
  14926. // ],
  14927. // "parameters": {
  14928. // "backendBucket": {
  14929. // "description": "Name of the BackendBucket resource to update.",
  14930. // "location": "path",
  14931. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  14932. // "required": true,
  14933. // "type": "string"
  14934. // },
  14935. // "project": {
  14936. // "description": "Project ID for this request.",
  14937. // "location": "path",
  14938. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  14939. // "required": true,
  14940. // "type": "string"
  14941. // }
  14942. // },
  14943. // "path": "{project}/global/backendBuckets/{backendBucket}",
  14944. // "request": {
  14945. // "$ref": "BackendBucket"
  14946. // },
  14947. // "response": {
  14948. // "$ref": "Operation"
  14949. // },
  14950. // "scopes": [
  14951. // "https://www.googleapis.com/auth/cloud-platform",
  14952. // "https://www.googleapis.com/auth/compute"
  14953. // ]
  14954. // }
  14955. }
  14956. // method id "compute.backendServices.aggregatedList":
  14957. type BackendServicesAggregatedListCall struct {
  14958. s *Service
  14959. project string
  14960. urlParams_ gensupport.URLParams
  14961. ifNoneMatch_ string
  14962. ctx_ context.Context
  14963. header_ http.Header
  14964. }
  14965. // AggregatedList: Retrieves the list of all BackendService resources,
  14966. // regional and global, available to the specified project.
  14967. func (r *BackendServicesService) AggregatedList(project string) *BackendServicesAggregatedListCall {
  14968. c := &BackendServicesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14969. c.project = project
  14970. return c
  14971. }
  14972. // Filter sets the optional parameter "filter": Sets a filter
  14973. // {expression} for filtering listed resources. Your {expression} must
  14974. // be in the format: field_name comparison_string literal_string.
  14975. //
  14976. // The field_name is the name of the field you want to compare. Only
  14977. // atomic field types are supported (string, number, boolean). The
  14978. // comparison_string must be either eq (equals) or ne (not equals). The
  14979. // literal_string is the string value to filter to. The literal value
  14980. // must be valid for the type of field you are filtering by (string,
  14981. // number, boolean). For string fields, the literal value is interpreted
  14982. // as a regular expression using RE2 syntax. The literal value must
  14983. // match the entire field.
  14984. //
  14985. // For example, to filter for instances that do not have a name of
  14986. // example-instance, you would use name ne example-instance.
  14987. //
  14988. // You can filter on nested fields. For example, you could filter on
  14989. // instances that have set the scheduling.automaticRestart field to
  14990. // true. Use filtering on nested fields to take advantage of labels to
  14991. // organize and search for results based on label values.
  14992. //
  14993. // To filter on multiple expressions, provide each separate expression
  14994. // within parentheses. For example, (scheduling.automaticRestart eq
  14995. // true) (zone eq us-central1-f). Multiple expressions are treated as
  14996. // AND expressions, meaning that resources must match all expressions to
  14997. // pass the filters.
  14998. func (c *BackendServicesAggregatedListCall) Filter(filter string) *BackendServicesAggregatedListCall {
  14999. c.urlParams_.Set("filter", filter)
  15000. return c
  15001. }
  15002. // MaxResults sets the optional parameter "maxResults": The maximum
  15003. // number of results per page that should be returned. If the number of
  15004. // available results is larger than maxResults, Compute Engine returns a
  15005. // nextPageToken that can be used to get the next page of results in
  15006. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  15007. // (Default: 500)
  15008. func (c *BackendServicesAggregatedListCall) MaxResults(maxResults int64) *BackendServicesAggregatedListCall {
  15009. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  15010. return c
  15011. }
  15012. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  15013. // a certain order. By default, results are returned in alphanumerical
  15014. // order based on the resource name.
  15015. //
  15016. // You can also sort results in descending order based on the creation
  15017. // timestamp using orderBy="creationTimestamp desc". This sorts results
  15018. // based on the creationTimestamp field in reverse chronological order
  15019. // (newest result first). Use this to sort resources like operations so
  15020. // that the newest operation is returned first.
  15021. //
  15022. // Currently, only sorting by name or creationTimestamp desc is
  15023. // supported.
  15024. func (c *BackendServicesAggregatedListCall) OrderBy(orderBy string) *BackendServicesAggregatedListCall {
  15025. c.urlParams_.Set("orderBy", orderBy)
  15026. return c
  15027. }
  15028. // PageToken sets the optional parameter "pageToken": Specifies a page
  15029. // token to use. Set pageToken to the nextPageToken returned by a
  15030. // previous list request to get the next page of results.
  15031. func (c *BackendServicesAggregatedListCall) PageToken(pageToken string) *BackendServicesAggregatedListCall {
  15032. c.urlParams_.Set("pageToken", pageToken)
  15033. return c
  15034. }
  15035. // Fields allows partial responses to be retrieved. See
  15036. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15037. // for more information.
  15038. func (c *BackendServicesAggregatedListCall) Fields(s ...googleapi.Field) *BackendServicesAggregatedListCall {
  15039. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15040. return c
  15041. }
  15042. // IfNoneMatch sets the optional parameter which makes the operation
  15043. // fail if the object's ETag matches the given value. This is useful for
  15044. // getting updates only after the object has changed since the last
  15045. // request. Use googleapi.IsNotModified to check whether the response
  15046. // error from Do is the result of In-None-Match.
  15047. func (c *BackendServicesAggregatedListCall) IfNoneMatch(entityTag string) *BackendServicesAggregatedListCall {
  15048. c.ifNoneMatch_ = entityTag
  15049. return c
  15050. }
  15051. // Context sets the context to be used in this call's Do method. Any
  15052. // pending HTTP request will be aborted if the provided context is
  15053. // canceled.
  15054. func (c *BackendServicesAggregatedListCall) Context(ctx context.Context) *BackendServicesAggregatedListCall {
  15055. c.ctx_ = ctx
  15056. return c
  15057. }
  15058. // Header returns an http.Header that can be modified by the caller to
  15059. // add HTTP headers to the request.
  15060. func (c *BackendServicesAggregatedListCall) Header() http.Header {
  15061. if c.header_ == nil {
  15062. c.header_ = make(http.Header)
  15063. }
  15064. return c.header_
  15065. }
  15066. func (c *BackendServicesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  15067. reqHeaders := make(http.Header)
  15068. for k, v := range c.header_ {
  15069. reqHeaders[k] = v
  15070. }
  15071. reqHeaders.Set("User-Agent", c.s.userAgent())
  15072. if c.ifNoneMatch_ != "" {
  15073. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  15074. }
  15075. var body io.Reader = nil
  15076. c.urlParams_.Set("alt", alt)
  15077. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/backendServices")
  15078. urls += "?" + c.urlParams_.Encode()
  15079. req, _ := http.NewRequest("GET", urls, body)
  15080. req.Header = reqHeaders
  15081. googleapi.Expand(req.URL, map[string]string{
  15082. "project": c.project,
  15083. })
  15084. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15085. }
  15086. // Do executes the "compute.backendServices.aggregatedList" call.
  15087. // Exactly one of *BackendServiceAggregatedList or error will be
  15088. // non-nil. Any non-2xx status code is an error. Response headers are in
  15089. // either *BackendServiceAggregatedList.ServerResponse.Header or (if a
  15090. // response was returned at all) in error.(*googleapi.Error).Header. Use
  15091. // googleapi.IsNotModified to check whether the returned error was
  15092. // because http.StatusNotModified was returned.
  15093. func (c *BackendServicesAggregatedListCall) Do(opts ...googleapi.CallOption) (*BackendServiceAggregatedList, error) {
  15094. gensupport.SetOptions(c.urlParams_, opts...)
  15095. res, err := c.doRequest("json")
  15096. if res != nil && res.StatusCode == http.StatusNotModified {
  15097. if res.Body != nil {
  15098. res.Body.Close()
  15099. }
  15100. return nil, &googleapi.Error{
  15101. Code: res.StatusCode,
  15102. Header: res.Header,
  15103. }
  15104. }
  15105. if err != nil {
  15106. return nil, err
  15107. }
  15108. defer googleapi.CloseBody(res)
  15109. if err := googleapi.CheckResponse(res); err != nil {
  15110. return nil, err
  15111. }
  15112. ret := &BackendServiceAggregatedList{
  15113. ServerResponse: googleapi.ServerResponse{
  15114. Header: res.Header,
  15115. HTTPStatusCode: res.StatusCode,
  15116. },
  15117. }
  15118. target := &ret
  15119. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  15120. return nil, err
  15121. }
  15122. return ret, nil
  15123. // {
  15124. // "description": "Retrieves the list of all BackendService resources, regional and global, available to the specified project.",
  15125. // "httpMethod": "GET",
  15126. // "id": "compute.backendServices.aggregatedList",
  15127. // "parameterOrder": [
  15128. // "project"
  15129. // ],
  15130. // "parameters": {
  15131. // "filter": {
  15132. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  15133. // "location": "query",
  15134. // "type": "string"
  15135. // },
  15136. // "maxResults": {
  15137. // "default": "500",
  15138. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  15139. // "format": "uint32",
  15140. // "location": "query",
  15141. // "minimum": "0",
  15142. // "type": "integer"
  15143. // },
  15144. // "orderBy": {
  15145. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  15146. // "location": "query",
  15147. // "type": "string"
  15148. // },
  15149. // "pageToken": {
  15150. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  15151. // "location": "query",
  15152. // "type": "string"
  15153. // },
  15154. // "project": {
  15155. // "description": "Name of the project scoping this request.",
  15156. // "location": "path",
  15157. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  15158. // "required": true,
  15159. // "type": "string"
  15160. // }
  15161. // },
  15162. // "path": "{project}/aggregated/backendServices",
  15163. // "response": {
  15164. // "$ref": "BackendServiceAggregatedList"
  15165. // },
  15166. // "scopes": [
  15167. // "https://www.googleapis.com/auth/cloud-platform",
  15168. // "https://www.googleapis.com/auth/compute",
  15169. // "https://www.googleapis.com/auth/compute.readonly"
  15170. // ]
  15171. // }
  15172. }
  15173. // Pages invokes f for each page of results.
  15174. // A non-nil error returned from f will halt the iteration.
  15175. // The provided context supersedes any context provided to the Context method.
  15176. func (c *BackendServicesAggregatedListCall) Pages(ctx context.Context, f func(*BackendServiceAggregatedList) error) error {
  15177. c.ctx_ = ctx
  15178. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  15179. for {
  15180. x, err := c.Do()
  15181. if err != nil {
  15182. return err
  15183. }
  15184. if err := f(x); err != nil {
  15185. return err
  15186. }
  15187. if x.NextPageToken == "" {
  15188. return nil
  15189. }
  15190. c.PageToken(x.NextPageToken)
  15191. }
  15192. }
  15193. // method id "compute.backendServices.delete":
  15194. type BackendServicesDeleteCall struct {
  15195. s *Service
  15196. project string
  15197. backendService string
  15198. urlParams_ gensupport.URLParams
  15199. ctx_ context.Context
  15200. header_ http.Header
  15201. }
  15202. // Delete: Deletes the specified BackendService resource.
  15203. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/delete
  15204. func (r *BackendServicesService) Delete(project string, backendService string) *BackendServicesDeleteCall {
  15205. c := &BackendServicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15206. c.project = project
  15207. c.backendService = backendService
  15208. return c
  15209. }
  15210. // Fields allows partial responses to be retrieved. See
  15211. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15212. // for more information.
  15213. func (c *BackendServicesDeleteCall) Fields(s ...googleapi.Field) *BackendServicesDeleteCall {
  15214. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15215. return c
  15216. }
  15217. // Context sets the context to be used in this call's Do method. Any
  15218. // pending HTTP request will be aborted if the provided context is
  15219. // canceled.
  15220. func (c *BackendServicesDeleteCall) Context(ctx context.Context) *BackendServicesDeleteCall {
  15221. c.ctx_ = ctx
  15222. return c
  15223. }
  15224. // Header returns an http.Header that can be modified by the caller to
  15225. // add HTTP headers to the request.
  15226. func (c *BackendServicesDeleteCall) Header() http.Header {
  15227. if c.header_ == nil {
  15228. c.header_ = make(http.Header)
  15229. }
  15230. return c.header_
  15231. }
  15232. func (c *BackendServicesDeleteCall) doRequest(alt string) (*http.Response, error) {
  15233. reqHeaders := make(http.Header)
  15234. for k, v := range c.header_ {
  15235. reqHeaders[k] = v
  15236. }
  15237. reqHeaders.Set("User-Agent", c.s.userAgent())
  15238. var body io.Reader = nil
  15239. c.urlParams_.Set("alt", alt)
  15240. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  15241. urls += "?" + c.urlParams_.Encode()
  15242. req, _ := http.NewRequest("DELETE", urls, body)
  15243. req.Header = reqHeaders
  15244. googleapi.Expand(req.URL, map[string]string{
  15245. "project": c.project,
  15246. "backendService": c.backendService,
  15247. })
  15248. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15249. }
  15250. // Do executes the "compute.backendServices.delete" call.
  15251. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  15252. // status code is an error. Response headers are in either
  15253. // *Operation.ServerResponse.Header or (if a response was returned at
  15254. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  15255. // to check whether the returned error was because
  15256. // http.StatusNotModified was returned.
  15257. func (c *BackendServicesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  15258. gensupport.SetOptions(c.urlParams_, opts...)
  15259. res, err := c.doRequest("json")
  15260. if res != nil && res.StatusCode == http.StatusNotModified {
  15261. if res.Body != nil {
  15262. res.Body.Close()
  15263. }
  15264. return nil, &googleapi.Error{
  15265. Code: res.StatusCode,
  15266. Header: res.Header,
  15267. }
  15268. }
  15269. if err != nil {
  15270. return nil, err
  15271. }
  15272. defer googleapi.CloseBody(res)
  15273. if err := googleapi.CheckResponse(res); err != nil {
  15274. return nil, err
  15275. }
  15276. ret := &Operation{
  15277. ServerResponse: googleapi.ServerResponse{
  15278. Header: res.Header,
  15279. HTTPStatusCode: res.StatusCode,
  15280. },
  15281. }
  15282. target := &ret
  15283. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  15284. return nil, err
  15285. }
  15286. return ret, nil
  15287. // {
  15288. // "description": "Deletes the specified BackendService resource.",
  15289. // "httpMethod": "DELETE",
  15290. // "id": "compute.backendServices.delete",
  15291. // "parameterOrder": [
  15292. // "project",
  15293. // "backendService"
  15294. // ],
  15295. // "parameters": {
  15296. // "backendService": {
  15297. // "description": "Name of the BackendService resource to delete.",
  15298. // "location": "path",
  15299. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  15300. // "required": true,
  15301. // "type": "string"
  15302. // },
  15303. // "project": {
  15304. // "description": "Project ID for this request.",
  15305. // "location": "path",
  15306. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  15307. // "required": true,
  15308. // "type": "string"
  15309. // }
  15310. // },
  15311. // "path": "{project}/global/backendServices/{backendService}",
  15312. // "response": {
  15313. // "$ref": "Operation"
  15314. // },
  15315. // "scopes": [
  15316. // "https://www.googleapis.com/auth/cloud-platform",
  15317. // "https://www.googleapis.com/auth/compute"
  15318. // ]
  15319. // }
  15320. }
  15321. // method id "compute.backendServices.get":
  15322. type BackendServicesGetCall struct {
  15323. s *Service
  15324. project string
  15325. backendService string
  15326. urlParams_ gensupport.URLParams
  15327. ifNoneMatch_ string
  15328. ctx_ context.Context
  15329. header_ http.Header
  15330. }
  15331. // Get: Returns the specified BackendService resource. Get a list of
  15332. // available backend services by making a list() request.
  15333. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/get
  15334. func (r *BackendServicesService) Get(project string, backendService string) *BackendServicesGetCall {
  15335. c := &BackendServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15336. c.project = project
  15337. c.backendService = backendService
  15338. return c
  15339. }
  15340. // Fields allows partial responses to be retrieved. See
  15341. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15342. // for more information.
  15343. func (c *BackendServicesGetCall) Fields(s ...googleapi.Field) *BackendServicesGetCall {
  15344. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15345. return c
  15346. }
  15347. // IfNoneMatch sets the optional parameter which makes the operation
  15348. // fail if the object's ETag matches the given value. This is useful for
  15349. // getting updates only after the object has changed since the last
  15350. // request. Use googleapi.IsNotModified to check whether the response
  15351. // error from Do is the result of In-None-Match.
  15352. func (c *BackendServicesGetCall) IfNoneMatch(entityTag string) *BackendServicesGetCall {
  15353. c.ifNoneMatch_ = entityTag
  15354. return c
  15355. }
  15356. // Context sets the context to be used in this call's Do method. Any
  15357. // pending HTTP request will be aborted if the provided context is
  15358. // canceled.
  15359. func (c *BackendServicesGetCall) Context(ctx context.Context) *BackendServicesGetCall {
  15360. c.ctx_ = ctx
  15361. return c
  15362. }
  15363. // Header returns an http.Header that can be modified by the caller to
  15364. // add HTTP headers to the request.
  15365. func (c *BackendServicesGetCall) Header() http.Header {
  15366. if c.header_ == nil {
  15367. c.header_ = make(http.Header)
  15368. }
  15369. return c.header_
  15370. }
  15371. func (c *BackendServicesGetCall) doRequest(alt string) (*http.Response, error) {
  15372. reqHeaders := make(http.Header)
  15373. for k, v := range c.header_ {
  15374. reqHeaders[k] = v
  15375. }
  15376. reqHeaders.Set("User-Agent", c.s.userAgent())
  15377. if c.ifNoneMatch_ != "" {
  15378. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  15379. }
  15380. var body io.Reader = nil
  15381. c.urlParams_.Set("alt", alt)
  15382. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  15383. urls += "?" + c.urlParams_.Encode()
  15384. req, _ := http.NewRequest("GET", urls, body)
  15385. req.Header = reqHeaders
  15386. googleapi.Expand(req.URL, map[string]string{
  15387. "project": c.project,
  15388. "backendService": c.backendService,
  15389. })
  15390. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15391. }
  15392. // Do executes the "compute.backendServices.get" call.
  15393. // Exactly one of *BackendService or error will be non-nil. Any non-2xx
  15394. // status code is an error. Response headers are in either
  15395. // *BackendService.ServerResponse.Header or (if a response was returned
  15396. // at all) in error.(*googleapi.Error).Header. Use
  15397. // googleapi.IsNotModified to check whether the returned error was
  15398. // because http.StatusNotModified was returned.
  15399. func (c *BackendServicesGetCall) Do(opts ...googleapi.CallOption) (*BackendService, error) {
  15400. gensupport.SetOptions(c.urlParams_, opts...)
  15401. res, err := c.doRequest("json")
  15402. if res != nil && res.StatusCode == http.StatusNotModified {
  15403. if res.Body != nil {
  15404. res.Body.Close()
  15405. }
  15406. return nil, &googleapi.Error{
  15407. Code: res.StatusCode,
  15408. Header: res.Header,
  15409. }
  15410. }
  15411. if err != nil {
  15412. return nil, err
  15413. }
  15414. defer googleapi.CloseBody(res)
  15415. if err := googleapi.CheckResponse(res); err != nil {
  15416. return nil, err
  15417. }
  15418. ret := &BackendService{
  15419. ServerResponse: googleapi.ServerResponse{
  15420. Header: res.Header,
  15421. HTTPStatusCode: res.StatusCode,
  15422. },
  15423. }
  15424. target := &ret
  15425. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  15426. return nil, err
  15427. }
  15428. return ret, nil
  15429. // {
  15430. // "description": "Returns the specified BackendService resource. Get a list of available backend services by making a list() request.",
  15431. // "httpMethod": "GET",
  15432. // "id": "compute.backendServices.get",
  15433. // "parameterOrder": [
  15434. // "project",
  15435. // "backendService"
  15436. // ],
  15437. // "parameters": {
  15438. // "backendService": {
  15439. // "description": "Name of the BackendService resource to return.",
  15440. // "location": "path",
  15441. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  15442. // "required": true,
  15443. // "type": "string"
  15444. // },
  15445. // "project": {
  15446. // "description": "Project ID for this request.",
  15447. // "location": "path",
  15448. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  15449. // "required": true,
  15450. // "type": "string"
  15451. // }
  15452. // },
  15453. // "path": "{project}/global/backendServices/{backendService}",
  15454. // "response": {
  15455. // "$ref": "BackendService"
  15456. // },
  15457. // "scopes": [
  15458. // "https://www.googleapis.com/auth/cloud-platform",
  15459. // "https://www.googleapis.com/auth/compute",
  15460. // "https://www.googleapis.com/auth/compute.readonly"
  15461. // ]
  15462. // }
  15463. }
  15464. // method id "compute.backendServices.getHealth":
  15465. type BackendServicesGetHealthCall struct {
  15466. s *Service
  15467. project string
  15468. backendService string
  15469. resourcegroupreference *ResourceGroupReference
  15470. urlParams_ gensupport.URLParams
  15471. ctx_ context.Context
  15472. header_ http.Header
  15473. }
  15474. // GetHealth: Gets the most recent health check results for this
  15475. // BackendService.
  15476. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/getHealth
  15477. func (r *BackendServicesService) GetHealth(project string, backendService string, resourcegroupreference *ResourceGroupReference) *BackendServicesGetHealthCall {
  15478. c := &BackendServicesGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15479. c.project = project
  15480. c.backendService = backendService
  15481. c.resourcegroupreference = resourcegroupreference
  15482. return c
  15483. }
  15484. // Fields allows partial responses to be retrieved. See
  15485. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15486. // for more information.
  15487. func (c *BackendServicesGetHealthCall) Fields(s ...googleapi.Field) *BackendServicesGetHealthCall {
  15488. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15489. return c
  15490. }
  15491. // Context sets the context to be used in this call's Do method. Any
  15492. // pending HTTP request will be aborted if the provided context is
  15493. // canceled.
  15494. func (c *BackendServicesGetHealthCall) Context(ctx context.Context) *BackendServicesGetHealthCall {
  15495. c.ctx_ = ctx
  15496. return c
  15497. }
  15498. // Header returns an http.Header that can be modified by the caller to
  15499. // add HTTP headers to the request.
  15500. func (c *BackendServicesGetHealthCall) Header() http.Header {
  15501. if c.header_ == nil {
  15502. c.header_ = make(http.Header)
  15503. }
  15504. return c.header_
  15505. }
  15506. func (c *BackendServicesGetHealthCall) doRequest(alt string) (*http.Response, error) {
  15507. reqHeaders := make(http.Header)
  15508. for k, v := range c.header_ {
  15509. reqHeaders[k] = v
  15510. }
  15511. reqHeaders.Set("User-Agent", c.s.userAgent())
  15512. var body io.Reader = nil
  15513. body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcegroupreference)
  15514. if err != nil {
  15515. return nil, err
  15516. }
  15517. reqHeaders.Set("Content-Type", "application/json")
  15518. c.urlParams_.Set("alt", alt)
  15519. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}/getHealth")
  15520. urls += "?" + c.urlParams_.Encode()
  15521. req, _ := http.NewRequest("POST", urls, body)
  15522. req.Header = reqHeaders
  15523. googleapi.Expand(req.URL, map[string]string{
  15524. "project": c.project,
  15525. "backendService": c.backendService,
  15526. })
  15527. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15528. }
  15529. // Do executes the "compute.backendServices.getHealth" call.
  15530. // Exactly one of *BackendServiceGroupHealth or error will be non-nil.
  15531. // Any non-2xx status code is an error. Response headers are in either
  15532. // *BackendServiceGroupHealth.ServerResponse.Header or (if a response
  15533. // was returned at all) in error.(*googleapi.Error).Header. Use
  15534. // googleapi.IsNotModified to check whether the returned error was
  15535. // because http.StatusNotModified was returned.
  15536. func (c *BackendServicesGetHealthCall) Do(opts ...googleapi.CallOption) (*BackendServiceGroupHealth, error) {
  15537. gensupport.SetOptions(c.urlParams_, opts...)
  15538. res, err := c.doRequest("json")
  15539. if res != nil && res.StatusCode == http.StatusNotModified {
  15540. if res.Body != nil {
  15541. res.Body.Close()
  15542. }
  15543. return nil, &googleapi.Error{
  15544. Code: res.StatusCode,
  15545. Header: res.Header,
  15546. }
  15547. }
  15548. if err != nil {
  15549. return nil, err
  15550. }
  15551. defer googleapi.CloseBody(res)
  15552. if err := googleapi.CheckResponse(res); err != nil {
  15553. return nil, err
  15554. }
  15555. ret := &BackendServiceGroupHealth{
  15556. ServerResponse: googleapi.ServerResponse{
  15557. Header: res.Header,
  15558. HTTPStatusCode: res.StatusCode,
  15559. },
  15560. }
  15561. target := &ret
  15562. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  15563. return nil, err
  15564. }
  15565. return ret, nil
  15566. // {
  15567. // "description": "Gets the most recent health check results for this BackendService.",
  15568. // "httpMethod": "POST",
  15569. // "id": "compute.backendServices.getHealth",
  15570. // "parameterOrder": [
  15571. // "project",
  15572. // "backendService"
  15573. // ],
  15574. // "parameters": {
  15575. // "backendService": {
  15576. // "description": "Name of the BackendService resource to which the queried instance belongs.",
  15577. // "location": "path",
  15578. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  15579. // "required": true,
  15580. // "type": "string"
  15581. // },
  15582. // "project": {
  15583. // "location": "path",
  15584. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  15585. // "required": true,
  15586. // "type": "string"
  15587. // }
  15588. // },
  15589. // "path": "{project}/global/backendServices/{backendService}/getHealth",
  15590. // "request": {
  15591. // "$ref": "ResourceGroupReference"
  15592. // },
  15593. // "response": {
  15594. // "$ref": "BackendServiceGroupHealth"
  15595. // },
  15596. // "scopes": [
  15597. // "https://www.googleapis.com/auth/cloud-platform",
  15598. // "https://www.googleapis.com/auth/compute",
  15599. // "https://www.googleapis.com/auth/compute.readonly"
  15600. // ]
  15601. // }
  15602. }
  15603. // method id "compute.backendServices.insert":
  15604. type BackendServicesInsertCall struct {
  15605. s *Service
  15606. project string
  15607. backendservice *BackendService
  15608. urlParams_ gensupport.URLParams
  15609. ctx_ context.Context
  15610. header_ http.Header
  15611. }
  15612. // Insert: Creates a BackendService resource in the specified project
  15613. // using the data included in the request. There are several
  15614. // restrictions and guidelines to keep in mind when creating a backend
  15615. // service. Read Restrictions and Guidelines for more information.
  15616. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/insert
  15617. func (r *BackendServicesService) Insert(project string, backendservice *BackendService) *BackendServicesInsertCall {
  15618. c := &BackendServicesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15619. c.project = project
  15620. c.backendservice = backendservice
  15621. return c
  15622. }
  15623. // Fields allows partial responses to be retrieved. See
  15624. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15625. // for more information.
  15626. func (c *BackendServicesInsertCall) Fields(s ...googleapi.Field) *BackendServicesInsertCall {
  15627. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15628. return c
  15629. }
  15630. // Context sets the context to be used in this call's Do method. Any
  15631. // pending HTTP request will be aborted if the provided context is
  15632. // canceled.
  15633. func (c *BackendServicesInsertCall) Context(ctx context.Context) *BackendServicesInsertCall {
  15634. c.ctx_ = ctx
  15635. return c
  15636. }
  15637. // Header returns an http.Header that can be modified by the caller to
  15638. // add HTTP headers to the request.
  15639. func (c *BackendServicesInsertCall) Header() http.Header {
  15640. if c.header_ == nil {
  15641. c.header_ = make(http.Header)
  15642. }
  15643. return c.header_
  15644. }
  15645. func (c *BackendServicesInsertCall) doRequest(alt string) (*http.Response, error) {
  15646. reqHeaders := make(http.Header)
  15647. for k, v := range c.header_ {
  15648. reqHeaders[k] = v
  15649. }
  15650. reqHeaders.Set("User-Agent", c.s.userAgent())
  15651. var body io.Reader = nil
  15652. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  15653. if err != nil {
  15654. return nil, err
  15655. }
  15656. reqHeaders.Set("Content-Type", "application/json")
  15657. c.urlParams_.Set("alt", alt)
  15658. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices")
  15659. urls += "?" + c.urlParams_.Encode()
  15660. req, _ := http.NewRequest("POST", urls, body)
  15661. req.Header = reqHeaders
  15662. googleapi.Expand(req.URL, map[string]string{
  15663. "project": c.project,
  15664. })
  15665. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15666. }
  15667. // Do executes the "compute.backendServices.insert" call.
  15668. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  15669. // status code is an error. Response headers are in either
  15670. // *Operation.ServerResponse.Header or (if a response was returned at
  15671. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  15672. // to check whether the returned error was because
  15673. // http.StatusNotModified was returned.
  15674. func (c *BackendServicesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  15675. gensupport.SetOptions(c.urlParams_, opts...)
  15676. res, err := c.doRequest("json")
  15677. if res != nil && res.StatusCode == http.StatusNotModified {
  15678. if res.Body != nil {
  15679. res.Body.Close()
  15680. }
  15681. return nil, &googleapi.Error{
  15682. Code: res.StatusCode,
  15683. Header: res.Header,
  15684. }
  15685. }
  15686. if err != nil {
  15687. return nil, err
  15688. }
  15689. defer googleapi.CloseBody(res)
  15690. if err := googleapi.CheckResponse(res); err != nil {
  15691. return nil, err
  15692. }
  15693. ret := &Operation{
  15694. ServerResponse: googleapi.ServerResponse{
  15695. Header: res.Header,
  15696. HTTPStatusCode: res.StatusCode,
  15697. },
  15698. }
  15699. target := &ret
  15700. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  15701. return nil, err
  15702. }
  15703. return ret, nil
  15704. // {
  15705. // "description": "Creates a BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to keep in mind when creating a backend service. Read Restrictions and Guidelines for more information.",
  15706. // "httpMethod": "POST",
  15707. // "id": "compute.backendServices.insert",
  15708. // "parameterOrder": [
  15709. // "project"
  15710. // ],
  15711. // "parameters": {
  15712. // "project": {
  15713. // "description": "Project ID for this request.",
  15714. // "location": "path",
  15715. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  15716. // "required": true,
  15717. // "type": "string"
  15718. // }
  15719. // },
  15720. // "path": "{project}/global/backendServices",
  15721. // "request": {
  15722. // "$ref": "BackendService"
  15723. // },
  15724. // "response": {
  15725. // "$ref": "Operation"
  15726. // },
  15727. // "scopes": [
  15728. // "https://www.googleapis.com/auth/cloud-platform",
  15729. // "https://www.googleapis.com/auth/compute"
  15730. // ]
  15731. // }
  15732. }
  15733. // method id "compute.backendServices.list":
  15734. type BackendServicesListCall struct {
  15735. s *Service
  15736. project string
  15737. urlParams_ gensupport.URLParams
  15738. ifNoneMatch_ string
  15739. ctx_ context.Context
  15740. header_ http.Header
  15741. }
  15742. // List: Retrieves the list of BackendService resources available to the
  15743. // specified project.
  15744. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/list
  15745. func (r *BackendServicesService) List(project string) *BackendServicesListCall {
  15746. c := &BackendServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15747. c.project = project
  15748. return c
  15749. }
  15750. // Filter sets the optional parameter "filter": Sets a filter
  15751. // {expression} for filtering listed resources. Your {expression} must
  15752. // be in the format: field_name comparison_string literal_string.
  15753. //
  15754. // The field_name is the name of the field you want to compare. Only
  15755. // atomic field types are supported (string, number, boolean). The
  15756. // comparison_string must be either eq (equals) or ne (not equals). The
  15757. // literal_string is the string value to filter to. The literal value
  15758. // must be valid for the type of field you are filtering by (string,
  15759. // number, boolean). For string fields, the literal value is interpreted
  15760. // as a regular expression using RE2 syntax. The literal value must
  15761. // match the entire field.
  15762. //
  15763. // For example, to filter for instances that do not have a name of
  15764. // example-instance, you would use name ne example-instance.
  15765. //
  15766. // You can filter on nested fields. For example, you could filter on
  15767. // instances that have set the scheduling.automaticRestart field to
  15768. // true. Use filtering on nested fields to take advantage of labels to
  15769. // organize and search for results based on label values.
  15770. //
  15771. // To filter on multiple expressions, provide each separate expression
  15772. // within parentheses. For example, (scheduling.automaticRestart eq
  15773. // true) (zone eq us-central1-f). Multiple expressions are treated as
  15774. // AND expressions, meaning that resources must match all expressions to
  15775. // pass the filters.
  15776. func (c *BackendServicesListCall) Filter(filter string) *BackendServicesListCall {
  15777. c.urlParams_.Set("filter", filter)
  15778. return c
  15779. }
  15780. // MaxResults sets the optional parameter "maxResults": The maximum
  15781. // number of results per page that should be returned. If the number of
  15782. // available results is larger than maxResults, Compute Engine returns a
  15783. // nextPageToken that can be used to get the next page of results in
  15784. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  15785. // (Default: 500)
  15786. func (c *BackendServicesListCall) MaxResults(maxResults int64) *BackendServicesListCall {
  15787. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  15788. return c
  15789. }
  15790. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  15791. // a certain order. By default, results are returned in alphanumerical
  15792. // order based on the resource name.
  15793. //
  15794. // You can also sort results in descending order based on the creation
  15795. // timestamp using orderBy="creationTimestamp desc". This sorts results
  15796. // based on the creationTimestamp field in reverse chronological order
  15797. // (newest result first). Use this to sort resources like operations so
  15798. // that the newest operation is returned first.
  15799. //
  15800. // Currently, only sorting by name or creationTimestamp desc is
  15801. // supported.
  15802. func (c *BackendServicesListCall) OrderBy(orderBy string) *BackendServicesListCall {
  15803. c.urlParams_.Set("orderBy", orderBy)
  15804. return c
  15805. }
  15806. // PageToken sets the optional parameter "pageToken": Specifies a page
  15807. // token to use. Set pageToken to the nextPageToken returned by a
  15808. // previous list request to get the next page of results.
  15809. func (c *BackendServicesListCall) PageToken(pageToken string) *BackendServicesListCall {
  15810. c.urlParams_.Set("pageToken", pageToken)
  15811. return c
  15812. }
  15813. // Fields allows partial responses to be retrieved. See
  15814. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15815. // for more information.
  15816. func (c *BackendServicesListCall) Fields(s ...googleapi.Field) *BackendServicesListCall {
  15817. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15818. return c
  15819. }
  15820. // IfNoneMatch sets the optional parameter which makes the operation
  15821. // fail if the object's ETag matches the given value. This is useful for
  15822. // getting updates only after the object has changed since the last
  15823. // request. Use googleapi.IsNotModified to check whether the response
  15824. // error from Do is the result of In-None-Match.
  15825. func (c *BackendServicesListCall) IfNoneMatch(entityTag string) *BackendServicesListCall {
  15826. c.ifNoneMatch_ = entityTag
  15827. return c
  15828. }
  15829. // Context sets the context to be used in this call's Do method. Any
  15830. // pending HTTP request will be aborted if the provided context is
  15831. // canceled.
  15832. func (c *BackendServicesListCall) Context(ctx context.Context) *BackendServicesListCall {
  15833. c.ctx_ = ctx
  15834. return c
  15835. }
  15836. // Header returns an http.Header that can be modified by the caller to
  15837. // add HTTP headers to the request.
  15838. func (c *BackendServicesListCall) Header() http.Header {
  15839. if c.header_ == nil {
  15840. c.header_ = make(http.Header)
  15841. }
  15842. return c.header_
  15843. }
  15844. func (c *BackendServicesListCall) doRequest(alt string) (*http.Response, error) {
  15845. reqHeaders := make(http.Header)
  15846. for k, v := range c.header_ {
  15847. reqHeaders[k] = v
  15848. }
  15849. reqHeaders.Set("User-Agent", c.s.userAgent())
  15850. if c.ifNoneMatch_ != "" {
  15851. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  15852. }
  15853. var body io.Reader = nil
  15854. c.urlParams_.Set("alt", alt)
  15855. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices")
  15856. urls += "?" + c.urlParams_.Encode()
  15857. req, _ := http.NewRequest("GET", urls, body)
  15858. req.Header = reqHeaders
  15859. googleapi.Expand(req.URL, map[string]string{
  15860. "project": c.project,
  15861. })
  15862. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15863. }
  15864. // Do executes the "compute.backendServices.list" call.
  15865. // Exactly one of *BackendServiceList or error will be non-nil. Any
  15866. // non-2xx status code is an error. Response headers are in either
  15867. // *BackendServiceList.ServerResponse.Header or (if a response was
  15868. // returned at all) in error.(*googleapi.Error).Header. Use
  15869. // googleapi.IsNotModified to check whether the returned error was
  15870. // because http.StatusNotModified was returned.
  15871. func (c *BackendServicesListCall) Do(opts ...googleapi.CallOption) (*BackendServiceList, error) {
  15872. gensupport.SetOptions(c.urlParams_, opts...)
  15873. res, err := c.doRequest("json")
  15874. if res != nil && res.StatusCode == http.StatusNotModified {
  15875. if res.Body != nil {
  15876. res.Body.Close()
  15877. }
  15878. return nil, &googleapi.Error{
  15879. Code: res.StatusCode,
  15880. Header: res.Header,
  15881. }
  15882. }
  15883. if err != nil {
  15884. return nil, err
  15885. }
  15886. defer googleapi.CloseBody(res)
  15887. if err := googleapi.CheckResponse(res); err != nil {
  15888. return nil, err
  15889. }
  15890. ret := &BackendServiceList{
  15891. ServerResponse: googleapi.ServerResponse{
  15892. Header: res.Header,
  15893. HTTPStatusCode: res.StatusCode,
  15894. },
  15895. }
  15896. target := &ret
  15897. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  15898. return nil, err
  15899. }
  15900. return ret, nil
  15901. // {
  15902. // "description": "Retrieves the list of BackendService resources available to the specified project.",
  15903. // "httpMethod": "GET",
  15904. // "id": "compute.backendServices.list",
  15905. // "parameterOrder": [
  15906. // "project"
  15907. // ],
  15908. // "parameters": {
  15909. // "filter": {
  15910. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  15911. // "location": "query",
  15912. // "type": "string"
  15913. // },
  15914. // "maxResults": {
  15915. // "default": "500",
  15916. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  15917. // "format": "uint32",
  15918. // "location": "query",
  15919. // "minimum": "0",
  15920. // "type": "integer"
  15921. // },
  15922. // "orderBy": {
  15923. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  15924. // "location": "query",
  15925. // "type": "string"
  15926. // },
  15927. // "pageToken": {
  15928. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  15929. // "location": "query",
  15930. // "type": "string"
  15931. // },
  15932. // "project": {
  15933. // "description": "Project ID for this request.",
  15934. // "location": "path",
  15935. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  15936. // "required": true,
  15937. // "type": "string"
  15938. // }
  15939. // },
  15940. // "path": "{project}/global/backendServices",
  15941. // "response": {
  15942. // "$ref": "BackendServiceList"
  15943. // },
  15944. // "scopes": [
  15945. // "https://www.googleapis.com/auth/cloud-platform",
  15946. // "https://www.googleapis.com/auth/compute",
  15947. // "https://www.googleapis.com/auth/compute.readonly"
  15948. // ]
  15949. // }
  15950. }
  15951. // Pages invokes f for each page of results.
  15952. // A non-nil error returned from f will halt the iteration.
  15953. // The provided context supersedes any context provided to the Context method.
  15954. func (c *BackendServicesListCall) Pages(ctx context.Context, f func(*BackendServiceList) error) error {
  15955. c.ctx_ = ctx
  15956. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  15957. for {
  15958. x, err := c.Do()
  15959. if err != nil {
  15960. return err
  15961. }
  15962. if err := f(x); err != nil {
  15963. return err
  15964. }
  15965. if x.NextPageToken == "" {
  15966. return nil
  15967. }
  15968. c.PageToken(x.NextPageToken)
  15969. }
  15970. }
  15971. // method id "compute.backendServices.patch":
  15972. type BackendServicesPatchCall struct {
  15973. s *Service
  15974. project string
  15975. backendService string
  15976. backendservice *BackendService
  15977. urlParams_ gensupport.URLParams
  15978. ctx_ context.Context
  15979. header_ http.Header
  15980. }
  15981. // Patch: Patches the specified BackendService resource with the data
  15982. // included in the request. There are several restrictions and
  15983. // guidelines to keep in mind when updating a backend service. Read
  15984. // Restrictions and Guidelines for more information. This method
  15985. // supports patch semantics.
  15986. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/patch
  15987. func (r *BackendServicesService) Patch(project string, backendService string, backendservice *BackendService) *BackendServicesPatchCall {
  15988. c := &BackendServicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15989. c.project = project
  15990. c.backendService = backendService
  15991. c.backendservice = backendservice
  15992. return c
  15993. }
  15994. // Fields allows partial responses to be retrieved. See
  15995. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15996. // for more information.
  15997. func (c *BackendServicesPatchCall) Fields(s ...googleapi.Field) *BackendServicesPatchCall {
  15998. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15999. return c
  16000. }
  16001. // Context sets the context to be used in this call's Do method. Any
  16002. // pending HTTP request will be aborted if the provided context is
  16003. // canceled.
  16004. func (c *BackendServicesPatchCall) Context(ctx context.Context) *BackendServicesPatchCall {
  16005. c.ctx_ = ctx
  16006. return c
  16007. }
  16008. // Header returns an http.Header that can be modified by the caller to
  16009. // add HTTP headers to the request.
  16010. func (c *BackendServicesPatchCall) Header() http.Header {
  16011. if c.header_ == nil {
  16012. c.header_ = make(http.Header)
  16013. }
  16014. return c.header_
  16015. }
  16016. func (c *BackendServicesPatchCall) doRequest(alt string) (*http.Response, error) {
  16017. reqHeaders := make(http.Header)
  16018. for k, v := range c.header_ {
  16019. reqHeaders[k] = v
  16020. }
  16021. reqHeaders.Set("User-Agent", c.s.userAgent())
  16022. var body io.Reader = nil
  16023. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  16024. if err != nil {
  16025. return nil, err
  16026. }
  16027. reqHeaders.Set("Content-Type", "application/json")
  16028. c.urlParams_.Set("alt", alt)
  16029. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  16030. urls += "?" + c.urlParams_.Encode()
  16031. req, _ := http.NewRequest("PATCH", urls, body)
  16032. req.Header = reqHeaders
  16033. googleapi.Expand(req.URL, map[string]string{
  16034. "project": c.project,
  16035. "backendService": c.backendService,
  16036. })
  16037. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16038. }
  16039. // Do executes the "compute.backendServices.patch" call.
  16040. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  16041. // status code is an error. Response headers are in either
  16042. // *Operation.ServerResponse.Header or (if a response was returned at
  16043. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16044. // to check whether the returned error was because
  16045. // http.StatusNotModified was returned.
  16046. func (c *BackendServicesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  16047. gensupport.SetOptions(c.urlParams_, opts...)
  16048. res, err := c.doRequest("json")
  16049. if res != nil && res.StatusCode == http.StatusNotModified {
  16050. if res.Body != nil {
  16051. res.Body.Close()
  16052. }
  16053. return nil, &googleapi.Error{
  16054. Code: res.StatusCode,
  16055. Header: res.Header,
  16056. }
  16057. }
  16058. if err != nil {
  16059. return nil, err
  16060. }
  16061. defer googleapi.CloseBody(res)
  16062. if err := googleapi.CheckResponse(res); err != nil {
  16063. return nil, err
  16064. }
  16065. ret := &Operation{
  16066. ServerResponse: googleapi.ServerResponse{
  16067. Header: res.Header,
  16068. HTTPStatusCode: res.StatusCode,
  16069. },
  16070. }
  16071. target := &ret
  16072. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  16073. return nil, err
  16074. }
  16075. return ret, nil
  16076. // {
  16077. // "description": "Patches the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports patch semantics.",
  16078. // "httpMethod": "PATCH",
  16079. // "id": "compute.backendServices.patch",
  16080. // "parameterOrder": [
  16081. // "project",
  16082. // "backendService"
  16083. // ],
  16084. // "parameters": {
  16085. // "backendService": {
  16086. // "description": "Name of the BackendService resource to patch.",
  16087. // "location": "path",
  16088. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  16089. // "required": true,
  16090. // "type": "string"
  16091. // },
  16092. // "project": {
  16093. // "description": "Project ID for this request.",
  16094. // "location": "path",
  16095. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  16096. // "required": true,
  16097. // "type": "string"
  16098. // }
  16099. // },
  16100. // "path": "{project}/global/backendServices/{backendService}",
  16101. // "request": {
  16102. // "$ref": "BackendService"
  16103. // },
  16104. // "response": {
  16105. // "$ref": "Operation"
  16106. // },
  16107. // "scopes": [
  16108. // "https://www.googleapis.com/auth/cloud-platform",
  16109. // "https://www.googleapis.com/auth/compute",
  16110. // "https://www.googleapis.com/auth/compute.readonly"
  16111. // ]
  16112. // }
  16113. }
  16114. // method id "compute.backendServices.update":
  16115. type BackendServicesUpdateCall struct {
  16116. s *Service
  16117. project string
  16118. backendService string
  16119. backendservice *BackendService
  16120. urlParams_ gensupport.URLParams
  16121. ctx_ context.Context
  16122. header_ http.Header
  16123. }
  16124. // Update: Updates the specified BackendService resource with the data
  16125. // included in the request. There are several restrictions and
  16126. // guidelines to keep in mind when updating a backend service. Read
  16127. // Restrictions and Guidelines for more information.
  16128. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/update
  16129. func (r *BackendServicesService) Update(project string, backendService string, backendservice *BackendService) *BackendServicesUpdateCall {
  16130. c := &BackendServicesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16131. c.project = project
  16132. c.backendService = backendService
  16133. c.backendservice = backendservice
  16134. return c
  16135. }
  16136. // Fields allows partial responses to be retrieved. See
  16137. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16138. // for more information.
  16139. func (c *BackendServicesUpdateCall) Fields(s ...googleapi.Field) *BackendServicesUpdateCall {
  16140. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16141. return c
  16142. }
  16143. // Context sets the context to be used in this call's Do method. Any
  16144. // pending HTTP request will be aborted if the provided context is
  16145. // canceled.
  16146. func (c *BackendServicesUpdateCall) Context(ctx context.Context) *BackendServicesUpdateCall {
  16147. c.ctx_ = ctx
  16148. return c
  16149. }
  16150. // Header returns an http.Header that can be modified by the caller to
  16151. // add HTTP headers to the request.
  16152. func (c *BackendServicesUpdateCall) Header() http.Header {
  16153. if c.header_ == nil {
  16154. c.header_ = make(http.Header)
  16155. }
  16156. return c.header_
  16157. }
  16158. func (c *BackendServicesUpdateCall) doRequest(alt string) (*http.Response, error) {
  16159. reqHeaders := make(http.Header)
  16160. for k, v := range c.header_ {
  16161. reqHeaders[k] = v
  16162. }
  16163. reqHeaders.Set("User-Agent", c.s.userAgent())
  16164. var body io.Reader = nil
  16165. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  16166. if err != nil {
  16167. return nil, err
  16168. }
  16169. reqHeaders.Set("Content-Type", "application/json")
  16170. c.urlParams_.Set("alt", alt)
  16171. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  16172. urls += "?" + c.urlParams_.Encode()
  16173. req, _ := http.NewRequest("PUT", urls, body)
  16174. req.Header = reqHeaders
  16175. googleapi.Expand(req.URL, map[string]string{
  16176. "project": c.project,
  16177. "backendService": c.backendService,
  16178. })
  16179. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16180. }
  16181. // Do executes the "compute.backendServices.update" call.
  16182. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  16183. // status code is an error. Response headers are in either
  16184. // *Operation.ServerResponse.Header or (if a response was returned at
  16185. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16186. // to check whether the returned error was because
  16187. // http.StatusNotModified was returned.
  16188. func (c *BackendServicesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  16189. gensupport.SetOptions(c.urlParams_, opts...)
  16190. res, err := c.doRequest("json")
  16191. if res != nil && res.StatusCode == http.StatusNotModified {
  16192. if res.Body != nil {
  16193. res.Body.Close()
  16194. }
  16195. return nil, &googleapi.Error{
  16196. Code: res.StatusCode,
  16197. Header: res.Header,
  16198. }
  16199. }
  16200. if err != nil {
  16201. return nil, err
  16202. }
  16203. defer googleapi.CloseBody(res)
  16204. if err := googleapi.CheckResponse(res); err != nil {
  16205. return nil, err
  16206. }
  16207. ret := &Operation{
  16208. ServerResponse: googleapi.ServerResponse{
  16209. Header: res.Header,
  16210. HTTPStatusCode: res.StatusCode,
  16211. },
  16212. }
  16213. target := &ret
  16214. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  16215. return nil, err
  16216. }
  16217. return ret, nil
  16218. // {
  16219. // "description": "Updates the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information.",
  16220. // "httpMethod": "PUT",
  16221. // "id": "compute.backendServices.update",
  16222. // "parameterOrder": [
  16223. // "project",
  16224. // "backendService"
  16225. // ],
  16226. // "parameters": {
  16227. // "backendService": {
  16228. // "description": "Name of the BackendService resource to update.",
  16229. // "location": "path",
  16230. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  16231. // "required": true,
  16232. // "type": "string"
  16233. // },
  16234. // "project": {
  16235. // "description": "Project ID for this request.",
  16236. // "location": "path",
  16237. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  16238. // "required": true,
  16239. // "type": "string"
  16240. // }
  16241. // },
  16242. // "path": "{project}/global/backendServices/{backendService}",
  16243. // "request": {
  16244. // "$ref": "BackendService"
  16245. // },
  16246. // "response": {
  16247. // "$ref": "Operation"
  16248. // },
  16249. // "scopes": [
  16250. // "https://www.googleapis.com/auth/cloud-platform",
  16251. // "https://www.googleapis.com/auth/compute"
  16252. // ]
  16253. // }
  16254. }
  16255. // method id "compute.diskTypes.aggregatedList":
  16256. type DiskTypesAggregatedListCall struct {
  16257. s *Service
  16258. project string
  16259. urlParams_ gensupport.URLParams
  16260. ifNoneMatch_ string
  16261. ctx_ context.Context
  16262. header_ http.Header
  16263. }
  16264. // AggregatedList: Retrieves an aggregated list of disk types.
  16265. // For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/aggregatedList
  16266. func (r *DiskTypesService) AggregatedList(project string) *DiskTypesAggregatedListCall {
  16267. c := &DiskTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16268. c.project = project
  16269. return c
  16270. }
  16271. // Filter sets the optional parameter "filter": Sets a filter
  16272. // {expression} for filtering listed resources. Your {expression} must
  16273. // be in the format: field_name comparison_string literal_string.
  16274. //
  16275. // The field_name is the name of the field you want to compare. Only
  16276. // atomic field types are supported (string, number, boolean). The
  16277. // comparison_string must be either eq (equals) or ne (not equals). The
  16278. // literal_string is the string value to filter to. The literal value
  16279. // must be valid for the type of field you are filtering by (string,
  16280. // number, boolean). For string fields, the literal value is interpreted
  16281. // as a regular expression using RE2 syntax. The literal value must
  16282. // match the entire field.
  16283. //
  16284. // For example, to filter for instances that do not have a name of
  16285. // example-instance, you would use name ne example-instance.
  16286. //
  16287. // You can filter on nested fields. For example, you could filter on
  16288. // instances that have set the scheduling.automaticRestart field to
  16289. // true. Use filtering on nested fields to take advantage of labels to
  16290. // organize and search for results based on label values.
  16291. //
  16292. // To filter on multiple expressions, provide each separate expression
  16293. // within parentheses. For example, (scheduling.automaticRestart eq
  16294. // true) (zone eq us-central1-f). Multiple expressions are treated as
  16295. // AND expressions, meaning that resources must match all expressions to
  16296. // pass the filters.
  16297. func (c *DiskTypesAggregatedListCall) Filter(filter string) *DiskTypesAggregatedListCall {
  16298. c.urlParams_.Set("filter", filter)
  16299. return c
  16300. }
  16301. // MaxResults sets the optional parameter "maxResults": The maximum
  16302. // number of results per page that should be returned. If the number of
  16303. // available results is larger than maxResults, Compute Engine returns a
  16304. // nextPageToken that can be used to get the next page of results in
  16305. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  16306. // (Default: 500)
  16307. func (c *DiskTypesAggregatedListCall) MaxResults(maxResults int64) *DiskTypesAggregatedListCall {
  16308. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  16309. return c
  16310. }
  16311. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  16312. // a certain order. By default, results are returned in alphanumerical
  16313. // order based on the resource name.
  16314. //
  16315. // You can also sort results in descending order based on the creation
  16316. // timestamp using orderBy="creationTimestamp desc". This sorts results
  16317. // based on the creationTimestamp field in reverse chronological order
  16318. // (newest result first). Use this to sort resources like operations so
  16319. // that the newest operation is returned first.
  16320. //
  16321. // Currently, only sorting by name or creationTimestamp desc is
  16322. // supported.
  16323. func (c *DiskTypesAggregatedListCall) OrderBy(orderBy string) *DiskTypesAggregatedListCall {
  16324. c.urlParams_.Set("orderBy", orderBy)
  16325. return c
  16326. }
  16327. // PageToken sets the optional parameter "pageToken": Specifies a page
  16328. // token to use. Set pageToken to the nextPageToken returned by a
  16329. // previous list request to get the next page of results.
  16330. func (c *DiskTypesAggregatedListCall) PageToken(pageToken string) *DiskTypesAggregatedListCall {
  16331. c.urlParams_.Set("pageToken", pageToken)
  16332. return c
  16333. }
  16334. // Fields allows partial responses to be retrieved. See
  16335. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16336. // for more information.
  16337. func (c *DiskTypesAggregatedListCall) Fields(s ...googleapi.Field) *DiskTypesAggregatedListCall {
  16338. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16339. return c
  16340. }
  16341. // IfNoneMatch sets the optional parameter which makes the operation
  16342. // fail if the object's ETag matches the given value. This is useful for
  16343. // getting updates only after the object has changed since the last
  16344. // request. Use googleapi.IsNotModified to check whether the response
  16345. // error from Do is the result of In-None-Match.
  16346. func (c *DiskTypesAggregatedListCall) IfNoneMatch(entityTag string) *DiskTypesAggregatedListCall {
  16347. c.ifNoneMatch_ = entityTag
  16348. return c
  16349. }
  16350. // Context sets the context to be used in this call's Do method. Any
  16351. // pending HTTP request will be aborted if the provided context is
  16352. // canceled.
  16353. func (c *DiskTypesAggregatedListCall) Context(ctx context.Context) *DiskTypesAggregatedListCall {
  16354. c.ctx_ = ctx
  16355. return c
  16356. }
  16357. // Header returns an http.Header that can be modified by the caller to
  16358. // add HTTP headers to the request.
  16359. func (c *DiskTypesAggregatedListCall) Header() http.Header {
  16360. if c.header_ == nil {
  16361. c.header_ = make(http.Header)
  16362. }
  16363. return c.header_
  16364. }
  16365. func (c *DiskTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  16366. reqHeaders := make(http.Header)
  16367. for k, v := range c.header_ {
  16368. reqHeaders[k] = v
  16369. }
  16370. reqHeaders.Set("User-Agent", c.s.userAgent())
  16371. if c.ifNoneMatch_ != "" {
  16372. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  16373. }
  16374. var body io.Reader = nil
  16375. c.urlParams_.Set("alt", alt)
  16376. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/diskTypes")
  16377. urls += "?" + c.urlParams_.Encode()
  16378. req, _ := http.NewRequest("GET", urls, body)
  16379. req.Header = reqHeaders
  16380. googleapi.Expand(req.URL, map[string]string{
  16381. "project": c.project,
  16382. })
  16383. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16384. }
  16385. // Do executes the "compute.diskTypes.aggregatedList" call.
  16386. // Exactly one of *DiskTypeAggregatedList or error will be non-nil. Any
  16387. // non-2xx status code is an error. Response headers are in either
  16388. // *DiskTypeAggregatedList.ServerResponse.Header or (if a response was
  16389. // returned at all) in error.(*googleapi.Error).Header. Use
  16390. // googleapi.IsNotModified to check whether the returned error was
  16391. // because http.StatusNotModified was returned.
  16392. func (c *DiskTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*DiskTypeAggregatedList, error) {
  16393. gensupport.SetOptions(c.urlParams_, opts...)
  16394. res, err := c.doRequest("json")
  16395. if res != nil && res.StatusCode == http.StatusNotModified {
  16396. if res.Body != nil {
  16397. res.Body.Close()
  16398. }
  16399. return nil, &googleapi.Error{
  16400. Code: res.StatusCode,
  16401. Header: res.Header,
  16402. }
  16403. }
  16404. if err != nil {
  16405. return nil, err
  16406. }
  16407. defer googleapi.CloseBody(res)
  16408. if err := googleapi.CheckResponse(res); err != nil {
  16409. return nil, err
  16410. }
  16411. ret := &DiskTypeAggregatedList{
  16412. ServerResponse: googleapi.ServerResponse{
  16413. Header: res.Header,
  16414. HTTPStatusCode: res.StatusCode,
  16415. },
  16416. }
  16417. target := &ret
  16418. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  16419. return nil, err
  16420. }
  16421. return ret, nil
  16422. // {
  16423. // "description": "Retrieves an aggregated list of disk types.",
  16424. // "httpMethod": "GET",
  16425. // "id": "compute.diskTypes.aggregatedList",
  16426. // "parameterOrder": [
  16427. // "project"
  16428. // ],
  16429. // "parameters": {
  16430. // "filter": {
  16431. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  16432. // "location": "query",
  16433. // "type": "string"
  16434. // },
  16435. // "maxResults": {
  16436. // "default": "500",
  16437. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  16438. // "format": "uint32",
  16439. // "location": "query",
  16440. // "minimum": "0",
  16441. // "type": "integer"
  16442. // },
  16443. // "orderBy": {
  16444. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  16445. // "location": "query",
  16446. // "type": "string"
  16447. // },
  16448. // "pageToken": {
  16449. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  16450. // "location": "query",
  16451. // "type": "string"
  16452. // },
  16453. // "project": {
  16454. // "description": "Project ID for this request.",
  16455. // "location": "path",
  16456. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  16457. // "required": true,
  16458. // "type": "string"
  16459. // }
  16460. // },
  16461. // "path": "{project}/aggregated/diskTypes",
  16462. // "response": {
  16463. // "$ref": "DiskTypeAggregatedList"
  16464. // },
  16465. // "scopes": [
  16466. // "https://www.googleapis.com/auth/cloud-platform",
  16467. // "https://www.googleapis.com/auth/compute",
  16468. // "https://www.googleapis.com/auth/compute.readonly"
  16469. // ]
  16470. // }
  16471. }
  16472. // Pages invokes f for each page of results.
  16473. // A non-nil error returned from f will halt the iteration.
  16474. // The provided context supersedes any context provided to the Context method.
  16475. func (c *DiskTypesAggregatedListCall) Pages(ctx context.Context, f func(*DiskTypeAggregatedList) error) error {
  16476. c.ctx_ = ctx
  16477. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  16478. for {
  16479. x, err := c.Do()
  16480. if err != nil {
  16481. return err
  16482. }
  16483. if err := f(x); err != nil {
  16484. return err
  16485. }
  16486. if x.NextPageToken == "" {
  16487. return nil
  16488. }
  16489. c.PageToken(x.NextPageToken)
  16490. }
  16491. }
  16492. // method id "compute.diskTypes.get":
  16493. type DiskTypesGetCall struct {
  16494. s *Service
  16495. project string
  16496. zone string
  16497. diskType string
  16498. urlParams_ gensupport.URLParams
  16499. ifNoneMatch_ string
  16500. ctx_ context.Context
  16501. header_ http.Header
  16502. }
  16503. // Get: Returns the specified disk type. Get a list of available disk
  16504. // types by making a list() request.
  16505. // For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/get
  16506. func (r *DiskTypesService) Get(project string, zone string, diskType string) *DiskTypesGetCall {
  16507. c := &DiskTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16508. c.project = project
  16509. c.zone = zone
  16510. c.diskType = diskType
  16511. return c
  16512. }
  16513. // Fields allows partial responses to be retrieved. See
  16514. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16515. // for more information.
  16516. func (c *DiskTypesGetCall) Fields(s ...googleapi.Field) *DiskTypesGetCall {
  16517. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16518. return c
  16519. }
  16520. // IfNoneMatch sets the optional parameter which makes the operation
  16521. // fail if the object's ETag matches the given value. This is useful for
  16522. // getting updates only after the object has changed since the last
  16523. // request. Use googleapi.IsNotModified to check whether the response
  16524. // error from Do is the result of In-None-Match.
  16525. func (c *DiskTypesGetCall) IfNoneMatch(entityTag string) *DiskTypesGetCall {
  16526. c.ifNoneMatch_ = entityTag
  16527. return c
  16528. }
  16529. // Context sets the context to be used in this call's Do method. Any
  16530. // pending HTTP request will be aborted if the provided context is
  16531. // canceled.
  16532. func (c *DiskTypesGetCall) Context(ctx context.Context) *DiskTypesGetCall {
  16533. c.ctx_ = ctx
  16534. return c
  16535. }
  16536. // Header returns an http.Header that can be modified by the caller to
  16537. // add HTTP headers to the request.
  16538. func (c *DiskTypesGetCall) Header() http.Header {
  16539. if c.header_ == nil {
  16540. c.header_ = make(http.Header)
  16541. }
  16542. return c.header_
  16543. }
  16544. func (c *DiskTypesGetCall) doRequest(alt string) (*http.Response, error) {
  16545. reqHeaders := make(http.Header)
  16546. for k, v := range c.header_ {
  16547. reqHeaders[k] = v
  16548. }
  16549. reqHeaders.Set("User-Agent", c.s.userAgent())
  16550. if c.ifNoneMatch_ != "" {
  16551. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  16552. }
  16553. var body io.Reader = nil
  16554. c.urlParams_.Set("alt", alt)
  16555. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/diskTypes/{diskType}")
  16556. urls += "?" + c.urlParams_.Encode()
  16557. req, _ := http.NewRequest("GET", urls, body)
  16558. req.Header = reqHeaders
  16559. googleapi.Expand(req.URL, map[string]string{
  16560. "project": c.project,
  16561. "zone": c.zone,
  16562. "diskType": c.diskType,
  16563. })
  16564. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16565. }
  16566. // Do executes the "compute.diskTypes.get" call.
  16567. // Exactly one of *DiskType or error will be non-nil. Any non-2xx status
  16568. // code is an error. Response headers are in either
  16569. // *DiskType.ServerResponse.Header or (if a response was returned at
  16570. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16571. // to check whether the returned error was because
  16572. // http.StatusNotModified was returned.
  16573. func (c *DiskTypesGetCall) Do(opts ...googleapi.CallOption) (*DiskType, error) {
  16574. gensupport.SetOptions(c.urlParams_, opts...)
  16575. res, err := c.doRequest("json")
  16576. if res != nil && res.StatusCode == http.StatusNotModified {
  16577. if res.Body != nil {
  16578. res.Body.Close()
  16579. }
  16580. return nil, &googleapi.Error{
  16581. Code: res.StatusCode,
  16582. Header: res.Header,
  16583. }
  16584. }
  16585. if err != nil {
  16586. return nil, err
  16587. }
  16588. defer googleapi.CloseBody(res)
  16589. if err := googleapi.CheckResponse(res); err != nil {
  16590. return nil, err
  16591. }
  16592. ret := &DiskType{
  16593. ServerResponse: googleapi.ServerResponse{
  16594. Header: res.Header,
  16595. HTTPStatusCode: res.StatusCode,
  16596. },
  16597. }
  16598. target := &ret
  16599. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  16600. return nil, err
  16601. }
  16602. return ret, nil
  16603. // {
  16604. // "description": "Returns the specified disk type. Get a list of available disk types by making a list() request.",
  16605. // "httpMethod": "GET",
  16606. // "id": "compute.diskTypes.get",
  16607. // "parameterOrder": [
  16608. // "project",
  16609. // "zone",
  16610. // "diskType"
  16611. // ],
  16612. // "parameters": {
  16613. // "diskType": {
  16614. // "description": "Name of the disk type to return.",
  16615. // "location": "path",
  16616. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  16617. // "required": true,
  16618. // "type": "string"
  16619. // },
  16620. // "project": {
  16621. // "description": "Project ID for this request.",
  16622. // "location": "path",
  16623. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  16624. // "required": true,
  16625. // "type": "string"
  16626. // },
  16627. // "zone": {
  16628. // "description": "The name of the zone for this request.",
  16629. // "location": "path",
  16630. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  16631. // "required": true,
  16632. // "type": "string"
  16633. // }
  16634. // },
  16635. // "path": "{project}/zones/{zone}/diskTypes/{diskType}",
  16636. // "response": {
  16637. // "$ref": "DiskType"
  16638. // },
  16639. // "scopes": [
  16640. // "https://www.googleapis.com/auth/cloud-platform",
  16641. // "https://www.googleapis.com/auth/compute",
  16642. // "https://www.googleapis.com/auth/compute.readonly"
  16643. // ]
  16644. // }
  16645. }
  16646. // method id "compute.diskTypes.list":
  16647. type DiskTypesListCall struct {
  16648. s *Service
  16649. project string
  16650. zone string
  16651. urlParams_ gensupport.URLParams
  16652. ifNoneMatch_ string
  16653. ctx_ context.Context
  16654. header_ http.Header
  16655. }
  16656. // List: Retrieves a list of disk types available to the specified
  16657. // project.
  16658. // For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/list
  16659. func (r *DiskTypesService) List(project string, zone string) *DiskTypesListCall {
  16660. c := &DiskTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16661. c.project = project
  16662. c.zone = zone
  16663. return c
  16664. }
  16665. // Filter sets the optional parameter "filter": Sets a filter
  16666. // {expression} for filtering listed resources. Your {expression} must
  16667. // be in the format: field_name comparison_string literal_string.
  16668. //
  16669. // The field_name is the name of the field you want to compare. Only
  16670. // atomic field types are supported (string, number, boolean). The
  16671. // comparison_string must be either eq (equals) or ne (not equals). The
  16672. // literal_string is the string value to filter to. The literal value
  16673. // must be valid for the type of field you are filtering by (string,
  16674. // number, boolean). For string fields, the literal value is interpreted
  16675. // as a regular expression using RE2 syntax. The literal value must
  16676. // match the entire field.
  16677. //
  16678. // For example, to filter for instances that do not have a name of
  16679. // example-instance, you would use name ne example-instance.
  16680. //
  16681. // You can filter on nested fields. For example, you could filter on
  16682. // instances that have set the scheduling.automaticRestart field to
  16683. // true. Use filtering on nested fields to take advantage of labels to
  16684. // organize and search for results based on label values.
  16685. //
  16686. // To filter on multiple expressions, provide each separate expression
  16687. // within parentheses. For example, (scheduling.automaticRestart eq
  16688. // true) (zone eq us-central1-f). Multiple expressions are treated as
  16689. // AND expressions, meaning that resources must match all expressions to
  16690. // pass the filters.
  16691. func (c *DiskTypesListCall) Filter(filter string) *DiskTypesListCall {
  16692. c.urlParams_.Set("filter", filter)
  16693. return c
  16694. }
  16695. // MaxResults sets the optional parameter "maxResults": The maximum
  16696. // number of results per page that should be returned. If the number of
  16697. // available results is larger than maxResults, Compute Engine returns a
  16698. // nextPageToken that can be used to get the next page of results in
  16699. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  16700. // (Default: 500)
  16701. func (c *DiskTypesListCall) MaxResults(maxResults int64) *DiskTypesListCall {
  16702. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  16703. return c
  16704. }
  16705. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  16706. // a certain order. By default, results are returned in alphanumerical
  16707. // order based on the resource name.
  16708. //
  16709. // You can also sort results in descending order based on the creation
  16710. // timestamp using orderBy="creationTimestamp desc". This sorts results
  16711. // based on the creationTimestamp field in reverse chronological order
  16712. // (newest result first). Use this to sort resources like operations so
  16713. // that the newest operation is returned first.
  16714. //
  16715. // Currently, only sorting by name or creationTimestamp desc is
  16716. // supported.
  16717. func (c *DiskTypesListCall) OrderBy(orderBy string) *DiskTypesListCall {
  16718. c.urlParams_.Set("orderBy", orderBy)
  16719. return c
  16720. }
  16721. // PageToken sets the optional parameter "pageToken": Specifies a page
  16722. // token to use. Set pageToken to the nextPageToken returned by a
  16723. // previous list request to get the next page of results.
  16724. func (c *DiskTypesListCall) PageToken(pageToken string) *DiskTypesListCall {
  16725. c.urlParams_.Set("pageToken", pageToken)
  16726. return c
  16727. }
  16728. // Fields allows partial responses to be retrieved. See
  16729. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16730. // for more information.
  16731. func (c *DiskTypesListCall) Fields(s ...googleapi.Field) *DiskTypesListCall {
  16732. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16733. return c
  16734. }
  16735. // IfNoneMatch sets the optional parameter which makes the operation
  16736. // fail if the object's ETag matches the given value. This is useful for
  16737. // getting updates only after the object has changed since the last
  16738. // request. Use googleapi.IsNotModified to check whether the response
  16739. // error from Do is the result of In-None-Match.
  16740. func (c *DiskTypesListCall) IfNoneMatch(entityTag string) *DiskTypesListCall {
  16741. c.ifNoneMatch_ = entityTag
  16742. return c
  16743. }
  16744. // Context sets the context to be used in this call's Do method. Any
  16745. // pending HTTP request will be aborted if the provided context is
  16746. // canceled.
  16747. func (c *DiskTypesListCall) Context(ctx context.Context) *DiskTypesListCall {
  16748. c.ctx_ = ctx
  16749. return c
  16750. }
  16751. // Header returns an http.Header that can be modified by the caller to
  16752. // add HTTP headers to the request.
  16753. func (c *DiskTypesListCall) Header() http.Header {
  16754. if c.header_ == nil {
  16755. c.header_ = make(http.Header)
  16756. }
  16757. return c.header_
  16758. }
  16759. func (c *DiskTypesListCall) doRequest(alt string) (*http.Response, error) {
  16760. reqHeaders := make(http.Header)
  16761. for k, v := range c.header_ {
  16762. reqHeaders[k] = v
  16763. }
  16764. reqHeaders.Set("User-Agent", c.s.userAgent())
  16765. if c.ifNoneMatch_ != "" {
  16766. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  16767. }
  16768. var body io.Reader = nil
  16769. c.urlParams_.Set("alt", alt)
  16770. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/diskTypes")
  16771. urls += "?" + c.urlParams_.Encode()
  16772. req, _ := http.NewRequest("GET", urls, body)
  16773. req.Header = reqHeaders
  16774. googleapi.Expand(req.URL, map[string]string{
  16775. "project": c.project,
  16776. "zone": c.zone,
  16777. })
  16778. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16779. }
  16780. // Do executes the "compute.diskTypes.list" call.
  16781. // Exactly one of *DiskTypeList or error will be non-nil. Any non-2xx
  16782. // status code is an error. Response headers are in either
  16783. // *DiskTypeList.ServerResponse.Header or (if a response was returned at
  16784. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16785. // to check whether the returned error was because
  16786. // http.StatusNotModified was returned.
  16787. func (c *DiskTypesListCall) Do(opts ...googleapi.CallOption) (*DiskTypeList, error) {
  16788. gensupport.SetOptions(c.urlParams_, opts...)
  16789. res, err := c.doRequest("json")
  16790. if res != nil && res.StatusCode == http.StatusNotModified {
  16791. if res.Body != nil {
  16792. res.Body.Close()
  16793. }
  16794. return nil, &googleapi.Error{
  16795. Code: res.StatusCode,
  16796. Header: res.Header,
  16797. }
  16798. }
  16799. if err != nil {
  16800. return nil, err
  16801. }
  16802. defer googleapi.CloseBody(res)
  16803. if err := googleapi.CheckResponse(res); err != nil {
  16804. return nil, err
  16805. }
  16806. ret := &DiskTypeList{
  16807. ServerResponse: googleapi.ServerResponse{
  16808. Header: res.Header,
  16809. HTTPStatusCode: res.StatusCode,
  16810. },
  16811. }
  16812. target := &ret
  16813. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  16814. return nil, err
  16815. }
  16816. return ret, nil
  16817. // {
  16818. // "description": "Retrieves a list of disk types available to the specified project.",
  16819. // "httpMethod": "GET",
  16820. // "id": "compute.diskTypes.list",
  16821. // "parameterOrder": [
  16822. // "project",
  16823. // "zone"
  16824. // ],
  16825. // "parameters": {
  16826. // "filter": {
  16827. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  16828. // "location": "query",
  16829. // "type": "string"
  16830. // },
  16831. // "maxResults": {
  16832. // "default": "500",
  16833. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  16834. // "format": "uint32",
  16835. // "location": "query",
  16836. // "minimum": "0",
  16837. // "type": "integer"
  16838. // },
  16839. // "orderBy": {
  16840. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  16841. // "location": "query",
  16842. // "type": "string"
  16843. // },
  16844. // "pageToken": {
  16845. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  16846. // "location": "query",
  16847. // "type": "string"
  16848. // },
  16849. // "project": {
  16850. // "description": "Project ID for this request.",
  16851. // "location": "path",
  16852. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  16853. // "required": true,
  16854. // "type": "string"
  16855. // },
  16856. // "zone": {
  16857. // "description": "The name of the zone for this request.",
  16858. // "location": "path",
  16859. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  16860. // "required": true,
  16861. // "type": "string"
  16862. // }
  16863. // },
  16864. // "path": "{project}/zones/{zone}/diskTypes",
  16865. // "response": {
  16866. // "$ref": "DiskTypeList"
  16867. // },
  16868. // "scopes": [
  16869. // "https://www.googleapis.com/auth/cloud-platform",
  16870. // "https://www.googleapis.com/auth/compute",
  16871. // "https://www.googleapis.com/auth/compute.readonly"
  16872. // ]
  16873. // }
  16874. }
  16875. // Pages invokes f for each page of results.
  16876. // A non-nil error returned from f will halt the iteration.
  16877. // The provided context supersedes any context provided to the Context method.
  16878. func (c *DiskTypesListCall) Pages(ctx context.Context, f func(*DiskTypeList) error) error {
  16879. c.ctx_ = ctx
  16880. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  16881. for {
  16882. x, err := c.Do()
  16883. if err != nil {
  16884. return err
  16885. }
  16886. if err := f(x); err != nil {
  16887. return err
  16888. }
  16889. if x.NextPageToken == "" {
  16890. return nil
  16891. }
  16892. c.PageToken(x.NextPageToken)
  16893. }
  16894. }
  16895. // method id "compute.disks.aggregatedList":
  16896. type DisksAggregatedListCall struct {
  16897. s *Service
  16898. project string
  16899. urlParams_ gensupport.URLParams
  16900. ifNoneMatch_ string
  16901. ctx_ context.Context
  16902. header_ http.Header
  16903. }
  16904. // AggregatedList: Retrieves an aggregated list of persistent disks.
  16905. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/aggregatedList
  16906. func (r *DisksService) AggregatedList(project string) *DisksAggregatedListCall {
  16907. c := &DisksAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16908. c.project = project
  16909. return c
  16910. }
  16911. // Filter sets the optional parameter "filter": Sets a filter
  16912. // {expression} for filtering listed resources. Your {expression} must
  16913. // be in the format: field_name comparison_string literal_string.
  16914. //
  16915. // The field_name is the name of the field you want to compare. Only
  16916. // atomic field types are supported (string, number, boolean). The
  16917. // comparison_string must be either eq (equals) or ne (not equals). The
  16918. // literal_string is the string value to filter to. The literal value
  16919. // must be valid for the type of field you are filtering by (string,
  16920. // number, boolean). For string fields, the literal value is interpreted
  16921. // as a regular expression using RE2 syntax. The literal value must
  16922. // match the entire field.
  16923. //
  16924. // For example, to filter for instances that do not have a name of
  16925. // example-instance, you would use name ne example-instance.
  16926. //
  16927. // You can filter on nested fields. For example, you could filter on
  16928. // instances that have set the scheduling.automaticRestart field to
  16929. // true. Use filtering on nested fields to take advantage of labels to
  16930. // organize and search for results based on label values.
  16931. //
  16932. // To filter on multiple expressions, provide each separate expression
  16933. // within parentheses. For example, (scheduling.automaticRestart eq
  16934. // true) (zone eq us-central1-f). Multiple expressions are treated as
  16935. // AND expressions, meaning that resources must match all expressions to
  16936. // pass the filters.
  16937. func (c *DisksAggregatedListCall) Filter(filter string) *DisksAggregatedListCall {
  16938. c.urlParams_.Set("filter", filter)
  16939. return c
  16940. }
  16941. // MaxResults sets the optional parameter "maxResults": The maximum
  16942. // number of results per page that should be returned. If the number of
  16943. // available results is larger than maxResults, Compute Engine returns a
  16944. // nextPageToken that can be used to get the next page of results in
  16945. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  16946. // (Default: 500)
  16947. func (c *DisksAggregatedListCall) MaxResults(maxResults int64) *DisksAggregatedListCall {
  16948. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  16949. return c
  16950. }
  16951. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  16952. // a certain order. By default, results are returned in alphanumerical
  16953. // order based on the resource name.
  16954. //
  16955. // You can also sort results in descending order based on the creation
  16956. // timestamp using orderBy="creationTimestamp desc". This sorts results
  16957. // based on the creationTimestamp field in reverse chronological order
  16958. // (newest result first). Use this to sort resources like operations so
  16959. // that the newest operation is returned first.
  16960. //
  16961. // Currently, only sorting by name or creationTimestamp desc is
  16962. // supported.
  16963. func (c *DisksAggregatedListCall) OrderBy(orderBy string) *DisksAggregatedListCall {
  16964. c.urlParams_.Set("orderBy", orderBy)
  16965. return c
  16966. }
  16967. // PageToken sets the optional parameter "pageToken": Specifies a page
  16968. // token to use. Set pageToken to the nextPageToken returned by a
  16969. // previous list request to get the next page of results.
  16970. func (c *DisksAggregatedListCall) PageToken(pageToken string) *DisksAggregatedListCall {
  16971. c.urlParams_.Set("pageToken", pageToken)
  16972. return c
  16973. }
  16974. // Fields allows partial responses to be retrieved. See
  16975. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16976. // for more information.
  16977. func (c *DisksAggregatedListCall) Fields(s ...googleapi.Field) *DisksAggregatedListCall {
  16978. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16979. return c
  16980. }
  16981. // IfNoneMatch sets the optional parameter which makes the operation
  16982. // fail if the object's ETag matches the given value. This is useful for
  16983. // getting updates only after the object has changed since the last
  16984. // request. Use googleapi.IsNotModified to check whether the response
  16985. // error from Do is the result of In-None-Match.
  16986. func (c *DisksAggregatedListCall) IfNoneMatch(entityTag string) *DisksAggregatedListCall {
  16987. c.ifNoneMatch_ = entityTag
  16988. return c
  16989. }
  16990. // Context sets the context to be used in this call's Do method. Any
  16991. // pending HTTP request will be aborted if the provided context is
  16992. // canceled.
  16993. func (c *DisksAggregatedListCall) Context(ctx context.Context) *DisksAggregatedListCall {
  16994. c.ctx_ = ctx
  16995. return c
  16996. }
  16997. // Header returns an http.Header that can be modified by the caller to
  16998. // add HTTP headers to the request.
  16999. func (c *DisksAggregatedListCall) Header() http.Header {
  17000. if c.header_ == nil {
  17001. c.header_ = make(http.Header)
  17002. }
  17003. return c.header_
  17004. }
  17005. func (c *DisksAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  17006. reqHeaders := make(http.Header)
  17007. for k, v := range c.header_ {
  17008. reqHeaders[k] = v
  17009. }
  17010. reqHeaders.Set("User-Agent", c.s.userAgent())
  17011. if c.ifNoneMatch_ != "" {
  17012. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  17013. }
  17014. var body io.Reader = nil
  17015. c.urlParams_.Set("alt", alt)
  17016. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/disks")
  17017. urls += "?" + c.urlParams_.Encode()
  17018. req, _ := http.NewRequest("GET", urls, body)
  17019. req.Header = reqHeaders
  17020. googleapi.Expand(req.URL, map[string]string{
  17021. "project": c.project,
  17022. })
  17023. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17024. }
  17025. // Do executes the "compute.disks.aggregatedList" call.
  17026. // Exactly one of *DiskAggregatedList or error will be non-nil. Any
  17027. // non-2xx status code is an error. Response headers are in either
  17028. // *DiskAggregatedList.ServerResponse.Header or (if a response was
  17029. // returned at all) in error.(*googleapi.Error).Header. Use
  17030. // googleapi.IsNotModified to check whether the returned error was
  17031. // because http.StatusNotModified was returned.
  17032. func (c *DisksAggregatedListCall) Do(opts ...googleapi.CallOption) (*DiskAggregatedList, error) {
  17033. gensupport.SetOptions(c.urlParams_, opts...)
  17034. res, err := c.doRequest("json")
  17035. if res != nil && res.StatusCode == http.StatusNotModified {
  17036. if res.Body != nil {
  17037. res.Body.Close()
  17038. }
  17039. return nil, &googleapi.Error{
  17040. Code: res.StatusCode,
  17041. Header: res.Header,
  17042. }
  17043. }
  17044. if err != nil {
  17045. return nil, err
  17046. }
  17047. defer googleapi.CloseBody(res)
  17048. if err := googleapi.CheckResponse(res); err != nil {
  17049. return nil, err
  17050. }
  17051. ret := &DiskAggregatedList{
  17052. ServerResponse: googleapi.ServerResponse{
  17053. Header: res.Header,
  17054. HTTPStatusCode: res.StatusCode,
  17055. },
  17056. }
  17057. target := &ret
  17058. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  17059. return nil, err
  17060. }
  17061. return ret, nil
  17062. // {
  17063. // "description": "Retrieves an aggregated list of persistent disks.",
  17064. // "httpMethod": "GET",
  17065. // "id": "compute.disks.aggregatedList",
  17066. // "parameterOrder": [
  17067. // "project"
  17068. // ],
  17069. // "parameters": {
  17070. // "filter": {
  17071. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  17072. // "location": "query",
  17073. // "type": "string"
  17074. // },
  17075. // "maxResults": {
  17076. // "default": "500",
  17077. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  17078. // "format": "uint32",
  17079. // "location": "query",
  17080. // "minimum": "0",
  17081. // "type": "integer"
  17082. // },
  17083. // "orderBy": {
  17084. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  17085. // "location": "query",
  17086. // "type": "string"
  17087. // },
  17088. // "pageToken": {
  17089. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  17090. // "location": "query",
  17091. // "type": "string"
  17092. // },
  17093. // "project": {
  17094. // "description": "Project ID for this request.",
  17095. // "location": "path",
  17096. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  17097. // "required": true,
  17098. // "type": "string"
  17099. // }
  17100. // },
  17101. // "path": "{project}/aggregated/disks",
  17102. // "response": {
  17103. // "$ref": "DiskAggregatedList"
  17104. // },
  17105. // "scopes": [
  17106. // "https://www.googleapis.com/auth/cloud-platform",
  17107. // "https://www.googleapis.com/auth/compute",
  17108. // "https://www.googleapis.com/auth/compute.readonly"
  17109. // ]
  17110. // }
  17111. }
  17112. // Pages invokes f for each page of results.
  17113. // A non-nil error returned from f will halt the iteration.
  17114. // The provided context supersedes any context provided to the Context method.
  17115. func (c *DisksAggregatedListCall) Pages(ctx context.Context, f func(*DiskAggregatedList) error) error {
  17116. c.ctx_ = ctx
  17117. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  17118. for {
  17119. x, err := c.Do()
  17120. if err != nil {
  17121. return err
  17122. }
  17123. if err := f(x); err != nil {
  17124. return err
  17125. }
  17126. if x.NextPageToken == "" {
  17127. return nil
  17128. }
  17129. c.PageToken(x.NextPageToken)
  17130. }
  17131. }
  17132. // method id "compute.disks.createSnapshot":
  17133. type DisksCreateSnapshotCall struct {
  17134. s *Service
  17135. project string
  17136. zone string
  17137. disk string
  17138. snapshot *Snapshot
  17139. urlParams_ gensupport.URLParams
  17140. ctx_ context.Context
  17141. header_ http.Header
  17142. }
  17143. // CreateSnapshot: Creates a snapshot of a specified persistent disk.
  17144. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/createSnapshot
  17145. func (r *DisksService) CreateSnapshot(project string, zone string, disk string, snapshot *Snapshot) *DisksCreateSnapshotCall {
  17146. c := &DisksCreateSnapshotCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17147. c.project = project
  17148. c.zone = zone
  17149. c.disk = disk
  17150. c.snapshot = snapshot
  17151. return c
  17152. }
  17153. // GuestFlush sets the optional parameter "guestFlush":
  17154. func (c *DisksCreateSnapshotCall) GuestFlush(guestFlush bool) *DisksCreateSnapshotCall {
  17155. c.urlParams_.Set("guestFlush", fmt.Sprint(guestFlush))
  17156. return c
  17157. }
  17158. // Fields allows partial responses to be retrieved. See
  17159. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17160. // for more information.
  17161. func (c *DisksCreateSnapshotCall) Fields(s ...googleapi.Field) *DisksCreateSnapshotCall {
  17162. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17163. return c
  17164. }
  17165. // Context sets the context to be used in this call's Do method. Any
  17166. // pending HTTP request will be aborted if the provided context is
  17167. // canceled.
  17168. func (c *DisksCreateSnapshotCall) Context(ctx context.Context) *DisksCreateSnapshotCall {
  17169. c.ctx_ = ctx
  17170. return c
  17171. }
  17172. // Header returns an http.Header that can be modified by the caller to
  17173. // add HTTP headers to the request.
  17174. func (c *DisksCreateSnapshotCall) Header() http.Header {
  17175. if c.header_ == nil {
  17176. c.header_ = make(http.Header)
  17177. }
  17178. return c.header_
  17179. }
  17180. func (c *DisksCreateSnapshotCall) doRequest(alt string) (*http.Response, error) {
  17181. reqHeaders := make(http.Header)
  17182. for k, v := range c.header_ {
  17183. reqHeaders[k] = v
  17184. }
  17185. reqHeaders.Set("User-Agent", c.s.userAgent())
  17186. var body io.Reader = nil
  17187. body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot)
  17188. if err != nil {
  17189. return nil, err
  17190. }
  17191. reqHeaders.Set("Content-Type", "application/json")
  17192. c.urlParams_.Set("alt", alt)
  17193. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}/createSnapshot")
  17194. urls += "?" + c.urlParams_.Encode()
  17195. req, _ := http.NewRequest("POST", urls, body)
  17196. req.Header = reqHeaders
  17197. googleapi.Expand(req.URL, map[string]string{
  17198. "project": c.project,
  17199. "zone": c.zone,
  17200. "disk": c.disk,
  17201. })
  17202. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17203. }
  17204. // Do executes the "compute.disks.createSnapshot" call.
  17205. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  17206. // status code is an error. Response headers are in either
  17207. // *Operation.ServerResponse.Header or (if a response was returned at
  17208. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  17209. // to check whether the returned error was because
  17210. // http.StatusNotModified was returned.
  17211. func (c *DisksCreateSnapshotCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  17212. gensupport.SetOptions(c.urlParams_, opts...)
  17213. res, err := c.doRequest("json")
  17214. if res != nil && res.StatusCode == http.StatusNotModified {
  17215. if res.Body != nil {
  17216. res.Body.Close()
  17217. }
  17218. return nil, &googleapi.Error{
  17219. Code: res.StatusCode,
  17220. Header: res.Header,
  17221. }
  17222. }
  17223. if err != nil {
  17224. return nil, err
  17225. }
  17226. defer googleapi.CloseBody(res)
  17227. if err := googleapi.CheckResponse(res); err != nil {
  17228. return nil, err
  17229. }
  17230. ret := &Operation{
  17231. ServerResponse: googleapi.ServerResponse{
  17232. Header: res.Header,
  17233. HTTPStatusCode: res.StatusCode,
  17234. },
  17235. }
  17236. target := &ret
  17237. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  17238. return nil, err
  17239. }
  17240. return ret, nil
  17241. // {
  17242. // "description": "Creates a snapshot of a specified persistent disk.",
  17243. // "httpMethod": "POST",
  17244. // "id": "compute.disks.createSnapshot",
  17245. // "parameterOrder": [
  17246. // "project",
  17247. // "zone",
  17248. // "disk"
  17249. // ],
  17250. // "parameters": {
  17251. // "disk": {
  17252. // "description": "Name of the persistent disk to snapshot.",
  17253. // "location": "path",
  17254. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  17255. // "required": true,
  17256. // "type": "string"
  17257. // },
  17258. // "guestFlush": {
  17259. // "location": "query",
  17260. // "type": "boolean"
  17261. // },
  17262. // "project": {
  17263. // "description": "Project ID for this request.",
  17264. // "location": "path",
  17265. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  17266. // "required": true,
  17267. // "type": "string"
  17268. // },
  17269. // "zone": {
  17270. // "description": "The name of the zone for this request.",
  17271. // "location": "path",
  17272. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  17273. // "required": true,
  17274. // "type": "string"
  17275. // }
  17276. // },
  17277. // "path": "{project}/zones/{zone}/disks/{disk}/createSnapshot",
  17278. // "request": {
  17279. // "$ref": "Snapshot"
  17280. // },
  17281. // "response": {
  17282. // "$ref": "Operation"
  17283. // },
  17284. // "scopes": [
  17285. // "https://www.googleapis.com/auth/cloud-platform",
  17286. // "https://www.googleapis.com/auth/compute"
  17287. // ]
  17288. // }
  17289. }
  17290. // method id "compute.disks.delete":
  17291. type DisksDeleteCall struct {
  17292. s *Service
  17293. project string
  17294. zone string
  17295. disk string
  17296. urlParams_ gensupport.URLParams
  17297. ctx_ context.Context
  17298. header_ http.Header
  17299. }
  17300. // Delete: Deletes the specified persistent disk. Deleting a disk
  17301. // removes its data permanently and is irreversible. However, deleting a
  17302. // disk does not delete any snapshots previously made from the disk. You
  17303. // must separately delete snapshots.
  17304. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/delete
  17305. func (r *DisksService) Delete(project string, zone string, disk string) *DisksDeleteCall {
  17306. c := &DisksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17307. c.project = project
  17308. c.zone = zone
  17309. c.disk = disk
  17310. return c
  17311. }
  17312. // Fields allows partial responses to be retrieved. See
  17313. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17314. // for more information.
  17315. func (c *DisksDeleteCall) Fields(s ...googleapi.Field) *DisksDeleteCall {
  17316. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17317. return c
  17318. }
  17319. // Context sets the context to be used in this call's Do method. Any
  17320. // pending HTTP request will be aborted if the provided context is
  17321. // canceled.
  17322. func (c *DisksDeleteCall) Context(ctx context.Context) *DisksDeleteCall {
  17323. c.ctx_ = ctx
  17324. return c
  17325. }
  17326. // Header returns an http.Header that can be modified by the caller to
  17327. // add HTTP headers to the request.
  17328. func (c *DisksDeleteCall) Header() http.Header {
  17329. if c.header_ == nil {
  17330. c.header_ = make(http.Header)
  17331. }
  17332. return c.header_
  17333. }
  17334. func (c *DisksDeleteCall) doRequest(alt string) (*http.Response, error) {
  17335. reqHeaders := make(http.Header)
  17336. for k, v := range c.header_ {
  17337. reqHeaders[k] = v
  17338. }
  17339. reqHeaders.Set("User-Agent", c.s.userAgent())
  17340. var body io.Reader = nil
  17341. c.urlParams_.Set("alt", alt)
  17342. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}")
  17343. urls += "?" + c.urlParams_.Encode()
  17344. req, _ := http.NewRequest("DELETE", urls, body)
  17345. req.Header = reqHeaders
  17346. googleapi.Expand(req.URL, map[string]string{
  17347. "project": c.project,
  17348. "zone": c.zone,
  17349. "disk": c.disk,
  17350. })
  17351. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17352. }
  17353. // Do executes the "compute.disks.delete" call.
  17354. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  17355. // status code is an error. Response headers are in either
  17356. // *Operation.ServerResponse.Header or (if a response was returned at
  17357. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  17358. // to check whether the returned error was because
  17359. // http.StatusNotModified was returned.
  17360. func (c *DisksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  17361. gensupport.SetOptions(c.urlParams_, opts...)
  17362. res, err := c.doRequest("json")
  17363. if res != nil && res.StatusCode == http.StatusNotModified {
  17364. if res.Body != nil {
  17365. res.Body.Close()
  17366. }
  17367. return nil, &googleapi.Error{
  17368. Code: res.StatusCode,
  17369. Header: res.Header,
  17370. }
  17371. }
  17372. if err != nil {
  17373. return nil, err
  17374. }
  17375. defer googleapi.CloseBody(res)
  17376. if err := googleapi.CheckResponse(res); err != nil {
  17377. return nil, err
  17378. }
  17379. ret := &Operation{
  17380. ServerResponse: googleapi.ServerResponse{
  17381. Header: res.Header,
  17382. HTTPStatusCode: res.StatusCode,
  17383. },
  17384. }
  17385. target := &ret
  17386. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  17387. return nil, err
  17388. }
  17389. return ret, nil
  17390. // {
  17391. // "description": "Deletes the specified persistent disk. Deleting a disk removes its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots.",
  17392. // "httpMethod": "DELETE",
  17393. // "id": "compute.disks.delete",
  17394. // "parameterOrder": [
  17395. // "project",
  17396. // "zone",
  17397. // "disk"
  17398. // ],
  17399. // "parameters": {
  17400. // "disk": {
  17401. // "description": "Name of the persistent disk to delete.",
  17402. // "location": "path",
  17403. // "required": true,
  17404. // "type": "string"
  17405. // },
  17406. // "project": {
  17407. // "description": "Project ID for this request.",
  17408. // "location": "path",
  17409. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  17410. // "required": true,
  17411. // "type": "string"
  17412. // },
  17413. // "zone": {
  17414. // "description": "The name of the zone for this request.",
  17415. // "location": "path",
  17416. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  17417. // "required": true,
  17418. // "type": "string"
  17419. // }
  17420. // },
  17421. // "path": "{project}/zones/{zone}/disks/{disk}",
  17422. // "response": {
  17423. // "$ref": "Operation"
  17424. // },
  17425. // "scopes": [
  17426. // "https://www.googleapis.com/auth/cloud-platform",
  17427. // "https://www.googleapis.com/auth/compute"
  17428. // ]
  17429. // }
  17430. }
  17431. // method id "compute.disks.get":
  17432. type DisksGetCall struct {
  17433. s *Service
  17434. project string
  17435. zone string
  17436. disk string
  17437. urlParams_ gensupport.URLParams
  17438. ifNoneMatch_ string
  17439. ctx_ context.Context
  17440. header_ http.Header
  17441. }
  17442. // Get: Returns a specified persistent disk. Get a list of available
  17443. // persistent disks by making a list() request.
  17444. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/get
  17445. func (r *DisksService) Get(project string, zone string, disk string) *DisksGetCall {
  17446. c := &DisksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17447. c.project = project
  17448. c.zone = zone
  17449. c.disk = disk
  17450. return c
  17451. }
  17452. // Fields allows partial responses to be retrieved. See
  17453. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17454. // for more information.
  17455. func (c *DisksGetCall) Fields(s ...googleapi.Field) *DisksGetCall {
  17456. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17457. return c
  17458. }
  17459. // IfNoneMatch sets the optional parameter which makes the operation
  17460. // fail if the object's ETag matches the given value. This is useful for
  17461. // getting updates only after the object has changed since the last
  17462. // request. Use googleapi.IsNotModified to check whether the response
  17463. // error from Do is the result of In-None-Match.
  17464. func (c *DisksGetCall) IfNoneMatch(entityTag string) *DisksGetCall {
  17465. c.ifNoneMatch_ = entityTag
  17466. return c
  17467. }
  17468. // Context sets the context to be used in this call's Do method. Any
  17469. // pending HTTP request will be aborted if the provided context is
  17470. // canceled.
  17471. func (c *DisksGetCall) Context(ctx context.Context) *DisksGetCall {
  17472. c.ctx_ = ctx
  17473. return c
  17474. }
  17475. // Header returns an http.Header that can be modified by the caller to
  17476. // add HTTP headers to the request.
  17477. func (c *DisksGetCall) Header() http.Header {
  17478. if c.header_ == nil {
  17479. c.header_ = make(http.Header)
  17480. }
  17481. return c.header_
  17482. }
  17483. func (c *DisksGetCall) doRequest(alt string) (*http.Response, error) {
  17484. reqHeaders := make(http.Header)
  17485. for k, v := range c.header_ {
  17486. reqHeaders[k] = v
  17487. }
  17488. reqHeaders.Set("User-Agent", c.s.userAgent())
  17489. if c.ifNoneMatch_ != "" {
  17490. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  17491. }
  17492. var body io.Reader = nil
  17493. c.urlParams_.Set("alt", alt)
  17494. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}")
  17495. urls += "?" + c.urlParams_.Encode()
  17496. req, _ := http.NewRequest("GET", urls, body)
  17497. req.Header = reqHeaders
  17498. googleapi.Expand(req.URL, map[string]string{
  17499. "project": c.project,
  17500. "zone": c.zone,
  17501. "disk": c.disk,
  17502. })
  17503. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17504. }
  17505. // Do executes the "compute.disks.get" call.
  17506. // Exactly one of *Disk or error will be non-nil. Any non-2xx status
  17507. // code is an error. Response headers are in either
  17508. // *Disk.ServerResponse.Header or (if a response was returned at all) in
  17509. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  17510. // whether the returned error was because http.StatusNotModified was
  17511. // returned.
  17512. func (c *DisksGetCall) Do(opts ...googleapi.CallOption) (*Disk, error) {
  17513. gensupport.SetOptions(c.urlParams_, opts...)
  17514. res, err := c.doRequest("json")
  17515. if res != nil && res.StatusCode == http.StatusNotModified {
  17516. if res.Body != nil {
  17517. res.Body.Close()
  17518. }
  17519. return nil, &googleapi.Error{
  17520. Code: res.StatusCode,
  17521. Header: res.Header,
  17522. }
  17523. }
  17524. if err != nil {
  17525. return nil, err
  17526. }
  17527. defer googleapi.CloseBody(res)
  17528. if err := googleapi.CheckResponse(res); err != nil {
  17529. return nil, err
  17530. }
  17531. ret := &Disk{
  17532. ServerResponse: googleapi.ServerResponse{
  17533. Header: res.Header,
  17534. HTTPStatusCode: res.StatusCode,
  17535. },
  17536. }
  17537. target := &ret
  17538. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  17539. return nil, err
  17540. }
  17541. return ret, nil
  17542. // {
  17543. // "description": "Returns a specified persistent disk. Get a list of available persistent disks by making a list() request.",
  17544. // "httpMethod": "GET",
  17545. // "id": "compute.disks.get",
  17546. // "parameterOrder": [
  17547. // "project",
  17548. // "zone",
  17549. // "disk"
  17550. // ],
  17551. // "parameters": {
  17552. // "disk": {
  17553. // "description": "Name of the persistent disk to return.",
  17554. // "location": "path",
  17555. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  17556. // "required": true,
  17557. // "type": "string"
  17558. // },
  17559. // "project": {
  17560. // "description": "Project ID for this request.",
  17561. // "location": "path",
  17562. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  17563. // "required": true,
  17564. // "type": "string"
  17565. // },
  17566. // "zone": {
  17567. // "description": "The name of the zone for this request.",
  17568. // "location": "path",
  17569. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  17570. // "required": true,
  17571. // "type": "string"
  17572. // }
  17573. // },
  17574. // "path": "{project}/zones/{zone}/disks/{disk}",
  17575. // "response": {
  17576. // "$ref": "Disk"
  17577. // },
  17578. // "scopes": [
  17579. // "https://www.googleapis.com/auth/cloud-platform",
  17580. // "https://www.googleapis.com/auth/compute",
  17581. // "https://www.googleapis.com/auth/compute.readonly"
  17582. // ]
  17583. // }
  17584. }
  17585. // method id "compute.disks.insert":
  17586. type DisksInsertCall struct {
  17587. s *Service
  17588. project string
  17589. zone string
  17590. disk *Disk
  17591. urlParams_ gensupport.URLParams
  17592. ctx_ context.Context
  17593. header_ http.Header
  17594. }
  17595. // Insert: Creates a persistent disk in the specified project using the
  17596. // data in the request. You can create a disk with a sourceImage, a
  17597. // sourceSnapshot, or create an empty 500 GB data disk by omitting all
  17598. // properties. You can also create a disk that is larger than the
  17599. // default size by specifying the sizeGb property.
  17600. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/insert
  17601. func (r *DisksService) Insert(project string, zone string, disk *Disk) *DisksInsertCall {
  17602. c := &DisksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17603. c.project = project
  17604. c.zone = zone
  17605. c.disk = disk
  17606. return c
  17607. }
  17608. // SourceImage sets the optional parameter "sourceImage": Source image
  17609. // to restore onto a disk.
  17610. func (c *DisksInsertCall) SourceImage(sourceImage string) *DisksInsertCall {
  17611. c.urlParams_.Set("sourceImage", sourceImage)
  17612. return c
  17613. }
  17614. // Fields allows partial responses to be retrieved. See
  17615. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17616. // for more information.
  17617. func (c *DisksInsertCall) Fields(s ...googleapi.Field) *DisksInsertCall {
  17618. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17619. return c
  17620. }
  17621. // Context sets the context to be used in this call's Do method. Any
  17622. // pending HTTP request will be aborted if the provided context is
  17623. // canceled.
  17624. func (c *DisksInsertCall) Context(ctx context.Context) *DisksInsertCall {
  17625. c.ctx_ = ctx
  17626. return c
  17627. }
  17628. // Header returns an http.Header that can be modified by the caller to
  17629. // add HTTP headers to the request.
  17630. func (c *DisksInsertCall) Header() http.Header {
  17631. if c.header_ == nil {
  17632. c.header_ = make(http.Header)
  17633. }
  17634. return c.header_
  17635. }
  17636. func (c *DisksInsertCall) doRequest(alt string) (*http.Response, error) {
  17637. reqHeaders := make(http.Header)
  17638. for k, v := range c.header_ {
  17639. reqHeaders[k] = v
  17640. }
  17641. reqHeaders.Set("User-Agent", c.s.userAgent())
  17642. var body io.Reader = nil
  17643. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk)
  17644. if err != nil {
  17645. return nil, err
  17646. }
  17647. reqHeaders.Set("Content-Type", "application/json")
  17648. c.urlParams_.Set("alt", alt)
  17649. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks")
  17650. urls += "?" + c.urlParams_.Encode()
  17651. req, _ := http.NewRequest("POST", urls, body)
  17652. req.Header = reqHeaders
  17653. googleapi.Expand(req.URL, map[string]string{
  17654. "project": c.project,
  17655. "zone": c.zone,
  17656. })
  17657. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17658. }
  17659. // Do executes the "compute.disks.insert" call.
  17660. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  17661. // status code is an error. Response headers are in either
  17662. // *Operation.ServerResponse.Header or (if a response was returned at
  17663. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  17664. // to check whether the returned error was because
  17665. // http.StatusNotModified was returned.
  17666. func (c *DisksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  17667. gensupport.SetOptions(c.urlParams_, opts...)
  17668. res, err := c.doRequest("json")
  17669. if res != nil && res.StatusCode == http.StatusNotModified {
  17670. if res.Body != nil {
  17671. res.Body.Close()
  17672. }
  17673. return nil, &googleapi.Error{
  17674. Code: res.StatusCode,
  17675. Header: res.Header,
  17676. }
  17677. }
  17678. if err != nil {
  17679. return nil, err
  17680. }
  17681. defer googleapi.CloseBody(res)
  17682. if err := googleapi.CheckResponse(res); err != nil {
  17683. return nil, err
  17684. }
  17685. ret := &Operation{
  17686. ServerResponse: googleapi.ServerResponse{
  17687. Header: res.Header,
  17688. HTTPStatusCode: res.StatusCode,
  17689. },
  17690. }
  17691. target := &ret
  17692. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  17693. return nil, err
  17694. }
  17695. return ret, nil
  17696. // {
  17697. // "description": "Creates a persistent disk in the specified project using the data in the request. You can create a disk with a sourceImage, a sourceSnapshot, or create an empty 500 GB data disk by omitting all properties. You can also create a disk that is larger than the default size by specifying the sizeGb property.",
  17698. // "httpMethod": "POST",
  17699. // "id": "compute.disks.insert",
  17700. // "parameterOrder": [
  17701. // "project",
  17702. // "zone"
  17703. // ],
  17704. // "parameters": {
  17705. // "project": {
  17706. // "description": "Project ID for this request.",
  17707. // "location": "path",
  17708. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  17709. // "required": true,
  17710. // "type": "string"
  17711. // },
  17712. // "sourceImage": {
  17713. // "description": "Optional. Source image to restore onto a disk.",
  17714. // "location": "query",
  17715. // "type": "string"
  17716. // },
  17717. // "zone": {
  17718. // "description": "The name of the zone for this request.",
  17719. // "location": "path",
  17720. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  17721. // "required": true,
  17722. // "type": "string"
  17723. // }
  17724. // },
  17725. // "path": "{project}/zones/{zone}/disks",
  17726. // "request": {
  17727. // "$ref": "Disk"
  17728. // },
  17729. // "response": {
  17730. // "$ref": "Operation"
  17731. // },
  17732. // "scopes": [
  17733. // "https://www.googleapis.com/auth/cloud-platform",
  17734. // "https://www.googleapis.com/auth/compute"
  17735. // ]
  17736. // }
  17737. }
  17738. // method id "compute.disks.list":
  17739. type DisksListCall struct {
  17740. s *Service
  17741. project string
  17742. zone string
  17743. urlParams_ gensupport.URLParams
  17744. ifNoneMatch_ string
  17745. ctx_ context.Context
  17746. header_ http.Header
  17747. }
  17748. // List: Retrieves a list of persistent disks contained within the
  17749. // specified zone.
  17750. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/list
  17751. func (r *DisksService) List(project string, zone string) *DisksListCall {
  17752. c := &DisksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17753. c.project = project
  17754. c.zone = zone
  17755. return c
  17756. }
  17757. // Filter sets the optional parameter "filter": Sets a filter
  17758. // {expression} for filtering listed resources. Your {expression} must
  17759. // be in the format: field_name comparison_string literal_string.
  17760. //
  17761. // The field_name is the name of the field you want to compare. Only
  17762. // atomic field types are supported (string, number, boolean). The
  17763. // comparison_string must be either eq (equals) or ne (not equals). The
  17764. // literal_string is the string value to filter to. The literal value
  17765. // must be valid for the type of field you are filtering by (string,
  17766. // number, boolean). For string fields, the literal value is interpreted
  17767. // as a regular expression using RE2 syntax. The literal value must
  17768. // match the entire field.
  17769. //
  17770. // For example, to filter for instances that do not have a name of
  17771. // example-instance, you would use name ne example-instance.
  17772. //
  17773. // You can filter on nested fields. For example, you could filter on
  17774. // instances that have set the scheduling.automaticRestart field to
  17775. // true. Use filtering on nested fields to take advantage of labels to
  17776. // organize and search for results based on label values.
  17777. //
  17778. // To filter on multiple expressions, provide each separate expression
  17779. // within parentheses. For example, (scheduling.automaticRestart eq
  17780. // true) (zone eq us-central1-f). Multiple expressions are treated as
  17781. // AND expressions, meaning that resources must match all expressions to
  17782. // pass the filters.
  17783. func (c *DisksListCall) Filter(filter string) *DisksListCall {
  17784. c.urlParams_.Set("filter", filter)
  17785. return c
  17786. }
  17787. // MaxResults sets the optional parameter "maxResults": The maximum
  17788. // number of results per page that should be returned. If the number of
  17789. // available results is larger than maxResults, Compute Engine returns a
  17790. // nextPageToken that can be used to get the next page of results in
  17791. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  17792. // (Default: 500)
  17793. func (c *DisksListCall) MaxResults(maxResults int64) *DisksListCall {
  17794. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  17795. return c
  17796. }
  17797. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  17798. // a certain order. By default, results are returned in alphanumerical
  17799. // order based on the resource name.
  17800. //
  17801. // You can also sort results in descending order based on the creation
  17802. // timestamp using orderBy="creationTimestamp desc". This sorts results
  17803. // based on the creationTimestamp field in reverse chronological order
  17804. // (newest result first). Use this to sort resources like operations so
  17805. // that the newest operation is returned first.
  17806. //
  17807. // Currently, only sorting by name or creationTimestamp desc is
  17808. // supported.
  17809. func (c *DisksListCall) OrderBy(orderBy string) *DisksListCall {
  17810. c.urlParams_.Set("orderBy", orderBy)
  17811. return c
  17812. }
  17813. // PageToken sets the optional parameter "pageToken": Specifies a page
  17814. // token to use. Set pageToken to the nextPageToken returned by a
  17815. // previous list request to get the next page of results.
  17816. func (c *DisksListCall) PageToken(pageToken string) *DisksListCall {
  17817. c.urlParams_.Set("pageToken", pageToken)
  17818. return c
  17819. }
  17820. // Fields allows partial responses to be retrieved. See
  17821. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17822. // for more information.
  17823. func (c *DisksListCall) Fields(s ...googleapi.Field) *DisksListCall {
  17824. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17825. return c
  17826. }
  17827. // IfNoneMatch sets the optional parameter which makes the operation
  17828. // fail if the object's ETag matches the given value. This is useful for
  17829. // getting updates only after the object has changed since the last
  17830. // request. Use googleapi.IsNotModified to check whether the response
  17831. // error from Do is the result of In-None-Match.
  17832. func (c *DisksListCall) IfNoneMatch(entityTag string) *DisksListCall {
  17833. c.ifNoneMatch_ = entityTag
  17834. return c
  17835. }
  17836. // Context sets the context to be used in this call's Do method. Any
  17837. // pending HTTP request will be aborted if the provided context is
  17838. // canceled.
  17839. func (c *DisksListCall) Context(ctx context.Context) *DisksListCall {
  17840. c.ctx_ = ctx
  17841. return c
  17842. }
  17843. // Header returns an http.Header that can be modified by the caller to
  17844. // add HTTP headers to the request.
  17845. func (c *DisksListCall) Header() http.Header {
  17846. if c.header_ == nil {
  17847. c.header_ = make(http.Header)
  17848. }
  17849. return c.header_
  17850. }
  17851. func (c *DisksListCall) doRequest(alt string) (*http.Response, error) {
  17852. reqHeaders := make(http.Header)
  17853. for k, v := range c.header_ {
  17854. reqHeaders[k] = v
  17855. }
  17856. reqHeaders.Set("User-Agent", c.s.userAgent())
  17857. if c.ifNoneMatch_ != "" {
  17858. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  17859. }
  17860. var body io.Reader = nil
  17861. c.urlParams_.Set("alt", alt)
  17862. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks")
  17863. urls += "?" + c.urlParams_.Encode()
  17864. req, _ := http.NewRequest("GET", urls, body)
  17865. req.Header = reqHeaders
  17866. googleapi.Expand(req.URL, map[string]string{
  17867. "project": c.project,
  17868. "zone": c.zone,
  17869. })
  17870. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17871. }
  17872. // Do executes the "compute.disks.list" call.
  17873. // Exactly one of *DiskList or error will be non-nil. Any non-2xx status
  17874. // code is an error. Response headers are in either
  17875. // *DiskList.ServerResponse.Header or (if a response was returned at
  17876. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  17877. // to check whether the returned error was because
  17878. // http.StatusNotModified was returned.
  17879. func (c *DisksListCall) Do(opts ...googleapi.CallOption) (*DiskList, error) {
  17880. gensupport.SetOptions(c.urlParams_, opts...)
  17881. res, err := c.doRequest("json")
  17882. if res != nil && res.StatusCode == http.StatusNotModified {
  17883. if res.Body != nil {
  17884. res.Body.Close()
  17885. }
  17886. return nil, &googleapi.Error{
  17887. Code: res.StatusCode,
  17888. Header: res.Header,
  17889. }
  17890. }
  17891. if err != nil {
  17892. return nil, err
  17893. }
  17894. defer googleapi.CloseBody(res)
  17895. if err := googleapi.CheckResponse(res); err != nil {
  17896. return nil, err
  17897. }
  17898. ret := &DiskList{
  17899. ServerResponse: googleapi.ServerResponse{
  17900. Header: res.Header,
  17901. HTTPStatusCode: res.StatusCode,
  17902. },
  17903. }
  17904. target := &ret
  17905. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  17906. return nil, err
  17907. }
  17908. return ret, nil
  17909. // {
  17910. // "description": "Retrieves a list of persistent disks contained within the specified zone.",
  17911. // "httpMethod": "GET",
  17912. // "id": "compute.disks.list",
  17913. // "parameterOrder": [
  17914. // "project",
  17915. // "zone"
  17916. // ],
  17917. // "parameters": {
  17918. // "filter": {
  17919. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  17920. // "location": "query",
  17921. // "type": "string"
  17922. // },
  17923. // "maxResults": {
  17924. // "default": "500",
  17925. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  17926. // "format": "uint32",
  17927. // "location": "query",
  17928. // "minimum": "0",
  17929. // "type": "integer"
  17930. // },
  17931. // "orderBy": {
  17932. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  17933. // "location": "query",
  17934. // "type": "string"
  17935. // },
  17936. // "pageToken": {
  17937. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  17938. // "location": "query",
  17939. // "type": "string"
  17940. // },
  17941. // "project": {
  17942. // "description": "Project ID for this request.",
  17943. // "location": "path",
  17944. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  17945. // "required": true,
  17946. // "type": "string"
  17947. // },
  17948. // "zone": {
  17949. // "description": "The name of the zone for this request.",
  17950. // "location": "path",
  17951. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  17952. // "required": true,
  17953. // "type": "string"
  17954. // }
  17955. // },
  17956. // "path": "{project}/zones/{zone}/disks",
  17957. // "response": {
  17958. // "$ref": "DiskList"
  17959. // },
  17960. // "scopes": [
  17961. // "https://www.googleapis.com/auth/cloud-platform",
  17962. // "https://www.googleapis.com/auth/compute",
  17963. // "https://www.googleapis.com/auth/compute.readonly"
  17964. // ]
  17965. // }
  17966. }
  17967. // Pages invokes f for each page of results.
  17968. // A non-nil error returned from f will halt the iteration.
  17969. // The provided context supersedes any context provided to the Context method.
  17970. func (c *DisksListCall) Pages(ctx context.Context, f func(*DiskList) error) error {
  17971. c.ctx_ = ctx
  17972. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  17973. for {
  17974. x, err := c.Do()
  17975. if err != nil {
  17976. return err
  17977. }
  17978. if err := f(x); err != nil {
  17979. return err
  17980. }
  17981. if x.NextPageToken == "" {
  17982. return nil
  17983. }
  17984. c.PageToken(x.NextPageToken)
  17985. }
  17986. }
  17987. // method id "compute.disks.resize":
  17988. type DisksResizeCall struct {
  17989. s *Service
  17990. project string
  17991. zone string
  17992. disk string
  17993. disksresizerequest *DisksResizeRequest
  17994. urlParams_ gensupport.URLParams
  17995. ctx_ context.Context
  17996. header_ http.Header
  17997. }
  17998. // Resize: Resizes the specified persistent disk.
  17999. func (r *DisksService) Resize(project string, zone string, disk string, disksresizerequest *DisksResizeRequest) *DisksResizeCall {
  18000. c := &DisksResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18001. c.project = project
  18002. c.zone = zone
  18003. c.disk = disk
  18004. c.disksresizerequest = disksresizerequest
  18005. return c
  18006. }
  18007. // Fields allows partial responses to be retrieved. See
  18008. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18009. // for more information.
  18010. func (c *DisksResizeCall) Fields(s ...googleapi.Field) *DisksResizeCall {
  18011. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18012. return c
  18013. }
  18014. // Context sets the context to be used in this call's Do method. Any
  18015. // pending HTTP request will be aborted if the provided context is
  18016. // canceled.
  18017. func (c *DisksResizeCall) Context(ctx context.Context) *DisksResizeCall {
  18018. c.ctx_ = ctx
  18019. return c
  18020. }
  18021. // Header returns an http.Header that can be modified by the caller to
  18022. // add HTTP headers to the request.
  18023. func (c *DisksResizeCall) Header() http.Header {
  18024. if c.header_ == nil {
  18025. c.header_ = make(http.Header)
  18026. }
  18027. return c.header_
  18028. }
  18029. func (c *DisksResizeCall) doRequest(alt string) (*http.Response, error) {
  18030. reqHeaders := make(http.Header)
  18031. for k, v := range c.header_ {
  18032. reqHeaders[k] = v
  18033. }
  18034. reqHeaders.Set("User-Agent", c.s.userAgent())
  18035. var body io.Reader = nil
  18036. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksresizerequest)
  18037. if err != nil {
  18038. return nil, err
  18039. }
  18040. reqHeaders.Set("Content-Type", "application/json")
  18041. c.urlParams_.Set("alt", alt)
  18042. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}/resize")
  18043. urls += "?" + c.urlParams_.Encode()
  18044. req, _ := http.NewRequest("POST", urls, body)
  18045. req.Header = reqHeaders
  18046. googleapi.Expand(req.URL, map[string]string{
  18047. "project": c.project,
  18048. "zone": c.zone,
  18049. "disk": c.disk,
  18050. })
  18051. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18052. }
  18053. // Do executes the "compute.disks.resize" call.
  18054. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  18055. // status code is an error. Response headers are in either
  18056. // *Operation.ServerResponse.Header or (if a response was returned at
  18057. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  18058. // to check whether the returned error was because
  18059. // http.StatusNotModified was returned.
  18060. func (c *DisksResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  18061. gensupport.SetOptions(c.urlParams_, opts...)
  18062. res, err := c.doRequest("json")
  18063. if res != nil && res.StatusCode == http.StatusNotModified {
  18064. if res.Body != nil {
  18065. res.Body.Close()
  18066. }
  18067. return nil, &googleapi.Error{
  18068. Code: res.StatusCode,
  18069. Header: res.Header,
  18070. }
  18071. }
  18072. if err != nil {
  18073. return nil, err
  18074. }
  18075. defer googleapi.CloseBody(res)
  18076. if err := googleapi.CheckResponse(res); err != nil {
  18077. return nil, err
  18078. }
  18079. ret := &Operation{
  18080. ServerResponse: googleapi.ServerResponse{
  18081. Header: res.Header,
  18082. HTTPStatusCode: res.StatusCode,
  18083. },
  18084. }
  18085. target := &ret
  18086. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  18087. return nil, err
  18088. }
  18089. return ret, nil
  18090. // {
  18091. // "description": "Resizes the specified persistent disk.",
  18092. // "httpMethod": "POST",
  18093. // "id": "compute.disks.resize",
  18094. // "parameterOrder": [
  18095. // "project",
  18096. // "zone",
  18097. // "disk"
  18098. // ],
  18099. // "parameters": {
  18100. // "disk": {
  18101. // "description": "The name of the persistent disk.",
  18102. // "location": "path",
  18103. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  18104. // "required": true,
  18105. // "type": "string"
  18106. // },
  18107. // "project": {
  18108. // "description": "Project ID for this request.",
  18109. // "location": "path",
  18110. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  18111. // "required": true,
  18112. // "type": "string"
  18113. // },
  18114. // "zone": {
  18115. // "description": "The name of the zone for this request.",
  18116. // "location": "path",
  18117. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  18118. // "required": true,
  18119. // "type": "string"
  18120. // }
  18121. // },
  18122. // "path": "{project}/zones/{zone}/disks/{disk}/resize",
  18123. // "request": {
  18124. // "$ref": "DisksResizeRequest"
  18125. // },
  18126. // "response": {
  18127. // "$ref": "Operation"
  18128. // },
  18129. // "scopes": [
  18130. // "https://www.googleapis.com/auth/cloud-platform",
  18131. // "https://www.googleapis.com/auth/compute"
  18132. // ]
  18133. // }
  18134. }
  18135. // method id "compute.disks.setLabels":
  18136. type DisksSetLabelsCall struct {
  18137. s *Service
  18138. project string
  18139. zone string
  18140. resource string
  18141. zonesetlabelsrequest *ZoneSetLabelsRequest
  18142. urlParams_ gensupport.URLParams
  18143. ctx_ context.Context
  18144. header_ http.Header
  18145. }
  18146. // SetLabels: Sets the labels on a disk. To learn more about labels,
  18147. // read the Labeling Resources documentation.
  18148. func (r *DisksService) SetLabels(project string, zone string, resource string, zonesetlabelsrequest *ZoneSetLabelsRequest) *DisksSetLabelsCall {
  18149. c := &DisksSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18150. c.project = project
  18151. c.zone = zone
  18152. c.resource = resource
  18153. c.zonesetlabelsrequest = zonesetlabelsrequest
  18154. return c
  18155. }
  18156. // Fields allows partial responses to be retrieved. See
  18157. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18158. // for more information.
  18159. func (c *DisksSetLabelsCall) Fields(s ...googleapi.Field) *DisksSetLabelsCall {
  18160. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18161. return c
  18162. }
  18163. // Context sets the context to be used in this call's Do method. Any
  18164. // pending HTTP request will be aborted if the provided context is
  18165. // canceled.
  18166. func (c *DisksSetLabelsCall) Context(ctx context.Context) *DisksSetLabelsCall {
  18167. c.ctx_ = ctx
  18168. return c
  18169. }
  18170. // Header returns an http.Header that can be modified by the caller to
  18171. // add HTTP headers to the request.
  18172. func (c *DisksSetLabelsCall) Header() http.Header {
  18173. if c.header_ == nil {
  18174. c.header_ = make(http.Header)
  18175. }
  18176. return c.header_
  18177. }
  18178. func (c *DisksSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  18179. reqHeaders := make(http.Header)
  18180. for k, v := range c.header_ {
  18181. reqHeaders[k] = v
  18182. }
  18183. reqHeaders.Set("User-Agent", c.s.userAgent())
  18184. var body io.Reader = nil
  18185. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetlabelsrequest)
  18186. if err != nil {
  18187. return nil, err
  18188. }
  18189. reqHeaders.Set("Content-Type", "application/json")
  18190. c.urlParams_.Set("alt", alt)
  18191. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{resource}/setLabels")
  18192. urls += "?" + c.urlParams_.Encode()
  18193. req, _ := http.NewRequest("POST", urls, body)
  18194. req.Header = reqHeaders
  18195. googleapi.Expand(req.URL, map[string]string{
  18196. "project": c.project,
  18197. "zone": c.zone,
  18198. "resource": c.resource,
  18199. })
  18200. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18201. }
  18202. // Do executes the "compute.disks.setLabels" call.
  18203. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  18204. // status code is an error. Response headers are in either
  18205. // *Operation.ServerResponse.Header or (if a response was returned at
  18206. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  18207. // to check whether the returned error was because
  18208. // http.StatusNotModified was returned.
  18209. func (c *DisksSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  18210. gensupport.SetOptions(c.urlParams_, opts...)
  18211. res, err := c.doRequest("json")
  18212. if res != nil && res.StatusCode == http.StatusNotModified {
  18213. if res.Body != nil {
  18214. res.Body.Close()
  18215. }
  18216. return nil, &googleapi.Error{
  18217. Code: res.StatusCode,
  18218. Header: res.Header,
  18219. }
  18220. }
  18221. if err != nil {
  18222. return nil, err
  18223. }
  18224. defer googleapi.CloseBody(res)
  18225. if err := googleapi.CheckResponse(res); err != nil {
  18226. return nil, err
  18227. }
  18228. ret := &Operation{
  18229. ServerResponse: googleapi.ServerResponse{
  18230. Header: res.Header,
  18231. HTTPStatusCode: res.StatusCode,
  18232. },
  18233. }
  18234. target := &ret
  18235. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  18236. return nil, err
  18237. }
  18238. return ret, nil
  18239. // {
  18240. // "description": "Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation.",
  18241. // "httpMethod": "POST",
  18242. // "id": "compute.disks.setLabels",
  18243. // "parameterOrder": [
  18244. // "project",
  18245. // "zone",
  18246. // "resource"
  18247. // ],
  18248. // "parameters": {
  18249. // "project": {
  18250. // "description": "Project ID for this request.",
  18251. // "location": "path",
  18252. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  18253. // "required": true,
  18254. // "type": "string"
  18255. // },
  18256. // "resource": {
  18257. // "description": "Name of the resource for this request.",
  18258. // "location": "path",
  18259. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  18260. // "required": true,
  18261. // "type": "string"
  18262. // },
  18263. // "zone": {
  18264. // "description": "The name of the zone for this request.",
  18265. // "location": "path",
  18266. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  18267. // "required": true,
  18268. // "type": "string"
  18269. // }
  18270. // },
  18271. // "path": "{project}/zones/{zone}/disks/{resource}/setLabels",
  18272. // "request": {
  18273. // "$ref": "ZoneSetLabelsRequest"
  18274. // },
  18275. // "response": {
  18276. // "$ref": "Operation"
  18277. // },
  18278. // "scopes": [
  18279. // "https://www.googleapis.com/auth/cloud-platform",
  18280. // "https://www.googleapis.com/auth/compute"
  18281. // ]
  18282. // }
  18283. }
  18284. // method id "compute.firewalls.delete":
  18285. type FirewallsDeleteCall struct {
  18286. s *Service
  18287. project string
  18288. firewall string
  18289. urlParams_ gensupport.URLParams
  18290. ctx_ context.Context
  18291. header_ http.Header
  18292. }
  18293. // Delete: Deletes the specified firewall.
  18294. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/delete
  18295. func (r *FirewallsService) Delete(project string, firewall string) *FirewallsDeleteCall {
  18296. c := &FirewallsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18297. c.project = project
  18298. c.firewall = firewall
  18299. return c
  18300. }
  18301. // Fields allows partial responses to be retrieved. See
  18302. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18303. // for more information.
  18304. func (c *FirewallsDeleteCall) Fields(s ...googleapi.Field) *FirewallsDeleteCall {
  18305. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18306. return c
  18307. }
  18308. // Context sets the context to be used in this call's Do method. Any
  18309. // pending HTTP request will be aborted if the provided context is
  18310. // canceled.
  18311. func (c *FirewallsDeleteCall) Context(ctx context.Context) *FirewallsDeleteCall {
  18312. c.ctx_ = ctx
  18313. return c
  18314. }
  18315. // Header returns an http.Header that can be modified by the caller to
  18316. // add HTTP headers to the request.
  18317. func (c *FirewallsDeleteCall) Header() http.Header {
  18318. if c.header_ == nil {
  18319. c.header_ = make(http.Header)
  18320. }
  18321. return c.header_
  18322. }
  18323. func (c *FirewallsDeleteCall) doRequest(alt string) (*http.Response, error) {
  18324. reqHeaders := make(http.Header)
  18325. for k, v := range c.header_ {
  18326. reqHeaders[k] = v
  18327. }
  18328. reqHeaders.Set("User-Agent", c.s.userAgent())
  18329. var body io.Reader = nil
  18330. c.urlParams_.Set("alt", alt)
  18331. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  18332. urls += "?" + c.urlParams_.Encode()
  18333. req, _ := http.NewRequest("DELETE", urls, body)
  18334. req.Header = reqHeaders
  18335. googleapi.Expand(req.URL, map[string]string{
  18336. "project": c.project,
  18337. "firewall": c.firewall,
  18338. })
  18339. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18340. }
  18341. // Do executes the "compute.firewalls.delete" call.
  18342. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  18343. // status code is an error. Response headers are in either
  18344. // *Operation.ServerResponse.Header or (if a response was returned at
  18345. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  18346. // to check whether the returned error was because
  18347. // http.StatusNotModified was returned.
  18348. func (c *FirewallsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  18349. gensupport.SetOptions(c.urlParams_, opts...)
  18350. res, err := c.doRequest("json")
  18351. if res != nil && res.StatusCode == http.StatusNotModified {
  18352. if res.Body != nil {
  18353. res.Body.Close()
  18354. }
  18355. return nil, &googleapi.Error{
  18356. Code: res.StatusCode,
  18357. Header: res.Header,
  18358. }
  18359. }
  18360. if err != nil {
  18361. return nil, err
  18362. }
  18363. defer googleapi.CloseBody(res)
  18364. if err := googleapi.CheckResponse(res); err != nil {
  18365. return nil, err
  18366. }
  18367. ret := &Operation{
  18368. ServerResponse: googleapi.ServerResponse{
  18369. Header: res.Header,
  18370. HTTPStatusCode: res.StatusCode,
  18371. },
  18372. }
  18373. target := &ret
  18374. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  18375. return nil, err
  18376. }
  18377. return ret, nil
  18378. // {
  18379. // "description": "Deletes the specified firewall.",
  18380. // "httpMethod": "DELETE",
  18381. // "id": "compute.firewalls.delete",
  18382. // "parameterOrder": [
  18383. // "project",
  18384. // "firewall"
  18385. // ],
  18386. // "parameters": {
  18387. // "firewall": {
  18388. // "description": "Name of the firewall rule to delete.",
  18389. // "location": "path",
  18390. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  18391. // "required": true,
  18392. // "type": "string"
  18393. // },
  18394. // "project": {
  18395. // "description": "Project ID for this request.",
  18396. // "location": "path",
  18397. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  18398. // "required": true,
  18399. // "type": "string"
  18400. // }
  18401. // },
  18402. // "path": "{project}/global/firewalls/{firewall}",
  18403. // "response": {
  18404. // "$ref": "Operation"
  18405. // },
  18406. // "scopes": [
  18407. // "https://www.googleapis.com/auth/cloud-platform",
  18408. // "https://www.googleapis.com/auth/compute"
  18409. // ]
  18410. // }
  18411. }
  18412. // method id "compute.firewalls.get":
  18413. type FirewallsGetCall struct {
  18414. s *Service
  18415. project string
  18416. firewall string
  18417. urlParams_ gensupport.URLParams
  18418. ifNoneMatch_ string
  18419. ctx_ context.Context
  18420. header_ http.Header
  18421. }
  18422. // Get: Returns the specified firewall.
  18423. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/get
  18424. func (r *FirewallsService) Get(project string, firewall string) *FirewallsGetCall {
  18425. c := &FirewallsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18426. c.project = project
  18427. c.firewall = firewall
  18428. return c
  18429. }
  18430. // Fields allows partial responses to be retrieved. See
  18431. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18432. // for more information.
  18433. func (c *FirewallsGetCall) Fields(s ...googleapi.Field) *FirewallsGetCall {
  18434. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18435. return c
  18436. }
  18437. // IfNoneMatch sets the optional parameter which makes the operation
  18438. // fail if the object's ETag matches the given value. This is useful for
  18439. // getting updates only after the object has changed since the last
  18440. // request. Use googleapi.IsNotModified to check whether the response
  18441. // error from Do is the result of In-None-Match.
  18442. func (c *FirewallsGetCall) IfNoneMatch(entityTag string) *FirewallsGetCall {
  18443. c.ifNoneMatch_ = entityTag
  18444. return c
  18445. }
  18446. // Context sets the context to be used in this call's Do method. Any
  18447. // pending HTTP request will be aborted if the provided context is
  18448. // canceled.
  18449. func (c *FirewallsGetCall) Context(ctx context.Context) *FirewallsGetCall {
  18450. c.ctx_ = ctx
  18451. return c
  18452. }
  18453. // Header returns an http.Header that can be modified by the caller to
  18454. // add HTTP headers to the request.
  18455. func (c *FirewallsGetCall) Header() http.Header {
  18456. if c.header_ == nil {
  18457. c.header_ = make(http.Header)
  18458. }
  18459. return c.header_
  18460. }
  18461. func (c *FirewallsGetCall) doRequest(alt string) (*http.Response, error) {
  18462. reqHeaders := make(http.Header)
  18463. for k, v := range c.header_ {
  18464. reqHeaders[k] = v
  18465. }
  18466. reqHeaders.Set("User-Agent", c.s.userAgent())
  18467. if c.ifNoneMatch_ != "" {
  18468. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  18469. }
  18470. var body io.Reader = nil
  18471. c.urlParams_.Set("alt", alt)
  18472. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  18473. urls += "?" + c.urlParams_.Encode()
  18474. req, _ := http.NewRequest("GET", urls, body)
  18475. req.Header = reqHeaders
  18476. googleapi.Expand(req.URL, map[string]string{
  18477. "project": c.project,
  18478. "firewall": c.firewall,
  18479. })
  18480. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18481. }
  18482. // Do executes the "compute.firewalls.get" call.
  18483. // Exactly one of *Firewall or error will be non-nil. Any non-2xx status
  18484. // code is an error. Response headers are in either
  18485. // *Firewall.ServerResponse.Header or (if a response was returned at
  18486. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  18487. // to check whether the returned error was because
  18488. // http.StatusNotModified was returned.
  18489. func (c *FirewallsGetCall) Do(opts ...googleapi.CallOption) (*Firewall, error) {
  18490. gensupport.SetOptions(c.urlParams_, opts...)
  18491. res, err := c.doRequest("json")
  18492. if res != nil && res.StatusCode == http.StatusNotModified {
  18493. if res.Body != nil {
  18494. res.Body.Close()
  18495. }
  18496. return nil, &googleapi.Error{
  18497. Code: res.StatusCode,
  18498. Header: res.Header,
  18499. }
  18500. }
  18501. if err != nil {
  18502. return nil, err
  18503. }
  18504. defer googleapi.CloseBody(res)
  18505. if err := googleapi.CheckResponse(res); err != nil {
  18506. return nil, err
  18507. }
  18508. ret := &Firewall{
  18509. ServerResponse: googleapi.ServerResponse{
  18510. Header: res.Header,
  18511. HTTPStatusCode: res.StatusCode,
  18512. },
  18513. }
  18514. target := &ret
  18515. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  18516. return nil, err
  18517. }
  18518. return ret, nil
  18519. // {
  18520. // "description": "Returns the specified firewall.",
  18521. // "httpMethod": "GET",
  18522. // "id": "compute.firewalls.get",
  18523. // "parameterOrder": [
  18524. // "project",
  18525. // "firewall"
  18526. // ],
  18527. // "parameters": {
  18528. // "firewall": {
  18529. // "description": "Name of the firewall rule to return.",
  18530. // "location": "path",
  18531. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  18532. // "required": true,
  18533. // "type": "string"
  18534. // },
  18535. // "project": {
  18536. // "description": "Project ID for this request.",
  18537. // "location": "path",
  18538. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  18539. // "required": true,
  18540. // "type": "string"
  18541. // }
  18542. // },
  18543. // "path": "{project}/global/firewalls/{firewall}",
  18544. // "response": {
  18545. // "$ref": "Firewall"
  18546. // },
  18547. // "scopes": [
  18548. // "https://www.googleapis.com/auth/cloud-platform",
  18549. // "https://www.googleapis.com/auth/compute",
  18550. // "https://www.googleapis.com/auth/compute.readonly"
  18551. // ]
  18552. // }
  18553. }
  18554. // method id "compute.firewalls.insert":
  18555. type FirewallsInsertCall struct {
  18556. s *Service
  18557. project string
  18558. firewall *Firewall
  18559. urlParams_ gensupport.URLParams
  18560. ctx_ context.Context
  18561. header_ http.Header
  18562. }
  18563. // Insert: Creates a firewall rule in the specified project using the
  18564. // data included in the request.
  18565. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/insert
  18566. func (r *FirewallsService) Insert(project string, firewall *Firewall) *FirewallsInsertCall {
  18567. c := &FirewallsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18568. c.project = project
  18569. c.firewall = firewall
  18570. return c
  18571. }
  18572. // Fields allows partial responses to be retrieved. See
  18573. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18574. // for more information.
  18575. func (c *FirewallsInsertCall) Fields(s ...googleapi.Field) *FirewallsInsertCall {
  18576. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18577. return c
  18578. }
  18579. // Context sets the context to be used in this call's Do method. Any
  18580. // pending HTTP request will be aborted if the provided context is
  18581. // canceled.
  18582. func (c *FirewallsInsertCall) Context(ctx context.Context) *FirewallsInsertCall {
  18583. c.ctx_ = ctx
  18584. return c
  18585. }
  18586. // Header returns an http.Header that can be modified by the caller to
  18587. // add HTTP headers to the request.
  18588. func (c *FirewallsInsertCall) Header() http.Header {
  18589. if c.header_ == nil {
  18590. c.header_ = make(http.Header)
  18591. }
  18592. return c.header_
  18593. }
  18594. func (c *FirewallsInsertCall) doRequest(alt string) (*http.Response, error) {
  18595. reqHeaders := make(http.Header)
  18596. for k, v := range c.header_ {
  18597. reqHeaders[k] = v
  18598. }
  18599. reqHeaders.Set("User-Agent", c.s.userAgent())
  18600. var body io.Reader = nil
  18601. body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall)
  18602. if err != nil {
  18603. return nil, err
  18604. }
  18605. reqHeaders.Set("Content-Type", "application/json")
  18606. c.urlParams_.Set("alt", alt)
  18607. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls")
  18608. urls += "?" + c.urlParams_.Encode()
  18609. req, _ := http.NewRequest("POST", urls, body)
  18610. req.Header = reqHeaders
  18611. googleapi.Expand(req.URL, map[string]string{
  18612. "project": c.project,
  18613. })
  18614. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18615. }
  18616. // Do executes the "compute.firewalls.insert" call.
  18617. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  18618. // status code is an error. Response headers are in either
  18619. // *Operation.ServerResponse.Header or (if a response was returned at
  18620. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  18621. // to check whether the returned error was because
  18622. // http.StatusNotModified was returned.
  18623. func (c *FirewallsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  18624. gensupport.SetOptions(c.urlParams_, opts...)
  18625. res, err := c.doRequest("json")
  18626. if res != nil && res.StatusCode == http.StatusNotModified {
  18627. if res.Body != nil {
  18628. res.Body.Close()
  18629. }
  18630. return nil, &googleapi.Error{
  18631. Code: res.StatusCode,
  18632. Header: res.Header,
  18633. }
  18634. }
  18635. if err != nil {
  18636. return nil, err
  18637. }
  18638. defer googleapi.CloseBody(res)
  18639. if err := googleapi.CheckResponse(res); err != nil {
  18640. return nil, err
  18641. }
  18642. ret := &Operation{
  18643. ServerResponse: googleapi.ServerResponse{
  18644. Header: res.Header,
  18645. HTTPStatusCode: res.StatusCode,
  18646. },
  18647. }
  18648. target := &ret
  18649. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  18650. return nil, err
  18651. }
  18652. return ret, nil
  18653. // {
  18654. // "description": "Creates a firewall rule in the specified project using the data included in the request.",
  18655. // "httpMethod": "POST",
  18656. // "id": "compute.firewalls.insert",
  18657. // "parameterOrder": [
  18658. // "project"
  18659. // ],
  18660. // "parameters": {
  18661. // "project": {
  18662. // "description": "Project ID for this request.",
  18663. // "location": "path",
  18664. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  18665. // "required": true,
  18666. // "type": "string"
  18667. // }
  18668. // },
  18669. // "path": "{project}/global/firewalls",
  18670. // "request": {
  18671. // "$ref": "Firewall"
  18672. // },
  18673. // "response": {
  18674. // "$ref": "Operation"
  18675. // },
  18676. // "scopes": [
  18677. // "https://www.googleapis.com/auth/cloud-platform",
  18678. // "https://www.googleapis.com/auth/compute"
  18679. // ]
  18680. // }
  18681. }
  18682. // method id "compute.firewalls.list":
  18683. type FirewallsListCall struct {
  18684. s *Service
  18685. project string
  18686. urlParams_ gensupport.URLParams
  18687. ifNoneMatch_ string
  18688. ctx_ context.Context
  18689. header_ http.Header
  18690. }
  18691. // List: Retrieves the list of firewall rules available to the specified
  18692. // project.
  18693. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/list
  18694. func (r *FirewallsService) List(project string) *FirewallsListCall {
  18695. c := &FirewallsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18696. c.project = project
  18697. return c
  18698. }
  18699. // Filter sets the optional parameter "filter": Sets a filter
  18700. // {expression} for filtering listed resources. Your {expression} must
  18701. // be in the format: field_name comparison_string literal_string.
  18702. //
  18703. // The field_name is the name of the field you want to compare. Only
  18704. // atomic field types are supported (string, number, boolean). The
  18705. // comparison_string must be either eq (equals) or ne (not equals). The
  18706. // literal_string is the string value to filter to. The literal value
  18707. // must be valid for the type of field you are filtering by (string,
  18708. // number, boolean). For string fields, the literal value is interpreted
  18709. // as a regular expression using RE2 syntax. The literal value must
  18710. // match the entire field.
  18711. //
  18712. // For example, to filter for instances that do not have a name of
  18713. // example-instance, you would use name ne example-instance.
  18714. //
  18715. // You can filter on nested fields. For example, you could filter on
  18716. // instances that have set the scheduling.automaticRestart field to
  18717. // true. Use filtering on nested fields to take advantage of labels to
  18718. // organize and search for results based on label values.
  18719. //
  18720. // To filter on multiple expressions, provide each separate expression
  18721. // within parentheses. For example, (scheduling.automaticRestart eq
  18722. // true) (zone eq us-central1-f). Multiple expressions are treated as
  18723. // AND expressions, meaning that resources must match all expressions to
  18724. // pass the filters.
  18725. func (c *FirewallsListCall) Filter(filter string) *FirewallsListCall {
  18726. c.urlParams_.Set("filter", filter)
  18727. return c
  18728. }
  18729. // MaxResults sets the optional parameter "maxResults": The maximum
  18730. // number of results per page that should be returned. If the number of
  18731. // available results is larger than maxResults, Compute Engine returns a
  18732. // nextPageToken that can be used to get the next page of results in
  18733. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  18734. // (Default: 500)
  18735. func (c *FirewallsListCall) MaxResults(maxResults int64) *FirewallsListCall {
  18736. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  18737. return c
  18738. }
  18739. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  18740. // a certain order. By default, results are returned in alphanumerical
  18741. // order based on the resource name.
  18742. //
  18743. // You can also sort results in descending order based on the creation
  18744. // timestamp using orderBy="creationTimestamp desc". This sorts results
  18745. // based on the creationTimestamp field in reverse chronological order
  18746. // (newest result first). Use this to sort resources like operations so
  18747. // that the newest operation is returned first.
  18748. //
  18749. // Currently, only sorting by name or creationTimestamp desc is
  18750. // supported.
  18751. func (c *FirewallsListCall) OrderBy(orderBy string) *FirewallsListCall {
  18752. c.urlParams_.Set("orderBy", orderBy)
  18753. return c
  18754. }
  18755. // PageToken sets the optional parameter "pageToken": Specifies a page
  18756. // token to use. Set pageToken to the nextPageToken returned by a
  18757. // previous list request to get the next page of results.
  18758. func (c *FirewallsListCall) PageToken(pageToken string) *FirewallsListCall {
  18759. c.urlParams_.Set("pageToken", pageToken)
  18760. return c
  18761. }
  18762. // Fields allows partial responses to be retrieved. See
  18763. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18764. // for more information.
  18765. func (c *FirewallsListCall) Fields(s ...googleapi.Field) *FirewallsListCall {
  18766. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18767. return c
  18768. }
  18769. // IfNoneMatch sets the optional parameter which makes the operation
  18770. // fail if the object's ETag matches the given value. This is useful for
  18771. // getting updates only after the object has changed since the last
  18772. // request. Use googleapi.IsNotModified to check whether the response
  18773. // error from Do is the result of In-None-Match.
  18774. func (c *FirewallsListCall) IfNoneMatch(entityTag string) *FirewallsListCall {
  18775. c.ifNoneMatch_ = entityTag
  18776. return c
  18777. }
  18778. // Context sets the context to be used in this call's Do method. Any
  18779. // pending HTTP request will be aborted if the provided context is
  18780. // canceled.
  18781. func (c *FirewallsListCall) Context(ctx context.Context) *FirewallsListCall {
  18782. c.ctx_ = ctx
  18783. return c
  18784. }
  18785. // Header returns an http.Header that can be modified by the caller to
  18786. // add HTTP headers to the request.
  18787. func (c *FirewallsListCall) Header() http.Header {
  18788. if c.header_ == nil {
  18789. c.header_ = make(http.Header)
  18790. }
  18791. return c.header_
  18792. }
  18793. func (c *FirewallsListCall) doRequest(alt string) (*http.Response, error) {
  18794. reqHeaders := make(http.Header)
  18795. for k, v := range c.header_ {
  18796. reqHeaders[k] = v
  18797. }
  18798. reqHeaders.Set("User-Agent", c.s.userAgent())
  18799. if c.ifNoneMatch_ != "" {
  18800. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  18801. }
  18802. var body io.Reader = nil
  18803. c.urlParams_.Set("alt", alt)
  18804. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls")
  18805. urls += "?" + c.urlParams_.Encode()
  18806. req, _ := http.NewRequest("GET", urls, body)
  18807. req.Header = reqHeaders
  18808. googleapi.Expand(req.URL, map[string]string{
  18809. "project": c.project,
  18810. })
  18811. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18812. }
  18813. // Do executes the "compute.firewalls.list" call.
  18814. // Exactly one of *FirewallList or error will be non-nil. Any non-2xx
  18815. // status code is an error. Response headers are in either
  18816. // *FirewallList.ServerResponse.Header or (if a response was returned at
  18817. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  18818. // to check whether the returned error was because
  18819. // http.StatusNotModified was returned.
  18820. func (c *FirewallsListCall) Do(opts ...googleapi.CallOption) (*FirewallList, error) {
  18821. gensupport.SetOptions(c.urlParams_, opts...)
  18822. res, err := c.doRequest("json")
  18823. if res != nil && res.StatusCode == http.StatusNotModified {
  18824. if res.Body != nil {
  18825. res.Body.Close()
  18826. }
  18827. return nil, &googleapi.Error{
  18828. Code: res.StatusCode,
  18829. Header: res.Header,
  18830. }
  18831. }
  18832. if err != nil {
  18833. return nil, err
  18834. }
  18835. defer googleapi.CloseBody(res)
  18836. if err := googleapi.CheckResponse(res); err != nil {
  18837. return nil, err
  18838. }
  18839. ret := &FirewallList{
  18840. ServerResponse: googleapi.ServerResponse{
  18841. Header: res.Header,
  18842. HTTPStatusCode: res.StatusCode,
  18843. },
  18844. }
  18845. target := &ret
  18846. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  18847. return nil, err
  18848. }
  18849. return ret, nil
  18850. // {
  18851. // "description": "Retrieves the list of firewall rules available to the specified project.",
  18852. // "httpMethod": "GET",
  18853. // "id": "compute.firewalls.list",
  18854. // "parameterOrder": [
  18855. // "project"
  18856. // ],
  18857. // "parameters": {
  18858. // "filter": {
  18859. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  18860. // "location": "query",
  18861. // "type": "string"
  18862. // },
  18863. // "maxResults": {
  18864. // "default": "500",
  18865. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  18866. // "format": "uint32",
  18867. // "location": "query",
  18868. // "minimum": "0",
  18869. // "type": "integer"
  18870. // },
  18871. // "orderBy": {
  18872. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  18873. // "location": "query",
  18874. // "type": "string"
  18875. // },
  18876. // "pageToken": {
  18877. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  18878. // "location": "query",
  18879. // "type": "string"
  18880. // },
  18881. // "project": {
  18882. // "description": "Project ID for this request.",
  18883. // "location": "path",
  18884. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  18885. // "required": true,
  18886. // "type": "string"
  18887. // }
  18888. // },
  18889. // "path": "{project}/global/firewalls",
  18890. // "response": {
  18891. // "$ref": "FirewallList"
  18892. // },
  18893. // "scopes": [
  18894. // "https://www.googleapis.com/auth/cloud-platform",
  18895. // "https://www.googleapis.com/auth/compute",
  18896. // "https://www.googleapis.com/auth/compute.readonly"
  18897. // ]
  18898. // }
  18899. }
  18900. // Pages invokes f for each page of results.
  18901. // A non-nil error returned from f will halt the iteration.
  18902. // The provided context supersedes any context provided to the Context method.
  18903. func (c *FirewallsListCall) Pages(ctx context.Context, f func(*FirewallList) error) error {
  18904. c.ctx_ = ctx
  18905. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  18906. for {
  18907. x, err := c.Do()
  18908. if err != nil {
  18909. return err
  18910. }
  18911. if err := f(x); err != nil {
  18912. return err
  18913. }
  18914. if x.NextPageToken == "" {
  18915. return nil
  18916. }
  18917. c.PageToken(x.NextPageToken)
  18918. }
  18919. }
  18920. // method id "compute.firewalls.patch":
  18921. type FirewallsPatchCall struct {
  18922. s *Service
  18923. project string
  18924. firewall string
  18925. firewall2 *Firewall
  18926. urlParams_ gensupport.URLParams
  18927. ctx_ context.Context
  18928. header_ http.Header
  18929. }
  18930. // Patch: Updates the specified firewall rule with the data included in
  18931. // the request. Using PUT method, can only update following fields of
  18932. // firewall rule: allowed, description, sourceRanges, sourceTags,
  18933. // targetTags. This method supports patch semantics.
  18934. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/patch
  18935. func (r *FirewallsService) Patch(project string, firewall string, firewall2 *Firewall) *FirewallsPatchCall {
  18936. c := &FirewallsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18937. c.project = project
  18938. c.firewall = firewall
  18939. c.firewall2 = firewall2
  18940. return c
  18941. }
  18942. // Fields allows partial responses to be retrieved. See
  18943. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18944. // for more information.
  18945. func (c *FirewallsPatchCall) Fields(s ...googleapi.Field) *FirewallsPatchCall {
  18946. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18947. return c
  18948. }
  18949. // Context sets the context to be used in this call's Do method. Any
  18950. // pending HTTP request will be aborted if the provided context is
  18951. // canceled.
  18952. func (c *FirewallsPatchCall) Context(ctx context.Context) *FirewallsPatchCall {
  18953. c.ctx_ = ctx
  18954. return c
  18955. }
  18956. // Header returns an http.Header that can be modified by the caller to
  18957. // add HTTP headers to the request.
  18958. func (c *FirewallsPatchCall) Header() http.Header {
  18959. if c.header_ == nil {
  18960. c.header_ = make(http.Header)
  18961. }
  18962. return c.header_
  18963. }
  18964. func (c *FirewallsPatchCall) doRequest(alt string) (*http.Response, error) {
  18965. reqHeaders := make(http.Header)
  18966. for k, v := range c.header_ {
  18967. reqHeaders[k] = v
  18968. }
  18969. reqHeaders.Set("User-Agent", c.s.userAgent())
  18970. var body io.Reader = nil
  18971. body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2)
  18972. if err != nil {
  18973. return nil, err
  18974. }
  18975. reqHeaders.Set("Content-Type", "application/json")
  18976. c.urlParams_.Set("alt", alt)
  18977. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  18978. urls += "?" + c.urlParams_.Encode()
  18979. req, _ := http.NewRequest("PATCH", urls, body)
  18980. req.Header = reqHeaders
  18981. googleapi.Expand(req.URL, map[string]string{
  18982. "project": c.project,
  18983. "firewall": c.firewall,
  18984. })
  18985. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18986. }
  18987. // Do executes the "compute.firewalls.patch" call.
  18988. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  18989. // status code is an error. Response headers are in either
  18990. // *Operation.ServerResponse.Header or (if a response was returned at
  18991. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  18992. // to check whether the returned error was because
  18993. // http.StatusNotModified was returned.
  18994. func (c *FirewallsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  18995. gensupport.SetOptions(c.urlParams_, opts...)
  18996. res, err := c.doRequest("json")
  18997. if res != nil && res.StatusCode == http.StatusNotModified {
  18998. if res.Body != nil {
  18999. res.Body.Close()
  19000. }
  19001. return nil, &googleapi.Error{
  19002. Code: res.StatusCode,
  19003. Header: res.Header,
  19004. }
  19005. }
  19006. if err != nil {
  19007. return nil, err
  19008. }
  19009. defer googleapi.CloseBody(res)
  19010. if err := googleapi.CheckResponse(res); err != nil {
  19011. return nil, err
  19012. }
  19013. ret := &Operation{
  19014. ServerResponse: googleapi.ServerResponse{
  19015. Header: res.Header,
  19016. HTTPStatusCode: res.StatusCode,
  19017. },
  19018. }
  19019. target := &ret
  19020. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  19021. return nil, err
  19022. }
  19023. return ret, nil
  19024. // {
  19025. // "description": "Updates the specified firewall rule with the data included in the request. Using PUT method, can only update following fields of firewall rule: allowed, description, sourceRanges, sourceTags, targetTags. This method supports patch semantics.",
  19026. // "httpMethod": "PATCH",
  19027. // "id": "compute.firewalls.patch",
  19028. // "parameterOrder": [
  19029. // "project",
  19030. // "firewall"
  19031. // ],
  19032. // "parameters": {
  19033. // "firewall": {
  19034. // "description": "Name of the firewall rule to update.",
  19035. // "location": "path",
  19036. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  19037. // "required": true,
  19038. // "type": "string"
  19039. // },
  19040. // "project": {
  19041. // "description": "Project ID for this request.",
  19042. // "location": "path",
  19043. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  19044. // "required": true,
  19045. // "type": "string"
  19046. // }
  19047. // },
  19048. // "path": "{project}/global/firewalls/{firewall}",
  19049. // "request": {
  19050. // "$ref": "Firewall"
  19051. // },
  19052. // "response": {
  19053. // "$ref": "Operation"
  19054. // },
  19055. // "scopes": [
  19056. // "https://www.googleapis.com/auth/cloud-platform",
  19057. // "https://www.googleapis.com/auth/compute"
  19058. // ]
  19059. // }
  19060. }
  19061. // method id "compute.firewalls.update":
  19062. type FirewallsUpdateCall struct {
  19063. s *Service
  19064. project string
  19065. firewall string
  19066. firewall2 *Firewall
  19067. urlParams_ gensupport.URLParams
  19068. ctx_ context.Context
  19069. header_ http.Header
  19070. }
  19071. // Update: Updates the specified firewall rule with the data included in
  19072. // the request. Using PUT method, can only update following fields of
  19073. // firewall rule: allowed, description, sourceRanges, sourceTags,
  19074. // targetTags.
  19075. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/update
  19076. func (r *FirewallsService) Update(project string, firewall string, firewall2 *Firewall) *FirewallsUpdateCall {
  19077. c := &FirewallsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19078. c.project = project
  19079. c.firewall = firewall
  19080. c.firewall2 = firewall2
  19081. return c
  19082. }
  19083. // Fields allows partial responses to be retrieved. See
  19084. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19085. // for more information.
  19086. func (c *FirewallsUpdateCall) Fields(s ...googleapi.Field) *FirewallsUpdateCall {
  19087. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19088. return c
  19089. }
  19090. // Context sets the context to be used in this call's Do method. Any
  19091. // pending HTTP request will be aborted if the provided context is
  19092. // canceled.
  19093. func (c *FirewallsUpdateCall) Context(ctx context.Context) *FirewallsUpdateCall {
  19094. c.ctx_ = ctx
  19095. return c
  19096. }
  19097. // Header returns an http.Header that can be modified by the caller to
  19098. // add HTTP headers to the request.
  19099. func (c *FirewallsUpdateCall) Header() http.Header {
  19100. if c.header_ == nil {
  19101. c.header_ = make(http.Header)
  19102. }
  19103. return c.header_
  19104. }
  19105. func (c *FirewallsUpdateCall) doRequest(alt string) (*http.Response, error) {
  19106. reqHeaders := make(http.Header)
  19107. for k, v := range c.header_ {
  19108. reqHeaders[k] = v
  19109. }
  19110. reqHeaders.Set("User-Agent", c.s.userAgent())
  19111. var body io.Reader = nil
  19112. body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2)
  19113. if err != nil {
  19114. return nil, err
  19115. }
  19116. reqHeaders.Set("Content-Type", "application/json")
  19117. c.urlParams_.Set("alt", alt)
  19118. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  19119. urls += "?" + c.urlParams_.Encode()
  19120. req, _ := http.NewRequest("PUT", urls, body)
  19121. req.Header = reqHeaders
  19122. googleapi.Expand(req.URL, map[string]string{
  19123. "project": c.project,
  19124. "firewall": c.firewall,
  19125. })
  19126. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19127. }
  19128. // Do executes the "compute.firewalls.update" call.
  19129. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  19130. // status code is an error. Response headers are in either
  19131. // *Operation.ServerResponse.Header or (if a response was returned at
  19132. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  19133. // to check whether the returned error was because
  19134. // http.StatusNotModified was returned.
  19135. func (c *FirewallsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  19136. gensupport.SetOptions(c.urlParams_, opts...)
  19137. res, err := c.doRequest("json")
  19138. if res != nil && res.StatusCode == http.StatusNotModified {
  19139. if res.Body != nil {
  19140. res.Body.Close()
  19141. }
  19142. return nil, &googleapi.Error{
  19143. Code: res.StatusCode,
  19144. Header: res.Header,
  19145. }
  19146. }
  19147. if err != nil {
  19148. return nil, err
  19149. }
  19150. defer googleapi.CloseBody(res)
  19151. if err := googleapi.CheckResponse(res); err != nil {
  19152. return nil, err
  19153. }
  19154. ret := &Operation{
  19155. ServerResponse: googleapi.ServerResponse{
  19156. Header: res.Header,
  19157. HTTPStatusCode: res.StatusCode,
  19158. },
  19159. }
  19160. target := &ret
  19161. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  19162. return nil, err
  19163. }
  19164. return ret, nil
  19165. // {
  19166. // "description": "Updates the specified firewall rule with the data included in the request. Using PUT method, can only update following fields of firewall rule: allowed, description, sourceRanges, sourceTags, targetTags.",
  19167. // "httpMethod": "PUT",
  19168. // "id": "compute.firewalls.update",
  19169. // "parameterOrder": [
  19170. // "project",
  19171. // "firewall"
  19172. // ],
  19173. // "parameters": {
  19174. // "firewall": {
  19175. // "description": "Name of the firewall rule to update.",
  19176. // "location": "path",
  19177. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  19178. // "required": true,
  19179. // "type": "string"
  19180. // },
  19181. // "project": {
  19182. // "description": "Project ID for this request.",
  19183. // "location": "path",
  19184. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  19185. // "required": true,
  19186. // "type": "string"
  19187. // }
  19188. // },
  19189. // "path": "{project}/global/firewalls/{firewall}",
  19190. // "request": {
  19191. // "$ref": "Firewall"
  19192. // },
  19193. // "response": {
  19194. // "$ref": "Operation"
  19195. // },
  19196. // "scopes": [
  19197. // "https://www.googleapis.com/auth/cloud-platform",
  19198. // "https://www.googleapis.com/auth/compute"
  19199. // ]
  19200. // }
  19201. }
  19202. // method id "compute.forwardingRules.aggregatedList":
  19203. type ForwardingRulesAggregatedListCall struct {
  19204. s *Service
  19205. project string
  19206. urlParams_ gensupport.URLParams
  19207. ifNoneMatch_ string
  19208. ctx_ context.Context
  19209. header_ http.Header
  19210. }
  19211. // AggregatedList: Retrieves an aggregated list of forwarding rules.
  19212. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/aggregatedList
  19213. func (r *ForwardingRulesService) AggregatedList(project string) *ForwardingRulesAggregatedListCall {
  19214. c := &ForwardingRulesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19215. c.project = project
  19216. return c
  19217. }
  19218. // Filter sets the optional parameter "filter": Sets a filter
  19219. // {expression} for filtering listed resources. Your {expression} must
  19220. // be in the format: field_name comparison_string literal_string.
  19221. //
  19222. // The field_name is the name of the field you want to compare. Only
  19223. // atomic field types are supported (string, number, boolean). The
  19224. // comparison_string must be either eq (equals) or ne (not equals). The
  19225. // literal_string is the string value to filter to. The literal value
  19226. // must be valid for the type of field you are filtering by (string,
  19227. // number, boolean). For string fields, the literal value is interpreted
  19228. // as a regular expression using RE2 syntax. The literal value must
  19229. // match the entire field.
  19230. //
  19231. // For example, to filter for instances that do not have a name of
  19232. // example-instance, you would use name ne example-instance.
  19233. //
  19234. // You can filter on nested fields. For example, you could filter on
  19235. // instances that have set the scheduling.automaticRestart field to
  19236. // true. Use filtering on nested fields to take advantage of labels to
  19237. // organize and search for results based on label values.
  19238. //
  19239. // To filter on multiple expressions, provide each separate expression
  19240. // within parentheses. For example, (scheduling.automaticRestart eq
  19241. // true) (zone eq us-central1-f). Multiple expressions are treated as
  19242. // AND expressions, meaning that resources must match all expressions to
  19243. // pass the filters.
  19244. func (c *ForwardingRulesAggregatedListCall) Filter(filter string) *ForwardingRulesAggregatedListCall {
  19245. c.urlParams_.Set("filter", filter)
  19246. return c
  19247. }
  19248. // MaxResults sets the optional parameter "maxResults": The maximum
  19249. // number of results per page that should be returned. If the number of
  19250. // available results is larger than maxResults, Compute Engine returns a
  19251. // nextPageToken that can be used to get the next page of results in
  19252. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  19253. // (Default: 500)
  19254. func (c *ForwardingRulesAggregatedListCall) MaxResults(maxResults int64) *ForwardingRulesAggregatedListCall {
  19255. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  19256. return c
  19257. }
  19258. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  19259. // a certain order. By default, results are returned in alphanumerical
  19260. // order based on the resource name.
  19261. //
  19262. // You can also sort results in descending order based on the creation
  19263. // timestamp using orderBy="creationTimestamp desc". This sorts results
  19264. // based on the creationTimestamp field in reverse chronological order
  19265. // (newest result first). Use this to sort resources like operations so
  19266. // that the newest operation is returned first.
  19267. //
  19268. // Currently, only sorting by name or creationTimestamp desc is
  19269. // supported.
  19270. func (c *ForwardingRulesAggregatedListCall) OrderBy(orderBy string) *ForwardingRulesAggregatedListCall {
  19271. c.urlParams_.Set("orderBy", orderBy)
  19272. return c
  19273. }
  19274. // PageToken sets the optional parameter "pageToken": Specifies a page
  19275. // token to use. Set pageToken to the nextPageToken returned by a
  19276. // previous list request to get the next page of results.
  19277. func (c *ForwardingRulesAggregatedListCall) PageToken(pageToken string) *ForwardingRulesAggregatedListCall {
  19278. c.urlParams_.Set("pageToken", pageToken)
  19279. return c
  19280. }
  19281. // Fields allows partial responses to be retrieved. See
  19282. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19283. // for more information.
  19284. func (c *ForwardingRulesAggregatedListCall) Fields(s ...googleapi.Field) *ForwardingRulesAggregatedListCall {
  19285. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19286. return c
  19287. }
  19288. // IfNoneMatch sets the optional parameter which makes the operation
  19289. // fail if the object's ETag matches the given value. This is useful for
  19290. // getting updates only after the object has changed since the last
  19291. // request. Use googleapi.IsNotModified to check whether the response
  19292. // error from Do is the result of In-None-Match.
  19293. func (c *ForwardingRulesAggregatedListCall) IfNoneMatch(entityTag string) *ForwardingRulesAggregatedListCall {
  19294. c.ifNoneMatch_ = entityTag
  19295. return c
  19296. }
  19297. // Context sets the context to be used in this call's Do method. Any
  19298. // pending HTTP request will be aborted if the provided context is
  19299. // canceled.
  19300. func (c *ForwardingRulesAggregatedListCall) Context(ctx context.Context) *ForwardingRulesAggregatedListCall {
  19301. c.ctx_ = ctx
  19302. return c
  19303. }
  19304. // Header returns an http.Header that can be modified by the caller to
  19305. // add HTTP headers to the request.
  19306. func (c *ForwardingRulesAggregatedListCall) Header() http.Header {
  19307. if c.header_ == nil {
  19308. c.header_ = make(http.Header)
  19309. }
  19310. return c.header_
  19311. }
  19312. func (c *ForwardingRulesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  19313. reqHeaders := make(http.Header)
  19314. for k, v := range c.header_ {
  19315. reqHeaders[k] = v
  19316. }
  19317. reqHeaders.Set("User-Agent", c.s.userAgent())
  19318. if c.ifNoneMatch_ != "" {
  19319. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  19320. }
  19321. var body io.Reader = nil
  19322. c.urlParams_.Set("alt", alt)
  19323. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/forwardingRules")
  19324. urls += "?" + c.urlParams_.Encode()
  19325. req, _ := http.NewRequest("GET", urls, body)
  19326. req.Header = reqHeaders
  19327. googleapi.Expand(req.URL, map[string]string{
  19328. "project": c.project,
  19329. })
  19330. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19331. }
  19332. // Do executes the "compute.forwardingRules.aggregatedList" call.
  19333. // Exactly one of *ForwardingRuleAggregatedList or error will be
  19334. // non-nil. Any non-2xx status code is an error. Response headers are in
  19335. // either *ForwardingRuleAggregatedList.ServerResponse.Header or (if a
  19336. // response was returned at all) in error.(*googleapi.Error).Header. Use
  19337. // googleapi.IsNotModified to check whether the returned error was
  19338. // because http.StatusNotModified was returned.
  19339. func (c *ForwardingRulesAggregatedListCall) Do(opts ...googleapi.CallOption) (*ForwardingRuleAggregatedList, error) {
  19340. gensupport.SetOptions(c.urlParams_, opts...)
  19341. res, err := c.doRequest("json")
  19342. if res != nil && res.StatusCode == http.StatusNotModified {
  19343. if res.Body != nil {
  19344. res.Body.Close()
  19345. }
  19346. return nil, &googleapi.Error{
  19347. Code: res.StatusCode,
  19348. Header: res.Header,
  19349. }
  19350. }
  19351. if err != nil {
  19352. return nil, err
  19353. }
  19354. defer googleapi.CloseBody(res)
  19355. if err := googleapi.CheckResponse(res); err != nil {
  19356. return nil, err
  19357. }
  19358. ret := &ForwardingRuleAggregatedList{
  19359. ServerResponse: googleapi.ServerResponse{
  19360. Header: res.Header,
  19361. HTTPStatusCode: res.StatusCode,
  19362. },
  19363. }
  19364. target := &ret
  19365. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  19366. return nil, err
  19367. }
  19368. return ret, nil
  19369. // {
  19370. // "description": "Retrieves an aggregated list of forwarding rules.",
  19371. // "httpMethod": "GET",
  19372. // "id": "compute.forwardingRules.aggregatedList",
  19373. // "parameterOrder": [
  19374. // "project"
  19375. // ],
  19376. // "parameters": {
  19377. // "filter": {
  19378. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  19379. // "location": "query",
  19380. // "type": "string"
  19381. // },
  19382. // "maxResults": {
  19383. // "default": "500",
  19384. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  19385. // "format": "uint32",
  19386. // "location": "query",
  19387. // "minimum": "0",
  19388. // "type": "integer"
  19389. // },
  19390. // "orderBy": {
  19391. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  19392. // "location": "query",
  19393. // "type": "string"
  19394. // },
  19395. // "pageToken": {
  19396. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  19397. // "location": "query",
  19398. // "type": "string"
  19399. // },
  19400. // "project": {
  19401. // "description": "Project ID for this request.",
  19402. // "location": "path",
  19403. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  19404. // "required": true,
  19405. // "type": "string"
  19406. // }
  19407. // },
  19408. // "path": "{project}/aggregated/forwardingRules",
  19409. // "response": {
  19410. // "$ref": "ForwardingRuleAggregatedList"
  19411. // },
  19412. // "scopes": [
  19413. // "https://www.googleapis.com/auth/cloud-platform",
  19414. // "https://www.googleapis.com/auth/compute",
  19415. // "https://www.googleapis.com/auth/compute.readonly"
  19416. // ]
  19417. // }
  19418. }
  19419. // Pages invokes f for each page of results.
  19420. // A non-nil error returned from f will halt the iteration.
  19421. // The provided context supersedes any context provided to the Context method.
  19422. func (c *ForwardingRulesAggregatedListCall) Pages(ctx context.Context, f func(*ForwardingRuleAggregatedList) error) error {
  19423. c.ctx_ = ctx
  19424. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  19425. for {
  19426. x, err := c.Do()
  19427. if err != nil {
  19428. return err
  19429. }
  19430. if err := f(x); err != nil {
  19431. return err
  19432. }
  19433. if x.NextPageToken == "" {
  19434. return nil
  19435. }
  19436. c.PageToken(x.NextPageToken)
  19437. }
  19438. }
  19439. // method id "compute.forwardingRules.delete":
  19440. type ForwardingRulesDeleteCall struct {
  19441. s *Service
  19442. project string
  19443. region string
  19444. forwardingRule string
  19445. urlParams_ gensupport.URLParams
  19446. ctx_ context.Context
  19447. header_ http.Header
  19448. }
  19449. // Delete: Deletes the specified ForwardingRule resource.
  19450. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/delete
  19451. func (r *ForwardingRulesService) Delete(project string, region string, forwardingRule string) *ForwardingRulesDeleteCall {
  19452. c := &ForwardingRulesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19453. c.project = project
  19454. c.region = region
  19455. c.forwardingRule = forwardingRule
  19456. return c
  19457. }
  19458. // Fields allows partial responses to be retrieved. See
  19459. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19460. // for more information.
  19461. func (c *ForwardingRulesDeleteCall) Fields(s ...googleapi.Field) *ForwardingRulesDeleteCall {
  19462. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19463. return c
  19464. }
  19465. // Context sets the context to be used in this call's Do method. Any
  19466. // pending HTTP request will be aborted if the provided context is
  19467. // canceled.
  19468. func (c *ForwardingRulesDeleteCall) Context(ctx context.Context) *ForwardingRulesDeleteCall {
  19469. c.ctx_ = ctx
  19470. return c
  19471. }
  19472. // Header returns an http.Header that can be modified by the caller to
  19473. // add HTTP headers to the request.
  19474. func (c *ForwardingRulesDeleteCall) Header() http.Header {
  19475. if c.header_ == nil {
  19476. c.header_ = make(http.Header)
  19477. }
  19478. return c.header_
  19479. }
  19480. func (c *ForwardingRulesDeleteCall) doRequest(alt string) (*http.Response, error) {
  19481. reqHeaders := make(http.Header)
  19482. for k, v := range c.header_ {
  19483. reqHeaders[k] = v
  19484. }
  19485. reqHeaders.Set("User-Agent", c.s.userAgent())
  19486. var body io.Reader = nil
  19487. c.urlParams_.Set("alt", alt)
  19488. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}")
  19489. urls += "?" + c.urlParams_.Encode()
  19490. req, _ := http.NewRequest("DELETE", urls, body)
  19491. req.Header = reqHeaders
  19492. googleapi.Expand(req.URL, map[string]string{
  19493. "project": c.project,
  19494. "region": c.region,
  19495. "forwardingRule": c.forwardingRule,
  19496. })
  19497. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19498. }
  19499. // Do executes the "compute.forwardingRules.delete" call.
  19500. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  19501. // status code is an error. Response headers are in either
  19502. // *Operation.ServerResponse.Header or (if a response was returned at
  19503. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  19504. // to check whether the returned error was because
  19505. // http.StatusNotModified was returned.
  19506. func (c *ForwardingRulesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  19507. gensupport.SetOptions(c.urlParams_, opts...)
  19508. res, err := c.doRequest("json")
  19509. if res != nil && res.StatusCode == http.StatusNotModified {
  19510. if res.Body != nil {
  19511. res.Body.Close()
  19512. }
  19513. return nil, &googleapi.Error{
  19514. Code: res.StatusCode,
  19515. Header: res.Header,
  19516. }
  19517. }
  19518. if err != nil {
  19519. return nil, err
  19520. }
  19521. defer googleapi.CloseBody(res)
  19522. if err := googleapi.CheckResponse(res); err != nil {
  19523. return nil, err
  19524. }
  19525. ret := &Operation{
  19526. ServerResponse: googleapi.ServerResponse{
  19527. Header: res.Header,
  19528. HTTPStatusCode: res.StatusCode,
  19529. },
  19530. }
  19531. target := &ret
  19532. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  19533. return nil, err
  19534. }
  19535. return ret, nil
  19536. // {
  19537. // "description": "Deletes the specified ForwardingRule resource.",
  19538. // "httpMethod": "DELETE",
  19539. // "id": "compute.forwardingRules.delete",
  19540. // "parameterOrder": [
  19541. // "project",
  19542. // "region",
  19543. // "forwardingRule"
  19544. // ],
  19545. // "parameters": {
  19546. // "forwardingRule": {
  19547. // "description": "Name of the ForwardingRule resource to delete.",
  19548. // "location": "path",
  19549. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  19550. // "required": true,
  19551. // "type": "string"
  19552. // },
  19553. // "project": {
  19554. // "description": "Project ID for this request.",
  19555. // "location": "path",
  19556. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  19557. // "required": true,
  19558. // "type": "string"
  19559. // },
  19560. // "region": {
  19561. // "description": "Name of the region scoping this request.",
  19562. // "location": "path",
  19563. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  19564. // "required": true,
  19565. // "type": "string"
  19566. // }
  19567. // },
  19568. // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}",
  19569. // "response": {
  19570. // "$ref": "Operation"
  19571. // },
  19572. // "scopes": [
  19573. // "https://www.googleapis.com/auth/cloud-platform",
  19574. // "https://www.googleapis.com/auth/compute"
  19575. // ]
  19576. // }
  19577. }
  19578. // method id "compute.forwardingRules.get":
  19579. type ForwardingRulesGetCall struct {
  19580. s *Service
  19581. project string
  19582. region string
  19583. forwardingRule string
  19584. urlParams_ gensupport.URLParams
  19585. ifNoneMatch_ string
  19586. ctx_ context.Context
  19587. header_ http.Header
  19588. }
  19589. // Get: Returns the specified ForwardingRule resource.
  19590. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/get
  19591. func (r *ForwardingRulesService) Get(project string, region string, forwardingRule string) *ForwardingRulesGetCall {
  19592. c := &ForwardingRulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19593. c.project = project
  19594. c.region = region
  19595. c.forwardingRule = forwardingRule
  19596. return c
  19597. }
  19598. // Fields allows partial responses to be retrieved. See
  19599. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19600. // for more information.
  19601. func (c *ForwardingRulesGetCall) Fields(s ...googleapi.Field) *ForwardingRulesGetCall {
  19602. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19603. return c
  19604. }
  19605. // IfNoneMatch sets the optional parameter which makes the operation
  19606. // fail if the object's ETag matches the given value. This is useful for
  19607. // getting updates only after the object has changed since the last
  19608. // request. Use googleapi.IsNotModified to check whether the response
  19609. // error from Do is the result of In-None-Match.
  19610. func (c *ForwardingRulesGetCall) IfNoneMatch(entityTag string) *ForwardingRulesGetCall {
  19611. c.ifNoneMatch_ = entityTag
  19612. return c
  19613. }
  19614. // Context sets the context to be used in this call's Do method. Any
  19615. // pending HTTP request will be aborted if the provided context is
  19616. // canceled.
  19617. func (c *ForwardingRulesGetCall) Context(ctx context.Context) *ForwardingRulesGetCall {
  19618. c.ctx_ = ctx
  19619. return c
  19620. }
  19621. // Header returns an http.Header that can be modified by the caller to
  19622. // add HTTP headers to the request.
  19623. func (c *ForwardingRulesGetCall) Header() http.Header {
  19624. if c.header_ == nil {
  19625. c.header_ = make(http.Header)
  19626. }
  19627. return c.header_
  19628. }
  19629. func (c *ForwardingRulesGetCall) doRequest(alt string) (*http.Response, error) {
  19630. reqHeaders := make(http.Header)
  19631. for k, v := range c.header_ {
  19632. reqHeaders[k] = v
  19633. }
  19634. reqHeaders.Set("User-Agent", c.s.userAgent())
  19635. if c.ifNoneMatch_ != "" {
  19636. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  19637. }
  19638. var body io.Reader = nil
  19639. c.urlParams_.Set("alt", alt)
  19640. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}")
  19641. urls += "?" + c.urlParams_.Encode()
  19642. req, _ := http.NewRequest("GET", urls, body)
  19643. req.Header = reqHeaders
  19644. googleapi.Expand(req.URL, map[string]string{
  19645. "project": c.project,
  19646. "region": c.region,
  19647. "forwardingRule": c.forwardingRule,
  19648. })
  19649. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19650. }
  19651. // Do executes the "compute.forwardingRules.get" call.
  19652. // Exactly one of *ForwardingRule or error will be non-nil. Any non-2xx
  19653. // status code is an error. Response headers are in either
  19654. // *ForwardingRule.ServerResponse.Header or (if a response was returned
  19655. // at all) in error.(*googleapi.Error).Header. Use
  19656. // googleapi.IsNotModified to check whether the returned error was
  19657. // because http.StatusNotModified was returned.
  19658. func (c *ForwardingRulesGetCall) Do(opts ...googleapi.CallOption) (*ForwardingRule, error) {
  19659. gensupport.SetOptions(c.urlParams_, opts...)
  19660. res, err := c.doRequest("json")
  19661. if res != nil && res.StatusCode == http.StatusNotModified {
  19662. if res.Body != nil {
  19663. res.Body.Close()
  19664. }
  19665. return nil, &googleapi.Error{
  19666. Code: res.StatusCode,
  19667. Header: res.Header,
  19668. }
  19669. }
  19670. if err != nil {
  19671. return nil, err
  19672. }
  19673. defer googleapi.CloseBody(res)
  19674. if err := googleapi.CheckResponse(res); err != nil {
  19675. return nil, err
  19676. }
  19677. ret := &ForwardingRule{
  19678. ServerResponse: googleapi.ServerResponse{
  19679. Header: res.Header,
  19680. HTTPStatusCode: res.StatusCode,
  19681. },
  19682. }
  19683. target := &ret
  19684. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  19685. return nil, err
  19686. }
  19687. return ret, nil
  19688. // {
  19689. // "description": "Returns the specified ForwardingRule resource.",
  19690. // "httpMethod": "GET",
  19691. // "id": "compute.forwardingRules.get",
  19692. // "parameterOrder": [
  19693. // "project",
  19694. // "region",
  19695. // "forwardingRule"
  19696. // ],
  19697. // "parameters": {
  19698. // "forwardingRule": {
  19699. // "description": "Name of the ForwardingRule resource to return.",
  19700. // "location": "path",
  19701. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  19702. // "required": true,
  19703. // "type": "string"
  19704. // },
  19705. // "project": {
  19706. // "description": "Project ID for this request.",
  19707. // "location": "path",
  19708. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  19709. // "required": true,
  19710. // "type": "string"
  19711. // },
  19712. // "region": {
  19713. // "description": "Name of the region scoping this request.",
  19714. // "location": "path",
  19715. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  19716. // "required": true,
  19717. // "type": "string"
  19718. // }
  19719. // },
  19720. // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}",
  19721. // "response": {
  19722. // "$ref": "ForwardingRule"
  19723. // },
  19724. // "scopes": [
  19725. // "https://www.googleapis.com/auth/cloud-platform",
  19726. // "https://www.googleapis.com/auth/compute",
  19727. // "https://www.googleapis.com/auth/compute.readonly"
  19728. // ]
  19729. // }
  19730. }
  19731. // method id "compute.forwardingRules.insert":
  19732. type ForwardingRulesInsertCall struct {
  19733. s *Service
  19734. project string
  19735. region string
  19736. forwardingrule *ForwardingRule
  19737. urlParams_ gensupport.URLParams
  19738. ctx_ context.Context
  19739. header_ http.Header
  19740. }
  19741. // Insert: Creates a ForwardingRule resource in the specified project
  19742. // and region using the data included in the request.
  19743. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/insert
  19744. func (r *ForwardingRulesService) Insert(project string, region string, forwardingrule *ForwardingRule) *ForwardingRulesInsertCall {
  19745. c := &ForwardingRulesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19746. c.project = project
  19747. c.region = region
  19748. c.forwardingrule = forwardingrule
  19749. return c
  19750. }
  19751. // Fields allows partial responses to be retrieved. See
  19752. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19753. // for more information.
  19754. func (c *ForwardingRulesInsertCall) Fields(s ...googleapi.Field) *ForwardingRulesInsertCall {
  19755. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19756. return c
  19757. }
  19758. // Context sets the context to be used in this call's Do method. Any
  19759. // pending HTTP request will be aborted if the provided context is
  19760. // canceled.
  19761. func (c *ForwardingRulesInsertCall) Context(ctx context.Context) *ForwardingRulesInsertCall {
  19762. c.ctx_ = ctx
  19763. return c
  19764. }
  19765. // Header returns an http.Header that can be modified by the caller to
  19766. // add HTTP headers to the request.
  19767. func (c *ForwardingRulesInsertCall) Header() http.Header {
  19768. if c.header_ == nil {
  19769. c.header_ = make(http.Header)
  19770. }
  19771. return c.header_
  19772. }
  19773. func (c *ForwardingRulesInsertCall) doRequest(alt string) (*http.Response, error) {
  19774. reqHeaders := make(http.Header)
  19775. for k, v := range c.header_ {
  19776. reqHeaders[k] = v
  19777. }
  19778. reqHeaders.Set("User-Agent", c.s.userAgent())
  19779. var body io.Reader = nil
  19780. body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule)
  19781. if err != nil {
  19782. return nil, err
  19783. }
  19784. reqHeaders.Set("Content-Type", "application/json")
  19785. c.urlParams_.Set("alt", alt)
  19786. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules")
  19787. urls += "?" + c.urlParams_.Encode()
  19788. req, _ := http.NewRequest("POST", urls, body)
  19789. req.Header = reqHeaders
  19790. googleapi.Expand(req.URL, map[string]string{
  19791. "project": c.project,
  19792. "region": c.region,
  19793. })
  19794. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19795. }
  19796. // Do executes the "compute.forwardingRules.insert" call.
  19797. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  19798. // status code is an error. Response headers are in either
  19799. // *Operation.ServerResponse.Header or (if a response was returned at
  19800. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  19801. // to check whether the returned error was because
  19802. // http.StatusNotModified was returned.
  19803. func (c *ForwardingRulesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  19804. gensupport.SetOptions(c.urlParams_, opts...)
  19805. res, err := c.doRequest("json")
  19806. if res != nil && res.StatusCode == http.StatusNotModified {
  19807. if res.Body != nil {
  19808. res.Body.Close()
  19809. }
  19810. return nil, &googleapi.Error{
  19811. Code: res.StatusCode,
  19812. Header: res.Header,
  19813. }
  19814. }
  19815. if err != nil {
  19816. return nil, err
  19817. }
  19818. defer googleapi.CloseBody(res)
  19819. if err := googleapi.CheckResponse(res); err != nil {
  19820. return nil, err
  19821. }
  19822. ret := &Operation{
  19823. ServerResponse: googleapi.ServerResponse{
  19824. Header: res.Header,
  19825. HTTPStatusCode: res.StatusCode,
  19826. },
  19827. }
  19828. target := &ret
  19829. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  19830. return nil, err
  19831. }
  19832. return ret, nil
  19833. // {
  19834. // "description": "Creates a ForwardingRule resource in the specified project and region using the data included in the request.",
  19835. // "httpMethod": "POST",
  19836. // "id": "compute.forwardingRules.insert",
  19837. // "parameterOrder": [
  19838. // "project",
  19839. // "region"
  19840. // ],
  19841. // "parameters": {
  19842. // "project": {
  19843. // "description": "Project ID for this request.",
  19844. // "location": "path",
  19845. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  19846. // "required": true,
  19847. // "type": "string"
  19848. // },
  19849. // "region": {
  19850. // "description": "Name of the region scoping this request.",
  19851. // "location": "path",
  19852. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  19853. // "required": true,
  19854. // "type": "string"
  19855. // }
  19856. // },
  19857. // "path": "{project}/regions/{region}/forwardingRules",
  19858. // "request": {
  19859. // "$ref": "ForwardingRule"
  19860. // },
  19861. // "response": {
  19862. // "$ref": "Operation"
  19863. // },
  19864. // "scopes": [
  19865. // "https://www.googleapis.com/auth/cloud-platform",
  19866. // "https://www.googleapis.com/auth/compute"
  19867. // ]
  19868. // }
  19869. }
  19870. // method id "compute.forwardingRules.list":
  19871. type ForwardingRulesListCall struct {
  19872. s *Service
  19873. project string
  19874. region string
  19875. urlParams_ gensupport.URLParams
  19876. ifNoneMatch_ string
  19877. ctx_ context.Context
  19878. header_ http.Header
  19879. }
  19880. // List: Retrieves a list of ForwardingRule resources available to the
  19881. // specified project and region.
  19882. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/list
  19883. func (r *ForwardingRulesService) List(project string, region string) *ForwardingRulesListCall {
  19884. c := &ForwardingRulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19885. c.project = project
  19886. c.region = region
  19887. return c
  19888. }
  19889. // Filter sets the optional parameter "filter": Sets a filter
  19890. // {expression} for filtering listed resources. Your {expression} must
  19891. // be in the format: field_name comparison_string literal_string.
  19892. //
  19893. // The field_name is the name of the field you want to compare. Only
  19894. // atomic field types are supported (string, number, boolean). The
  19895. // comparison_string must be either eq (equals) or ne (not equals). The
  19896. // literal_string is the string value to filter to. The literal value
  19897. // must be valid for the type of field you are filtering by (string,
  19898. // number, boolean). For string fields, the literal value is interpreted
  19899. // as a regular expression using RE2 syntax. The literal value must
  19900. // match the entire field.
  19901. //
  19902. // For example, to filter for instances that do not have a name of
  19903. // example-instance, you would use name ne example-instance.
  19904. //
  19905. // You can filter on nested fields. For example, you could filter on
  19906. // instances that have set the scheduling.automaticRestart field to
  19907. // true. Use filtering on nested fields to take advantage of labels to
  19908. // organize and search for results based on label values.
  19909. //
  19910. // To filter on multiple expressions, provide each separate expression
  19911. // within parentheses. For example, (scheduling.automaticRestart eq
  19912. // true) (zone eq us-central1-f). Multiple expressions are treated as
  19913. // AND expressions, meaning that resources must match all expressions to
  19914. // pass the filters.
  19915. func (c *ForwardingRulesListCall) Filter(filter string) *ForwardingRulesListCall {
  19916. c.urlParams_.Set("filter", filter)
  19917. return c
  19918. }
  19919. // MaxResults sets the optional parameter "maxResults": The maximum
  19920. // number of results per page that should be returned. If the number of
  19921. // available results is larger than maxResults, Compute Engine returns a
  19922. // nextPageToken that can be used to get the next page of results in
  19923. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  19924. // (Default: 500)
  19925. func (c *ForwardingRulesListCall) MaxResults(maxResults int64) *ForwardingRulesListCall {
  19926. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  19927. return c
  19928. }
  19929. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  19930. // a certain order. By default, results are returned in alphanumerical
  19931. // order based on the resource name.
  19932. //
  19933. // You can also sort results in descending order based on the creation
  19934. // timestamp using orderBy="creationTimestamp desc". This sorts results
  19935. // based on the creationTimestamp field in reverse chronological order
  19936. // (newest result first). Use this to sort resources like operations so
  19937. // that the newest operation is returned first.
  19938. //
  19939. // Currently, only sorting by name or creationTimestamp desc is
  19940. // supported.
  19941. func (c *ForwardingRulesListCall) OrderBy(orderBy string) *ForwardingRulesListCall {
  19942. c.urlParams_.Set("orderBy", orderBy)
  19943. return c
  19944. }
  19945. // PageToken sets the optional parameter "pageToken": Specifies a page
  19946. // token to use. Set pageToken to the nextPageToken returned by a
  19947. // previous list request to get the next page of results.
  19948. func (c *ForwardingRulesListCall) PageToken(pageToken string) *ForwardingRulesListCall {
  19949. c.urlParams_.Set("pageToken", pageToken)
  19950. return c
  19951. }
  19952. // Fields allows partial responses to be retrieved. See
  19953. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19954. // for more information.
  19955. func (c *ForwardingRulesListCall) Fields(s ...googleapi.Field) *ForwardingRulesListCall {
  19956. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19957. return c
  19958. }
  19959. // IfNoneMatch sets the optional parameter which makes the operation
  19960. // fail if the object's ETag matches the given value. This is useful for
  19961. // getting updates only after the object has changed since the last
  19962. // request. Use googleapi.IsNotModified to check whether the response
  19963. // error from Do is the result of In-None-Match.
  19964. func (c *ForwardingRulesListCall) IfNoneMatch(entityTag string) *ForwardingRulesListCall {
  19965. c.ifNoneMatch_ = entityTag
  19966. return c
  19967. }
  19968. // Context sets the context to be used in this call's Do method. Any
  19969. // pending HTTP request will be aborted if the provided context is
  19970. // canceled.
  19971. func (c *ForwardingRulesListCall) Context(ctx context.Context) *ForwardingRulesListCall {
  19972. c.ctx_ = ctx
  19973. return c
  19974. }
  19975. // Header returns an http.Header that can be modified by the caller to
  19976. // add HTTP headers to the request.
  19977. func (c *ForwardingRulesListCall) Header() http.Header {
  19978. if c.header_ == nil {
  19979. c.header_ = make(http.Header)
  19980. }
  19981. return c.header_
  19982. }
  19983. func (c *ForwardingRulesListCall) doRequest(alt string) (*http.Response, error) {
  19984. reqHeaders := make(http.Header)
  19985. for k, v := range c.header_ {
  19986. reqHeaders[k] = v
  19987. }
  19988. reqHeaders.Set("User-Agent", c.s.userAgent())
  19989. if c.ifNoneMatch_ != "" {
  19990. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  19991. }
  19992. var body io.Reader = nil
  19993. c.urlParams_.Set("alt", alt)
  19994. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules")
  19995. urls += "?" + c.urlParams_.Encode()
  19996. req, _ := http.NewRequest("GET", urls, body)
  19997. req.Header = reqHeaders
  19998. googleapi.Expand(req.URL, map[string]string{
  19999. "project": c.project,
  20000. "region": c.region,
  20001. })
  20002. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20003. }
  20004. // Do executes the "compute.forwardingRules.list" call.
  20005. // Exactly one of *ForwardingRuleList or error will be non-nil. Any
  20006. // non-2xx status code is an error. Response headers are in either
  20007. // *ForwardingRuleList.ServerResponse.Header or (if a response was
  20008. // returned at all) in error.(*googleapi.Error).Header. Use
  20009. // googleapi.IsNotModified to check whether the returned error was
  20010. // because http.StatusNotModified was returned.
  20011. func (c *ForwardingRulesListCall) Do(opts ...googleapi.CallOption) (*ForwardingRuleList, error) {
  20012. gensupport.SetOptions(c.urlParams_, opts...)
  20013. res, err := c.doRequest("json")
  20014. if res != nil && res.StatusCode == http.StatusNotModified {
  20015. if res.Body != nil {
  20016. res.Body.Close()
  20017. }
  20018. return nil, &googleapi.Error{
  20019. Code: res.StatusCode,
  20020. Header: res.Header,
  20021. }
  20022. }
  20023. if err != nil {
  20024. return nil, err
  20025. }
  20026. defer googleapi.CloseBody(res)
  20027. if err := googleapi.CheckResponse(res); err != nil {
  20028. return nil, err
  20029. }
  20030. ret := &ForwardingRuleList{
  20031. ServerResponse: googleapi.ServerResponse{
  20032. Header: res.Header,
  20033. HTTPStatusCode: res.StatusCode,
  20034. },
  20035. }
  20036. target := &ret
  20037. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  20038. return nil, err
  20039. }
  20040. return ret, nil
  20041. // {
  20042. // "description": "Retrieves a list of ForwardingRule resources available to the specified project and region.",
  20043. // "httpMethod": "GET",
  20044. // "id": "compute.forwardingRules.list",
  20045. // "parameterOrder": [
  20046. // "project",
  20047. // "region"
  20048. // ],
  20049. // "parameters": {
  20050. // "filter": {
  20051. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  20052. // "location": "query",
  20053. // "type": "string"
  20054. // },
  20055. // "maxResults": {
  20056. // "default": "500",
  20057. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  20058. // "format": "uint32",
  20059. // "location": "query",
  20060. // "minimum": "0",
  20061. // "type": "integer"
  20062. // },
  20063. // "orderBy": {
  20064. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  20065. // "location": "query",
  20066. // "type": "string"
  20067. // },
  20068. // "pageToken": {
  20069. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  20070. // "location": "query",
  20071. // "type": "string"
  20072. // },
  20073. // "project": {
  20074. // "description": "Project ID for this request.",
  20075. // "location": "path",
  20076. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  20077. // "required": true,
  20078. // "type": "string"
  20079. // },
  20080. // "region": {
  20081. // "description": "Name of the region scoping this request.",
  20082. // "location": "path",
  20083. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  20084. // "required": true,
  20085. // "type": "string"
  20086. // }
  20087. // },
  20088. // "path": "{project}/regions/{region}/forwardingRules",
  20089. // "response": {
  20090. // "$ref": "ForwardingRuleList"
  20091. // },
  20092. // "scopes": [
  20093. // "https://www.googleapis.com/auth/cloud-platform",
  20094. // "https://www.googleapis.com/auth/compute",
  20095. // "https://www.googleapis.com/auth/compute.readonly"
  20096. // ]
  20097. // }
  20098. }
  20099. // Pages invokes f for each page of results.
  20100. // A non-nil error returned from f will halt the iteration.
  20101. // The provided context supersedes any context provided to the Context method.
  20102. func (c *ForwardingRulesListCall) Pages(ctx context.Context, f func(*ForwardingRuleList) error) error {
  20103. c.ctx_ = ctx
  20104. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  20105. for {
  20106. x, err := c.Do()
  20107. if err != nil {
  20108. return err
  20109. }
  20110. if err := f(x); err != nil {
  20111. return err
  20112. }
  20113. if x.NextPageToken == "" {
  20114. return nil
  20115. }
  20116. c.PageToken(x.NextPageToken)
  20117. }
  20118. }
  20119. // method id "compute.forwardingRules.setTarget":
  20120. type ForwardingRulesSetTargetCall struct {
  20121. s *Service
  20122. project string
  20123. region string
  20124. forwardingRule string
  20125. targetreference *TargetReference
  20126. urlParams_ gensupport.URLParams
  20127. ctx_ context.Context
  20128. header_ http.Header
  20129. }
  20130. // SetTarget: Changes target URL for forwarding rule. The new target
  20131. // should be of the same type as the old target.
  20132. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/setTarget
  20133. func (r *ForwardingRulesService) SetTarget(project string, region string, forwardingRule string, targetreference *TargetReference) *ForwardingRulesSetTargetCall {
  20134. c := &ForwardingRulesSetTargetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20135. c.project = project
  20136. c.region = region
  20137. c.forwardingRule = forwardingRule
  20138. c.targetreference = targetreference
  20139. return c
  20140. }
  20141. // Fields allows partial responses to be retrieved. See
  20142. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20143. // for more information.
  20144. func (c *ForwardingRulesSetTargetCall) Fields(s ...googleapi.Field) *ForwardingRulesSetTargetCall {
  20145. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20146. return c
  20147. }
  20148. // Context sets the context to be used in this call's Do method. Any
  20149. // pending HTTP request will be aborted if the provided context is
  20150. // canceled.
  20151. func (c *ForwardingRulesSetTargetCall) Context(ctx context.Context) *ForwardingRulesSetTargetCall {
  20152. c.ctx_ = ctx
  20153. return c
  20154. }
  20155. // Header returns an http.Header that can be modified by the caller to
  20156. // add HTTP headers to the request.
  20157. func (c *ForwardingRulesSetTargetCall) Header() http.Header {
  20158. if c.header_ == nil {
  20159. c.header_ = make(http.Header)
  20160. }
  20161. return c.header_
  20162. }
  20163. func (c *ForwardingRulesSetTargetCall) doRequest(alt string) (*http.Response, error) {
  20164. reqHeaders := make(http.Header)
  20165. for k, v := range c.header_ {
  20166. reqHeaders[k] = v
  20167. }
  20168. reqHeaders.Set("User-Agent", c.s.userAgent())
  20169. var body io.Reader = nil
  20170. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference)
  20171. if err != nil {
  20172. return nil, err
  20173. }
  20174. reqHeaders.Set("Content-Type", "application/json")
  20175. c.urlParams_.Set("alt", alt)
  20176. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget")
  20177. urls += "?" + c.urlParams_.Encode()
  20178. req, _ := http.NewRequest("POST", urls, body)
  20179. req.Header = reqHeaders
  20180. googleapi.Expand(req.URL, map[string]string{
  20181. "project": c.project,
  20182. "region": c.region,
  20183. "forwardingRule": c.forwardingRule,
  20184. })
  20185. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20186. }
  20187. // Do executes the "compute.forwardingRules.setTarget" call.
  20188. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  20189. // status code is an error. Response headers are in either
  20190. // *Operation.ServerResponse.Header or (if a response was returned at
  20191. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  20192. // to check whether the returned error was because
  20193. // http.StatusNotModified was returned.
  20194. func (c *ForwardingRulesSetTargetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  20195. gensupport.SetOptions(c.urlParams_, opts...)
  20196. res, err := c.doRequest("json")
  20197. if res != nil && res.StatusCode == http.StatusNotModified {
  20198. if res.Body != nil {
  20199. res.Body.Close()
  20200. }
  20201. return nil, &googleapi.Error{
  20202. Code: res.StatusCode,
  20203. Header: res.Header,
  20204. }
  20205. }
  20206. if err != nil {
  20207. return nil, err
  20208. }
  20209. defer googleapi.CloseBody(res)
  20210. if err := googleapi.CheckResponse(res); err != nil {
  20211. return nil, err
  20212. }
  20213. ret := &Operation{
  20214. ServerResponse: googleapi.ServerResponse{
  20215. Header: res.Header,
  20216. HTTPStatusCode: res.StatusCode,
  20217. },
  20218. }
  20219. target := &ret
  20220. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  20221. return nil, err
  20222. }
  20223. return ret, nil
  20224. // {
  20225. // "description": "Changes target URL for forwarding rule. The new target should be of the same type as the old target.",
  20226. // "httpMethod": "POST",
  20227. // "id": "compute.forwardingRules.setTarget",
  20228. // "parameterOrder": [
  20229. // "project",
  20230. // "region",
  20231. // "forwardingRule"
  20232. // ],
  20233. // "parameters": {
  20234. // "forwardingRule": {
  20235. // "description": "Name of the ForwardingRule resource in which target is to be set.",
  20236. // "location": "path",
  20237. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  20238. // "required": true,
  20239. // "type": "string"
  20240. // },
  20241. // "project": {
  20242. // "description": "Project ID for this request.",
  20243. // "location": "path",
  20244. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  20245. // "required": true,
  20246. // "type": "string"
  20247. // },
  20248. // "region": {
  20249. // "description": "Name of the region scoping this request.",
  20250. // "location": "path",
  20251. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  20252. // "required": true,
  20253. // "type": "string"
  20254. // }
  20255. // },
  20256. // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget",
  20257. // "request": {
  20258. // "$ref": "TargetReference"
  20259. // },
  20260. // "response": {
  20261. // "$ref": "Operation"
  20262. // },
  20263. // "scopes": [
  20264. // "https://www.googleapis.com/auth/cloud-platform",
  20265. // "https://www.googleapis.com/auth/compute"
  20266. // ]
  20267. // }
  20268. }
  20269. // method id "compute.globalAddresses.delete":
  20270. type GlobalAddressesDeleteCall struct {
  20271. s *Service
  20272. project string
  20273. address string
  20274. urlParams_ gensupport.URLParams
  20275. ctx_ context.Context
  20276. header_ http.Header
  20277. }
  20278. // Delete: Deletes the specified address resource.
  20279. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/delete
  20280. func (r *GlobalAddressesService) Delete(project string, address string) *GlobalAddressesDeleteCall {
  20281. c := &GlobalAddressesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20282. c.project = project
  20283. c.address = address
  20284. return c
  20285. }
  20286. // Fields allows partial responses to be retrieved. See
  20287. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20288. // for more information.
  20289. func (c *GlobalAddressesDeleteCall) Fields(s ...googleapi.Field) *GlobalAddressesDeleteCall {
  20290. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20291. return c
  20292. }
  20293. // Context sets the context to be used in this call's Do method. Any
  20294. // pending HTTP request will be aborted if the provided context is
  20295. // canceled.
  20296. func (c *GlobalAddressesDeleteCall) Context(ctx context.Context) *GlobalAddressesDeleteCall {
  20297. c.ctx_ = ctx
  20298. return c
  20299. }
  20300. // Header returns an http.Header that can be modified by the caller to
  20301. // add HTTP headers to the request.
  20302. func (c *GlobalAddressesDeleteCall) Header() http.Header {
  20303. if c.header_ == nil {
  20304. c.header_ = make(http.Header)
  20305. }
  20306. return c.header_
  20307. }
  20308. func (c *GlobalAddressesDeleteCall) doRequest(alt string) (*http.Response, error) {
  20309. reqHeaders := make(http.Header)
  20310. for k, v := range c.header_ {
  20311. reqHeaders[k] = v
  20312. }
  20313. reqHeaders.Set("User-Agent", c.s.userAgent())
  20314. var body io.Reader = nil
  20315. c.urlParams_.Set("alt", alt)
  20316. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{address}")
  20317. urls += "?" + c.urlParams_.Encode()
  20318. req, _ := http.NewRequest("DELETE", urls, body)
  20319. req.Header = reqHeaders
  20320. googleapi.Expand(req.URL, map[string]string{
  20321. "project": c.project,
  20322. "address": c.address,
  20323. })
  20324. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20325. }
  20326. // Do executes the "compute.globalAddresses.delete" call.
  20327. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  20328. // status code is an error. Response headers are in either
  20329. // *Operation.ServerResponse.Header or (if a response was returned at
  20330. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  20331. // to check whether the returned error was because
  20332. // http.StatusNotModified was returned.
  20333. func (c *GlobalAddressesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  20334. gensupport.SetOptions(c.urlParams_, opts...)
  20335. res, err := c.doRequest("json")
  20336. if res != nil && res.StatusCode == http.StatusNotModified {
  20337. if res.Body != nil {
  20338. res.Body.Close()
  20339. }
  20340. return nil, &googleapi.Error{
  20341. Code: res.StatusCode,
  20342. Header: res.Header,
  20343. }
  20344. }
  20345. if err != nil {
  20346. return nil, err
  20347. }
  20348. defer googleapi.CloseBody(res)
  20349. if err := googleapi.CheckResponse(res); err != nil {
  20350. return nil, err
  20351. }
  20352. ret := &Operation{
  20353. ServerResponse: googleapi.ServerResponse{
  20354. Header: res.Header,
  20355. HTTPStatusCode: res.StatusCode,
  20356. },
  20357. }
  20358. target := &ret
  20359. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  20360. return nil, err
  20361. }
  20362. return ret, nil
  20363. // {
  20364. // "description": "Deletes the specified address resource.",
  20365. // "httpMethod": "DELETE",
  20366. // "id": "compute.globalAddresses.delete",
  20367. // "parameterOrder": [
  20368. // "project",
  20369. // "address"
  20370. // ],
  20371. // "parameters": {
  20372. // "address": {
  20373. // "description": "Name of the address resource to delete.",
  20374. // "location": "path",
  20375. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  20376. // "required": true,
  20377. // "type": "string"
  20378. // },
  20379. // "project": {
  20380. // "description": "Project ID for this request.",
  20381. // "location": "path",
  20382. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  20383. // "required": true,
  20384. // "type": "string"
  20385. // }
  20386. // },
  20387. // "path": "{project}/global/addresses/{address}",
  20388. // "response": {
  20389. // "$ref": "Operation"
  20390. // },
  20391. // "scopes": [
  20392. // "https://www.googleapis.com/auth/cloud-platform",
  20393. // "https://www.googleapis.com/auth/compute"
  20394. // ]
  20395. // }
  20396. }
  20397. // method id "compute.globalAddresses.get":
  20398. type GlobalAddressesGetCall struct {
  20399. s *Service
  20400. project string
  20401. address string
  20402. urlParams_ gensupport.URLParams
  20403. ifNoneMatch_ string
  20404. ctx_ context.Context
  20405. header_ http.Header
  20406. }
  20407. // Get: Returns the specified address resource. Get a list of available
  20408. // addresses by making a list() request.
  20409. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/get
  20410. func (r *GlobalAddressesService) Get(project string, address string) *GlobalAddressesGetCall {
  20411. c := &GlobalAddressesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20412. c.project = project
  20413. c.address = address
  20414. return c
  20415. }
  20416. // Fields allows partial responses to be retrieved. See
  20417. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20418. // for more information.
  20419. func (c *GlobalAddressesGetCall) Fields(s ...googleapi.Field) *GlobalAddressesGetCall {
  20420. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20421. return c
  20422. }
  20423. // IfNoneMatch sets the optional parameter which makes the operation
  20424. // fail if the object's ETag matches the given value. This is useful for
  20425. // getting updates only after the object has changed since the last
  20426. // request. Use googleapi.IsNotModified to check whether the response
  20427. // error from Do is the result of In-None-Match.
  20428. func (c *GlobalAddressesGetCall) IfNoneMatch(entityTag string) *GlobalAddressesGetCall {
  20429. c.ifNoneMatch_ = entityTag
  20430. return c
  20431. }
  20432. // Context sets the context to be used in this call's Do method. Any
  20433. // pending HTTP request will be aborted if the provided context is
  20434. // canceled.
  20435. func (c *GlobalAddressesGetCall) Context(ctx context.Context) *GlobalAddressesGetCall {
  20436. c.ctx_ = ctx
  20437. return c
  20438. }
  20439. // Header returns an http.Header that can be modified by the caller to
  20440. // add HTTP headers to the request.
  20441. func (c *GlobalAddressesGetCall) Header() http.Header {
  20442. if c.header_ == nil {
  20443. c.header_ = make(http.Header)
  20444. }
  20445. return c.header_
  20446. }
  20447. func (c *GlobalAddressesGetCall) doRequest(alt string) (*http.Response, error) {
  20448. reqHeaders := make(http.Header)
  20449. for k, v := range c.header_ {
  20450. reqHeaders[k] = v
  20451. }
  20452. reqHeaders.Set("User-Agent", c.s.userAgent())
  20453. if c.ifNoneMatch_ != "" {
  20454. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  20455. }
  20456. var body io.Reader = nil
  20457. c.urlParams_.Set("alt", alt)
  20458. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{address}")
  20459. urls += "?" + c.urlParams_.Encode()
  20460. req, _ := http.NewRequest("GET", urls, body)
  20461. req.Header = reqHeaders
  20462. googleapi.Expand(req.URL, map[string]string{
  20463. "project": c.project,
  20464. "address": c.address,
  20465. })
  20466. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20467. }
  20468. // Do executes the "compute.globalAddresses.get" call.
  20469. // Exactly one of *Address or error will be non-nil. Any non-2xx status
  20470. // code is an error. Response headers are in either
  20471. // *Address.ServerResponse.Header or (if a response was returned at all)
  20472. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  20473. // check whether the returned error was because http.StatusNotModified
  20474. // was returned.
  20475. func (c *GlobalAddressesGetCall) Do(opts ...googleapi.CallOption) (*Address, error) {
  20476. gensupport.SetOptions(c.urlParams_, opts...)
  20477. res, err := c.doRequest("json")
  20478. if res != nil && res.StatusCode == http.StatusNotModified {
  20479. if res.Body != nil {
  20480. res.Body.Close()
  20481. }
  20482. return nil, &googleapi.Error{
  20483. Code: res.StatusCode,
  20484. Header: res.Header,
  20485. }
  20486. }
  20487. if err != nil {
  20488. return nil, err
  20489. }
  20490. defer googleapi.CloseBody(res)
  20491. if err := googleapi.CheckResponse(res); err != nil {
  20492. return nil, err
  20493. }
  20494. ret := &Address{
  20495. ServerResponse: googleapi.ServerResponse{
  20496. Header: res.Header,
  20497. HTTPStatusCode: res.StatusCode,
  20498. },
  20499. }
  20500. target := &ret
  20501. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  20502. return nil, err
  20503. }
  20504. return ret, nil
  20505. // {
  20506. // "description": "Returns the specified address resource. Get a list of available addresses by making a list() request.",
  20507. // "httpMethod": "GET",
  20508. // "id": "compute.globalAddresses.get",
  20509. // "parameterOrder": [
  20510. // "project",
  20511. // "address"
  20512. // ],
  20513. // "parameters": {
  20514. // "address": {
  20515. // "description": "Name of the address resource to return.",
  20516. // "location": "path",
  20517. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  20518. // "required": true,
  20519. // "type": "string"
  20520. // },
  20521. // "project": {
  20522. // "description": "Project ID for this request.",
  20523. // "location": "path",
  20524. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  20525. // "required": true,
  20526. // "type": "string"
  20527. // }
  20528. // },
  20529. // "path": "{project}/global/addresses/{address}",
  20530. // "response": {
  20531. // "$ref": "Address"
  20532. // },
  20533. // "scopes": [
  20534. // "https://www.googleapis.com/auth/cloud-platform",
  20535. // "https://www.googleapis.com/auth/compute",
  20536. // "https://www.googleapis.com/auth/compute.readonly"
  20537. // ]
  20538. // }
  20539. }
  20540. // method id "compute.globalAddresses.insert":
  20541. type GlobalAddressesInsertCall struct {
  20542. s *Service
  20543. project string
  20544. address *Address
  20545. urlParams_ gensupport.URLParams
  20546. ctx_ context.Context
  20547. header_ http.Header
  20548. }
  20549. // Insert: Creates an address resource in the specified project using
  20550. // the data included in the request.
  20551. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/insert
  20552. func (r *GlobalAddressesService) Insert(project string, address *Address) *GlobalAddressesInsertCall {
  20553. c := &GlobalAddressesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20554. c.project = project
  20555. c.address = address
  20556. return c
  20557. }
  20558. // Fields allows partial responses to be retrieved. See
  20559. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20560. // for more information.
  20561. func (c *GlobalAddressesInsertCall) Fields(s ...googleapi.Field) *GlobalAddressesInsertCall {
  20562. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20563. return c
  20564. }
  20565. // Context sets the context to be used in this call's Do method. Any
  20566. // pending HTTP request will be aborted if the provided context is
  20567. // canceled.
  20568. func (c *GlobalAddressesInsertCall) Context(ctx context.Context) *GlobalAddressesInsertCall {
  20569. c.ctx_ = ctx
  20570. return c
  20571. }
  20572. // Header returns an http.Header that can be modified by the caller to
  20573. // add HTTP headers to the request.
  20574. func (c *GlobalAddressesInsertCall) Header() http.Header {
  20575. if c.header_ == nil {
  20576. c.header_ = make(http.Header)
  20577. }
  20578. return c.header_
  20579. }
  20580. func (c *GlobalAddressesInsertCall) doRequest(alt string) (*http.Response, error) {
  20581. reqHeaders := make(http.Header)
  20582. for k, v := range c.header_ {
  20583. reqHeaders[k] = v
  20584. }
  20585. reqHeaders.Set("User-Agent", c.s.userAgent())
  20586. var body io.Reader = nil
  20587. body, err := googleapi.WithoutDataWrapper.JSONReader(c.address)
  20588. if err != nil {
  20589. return nil, err
  20590. }
  20591. reqHeaders.Set("Content-Type", "application/json")
  20592. c.urlParams_.Set("alt", alt)
  20593. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses")
  20594. urls += "?" + c.urlParams_.Encode()
  20595. req, _ := http.NewRequest("POST", urls, body)
  20596. req.Header = reqHeaders
  20597. googleapi.Expand(req.URL, map[string]string{
  20598. "project": c.project,
  20599. })
  20600. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20601. }
  20602. // Do executes the "compute.globalAddresses.insert" call.
  20603. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  20604. // status code is an error. Response headers are in either
  20605. // *Operation.ServerResponse.Header or (if a response was returned at
  20606. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  20607. // to check whether the returned error was because
  20608. // http.StatusNotModified was returned.
  20609. func (c *GlobalAddressesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  20610. gensupport.SetOptions(c.urlParams_, opts...)
  20611. res, err := c.doRequest("json")
  20612. if res != nil && res.StatusCode == http.StatusNotModified {
  20613. if res.Body != nil {
  20614. res.Body.Close()
  20615. }
  20616. return nil, &googleapi.Error{
  20617. Code: res.StatusCode,
  20618. Header: res.Header,
  20619. }
  20620. }
  20621. if err != nil {
  20622. return nil, err
  20623. }
  20624. defer googleapi.CloseBody(res)
  20625. if err := googleapi.CheckResponse(res); err != nil {
  20626. return nil, err
  20627. }
  20628. ret := &Operation{
  20629. ServerResponse: googleapi.ServerResponse{
  20630. Header: res.Header,
  20631. HTTPStatusCode: res.StatusCode,
  20632. },
  20633. }
  20634. target := &ret
  20635. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  20636. return nil, err
  20637. }
  20638. return ret, nil
  20639. // {
  20640. // "description": "Creates an address resource in the specified project using the data included in the request.",
  20641. // "httpMethod": "POST",
  20642. // "id": "compute.globalAddresses.insert",
  20643. // "parameterOrder": [
  20644. // "project"
  20645. // ],
  20646. // "parameters": {
  20647. // "project": {
  20648. // "description": "Project ID for this request.",
  20649. // "location": "path",
  20650. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  20651. // "required": true,
  20652. // "type": "string"
  20653. // }
  20654. // },
  20655. // "path": "{project}/global/addresses",
  20656. // "request": {
  20657. // "$ref": "Address"
  20658. // },
  20659. // "response": {
  20660. // "$ref": "Operation"
  20661. // },
  20662. // "scopes": [
  20663. // "https://www.googleapis.com/auth/cloud-platform",
  20664. // "https://www.googleapis.com/auth/compute"
  20665. // ]
  20666. // }
  20667. }
  20668. // method id "compute.globalAddresses.list":
  20669. type GlobalAddressesListCall struct {
  20670. s *Service
  20671. project string
  20672. urlParams_ gensupport.URLParams
  20673. ifNoneMatch_ string
  20674. ctx_ context.Context
  20675. header_ http.Header
  20676. }
  20677. // List: Retrieves a list of global addresses.
  20678. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/list
  20679. func (r *GlobalAddressesService) List(project string) *GlobalAddressesListCall {
  20680. c := &GlobalAddressesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20681. c.project = project
  20682. return c
  20683. }
  20684. // Filter sets the optional parameter "filter": Sets a filter
  20685. // {expression} for filtering listed resources. Your {expression} must
  20686. // be in the format: field_name comparison_string literal_string.
  20687. //
  20688. // The field_name is the name of the field you want to compare. Only
  20689. // atomic field types are supported (string, number, boolean). The
  20690. // comparison_string must be either eq (equals) or ne (not equals). The
  20691. // literal_string is the string value to filter to. The literal value
  20692. // must be valid for the type of field you are filtering by (string,
  20693. // number, boolean). For string fields, the literal value is interpreted
  20694. // as a regular expression using RE2 syntax. The literal value must
  20695. // match the entire field.
  20696. //
  20697. // For example, to filter for instances that do not have a name of
  20698. // example-instance, you would use name ne example-instance.
  20699. //
  20700. // You can filter on nested fields. For example, you could filter on
  20701. // instances that have set the scheduling.automaticRestart field to
  20702. // true. Use filtering on nested fields to take advantage of labels to
  20703. // organize and search for results based on label values.
  20704. //
  20705. // To filter on multiple expressions, provide each separate expression
  20706. // within parentheses. For example, (scheduling.automaticRestart eq
  20707. // true) (zone eq us-central1-f). Multiple expressions are treated as
  20708. // AND expressions, meaning that resources must match all expressions to
  20709. // pass the filters.
  20710. func (c *GlobalAddressesListCall) Filter(filter string) *GlobalAddressesListCall {
  20711. c.urlParams_.Set("filter", filter)
  20712. return c
  20713. }
  20714. // MaxResults sets the optional parameter "maxResults": The maximum
  20715. // number of results per page that should be returned. If the number of
  20716. // available results is larger than maxResults, Compute Engine returns a
  20717. // nextPageToken that can be used to get the next page of results in
  20718. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  20719. // (Default: 500)
  20720. func (c *GlobalAddressesListCall) MaxResults(maxResults int64) *GlobalAddressesListCall {
  20721. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  20722. return c
  20723. }
  20724. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  20725. // a certain order. By default, results are returned in alphanumerical
  20726. // order based on the resource name.
  20727. //
  20728. // You can also sort results in descending order based on the creation
  20729. // timestamp using orderBy="creationTimestamp desc". This sorts results
  20730. // based on the creationTimestamp field in reverse chronological order
  20731. // (newest result first). Use this to sort resources like operations so
  20732. // that the newest operation is returned first.
  20733. //
  20734. // Currently, only sorting by name or creationTimestamp desc is
  20735. // supported.
  20736. func (c *GlobalAddressesListCall) OrderBy(orderBy string) *GlobalAddressesListCall {
  20737. c.urlParams_.Set("orderBy", orderBy)
  20738. return c
  20739. }
  20740. // PageToken sets the optional parameter "pageToken": Specifies a page
  20741. // token to use. Set pageToken to the nextPageToken returned by a
  20742. // previous list request to get the next page of results.
  20743. func (c *GlobalAddressesListCall) PageToken(pageToken string) *GlobalAddressesListCall {
  20744. c.urlParams_.Set("pageToken", pageToken)
  20745. return c
  20746. }
  20747. // Fields allows partial responses to be retrieved. See
  20748. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20749. // for more information.
  20750. func (c *GlobalAddressesListCall) Fields(s ...googleapi.Field) *GlobalAddressesListCall {
  20751. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20752. return c
  20753. }
  20754. // IfNoneMatch sets the optional parameter which makes the operation
  20755. // fail if the object's ETag matches the given value. This is useful for
  20756. // getting updates only after the object has changed since the last
  20757. // request. Use googleapi.IsNotModified to check whether the response
  20758. // error from Do is the result of In-None-Match.
  20759. func (c *GlobalAddressesListCall) IfNoneMatch(entityTag string) *GlobalAddressesListCall {
  20760. c.ifNoneMatch_ = entityTag
  20761. return c
  20762. }
  20763. // Context sets the context to be used in this call's Do method. Any
  20764. // pending HTTP request will be aborted if the provided context is
  20765. // canceled.
  20766. func (c *GlobalAddressesListCall) Context(ctx context.Context) *GlobalAddressesListCall {
  20767. c.ctx_ = ctx
  20768. return c
  20769. }
  20770. // Header returns an http.Header that can be modified by the caller to
  20771. // add HTTP headers to the request.
  20772. func (c *GlobalAddressesListCall) Header() http.Header {
  20773. if c.header_ == nil {
  20774. c.header_ = make(http.Header)
  20775. }
  20776. return c.header_
  20777. }
  20778. func (c *GlobalAddressesListCall) doRequest(alt string) (*http.Response, error) {
  20779. reqHeaders := make(http.Header)
  20780. for k, v := range c.header_ {
  20781. reqHeaders[k] = v
  20782. }
  20783. reqHeaders.Set("User-Agent", c.s.userAgent())
  20784. if c.ifNoneMatch_ != "" {
  20785. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  20786. }
  20787. var body io.Reader = nil
  20788. c.urlParams_.Set("alt", alt)
  20789. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses")
  20790. urls += "?" + c.urlParams_.Encode()
  20791. req, _ := http.NewRequest("GET", urls, body)
  20792. req.Header = reqHeaders
  20793. googleapi.Expand(req.URL, map[string]string{
  20794. "project": c.project,
  20795. })
  20796. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20797. }
  20798. // Do executes the "compute.globalAddresses.list" call.
  20799. // Exactly one of *AddressList or error will be non-nil. Any non-2xx
  20800. // status code is an error. Response headers are in either
  20801. // *AddressList.ServerResponse.Header or (if a response was returned at
  20802. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  20803. // to check whether the returned error was because
  20804. // http.StatusNotModified was returned.
  20805. func (c *GlobalAddressesListCall) Do(opts ...googleapi.CallOption) (*AddressList, error) {
  20806. gensupport.SetOptions(c.urlParams_, opts...)
  20807. res, err := c.doRequest("json")
  20808. if res != nil && res.StatusCode == http.StatusNotModified {
  20809. if res.Body != nil {
  20810. res.Body.Close()
  20811. }
  20812. return nil, &googleapi.Error{
  20813. Code: res.StatusCode,
  20814. Header: res.Header,
  20815. }
  20816. }
  20817. if err != nil {
  20818. return nil, err
  20819. }
  20820. defer googleapi.CloseBody(res)
  20821. if err := googleapi.CheckResponse(res); err != nil {
  20822. return nil, err
  20823. }
  20824. ret := &AddressList{
  20825. ServerResponse: googleapi.ServerResponse{
  20826. Header: res.Header,
  20827. HTTPStatusCode: res.StatusCode,
  20828. },
  20829. }
  20830. target := &ret
  20831. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  20832. return nil, err
  20833. }
  20834. return ret, nil
  20835. // {
  20836. // "description": "Retrieves a list of global addresses.",
  20837. // "httpMethod": "GET",
  20838. // "id": "compute.globalAddresses.list",
  20839. // "parameterOrder": [
  20840. // "project"
  20841. // ],
  20842. // "parameters": {
  20843. // "filter": {
  20844. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  20845. // "location": "query",
  20846. // "type": "string"
  20847. // },
  20848. // "maxResults": {
  20849. // "default": "500",
  20850. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  20851. // "format": "uint32",
  20852. // "location": "query",
  20853. // "minimum": "0",
  20854. // "type": "integer"
  20855. // },
  20856. // "orderBy": {
  20857. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  20858. // "location": "query",
  20859. // "type": "string"
  20860. // },
  20861. // "pageToken": {
  20862. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  20863. // "location": "query",
  20864. // "type": "string"
  20865. // },
  20866. // "project": {
  20867. // "description": "Project ID for this request.",
  20868. // "location": "path",
  20869. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  20870. // "required": true,
  20871. // "type": "string"
  20872. // }
  20873. // },
  20874. // "path": "{project}/global/addresses",
  20875. // "response": {
  20876. // "$ref": "AddressList"
  20877. // },
  20878. // "scopes": [
  20879. // "https://www.googleapis.com/auth/cloud-platform",
  20880. // "https://www.googleapis.com/auth/compute",
  20881. // "https://www.googleapis.com/auth/compute.readonly"
  20882. // ]
  20883. // }
  20884. }
  20885. // Pages invokes f for each page of results.
  20886. // A non-nil error returned from f will halt the iteration.
  20887. // The provided context supersedes any context provided to the Context method.
  20888. func (c *GlobalAddressesListCall) Pages(ctx context.Context, f func(*AddressList) error) error {
  20889. c.ctx_ = ctx
  20890. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  20891. for {
  20892. x, err := c.Do()
  20893. if err != nil {
  20894. return err
  20895. }
  20896. if err := f(x); err != nil {
  20897. return err
  20898. }
  20899. if x.NextPageToken == "" {
  20900. return nil
  20901. }
  20902. c.PageToken(x.NextPageToken)
  20903. }
  20904. }
  20905. // method id "compute.globalForwardingRules.delete":
  20906. type GlobalForwardingRulesDeleteCall struct {
  20907. s *Service
  20908. project string
  20909. forwardingRule string
  20910. urlParams_ gensupport.URLParams
  20911. ctx_ context.Context
  20912. header_ http.Header
  20913. }
  20914. // Delete: Deletes the specified GlobalForwardingRule resource.
  20915. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/delete
  20916. func (r *GlobalForwardingRulesService) Delete(project string, forwardingRule string) *GlobalForwardingRulesDeleteCall {
  20917. c := &GlobalForwardingRulesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20918. c.project = project
  20919. c.forwardingRule = forwardingRule
  20920. return c
  20921. }
  20922. // Fields allows partial responses to be retrieved. See
  20923. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20924. // for more information.
  20925. func (c *GlobalForwardingRulesDeleteCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesDeleteCall {
  20926. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20927. return c
  20928. }
  20929. // Context sets the context to be used in this call's Do method. Any
  20930. // pending HTTP request will be aborted if the provided context is
  20931. // canceled.
  20932. func (c *GlobalForwardingRulesDeleteCall) Context(ctx context.Context) *GlobalForwardingRulesDeleteCall {
  20933. c.ctx_ = ctx
  20934. return c
  20935. }
  20936. // Header returns an http.Header that can be modified by the caller to
  20937. // add HTTP headers to the request.
  20938. func (c *GlobalForwardingRulesDeleteCall) Header() http.Header {
  20939. if c.header_ == nil {
  20940. c.header_ = make(http.Header)
  20941. }
  20942. return c.header_
  20943. }
  20944. func (c *GlobalForwardingRulesDeleteCall) doRequest(alt string) (*http.Response, error) {
  20945. reqHeaders := make(http.Header)
  20946. for k, v := range c.header_ {
  20947. reqHeaders[k] = v
  20948. }
  20949. reqHeaders.Set("User-Agent", c.s.userAgent())
  20950. var body io.Reader = nil
  20951. c.urlParams_.Set("alt", alt)
  20952. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}")
  20953. urls += "?" + c.urlParams_.Encode()
  20954. req, _ := http.NewRequest("DELETE", urls, body)
  20955. req.Header = reqHeaders
  20956. googleapi.Expand(req.URL, map[string]string{
  20957. "project": c.project,
  20958. "forwardingRule": c.forwardingRule,
  20959. })
  20960. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20961. }
  20962. // Do executes the "compute.globalForwardingRules.delete" call.
  20963. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  20964. // status code is an error. Response headers are in either
  20965. // *Operation.ServerResponse.Header or (if a response was returned at
  20966. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  20967. // to check whether the returned error was because
  20968. // http.StatusNotModified was returned.
  20969. func (c *GlobalForwardingRulesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  20970. gensupport.SetOptions(c.urlParams_, opts...)
  20971. res, err := c.doRequest("json")
  20972. if res != nil && res.StatusCode == http.StatusNotModified {
  20973. if res.Body != nil {
  20974. res.Body.Close()
  20975. }
  20976. return nil, &googleapi.Error{
  20977. Code: res.StatusCode,
  20978. Header: res.Header,
  20979. }
  20980. }
  20981. if err != nil {
  20982. return nil, err
  20983. }
  20984. defer googleapi.CloseBody(res)
  20985. if err := googleapi.CheckResponse(res); err != nil {
  20986. return nil, err
  20987. }
  20988. ret := &Operation{
  20989. ServerResponse: googleapi.ServerResponse{
  20990. Header: res.Header,
  20991. HTTPStatusCode: res.StatusCode,
  20992. },
  20993. }
  20994. target := &ret
  20995. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  20996. return nil, err
  20997. }
  20998. return ret, nil
  20999. // {
  21000. // "description": "Deletes the specified GlobalForwardingRule resource.",
  21001. // "httpMethod": "DELETE",
  21002. // "id": "compute.globalForwardingRules.delete",
  21003. // "parameterOrder": [
  21004. // "project",
  21005. // "forwardingRule"
  21006. // ],
  21007. // "parameters": {
  21008. // "forwardingRule": {
  21009. // "description": "Name of the ForwardingRule resource to delete.",
  21010. // "location": "path",
  21011. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  21012. // "required": true,
  21013. // "type": "string"
  21014. // },
  21015. // "project": {
  21016. // "description": "Project ID for this request.",
  21017. // "location": "path",
  21018. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  21019. // "required": true,
  21020. // "type": "string"
  21021. // }
  21022. // },
  21023. // "path": "{project}/global/forwardingRules/{forwardingRule}",
  21024. // "response": {
  21025. // "$ref": "Operation"
  21026. // },
  21027. // "scopes": [
  21028. // "https://www.googleapis.com/auth/cloud-platform",
  21029. // "https://www.googleapis.com/auth/compute"
  21030. // ]
  21031. // }
  21032. }
  21033. // method id "compute.globalForwardingRules.get":
  21034. type GlobalForwardingRulesGetCall struct {
  21035. s *Service
  21036. project string
  21037. forwardingRule string
  21038. urlParams_ gensupport.URLParams
  21039. ifNoneMatch_ string
  21040. ctx_ context.Context
  21041. header_ http.Header
  21042. }
  21043. // Get: Returns the specified GlobalForwardingRule resource. Get a list
  21044. // of available forwarding rules by making a list() request.
  21045. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/get
  21046. func (r *GlobalForwardingRulesService) Get(project string, forwardingRule string) *GlobalForwardingRulesGetCall {
  21047. c := &GlobalForwardingRulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21048. c.project = project
  21049. c.forwardingRule = forwardingRule
  21050. return c
  21051. }
  21052. // Fields allows partial responses to be retrieved. See
  21053. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21054. // for more information.
  21055. func (c *GlobalForwardingRulesGetCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesGetCall {
  21056. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21057. return c
  21058. }
  21059. // IfNoneMatch sets the optional parameter which makes the operation
  21060. // fail if the object's ETag matches the given value. This is useful for
  21061. // getting updates only after the object has changed since the last
  21062. // request. Use googleapi.IsNotModified to check whether the response
  21063. // error from Do is the result of In-None-Match.
  21064. func (c *GlobalForwardingRulesGetCall) IfNoneMatch(entityTag string) *GlobalForwardingRulesGetCall {
  21065. c.ifNoneMatch_ = entityTag
  21066. return c
  21067. }
  21068. // Context sets the context to be used in this call's Do method. Any
  21069. // pending HTTP request will be aborted if the provided context is
  21070. // canceled.
  21071. func (c *GlobalForwardingRulesGetCall) Context(ctx context.Context) *GlobalForwardingRulesGetCall {
  21072. c.ctx_ = ctx
  21073. return c
  21074. }
  21075. // Header returns an http.Header that can be modified by the caller to
  21076. // add HTTP headers to the request.
  21077. func (c *GlobalForwardingRulesGetCall) Header() http.Header {
  21078. if c.header_ == nil {
  21079. c.header_ = make(http.Header)
  21080. }
  21081. return c.header_
  21082. }
  21083. func (c *GlobalForwardingRulesGetCall) doRequest(alt string) (*http.Response, error) {
  21084. reqHeaders := make(http.Header)
  21085. for k, v := range c.header_ {
  21086. reqHeaders[k] = v
  21087. }
  21088. reqHeaders.Set("User-Agent", c.s.userAgent())
  21089. if c.ifNoneMatch_ != "" {
  21090. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  21091. }
  21092. var body io.Reader = nil
  21093. c.urlParams_.Set("alt", alt)
  21094. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}")
  21095. urls += "?" + c.urlParams_.Encode()
  21096. req, _ := http.NewRequest("GET", urls, body)
  21097. req.Header = reqHeaders
  21098. googleapi.Expand(req.URL, map[string]string{
  21099. "project": c.project,
  21100. "forwardingRule": c.forwardingRule,
  21101. })
  21102. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21103. }
  21104. // Do executes the "compute.globalForwardingRules.get" call.
  21105. // Exactly one of *ForwardingRule or error will be non-nil. Any non-2xx
  21106. // status code is an error. Response headers are in either
  21107. // *ForwardingRule.ServerResponse.Header or (if a response was returned
  21108. // at all) in error.(*googleapi.Error).Header. Use
  21109. // googleapi.IsNotModified to check whether the returned error was
  21110. // because http.StatusNotModified was returned.
  21111. func (c *GlobalForwardingRulesGetCall) Do(opts ...googleapi.CallOption) (*ForwardingRule, error) {
  21112. gensupport.SetOptions(c.urlParams_, opts...)
  21113. res, err := c.doRequest("json")
  21114. if res != nil && res.StatusCode == http.StatusNotModified {
  21115. if res.Body != nil {
  21116. res.Body.Close()
  21117. }
  21118. return nil, &googleapi.Error{
  21119. Code: res.StatusCode,
  21120. Header: res.Header,
  21121. }
  21122. }
  21123. if err != nil {
  21124. return nil, err
  21125. }
  21126. defer googleapi.CloseBody(res)
  21127. if err := googleapi.CheckResponse(res); err != nil {
  21128. return nil, err
  21129. }
  21130. ret := &ForwardingRule{
  21131. ServerResponse: googleapi.ServerResponse{
  21132. Header: res.Header,
  21133. HTTPStatusCode: res.StatusCode,
  21134. },
  21135. }
  21136. target := &ret
  21137. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  21138. return nil, err
  21139. }
  21140. return ret, nil
  21141. // {
  21142. // "description": "Returns the specified GlobalForwardingRule resource. Get a list of available forwarding rules by making a list() request.",
  21143. // "httpMethod": "GET",
  21144. // "id": "compute.globalForwardingRules.get",
  21145. // "parameterOrder": [
  21146. // "project",
  21147. // "forwardingRule"
  21148. // ],
  21149. // "parameters": {
  21150. // "forwardingRule": {
  21151. // "description": "Name of the ForwardingRule resource to return.",
  21152. // "location": "path",
  21153. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  21154. // "required": true,
  21155. // "type": "string"
  21156. // },
  21157. // "project": {
  21158. // "description": "Project ID for this request.",
  21159. // "location": "path",
  21160. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  21161. // "required": true,
  21162. // "type": "string"
  21163. // }
  21164. // },
  21165. // "path": "{project}/global/forwardingRules/{forwardingRule}",
  21166. // "response": {
  21167. // "$ref": "ForwardingRule"
  21168. // },
  21169. // "scopes": [
  21170. // "https://www.googleapis.com/auth/cloud-platform",
  21171. // "https://www.googleapis.com/auth/compute",
  21172. // "https://www.googleapis.com/auth/compute.readonly"
  21173. // ]
  21174. // }
  21175. }
  21176. // method id "compute.globalForwardingRules.insert":
  21177. type GlobalForwardingRulesInsertCall struct {
  21178. s *Service
  21179. project string
  21180. forwardingrule *ForwardingRule
  21181. urlParams_ gensupport.URLParams
  21182. ctx_ context.Context
  21183. header_ http.Header
  21184. }
  21185. // Insert: Creates a GlobalForwardingRule resource in the specified
  21186. // project using the data included in the request.
  21187. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/insert
  21188. func (r *GlobalForwardingRulesService) Insert(project string, forwardingrule *ForwardingRule) *GlobalForwardingRulesInsertCall {
  21189. c := &GlobalForwardingRulesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21190. c.project = project
  21191. c.forwardingrule = forwardingrule
  21192. return c
  21193. }
  21194. // Fields allows partial responses to be retrieved. See
  21195. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21196. // for more information.
  21197. func (c *GlobalForwardingRulesInsertCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesInsertCall {
  21198. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21199. return c
  21200. }
  21201. // Context sets the context to be used in this call's Do method. Any
  21202. // pending HTTP request will be aborted if the provided context is
  21203. // canceled.
  21204. func (c *GlobalForwardingRulesInsertCall) Context(ctx context.Context) *GlobalForwardingRulesInsertCall {
  21205. c.ctx_ = ctx
  21206. return c
  21207. }
  21208. // Header returns an http.Header that can be modified by the caller to
  21209. // add HTTP headers to the request.
  21210. func (c *GlobalForwardingRulesInsertCall) Header() http.Header {
  21211. if c.header_ == nil {
  21212. c.header_ = make(http.Header)
  21213. }
  21214. return c.header_
  21215. }
  21216. func (c *GlobalForwardingRulesInsertCall) doRequest(alt string) (*http.Response, error) {
  21217. reqHeaders := make(http.Header)
  21218. for k, v := range c.header_ {
  21219. reqHeaders[k] = v
  21220. }
  21221. reqHeaders.Set("User-Agent", c.s.userAgent())
  21222. var body io.Reader = nil
  21223. body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule)
  21224. if err != nil {
  21225. return nil, err
  21226. }
  21227. reqHeaders.Set("Content-Type", "application/json")
  21228. c.urlParams_.Set("alt", alt)
  21229. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules")
  21230. urls += "?" + c.urlParams_.Encode()
  21231. req, _ := http.NewRequest("POST", urls, body)
  21232. req.Header = reqHeaders
  21233. googleapi.Expand(req.URL, map[string]string{
  21234. "project": c.project,
  21235. })
  21236. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21237. }
  21238. // Do executes the "compute.globalForwardingRules.insert" call.
  21239. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  21240. // status code is an error. Response headers are in either
  21241. // *Operation.ServerResponse.Header or (if a response was returned at
  21242. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  21243. // to check whether the returned error was because
  21244. // http.StatusNotModified was returned.
  21245. func (c *GlobalForwardingRulesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  21246. gensupport.SetOptions(c.urlParams_, opts...)
  21247. res, err := c.doRequest("json")
  21248. if res != nil && res.StatusCode == http.StatusNotModified {
  21249. if res.Body != nil {
  21250. res.Body.Close()
  21251. }
  21252. return nil, &googleapi.Error{
  21253. Code: res.StatusCode,
  21254. Header: res.Header,
  21255. }
  21256. }
  21257. if err != nil {
  21258. return nil, err
  21259. }
  21260. defer googleapi.CloseBody(res)
  21261. if err := googleapi.CheckResponse(res); err != nil {
  21262. return nil, err
  21263. }
  21264. ret := &Operation{
  21265. ServerResponse: googleapi.ServerResponse{
  21266. Header: res.Header,
  21267. HTTPStatusCode: res.StatusCode,
  21268. },
  21269. }
  21270. target := &ret
  21271. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  21272. return nil, err
  21273. }
  21274. return ret, nil
  21275. // {
  21276. // "description": "Creates a GlobalForwardingRule resource in the specified project using the data included in the request.",
  21277. // "httpMethod": "POST",
  21278. // "id": "compute.globalForwardingRules.insert",
  21279. // "parameterOrder": [
  21280. // "project"
  21281. // ],
  21282. // "parameters": {
  21283. // "project": {
  21284. // "description": "Project ID for this request.",
  21285. // "location": "path",
  21286. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  21287. // "required": true,
  21288. // "type": "string"
  21289. // }
  21290. // },
  21291. // "path": "{project}/global/forwardingRules",
  21292. // "request": {
  21293. // "$ref": "ForwardingRule"
  21294. // },
  21295. // "response": {
  21296. // "$ref": "Operation"
  21297. // },
  21298. // "scopes": [
  21299. // "https://www.googleapis.com/auth/cloud-platform",
  21300. // "https://www.googleapis.com/auth/compute"
  21301. // ]
  21302. // }
  21303. }
  21304. // method id "compute.globalForwardingRules.list":
  21305. type GlobalForwardingRulesListCall struct {
  21306. s *Service
  21307. project string
  21308. urlParams_ gensupport.URLParams
  21309. ifNoneMatch_ string
  21310. ctx_ context.Context
  21311. header_ http.Header
  21312. }
  21313. // List: Retrieves a list of GlobalForwardingRule resources available to
  21314. // the specified project.
  21315. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/list
  21316. func (r *GlobalForwardingRulesService) List(project string) *GlobalForwardingRulesListCall {
  21317. c := &GlobalForwardingRulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21318. c.project = project
  21319. return c
  21320. }
  21321. // Filter sets the optional parameter "filter": Sets a filter
  21322. // {expression} for filtering listed resources. Your {expression} must
  21323. // be in the format: field_name comparison_string literal_string.
  21324. //
  21325. // The field_name is the name of the field you want to compare. Only
  21326. // atomic field types are supported (string, number, boolean). The
  21327. // comparison_string must be either eq (equals) or ne (not equals). The
  21328. // literal_string is the string value to filter to. The literal value
  21329. // must be valid for the type of field you are filtering by (string,
  21330. // number, boolean). For string fields, the literal value is interpreted
  21331. // as a regular expression using RE2 syntax. The literal value must
  21332. // match the entire field.
  21333. //
  21334. // For example, to filter for instances that do not have a name of
  21335. // example-instance, you would use name ne example-instance.
  21336. //
  21337. // You can filter on nested fields. For example, you could filter on
  21338. // instances that have set the scheduling.automaticRestart field to
  21339. // true. Use filtering on nested fields to take advantage of labels to
  21340. // organize and search for results based on label values.
  21341. //
  21342. // To filter on multiple expressions, provide each separate expression
  21343. // within parentheses. For example, (scheduling.automaticRestart eq
  21344. // true) (zone eq us-central1-f). Multiple expressions are treated as
  21345. // AND expressions, meaning that resources must match all expressions to
  21346. // pass the filters.
  21347. func (c *GlobalForwardingRulesListCall) Filter(filter string) *GlobalForwardingRulesListCall {
  21348. c.urlParams_.Set("filter", filter)
  21349. return c
  21350. }
  21351. // MaxResults sets the optional parameter "maxResults": The maximum
  21352. // number of results per page that should be returned. If the number of
  21353. // available results is larger than maxResults, Compute Engine returns a
  21354. // nextPageToken that can be used to get the next page of results in
  21355. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  21356. // (Default: 500)
  21357. func (c *GlobalForwardingRulesListCall) MaxResults(maxResults int64) *GlobalForwardingRulesListCall {
  21358. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  21359. return c
  21360. }
  21361. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  21362. // a certain order. By default, results are returned in alphanumerical
  21363. // order based on the resource name.
  21364. //
  21365. // You can also sort results in descending order based on the creation
  21366. // timestamp using orderBy="creationTimestamp desc". This sorts results
  21367. // based on the creationTimestamp field in reverse chronological order
  21368. // (newest result first). Use this to sort resources like operations so
  21369. // that the newest operation is returned first.
  21370. //
  21371. // Currently, only sorting by name or creationTimestamp desc is
  21372. // supported.
  21373. func (c *GlobalForwardingRulesListCall) OrderBy(orderBy string) *GlobalForwardingRulesListCall {
  21374. c.urlParams_.Set("orderBy", orderBy)
  21375. return c
  21376. }
  21377. // PageToken sets the optional parameter "pageToken": Specifies a page
  21378. // token to use. Set pageToken to the nextPageToken returned by a
  21379. // previous list request to get the next page of results.
  21380. func (c *GlobalForwardingRulesListCall) PageToken(pageToken string) *GlobalForwardingRulesListCall {
  21381. c.urlParams_.Set("pageToken", pageToken)
  21382. return c
  21383. }
  21384. // Fields allows partial responses to be retrieved. See
  21385. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21386. // for more information.
  21387. func (c *GlobalForwardingRulesListCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesListCall {
  21388. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21389. return c
  21390. }
  21391. // IfNoneMatch sets the optional parameter which makes the operation
  21392. // fail if the object's ETag matches the given value. This is useful for
  21393. // getting updates only after the object has changed since the last
  21394. // request. Use googleapi.IsNotModified to check whether the response
  21395. // error from Do is the result of In-None-Match.
  21396. func (c *GlobalForwardingRulesListCall) IfNoneMatch(entityTag string) *GlobalForwardingRulesListCall {
  21397. c.ifNoneMatch_ = entityTag
  21398. return c
  21399. }
  21400. // Context sets the context to be used in this call's Do method. Any
  21401. // pending HTTP request will be aborted if the provided context is
  21402. // canceled.
  21403. func (c *GlobalForwardingRulesListCall) Context(ctx context.Context) *GlobalForwardingRulesListCall {
  21404. c.ctx_ = ctx
  21405. return c
  21406. }
  21407. // Header returns an http.Header that can be modified by the caller to
  21408. // add HTTP headers to the request.
  21409. func (c *GlobalForwardingRulesListCall) Header() http.Header {
  21410. if c.header_ == nil {
  21411. c.header_ = make(http.Header)
  21412. }
  21413. return c.header_
  21414. }
  21415. func (c *GlobalForwardingRulesListCall) doRequest(alt string) (*http.Response, error) {
  21416. reqHeaders := make(http.Header)
  21417. for k, v := range c.header_ {
  21418. reqHeaders[k] = v
  21419. }
  21420. reqHeaders.Set("User-Agent", c.s.userAgent())
  21421. if c.ifNoneMatch_ != "" {
  21422. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  21423. }
  21424. var body io.Reader = nil
  21425. c.urlParams_.Set("alt", alt)
  21426. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules")
  21427. urls += "?" + c.urlParams_.Encode()
  21428. req, _ := http.NewRequest("GET", urls, body)
  21429. req.Header = reqHeaders
  21430. googleapi.Expand(req.URL, map[string]string{
  21431. "project": c.project,
  21432. })
  21433. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21434. }
  21435. // Do executes the "compute.globalForwardingRules.list" call.
  21436. // Exactly one of *ForwardingRuleList or error will be non-nil. Any
  21437. // non-2xx status code is an error. Response headers are in either
  21438. // *ForwardingRuleList.ServerResponse.Header or (if a response was
  21439. // returned at all) in error.(*googleapi.Error).Header. Use
  21440. // googleapi.IsNotModified to check whether the returned error was
  21441. // because http.StatusNotModified was returned.
  21442. func (c *GlobalForwardingRulesListCall) Do(opts ...googleapi.CallOption) (*ForwardingRuleList, error) {
  21443. gensupport.SetOptions(c.urlParams_, opts...)
  21444. res, err := c.doRequest("json")
  21445. if res != nil && res.StatusCode == http.StatusNotModified {
  21446. if res.Body != nil {
  21447. res.Body.Close()
  21448. }
  21449. return nil, &googleapi.Error{
  21450. Code: res.StatusCode,
  21451. Header: res.Header,
  21452. }
  21453. }
  21454. if err != nil {
  21455. return nil, err
  21456. }
  21457. defer googleapi.CloseBody(res)
  21458. if err := googleapi.CheckResponse(res); err != nil {
  21459. return nil, err
  21460. }
  21461. ret := &ForwardingRuleList{
  21462. ServerResponse: googleapi.ServerResponse{
  21463. Header: res.Header,
  21464. HTTPStatusCode: res.StatusCode,
  21465. },
  21466. }
  21467. target := &ret
  21468. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  21469. return nil, err
  21470. }
  21471. return ret, nil
  21472. // {
  21473. // "description": "Retrieves a list of GlobalForwardingRule resources available to the specified project.",
  21474. // "httpMethod": "GET",
  21475. // "id": "compute.globalForwardingRules.list",
  21476. // "parameterOrder": [
  21477. // "project"
  21478. // ],
  21479. // "parameters": {
  21480. // "filter": {
  21481. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  21482. // "location": "query",
  21483. // "type": "string"
  21484. // },
  21485. // "maxResults": {
  21486. // "default": "500",
  21487. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  21488. // "format": "uint32",
  21489. // "location": "query",
  21490. // "minimum": "0",
  21491. // "type": "integer"
  21492. // },
  21493. // "orderBy": {
  21494. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  21495. // "location": "query",
  21496. // "type": "string"
  21497. // },
  21498. // "pageToken": {
  21499. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  21500. // "location": "query",
  21501. // "type": "string"
  21502. // },
  21503. // "project": {
  21504. // "description": "Project ID for this request.",
  21505. // "location": "path",
  21506. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  21507. // "required": true,
  21508. // "type": "string"
  21509. // }
  21510. // },
  21511. // "path": "{project}/global/forwardingRules",
  21512. // "response": {
  21513. // "$ref": "ForwardingRuleList"
  21514. // },
  21515. // "scopes": [
  21516. // "https://www.googleapis.com/auth/cloud-platform",
  21517. // "https://www.googleapis.com/auth/compute",
  21518. // "https://www.googleapis.com/auth/compute.readonly"
  21519. // ]
  21520. // }
  21521. }
  21522. // Pages invokes f for each page of results.
  21523. // A non-nil error returned from f will halt the iteration.
  21524. // The provided context supersedes any context provided to the Context method.
  21525. func (c *GlobalForwardingRulesListCall) Pages(ctx context.Context, f func(*ForwardingRuleList) error) error {
  21526. c.ctx_ = ctx
  21527. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  21528. for {
  21529. x, err := c.Do()
  21530. if err != nil {
  21531. return err
  21532. }
  21533. if err := f(x); err != nil {
  21534. return err
  21535. }
  21536. if x.NextPageToken == "" {
  21537. return nil
  21538. }
  21539. c.PageToken(x.NextPageToken)
  21540. }
  21541. }
  21542. // method id "compute.globalForwardingRules.setTarget":
  21543. type GlobalForwardingRulesSetTargetCall struct {
  21544. s *Service
  21545. project string
  21546. forwardingRule string
  21547. targetreference *TargetReference
  21548. urlParams_ gensupport.URLParams
  21549. ctx_ context.Context
  21550. header_ http.Header
  21551. }
  21552. // SetTarget: Changes target URL for the GlobalForwardingRule resource.
  21553. // The new target should be of the same type as the old target.
  21554. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/setTarget
  21555. func (r *GlobalForwardingRulesService) SetTarget(project string, forwardingRule string, targetreference *TargetReference) *GlobalForwardingRulesSetTargetCall {
  21556. c := &GlobalForwardingRulesSetTargetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21557. c.project = project
  21558. c.forwardingRule = forwardingRule
  21559. c.targetreference = targetreference
  21560. return c
  21561. }
  21562. // Fields allows partial responses to be retrieved. See
  21563. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21564. // for more information.
  21565. func (c *GlobalForwardingRulesSetTargetCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesSetTargetCall {
  21566. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21567. return c
  21568. }
  21569. // Context sets the context to be used in this call's Do method. Any
  21570. // pending HTTP request will be aborted if the provided context is
  21571. // canceled.
  21572. func (c *GlobalForwardingRulesSetTargetCall) Context(ctx context.Context) *GlobalForwardingRulesSetTargetCall {
  21573. c.ctx_ = ctx
  21574. return c
  21575. }
  21576. // Header returns an http.Header that can be modified by the caller to
  21577. // add HTTP headers to the request.
  21578. func (c *GlobalForwardingRulesSetTargetCall) Header() http.Header {
  21579. if c.header_ == nil {
  21580. c.header_ = make(http.Header)
  21581. }
  21582. return c.header_
  21583. }
  21584. func (c *GlobalForwardingRulesSetTargetCall) doRequest(alt string) (*http.Response, error) {
  21585. reqHeaders := make(http.Header)
  21586. for k, v := range c.header_ {
  21587. reqHeaders[k] = v
  21588. }
  21589. reqHeaders.Set("User-Agent", c.s.userAgent())
  21590. var body io.Reader = nil
  21591. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference)
  21592. if err != nil {
  21593. return nil, err
  21594. }
  21595. reqHeaders.Set("Content-Type", "application/json")
  21596. c.urlParams_.Set("alt", alt)
  21597. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}/setTarget")
  21598. urls += "?" + c.urlParams_.Encode()
  21599. req, _ := http.NewRequest("POST", urls, body)
  21600. req.Header = reqHeaders
  21601. googleapi.Expand(req.URL, map[string]string{
  21602. "project": c.project,
  21603. "forwardingRule": c.forwardingRule,
  21604. })
  21605. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21606. }
  21607. // Do executes the "compute.globalForwardingRules.setTarget" call.
  21608. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  21609. // status code is an error. Response headers are in either
  21610. // *Operation.ServerResponse.Header or (if a response was returned at
  21611. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  21612. // to check whether the returned error was because
  21613. // http.StatusNotModified was returned.
  21614. func (c *GlobalForwardingRulesSetTargetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  21615. gensupport.SetOptions(c.urlParams_, opts...)
  21616. res, err := c.doRequest("json")
  21617. if res != nil && res.StatusCode == http.StatusNotModified {
  21618. if res.Body != nil {
  21619. res.Body.Close()
  21620. }
  21621. return nil, &googleapi.Error{
  21622. Code: res.StatusCode,
  21623. Header: res.Header,
  21624. }
  21625. }
  21626. if err != nil {
  21627. return nil, err
  21628. }
  21629. defer googleapi.CloseBody(res)
  21630. if err := googleapi.CheckResponse(res); err != nil {
  21631. return nil, err
  21632. }
  21633. ret := &Operation{
  21634. ServerResponse: googleapi.ServerResponse{
  21635. Header: res.Header,
  21636. HTTPStatusCode: res.StatusCode,
  21637. },
  21638. }
  21639. target := &ret
  21640. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  21641. return nil, err
  21642. }
  21643. return ret, nil
  21644. // {
  21645. // "description": "Changes target URL for the GlobalForwardingRule resource. The new target should be of the same type as the old target.",
  21646. // "httpMethod": "POST",
  21647. // "id": "compute.globalForwardingRules.setTarget",
  21648. // "parameterOrder": [
  21649. // "project",
  21650. // "forwardingRule"
  21651. // ],
  21652. // "parameters": {
  21653. // "forwardingRule": {
  21654. // "description": "Name of the ForwardingRule resource in which target is to be set.",
  21655. // "location": "path",
  21656. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  21657. // "required": true,
  21658. // "type": "string"
  21659. // },
  21660. // "project": {
  21661. // "description": "Project ID for this request.",
  21662. // "location": "path",
  21663. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  21664. // "required": true,
  21665. // "type": "string"
  21666. // }
  21667. // },
  21668. // "path": "{project}/global/forwardingRules/{forwardingRule}/setTarget",
  21669. // "request": {
  21670. // "$ref": "TargetReference"
  21671. // },
  21672. // "response": {
  21673. // "$ref": "Operation"
  21674. // },
  21675. // "scopes": [
  21676. // "https://www.googleapis.com/auth/cloud-platform",
  21677. // "https://www.googleapis.com/auth/compute"
  21678. // ]
  21679. // }
  21680. }
  21681. // method id "compute.globalOperations.aggregatedList":
  21682. type GlobalOperationsAggregatedListCall struct {
  21683. s *Service
  21684. project string
  21685. urlParams_ gensupport.URLParams
  21686. ifNoneMatch_ string
  21687. ctx_ context.Context
  21688. header_ http.Header
  21689. }
  21690. // AggregatedList: Retrieves an aggregated list of all operations.
  21691. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/aggregatedList
  21692. func (r *GlobalOperationsService) AggregatedList(project string) *GlobalOperationsAggregatedListCall {
  21693. c := &GlobalOperationsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21694. c.project = project
  21695. return c
  21696. }
  21697. // Filter sets the optional parameter "filter": Sets a filter
  21698. // {expression} for filtering listed resources. Your {expression} must
  21699. // be in the format: field_name comparison_string literal_string.
  21700. //
  21701. // The field_name is the name of the field you want to compare. Only
  21702. // atomic field types are supported (string, number, boolean). The
  21703. // comparison_string must be either eq (equals) or ne (not equals). The
  21704. // literal_string is the string value to filter to. The literal value
  21705. // must be valid for the type of field you are filtering by (string,
  21706. // number, boolean). For string fields, the literal value is interpreted
  21707. // as a regular expression using RE2 syntax. The literal value must
  21708. // match the entire field.
  21709. //
  21710. // For example, to filter for instances that do not have a name of
  21711. // example-instance, you would use name ne example-instance.
  21712. //
  21713. // You can filter on nested fields. For example, you could filter on
  21714. // instances that have set the scheduling.automaticRestart field to
  21715. // true. Use filtering on nested fields to take advantage of labels to
  21716. // organize and search for results based on label values.
  21717. //
  21718. // To filter on multiple expressions, provide each separate expression
  21719. // within parentheses. For example, (scheduling.automaticRestart eq
  21720. // true) (zone eq us-central1-f). Multiple expressions are treated as
  21721. // AND expressions, meaning that resources must match all expressions to
  21722. // pass the filters.
  21723. func (c *GlobalOperationsAggregatedListCall) Filter(filter string) *GlobalOperationsAggregatedListCall {
  21724. c.urlParams_.Set("filter", filter)
  21725. return c
  21726. }
  21727. // MaxResults sets the optional parameter "maxResults": The maximum
  21728. // number of results per page that should be returned. If the number of
  21729. // available results is larger than maxResults, Compute Engine returns a
  21730. // nextPageToken that can be used to get the next page of results in
  21731. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  21732. // (Default: 500)
  21733. func (c *GlobalOperationsAggregatedListCall) MaxResults(maxResults int64) *GlobalOperationsAggregatedListCall {
  21734. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  21735. return c
  21736. }
  21737. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  21738. // a certain order. By default, results are returned in alphanumerical
  21739. // order based on the resource name.
  21740. //
  21741. // You can also sort results in descending order based on the creation
  21742. // timestamp using orderBy="creationTimestamp desc". This sorts results
  21743. // based on the creationTimestamp field in reverse chronological order
  21744. // (newest result first). Use this to sort resources like operations so
  21745. // that the newest operation is returned first.
  21746. //
  21747. // Currently, only sorting by name or creationTimestamp desc is
  21748. // supported.
  21749. func (c *GlobalOperationsAggregatedListCall) OrderBy(orderBy string) *GlobalOperationsAggregatedListCall {
  21750. c.urlParams_.Set("orderBy", orderBy)
  21751. return c
  21752. }
  21753. // PageToken sets the optional parameter "pageToken": Specifies a page
  21754. // token to use. Set pageToken to the nextPageToken returned by a
  21755. // previous list request to get the next page of results.
  21756. func (c *GlobalOperationsAggregatedListCall) PageToken(pageToken string) *GlobalOperationsAggregatedListCall {
  21757. c.urlParams_.Set("pageToken", pageToken)
  21758. return c
  21759. }
  21760. // Fields allows partial responses to be retrieved. See
  21761. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21762. // for more information.
  21763. func (c *GlobalOperationsAggregatedListCall) Fields(s ...googleapi.Field) *GlobalOperationsAggregatedListCall {
  21764. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21765. return c
  21766. }
  21767. // IfNoneMatch sets the optional parameter which makes the operation
  21768. // fail if the object's ETag matches the given value. This is useful for
  21769. // getting updates only after the object has changed since the last
  21770. // request. Use googleapi.IsNotModified to check whether the response
  21771. // error from Do is the result of In-None-Match.
  21772. func (c *GlobalOperationsAggregatedListCall) IfNoneMatch(entityTag string) *GlobalOperationsAggregatedListCall {
  21773. c.ifNoneMatch_ = entityTag
  21774. return c
  21775. }
  21776. // Context sets the context to be used in this call's Do method. Any
  21777. // pending HTTP request will be aborted if the provided context is
  21778. // canceled.
  21779. func (c *GlobalOperationsAggregatedListCall) Context(ctx context.Context) *GlobalOperationsAggregatedListCall {
  21780. c.ctx_ = ctx
  21781. return c
  21782. }
  21783. // Header returns an http.Header that can be modified by the caller to
  21784. // add HTTP headers to the request.
  21785. func (c *GlobalOperationsAggregatedListCall) Header() http.Header {
  21786. if c.header_ == nil {
  21787. c.header_ = make(http.Header)
  21788. }
  21789. return c.header_
  21790. }
  21791. func (c *GlobalOperationsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  21792. reqHeaders := make(http.Header)
  21793. for k, v := range c.header_ {
  21794. reqHeaders[k] = v
  21795. }
  21796. reqHeaders.Set("User-Agent", c.s.userAgent())
  21797. if c.ifNoneMatch_ != "" {
  21798. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  21799. }
  21800. var body io.Reader = nil
  21801. c.urlParams_.Set("alt", alt)
  21802. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/operations")
  21803. urls += "?" + c.urlParams_.Encode()
  21804. req, _ := http.NewRequest("GET", urls, body)
  21805. req.Header = reqHeaders
  21806. googleapi.Expand(req.URL, map[string]string{
  21807. "project": c.project,
  21808. })
  21809. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21810. }
  21811. // Do executes the "compute.globalOperations.aggregatedList" call.
  21812. // Exactly one of *OperationAggregatedList or error will be non-nil. Any
  21813. // non-2xx status code is an error. Response headers are in either
  21814. // *OperationAggregatedList.ServerResponse.Header or (if a response was
  21815. // returned at all) in error.(*googleapi.Error).Header. Use
  21816. // googleapi.IsNotModified to check whether the returned error was
  21817. // because http.StatusNotModified was returned.
  21818. func (c *GlobalOperationsAggregatedListCall) Do(opts ...googleapi.CallOption) (*OperationAggregatedList, error) {
  21819. gensupport.SetOptions(c.urlParams_, opts...)
  21820. res, err := c.doRequest("json")
  21821. if res != nil && res.StatusCode == http.StatusNotModified {
  21822. if res.Body != nil {
  21823. res.Body.Close()
  21824. }
  21825. return nil, &googleapi.Error{
  21826. Code: res.StatusCode,
  21827. Header: res.Header,
  21828. }
  21829. }
  21830. if err != nil {
  21831. return nil, err
  21832. }
  21833. defer googleapi.CloseBody(res)
  21834. if err := googleapi.CheckResponse(res); err != nil {
  21835. return nil, err
  21836. }
  21837. ret := &OperationAggregatedList{
  21838. ServerResponse: googleapi.ServerResponse{
  21839. Header: res.Header,
  21840. HTTPStatusCode: res.StatusCode,
  21841. },
  21842. }
  21843. target := &ret
  21844. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  21845. return nil, err
  21846. }
  21847. return ret, nil
  21848. // {
  21849. // "description": "Retrieves an aggregated list of all operations.",
  21850. // "httpMethod": "GET",
  21851. // "id": "compute.globalOperations.aggregatedList",
  21852. // "parameterOrder": [
  21853. // "project"
  21854. // ],
  21855. // "parameters": {
  21856. // "filter": {
  21857. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  21858. // "location": "query",
  21859. // "type": "string"
  21860. // },
  21861. // "maxResults": {
  21862. // "default": "500",
  21863. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  21864. // "format": "uint32",
  21865. // "location": "query",
  21866. // "minimum": "0",
  21867. // "type": "integer"
  21868. // },
  21869. // "orderBy": {
  21870. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  21871. // "location": "query",
  21872. // "type": "string"
  21873. // },
  21874. // "pageToken": {
  21875. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  21876. // "location": "query",
  21877. // "type": "string"
  21878. // },
  21879. // "project": {
  21880. // "description": "Project ID for this request.",
  21881. // "location": "path",
  21882. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  21883. // "required": true,
  21884. // "type": "string"
  21885. // }
  21886. // },
  21887. // "path": "{project}/aggregated/operations",
  21888. // "response": {
  21889. // "$ref": "OperationAggregatedList"
  21890. // },
  21891. // "scopes": [
  21892. // "https://www.googleapis.com/auth/cloud-platform",
  21893. // "https://www.googleapis.com/auth/compute",
  21894. // "https://www.googleapis.com/auth/compute.readonly"
  21895. // ]
  21896. // }
  21897. }
  21898. // Pages invokes f for each page of results.
  21899. // A non-nil error returned from f will halt the iteration.
  21900. // The provided context supersedes any context provided to the Context method.
  21901. func (c *GlobalOperationsAggregatedListCall) Pages(ctx context.Context, f func(*OperationAggregatedList) error) error {
  21902. c.ctx_ = ctx
  21903. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  21904. for {
  21905. x, err := c.Do()
  21906. if err != nil {
  21907. return err
  21908. }
  21909. if err := f(x); err != nil {
  21910. return err
  21911. }
  21912. if x.NextPageToken == "" {
  21913. return nil
  21914. }
  21915. c.PageToken(x.NextPageToken)
  21916. }
  21917. }
  21918. // method id "compute.globalOperations.delete":
  21919. type GlobalOperationsDeleteCall struct {
  21920. s *Service
  21921. project string
  21922. operation string
  21923. urlParams_ gensupport.URLParams
  21924. ctx_ context.Context
  21925. header_ http.Header
  21926. }
  21927. // Delete: Deletes the specified Operations resource.
  21928. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/delete
  21929. func (r *GlobalOperationsService) Delete(project string, operation string) *GlobalOperationsDeleteCall {
  21930. c := &GlobalOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21931. c.project = project
  21932. c.operation = operation
  21933. return c
  21934. }
  21935. // Fields allows partial responses to be retrieved. See
  21936. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21937. // for more information.
  21938. func (c *GlobalOperationsDeleteCall) Fields(s ...googleapi.Field) *GlobalOperationsDeleteCall {
  21939. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21940. return c
  21941. }
  21942. // Context sets the context to be used in this call's Do method. Any
  21943. // pending HTTP request will be aborted if the provided context is
  21944. // canceled.
  21945. func (c *GlobalOperationsDeleteCall) Context(ctx context.Context) *GlobalOperationsDeleteCall {
  21946. c.ctx_ = ctx
  21947. return c
  21948. }
  21949. // Header returns an http.Header that can be modified by the caller to
  21950. // add HTTP headers to the request.
  21951. func (c *GlobalOperationsDeleteCall) Header() http.Header {
  21952. if c.header_ == nil {
  21953. c.header_ = make(http.Header)
  21954. }
  21955. return c.header_
  21956. }
  21957. func (c *GlobalOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  21958. reqHeaders := make(http.Header)
  21959. for k, v := range c.header_ {
  21960. reqHeaders[k] = v
  21961. }
  21962. reqHeaders.Set("User-Agent", c.s.userAgent())
  21963. var body io.Reader = nil
  21964. c.urlParams_.Set("alt", alt)
  21965. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}")
  21966. urls += "?" + c.urlParams_.Encode()
  21967. req, _ := http.NewRequest("DELETE", urls, body)
  21968. req.Header = reqHeaders
  21969. googleapi.Expand(req.URL, map[string]string{
  21970. "project": c.project,
  21971. "operation": c.operation,
  21972. })
  21973. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21974. }
  21975. // Do executes the "compute.globalOperations.delete" call.
  21976. func (c *GlobalOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  21977. gensupport.SetOptions(c.urlParams_, opts...)
  21978. res, err := c.doRequest("json")
  21979. if err != nil {
  21980. return err
  21981. }
  21982. defer googleapi.CloseBody(res)
  21983. if err := googleapi.CheckResponse(res); err != nil {
  21984. return err
  21985. }
  21986. return nil
  21987. // {
  21988. // "description": "Deletes the specified Operations resource.",
  21989. // "httpMethod": "DELETE",
  21990. // "id": "compute.globalOperations.delete",
  21991. // "parameterOrder": [
  21992. // "project",
  21993. // "operation"
  21994. // ],
  21995. // "parameters": {
  21996. // "operation": {
  21997. // "description": "Name of the Operations resource to delete.",
  21998. // "location": "path",
  21999. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  22000. // "required": true,
  22001. // "type": "string"
  22002. // },
  22003. // "project": {
  22004. // "description": "Project ID for this request.",
  22005. // "location": "path",
  22006. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  22007. // "required": true,
  22008. // "type": "string"
  22009. // }
  22010. // },
  22011. // "path": "{project}/global/operations/{operation}",
  22012. // "scopes": [
  22013. // "https://www.googleapis.com/auth/cloud-platform",
  22014. // "https://www.googleapis.com/auth/compute"
  22015. // ]
  22016. // }
  22017. }
  22018. // method id "compute.globalOperations.get":
  22019. type GlobalOperationsGetCall struct {
  22020. s *Service
  22021. project string
  22022. operation string
  22023. urlParams_ gensupport.URLParams
  22024. ifNoneMatch_ string
  22025. ctx_ context.Context
  22026. header_ http.Header
  22027. }
  22028. // Get: Retrieves the specified Operations resource. Get a list of
  22029. // operations by making a list() request.
  22030. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/get
  22031. func (r *GlobalOperationsService) Get(project string, operation string) *GlobalOperationsGetCall {
  22032. c := &GlobalOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22033. c.project = project
  22034. c.operation = operation
  22035. return c
  22036. }
  22037. // Fields allows partial responses to be retrieved. See
  22038. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22039. // for more information.
  22040. func (c *GlobalOperationsGetCall) Fields(s ...googleapi.Field) *GlobalOperationsGetCall {
  22041. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22042. return c
  22043. }
  22044. // IfNoneMatch sets the optional parameter which makes the operation
  22045. // fail if the object's ETag matches the given value. This is useful for
  22046. // getting updates only after the object has changed since the last
  22047. // request. Use googleapi.IsNotModified to check whether the response
  22048. // error from Do is the result of In-None-Match.
  22049. func (c *GlobalOperationsGetCall) IfNoneMatch(entityTag string) *GlobalOperationsGetCall {
  22050. c.ifNoneMatch_ = entityTag
  22051. return c
  22052. }
  22053. // Context sets the context to be used in this call's Do method. Any
  22054. // pending HTTP request will be aborted if the provided context is
  22055. // canceled.
  22056. func (c *GlobalOperationsGetCall) Context(ctx context.Context) *GlobalOperationsGetCall {
  22057. c.ctx_ = ctx
  22058. return c
  22059. }
  22060. // Header returns an http.Header that can be modified by the caller to
  22061. // add HTTP headers to the request.
  22062. func (c *GlobalOperationsGetCall) Header() http.Header {
  22063. if c.header_ == nil {
  22064. c.header_ = make(http.Header)
  22065. }
  22066. return c.header_
  22067. }
  22068. func (c *GlobalOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  22069. reqHeaders := make(http.Header)
  22070. for k, v := range c.header_ {
  22071. reqHeaders[k] = v
  22072. }
  22073. reqHeaders.Set("User-Agent", c.s.userAgent())
  22074. if c.ifNoneMatch_ != "" {
  22075. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  22076. }
  22077. var body io.Reader = nil
  22078. c.urlParams_.Set("alt", alt)
  22079. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}")
  22080. urls += "?" + c.urlParams_.Encode()
  22081. req, _ := http.NewRequest("GET", urls, body)
  22082. req.Header = reqHeaders
  22083. googleapi.Expand(req.URL, map[string]string{
  22084. "project": c.project,
  22085. "operation": c.operation,
  22086. })
  22087. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22088. }
  22089. // Do executes the "compute.globalOperations.get" call.
  22090. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  22091. // status code is an error. Response headers are in either
  22092. // *Operation.ServerResponse.Header or (if a response was returned at
  22093. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  22094. // to check whether the returned error was because
  22095. // http.StatusNotModified was returned.
  22096. func (c *GlobalOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  22097. gensupport.SetOptions(c.urlParams_, opts...)
  22098. res, err := c.doRequest("json")
  22099. if res != nil && res.StatusCode == http.StatusNotModified {
  22100. if res.Body != nil {
  22101. res.Body.Close()
  22102. }
  22103. return nil, &googleapi.Error{
  22104. Code: res.StatusCode,
  22105. Header: res.Header,
  22106. }
  22107. }
  22108. if err != nil {
  22109. return nil, err
  22110. }
  22111. defer googleapi.CloseBody(res)
  22112. if err := googleapi.CheckResponse(res); err != nil {
  22113. return nil, err
  22114. }
  22115. ret := &Operation{
  22116. ServerResponse: googleapi.ServerResponse{
  22117. Header: res.Header,
  22118. HTTPStatusCode: res.StatusCode,
  22119. },
  22120. }
  22121. target := &ret
  22122. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  22123. return nil, err
  22124. }
  22125. return ret, nil
  22126. // {
  22127. // "description": "Retrieves the specified Operations resource. Get a list of operations by making a list() request.",
  22128. // "httpMethod": "GET",
  22129. // "id": "compute.globalOperations.get",
  22130. // "parameterOrder": [
  22131. // "project",
  22132. // "operation"
  22133. // ],
  22134. // "parameters": {
  22135. // "operation": {
  22136. // "description": "Name of the Operations resource to return.",
  22137. // "location": "path",
  22138. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  22139. // "required": true,
  22140. // "type": "string"
  22141. // },
  22142. // "project": {
  22143. // "description": "Project ID for this request.",
  22144. // "location": "path",
  22145. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  22146. // "required": true,
  22147. // "type": "string"
  22148. // }
  22149. // },
  22150. // "path": "{project}/global/operations/{operation}",
  22151. // "response": {
  22152. // "$ref": "Operation"
  22153. // },
  22154. // "scopes": [
  22155. // "https://www.googleapis.com/auth/cloud-platform",
  22156. // "https://www.googleapis.com/auth/compute",
  22157. // "https://www.googleapis.com/auth/compute.readonly"
  22158. // ]
  22159. // }
  22160. }
  22161. // method id "compute.globalOperations.list":
  22162. type GlobalOperationsListCall struct {
  22163. s *Service
  22164. project string
  22165. urlParams_ gensupport.URLParams
  22166. ifNoneMatch_ string
  22167. ctx_ context.Context
  22168. header_ http.Header
  22169. }
  22170. // List: Retrieves a list of Operation resources contained within the
  22171. // specified project.
  22172. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/list
  22173. func (r *GlobalOperationsService) List(project string) *GlobalOperationsListCall {
  22174. c := &GlobalOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22175. c.project = project
  22176. return c
  22177. }
  22178. // Filter sets the optional parameter "filter": Sets a filter
  22179. // {expression} for filtering listed resources. Your {expression} must
  22180. // be in the format: field_name comparison_string literal_string.
  22181. //
  22182. // The field_name is the name of the field you want to compare. Only
  22183. // atomic field types are supported (string, number, boolean). The
  22184. // comparison_string must be either eq (equals) or ne (not equals). The
  22185. // literal_string is the string value to filter to. The literal value
  22186. // must be valid for the type of field you are filtering by (string,
  22187. // number, boolean). For string fields, the literal value is interpreted
  22188. // as a regular expression using RE2 syntax. The literal value must
  22189. // match the entire field.
  22190. //
  22191. // For example, to filter for instances that do not have a name of
  22192. // example-instance, you would use name ne example-instance.
  22193. //
  22194. // You can filter on nested fields. For example, you could filter on
  22195. // instances that have set the scheduling.automaticRestart field to
  22196. // true. Use filtering on nested fields to take advantage of labels to
  22197. // organize and search for results based on label values.
  22198. //
  22199. // To filter on multiple expressions, provide each separate expression
  22200. // within parentheses. For example, (scheduling.automaticRestart eq
  22201. // true) (zone eq us-central1-f). Multiple expressions are treated as
  22202. // AND expressions, meaning that resources must match all expressions to
  22203. // pass the filters.
  22204. func (c *GlobalOperationsListCall) Filter(filter string) *GlobalOperationsListCall {
  22205. c.urlParams_.Set("filter", filter)
  22206. return c
  22207. }
  22208. // MaxResults sets the optional parameter "maxResults": The maximum
  22209. // number of results per page that should be returned. If the number of
  22210. // available results is larger than maxResults, Compute Engine returns a
  22211. // nextPageToken that can be used to get the next page of results in
  22212. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  22213. // (Default: 500)
  22214. func (c *GlobalOperationsListCall) MaxResults(maxResults int64) *GlobalOperationsListCall {
  22215. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  22216. return c
  22217. }
  22218. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  22219. // a certain order. By default, results are returned in alphanumerical
  22220. // order based on the resource name.
  22221. //
  22222. // You can also sort results in descending order based on the creation
  22223. // timestamp using orderBy="creationTimestamp desc". This sorts results
  22224. // based on the creationTimestamp field in reverse chronological order
  22225. // (newest result first). Use this to sort resources like operations so
  22226. // that the newest operation is returned first.
  22227. //
  22228. // Currently, only sorting by name or creationTimestamp desc is
  22229. // supported.
  22230. func (c *GlobalOperationsListCall) OrderBy(orderBy string) *GlobalOperationsListCall {
  22231. c.urlParams_.Set("orderBy", orderBy)
  22232. return c
  22233. }
  22234. // PageToken sets the optional parameter "pageToken": Specifies a page
  22235. // token to use. Set pageToken to the nextPageToken returned by a
  22236. // previous list request to get the next page of results.
  22237. func (c *GlobalOperationsListCall) PageToken(pageToken string) *GlobalOperationsListCall {
  22238. c.urlParams_.Set("pageToken", pageToken)
  22239. return c
  22240. }
  22241. // Fields allows partial responses to be retrieved. See
  22242. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22243. // for more information.
  22244. func (c *GlobalOperationsListCall) Fields(s ...googleapi.Field) *GlobalOperationsListCall {
  22245. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22246. return c
  22247. }
  22248. // IfNoneMatch sets the optional parameter which makes the operation
  22249. // fail if the object's ETag matches the given value. This is useful for
  22250. // getting updates only after the object has changed since the last
  22251. // request. Use googleapi.IsNotModified to check whether the response
  22252. // error from Do is the result of In-None-Match.
  22253. func (c *GlobalOperationsListCall) IfNoneMatch(entityTag string) *GlobalOperationsListCall {
  22254. c.ifNoneMatch_ = entityTag
  22255. return c
  22256. }
  22257. // Context sets the context to be used in this call's Do method. Any
  22258. // pending HTTP request will be aborted if the provided context is
  22259. // canceled.
  22260. func (c *GlobalOperationsListCall) Context(ctx context.Context) *GlobalOperationsListCall {
  22261. c.ctx_ = ctx
  22262. return c
  22263. }
  22264. // Header returns an http.Header that can be modified by the caller to
  22265. // add HTTP headers to the request.
  22266. func (c *GlobalOperationsListCall) Header() http.Header {
  22267. if c.header_ == nil {
  22268. c.header_ = make(http.Header)
  22269. }
  22270. return c.header_
  22271. }
  22272. func (c *GlobalOperationsListCall) doRequest(alt string) (*http.Response, error) {
  22273. reqHeaders := make(http.Header)
  22274. for k, v := range c.header_ {
  22275. reqHeaders[k] = v
  22276. }
  22277. reqHeaders.Set("User-Agent", c.s.userAgent())
  22278. if c.ifNoneMatch_ != "" {
  22279. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  22280. }
  22281. var body io.Reader = nil
  22282. c.urlParams_.Set("alt", alt)
  22283. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations")
  22284. urls += "?" + c.urlParams_.Encode()
  22285. req, _ := http.NewRequest("GET", urls, body)
  22286. req.Header = reqHeaders
  22287. googleapi.Expand(req.URL, map[string]string{
  22288. "project": c.project,
  22289. })
  22290. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22291. }
  22292. // Do executes the "compute.globalOperations.list" call.
  22293. // Exactly one of *OperationList or error will be non-nil. Any non-2xx
  22294. // status code is an error. Response headers are in either
  22295. // *OperationList.ServerResponse.Header or (if a response was returned
  22296. // at all) in error.(*googleapi.Error).Header. Use
  22297. // googleapi.IsNotModified to check whether the returned error was
  22298. // because http.StatusNotModified was returned.
  22299. func (c *GlobalOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, error) {
  22300. gensupport.SetOptions(c.urlParams_, opts...)
  22301. res, err := c.doRequest("json")
  22302. if res != nil && res.StatusCode == http.StatusNotModified {
  22303. if res.Body != nil {
  22304. res.Body.Close()
  22305. }
  22306. return nil, &googleapi.Error{
  22307. Code: res.StatusCode,
  22308. Header: res.Header,
  22309. }
  22310. }
  22311. if err != nil {
  22312. return nil, err
  22313. }
  22314. defer googleapi.CloseBody(res)
  22315. if err := googleapi.CheckResponse(res); err != nil {
  22316. return nil, err
  22317. }
  22318. ret := &OperationList{
  22319. ServerResponse: googleapi.ServerResponse{
  22320. Header: res.Header,
  22321. HTTPStatusCode: res.StatusCode,
  22322. },
  22323. }
  22324. target := &ret
  22325. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  22326. return nil, err
  22327. }
  22328. return ret, nil
  22329. // {
  22330. // "description": "Retrieves a list of Operation resources contained within the specified project.",
  22331. // "httpMethod": "GET",
  22332. // "id": "compute.globalOperations.list",
  22333. // "parameterOrder": [
  22334. // "project"
  22335. // ],
  22336. // "parameters": {
  22337. // "filter": {
  22338. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  22339. // "location": "query",
  22340. // "type": "string"
  22341. // },
  22342. // "maxResults": {
  22343. // "default": "500",
  22344. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  22345. // "format": "uint32",
  22346. // "location": "query",
  22347. // "minimum": "0",
  22348. // "type": "integer"
  22349. // },
  22350. // "orderBy": {
  22351. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  22352. // "location": "query",
  22353. // "type": "string"
  22354. // },
  22355. // "pageToken": {
  22356. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  22357. // "location": "query",
  22358. // "type": "string"
  22359. // },
  22360. // "project": {
  22361. // "description": "Project ID for this request.",
  22362. // "location": "path",
  22363. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  22364. // "required": true,
  22365. // "type": "string"
  22366. // }
  22367. // },
  22368. // "path": "{project}/global/operations",
  22369. // "response": {
  22370. // "$ref": "OperationList"
  22371. // },
  22372. // "scopes": [
  22373. // "https://www.googleapis.com/auth/cloud-platform",
  22374. // "https://www.googleapis.com/auth/compute",
  22375. // "https://www.googleapis.com/auth/compute.readonly"
  22376. // ]
  22377. // }
  22378. }
  22379. // Pages invokes f for each page of results.
  22380. // A non-nil error returned from f will halt the iteration.
  22381. // The provided context supersedes any context provided to the Context method.
  22382. func (c *GlobalOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
  22383. c.ctx_ = ctx
  22384. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  22385. for {
  22386. x, err := c.Do()
  22387. if err != nil {
  22388. return err
  22389. }
  22390. if err := f(x); err != nil {
  22391. return err
  22392. }
  22393. if x.NextPageToken == "" {
  22394. return nil
  22395. }
  22396. c.PageToken(x.NextPageToken)
  22397. }
  22398. }
  22399. // method id "compute.healthChecks.delete":
  22400. type HealthChecksDeleteCall struct {
  22401. s *Service
  22402. project string
  22403. healthCheck string
  22404. urlParams_ gensupport.URLParams
  22405. ctx_ context.Context
  22406. header_ http.Header
  22407. }
  22408. // Delete: Deletes the specified HealthCheck resource.
  22409. func (r *HealthChecksService) Delete(project string, healthCheck string) *HealthChecksDeleteCall {
  22410. c := &HealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22411. c.project = project
  22412. c.healthCheck = healthCheck
  22413. return c
  22414. }
  22415. // Fields allows partial responses to be retrieved. See
  22416. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22417. // for more information.
  22418. func (c *HealthChecksDeleteCall) Fields(s ...googleapi.Field) *HealthChecksDeleteCall {
  22419. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22420. return c
  22421. }
  22422. // Context sets the context to be used in this call's Do method. Any
  22423. // pending HTTP request will be aborted if the provided context is
  22424. // canceled.
  22425. func (c *HealthChecksDeleteCall) Context(ctx context.Context) *HealthChecksDeleteCall {
  22426. c.ctx_ = ctx
  22427. return c
  22428. }
  22429. // Header returns an http.Header that can be modified by the caller to
  22430. // add HTTP headers to the request.
  22431. func (c *HealthChecksDeleteCall) Header() http.Header {
  22432. if c.header_ == nil {
  22433. c.header_ = make(http.Header)
  22434. }
  22435. return c.header_
  22436. }
  22437. func (c *HealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
  22438. reqHeaders := make(http.Header)
  22439. for k, v := range c.header_ {
  22440. reqHeaders[k] = v
  22441. }
  22442. reqHeaders.Set("User-Agent", c.s.userAgent())
  22443. var body io.Reader = nil
  22444. c.urlParams_.Set("alt", alt)
  22445. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{healthCheck}")
  22446. urls += "?" + c.urlParams_.Encode()
  22447. req, _ := http.NewRequest("DELETE", urls, body)
  22448. req.Header = reqHeaders
  22449. googleapi.Expand(req.URL, map[string]string{
  22450. "project": c.project,
  22451. "healthCheck": c.healthCheck,
  22452. })
  22453. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22454. }
  22455. // Do executes the "compute.healthChecks.delete" call.
  22456. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  22457. // status code is an error. Response headers are in either
  22458. // *Operation.ServerResponse.Header or (if a response was returned at
  22459. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  22460. // to check whether the returned error was because
  22461. // http.StatusNotModified was returned.
  22462. func (c *HealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  22463. gensupport.SetOptions(c.urlParams_, opts...)
  22464. res, err := c.doRequest("json")
  22465. if res != nil && res.StatusCode == http.StatusNotModified {
  22466. if res.Body != nil {
  22467. res.Body.Close()
  22468. }
  22469. return nil, &googleapi.Error{
  22470. Code: res.StatusCode,
  22471. Header: res.Header,
  22472. }
  22473. }
  22474. if err != nil {
  22475. return nil, err
  22476. }
  22477. defer googleapi.CloseBody(res)
  22478. if err := googleapi.CheckResponse(res); err != nil {
  22479. return nil, err
  22480. }
  22481. ret := &Operation{
  22482. ServerResponse: googleapi.ServerResponse{
  22483. Header: res.Header,
  22484. HTTPStatusCode: res.StatusCode,
  22485. },
  22486. }
  22487. target := &ret
  22488. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  22489. return nil, err
  22490. }
  22491. return ret, nil
  22492. // {
  22493. // "description": "Deletes the specified HealthCheck resource.",
  22494. // "httpMethod": "DELETE",
  22495. // "id": "compute.healthChecks.delete",
  22496. // "parameterOrder": [
  22497. // "project",
  22498. // "healthCheck"
  22499. // ],
  22500. // "parameters": {
  22501. // "healthCheck": {
  22502. // "description": "Name of the HealthCheck resource to delete.",
  22503. // "location": "path",
  22504. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  22505. // "required": true,
  22506. // "type": "string"
  22507. // },
  22508. // "project": {
  22509. // "description": "Project ID for this request.",
  22510. // "location": "path",
  22511. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  22512. // "required": true,
  22513. // "type": "string"
  22514. // }
  22515. // },
  22516. // "path": "{project}/global/healthChecks/{healthCheck}",
  22517. // "response": {
  22518. // "$ref": "Operation"
  22519. // },
  22520. // "scopes": [
  22521. // "https://www.googleapis.com/auth/cloud-platform",
  22522. // "https://www.googleapis.com/auth/compute"
  22523. // ]
  22524. // }
  22525. }
  22526. // method id "compute.healthChecks.get":
  22527. type HealthChecksGetCall struct {
  22528. s *Service
  22529. project string
  22530. healthCheck string
  22531. urlParams_ gensupport.URLParams
  22532. ifNoneMatch_ string
  22533. ctx_ context.Context
  22534. header_ http.Header
  22535. }
  22536. // Get: Returns the specified HealthCheck resource. Get a list of
  22537. // available health checks by making a list() request.
  22538. func (r *HealthChecksService) Get(project string, healthCheck string) *HealthChecksGetCall {
  22539. c := &HealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22540. c.project = project
  22541. c.healthCheck = healthCheck
  22542. return c
  22543. }
  22544. // Fields allows partial responses to be retrieved. See
  22545. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22546. // for more information.
  22547. func (c *HealthChecksGetCall) Fields(s ...googleapi.Field) *HealthChecksGetCall {
  22548. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22549. return c
  22550. }
  22551. // IfNoneMatch sets the optional parameter which makes the operation
  22552. // fail if the object's ETag matches the given value. This is useful for
  22553. // getting updates only after the object has changed since the last
  22554. // request. Use googleapi.IsNotModified to check whether the response
  22555. // error from Do is the result of In-None-Match.
  22556. func (c *HealthChecksGetCall) IfNoneMatch(entityTag string) *HealthChecksGetCall {
  22557. c.ifNoneMatch_ = entityTag
  22558. return c
  22559. }
  22560. // Context sets the context to be used in this call's Do method. Any
  22561. // pending HTTP request will be aborted if the provided context is
  22562. // canceled.
  22563. func (c *HealthChecksGetCall) Context(ctx context.Context) *HealthChecksGetCall {
  22564. c.ctx_ = ctx
  22565. return c
  22566. }
  22567. // Header returns an http.Header that can be modified by the caller to
  22568. // add HTTP headers to the request.
  22569. func (c *HealthChecksGetCall) Header() http.Header {
  22570. if c.header_ == nil {
  22571. c.header_ = make(http.Header)
  22572. }
  22573. return c.header_
  22574. }
  22575. func (c *HealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
  22576. reqHeaders := make(http.Header)
  22577. for k, v := range c.header_ {
  22578. reqHeaders[k] = v
  22579. }
  22580. reqHeaders.Set("User-Agent", c.s.userAgent())
  22581. if c.ifNoneMatch_ != "" {
  22582. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  22583. }
  22584. var body io.Reader = nil
  22585. c.urlParams_.Set("alt", alt)
  22586. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{healthCheck}")
  22587. urls += "?" + c.urlParams_.Encode()
  22588. req, _ := http.NewRequest("GET", urls, body)
  22589. req.Header = reqHeaders
  22590. googleapi.Expand(req.URL, map[string]string{
  22591. "project": c.project,
  22592. "healthCheck": c.healthCheck,
  22593. })
  22594. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22595. }
  22596. // Do executes the "compute.healthChecks.get" call.
  22597. // Exactly one of *HealthCheck or error will be non-nil. Any non-2xx
  22598. // status code is an error. Response headers are in either
  22599. // *HealthCheck.ServerResponse.Header or (if a response was returned at
  22600. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  22601. // to check whether the returned error was because
  22602. // http.StatusNotModified was returned.
  22603. func (c *HealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HealthCheck, error) {
  22604. gensupport.SetOptions(c.urlParams_, opts...)
  22605. res, err := c.doRequest("json")
  22606. if res != nil && res.StatusCode == http.StatusNotModified {
  22607. if res.Body != nil {
  22608. res.Body.Close()
  22609. }
  22610. return nil, &googleapi.Error{
  22611. Code: res.StatusCode,
  22612. Header: res.Header,
  22613. }
  22614. }
  22615. if err != nil {
  22616. return nil, err
  22617. }
  22618. defer googleapi.CloseBody(res)
  22619. if err := googleapi.CheckResponse(res); err != nil {
  22620. return nil, err
  22621. }
  22622. ret := &HealthCheck{
  22623. ServerResponse: googleapi.ServerResponse{
  22624. Header: res.Header,
  22625. HTTPStatusCode: res.StatusCode,
  22626. },
  22627. }
  22628. target := &ret
  22629. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  22630. return nil, err
  22631. }
  22632. return ret, nil
  22633. // {
  22634. // "description": "Returns the specified HealthCheck resource. Get a list of available health checks by making a list() request.",
  22635. // "httpMethod": "GET",
  22636. // "id": "compute.healthChecks.get",
  22637. // "parameterOrder": [
  22638. // "project",
  22639. // "healthCheck"
  22640. // ],
  22641. // "parameters": {
  22642. // "healthCheck": {
  22643. // "description": "Name of the HealthCheck resource to return.",
  22644. // "location": "path",
  22645. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  22646. // "required": true,
  22647. // "type": "string"
  22648. // },
  22649. // "project": {
  22650. // "description": "Project ID for this request.",
  22651. // "location": "path",
  22652. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  22653. // "required": true,
  22654. // "type": "string"
  22655. // }
  22656. // },
  22657. // "path": "{project}/global/healthChecks/{healthCheck}",
  22658. // "response": {
  22659. // "$ref": "HealthCheck"
  22660. // },
  22661. // "scopes": [
  22662. // "https://www.googleapis.com/auth/cloud-platform",
  22663. // "https://www.googleapis.com/auth/compute",
  22664. // "https://www.googleapis.com/auth/compute.readonly"
  22665. // ]
  22666. // }
  22667. }
  22668. // method id "compute.healthChecks.insert":
  22669. type HealthChecksInsertCall struct {
  22670. s *Service
  22671. project string
  22672. healthcheck *HealthCheck
  22673. urlParams_ gensupport.URLParams
  22674. ctx_ context.Context
  22675. header_ http.Header
  22676. }
  22677. // Insert: Creates a HealthCheck resource in the specified project using
  22678. // the data included in the request.
  22679. func (r *HealthChecksService) Insert(project string, healthcheck *HealthCheck) *HealthChecksInsertCall {
  22680. c := &HealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22681. c.project = project
  22682. c.healthcheck = healthcheck
  22683. return c
  22684. }
  22685. // Fields allows partial responses to be retrieved. See
  22686. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22687. // for more information.
  22688. func (c *HealthChecksInsertCall) Fields(s ...googleapi.Field) *HealthChecksInsertCall {
  22689. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22690. return c
  22691. }
  22692. // Context sets the context to be used in this call's Do method. Any
  22693. // pending HTTP request will be aborted if the provided context is
  22694. // canceled.
  22695. func (c *HealthChecksInsertCall) Context(ctx context.Context) *HealthChecksInsertCall {
  22696. c.ctx_ = ctx
  22697. return c
  22698. }
  22699. // Header returns an http.Header that can be modified by the caller to
  22700. // add HTTP headers to the request.
  22701. func (c *HealthChecksInsertCall) Header() http.Header {
  22702. if c.header_ == nil {
  22703. c.header_ = make(http.Header)
  22704. }
  22705. return c.header_
  22706. }
  22707. func (c *HealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
  22708. reqHeaders := make(http.Header)
  22709. for k, v := range c.header_ {
  22710. reqHeaders[k] = v
  22711. }
  22712. reqHeaders.Set("User-Agent", c.s.userAgent())
  22713. var body io.Reader = nil
  22714. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
  22715. if err != nil {
  22716. return nil, err
  22717. }
  22718. reqHeaders.Set("Content-Type", "application/json")
  22719. c.urlParams_.Set("alt", alt)
  22720. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks")
  22721. urls += "?" + c.urlParams_.Encode()
  22722. req, _ := http.NewRequest("POST", urls, body)
  22723. req.Header = reqHeaders
  22724. googleapi.Expand(req.URL, map[string]string{
  22725. "project": c.project,
  22726. })
  22727. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22728. }
  22729. // Do executes the "compute.healthChecks.insert" call.
  22730. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  22731. // status code is an error. Response headers are in either
  22732. // *Operation.ServerResponse.Header or (if a response was returned at
  22733. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  22734. // to check whether the returned error was because
  22735. // http.StatusNotModified was returned.
  22736. func (c *HealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  22737. gensupport.SetOptions(c.urlParams_, opts...)
  22738. res, err := c.doRequest("json")
  22739. if res != nil && res.StatusCode == http.StatusNotModified {
  22740. if res.Body != nil {
  22741. res.Body.Close()
  22742. }
  22743. return nil, &googleapi.Error{
  22744. Code: res.StatusCode,
  22745. Header: res.Header,
  22746. }
  22747. }
  22748. if err != nil {
  22749. return nil, err
  22750. }
  22751. defer googleapi.CloseBody(res)
  22752. if err := googleapi.CheckResponse(res); err != nil {
  22753. return nil, err
  22754. }
  22755. ret := &Operation{
  22756. ServerResponse: googleapi.ServerResponse{
  22757. Header: res.Header,
  22758. HTTPStatusCode: res.StatusCode,
  22759. },
  22760. }
  22761. target := &ret
  22762. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  22763. return nil, err
  22764. }
  22765. return ret, nil
  22766. // {
  22767. // "description": "Creates a HealthCheck resource in the specified project using the data included in the request.",
  22768. // "httpMethod": "POST",
  22769. // "id": "compute.healthChecks.insert",
  22770. // "parameterOrder": [
  22771. // "project"
  22772. // ],
  22773. // "parameters": {
  22774. // "project": {
  22775. // "description": "Project ID for this request.",
  22776. // "location": "path",
  22777. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  22778. // "required": true,
  22779. // "type": "string"
  22780. // }
  22781. // },
  22782. // "path": "{project}/global/healthChecks",
  22783. // "request": {
  22784. // "$ref": "HealthCheck"
  22785. // },
  22786. // "response": {
  22787. // "$ref": "Operation"
  22788. // },
  22789. // "scopes": [
  22790. // "https://www.googleapis.com/auth/cloud-platform",
  22791. // "https://www.googleapis.com/auth/compute"
  22792. // ]
  22793. // }
  22794. }
  22795. // method id "compute.healthChecks.list":
  22796. type HealthChecksListCall struct {
  22797. s *Service
  22798. project string
  22799. urlParams_ gensupport.URLParams
  22800. ifNoneMatch_ string
  22801. ctx_ context.Context
  22802. header_ http.Header
  22803. }
  22804. // List: Retrieves the list of HealthCheck resources available to the
  22805. // specified project.
  22806. func (r *HealthChecksService) List(project string) *HealthChecksListCall {
  22807. c := &HealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22808. c.project = project
  22809. return c
  22810. }
  22811. // Filter sets the optional parameter "filter": Sets a filter
  22812. // {expression} for filtering listed resources. Your {expression} must
  22813. // be in the format: field_name comparison_string literal_string.
  22814. //
  22815. // The field_name is the name of the field you want to compare. Only
  22816. // atomic field types are supported (string, number, boolean). The
  22817. // comparison_string must be either eq (equals) or ne (not equals). The
  22818. // literal_string is the string value to filter to. The literal value
  22819. // must be valid for the type of field you are filtering by (string,
  22820. // number, boolean). For string fields, the literal value is interpreted
  22821. // as a regular expression using RE2 syntax. The literal value must
  22822. // match the entire field.
  22823. //
  22824. // For example, to filter for instances that do not have a name of
  22825. // example-instance, you would use name ne example-instance.
  22826. //
  22827. // You can filter on nested fields. For example, you could filter on
  22828. // instances that have set the scheduling.automaticRestart field to
  22829. // true. Use filtering on nested fields to take advantage of labels to
  22830. // organize and search for results based on label values.
  22831. //
  22832. // To filter on multiple expressions, provide each separate expression
  22833. // within parentheses. For example, (scheduling.automaticRestart eq
  22834. // true) (zone eq us-central1-f). Multiple expressions are treated as
  22835. // AND expressions, meaning that resources must match all expressions to
  22836. // pass the filters.
  22837. func (c *HealthChecksListCall) Filter(filter string) *HealthChecksListCall {
  22838. c.urlParams_.Set("filter", filter)
  22839. return c
  22840. }
  22841. // MaxResults sets the optional parameter "maxResults": The maximum
  22842. // number of results per page that should be returned. If the number of
  22843. // available results is larger than maxResults, Compute Engine returns a
  22844. // nextPageToken that can be used to get the next page of results in
  22845. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  22846. // (Default: 500)
  22847. func (c *HealthChecksListCall) MaxResults(maxResults int64) *HealthChecksListCall {
  22848. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  22849. return c
  22850. }
  22851. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  22852. // a certain order. By default, results are returned in alphanumerical
  22853. // order based on the resource name.
  22854. //
  22855. // You can also sort results in descending order based on the creation
  22856. // timestamp using orderBy="creationTimestamp desc". This sorts results
  22857. // based on the creationTimestamp field in reverse chronological order
  22858. // (newest result first). Use this to sort resources like operations so
  22859. // that the newest operation is returned first.
  22860. //
  22861. // Currently, only sorting by name or creationTimestamp desc is
  22862. // supported.
  22863. func (c *HealthChecksListCall) OrderBy(orderBy string) *HealthChecksListCall {
  22864. c.urlParams_.Set("orderBy", orderBy)
  22865. return c
  22866. }
  22867. // PageToken sets the optional parameter "pageToken": Specifies a page
  22868. // token to use. Set pageToken to the nextPageToken returned by a
  22869. // previous list request to get the next page of results.
  22870. func (c *HealthChecksListCall) PageToken(pageToken string) *HealthChecksListCall {
  22871. c.urlParams_.Set("pageToken", pageToken)
  22872. return c
  22873. }
  22874. // Fields allows partial responses to be retrieved. See
  22875. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22876. // for more information.
  22877. func (c *HealthChecksListCall) Fields(s ...googleapi.Field) *HealthChecksListCall {
  22878. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22879. return c
  22880. }
  22881. // IfNoneMatch sets the optional parameter which makes the operation
  22882. // fail if the object's ETag matches the given value. This is useful for
  22883. // getting updates only after the object has changed since the last
  22884. // request. Use googleapi.IsNotModified to check whether the response
  22885. // error from Do is the result of In-None-Match.
  22886. func (c *HealthChecksListCall) IfNoneMatch(entityTag string) *HealthChecksListCall {
  22887. c.ifNoneMatch_ = entityTag
  22888. return c
  22889. }
  22890. // Context sets the context to be used in this call's Do method. Any
  22891. // pending HTTP request will be aborted if the provided context is
  22892. // canceled.
  22893. func (c *HealthChecksListCall) Context(ctx context.Context) *HealthChecksListCall {
  22894. c.ctx_ = ctx
  22895. return c
  22896. }
  22897. // Header returns an http.Header that can be modified by the caller to
  22898. // add HTTP headers to the request.
  22899. func (c *HealthChecksListCall) Header() http.Header {
  22900. if c.header_ == nil {
  22901. c.header_ = make(http.Header)
  22902. }
  22903. return c.header_
  22904. }
  22905. func (c *HealthChecksListCall) doRequest(alt string) (*http.Response, error) {
  22906. reqHeaders := make(http.Header)
  22907. for k, v := range c.header_ {
  22908. reqHeaders[k] = v
  22909. }
  22910. reqHeaders.Set("User-Agent", c.s.userAgent())
  22911. if c.ifNoneMatch_ != "" {
  22912. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  22913. }
  22914. var body io.Reader = nil
  22915. c.urlParams_.Set("alt", alt)
  22916. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks")
  22917. urls += "?" + c.urlParams_.Encode()
  22918. req, _ := http.NewRequest("GET", urls, body)
  22919. req.Header = reqHeaders
  22920. googleapi.Expand(req.URL, map[string]string{
  22921. "project": c.project,
  22922. })
  22923. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22924. }
  22925. // Do executes the "compute.healthChecks.list" call.
  22926. // Exactly one of *HealthCheckList or error will be non-nil. Any non-2xx
  22927. // status code is an error. Response headers are in either
  22928. // *HealthCheckList.ServerResponse.Header or (if a response was returned
  22929. // at all) in error.(*googleapi.Error).Header. Use
  22930. // googleapi.IsNotModified to check whether the returned error was
  22931. // because http.StatusNotModified was returned.
  22932. func (c *HealthChecksListCall) Do(opts ...googleapi.CallOption) (*HealthCheckList, error) {
  22933. gensupport.SetOptions(c.urlParams_, opts...)
  22934. res, err := c.doRequest("json")
  22935. if res != nil && res.StatusCode == http.StatusNotModified {
  22936. if res.Body != nil {
  22937. res.Body.Close()
  22938. }
  22939. return nil, &googleapi.Error{
  22940. Code: res.StatusCode,
  22941. Header: res.Header,
  22942. }
  22943. }
  22944. if err != nil {
  22945. return nil, err
  22946. }
  22947. defer googleapi.CloseBody(res)
  22948. if err := googleapi.CheckResponse(res); err != nil {
  22949. return nil, err
  22950. }
  22951. ret := &HealthCheckList{
  22952. ServerResponse: googleapi.ServerResponse{
  22953. Header: res.Header,
  22954. HTTPStatusCode: res.StatusCode,
  22955. },
  22956. }
  22957. target := &ret
  22958. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  22959. return nil, err
  22960. }
  22961. return ret, nil
  22962. // {
  22963. // "description": "Retrieves the list of HealthCheck resources available to the specified project.",
  22964. // "httpMethod": "GET",
  22965. // "id": "compute.healthChecks.list",
  22966. // "parameterOrder": [
  22967. // "project"
  22968. // ],
  22969. // "parameters": {
  22970. // "filter": {
  22971. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  22972. // "location": "query",
  22973. // "type": "string"
  22974. // },
  22975. // "maxResults": {
  22976. // "default": "500",
  22977. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  22978. // "format": "uint32",
  22979. // "location": "query",
  22980. // "minimum": "0",
  22981. // "type": "integer"
  22982. // },
  22983. // "orderBy": {
  22984. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  22985. // "location": "query",
  22986. // "type": "string"
  22987. // },
  22988. // "pageToken": {
  22989. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  22990. // "location": "query",
  22991. // "type": "string"
  22992. // },
  22993. // "project": {
  22994. // "description": "Project ID for this request.",
  22995. // "location": "path",
  22996. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  22997. // "required": true,
  22998. // "type": "string"
  22999. // }
  23000. // },
  23001. // "path": "{project}/global/healthChecks",
  23002. // "response": {
  23003. // "$ref": "HealthCheckList"
  23004. // },
  23005. // "scopes": [
  23006. // "https://www.googleapis.com/auth/cloud-platform",
  23007. // "https://www.googleapis.com/auth/compute",
  23008. // "https://www.googleapis.com/auth/compute.readonly"
  23009. // ]
  23010. // }
  23011. }
  23012. // Pages invokes f for each page of results.
  23013. // A non-nil error returned from f will halt the iteration.
  23014. // The provided context supersedes any context provided to the Context method.
  23015. func (c *HealthChecksListCall) Pages(ctx context.Context, f func(*HealthCheckList) error) error {
  23016. c.ctx_ = ctx
  23017. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  23018. for {
  23019. x, err := c.Do()
  23020. if err != nil {
  23021. return err
  23022. }
  23023. if err := f(x); err != nil {
  23024. return err
  23025. }
  23026. if x.NextPageToken == "" {
  23027. return nil
  23028. }
  23029. c.PageToken(x.NextPageToken)
  23030. }
  23031. }
  23032. // method id "compute.healthChecks.patch":
  23033. type HealthChecksPatchCall struct {
  23034. s *Service
  23035. project string
  23036. healthCheck string
  23037. healthcheck *HealthCheck
  23038. urlParams_ gensupport.URLParams
  23039. ctx_ context.Context
  23040. header_ http.Header
  23041. }
  23042. // Patch: Updates a HealthCheck resource in the specified project using
  23043. // the data included in the request. This method supports patch
  23044. // semantics.
  23045. func (r *HealthChecksService) Patch(project string, healthCheck string, healthcheck *HealthCheck) *HealthChecksPatchCall {
  23046. c := &HealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23047. c.project = project
  23048. c.healthCheck = healthCheck
  23049. c.healthcheck = healthcheck
  23050. return c
  23051. }
  23052. // Fields allows partial responses to be retrieved. See
  23053. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23054. // for more information.
  23055. func (c *HealthChecksPatchCall) Fields(s ...googleapi.Field) *HealthChecksPatchCall {
  23056. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23057. return c
  23058. }
  23059. // Context sets the context to be used in this call's Do method. Any
  23060. // pending HTTP request will be aborted if the provided context is
  23061. // canceled.
  23062. func (c *HealthChecksPatchCall) Context(ctx context.Context) *HealthChecksPatchCall {
  23063. c.ctx_ = ctx
  23064. return c
  23065. }
  23066. // Header returns an http.Header that can be modified by the caller to
  23067. // add HTTP headers to the request.
  23068. func (c *HealthChecksPatchCall) Header() http.Header {
  23069. if c.header_ == nil {
  23070. c.header_ = make(http.Header)
  23071. }
  23072. return c.header_
  23073. }
  23074. func (c *HealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
  23075. reqHeaders := make(http.Header)
  23076. for k, v := range c.header_ {
  23077. reqHeaders[k] = v
  23078. }
  23079. reqHeaders.Set("User-Agent", c.s.userAgent())
  23080. var body io.Reader = nil
  23081. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
  23082. if err != nil {
  23083. return nil, err
  23084. }
  23085. reqHeaders.Set("Content-Type", "application/json")
  23086. c.urlParams_.Set("alt", alt)
  23087. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{healthCheck}")
  23088. urls += "?" + c.urlParams_.Encode()
  23089. req, _ := http.NewRequest("PATCH", urls, body)
  23090. req.Header = reqHeaders
  23091. googleapi.Expand(req.URL, map[string]string{
  23092. "project": c.project,
  23093. "healthCheck": c.healthCheck,
  23094. })
  23095. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23096. }
  23097. // Do executes the "compute.healthChecks.patch" call.
  23098. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  23099. // status code is an error. Response headers are in either
  23100. // *Operation.ServerResponse.Header or (if a response was returned at
  23101. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  23102. // to check whether the returned error was because
  23103. // http.StatusNotModified was returned.
  23104. func (c *HealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  23105. gensupport.SetOptions(c.urlParams_, opts...)
  23106. res, err := c.doRequest("json")
  23107. if res != nil && res.StatusCode == http.StatusNotModified {
  23108. if res.Body != nil {
  23109. res.Body.Close()
  23110. }
  23111. return nil, &googleapi.Error{
  23112. Code: res.StatusCode,
  23113. Header: res.Header,
  23114. }
  23115. }
  23116. if err != nil {
  23117. return nil, err
  23118. }
  23119. defer googleapi.CloseBody(res)
  23120. if err := googleapi.CheckResponse(res); err != nil {
  23121. return nil, err
  23122. }
  23123. ret := &Operation{
  23124. ServerResponse: googleapi.ServerResponse{
  23125. Header: res.Header,
  23126. HTTPStatusCode: res.StatusCode,
  23127. },
  23128. }
  23129. target := &ret
  23130. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  23131. return nil, err
  23132. }
  23133. return ret, nil
  23134. // {
  23135. // "description": "Updates a HealthCheck resource in the specified project using the data included in the request. This method supports patch semantics.",
  23136. // "httpMethod": "PATCH",
  23137. // "id": "compute.healthChecks.patch",
  23138. // "parameterOrder": [
  23139. // "project",
  23140. // "healthCheck"
  23141. // ],
  23142. // "parameters": {
  23143. // "healthCheck": {
  23144. // "description": "Name of the HealthCheck resource to patch.",
  23145. // "location": "path",
  23146. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  23147. // "required": true,
  23148. // "type": "string"
  23149. // },
  23150. // "project": {
  23151. // "description": "Project ID for this request.",
  23152. // "location": "path",
  23153. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  23154. // "required": true,
  23155. // "type": "string"
  23156. // }
  23157. // },
  23158. // "path": "{project}/global/healthChecks/{healthCheck}",
  23159. // "request": {
  23160. // "$ref": "HealthCheck"
  23161. // },
  23162. // "response": {
  23163. // "$ref": "Operation"
  23164. // },
  23165. // "scopes": [
  23166. // "https://www.googleapis.com/auth/cloud-platform",
  23167. // "https://www.googleapis.com/auth/compute",
  23168. // "https://www.googleapis.com/auth/compute.readonly"
  23169. // ]
  23170. // }
  23171. }
  23172. // method id "compute.healthChecks.update":
  23173. type HealthChecksUpdateCall struct {
  23174. s *Service
  23175. project string
  23176. healthCheck string
  23177. healthcheck *HealthCheck
  23178. urlParams_ gensupport.URLParams
  23179. ctx_ context.Context
  23180. header_ http.Header
  23181. }
  23182. // Update: Updates a HealthCheck resource in the specified project using
  23183. // the data included in the request.
  23184. func (r *HealthChecksService) Update(project string, healthCheck string, healthcheck *HealthCheck) *HealthChecksUpdateCall {
  23185. c := &HealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23186. c.project = project
  23187. c.healthCheck = healthCheck
  23188. c.healthcheck = healthcheck
  23189. return c
  23190. }
  23191. // Fields allows partial responses to be retrieved. See
  23192. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23193. // for more information.
  23194. func (c *HealthChecksUpdateCall) Fields(s ...googleapi.Field) *HealthChecksUpdateCall {
  23195. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23196. return c
  23197. }
  23198. // Context sets the context to be used in this call's Do method. Any
  23199. // pending HTTP request will be aborted if the provided context is
  23200. // canceled.
  23201. func (c *HealthChecksUpdateCall) Context(ctx context.Context) *HealthChecksUpdateCall {
  23202. c.ctx_ = ctx
  23203. return c
  23204. }
  23205. // Header returns an http.Header that can be modified by the caller to
  23206. // add HTTP headers to the request.
  23207. func (c *HealthChecksUpdateCall) Header() http.Header {
  23208. if c.header_ == nil {
  23209. c.header_ = make(http.Header)
  23210. }
  23211. return c.header_
  23212. }
  23213. func (c *HealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
  23214. reqHeaders := make(http.Header)
  23215. for k, v := range c.header_ {
  23216. reqHeaders[k] = v
  23217. }
  23218. reqHeaders.Set("User-Agent", c.s.userAgent())
  23219. var body io.Reader = nil
  23220. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
  23221. if err != nil {
  23222. return nil, err
  23223. }
  23224. reqHeaders.Set("Content-Type", "application/json")
  23225. c.urlParams_.Set("alt", alt)
  23226. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{healthCheck}")
  23227. urls += "?" + c.urlParams_.Encode()
  23228. req, _ := http.NewRequest("PUT", urls, body)
  23229. req.Header = reqHeaders
  23230. googleapi.Expand(req.URL, map[string]string{
  23231. "project": c.project,
  23232. "healthCheck": c.healthCheck,
  23233. })
  23234. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23235. }
  23236. // Do executes the "compute.healthChecks.update" call.
  23237. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  23238. // status code is an error. Response headers are in either
  23239. // *Operation.ServerResponse.Header or (if a response was returned at
  23240. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  23241. // to check whether the returned error was because
  23242. // http.StatusNotModified was returned.
  23243. func (c *HealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  23244. gensupport.SetOptions(c.urlParams_, opts...)
  23245. res, err := c.doRequest("json")
  23246. if res != nil && res.StatusCode == http.StatusNotModified {
  23247. if res.Body != nil {
  23248. res.Body.Close()
  23249. }
  23250. return nil, &googleapi.Error{
  23251. Code: res.StatusCode,
  23252. Header: res.Header,
  23253. }
  23254. }
  23255. if err != nil {
  23256. return nil, err
  23257. }
  23258. defer googleapi.CloseBody(res)
  23259. if err := googleapi.CheckResponse(res); err != nil {
  23260. return nil, err
  23261. }
  23262. ret := &Operation{
  23263. ServerResponse: googleapi.ServerResponse{
  23264. Header: res.Header,
  23265. HTTPStatusCode: res.StatusCode,
  23266. },
  23267. }
  23268. target := &ret
  23269. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  23270. return nil, err
  23271. }
  23272. return ret, nil
  23273. // {
  23274. // "description": "Updates a HealthCheck resource in the specified project using the data included in the request.",
  23275. // "httpMethod": "PUT",
  23276. // "id": "compute.healthChecks.update",
  23277. // "parameterOrder": [
  23278. // "project",
  23279. // "healthCheck"
  23280. // ],
  23281. // "parameters": {
  23282. // "healthCheck": {
  23283. // "description": "Name of the HealthCheck resource to update.",
  23284. // "location": "path",
  23285. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  23286. // "required": true,
  23287. // "type": "string"
  23288. // },
  23289. // "project": {
  23290. // "description": "Project ID for this request.",
  23291. // "location": "path",
  23292. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  23293. // "required": true,
  23294. // "type": "string"
  23295. // }
  23296. // },
  23297. // "path": "{project}/global/healthChecks/{healthCheck}",
  23298. // "request": {
  23299. // "$ref": "HealthCheck"
  23300. // },
  23301. // "response": {
  23302. // "$ref": "Operation"
  23303. // },
  23304. // "scopes": [
  23305. // "https://www.googleapis.com/auth/cloud-platform",
  23306. // "https://www.googleapis.com/auth/compute"
  23307. // ]
  23308. // }
  23309. }
  23310. // method id "compute.httpHealthChecks.delete":
  23311. type HttpHealthChecksDeleteCall struct {
  23312. s *Service
  23313. project string
  23314. httpHealthCheck string
  23315. urlParams_ gensupport.URLParams
  23316. ctx_ context.Context
  23317. header_ http.Header
  23318. }
  23319. // Delete: Deletes the specified HttpHealthCheck resource.
  23320. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/delete
  23321. func (r *HttpHealthChecksService) Delete(project string, httpHealthCheck string) *HttpHealthChecksDeleteCall {
  23322. c := &HttpHealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23323. c.project = project
  23324. c.httpHealthCheck = httpHealthCheck
  23325. return c
  23326. }
  23327. // Fields allows partial responses to be retrieved. See
  23328. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23329. // for more information.
  23330. func (c *HttpHealthChecksDeleteCall) Fields(s ...googleapi.Field) *HttpHealthChecksDeleteCall {
  23331. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23332. return c
  23333. }
  23334. // Context sets the context to be used in this call's Do method. Any
  23335. // pending HTTP request will be aborted if the provided context is
  23336. // canceled.
  23337. func (c *HttpHealthChecksDeleteCall) Context(ctx context.Context) *HttpHealthChecksDeleteCall {
  23338. c.ctx_ = ctx
  23339. return c
  23340. }
  23341. // Header returns an http.Header that can be modified by the caller to
  23342. // add HTTP headers to the request.
  23343. func (c *HttpHealthChecksDeleteCall) Header() http.Header {
  23344. if c.header_ == nil {
  23345. c.header_ = make(http.Header)
  23346. }
  23347. return c.header_
  23348. }
  23349. func (c *HttpHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
  23350. reqHeaders := make(http.Header)
  23351. for k, v := range c.header_ {
  23352. reqHeaders[k] = v
  23353. }
  23354. reqHeaders.Set("User-Agent", c.s.userAgent())
  23355. var body io.Reader = nil
  23356. c.urlParams_.Set("alt", alt)
  23357. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  23358. urls += "?" + c.urlParams_.Encode()
  23359. req, _ := http.NewRequest("DELETE", urls, body)
  23360. req.Header = reqHeaders
  23361. googleapi.Expand(req.URL, map[string]string{
  23362. "project": c.project,
  23363. "httpHealthCheck": c.httpHealthCheck,
  23364. })
  23365. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23366. }
  23367. // Do executes the "compute.httpHealthChecks.delete" call.
  23368. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  23369. // status code is an error. Response headers are in either
  23370. // *Operation.ServerResponse.Header or (if a response was returned at
  23371. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  23372. // to check whether the returned error was because
  23373. // http.StatusNotModified was returned.
  23374. func (c *HttpHealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  23375. gensupport.SetOptions(c.urlParams_, opts...)
  23376. res, err := c.doRequest("json")
  23377. if res != nil && res.StatusCode == http.StatusNotModified {
  23378. if res.Body != nil {
  23379. res.Body.Close()
  23380. }
  23381. return nil, &googleapi.Error{
  23382. Code: res.StatusCode,
  23383. Header: res.Header,
  23384. }
  23385. }
  23386. if err != nil {
  23387. return nil, err
  23388. }
  23389. defer googleapi.CloseBody(res)
  23390. if err := googleapi.CheckResponse(res); err != nil {
  23391. return nil, err
  23392. }
  23393. ret := &Operation{
  23394. ServerResponse: googleapi.ServerResponse{
  23395. Header: res.Header,
  23396. HTTPStatusCode: res.StatusCode,
  23397. },
  23398. }
  23399. target := &ret
  23400. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  23401. return nil, err
  23402. }
  23403. return ret, nil
  23404. // {
  23405. // "description": "Deletes the specified HttpHealthCheck resource.",
  23406. // "httpMethod": "DELETE",
  23407. // "id": "compute.httpHealthChecks.delete",
  23408. // "parameterOrder": [
  23409. // "project",
  23410. // "httpHealthCheck"
  23411. // ],
  23412. // "parameters": {
  23413. // "httpHealthCheck": {
  23414. // "description": "Name of the HttpHealthCheck resource to delete.",
  23415. // "location": "path",
  23416. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  23417. // "required": true,
  23418. // "type": "string"
  23419. // },
  23420. // "project": {
  23421. // "description": "Project ID for this request.",
  23422. // "location": "path",
  23423. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  23424. // "required": true,
  23425. // "type": "string"
  23426. // }
  23427. // },
  23428. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  23429. // "response": {
  23430. // "$ref": "Operation"
  23431. // },
  23432. // "scopes": [
  23433. // "https://www.googleapis.com/auth/cloud-platform",
  23434. // "https://www.googleapis.com/auth/compute"
  23435. // ]
  23436. // }
  23437. }
  23438. // method id "compute.httpHealthChecks.get":
  23439. type HttpHealthChecksGetCall struct {
  23440. s *Service
  23441. project string
  23442. httpHealthCheck string
  23443. urlParams_ gensupport.URLParams
  23444. ifNoneMatch_ string
  23445. ctx_ context.Context
  23446. header_ http.Header
  23447. }
  23448. // Get: Returns the specified HttpHealthCheck resource. Get a list of
  23449. // available HTTP health checks by making a list() request.
  23450. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/get
  23451. func (r *HttpHealthChecksService) Get(project string, httpHealthCheck string) *HttpHealthChecksGetCall {
  23452. c := &HttpHealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23453. c.project = project
  23454. c.httpHealthCheck = httpHealthCheck
  23455. return c
  23456. }
  23457. // Fields allows partial responses to be retrieved. See
  23458. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23459. // for more information.
  23460. func (c *HttpHealthChecksGetCall) Fields(s ...googleapi.Field) *HttpHealthChecksGetCall {
  23461. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23462. return c
  23463. }
  23464. // IfNoneMatch sets the optional parameter which makes the operation
  23465. // fail if the object's ETag matches the given value. This is useful for
  23466. // getting updates only after the object has changed since the last
  23467. // request. Use googleapi.IsNotModified to check whether the response
  23468. // error from Do is the result of In-None-Match.
  23469. func (c *HttpHealthChecksGetCall) IfNoneMatch(entityTag string) *HttpHealthChecksGetCall {
  23470. c.ifNoneMatch_ = entityTag
  23471. return c
  23472. }
  23473. // Context sets the context to be used in this call's Do method. Any
  23474. // pending HTTP request will be aborted if the provided context is
  23475. // canceled.
  23476. func (c *HttpHealthChecksGetCall) Context(ctx context.Context) *HttpHealthChecksGetCall {
  23477. c.ctx_ = ctx
  23478. return c
  23479. }
  23480. // Header returns an http.Header that can be modified by the caller to
  23481. // add HTTP headers to the request.
  23482. func (c *HttpHealthChecksGetCall) Header() http.Header {
  23483. if c.header_ == nil {
  23484. c.header_ = make(http.Header)
  23485. }
  23486. return c.header_
  23487. }
  23488. func (c *HttpHealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
  23489. reqHeaders := make(http.Header)
  23490. for k, v := range c.header_ {
  23491. reqHeaders[k] = v
  23492. }
  23493. reqHeaders.Set("User-Agent", c.s.userAgent())
  23494. if c.ifNoneMatch_ != "" {
  23495. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  23496. }
  23497. var body io.Reader = nil
  23498. c.urlParams_.Set("alt", alt)
  23499. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  23500. urls += "?" + c.urlParams_.Encode()
  23501. req, _ := http.NewRequest("GET", urls, body)
  23502. req.Header = reqHeaders
  23503. googleapi.Expand(req.URL, map[string]string{
  23504. "project": c.project,
  23505. "httpHealthCheck": c.httpHealthCheck,
  23506. })
  23507. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23508. }
  23509. // Do executes the "compute.httpHealthChecks.get" call.
  23510. // Exactly one of *HttpHealthCheck or error will be non-nil. Any non-2xx
  23511. // status code is an error. Response headers are in either
  23512. // *HttpHealthCheck.ServerResponse.Header or (if a response was returned
  23513. // at all) in error.(*googleapi.Error).Header. Use
  23514. // googleapi.IsNotModified to check whether the returned error was
  23515. // because http.StatusNotModified was returned.
  23516. func (c *HttpHealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HttpHealthCheck, error) {
  23517. gensupport.SetOptions(c.urlParams_, opts...)
  23518. res, err := c.doRequest("json")
  23519. if res != nil && res.StatusCode == http.StatusNotModified {
  23520. if res.Body != nil {
  23521. res.Body.Close()
  23522. }
  23523. return nil, &googleapi.Error{
  23524. Code: res.StatusCode,
  23525. Header: res.Header,
  23526. }
  23527. }
  23528. if err != nil {
  23529. return nil, err
  23530. }
  23531. defer googleapi.CloseBody(res)
  23532. if err := googleapi.CheckResponse(res); err != nil {
  23533. return nil, err
  23534. }
  23535. ret := &HttpHealthCheck{
  23536. ServerResponse: googleapi.ServerResponse{
  23537. Header: res.Header,
  23538. HTTPStatusCode: res.StatusCode,
  23539. },
  23540. }
  23541. target := &ret
  23542. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  23543. return nil, err
  23544. }
  23545. return ret, nil
  23546. // {
  23547. // "description": "Returns the specified HttpHealthCheck resource. Get a list of available HTTP health checks by making a list() request.",
  23548. // "httpMethod": "GET",
  23549. // "id": "compute.httpHealthChecks.get",
  23550. // "parameterOrder": [
  23551. // "project",
  23552. // "httpHealthCheck"
  23553. // ],
  23554. // "parameters": {
  23555. // "httpHealthCheck": {
  23556. // "description": "Name of the HttpHealthCheck resource to return.",
  23557. // "location": "path",
  23558. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  23559. // "required": true,
  23560. // "type": "string"
  23561. // },
  23562. // "project": {
  23563. // "description": "Project ID for this request.",
  23564. // "location": "path",
  23565. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  23566. // "required": true,
  23567. // "type": "string"
  23568. // }
  23569. // },
  23570. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  23571. // "response": {
  23572. // "$ref": "HttpHealthCheck"
  23573. // },
  23574. // "scopes": [
  23575. // "https://www.googleapis.com/auth/cloud-platform",
  23576. // "https://www.googleapis.com/auth/compute",
  23577. // "https://www.googleapis.com/auth/compute.readonly"
  23578. // ]
  23579. // }
  23580. }
  23581. // method id "compute.httpHealthChecks.insert":
  23582. type HttpHealthChecksInsertCall struct {
  23583. s *Service
  23584. project string
  23585. httphealthcheck *HttpHealthCheck
  23586. urlParams_ gensupport.URLParams
  23587. ctx_ context.Context
  23588. header_ http.Header
  23589. }
  23590. // Insert: Creates a HttpHealthCheck resource in the specified project
  23591. // using the data included in the request.
  23592. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/insert
  23593. func (r *HttpHealthChecksService) Insert(project string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksInsertCall {
  23594. c := &HttpHealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23595. c.project = project
  23596. c.httphealthcheck = httphealthcheck
  23597. return c
  23598. }
  23599. // Fields allows partial responses to be retrieved. See
  23600. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23601. // for more information.
  23602. func (c *HttpHealthChecksInsertCall) Fields(s ...googleapi.Field) *HttpHealthChecksInsertCall {
  23603. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23604. return c
  23605. }
  23606. // Context sets the context to be used in this call's Do method. Any
  23607. // pending HTTP request will be aborted if the provided context is
  23608. // canceled.
  23609. func (c *HttpHealthChecksInsertCall) Context(ctx context.Context) *HttpHealthChecksInsertCall {
  23610. c.ctx_ = ctx
  23611. return c
  23612. }
  23613. // Header returns an http.Header that can be modified by the caller to
  23614. // add HTTP headers to the request.
  23615. func (c *HttpHealthChecksInsertCall) Header() http.Header {
  23616. if c.header_ == nil {
  23617. c.header_ = make(http.Header)
  23618. }
  23619. return c.header_
  23620. }
  23621. func (c *HttpHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
  23622. reqHeaders := make(http.Header)
  23623. for k, v := range c.header_ {
  23624. reqHeaders[k] = v
  23625. }
  23626. reqHeaders.Set("User-Agent", c.s.userAgent())
  23627. var body io.Reader = nil
  23628. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck)
  23629. if err != nil {
  23630. return nil, err
  23631. }
  23632. reqHeaders.Set("Content-Type", "application/json")
  23633. c.urlParams_.Set("alt", alt)
  23634. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks")
  23635. urls += "?" + c.urlParams_.Encode()
  23636. req, _ := http.NewRequest("POST", urls, body)
  23637. req.Header = reqHeaders
  23638. googleapi.Expand(req.URL, map[string]string{
  23639. "project": c.project,
  23640. })
  23641. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23642. }
  23643. // Do executes the "compute.httpHealthChecks.insert" call.
  23644. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  23645. // status code is an error. Response headers are in either
  23646. // *Operation.ServerResponse.Header or (if a response was returned at
  23647. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  23648. // to check whether the returned error was because
  23649. // http.StatusNotModified was returned.
  23650. func (c *HttpHealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  23651. gensupport.SetOptions(c.urlParams_, opts...)
  23652. res, err := c.doRequest("json")
  23653. if res != nil && res.StatusCode == http.StatusNotModified {
  23654. if res.Body != nil {
  23655. res.Body.Close()
  23656. }
  23657. return nil, &googleapi.Error{
  23658. Code: res.StatusCode,
  23659. Header: res.Header,
  23660. }
  23661. }
  23662. if err != nil {
  23663. return nil, err
  23664. }
  23665. defer googleapi.CloseBody(res)
  23666. if err := googleapi.CheckResponse(res); err != nil {
  23667. return nil, err
  23668. }
  23669. ret := &Operation{
  23670. ServerResponse: googleapi.ServerResponse{
  23671. Header: res.Header,
  23672. HTTPStatusCode: res.StatusCode,
  23673. },
  23674. }
  23675. target := &ret
  23676. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  23677. return nil, err
  23678. }
  23679. return ret, nil
  23680. // {
  23681. // "description": "Creates a HttpHealthCheck resource in the specified project using the data included in the request.",
  23682. // "httpMethod": "POST",
  23683. // "id": "compute.httpHealthChecks.insert",
  23684. // "parameterOrder": [
  23685. // "project"
  23686. // ],
  23687. // "parameters": {
  23688. // "project": {
  23689. // "description": "Project ID for this request.",
  23690. // "location": "path",
  23691. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  23692. // "required": true,
  23693. // "type": "string"
  23694. // }
  23695. // },
  23696. // "path": "{project}/global/httpHealthChecks",
  23697. // "request": {
  23698. // "$ref": "HttpHealthCheck"
  23699. // },
  23700. // "response": {
  23701. // "$ref": "Operation"
  23702. // },
  23703. // "scopes": [
  23704. // "https://www.googleapis.com/auth/cloud-platform",
  23705. // "https://www.googleapis.com/auth/compute"
  23706. // ]
  23707. // }
  23708. }
  23709. // method id "compute.httpHealthChecks.list":
  23710. type HttpHealthChecksListCall struct {
  23711. s *Service
  23712. project string
  23713. urlParams_ gensupport.URLParams
  23714. ifNoneMatch_ string
  23715. ctx_ context.Context
  23716. header_ http.Header
  23717. }
  23718. // List: Retrieves the list of HttpHealthCheck resources available to
  23719. // the specified project.
  23720. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/list
  23721. func (r *HttpHealthChecksService) List(project string) *HttpHealthChecksListCall {
  23722. c := &HttpHealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23723. c.project = project
  23724. return c
  23725. }
  23726. // Filter sets the optional parameter "filter": Sets a filter
  23727. // {expression} for filtering listed resources. Your {expression} must
  23728. // be in the format: field_name comparison_string literal_string.
  23729. //
  23730. // The field_name is the name of the field you want to compare. Only
  23731. // atomic field types are supported (string, number, boolean). The
  23732. // comparison_string must be either eq (equals) or ne (not equals). The
  23733. // literal_string is the string value to filter to. The literal value
  23734. // must be valid for the type of field you are filtering by (string,
  23735. // number, boolean). For string fields, the literal value is interpreted
  23736. // as a regular expression using RE2 syntax. The literal value must
  23737. // match the entire field.
  23738. //
  23739. // For example, to filter for instances that do not have a name of
  23740. // example-instance, you would use name ne example-instance.
  23741. //
  23742. // You can filter on nested fields. For example, you could filter on
  23743. // instances that have set the scheduling.automaticRestart field to
  23744. // true. Use filtering on nested fields to take advantage of labels to
  23745. // organize and search for results based on label values.
  23746. //
  23747. // To filter on multiple expressions, provide each separate expression
  23748. // within parentheses. For example, (scheduling.automaticRestart eq
  23749. // true) (zone eq us-central1-f). Multiple expressions are treated as
  23750. // AND expressions, meaning that resources must match all expressions to
  23751. // pass the filters.
  23752. func (c *HttpHealthChecksListCall) Filter(filter string) *HttpHealthChecksListCall {
  23753. c.urlParams_.Set("filter", filter)
  23754. return c
  23755. }
  23756. // MaxResults sets the optional parameter "maxResults": The maximum
  23757. // number of results per page that should be returned. If the number of
  23758. // available results is larger than maxResults, Compute Engine returns a
  23759. // nextPageToken that can be used to get the next page of results in
  23760. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  23761. // (Default: 500)
  23762. func (c *HttpHealthChecksListCall) MaxResults(maxResults int64) *HttpHealthChecksListCall {
  23763. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  23764. return c
  23765. }
  23766. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  23767. // a certain order. By default, results are returned in alphanumerical
  23768. // order based on the resource name.
  23769. //
  23770. // You can also sort results in descending order based on the creation
  23771. // timestamp using orderBy="creationTimestamp desc". This sorts results
  23772. // based on the creationTimestamp field in reverse chronological order
  23773. // (newest result first). Use this to sort resources like operations so
  23774. // that the newest operation is returned first.
  23775. //
  23776. // Currently, only sorting by name or creationTimestamp desc is
  23777. // supported.
  23778. func (c *HttpHealthChecksListCall) OrderBy(orderBy string) *HttpHealthChecksListCall {
  23779. c.urlParams_.Set("orderBy", orderBy)
  23780. return c
  23781. }
  23782. // PageToken sets the optional parameter "pageToken": Specifies a page
  23783. // token to use. Set pageToken to the nextPageToken returned by a
  23784. // previous list request to get the next page of results.
  23785. func (c *HttpHealthChecksListCall) PageToken(pageToken string) *HttpHealthChecksListCall {
  23786. c.urlParams_.Set("pageToken", pageToken)
  23787. return c
  23788. }
  23789. // Fields allows partial responses to be retrieved. See
  23790. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23791. // for more information.
  23792. func (c *HttpHealthChecksListCall) Fields(s ...googleapi.Field) *HttpHealthChecksListCall {
  23793. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23794. return c
  23795. }
  23796. // IfNoneMatch sets the optional parameter which makes the operation
  23797. // fail if the object's ETag matches the given value. This is useful for
  23798. // getting updates only after the object has changed since the last
  23799. // request. Use googleapi.IsNotModified to check whether the response
  23800. // error from Do is the result of In-None-Match.
  23801. func (c *HttpHealthChecksListCall) IfNoneMatch(entityTag string) *HttpHealthChecksListCall {
  23802. c.ifNoneMatch_ = entityTag
  23803. return c
  23804. }
  23805. // Context sets the context to be used in this call's Do method. Any
  23806. // pending HTTP request will be aborted if the provided context is
  23807. // canceled.
  23808. func (c *HttpHealthChecksListCall) Context(ctx context.Context) *HttpHealthChecksListCall {
  23809. c.ctx_ = ctx
  23810. return c
  23811. }
  23812. // Header returns an http.Header that can be modified by the caller to
  23813. // add HTTP headers to the request.
  23814. func (c *HttpHealthChecksListCall) Header() http.Header {
  23815. if c.header_ == nil {
  23816. c.header_ = make(http.Header)
  23817. }
  23818. return c.header_
  23819. }
  23820. func (c *HttpHealthChecksListCall) doRequest(alt string) (*http.Response, error) {
  23821. reqHeaders := make(http.Header)
  23822. for k, v := range c.header_ {
  23823. reqHeaders[k] = v
  23824. }
  23825. reqHeaders.Set("User-Agent", c.s.userAgent())
  23826. if c.ifNoneMatch_ != "" {
  23827. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  23828. }
  23829. var body io.Reader = nil
  23830. c.urlParams_.Set("alt", alt)
  23831. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks")
  23832. urls += "?" + c.urlParams_.Encode()
  23833. req, _ := http.NewRequest("GET", urls, body)
  23834. req.Header = reqHeaders
  23835. googleapi.Expand(req.URL, map[string]string{
  23836. "project": c.project,
  23837. })
  23838. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23839. }
  23840. // Do executes the "compute.httpHealthChecks.list" call.
  23841. // Exactly one of *HttpHealthCheckList or error will be non-nil. Any
  23842. // non-2xx status code is an error. Response headers are in either
  23843. // *HttpHealthCheckList.ServerResponse.Header or (if a response was
  23844. // returned at all) in error.(*googleapi.Error).Header. Use
  23845. // googleapi.IsNotModified to check whether the returned error was
  23846. // because http.StatusNotModified was returned.
  23847. func (c *HttpHealthChecksListCall) Do(opts ...googleapi.CallOption) (*HttpHealthCheckList, error) {
  23848. gensupport.SetOptions(c.urlParams_, opts...)
  23849. res, err := c.doRequest("json")
  23850. if res != nil && res.StatusCode == http.StatusNotModified {
  23851. if res.Body != nil {
  23852. res.Body.Close()
  23853. }
  23854. return nil, &googleapi.Error{
  23855. Code: res.StatusCode,
  23856. Header: res.Header,
  23857. }
  23858. }
  23859. if err != nil {
  23860. return nil, err
  23861. }
  23862. defer googleapi.CloseBody(res)
  23863. if err := googleapi.CheckResponse(res); err != nil {
  23864. return nil, err
  23865. }
  23866. ret := &HttpHealthCheckList{
  23867. ServerResponse: googleapi.ServerResponse{
  23868. Header: res.Header,
  23869. HTTPStatusCode: res.StatusCode,
  23870. },
  23871. }
  23872. target := &ret
  23873. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  23874. return nil, err
  23875. }
  23876. return ret, nil
  23877. // {
  23878. // "description": "Retrieves the list of HttpHealthCheck resources available to the specified project.",
  23879. // "httpMethod": "GET",
  23880. // "id": "compute.httpHealthChecks.list",
  23881. // "parameterOrder": [
  23882. // "project"
  23883. // ],
  23884. // "parameters": {
  23885. // "filter": {
  23886. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  23887. // "location": "query",
  23888. // "type": "string"
  23889. // },
  23890. // "maxResults": {
  23891. // "default": "500",
  23892. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  23893. // "format": "uint32",
  23894. // "location": "query",
  23895. // "minimum": "0",
  23896. // "type": "integer"
  23897. // },
  23898. // "orderBy": {
  23899. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  23900. // "location": "query",
  23901. // "type": "string"
  23902. // },
  23903. // "pageToken": {
  23904. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  23905. // "location": "query",
  23906. // "type": "string"
  23907. // },
  23908. // "project": {
  23909. // "description": "Project ID for this request.",
  23910. // "location": "path",
  23911. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  23912. // "required": true,
  23913. // "type": "string"
  23914. // }
  23915. // },
  23916. // "path": "{project}/global/httpHealthChecks",
  23917. // "response": {
  23918. // "$ref": "HttpHealthCheckList"
  23919. // },
  23920. // "scopes": [
  23921. // "https://www.googleapis.com/auth/cloud-platform",
  23922. // "https://www.googleapis.com/auth/compute",
  23923. // "https://www.googleapis.com/auth/compute.readonly"
  23924. // ]
  23925. // }
  23926. }
  23927. // Pages invokes f for each page of results.
  23928. // A non-nil error returned from f will halt the iteration.
  23929. // The provided context supersedes any context provided to the Context method.
  23930. func (c *HttpHealthChecksListCall) Pages(ctx context.Context, f func(*HttpHealthCheckList) error) error {
  23931. c.ctx_ = ctx
  23932. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  23933. for {
  23934. x, err := c.Do()
  23935. if err != nil {
  23936. return err
  23937. }
  23938. if err := f(x); err != nil {
  23939. return err
  23940. }
  23941. if x.NextPageToken == "" {
  23942. return nil
  23943. }
  23944. c.PageToken(x.NextPageToken)
  23945. }
  23946. }
  23947. // method id "compute.httpHealthChecks.patch":
  23948. type HttpHealthChecksPatchCall struct {
  23949. s *Service
  23950. project string
  23951. httpHealthCheck string
  23952. httphealthcheck *HttpHealthCheck
  23953. urlParams_ gensupport.URLParams
  23954. ctx_ context.Context
  23955. header_ http.Header
  23956. }
  23957. // Patch: Updates a HttpHealthCheck resource in the specified project
  23958. // using the data included in the request. This method supports patch
  23959. // semantics.
  23960. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/patch
  23961. func (r *HttpHealthChecksService) Patch(project string, httpHealthCheck string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksPatchCall {
  23962. c := &HttpHealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23963. c.project = project
  23964. c.httpHealthCheck = httpHealthCheck
  23965. c.httphealthcheck = httphealthcheck
  23966. return c
  23967. }
  23968. // Fields allows partial responses to be retrieved. See
  23969. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23970. // for more information.
  23971. func (c *HttpHealthChecksPatchCall) Fields(s ...googleapi.Field) *HttpHealthChecksPatchCall {
  23972. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23973. return c
  23974. }
  23975. // Context sets the context to be used in this call's Do method. Any
  23976. // pending HTTP request will be aborted if the provided context is
  23977. // canceled.
  23978. func (c *HttpHealthChecksPatchCall) Context(ctx context.Context) *HttpHealthChecksPatchCall {
  23979. c.ctx_ = ctx
  23980. return c
  23981. }
  23982. // Header returns an http.Header that can be modified by the caller to
  23983. // add HTTP headers to the request.
  23984. func (c *HttpHealthChecksPatchCall) Header() http.Header {
  23985. if c.header_ == nil {
  23986. c.header_ = make(http.Header)
  23987. }
  23988. return c.header_
  23989. }
  23990. func (c *HttpHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
  23991. reqHeaders := make(http.Header)
  23992. for k, v := range c.header_ {
  23993. reqHeaders[k] = v
  23994. }
  23995. reqHeaders.Set("User-Agent", c.s.userAgent())
  23996. var body io.Reader = nil
  23997. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck)
  23998. if err != nil {
  23999. return nil, err
  24000. }
  24001. reqHeaders.Set("Content-Type", "application/json")
  24002. c.urlParams_.Set("alt", alt)
  24003. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  24004. urls += "?" + c.urlParams_.Encode()
  24005. req, _ := http.NewRequest("PATCH", urls, body)
  24006. req.Header = reqHeaders
  24007. googleapi.Expand(req.URL, map[string]string{
  24008. "project": c.project,
  24009. "httpHealthCheck": c.httpHealthCheck,
  24010. })
  24011. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24012. }
  24013. // Do executes the "compute.httpHealthChecks.patch" call.
  24014. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  24015. // status code is an error. Response headers are in either
  24016. // *Operation.ServerResponse.Header or (if a response was returned at
  24017. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  24018. // to check whether the returned error was because
  24019. // http.StatusNotModified was returned.
  24020. func (c *HttpHealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  24021. gensupport.SetOptions(c.urlParams_, opts...)
  24022. res, err := c.doRequest("json")
  24023. if res != nil && res.StatusCode == http.StatusNotModified {
  24024. if res.Body != nil {
  24025. res.Body.Close()
  24026. }
  24027. return nil, &googleapi.Error{
  24028. Code: res.StatusCode,
  24029. Header: res.Header,
  24030. }
  24031. }
  24032. if err != nil {
  24033. return nil, err
  24034. }
  24035. defer googleapi.CloseBody(res)
  24036. if err := googleapi.CheckResponse(res); err != nil {
  24037. return nil, err
  24038. }
  24039. ret := &Operation{
  24040. ServerResponse: googleapi.ServerResponse{
  24041. Header: res.Header,
  24042. HTTPStatusCode: res.StatusCode,
  24043. },
  24044. }
  24045. target := &ret
  24046. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  24047. return nil, err
  24048. }
  24049. return ret, nil
  24050. // {
  24051. // "description": "Updates a HttpHealthCheck resource in the specified project using the data included in the request. This method supports patch semantics.",
  24052. // "httpMethod": "PATCH",
  24053. // "id": "compute.httpHealthChecks.patch",
  24054. // "parameterOrder": [
  24055. // "project",
  24056. // "httpHealthCheck"
  24057. // ],
  24058. // "parameters": {
  24059. // "httpHealthCheck": {
  24060. // "description": "Name of the HttpHealthCheck resource to patch.",
  24061. // "location": "path",
  24062. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  24063. // "required": true,
  24064. // "type": "string"
  24065. // },
  24066. // "project": {
  24067. // "description": "Project ID for this request.",
  24068. // "location": "path",
  24069. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  24070. // "required": true,
  24071. // "type": "string"
  24072. // }
  24073. // },
  24074. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  24075. // "request": {
  24076. // "$ref": "HttpHealthCheck"
  24077. // },
  24078. // "response": {
  24079. // "$ref": "Operation"
  24080. // },
  24081. // "scopes": [
  24082. // "https://www.googleapis.com/auth/cloud-platform",
  24083. // "https://www.googleapis.com/auth/compute",
  24084. // "https://www.googleapis.com/auth/compute.readonly"
  24085. // ]
  24086. // }
  24087. }
  24088. // method id "compute.httpHealthChecks.update":
  24089. type HttpHealthChecksUpdateCall struct {
  24090. s *Service
  24091. project string
  24092. httpHealthCheck string
  24093. httphealthcheck *HttpHealthCheck
  24094. urlParams_ gensupport.URLParams
  24095. ctx_ context.Context
  24096. header_ http.Header
  24097. }
  24098. // Update: Updates a HttpHealthCheck resource in the specified project
  24099. // using the data included in the request.
  24100. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/update
  24101. func (r *HttpHealthChecksService) Update(project string, httpHealthCheck string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksUpdateCall {
  24102. c := &HttpHealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24103. c.project = project
  24104. c.httpHealthCheck = httpHealthCheck
  24105. c.httphealthcheck = httphealthcheck
  24106. return c
  24107. }
  24108. // Fields allows partial responses to be retrieved. See
  24109. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24110. // for more information.
  24111. func (c *HttpHealthChecksUpdateCall) Fields(s ...googleapi.Field) *HttpHealthChecksUpdateCall {
  24112. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24113. return c
  24114. }
  24115. // Context sets the context to be used in this call's Do method. Any
  24116. // pending HTTP request will be aborted if the provided context is
  24117. // canceled.
  24118. func (c *HttpHealthChecksUpdateCall) Context(ctx context.Context) *HttpHealthChecksUpdateCall {
  24119. c.ctx_ = ctx
  24120. return c
  24121. }
  24122. // Header returns an http.Header that can be modified by the caller to
  24123. // add HTTP headers to the request.
  24124. func (c *HttpHealthChecksUpdateCall) Header() http.Header {
  24125. if c.header_ == nil {
  24126. c.header_ = make(http.Header)
  24127. }
  24128. return c.header_
  24129. }
  24130. func (c *HttpHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
  24131. reqHeaders := make(http.Header)
  24132. for k, v := range c.header_ {
  24133. reqHeaders[k] = v
  24134. }
  24135. reqHeaders.Set("User-Agent", c.s.userAgent())
  24136. var body io.Reader = nil
  24137. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck)
  24138. if err != nil {
  24139. return nil, err
  24140. }
  24141. reqHeaders.Set("Content-Type", "application/json")
  24142. c.urlParams_.Set("alt", alt)
  24143. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  24144. urls += "?" + c.urlParams_.Encode()
  24145. req, _ := http.NewRequest("PUT", urls, body)
  24146. req.Header = reqHeaders
  24147. googleapi.Expand(req.URL, map[string]string{
  24148. "project": c.project,
  24149. "httpHealthCheck": c.httpHealthCheck,
  24150. })
  24151. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24152. }
  24153. // Do executes the "compute.httpHealthChecks.update" call.
  24154. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  24155. // status code is an error. Response headers are in either
  24156. // *Operation.ServerResponse.Header or (if a response was returned at
  24157. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  24158. // to check whether the returned error was because
  24159. // http.StatusNotModified was returned.
  24160. func (c *HttpHealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  24161. gensupport.SetOptions(c.urlParams_, opts...)
  24162. res, err := c.doRequest("json")
  24163. if res != nil && res.StatusCode == http.StatusNotModified {
  24164. if res.Body != nil {
  24165. res.Body.Close()
  24166. }
  24167. return nil, &googleapi.Error{
  24168. Code: res.StatusCode,
  24169. Header: res.Header,
  24170. }
  24171. }
  24172. if err != nil {
  24173. return nil, err
  24174. }
  24175. defer googleapi.CloseBody(res)
  24176. if err := googleapi.CheckResponse(res); err != nil {
  24177. return nil, err
  24178. }
  24179. ret := &Operation{
  24180. ServerResponse: googleapi.ServerResponse{
  24181. Header: res.Header,
  24182. HTTPStatusCode: res.StatusCode,
  24183. },
  24184. }
  24185. target := &ret
  24186. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  24187. return nil, err
  24188. }
  24189. return ret, nil
  24190. // {
  24191. // "description": "Updates a HttpHealthCheck resource in the specified project using the data included in the request.",
  24192. // "httpMethod": "PUT",
  24193. // "id": "compute.httpHealthChecks.update",
  24194. // "parameterOrder": [
  24195. // "project",
  24196. // "httpHealthCheck"
  24197. // ],
  24198. // "parameters": {
  24199. // "httpHealthCheck": {
  24200. // "description": "Name of the HttpHealthCheck resource to update.",
  24201. // "location": "path",
  24202. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  24203. // "required": true,
  24204. // "type": "string"
  24205. // },
  24206. // "project": {
  24207. // "description": "Project ID for this request.",
  24208. // "location": "path",
  24209. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  24210. // "required": true,
  24211. // "type": "string"
  24212. // }
  24213. // },
  24214. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  24215. // "request": {
  24216. // "$ref": "HttpHealthCheck"
  24217. // },
  24218. // "response": {
  24219. // "$ref": "Operation"
  24220. // },
  24221. // "scopes": [
  24222. // "https://www.googleapis.com/auth/cloud-platform",
  24223. // "https://www.googleapis.com/auth/compute"
  24224. // ]
  24225. // }
  24226. }
  24227. // method id "compute.httpsHealthChecks.delete":
  24228. type HttpsHealthChecksDeleteCall struct {
  24229. s *Service
  24230. project string
  24231. httpsHealthCheck string
  24232. urlParams_ gensupport.URLParams
  24233. ctx_ context.Context
  24234. header_ http.Header
  24235. }
  24236. // Delete: Deletes the specified HttpsHealthCheck resource.
  24237. func (r *HttpsHealthChecksService) Delete(project string, httpsHealthCheck string) *HttpsHealthChecksDeleteCall {
  24238. c := &HttpsHealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24239. c.project = project
  24240. c.httpsHealthCheck = httpsHealthCheck
  24241. return c
  24242. }
  24243. // Fields allows partial responses to be retrieved. See
  24244. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24245. // for more information.
  24246. func (c *HttpsHealthChecksDeleteCall) Fields(s ...googleapi.Field) *HttpsHealthChecksDeleteCall {
  24247. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24248. return c
  24249. }
  24250. // Context sets the context to be used in this call's Do method. Any
  24251. // pending HTTP request will be aborted if the provided context is
  24252. // canceled.
  24253. func (c *HttpsHealthChecksDeleteCall) Context(ctx context.Context) *HttpsHealthChecksDeleteCall {
  24254. c.ctx_ = ctx
  24255. return c
  24256. }
  24257. // Header returns an http.Header that can be modified by the caller to
  24258. // add HTTP headers to the request.
  24259. func (c *HttpsHealthChecksDeleteCall) Header() http.Header {
  24260. if c.header_ == nil {
  24261. c.header_ = make(http.Header)
  24262. }
  24263. return c.header_
  24264. }
  24265. func (c *HttpsHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
  24266. reqHeaders := make(http.Header)
  24267. for k, v := range c.header_ {
  24268. reqHeaders[k] = v
  24269. }
  24270. reqHeaders.Set("User-Agent", c.s.userAgent())
  24271. var body io.Reader = nil
  24272. c.urlParams_.Set("alt", alt)
  24273. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  24274. urls += "?" + c.urlParams_.Encode()
  24275. req, _ := http.NewRequest("DELETE", urls, body)
  24276. req.Header = reqHeaders
  24277. googleapi.Expand(req.URL, map[string]string{
  24278. "project": c.project,
  24279. "httpsHealthCheck": c.httpsHealthCheck,
  24280. })
  24281. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24282. }
  24283. // Do executes the "compute.httpsHealthChecks.delete" call.
  24284. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  24285. // status code is an error. Response headers are in either
  24286. // *Operation.ServerResponse.Header or (if a response was returned at
  24287. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  24288. // to check whether the returned error was because
  24289. // http.StatusNotModified was returned.
  24290. func (c *HttpsHealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  24291. gensupport.SetOptions(c.urlParams_, opts...)
  24292. res, err := c.doRequest("json")
  24293. if res != nil && res.StatusCode == http.StatusNotModified {
  24294. if res.Body != nil {
  24295. res.Body.Close()
  24296. }
  24297. return nil, &googleapi.Error{
  24298. Code: res.StatusCode,
  24299. Header: res.Header,
  24300. }
  24301. }
  24302. if err != nil {
  24303. return nil, err
  24304. }
  24305. defer googleapi.CloseBody(res)
  24306. if err := googleapi.CheckResponse(res); err != nil {
  24307. return nil, err
  24308. }
  24309. ret := &Operation{
  24310. ServerResponse: googleapi.ServerResponse{
  24311. Header: res.Header,
  24312. HTTPStatusCode: res.StatusCode,
  24313. },
  24314. }
  24315. target := &ret
  24316. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  24317. return nil, err
  24318. }
  24319. return ret, nil
  24320. // {
  24321. // "description": "Deletes the specified HttpsHealthCheck resource.",
  24322. // "httpMethod": "DELETE",
  24323. // "id": "compute.httpsHealthChecks.delete",
  24324. // "parameterOrder": [
  24325. // "project",
  24326. // "httpsHealthCheck"
  24327. // ],
  24328. // "parameters": {
  24329. // "httpsHealthCheck": {
  24330. // "description": "Name of the HttpsHealthCheck resource to delete.",
  24331. // "location": "path",
  24332. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  24333. // "required": true,
  24334. // "type": "string"
  24335. // },
  24336. // "project": {
  24337. // "description": "Project ID for this request.",
  24338. // "location": "path",
  24339. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  24340. // "required": true,
  24341. // "type": "string"
  24342. // }
  24343. // },
  24344. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  24345. // "response": {
  24346. // "$ref": "Operation"
  24347. // },
  24348. // "scopes": [
  24349. // "https://www.googleapis.com/auth/cloud-platform",
  24350. // "https://www.googleapis.com/auth/compute"
  24351. // ]
  24352. // }
  24353. }
  24354. // method id "compute.httpsHealthChecks.get":
  24355. type HttpsHealthChecksGetCall struct {
  24356. s *Service
  24357. project string
  24358. httpsHealthCheck string
  24359. urlParams_ gensupport.URLParams
  24360. ifNoneMatch_ string
  24361. ctx_ context.Context
  24362. header_ http.Header
  24363. }
  24364. // Get: Returns the specified HttpsHealthCheck resource. Get a list of
  24365. // available HTTPS health checks by making a list() request.
  24366. func (r *HttpsHealthChecksService) Get(project string, httpsHealthCheck string) *HttpsHealthChecksGetCall {
  24367. c := &HttpsHealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24368. c.project = project
  24369. c.httpsHealthCheck = httpsHealthCheck
  24370. return c
  24371. }
  24372. // Fields allows partial responses to be retrieved. See
  24373. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24374. // for more information.
  24375. func (c *HttpsHealthChecksGetCall) Fields(s ...googleapi.Field) *HttpsHealthChecksGetCall {
  24376. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24377. return c
  24378. }
  24379. // IfNoneMatch sets the optional parameter which makes the operation
  24380. // fail if the object's ETag matches the given value. This is useful for
  24381. // getting updates only after the object has changed since the last
  24382. // request. Use googleapi.IsNotModified to check whether the response
  24383. // error from Do is the result of In-None-Match.
  24384. func (c *HttpsHealthChecksGetCall) IfNoneMatch(entityTag string) *HttpsHealthChecksGetCall {
  24385. c.ifNoneMatch_ = entityTag
  24386. return c
  24387. }
  24388. // Context sets the context to be used in this call's Do method. Any
  24389. // pending HTTP request will be aborted if the provided context is
  24390. // canceled.
  24391. func (c *HttpsHealthChecksGetCall) Context(ctx context.Context) *HttpsHealthChecksGetCall {
  24392. c.ctx_ = ctx
  24393. return c
  24394. }
  24395. // Header returns an http.Header that can be modified by the caller to
  24396. // add HTTP headers to the request.
  24397. func (c *HttpsHealthChecksGetCall) Header() http.Header {
  24398. if c.header_ == nil {
  24399. c.header_ = make(http.Header)
  24400. }
  24401. return c.header_
  24402. }
  24403. func (c *HttpsHealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
  24404. reqHeaders := make(http.Header)
  24405. for k, v := range c.header_ {
  24406. reqHeaders[k] = v
  24407. }
  24408. reqHeaders.Set("User-Agent", c.s.userAgent())
  24409. if c.ifNoneMatch_ != "" {
  24410. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  24411. }
  24412. var body io.Reader = nil
  24413. c.urlParams_.Set("alt", alt)
  24414. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  24415. urls += "?" + c.urlParams_.Encode()
  24416. req, _ := http.NewRequest("GET", urls, body)
  24417. req.Header = reqHeaders
  24418. googleapi.Expand(req.URL, map[string]string{
  24419. "project": c.project,
  24420. "httpsHealthCheck": c.httpsHealthCheck,
  24421. })
  24422. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24423. }
  24424. // Do executes the "compute.httpsHealthChecks.get" call.
  24425. // Exactly one of *HttpsHealthCheck or error will be non-nil. Any
  24426. // non-2xx status code is an error. Response headers are in either
  24427. // *HttpsHealthCheck.ServerResponse.Header or (if a response was
  24428. // returned at all) in error.(*googleapi.Error).Header. Use
  24429. // googleapi.IsNotModified to check whether the returned error was
  24430. // because http.StatusNotModified was returned.
  24431. func (c *HttpsHealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HttpsHealthCheck, error) {
  24432. gensupport.SetOptions(c.urlParams_, opts...)
  24433. res, err := c.doRequest("json")
  24434. if res != nil && res.StatusCode == http.StatusNotModified {
  24435. if res.Body != nil {
  24436. res.Body.Close()
  24437. }
  24438. return nil, &googleapi.Error{
  24439. Code: res.StatusCode,
  24440. Header: res.Header,
  24441. }
  24442. }
  24443. if err != nil {
  24444. return nil, err
  24445. }
  24446. defer googleapi.CloseBody(res)
  24447. if err := googleapi.CheckResponse(res); err != nil {
  24448. return nil, err
  24449. }
  24450. ret := &HttpsHealthCheck{
  24451. ServerResponse: googleapi.ServerResponse{
  24452. Header: res.Header,
  24453. HTTPStatusCode: res.StatusCode,
  24454. },
  24455. }
  24456. target := &ret
  24457. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  24458. return nil, err
  24459. }
  24460. return ret, nil
  24461. // {
  24462. // "description": "Returns the specified HttpsHealthCheck resource. Get a list of available HTTPS health checks by making a list() request.",
  24463. // "httpMethod": "GET",
  24464. // "id": "compute.httpsHealthChecks.get",
  24465. // "parameterOrder": [
  24466. // "project",
  24467. // "httpsHealthCheck"
  24468. // ],
  24469. // "parameters": {
  24470. // "httpsHealthCheck": {
  24471. // "description": "Name of the HttpsHealthCheck resource to return.",
  24472. // "location": "path",
  24473. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  24474. // "required": true,
  24475. // "type": "string"
  24476. // },
  24477. // "project": {
  24478. // "description": "Project ID for this request.",
  24479. // "location": "path",
  24480. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  24481. // "required": true,
  24482. // "type": "string"
  24483. // }
  24484. // },
  24485. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  24486. // "response": {
  24487. // "$ref": "HttpsHealthCheck"
  24488. // },
  24489. // "scopes": [
  24490. // "https://www.googleapis.com/auth/cloud-platform",
  24491. // "https://www.googleapis.com/auth/compute",
  24492. // "https://www.googleapis.com/auth/compute.readonly"
  24493. // ]
  24494. // }
  24495. }
  24496. // method id "compute.httpsHealthChecks.insert":
  24497. type HttpsHealthChecksInsertCall struct {
  24498. s *Service
  24499. project string
  24500. httpshealthcheck *HttpsHealthCheck
  24501. urlParams_ gensupport.URLParams
  24502. ctx_ context.Context
  24503. header_ http.Header
  24504. }
  24505. // Insert: Creates a HttpsHealthCheck resource in the specified project
  24506. // using the data included in the request.
  24507. func (r *HttpsHealthChecksService) Insert(project string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksInsertCall {
  24508. c := &HttpsHealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24509. c.project = project
  24510. c.httpshealthcheck = httpshealthcheck
  24511. return c
  24512. }
  24513. // Fields allows partial responses to be retrieved. See
  24514. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24515. // for more information.
  24516. func (c *HttpsHealthChecksInsertCall) Fields(s ...googleapi.Field) *HttpsHealthChecksInsertCall {
  24517. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24518. return c
  24519. }
  24520. // Context sets the context to be used in this call's Do method. Any
  24521. // pending HTTP request will be aborted if the provided context is
  24522. // canceled.
  24523. func (c *HttpsHealthChecksInsertCall) Context(ctx context.Context) *HttpsHealthChecksInsertCall {
  24524. c.ctx_ = ctx
  24525. return c
  24526. }
  24527. // Header returns an http.Header that can be modified by the caller to
  24528. // add HTTP headers to the request.
  24529. func (c *HttpsHealthChecksInsertCall) Header() http.Header {
  24530. if c.header_ == nil {
  24531. c.header_ = make(http.Header)
  24532. }
  24533. return c.header_
  24534. }
  24535. func (c *HttpsHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
  24536. reqHeaders := make(http.Header)
  24537. for k, v := range c.header_ {
  24538. reqHeaders[k] = v
  24539. }
  24540. reqHeaders.Set("User-Agent", c.s.userAgent())
  24541. var body io.Reader = nil
  24542. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck)
  24543. if err != nil {
  24544. return nil, err
  24545. }
  24546. reqHeaders.Set("Content-Type", "application/json")
  24547. c.urlParams_.Set("alt", alt)
  24548. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks")
  24549. urls += "?" + c.urlParams_.Encode()
  24550. req, _ := http.NewRequest("POST", urls, body)
  24551. req.Header = reqHeaders
  24552. googleapi.Expand(req.URL, map[string]string{
  24553. "project": c.project,
  24554. })
  24555. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24556. }
  24557. // Do executes the "compute.httpsHealthChecks.insert" call.
  24558. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  24559. // status code is an error. Response headers are in either
  24560. // *Operation.ServerResponse.Header or (if a response was returned at
  24561. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  24562. // to check whether the returned error was because
  24563. // http.StatusNotModified was returned.
  24564. func (c *HttpsHealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  24565. gensupport.SetOptions(c.urlParams_, opts...)
  24566. res, err := c.doRequest("json")
  24567. if res != nil && res.StatusCode == http.StatusNotModified {
  24568. if res.Body != nil {
  24569. res.Body.Close()
  24570. }
  24571. return nil, &googleapi.Error{
  24572. Code: res.StatusCode,
  24573. Header: res.Header,
  24574. }
  24575. }
  24576. if err != nil {
  24577. return nil, err
  24578. }
  24579. defer googleapi.CloseBody(res)
  24580. if err := googleapi.CheckResponse(res); err != nil {
  24581. return nil, err
  24582. }
  24583. ret := &Operation{
  24584. ServerResponse: googleapi.ServerResponse{
  24585. Header: res.Header,
  24586. HTTPStatusCode: res.StatusCode,
  24587. },
  24588. }
  24589. target := &ret
  24590. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  24591. return nil, err
  24592. }
  24593. return ret, nil
  24594. // {
  24595. // "description": "Creates a HttpsHealthCheck resource in the specified project using the data included in the request.",
  24596. // "httpMethod": "POST",
  24597. // "id": "compute.httpsHealthChecks.insert",
  24598. // "parameterOrder": [
  24599. // "project"
  24600. // ],
  24601. // "parameters": {
  24602. // "project": {
  24603. // "description": "Project ID for this request.",
  24604. // "location": "path",
  24605. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  24606. // "required": true,
  24607. // "type": "string"
  24608. // }
  24609. // },
  24610. // "path": "{project}/global/httpsHealthChecks",
  24611. // "request": {
  24612. // "$ref": "HttpsHealthCheck"
  24613. // },
  24614. // "response": {
  24615. // "$ref": "Operation"
  24616. // },
  24617. // "scopes": [
  24618. // "https://www.googleapis.com/auth/cloud-platform",
  24619. // "https://www.googleapis.com/auth/compute"
  24620. // ]
  24621. // }
  24622. }
  24623. // method id "compute.httpsHealthChecks.list":
  24624. type HttpsHealthChecksListCall struct {
  24625. s *Service
  24626. project string
  24627. urlParams_ gensupport.URLParams
  24628. ifNoneMatch_ string
  24629. ctx_ context.Context
  24630. header_ http.Header
  24631. }
  24632. // List: Retrieves the list of HttpsHealthCheck resources available to
  24633. // the specified project.
  24634. func (r *HttpsHealthChecksService) List(project string) *HttpsHealthChecksListCall {
  24635. c := &HttpsHealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24636. c.project = project
  24637. return c
  24638. }
  24639. // Filter sets the optional parameter "filter": Sets a filter
  24640. // {expression} for filtering listed resources. Your {expression} must
  24641. // be in the format: field_name comparison_string literal_string.
  24642. //
  24643. // The field_name is the name of the field you want to compare. Only
  24644. // atomic field types are supported (string, number, boolean). The
  24645. // comparison_string must be either eq (equals) or ne (not equals). The
  24646. // literal_string is the string value to filter to. The literal value
  24647. // must be valid for the type of field you are filtering by (string,
  24648. // number, boolean). For string fields, the literal value is interpreted
  24649. // as a regular expression using RE2 syntax. The literal value must
  24650. // match the entire field.
  24651. //
  24652. // For example, to filter for instances that do not have a name of
  24653. // example-instance, you would use name ne example-instance.
  24654. //
  24655. // You can filter on nested fields. For example, you could filter on
  24656. // instances that have set the scheduling.automaticRestart field to
  24657. // true. Use filtering on nested fields to take advantage of labels to
  24658. // organize and search for results based on label values.
  24659. //
  24660. // To filter on multiple expressions, provide each separate expression
  24661. // within parentheses. For example, (scheduling.automaticRestart eq
  24662. // true) (zone eq us-central1-f). Multiple expressions are treated as
  24663. // AND expressions, meaning that resources must match all expressions to
  24664. // pass the filters.
  24665. func (c *HttpsHealthChecksListCall) Filter(filter string) *HttpsHealthChecksListCall {
  24666. c.urlParams_.Set("filter", filter)
  24667. return c
  24668. }
  24669. // MaxResults sets the optional parameter "maxResults": The maximum
  24670. // number of results per page that should be returned. If the number of
  24671. // available results is larger than maxResults, Compute Engine returns a
  24672. // nextPageToken that can be used to get the next page of results in
  24673. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  24674. // (Default: 500)
  24675. func (c *HttpsHealthChecksListCall) MaxResults(maxResults int64) *HttpsHealthChecksListCall {
  24676. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  24677. return c
  24678. }
  24679. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  24680. // a certain order. By default, results are returned in alphanumerical
  24681. // order based on the resource name.
  24682. //
  24683. // You can also sort results in descending order based on the creation
  24684. // timestamp using orderBy="creationTimestamp desc". This sorts results
  24685. // based on the creationTimestamp field in reverse chronological order
  24686. // (newest result first). Use this to sort resources like operations so
  24687. // that the newest operation is returned first.
  24688. //
  24689. // Currently, only sorting by name or creationTimestamp desc is
  24690. // supported.
  24691. func (c *HttpsHealthChecksListCall) OrderBy(orderBy string) *HttpsHealthChecksListCall {
  24692. c.urlParams_.Set("orderBy", orderBy)
  24693. return c
  24694. }
  24695. // PageToken sets the optional parameter "pageToken": Specifies a page
  24696. // token to use. Set pageToken to the nextPageToken returned by a
  24697. // previous list request to get the next page of results.
  24698. func (c *HttpsHealthChecksListCall) PageToken(pageToken string) *HttpsHealthChecksListCall {
  24699. c.urlParams_.Set("pageToken", pageToken)
  24700. return c
  24701. }
  24702. // Fields allows partial responses to be retrieved. See
  24703. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24704. // for more information.
  24705. func (c *HttpsHealthChecksListCall) Fields(s ...googleapi.Field) *HttpsHealthChecksListCall {
  24706. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24707. return c
  24708. }
  24709. // IfNoneMatch sets the optional parameter which makes the operation
  24710. // fail if the object's ETag matches the given value. This is useful for
  24711. // getting updates only after the object has changed since the last
  24712. // request. Use googleapi.IsNotModified to check whether the response
  24713. // error from Do is the result of In-None-Match.
  24714. func (c *HttpsHealthChecksListCall) IfNoneMatch(entityTag string) *HttpsHealthChecksListCall {
  24715. c.ifNoneMatch_ = entityTag
  24716. return c
  24717. }
  24718. // Context sets the context to be used in this call's Do method. Any
  24719. // pending HTTP request will be aborted if the provided context is
  24720. // canceled.
  24721. func (c *HttpsHealthChecksListCall) Context(ctx context.Context) *HttpsHealthChecksListCall {
  24722. c.ctx_ = ctx
  24723. return c
  24724. }
  24725. // Header returns an http.Header that can be modified by the caller to
  24726. // add HTTP headers to the request.
  24727. func (c *HttpsHealthChecksListCall) Header() http.Header {
  24728. if c.header_ == nil {
  24729. c.header_ = make(http.Header)
  24730. }
  24731. return c.header_
  24732. }
  24733. func (c *HttpsHealthChecksListCall) doRequest(alt string) (*http.Response, error) {
  24734. reqHeaders := make(http.Header)
  24735. for k, v := range c.header_ {
  24736. reqHeaders[k] = v
  24737. }
  24738. reqHeaders.Set("User-Agent", c.s.userAgent())
  24739. if c.ifNoneMatch_ != "" {
  24740. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  24741. }
  24742. var body io.Reader = nil
  24743. c.urlParams_.Set("alt", alt)
  24744. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks")
  24745. urls += "?" + c.urlParams_.Encode()
  24746. req, _ := http.NewRequest("GET", urls, body)
  24747. req.Header = reqHeaders
  24748. googleapi.Expand(req.URL, map[string]string{
  24749. "project": c.project,
  24750. })
  24751. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24752. }
  24753. // Do executes the "compute.httpsHealthChecks.list" call.
  24754. // Exactly one of *HttpsHealthCheckList or error will be non-nil. Any
  24755. // non-2xx status code is an error. Response headers are in either
  24756. // *HttpsHealthCheckList.ServerResponse.Header or (if a response was
  24757. // returned at all) in error.(*googleapi.Error).Header. Use
  24758. // googleapi.IsNotModified to check whether the returned error was
  24759. // because http.StatusNotModified was returned.
  24760. func (c *HttpsHealthChecksListCall) Do(opts ...googleapi.CallOption) (*HttpsHealthCheckList, error) {
  24761. gensupport.SetOptions(c.urlParams_, opts...)
  24762. res, err := c.doRequest("json")
  24763. if res != nil && res.StatusCode == http.StatusNotModified {
  24764. if res.Body != nil {
  24765. res.Body.Close()
  24766. }
  24767. return nil, &googleapi.Error{
  24768. Code: res.StatusCode,
  24769. Header: res.Header,
  24770. }
  24771. }
  24772. if err != nil {
  24773. return nil, err
  24774. }
  24775. defer googleapi.CloseBody(res)
  24776. if err := googleapi.CheckResponse(res); err != nil {
  24777. return nil, err
  24778. }
  24779. ret := &HttpsHealthCheckList{
  24780. ServerResponse: googleapi.ServerResponse{
  24781. Header: res.Header,
  24782. HTTPStatusCode: res.StatusCode,
  24783. },
  24784. }
  24785. target := &ret
  24786. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  24787. return nil, err
  24788. }
  24789. return ret, nil
  24790. // {
  24791. // "description": "Retrieves the list of HttpsHealthCheck resources available to the specified project.",
  24792. // "httpMethod": "GET",
  24793. // "id": "compute.httpsHealthChecks.list",
  24794. // "parameterOrder": [
  24795. // "project"
  24796. // ],
  24797. // "parameters": {
  24798. // "filter": {
  24799. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  24800. // "location": "query",
  24801. // "type": "string"
  24802. // },
  24803. // "maxResults": {
  24804. // "default": "500",
  24805. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  24806. // "format": "uint32",
  24807. // "location": "query",
  24808. // "minimum": "0",
  24809. // "type": "integer"
  24810. // },
  24811. // "orderBy": {
  24812. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  24813. // "location": "query",
  24814. // "type": "string"
  24815. // },
  24816. // "pageToken": {
  24817. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  24818. // "location": "query",
  24819. // "type": "string"
  24820. // },
  24821. // "project": {
  24822. // "description": "Project ID for this request.",
  24823. // "location": "path",
  24824. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  24825. // "required": true,
  24826. // "type": "string"
  24827. // }
  24828. // },
  24829. // "path": "{project}/global/httpsHealthChecks",
  24830. // "response": {
  24831. // "$ref": "HttpsHealthCheckList"
  24832. // },
  24833. // "scopes": [
  24834. // "https://www.googleapis.com/auth/cloud-platform",
  24835. // "https://www.googleapis.com/auth/compute",
  24836. // "https://www.googleapis.com/auth/compute.readonly"
  24837. // ]
  24838. // }
  24839. }
  24840. // Pages invokes f for each page of results.
  24841. // A non-nil error returned from f will halt the iteration.
  24842. // The provided context supersedes any context provided to the Context method.
  24843. func (c *HttpsHealthChecksListCall) Pages(ctx context.Context, f func(*HttpsHealthCheckList) error) error {
  24844. c.ctx_ = ctx
  24845. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  24846. for {
  24847. x, err := c.Do()
  24848. if err != nil {
  24849. return err
  24850. }
  24851. if err := f(x); err != nil {
  24852. return err
  24853. }
  24854. if x.NextPageToken == "" {
  24855. return nil
  24856. }
  24857. c.PageToken(x.NextPageToken)
  24858. }
  24859. }
  24860. // method id "compute.httpsHealthChecks.patch":
  24861. type HttpsHealthChecksPatchCall struct {
  24862. s *Service
  24863. project string
  24864. httpsHealthCheck string
  24865. httpshealthcheck *HttpsHealthCheck
  24866. urlParams_ gensupport.URLParams
  24867. ctx_ context.Context
  24868. header_ http.Header
  24869. }
  24870. // Patch: Updates a HttpsHealthCheck resource in the specified project
  24871. // using the data included in the request. This method supports patch
  24872. // semantics.
  24873. func (r *HttpsHealthChecksService) Patch(project string, httpsHealthCheck string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksPatchCall {
  24874. c := &HttpsHealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24875. c.project = project
  24876. c.httpsHealthCheck = httpsHealthCheck
  24877. c.httpshealthcheck = httpshealthcheck
  24878. return c
  24879. }
  24880. // Fields allows partial responses to be retrieved. See
  24881. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24882. // for more information.
  24883. func (c *HttpsHealthChecksPatchCall) Fields(s ...googleapi.Field) *HttpsHealthChecksPatchCall {
  24884. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24885. return c
  24886. }
  24887. // Context sets the context to be used in this call's Do method. Any
  24888. // pending HTTP request will be aborted if the provided context is
  24889. // canceled.
  24890. func (c *HttpsHealthChecksPatchCall) Context(ctx context.Context) *HttpsHealthChecksPatchCall {
  24891. c.ctx_ = ctx
  24892. return c
  24893. }
  24894. // Header returns an http.Header that can be modified by the caller to
  24895. // add HTTP headers to the request.
  24896. func (c *HttpsHealthChecksPatchCall) Header() http.Header {
  24897. if c.header_ == nil {
  24898. c.header_ = make(http.Header)
  24899. }
  24900. return c.header_
  24901. }
  24902. func (c *HttpsHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
  24903. reqHeaders := make(http.Header)
  24904. for k, v := range c.header_ {
  24905. reqHeaders[k] = v
  24906. }
  24907. reqHeaders.Set("User-Agent", c.s.userAgent())
  24908. var body io.Reader = nil
  24909. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck)
  24910. if err != nil {
  24911. return nil, err
  24912. }
  24913. reqHeaders.Set("Content-Type", "application/json")
  24914. c.urlParams_.Set("alt", alt)
  24915. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  24916. urls += "?" + c.urlParams_.Encode()
  24917. req, _ := http.NewRequest("PATCH", urls, body)
  24918. req.Header = reqHeaders
  24919. googleapi.Expand(req.URL, map[string]string{
  24920. "project": c.project,
  24921. "httpsHealthCheck": c.httpsHealthCheck,
  24922. })
  24923. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24924. }
  24925. // Do executes the "compute.httpsHealthChecks.patch" call.
  24926. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  24927. // status code is an error. Response headers are in either
  24928. // *Operation.ServerResponse.Header or (if a response was returned at
  24929. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  24930. // to check whether the returned error was because
  24931. // http.StatusNotModified was returned.
  24932. func (c *HttpsHealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  24933. gensupport.SetOptions(c.urlParams_, opts...)
  24934. res, err := c.doRequest("json")
  24935. if res != nil && res.StatusCode == http.StatusNotModified {
  24936. if res.Body != nil {
  24937. res.Body.Close()
  24938. }
  24939. return nil, &googleapi.Error{
  24940. Code: res.StatusCode,
  24941. Header: res.Header,
  24942. }
  24943. }
  24944. if err != nil {
  24945. return nil, err
  24946. }
  24947. defer googleapi.CloseBody(res)
  24948. if err := googleapi.CheckResponse(res); err != nil {
  24949. return nil, err
  24950. }
  24951. ret := &Operation{
  24952. ServerResponse: googleapi.ServerResponse{
  24953. Header: res.Header,
  24954. HTTPStatusCode: res.StatusCode,
  24955. },
  24956. }
  24957. target := &ret
  24958. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  24959. return nil, err
  24960. }
  24961. return ret, nil
  24962. // {
  24963. // "description": "Updates a HttpsHealthCheck resource in the specified project using the data included in the request. This method supports patch semantics.",
  24964. // "httpMethod": "PATCH",
  24965. // "id": "compute.httpsHealthChecks.patch",
  24966. // "parameterOrder": [
  24967. // "project",
  24968. // "httpsHealthCheck"
  24969. // ],
  24970. // "parameters": {
  24971. // "httpsHealthCheck": {
  24972. // "description": "Name of the HttpsHealthCheck resource to patch.",
  24973. // "location": "path",
  24974. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  24975. // "required": true,
  24976. // "type": "string"
  24977. // },
  24978. // "project": {
  24979. // "description": "Project ID for this request.",
  24980. // "location": "path",
  24981. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  24982. // "required": true,
  24983. // "type": "string"
  24984. // }
  24985. // },
  24986. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  24987. // "request": {
  24988. // "$ref": "HttpsHealthCheck"
  24989. // },
  24990. // "response": {
  24991. // "$ref": "Operation"
  24992. // },
  24993. // "scopes": [
  24994. // "https://www.googleapis.com/auth/cloud-platform",
  24995. // "https://www.googleapis.com/auth/compute",
  24996. // "https://www.googleapis.com/auth/compute.readonly"
  24997. // ]
  24998. // }
  24999. }
  25000. // method id "compute.httpsHealthChecks.update":
  25001. type HttpsHealthChecksUpdateCall struct {
  25002. s *Service
  25003. project string
  25004. httpsHealthCheck string
  25005. httpshealthcheck *HttpsHealthCheck
  25006. urlParams_ gensupport.URLParams
  25007. ctx_ context.Context
  25008. header_ http.Header
  25009. }
  25010. // Update: Updates a HttpsHealthCheck resource in the specified project
  25011. // using the data included in the request.
  25012. func (r *HttpsHealthChecksService) Update(project string, httpsHealthCheck string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksUpdateCall {
  25013. c := &HttpsHealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25014. c.project = project
  25015. c.httpsHealthCheck = httpsHealthCheck
  25016. c.httpshealthcheck = httpshealthcheck
  25017. return c
  25018. }
  25019. // Fields allows partial responses to be retrieved. See
  25020. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25021. // for more information.
  25022. func (c *HttpsHealthChecksUpdateCall) Fields(s ...googleapi.Field) *HttpsHealthChecksUpdateCall {
  25023. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25024. return c
  25025. }
  25026. // Context sets the context to be used in this call's Do method. Any
  25027. // pending HTTP request will be aborted if the provided context is
  25028. // canceled.
  25029. func (c *HttpsHealthChecksUpdateCall) Context(ctx context.Context) *HttpsHealthChecksUpdateCall {
  25030. c.ctx_ = ctx
  25031. return c
  25032. }
  25033. // Header returns an http.Header that can be modified by the caller to
  25034. // add HTTP headers to the request.
  25035. func (c *HttpsHealthChecksUpdateCall) Header() http.Header {
  25036. if c.header_ == nil {
  25037. c.header_ = make(http.Header)
  25038. }
  25039. return c.header_
  25040. }
  25041. func (c *HttpsHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
  25042. reqHeaders := make(http.Header)
  25043. for k, v := range c.header_ {
  25044. reqHeaders[k] = v
  25045. }
  25046. reqHeaders.Set("User-Agent", c.s.userAgent())
  25047. var body io.Reader = nil
  25048. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck)
  25049. if err != nil {
  25050. return nil, err
  25051. }
  25052. reqHeaders.Set("Content-Type", "application/json")
  25053. c.urlParams_.Set("alt", alt)
  25054. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  25055. urls += "?" + c.urlParams_.Encode()
  25056. req, _ := http.NewRequest("PUT", urls, body)
  25057. req.Header = reqHeaders
  25058. googleapi.Expand(req.URL, map[string]string{
  25059. "project": c.project,
  25060. "httpsHealthCheck": c.httpsHealthCheck,
  25061. })
  25062. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25063. }
  25064. // Do executes the "compute.httpsHealthChecks.update" call.
  25065. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  25066. // status code is an error. Response headers are in either
  25067. // *Operation.ServerResponse.Header or (if a response was returned at
  25068. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  25069. // to check whether the returned error was because
  25070. // http.StatusNotModified was returned.
  25071. func (c *HttpsHealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  25072. gensupport.SetOptions(c.urlParams_, opts...)
  25073. res, err := c.doRequest("json")
  25074. if res != nil && res.StatusCode == http.StatusNotModified {
  25075. if res.Body != nil {
  25076. res.Body.Close()
  25077. }
  25078. return nil, &googleapi.Error{
  25079. Code: res.StatusCode,
  25080. Header: res.Header,
  25081. }
  25082. }
  25083. if err != nil {
  25084. return nil, err
  25085. }
  25086. defer googleapi.CloseBody(res)
  25087. if err := googleapi.CheckResponse(res); err != nil {
  25088. return nil, err
  25089. }
  25090. ret := &Operation{
  25091. ServerResponse: googleapi.ServerResponse{
  25092. Header: res.Header,
  25093. HTTPStatusCode: res.StatusCode,
  25094. },
  25095. }
  25096. target := &ret
  25097. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  25098. return nil, err
  25099. }
  25100. return ret, nil
  25101. // {
  25102. // "description": "Updates a HttpsHealthCheck resource in the specified project using the data included in the request.",
  25103. // "httpMethod": "PUT",
  25104. // "id": "compute.httpsHealthChecks.update",
  25105. // "parameterOrder": [
  25106. // "project",
  25107. // "httpsHealthCheck"
  25108. // ],
  25109. // "parameters": {
  25110. // "httpsHealthCheck": {
  25111. // "description": "Name of the HttpsHealthCheck resource to update.",
  25112. // "location": "path",
  25113. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  25114. // "required": true,
  25115. // "type": "string"
  25116. // },
  25117. // "project": {
  25118. // "description": "Project ID for this request.",
  25119. // "location": "path",
  25120. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  25121. // "required": true,
  25122. // "type": "string"
  25123. // }
  25124. // },
  25125. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  25126. // "request": {
  25127. // "$ref": "HttpsHealthCheck"
  25128. // },
  25129. // "response": {
  25130. // "$ref": "Operation"
  25131. // },
  25132. // "scopes": [
  25133. // "https://www.googleapis.com/auth/cloud-platform",
  25134. // "https://www.googleapis.com/auth/compute"
  25135. // ]
  25136. // }
  25137. }
  25138. // method id "compute.images.delete":
  25139. type ImagesDeleteCall struct {
  25140. s *Service
  25141. project string
  25142. image string
  25143. urlParams_ gensupport.URLParams
  25144. ctx_ context.Context
  25145. header_ http.Header
  25146. }
  25147. // Delete: Deletes the specified image.
  25148. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/delete
  25149. func (r *ImagesService) Delete(project string, image string) *ImagesDeleteCall {
  25150. c := &ImagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25151. c.project = project
  25152. c.image = image
  25153. return c
  25154. }
  25155. // Fields allows partial responses to be retrieved. See
  25156. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25157. // for more information.
  25158. func (c *ImagesDeleteCall) Fields(s ...googleapi.Field) *ImagesDeleteCall {
  25159. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25160. return c
  25161. }
  25162. // Context sets the context to be used in this call's Do method. Any
  25163. // pending HTTP request will be aborted if the provided context is
  25164. // canceled.
  25165. func (c *ImagesDeleteCall) Context(ctx context.Context) *ImagesDeleteCall {
  25166. c.ctx_ = ctx
  25167. return c
  25168. }
  25169. // Header returns an http.Header that can be modified by the caller to
  25170. // add HTTP headers to the request.
  25171. func (c *ImagesDeleteCall) Header() http.Header {
  25172. if c.header_ == nil {
  25173. c.header_ = make(http.Header)
  25174. }
  25175. return c.header_
  25176. }
  25177. func (c *ImagesDeleteCall) doRequest(alt string) (*http.Response, error) {
  25178. reqHeaders := make(http.Header)
  25179. for k, v := range c.header_ {
  25180. reqHeaders[k] = v
  25181. }
  25182. reqHeaders.Set("User-Agent", c.s.userAgent())
  25183. var body io.Reader = nil
  25184. c.urlParams_.Set("alt", alt)
  25185. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}")
  25186. urls += "?" + c.urlParams_.Encode()
  25187. req, _ := http.NewRequest("DELETE", urls, body)
  25188. req.Header = reqHeaders
  25189. googleapi.Expand(req.URL, map[string]string{
  25190. "project": c.project,
  25191. "image": c.image,
  25192. })
  25193. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25194. }
  25195. // Do executes the "compute.images.delete" call.
  25196. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  25197. // status code is an error. Response headers are in either
  25198. // *Operation.ServerResponse.Header or (if a response was returned at
  25199. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  25200. // to check whether the returned error was because
  25201. // http.StatusNotModified was returned.
  25202. func (c *ImagesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  25203. gensupport.SetOptions(c.urlParams_, opts...)
  25204. res, err := c.doRequest("json")
  25205. if res != nil && res.StatusCode == http.StatusNotModified {
  25206. if res.Body != nil {
  25207. res.Body.Close()
  25208. }
  25209. return nil, &googleapi.Error{
  25210. Code: res.StatusCode,
  25211. Header: res.Header,
  25212. }
  25213. }
  25214. if err != nil {
  25215. return nil, err
  25216. }
  25217. defer googleapi.CloseBody(res)
  25218. if err := googleapi.CheckResponse(res); err != nil {
  25219. return nil, err
  25220. }
  25221. ret := &Operation{
  25222. ServerResponse: googleapi.ServerResponse{
  25223. Header: res.Header,
  25224. HTTPStatusCode: res.StatusCode,
  25225. },
  25226. }
  25227. target := &ret
  25228. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  25229. return nil, err
  25230. }
  25231. return ret, nil
  25232. // {
  25233. // "description": "Deletes the specified image.",
  25234. // "httpMethod": "DELETE",
  25235. // "id": "compute.images.delete",
  25236. // "parameterOrder": [
  25237. // "project",
  25238. // "image"
  25239. // ],
  25240. // "parameters": {
  25241. // "image": {
  25242. // "description": "Name of the image resource to delete.",
  25243. // "location": "path",
  25244. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  25245. // "required": true,
  25246. // "type": "string"
  25247. // },
  25248. // "project": {
  25249. // "description": "Project ID for this request.",
  25250. // "location": "path",
  25251. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  25252. // "required": true,
  25253. // "type": "string"
  25254. // }
  25255. // },
  25256. // "path": "{project}/global/images/{image}",
  25257. // "response": {
  25258. // "$ref": "Operation"
  25259. // },
  25260. // "scopes": [
  25261. // "https://www.googleapis.com/auth/cloud-platform",
  25262. // "https://www.googleapis.com/auth/compute"
  25263. // ]
  25264. // }
  25265. }
  25266. // method id "compute.images.deprecate":
  25267. type ImagesDeprecateCall struct {
  25268. s *Service
  25269. project string
  25270. image string
  25271. deprecationstatus *DeprecationStatus
  25272. urlParams_ gensupport.URLParams
  25273. ctx_ context.Context
  25274. header_ http.Header
  25275. }
  25276. // Deprecate: Sets the deprecation status of an image.
  25277. //
  25278. // If an empty request body is given, clears the deprecation status
  25279. // instead.
  25280. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/deprecate
  25281. func (r *ImagesService) Deprecate(project string, image string, deprecationstatus *DeprecationStatus) *ImagesDeprecateCall {
  25282. c := &ImagesDeprecateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25283. c.project = project
  25284. c.image = image
  25285. c.deprecationstatus = deprecationstatus
  25286. return c
  25287. }
  25288. // Fields allows partial responses to be retrieved. See
  25289. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25290. // for more information.
  25291. func (c *ImagesDeprecateCall) Fields(s ...googleapi.Field) *ImagesDeprecateCall {
  25292. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25293. return c
  25294. }
  25295. // Context sets the context to be used in this call's Do method. Any
  25296. // pending HTTP request will be aborted if the provided context is
  25297. // canceled.
  25298. func (c *ImagesDeprecateCall) Context(ctx context.Context) *ImagesDeprecateCall {
  25299. c.ctx_ = ctx
  25300. return c
  25301. }
  25302. // Header returns an http.Header that can be modified by the caller to
  25303. // add HTTP headers to the request.
  25304. func (c *ImagesDeprecateCall) Header() http.Header {
  25305. if c.header_ == nil {
  25306. c.header_ = make(http.Header)
  25307. }
  25308. return c.header_
  25309. }
  25310. func (c *ImagesDeprecateCall) doRequest(alt string) (*http.Response, error) {
  25311. reqHeaders := make(http.Header)
  25312. for k, v := range c.header_ {
  25313. reqHeaders[k] = v
  25314. }
  25315. reqHeaders.Set("User-Agent", c.s.userAgent())
  25316. var body io.Reader = nil
  25317. body, err := googleapi.WithoutDataWrapper.JSONReader(c.deprecationstatus)
  25318. if err != nil {
  25319. return nil, err
  25320. }
  25321. reqHeaders.Set("Content-Type", "application/json")
  25322. c.urlParams_.Set("alt", alt)
  25323. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}/deprecate")
  25324. urls += "?" + c.urlParams_.Encode()
  25325. req, _ := http.NewRequest("POST", urls, body)
  25326. req.Header = reqHeaders
  25327. googleapi.Expand(req.URL, map[string]string{
  25328. "project": c.project,
  25329. "image": c.image,
  25330. })
  25331. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25332. }
  25333. // Do executes the "compute.images.deprecate" call.
  25334. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  25335. // status code is an error. Response headers are in either
  25336. // *Operation.ServerResponse.Header or (if a response was returned at
  25337. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  25338. // to check whether the returned error was because
  25339. // http.StatusNotModified was returned.
  25340. func (c *ImagesDeprecateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  25341. gensupport.SetOptions(c.urlParams_, opts...)
  25342. res, err := c.doRequest("json")
  25343. if res != nil && res.StatusCode == http.StatusNotModified {
  25344. if res.Body != nil {
  25345. res.Body.Close()
  25346. }
  25347. return nil, &googleapi.Error{
  25348. Code: res.StatusCode,
  25349. Header: res.Header,
  25350. }
  25351. }
  25352. if err != nil {
  25353. return nil, err
  25354. }
  25355. defer googleapi.CloseBody(res)
  25356. if err := googleapi.CheckResponse(res); err != nil {
  25357. return nil, err
  25358. }
  25359. ret := &Operation{
  25360. ServerResponse: googleapi.ServerResponse{
  25361. Header: res.Header,
  25362. HTTPStatusCode: res.StatusCode,
  25363. },
  25364. }
  25365. target := &ret
  25366. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  25367. return nil, err
  25368. }
  25369. return ret, nil
  25370. // {
  25371. // "description": "Sets the deprecation status of an image.\n\nIf an empty request body is given, clears the deprecation status instead.",
  25372. // "httpMethod": "POST",
  25373. // "id": "compute.images.deprecate",
  25374. // "parameterOrder": [
  25375. // "project",
  25376. // "image"
  25377. // ],
  25378. // "parameters": {
  25379. // "image": {
  25380. // "description": "Image name.",
  25381. // "location": "path",
  25382. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  25383. // "required": true,
  25384. // "type": "string"
  25385. // },
  25386. // "project": {
  25387. // "description": "Project ID for this request.",
  25388. // "location": "path",
  25389. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  25390. // "required": true,
  25391. // "type": "string"
  25392. // }
  25393. // },
  25394. // "path": "{project}/global/images/{image}/deprecate",
  25395. // "request": {
  25396. // "$ref": "DeprecationStatus"
  25397. // },
  25398. // "response": {
  25399. // "$ref": "Operation"
  25400. // },
  25401. // "scopes": [
  25402. // "https://www.googleapis.com/auth/cloud-platform",
  25403. // "https://www.googleapis.com/auth/compute"
  25404. // ]
  25405. // }
  25406. }
  25407. // method id "compute.images.get":
  25408. type ImagesGetCall struct {
  25409. s *Service
  25410. project string
  25411. image string
  25412. urlParams_ gensupport.URLParams
  25413. ifNoneMatch_ string
  25414. ctx_ context.Context
  25415. header_ http.Header
  25416. }
  25417. // Get: Returns the specified image. Get a list of available images by
  25418. // making a list() request.
  25419. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/get
  25420. func (r *ImagesService) Get(project string, image string) *ImagesGetCall {
  25421. c := &ImagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25422. c.project = project
  25423. c.image = image
  25424. return c
  25425. }
  25426. // Fields allows partial responses to be retrieved. See
  25427. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25428. // for more information.
  25429. func (c *ImagesGetCall) Fields(s ...googleapi.Field) *ImagesGetCall {
  25430. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25431. return c
  25432. }
  25433. // IfNoneMatch sets the optional parameter which makes the operation
  25434. // fail if the object's ETag matches the given value. This is useful for
  25435. // getting updates only after the object has changed since the last
  25436. // request. Use googleapi.IsNotModified to check whether the response
  25437. // error from Do is the result of In-None-Match.
  25438. func (c *ImagesGetCall) IfNoneMatch(entityTag string) *ImagesGetCall {
  25439. c.ifNoneMatch_ = entityTag
  25440. return c
  25441. }
  25442. // Context sets the context to be used in this call's Do method. Any
  25443. // pending HTTP request will be aborted if the provided context is
  25444. // canceled.
  25445. func (c *ImagesGetCall) Context(ctx context.Context) *ImagesGetCall {
  25446. c.ctx_ = ctx
  25447. return c
  25448. }
  25449. // Header returns an http.Header that can be modified by the caller to
  25450. // add HTTP headers to the request.
  25451. func (c *ImagesGetCall) Header() http.Header {
  25452. if c.header_ == nil {
  25453. c.header_ = make(http.Header)
  25454. }
  25455. return c.header_
  25456. }
  25457. func (c *ImagesGetCall) doRequest(alt string) (*http.Response, error) {
  25458. reqHeaders := make(http.Header)
  25459. for k, v := range c.header_ {
  25460. reqHeaders[k] = v
  25461. }
  25462. reqHeaders.Set("User-Agent", c.s.userAgent())
  25463. if c.ifNoneMatch_ != "" {
  25464. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  25465. }
  25466. var body io.Reader = nil
  25467. c.urlParams_.Set("alt", alt)
  25468. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}")
  25469. urls += "?" + c.urlParams_.Encode()
  25470. req, _ := http.NewRequest("GET", urls, body)
  25471. req.Header = reqHeaders
  25472. googleapi.Expand(req.URL, map[string]string{
  25473. "project": c.project,
  25474. "image": c.image,
  25475. })
  25476. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25477. }
  25478. // Do executes the "compute.images.get" call.
  25479. // Exactly one of *Image or error will be non-nil. Any non-2xx status
  25480. // code is an error. Response headers are in either
  25481. // *Image.ServerResponse.Header or (if a response was returned at all)
  25482. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  25483. // check whether the returned error was because http.StatusNotModified
  25484. // was returned.
  25485. func (c *ImagesGetCall) Do(opts ...googleapi.CallOption) (*Image, error) {
  25486. gensupport.SetOptions(c.urlParams_, opts...)
  25487. res, err := c.doRequest("json")
  25488. if res != nil && res.StatusCode == http.StatusNotModified {
  25489. if res.Body != nil {
  25490. res.Body.Close()
  25491. }
  25492. return nil, &googleapi.Error{
  25493. Code: res.StatusCode,
  25494. Header: res.Header,
  25495. }
  25496. }
  25497. if err != nil {
  25498. return nil, err
  25499. }
  25500. defer googleapi.CloseBody(res)
  25501. if err := googleapi.CheckResponse(res); err != nil {
  25502. return nil, err
  25503. }
  25504. ret := &Image{
  25505. ServerResponse: googleapi.ServerResponse{
  25506. Header: res.Header,
  25507. HTTPStatusCode: res.StatusCode,
  25508. },
  25509. }
  25510. target := &ret
  25511. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  25512. return nil, err
  25513. }
  25514. return ret, nil
  25515. // {
  25516. // "description": "Returns the specified image. Get a list of available images by making a list() request.",
  25517. // "httpMethod": "GET",
  25518. // "id": "compute.images.get",
  25519. // "parameterOrder": [
  25520. // "project",
  25521. // "image"
  25522. // ],
  25523. // "parameters": {
  25524. // "image": {
  25525. // "description": "Name of the image resource to return.",
  25526. // "location": "path",
  25527. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  25528. // "required": true,
  25529. // "type": "string"
  25530. // },
  25531. // "project": {
  25532. // "description": "Project ID for this request.",
  25533. // "location": "path",
  25534. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  25535. // "required": true,
  25536. // "type": "string"
  25537. // }
  25538. // },
  25539. // "path": "{project}/global/images/{image}",
  25540. // "response": {
  25541. // "$ref": "Image"
  25542. // },
  25543. // "scopes": [
  25544. // "https://www.googleapis.com/auth/cloud-platform",
  25545. // "https://www.googleapis.com/auth/compute",
  25546. // "https://www.googleapis.com/auth/compute.readonly"
  25547. // ]
  25548. // }
  25549. }
  25550. // method id "compute.images.getFromFamily":
  25551. type ImagesGetFromFamilyCall struct {
  25552. s *Service
  25553. project string
  25554. family string
  25555. urlParams_ gensupport.URLParams
  25556. ifNoneMatch_ string
  25557. ctx_ context.Context
  25558. header_ http.Header
  25559. }
  25560. // GetFromFamily: Returns the latest image that is part of an image
  25561. // family and is not deprecated.
  25562. func (r *ImagesService) GetFromFamily(project string, family string) *ImagesGetFromFamilyCall {
  25563. c := &ImagesGetFromFamilyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25564. c.project = project
  25565. c.family = family
  25566. return c
  25567. }
  25568. // Fields allows partial responses to be retrieved. See
  25569. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25570. // for more information.
  25571. func (c *ImagesGetFromFamilyCall) Fields(s ...googleapi.Field) *ImagesGetFromFamilyCall {
  25572. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25573. return c
  25574. }
  25575. // IfNoneMatch sets the optional parameter which makes the operation
  25576. // fail if the object's ETag matches the given value. This is useful for
  25577. // getting updates only after the object has changed since the last
  25578. // request. Use googleapi.IsNotModified to check whether the response
  25579. // error from Do is the result of In-None-Match.
  25580. func (c *ImagesGetFromFamilyCall) IfNoneMatch(entityTag string) *ImagesGetFromFamilyCall {
  25581. c.ifNoneMatch_ = entityTag
  25582. return c
  25583. }
  25584. // Context sets the context to be used in this call's Do method. Any
  25585. // pending HTTP request will be aborted if the provided context is
  25586. // canceled.
  25587. func (c *ImagesGetFromFamilyCall) Context(ctx context.Context) *ImagesGetFromFamilyCall {
  25588. c.ctx_ = ctx
  25589. return c
  25590. }
  25591. // Header returns an http.Header that can be modified by the caller to
  25592. // add HTTP headers to the request.
  25593. func (c *ImagesGetFromFamilyCall) Header() http.Header {
  25594. if c.header_ == nil {
  25595. c.header_ = make(http.Header)
  25596. }
  25597. return c.header_
  25598. }
  25599. func (c *ImagesGetFromFamilyCall) doRequest(alt string) (*http.Response, error) {
  25600. reqHeaders := make(http.Header)
  25601. for k, v := range c.header_ {
  25602. reqHeaders[k] = v
  25603. }
  25604. reqHeaders.Set("User-Agent", c.s.userAgent())
  25605. if c.ifNoneMatch_ != "" {
  25606. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  25607. }
  25608. var body io.Reader = nil
  25609. c.urlParams_.Set("alt", alt)
  25610. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/family/{family}")
  25611. urls += "?" + c.urlParams_.Encode()
  25612. req, _ := http.NewRequest("GET", urls, body)
  25613. req.Header = reqHeaders
  25614. googleapi.Expand(req.URL, map[string]string{
  25615. "project": c.project,
  25616. "family": c.family,
  25617. })
  25618. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25619. }
  25620. // Do executes the "compute.images.getFromFamily" call.
  25621. // Exactly one of *Image or error will be non-nil. Any non-2xx status
  25622. // code is an error. Response headers are in either
  25623. // *Image.ServerResponse.Header or (if a response was returned at all)
  25624. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  25625. // check whether the returned error was because http.StatusNotModified
  25626. // was returned.
  25627. func (c *ImagesGetFromFamilyCall) Do(opts ...googleapi.CallOption) (*Image, error) {
  25628. gensupport.SetOptions(c.urlParams_, opts...)
  25629. res, err := c.doRequest("json")
  25630. if res != nil && res.StatusCode == http.StatusNotModified {
  25631. if res.Body != nil {
  25632. res.Body.Close()
  25633. }
  25634. return nil, &googleapi.Error{
  25635. Code: res.StatusCode,
  25636. Header: res.Header,
  25637. }
  25638. }
  25639. if err != nil {
  25640. return nil, err
  25641. }
  25642. defer googleapi.CloseBody(res)
  25643. if err := googleapi.CheckResponse(res); err != nil {
  25644. return nil, err
  25645. }
  25646. ret := &Image{
  25647. ServerResponse: googleapi.ServerResponse{
  25648. Header: res.Header,
  25649. HTTPStatusCode: res.StatusCode,
  25650. },
  25651. }
  25652. target := &ret
  25653. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  25654. return nil, err
  25655. }
  25656. return ret, nil
  25657. // {
  25658. // "description": "Returns the latest image that is part of an image family and is not deprecated.",
  25659. // "httpMethod": "GET",
  25660. // "id": "compute.images.getFromFamily",
  25661. // "parameterOrder": [
  25662. // "project",
  25663. // "family"
  25664. // ],
  25665. // "parameters": {
  25666. // "family": {
  25667. // "description": "Name of the image family to search for.",
  25668. // "location": "path",
  25669. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  25670. // "required": true,
  25671. // "type": "string"
  25672. // },
  25673. // "project": {
  25674. // "description": "Project ID for this request.",
  25675. // "location": "path",
  25676. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  25677. // "required": true,
  25678. // "type": "string"
  25679. // }
  25680. // },
  25681. // "path": "{project}/global/images/family/{family}",
  25682. // "response": {
  25683. // "$ref": "Image"
  25684. // },
  25685. // "scopes": [
  25686. // "https://www.googleapis.com/auth/cloud-platform",
  25687. // "https://www.googleapis.com/auth/compute",
  25688. // "https://www.googleapis.com/auth/compute.readonly"
  25689. // ]
  25690. // }
  25691. }
  25692. // method id "compute.images.insert":
  25693. type ImagesInsertCall struct {
  25694. s *Service
  25695. project string
  25696. image *Image
  25697. urlParams_ gensupport.URLParams
  25698. ctx_ context.Context
  25699. header_ http.Header
  25700. }
  25701. // Insert: Creates an image in the specified project using the data
  25702. // included in the request.
  25703. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/insert
  25704. func (r *ImagesService) Insert(project string, image *Image) *ImagesInsertCall {
  25705. c := &ImagesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25706. c.project = project
  25707. c.image = image
  25708. return c
  25709. }
  25710. // Fields allows partial responses to be retrieved. See
  25711. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25712. // for more information.
  25713. func (c *ImagesInsertCall) Fields(s ...googleapi.Field) *ImagesInsertCall {
  25714. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25715. return c
  25716. }
  25717. // Context sets the context to be used in this call's Do method. Any
  25718. // pending HTTP request will be aborted if the provided context is
  25719. // canceled.
  25720. func (c *ImagesInsertCall) Context(ctx context.Context) *ImagesInsertCall {
  25721. c.ctx_ = ctx
  25722. return c
  25723. }
  25724. // Header returns an http.Header that can be modified by the caller to
  25725. // add HTTP headers to the request.
  25726. func (c *ImagesInsertCall) Header() http.Header {
  25727. if c.header_ == nil {
  25728. c.header_ = make(http.Header)
  25729. }
  25730. return c.header_
  25731. }
  25732. func (c *ImagesInsertCall) doRequest(alt string) (*http.Response, error) {
  25733. reqHeaders := make(http.Header)
  25734. for k, v := range c.header_ {
  25735. reqHeaders[k] = v
  25736. }
  25737. reqHeaders.Set("User-Agent", c.s.userAgent())
  25738. var body io.Reader = nil
  25739. body, err := googleapi.WithoutDataWrapper.JSONReader(c.image)
  25740. if err != nil {
  25741. return nil, err
  25742. }
  25743. reqHeaders.Set("Content-Type", "application/json")
  25744. c.urlParams_.Set("alt", alt)
  25745. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images")
  25746. urls += "?" + c.urlParams_.Encode()
  25747. req, _ := http.NewRequest("POST", urls, body)
  25748. req.Header = reqHeaders
  25749. googleapi.Expand(req.URL, map[string]string{
  25750. "project": c.project,
  25751. })
  25752. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25753. }
  25754. // Do executes the "compute.images.insert" call.
  25755. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  25756. // status code is an error. Response headers are in either
  25757. // *Operation.ServerResponse.Header or (if a response was returned at
  25758. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  25759. // to check whether the returned error was because
  25760. // http.StatusNotModified was returned.
  25761. func (c *ImagesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  25762. gensupport.SetOptions(c.urlParams_, opts...)
  25763. res, err := c.doRequest("json")
  25764. if res != nil && res.StatusCode == http.StatusNotModified {
  25765. if res.Body != nil {
  25766. res.Body.Close()
  25767. }
  25768. return nil, &googleapi.Error{
  25769. Code: res.StatusCode,
  25770. Header: res.Header,
  25771. }
  25772. }
  25773. if err != nil {
  25774. return nil, err
  25775. }
  25776. defer googleapi.CloseBody(res)
  25777. if err := googleapi.CheckResponse(res); err != nil {
  25778. return nil, err
  25779. }
  25780. ret := &Operation{
  25781. ServerResponse: googleapi.ServerResponse{
  25782. Header: res.Header,
  25783. HTTPStatusCode: res.StatusCode,
  25784. },
  25785. }
  25786. target := &ret
  25787. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  25788. return nil, err
  25789. }
  25790. return ret, nil
  25791. // {
  25792. // "description": "Creates an image in the specified project using the data included in the request.",
  25793. // "httpMethod": "POST",
  25794. // "id": "compute.images.insert",
  25795. // "parameterOrder": [
  25796. // "project"
  25797. // ],
  25798. // "parameters": {
  25799. // "project": {
  25800. // "description": "Project ID for this request.",
  25801. // "location": "path",
  25802. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  25803. // "required": true,
  25804. // "type": "string"
  25805. // }
  25806. // },
  25807. // "path": "{project}/global/images",
  25808. // "request": {
  25809. // "$ref": "Image"
  25810. // },
  25811. // "response": {
  25812. // "$ref": "Operation"
  25813. // },
  25814. // "scopes": [
  25815. // "https://www.googleapis.com/auth/cloud-platform",
  25816. // "https://www.googleapis.com/auth/compute",
  25817. // "https://www.googleapis.com/auth/devstorage.full_control",
  25818. // "https://www.googleapis.com/auth/devstorage.read_only",
  25819. // "https://www.googleapis.com/auth/devstorage.read_write"
  25820. // ]
  25821. // }
  25822. }
  25823. // method id "compute.images.list":
  25824. type ImagesListCall struct {
  25825. s *Service
  25826. project string
  25827. urlParams_ gensupport.URLParams
  25828. ifNoneMatch_ string
  25829. ctx_ context.Context
  25830. header_ http.Header
  25831. }
  25832. // List: Retrieves the list of private images available to the specified
  25833. // project. Private images are images you create that belong to your
  25834. // project. This method does not get any images that belong to other
  25835. // projects, including publicly-available images, like Debian 8. If you
  25836. // want to get a list of publicly-available images, use this method to
  25837. // make a request to the respective image project, such as debian-cloud
  25838. // or windows-cloud.
  25839. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/list
  25840. func (r *ImagesService) List(project string) *ImagesListCall {
  25841. c := &ImagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25842. c.project = project
  25843. return c
  25844. }
  25845. // Filter sets the optional parameter "filter": Sets a filter
  25846. // {expression} for filtering listed resources. Your {expression} must
  25847. // be in the format: field_name comparison_string literal_string.
  25848. //
  25849. // The field_name is the name of the field you want to compare. Only
  25850. // atomic field types are supported (string, number, boolean). The
  25851. // comparison_string must be either eq (equals) or ne (not equals). The
  25852. // literal_string is the string value to filter to. The literal value
  25853. // must be valid for the type of field you are filtering by (string,
  25854. // number, boolean). For string fields, the literal value is interpreted
  25855. // as a regular expression using RE2 syntax. The literal value must
  25856. // match the entire field.
  25857. //
  25858. // For example, to filter for instances that do not have a name of
  25859. // example-instance, you would use name ne example-instance.
  25860. //
  25861. // You can filter on nested fields. For example, you could filter on
  25862. // instances that have set the scheduling.automaticRestart field to
  25863. // true. Use filtering on nested fields to take advantage of labels to
  25864. // organize and search for results based on label values.
  25865. //
  25866. // To filter on multiple expressions, provide each separate expression
  25867. // within parentheses. For example, (scheduling.automaticRestart eq
  25868. // true) (zone eq us-central1-f). Multiple expressions are treated as
  25869. // AND expressions, meaning that resources must match all expressions to
  25870. // pass the filters.
  25871. func (c *ImagesListCall) Filter(filter string) *ImagesListCall {
  25872. c.urlParams_.Set("filter", filter)
  25873. return c
  25874. }
  25875. // MaxResults sets the optional parameter "maxResults": The maximum
  25876. // number of results per page that should be returned. If the number of
  25877. // available results is larger than maxResults, Compute Engine returns a
  25878. // nextPageToken that can be used to get the next page of results in
  25879. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  25880. // (Default: 500)
  25881. func (c *ImagesListCall) MaxResults(maxResults int64) *ImagesListCall {
  25882. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  25883. return c
  25884. }
  25885. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  25886. // a certain order. By default, results are returned in alphanumerical
  25887. // order based on the resource name.
  25888. //
  25889. // You can also sort results in descending order based on the creation
  25890. // timestamp using orderBy="creationTimestamp desc". This sorts results
  25891. // based on the creationTimestamp field in reverse chronological order
  25892. // (newest result first). Use this to sort resources like operations so
  25893. // that the newest operation is returned first.
  25894. //
  25895. // Currently, only sorting by name or creationTimestamp desc is
  25896. // supported.
  25897. func (c *ImagesListCall) OrderBy(orderBy string) *ImagesListCall {
  25898. c.urlParams_.Set("orderBy", orderBy)
  25899. return c
  25900. }
  25901. // PageToken sets the optional parameter "pageToken": Specifies a page
  25902. // token to use. Set pageToken to the nextPageToken returned by a
  25903. // previous list request to get the next page of results.
  25904. func (c *ImagesListCall) PageToken(pageToken string) *ImagesListCall {
  25905. c.urlParams_.Set("pageToken", pageToken)
  25906. return c
  25907. }
  25908. // Fields allows partial responses to be retrieved. See
  25909. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25910. // for more information.
  25911. func (c *ImagesListCall) Fields(s ...googleapi.Field) *ImagesListCall {
  25912. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25913. return c
  25914. }
  25915. // IfNoneMatch sets the optional parameter which makes the operation
  25916. // fail if the object's ETag matches the given value. This is useful for
  25917. // getting updates only after the object has changed since the last
  25918. // request. Use googleapi.IsNotModified to check whether the response
  25919. // error from Do is the result of In-None-Match.
  25920. func (c *ImagesListCall) IfNoneMatch(entityTag string) *ImagesListCall {
  25921. c.ifNoneMatch_ = entityTag
  25922. return c
  25923. }
  25924. // Context sets the context to be used in this call's Do method. Any
  25925. // pending HTTP request will be aborted if the provided context is
  25926. // canceled.
  25927. func (c *ImagesListCall) Context(ctx context.Context) *ImagesListCall {
  25928. c.ctx_ = ctx
  25929. return c
  25930. }
  25931. // Header returns an http.Header that can be modified by the caller to
  25932. // add HTTP headers to the request.
  25933. func (c *ImagesListCall) Header() http.Header {
  25934. if c.header_ == nil {
  25935. c.header_ = make(http.Header)
  25936. }
  25937. return c.header_
  25938. }
  25939. func (c *ImagesListCall) doRequest(alt string) (*http.Response, error) {
  25940. reqHeaders := make(http.Header)
  25941. for k, v := range c.header_ {
  25942. reqHeaders[k] = v
  25943. }
  25944. reqHeaders.Set("User-Agent", c.s.userAgent())
  25945. if c.ifNoneMatch_ != "" {
  25946. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  25947. }
  25948. var body io.Reader = nil
  25949. c.urlParams_.Set("alt", alt)
  25950. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images")
  25951. urls += "?" + c.urlParams_.Encode()
  25952. req, _ := http.NewRequest("GET", urls, body)
  25953. req.Header = reqHeaders
  25954. googleapi.Expand(req.URL, map[string]string{
  25955. "project": c.project,
  25956. })
  25957. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25958. }
  25959. // Do executes the "compute.images.list" call.
  25960. // Exactly one of *ImageList or error will be non-nil. Any non-2xx
  25961. // status code is an error. Response headers are in either
  25962. // *ImageList.ServerResponse.Header or (if a response was returned at
  25963. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  25964. // to check whether the returned error was because
  25965. // http.StatusNotModified was returned.
  25966. func (c *ImagesListCall) Do(opts ...googleapi.CallOption) (*ImageList, error) {
  25967. gensupport.SetOptions(c.urlParams_, opts...)
  25968. res, err := c.doRequest("json")
  25969. if res != nil && res.StatusCode == http.StatusNotModified {
  25970. if res.Body != nil {
  25971. res.Body.Close()
  25972. }
  25973. return nil, &googleapi.Error{
  25974. Code: res.StatusCode,
  25975. Header: res.Header,
  25976. }
  25977. }
  25978. if err != nil {
  25979. return nil, err
  25980. }
  25981. defer googleapi.CloseBody(res)
  25982. if err := googleapi.CheckResponse(res); err != nil {
  25983. return nil, err
  25984. }
  25985. ret := &ImageList{
  25986. ServerResponse: googleapi.ServerResponse{
  25987. Header: res.Header,
  25988. HTTPStatusCode: res.StatusCode,
  25989. },
  25990. }
  25991. target := &ret
  25992. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  25993. return nil, err
  25994. }
  25995. return ret, nil
  25996. // {
  25997. // "description": "Retrieves the list of private images available to the specified project. Private images are images you create that belong to your project. This method does not get any images that belong to other projects, including publicly-available images, like Debian 8. If you want to get a list of publicly-available images, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud.",
  25998. // "httpMethod": "GET",
  25999. // "id": "compute.images.list",
  26000. // "parameterOrder": [
  26001. // "project"
  26002. // ],
  26003. // "parameters": {
  26004. // "filter": {
  26005. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  26006. // "location": "query",
  26007. // "type": "string"
  26008. // },
  26009. // "maxResults": {
  26010. // "default": "500",
  26011. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  26012. // "format": "uint32",
  26013. // "location": "query",
  26014. // "minimum": "0",
  26015. // "type": "integer"
  26016. // },
  26017. // "orderBy": {
  26018. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  26019. // "location": "query",
  26020. // "type": "string"
  26021. // },
  26022. // "pageToken": {
  26023. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  26024. // "location": "query",
  26025. // "type": "string"
  26026. // },
  26027. // "project": {
  26028. // "description": "Project ID for this request.",
  26029. // "location": "path",
  26030. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  26031. // "required": true,
  26032. // "type": "string"
  26033. // }
  26034. // },
  26035. // "path": "{project}/global/images",
  26036. // "response": {
  26037. // "$ref": "ImageList"
  26038. // },
  26039. // "scopes": [
  26040. // "https://www.googleapis.com/auth/cloud-platform",
  26041. // "https://www.googleapis.com/auth/compute",
  26042. // "https://www.googleapis.com/auth/compute.readonly"
  26043. // ]
  26044. // }
  26045. }
  26046. // Pages invokes f for each page of results.
  26047. // A non-nil error returned from f will halt the iteration.
  26048. // The provided context supersedes any context provided to the Context method.
  26049. func (c *ImagesListCall) Pages(ctx context.Context, f func(*ImageList) error) error {
  26050. c.ctx_ = ctx
  26051. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  26052. for {
  26053. x, err := c.Do()
  26054. if err != nil {
  26055. return err
  26056. }
  26057. if err := f(x); err != nil {
  26058. return err
  26059. }
  26060. if x.NextPageToken == "" {
  26061. return nil
  26062. }
  26063. c.PageToken(x.NextPageToken)
  26064. }
  26065. }
  26066. // method id "compute.images.setLabels":
  26067. type ImagesSetLabelsCall struct {
  26068. s *Service
  26069. project string
  26070. resource string
  26071. globalsetlabelsrequest *GlobalSetLabelsRequest
  26072. urlParams_ gensupport.URLParams
  26073. ctx_ context.Context
  26074. header_ http.Header
  26075. }
  26076. // SetLabels: Sets the labels on an image. To learn more about labels,
  26077. // read the Labeling Resources documentation.
  26078. func (r *ImagesService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *ImagesSetLabelsCall {
  26079. c := &ImagesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26080. c.project = project
  26081. c.resource = resource
  26082. c.globalsetlabelsrequest = globalsetlabelsrequest
  26083. return c
  26084. }
  26085. // Fields allows partial responses to be retrieved. See
  26086. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26087. // for more information.
  26088. func (c *ImagesSetLabelsCall) Fields(s ...googleapi.Field) *ImagesSetLabelsCall {
  26089. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26090. return c
  26091. }
  26092. // Context sets the context to be used in this call's Do method. Any
  26093. // pending HTTP request will be aborted if the provided context is
  26094. // canceled.
  26095. func (c *ImagesSetLabelsCall) Context(ctx context.Context) *ImagesSetLabelsCall {
  26096. c.ctx_ = ctx
  26097. return c
  26098. }
  26099. // Header returns an http.Header that can be modified by the caller to
  26100. // add HTTP headers to the request.
  26101. func (c *ImagesSetLabelsCall) Header() http.Header {
  26102. if c.header_ == nil {
  26103. c.header_ = make(http.Header)
  26104. }
  26105. return c.header_
  26106. }
  26107. func (c *ImagesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  26108. reqHeaders := make(http.Header)
  26109. for k, v := range c.header_ {
  26110. reqHeaders[k] = v
  26111. }
  26112. reqHeaders.Set("User-Agent", c.s.userAgent())
  26113. var body io.Reader = nil
  26114. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  26115. if err != nil {
  26116. return nil, err
  26117. }
  26118. reqHeaders.Set("Content-Type", "application/json")
  26119. c.urlParams_.Set("alt", alt)
  26120. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{resource}/setLabels")
  26121. urls += "?" + c.urlParams_.Encode()
  26122. req, _ := http.NewRequest("POST", urls, body)
  26123. req.Header = reqHeaders
  26124. googleapi.Expand(req.URL, map[string]string{
  26125. "project": c.project,
  26126. "resource": c.resource,
  26127. })
  26128. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26129. }
  26130. // Do executes the "compute.images.setLabels" call.
  26131. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  26132. // status code is an error. Response headers are in either
  26133. // *Operation.ServerResponse.Header or (if a response was returned at
  26134. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  26135. // to check whether the returned error was because
  26136. // http.StatusNotModified was returned.
  26137. func (c *ImagesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  26138. gensupport.SetOptions(c.urlParams_, opts...)
  26139. res, err := c.doRequest("json")
  26140. if res != nil && res.StatusCode == http.StatusNotModified {
  26141. if res.Body != nil {
  26142. res.Body.Close()
  26143. }
  26144. return nil, &googleapi.Error{
  26145. Code: res.StatusCode,
  26146. Header: res.Header,
  26147. }
  26148. }
  26149. if err != nil {
  26150. return nil, err
  26151. }
  26152. defer googleapi.CloseBody(res)
  26153. if err := googleapi.CheckResponse(res); err != nil {
  26154. return nil, err
  26155. }
  26156. ret := &Operation{
  26157. ServerResponse: googleapi.ServerResponse{
  26158. Header: res.Header,
  26159. HTTPStatusCode: res.StatusCode,
  26160. },
  26161. }
  26162. target := &ret
  26163. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  26164. return nil, err
  26165. }
  26166. return ret, nil
  26167. // {
  26168. // "description": "Sets the labels on an image. To learn more about labels, read the Labeling Resources documentation.",
  26169. // "httpMethod": "POST",
  26170. // "id": "compute.images.setLabels",
  26171. // "parameterOrder": [
  26172. // "project",
  26173. // "resource"
  26174. // ],
  26175. // "parameters": {
  26176. // "project": {
  26177. // "description": "Project ID for this request.",
  26178. // "location": "path",
  26179. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  26180. // "required": true,
  26181. // "type": "string"
  26182. // },
  26183. // "resource": {
  26184. // "description": "Name of the resource for this request.",
  26185. // "location": "path",
  26186. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?",
  26187. // "required": true,
  26188. // "type": "string"
  26189. // }
  26190. // },
  26191. // "path": "{project}/global/images/{resource}/setLabels",
  26192. // "request": {
  26193. // "$ref": "GlobalSetLabelsRequest"
  26194. // },
  26195. // "response": {
  26196. // "$ref": "Operation"
  26197. // },
  26198. // "scopes": [
  26199. // "https://www.googleapis.com/auth/cloud-platform",
  26200. // "https://www.googleapis.com/auth/compute"
  26201. // ]
  26202. // }
  26203. }
  26204. // method id "compute.instanceGroupManagers.abandonInstances":
  26205. type InstanceGroupManagersAbandonInstancesCall struct {
  26206. s *Service
  26207. project string
  26208. zone string
  26209. instanceGroupManager string
  26210. instancegroupmanagersabandoninstancesrequest *InstanceGroupManagersAbandonInstancesRequest
  26211. urlParams_ gensupport.URLParams
  26212. ctx_ context.Context
  26213. header_ http.Header
  26214. }
  26215. // AbandonInstances: Schedules a group action to remove the specified
  26216. // instances from the managed instance group. Abandoning an instance
  26217. // does not delete the instance, but it does remove the instance from
  26218. // any target pools that are applied by the managed instance group. This
  26219. // method reduces the targetSize of the managed instance group by the
  26220. // number of instances that you abandon. This operation is marked as
  26221. // DONE when the action is scheduled even if the instances have not yet
  26222. // been removed from the group. You must separately verify the status of
  26223. // the abandoning action with the listmanagedinstances method.
  26224. //
  26225. // If the group is part of a backend service that has enabled connection
  26226. // draining, it can take up to 60 seconds after the connection draining
  26227. // duration has elapsed before the VM instance is removed or
  26228. // deleted.
  26229. //
  26230. // You can specify a maximum of 1000 instances with this method per
  26231. // request.
  26232. func (r *InstanceGroupManagersService) AbandonInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersabandoninstancesrequest *InstanceGroupManagersAbandonInstancesRequest) *InstanceGroupManagersAbandonInstancesCall {
  26233. c := &InstanceGroupManagersAbandonInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26234. c.project = project
  26235. c.zone = zone
  26236. c.instanceGroupManager = instanceGroupManager
  26237. c.instancegroupmanagersabandoninstancesrequest = instancegroupmanagersabandoninstancesrequest
  26238. return c
  26239. }
  26240. // Fields allows partial responses to be retrieved. See
  26241. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26242. // for more information.
  26243. func (c *InstanceGroupManagersAbandonInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersAbandonInstancesCall {
  26244. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26245. return c
  26246. }
  26247. // Context sets the context to be used in this call's Do method. Any
  26248. // pending HTTP request will be aborted if the provided context is
  26249. // canceled.
  26250. func (c *InstanceGroupManagersAbandonInstancesCall) Context(ctx context.Context) *InstanceGroupManagersAbandonInstancesCall {
  26251. c.ctx_ = ctx
  26252. return c
  26253. }
  26254. // Header returns an http.Header that can be modified by the caller to
  26255. // add HTTP headers to the request.
  26256. func (c *InstanceGroupManagersAbandonInstancesCall) Header() http.Header {
  26257. if c.header_ == nil {
  26258. c.header_ = make(http.Header)
  26259. }
  26260. return c.header_
  26261. }
  26262. func (c *InstanceGroupManagersAbandonInstancesCall) doRequest(alt string) (*http.Response, error) {
  26263. reqHeaders := make(http.Header)
  26264. for k, v := range c.header_ {
  26265. reqHeaders[k] = v
  26266. }
  26267. reqHeaders.Set("User-Agent", c.s.userAgent())
  26268. var body io.Reader = nil
  26269. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersabandoninstancesrequest)
  26270. if err != nil {
  26271. return nil, err
  26272. }
  26273. reqHeaders.Set("Content-Type", "application/json")
  26274. c.urlParams_.Set("alt", alt)
  26275. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances")
  26276. urls += "?" + c.urlParams_.Encode()
  26277. req, _ := http.NewRequest("POST", urls, body)
  26278. req.Header = reqHeaders
  26279. googleapi.Expand(req.URL, map[string]string{
  26280. "project": c.project,
  26281. "zone": c.zone,
  26282. "instanceGroupManager": c.instanceGroupManager,
  26283. })
  26284. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26285. }
  26286. // Do executes the "compute.instanceGroupManagers.abandonInstances" call.
  26287. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  26288. // status code is an error. Response headers are in either
  26289. // *Operation.ServerResponse.Header or (if a response was returned at
  26290. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  26291. // to check whether the returned error was because
  26292. // http.StatusNotModified was returned.
  26293. func (c *InstanceGroupManagersAbandonInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  26294. gensupport.SetOptions(c.urlParams_, opts...)
  26295. res, err := c.doRequest("json")
  26296. if res != nil && res.StatusCode == http.StatusNotModified {
  26297. if res.Body != nil {
  26298. res.Body.Close()
  26299. }
  26300. return nil, &googleapi.Error{
  26301. Code: res.StatusCode,
  26302. Header: res.Header,
  26303. }
  26304. }
  26305. if err != nil {
  26306. return nil, err
  26307. }
  26308. defer googleapi.CloseBody(res)
  26309. if err := googleapi.CheckResponse(res); err != nil {
  26310. return nil, err
  26311. }
  26312. ret := &Operation{
  26313. ServerResponse: googleapi.ServerResponse{
  26314. Header: res.Header,
  26315. HTTPStatusCode: res.StatusCode,
  26316. },
  26317. }
  26318. target := &ret
  26319. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  26320. return nil, err
  26321. }
  26322. return ret, nil
  26323. // {
  26324. // "description": "Schedules a group action to remove the specified instances from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.\n\nYou can specify a maximum of 1000 instances with this method per request.",
  26325. // "httpMethod": "POST",
  26326. // "id": "compute.instanceGroupManagers.abandonInstances",
  26327. // "parameterOrder": [
  26328. // "project",
  26329. // "zone",
  26330. // "instanceGroupManager"
  26331. // ],
  26332. // "parameters": {
  26333. // "instanceGroupManager": {
  26334. // "description": "The name of the managed instance group.",
  26335. // "location": "path",
  26336. // "required": true,
  26337. // "type": "string"
  26338. // },
  26339. // "project": {
  26340. // "description": "Project ID for this request.",
  26341. // "location": "path",
  26342. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  26343. // "required": true,
  26344. // "type": "string"
  26345. // },
  26346. // "zone": {
  26347. // "description": "The name of the zone where the managed instance group is located.",
  26348. // "location": "path",
  26349. // "required": true,
  26350. // "type": "string"
  26351. // }
  26352. // },
  26353. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances",
  26354. // "request": {
  26355. // "$ref": "InstanceGroupManagersAbandonInstancesRequest"
  26356. // },
  26357. // "response": {
  26358. // "$ref": "Operation"
  26359. // },
  26360. // "scopes": [
  26361. // "https://www.googleapis.com/auth/cloud-platform",
  26362. // "https://www.googleapis.com/auth/compute"
  26363. // ]
  26364. // }
  26365. }
  26366. // method id "compute.instanceGroupManagers.aggregatedList":
  26367. type InstanceGroupManagersAggregatedListCall struct {
  26368. s *Service
  26369. project string
  26370. urlParams_ gensupport.URLParams
  26371. ifNoneMatch_ string
  26372. ctx_ context.Context
  26373. header_ http.Header
  26374. }
  26375. // AggregatedList: Retrieves the list of managed instance groups and
  26376. // groups them by zone.
  26377. func (r *InstanceGroupManagersService) AggregatedList(project string) *InstanceGroupManagersAggregatedListCall {
  26378. c := &InstanceGroupManagersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26379. c.project = project
  26380. return c
  26381. }
  26382. // Filter sets the optional parameter "filter": Sets a filter
  26383. // {expression} for filtering listed resources. Your {expression} must
  26384. // be in the format: field_name comparison_string literal_string.
  26385. //
  26386. // The field_name is the name of the field you want to compare. Only
  26387. // atomic field types are supported (string, number, boolean). The
  26388. // comparison_string must be either eq (equals) or ne (not equals). The
  26389. // literal_string is the string value to filter to. The literal value
  26390. // must be valid for the type of field you are filtering by (string,
  26391. // number, boolean). For string fields, the literal value is interpreted
  26392. // as a regular expression using RE2 syntax. The literal value must
  26393. // match the entire field.
  26394. //
  26395. // For example, to filter for instances that do not have a name of
  26396. // example-instance, you would use name ne example-instance.
  26397. //
  26398. // You can filter on nested fields. For example, you could filter on
  26399. // instances that have set the scheduling.automaticRestart field to
  26400. // true. Use filtering on nested fields to take advantage of labels to
  26401. // organize and search for results based on label values.
  26402. //
  26403. // To filter on multiple expressions, provide each separate expression
  26404. // within parentheses. For example, (scheduling.automaticRestart eq
  26405. // true) (zone eq us-central1-f). Multiple expressions are treated as
  26406. // AND expressions, meaning that resources must match all expressions to
  26407. // pass the filters.
  26408. func (c *InstanceGroupManagersAggregatedListCall) Filter(filter string) *InstanceGroupManagersAggregatedListCall {
  26409. c.urlParams_.Set("filter", filter)
  26410. return c
  26411. }
  26412. // MaxResults sets the optional parameter "maxResults": The maximum
  26413. // number of results per page that should be returned. If the number of
  26414. // available results is larger than maxResults, Compute Engine returns a
  26415. // nextPageToken that can be used to get the next page of results in
  26416. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  26417. // (Default: 500)
  26418. func (c *InstanceGroupManagersAggregatedListCall) MaxResults(maxResults int64) *InstanceGroupManagersAggregatedListCall {
  26419. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  26420. return c
  26421. }
  26422. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  26423. // a certain order. By default, results are returned in alphanumerical
  26424. // order based on the resource name.
  26425. //
  26426. // You can also sort results in descending order based on the creation
  26427. // timestamp using orderBy="creationTimestamp desc". This sorts results
  26428. // based on the creationTimestamp field in reverse chronological order
  26429. // (newest result first). Use this to sort resources like operations so
  26430. // that the newest operation is returned first.
  26431. //
  26432. // Currently, only sorting by name or creationTimestamp desc is
  26433. // supported.
  26434. func (c *InstanceGroupManagersAggregatedListCall) OrderBy(orderBy string) *InstanceGroupManagersAggregatedListCall {
  26435. c.urlParams_.Set("orderBy", orderBy)
  26436. return c
  26437. }
  26438. // PageToken sets the optional parameter "pageToken": Specifies a page
  26439. // token to use. Set pageToken to the nextPageToken returned by a
  26440. // previous list request to get the next page of results.
  26441. func (c *InstanceGroupManagersAggregatedListCall) PageToken(pageToken string) *InstanceGroupManagersAggregatedListCall {
  26442. c.urlParams_.Set("pageToken", pageToken)
  26443. return c
  26444. }
  26445. // Fields allows partial responses to be retrieved. See
  26446. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26447. // for more information.
  26448. func (c *InstanceGroupManagersAggregatedListCall) Fields(s ...googleapi.Field) *InstanceGroupManagersAggregatedListCall {
  26449. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26450. return c
  26451. }
  26452. // IfNoneMatch sets the optional parameter which makes the operation
  26453. // fail if the object's ETag matches the given value. This is useful for
  26454. // getting updates only after the object has changed since the last
  26455. // request. Use googleapi.IsNotModified to check whether the response
  26456. // error from Do is the result of In-None-Match.
  26457. func (c *InstanceGroupManagersAggregatedListCall) IfNoneMatch(entityTag string) *InstanceGroupManagersAggregatedListCall {
  26458. c.ifNoneMatch_ = entityTag
  26459. return c
  26460. }
  26461. // Context sets the context to be used in this call's Do method. Any
  26462. // pending HTTP request will be aborted if the provided context is
  26463. // canceled.
  26464. func (c *InstanceGroupManagersAggregatedListCall) Context(ctx context.Context) *InstanceGroupManagersAggregatedListCall {
  26465. c.ctx_ = ctx
  26466. return c
  26467. }
  26468. // Header returns an http.Header that can be modified by the caller to
  26469. // add HTTP headers to the request.
  26470. func (c *InstanceGroupManagersAggregatedListCall) Header() http.Header {
  26471. if c.header_ == nil {
  26472. c.header_ = make(http.Header)
  26473. }
  26474. return c.header_
  26475. }
  26476. func (c *InstanceGroupManagersAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  26477. reqHeaders := make(http.Header)
  26478. for k, v := range c.header_ {
  26479. reqHeaders[k] = v
  26480. }
  26481. reqHeaders.Set("User-Agent", c.s.userAgent())
  26482. if c.ifNoneMatch_ != "" {
  26483. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  26484. }
  26485. var body io.Reader = nil
  26486. c.urlParams_.Set("alt", alt)
  26487. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instanceGroupManagers")
  26488. urls += "?" + c.urlParams_.Encode()
  26489. req, _ := http.NewRequest("GET", urls, body)
  26490. req.Header = reqHeaders
  26491. googleapi.Expand(req.URL, map[string]string{
  26492. "project": c.project,
  26493. })
  26494. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26495. }
  26496. // Do executes the "compute.instanceGroupManagers.aggregatedList" call.
  26497. // Exactly one of *InstanceGroupManagerAggregatedList or error will be
  26498. // non-nil. Any non-2xx status code is an error. Response headers are in
  26499. // either *InstanceGroupManagerAggregatedList.ServerResponse.Header or
  26500. // (if a response was returned at all) in
  26501. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  26502. // whether the returned error was because http.StatusNotModified was
  26503. // returned.
  26504. func (c *InstanceGroupManagersAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagerAggregatedList, error) {
  26505. gensupport.SetOptions(c.urlParams_, opts...)
  26506. res, err := c.doRequest("json")
  26507. if res != nil && res.StatusCode == http.StatusNotModified {
  26508. if res.Body != nil {
  26509. res.Body.Close()
  26510. }
  26511. return nil, &googleapi.Error{
  26512. Code: res.StatusCode,
  26513. Header: res.Header,
  26514. }
  26515. }
  26516. if err != nil {
  26517. return nil, err
  26518. }
  26519. defer googleapi.CloseBody(res)
  26520. if err := googleapi.CheckResponse(res); err != nil {
  26521. return nil, err
  26522. }
  26523. ret := &InstanceGroupManagerAggregatedList{
  26524. ServerResponse: googleapi.ServerResponse{
  26525. Header: res.Header,
  26526. HTTPStatusCode: res.StatusCode,
  26527. },
  26528. }
  26529. target := &ret
  26530. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  26531. return nil, err
  26532. }
  26533. return ret, nil
  26534. // {
  26535. // "description": "Retrieves the list of managed instance groups and groups them by zone.",
  26536. // "httpMethod": "GET",
  26537. // "id": "compute.instanceGroupManagers.aggregatedList",
  26538. // "parameterOrder": [
  26539. // "project"
  26540. // ],
  26541. // "parameters": {
  26542. // "filter": {
  26543. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  26544. // "location": "query",
  26545. // "type": "string"
  26546. // },
  26547. // "maxResults": {
  26548. // "default": "500",
  26549. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  26550. // "format": "uint32",
  26551. // "location": "query",
  26552. // "minimum": "0",
  26553. // "type": "integer"
  26554. // },
  26555. // "orderBy": {
  26556. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  26557. // "location": "query",
  26558. // "type": "string"
  26559. // },
  26560. // "pageToken": {
  26561. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  26562. // "location": "query",
  26563. // "type": "string"
  26564. // },
  26565. // "project": {
  26566. // "description": "Project ID for this request.",
  26567. // "location": "path",
  26568. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  26569. // "required": true,
  26570. // "type": "string"
  26571. // }
  26572. // },
  26573. // "path": "{project}/aggregated/instanceGroupManagers",
  26574. // "response": {
  26575. // "$ref": "InstanceGroupManagerAggregatedList"
  26576. // },
  26577. // "scopes": [
  26578. // "https://www.googleapis.com/auth/cloud-platform",
  26579. // "https://www.googleapis.com/auth/compute",
  26580. // "https://www.googleapis.com/auth/compute.readonly"
  26581. // ]
  26582. // }
  26583. }
  26584. // Pages invokes f for each page of results.
  26585. // A non-nil error returned from f will halt the iteration.
  26586. // The provided context supersedes any context provided to the Context method.
  26587. func (c *InstanceGroupManagersAggregatedListCall) Pages(ctx context.Context, f func(*InstanceGroupManagerAggregatedList) error) error {
  26588. c.ctx_ = ctx
  26589. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  26590. for {
  26591. x, err := c.Do()
  26592. if err != nil {
  26593. return err
  26594. }
  26595. if err := f(x); err != nil {
  26596. return err
  26597. }
  26598. if x.NextPageToken == "" {
  26599. return nil
  26600. }
  26601. c.PageToken(x.NextPageToken)
  26602. }
  26603. }
  26604. // method id "compute.instanceGroupManagers.delete":
  26605. type InstanceGroupManagersDeleteCall struct {
  26606. s *Service
  26607. project string
  26608. zone string
  26609. instanceGroupManager string
  26610. urlParams_ gensupport.URLParams
  26611. ctx_ context.Context
  26612. header_ http.Header
  26613. }
  26614. // Delete: Deletes the specified managed instance group and all of the
  26615. // instances in that group. Note that the instance group must not belong
  26616. // to a backend service. Read Deleting an instance group for more
  26617. // information.
  26618. func (r *InstanceGroupManagersService) Delete(project string, zone string, instanceGroupManager string) *InstanceGroupManagersDeleteCall {
  26619. c := &InstanceGroupManagersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26620. c.project = project
  26621. c.zone = zone
  26622. c.instanceGroupManager = instanceGroupManager
  26623. return c
  26624. }
  26625. // Fields allows partial responses to be retrieved. See
  26626. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26627. // for more information.
  26628. func (c *InstanceGroupManagersDeleteCall) Fields(s ...googleapi.Field) *InstanceGroupManagersDeleteCall {
  26629. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26630. return c
  26631. }
  26632. // Context sets the context to be used in this call's Do method. Any
  26633. // pending HTTP request will be aborted if the provided context is
  26634. // canceled.
  26635. func (c *InstanceGroupManagersDeleteCall) Context(ctx context.Context) *InstanceGroupManagersDeleteCall {
  26636. c.ctx_ = ctx
  26637. return c
  26638. }
  26639. // Header returns an http.Header that can be modified by the caller to
  26640. // add HTTP headers to the request.
  26641. func (c *InstanceGroupManagersDeleteCall) Header() http.Header {
  26642. if c.header_ == nil {
  26643. c.header_ = make(http.Header)
  26644. }
  26645. return c.header_
  26646. }
  26647. func (c *InstanceGroupManagersDeleteCall) doRequest(alt string) (*http.Response, error) {
  26648. reqHeaders := make(http.Header)
  26649. for k, v := range c.header_ {
  26650. reqHeaders[k] = v
  26651. }
  26652. reqHeaders.Set("User-Agent", c.s.userAgent())
  26653. var body io.Reader = nil
  26654. c.urlParams_.Set("alt", alt)
  26655. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
  26656. urls += "?" + c.urlParams_.Encode()
  26657. req, _ := http.NewRequest("DELETE", urls, body)
  26658. req.Header = reqHeaders
  26659. googleapi.Expand(req.URL, map[string]string{
  26660. "project": c.project,
  26661. "zone": c.zone,
  26662. "instanceGroupManager": c.instanceGroupManager,
  26663. })
  26664. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26665. }
  26666. // Do executes the "compute.instanceGroupManagers.delete" call.
  26667. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  26668. // status code is an error. Response headers are in either
  26669. // *Operation.ServerResponse.Header or (if a response was returned at
  26670. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  26671. // to check whether the returned error was because
  26672. // http.StatusNotModified was returned.
  26673. func (c *InstanceGroupManagersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  26674. gensupport.SetOptions(c.urlParams_, opts...)
  26675. res, err := c.doRequest("json")
  26676. if res != nil && res.StatusCode == http.StatusNotModified {
  26677. if res.Body != nil {
  26678. res.Body.Close()
  26679. }
  26680. return nil, &googleapi.Error{
  26681. Code: res.StatusCode,
  26682. Header: res.Header,
  26683. }
  26684. }
  26685. if err != nil {
  26686. return nil, err
  26687. }
  26688. defer googleapi.CloseBody(res)
  26689. if err := googleapi.CheckResponse(res); err != nil {
  26690. return nil, err
  26691. }
  26692. ret := &Operation{
  26693. ServerResponse: googleapi.ServerResponse{
  26694. Header: res.Header,
  26695. HTTPStatusCode: res.StatusCode,
  26696. },
  26697. }
  26698. target := &ret
  26699. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  26700. return nil, err
  26701. }
  26702. return ret, nil
  26703. // {
  26704. // "description": "Deletes the specified managed instance group and all of the instances in that group. Note that the instance group must not belong to a backend service. Read Deleting an instance group for more information.",
  26705. // "httpMethod": "DELETE",
  26706. // "id": "compute.instanceGroupManagers.delete",
  26707. // "parameterOrder": [
  26708. // "project",
  26709. // "zone",
  26710. // "instanceGroupManager"
  26711. // ],
  26712. // "parameters": {
  26713. // "instanceGroupManager": {
  26714. // "description": "The name of the managed instance group to delete.",
  26715. // "location": "path",
  26716. // "required": true,
  26717. // "type": "string"
  26718. // },
  26719. // "project": {
  26720. // "description": "Project ID for this request.",
  26721. // "location": "path",
  26722. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  26723. // "required": true,
  26724. // "type": "string"
  26725. // },
  26726. // "zone": {
  26727. // "description": "The name of the zone where the managed instance group is located.",
  26728. // "location": "path",
  26729. // "required": true,
  26730. // "type": "string"
  26731. // }
  26732. // },
  26733. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
  26734. // "response": {
  26735. // "$ref": "Operation"
  26736. // },
  26737. // "scopes": [
  26738. // "https://www.googleapis.com/auth/cloud-platform",
  26739. // "https://www.googleapis.com/auth/compute"
  26740. // ]
  26741. // }
  26742. }
  26743. // method id "compute.instanceGroupManagers.deleteInstances":
  26744. type InstanceGroupManagersDeleteInstancesCall struct {
  26745. s *Service
  26746. project string
  26747. zone string
  26748. instanceGroupManager string
  26749. instancegroupmanagersdeleteinstancesrequest *InstanceGroupManagersDeleteInstancesRequest
  26750. urlParams_ gensupport.URLParams
  26751. ctx_ context.Context
  26752. header_ http.Header
  26753. }
  26754. // DeleteInstances: Schedules a group action to delete the specified
  26755. // instances in the managed instance group. The instances are also
  26756. // removed from any target pools of which they were a member. This
  26757. // method reduces the targetSize of the managed instance group by the
  26758. // number of instances that you delete. This operation is marked as DONE
  26759. // when the action is scheduled even if the instances are still being
  26760. // deleted. You must separately verify the status of the deleting action
  26761. // with the listmanagedinstances method.
  26762. //
  26763. // If the group is part of a backend service that has enabled connection
  26764. // draining, it can take up to 60 seconds after the connection draining
  26765. // duration has elapsed before the VM instance is removed or
  26766. // deleted.
  26767. //
  26768. // You can specify a maximum of 1000 instances with this method per
  26769. // request.
  26770. func (r *InstanceGroupManagersService) DeleteInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersdeleteinstancesrequest *InstanceGroupManagersDeleteInstancesRequest) *InstanceGroupManagersDeleteInstancesCall {
  26771. c := &InstanceGroupManagersDeleteInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26772. c.project = project
  26773. c.zone = zone
  26774. c.instanceGroupManager = instanceGroupManager
  26775. c.instancegroupmanagersdeleteinstancesrequest = instancegroupmanagersdeleteinstancesrequest
  26776. return c
  26777. }
  26778. // Fields allows partial responses to be retrieved. See
  26779. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26780. // for more information.
  26781. func (c *InstanceGroupManagersDeleteInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersDeleteInstancesCall {
  26782. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26783. return c
  26784. }
  26785. // Context sets the context to be used in this call's Do method. Any
  26786. // pending HTTP request will be aborted if the provided context is
  26787. // canceled.
  26788. func (c *InstanceGroupManagersDeleteInstancesCall) Context(ctx context.Context) *InstanceGroupManagersDeleteInstancesCall {
  26789. c.ctx_ = ctx
  26790. return c
  26791. }
  26792. // Header returns an http.Header that can be modified by the caller to
  26793. // add HTTP headers to the request.
  26794. func (c *InstanceGroupManagersDeleteInstancesCall) Header() http.Header {
  26795. if c.header_ == nil {
  26796. c.header_ = make(http.Header)
  26797. }
  26798. return c.header_
  26799. }
  26800. func (c *InstanceGroupManagersDeleteInstancesCall) doRequest(alt string) (*http.Response, error) {
  26801. reqHeaders := make(http.Header)
  26802. for k, v := range c.header_ {
  26803. reqHeaders[k] = v
  26804. }
  26805. reqHeaders.Set("User-Agent", c.s.userAgent())
  26806. var body io.Reader = nil
  26807. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersdeleteinstancesrequest)
  26808. if err != nil {
  26809. return nil, err
  26810. }
  26811. reqHeaders.Set("Content-Type", "application/json")
  26812. c.urlParams_.Set("alt", alt)
  26813. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances")
  26814. urls += "?" + c.urlParams_.Encode()
  26815. req, _ := http.NewRequest("POST", urls, body)
  26816. req.Header = reqHeaders
  26817. googleapi.Expand(req.URL, map[string]string{
  26818. "project": c.project,
  26819. "zone": c.zone,
  26820. "instanceGroupManager": c.instanceGroupManager,
  26821. })
  26822. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26823. }
  26824. // Do executes the "compute.instanceGroupManagers.deleteInstances" call.
  26825. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  26826. // status code is an error. Response headers are in either
  26827. // *Operation.ServerResponse.Header or (if a response was returned at
  26828. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  26829. // to check whether the returned error was because
  26830. // http.StatusNotModified was returned.
  26831. func (c *InstanceGroupManagersDeleteInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  26832. gensupport.SetOptions(c.urlParams_, opts...)
  26833. res, err := c.doRequest("json")
  26834. if res != nil && res.StatusCode == http.StatusNotModified {
  26835. if res.Body != nil {
  26836. res.Body.Close()
  26837. }
  26838. return nil, &googleapi.Error{
  26839. Code: res.StatusCode,
  26840. Header: res.Header,
  26841. }
  26842. }
  26843. if err != nil {
  26844. return nil, err
  26845. }
  26846. defer googleapi.CloseBody(res)
  26847. if err := googleapi.CheckResponse(res); err != nil {
  26848. return nil, err
  26849. }
  26850. ret := &Operation{
  26851. ServerResponse: googleapi.ServerResponse{
  26852. Header: res.Header,
  26853. HTTPStatusCode: res.StatusCode,
  26854. },
  26855. }
  26856. target := &ret
  26857. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  26858. return nil, err
  26859. }
  26860. return ret, nil
  26861. // {
  26862. // "description": "Schedules a group action to delete the specified instances in the managed instance group. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.\n\nYou can specify a maximum of 1000 instances with this method per request.",
  26863. // "httpMethod": "POST",
  26864. // "id": "compute.instanceGroupManagers.deleteInstances",
  26865. // "parameterOrder": [
  26866. // "project",
  26867. // "zone",
  26868. // "instanceGroupManager"
  26869. // ],
  26870. // "parameters": {
  26871. // "instanceGroupManager": {
  26872. // "description": "The name of the managed instance group.",
  26873. // "location": "path",
  26874. // "required": true,
  26875. // "type": "string"
  26876. // },
  26877. // "project": {
  26878. // "description": "Project ID for this request.",
  26879. // "location": "path",
  26880. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  26881. // "required": true,
  26882. // "type": "string"
  26883. // },
  26884. // "zone": {
  26885. // "description": "The name of the zone where the managed instance group is located.",
  26886. // "location": "path",
  26887. // "required": true,
  26888. // "type": "string"
  26889. // }
  26890. // },
  26891. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances",
  26892. // "request": {
  26893. // "$ref": "InstanceGroupManagersDeleteInstancesRequest"
  26894. // },
  26895. // "response": {
  26896. // "$ref": "Operation"
  26897. // },
  26898. // "scopes": [
  26899. // "https://www.googleapis.com/auth/cloud-platform",
  26900. // "https://www.googleapis.com/auth/compute"
  26901. // ]
  26902. // }
  26903. }
  26904. // method id "compute.instanceGroupManagers.get":
  26905. type InstanceGroupManagersGetCall struct {
  26906. s *Service
  26907. project string
  26908. zone string
  26909. instanceGroupManager string
  26910. urlParams_ gensupport.URLParams
  26911. ifNoneMatch_ string
  26912. ctx_ context.Context
  26913. header_ http.Header
  26914. }
  26915. // Get: Returns all of the details about the specified managed instance
  26916. // group. Get a list of available managed instance groups by making a
  26917. // list() request.
  26918. func (r *InstanceGroupManagersService) Get(project string, zone string, instanceGroupManager string) *InstanceGroupManagersGetCall {
  26919. c := &InstanceGroupManagersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26920. c.project = project
  26921. c.zone = zone
  26922. c.instanceGroupManager = instanceGroupManager
  26923. return c
  26924. }
  26925. // Fields allows partial responses to be retrieved. See
  26926. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26927. // for more information.
  26928. func (c *InstanceGroupManagersGetCall) Fields(s ...googleapi.Field) *InstanceGroupManagersGetCall {
  26929. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26930. return c
  26931. }
  26932. // IfNoneMatch sets the optional parameter which makes the operation
  26933. // fail if the object's ETag matches the given value. This is useful for
  26934. // getting updates only after the object has changed since the last
  26935. // request. Use googleapi.IsNotModified to check whether the response
  26936. // error from Do is the result of In-None-Match.
  26937. func (c *InstanceGroupManagersGetCall) IfNoneMatch(entityTag string) *InstanceGroupManagersGetCall {
  26938. c.ifNoneMatch_ = entityTag
  26939. return c
  26940. }
  26941. // Context sets the context to be used in this call's Do method. Any
  26942. // pending HTTP request will be aborted if the provided context is
  26943. // canceled.
  26944. func (c *InstanceGroupManagersGetCall) Context(ctx context.Context) *InstanceGroupManagersGetCall {
  26945. c.ctx_ = ctx
  26946. return c
  26947. }
  26948. // Header returns an http.Header that can be modified by the caller to
  26949. // add HTTP headers to the request.
  26950. func (c *InstanceGroupManagersGetCall) Header() http.Header {
  26951. if c.header_ == nil {
  26952. c.header_ = make(http.Header)
  26953. }
  26954. return c.header_
  26955. }
  26956. func (c *InstanceGroupManagersGetCall) doRequest(alt string) (*http.Response, error) {
  26957. reqHeaders := make(http.Header)
  26958. for k, v := range c.header_ {
  26959. reqHeaders[k] = v
  26960. }
  26961. reqHeaders.Set("User-Agent", c.s.userAgent())
  26962. if c.ifNoneMatch_ != "" {
  26963. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  26964. }
  26965. var body io.Reader = nil
  26966. c.urlParams_.Set("alt", alt)
  26967. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
  26968. urls += "?" + c.urlParams_.Encode()
  26969. req, _ := http.NewRequest("GET", urls, body)
  26970. req.Header = reqHeaders
  26971. googleapi.Expand(req.URL, map[string]string{
  26972. "project": c.project,
  26973. "zone": c.zone,
  26974. "instanceGroupManager": c.instanceGroupManager,
  26975. })
  26976. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26977. }
  26978. // Do executes the "compute.instanceGroupManagers.get" call.
  26979. // Exactly one of *InstanceGroupManager or error will be non-nil. Any
  26980. // non-2xx status code is an error. Response headers are in either
  26981. // *InstanceGroupManager.ServerResponse.Header or (if a response was
  26982. // returned at all) in error.(*googleapi.Error).Header. Use
  26983. // googleapi.IsNotModified to check whether the returned error was
  26984. // because http.StatusNotModified was returned.
  26985. func (c *InstanceGroupManagersGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManager, error) {
  26986. gensupport.SetOptions(c.urlParams_, opts...)
  26987. res, err := c.doRequest("json")
  26988. if res != nil && res.StatusCode == http.StatusNotModified {
  26989. if res.Body != nil {
  26990. res.Body.Close()
  26991. }
  26992. return nil, &googleapi.Error{
  26993. Code: res.StatusCode,
  26994. Header: res.Header,
  26995. }
  26996. }
  26997. if err != nil {
  26998. return nil, err
  26999. }
  27000. defer googleapi.CloseBody(res)
  27001. if err := googleapi.CheckResponse(res); err != nil {
  27002. return nil, err
  27003. }
  27004. ret := &InstanceGroupManager{
  27005. ServerResponse: googleapi.ServerResponse{
  27006. Header: res.Header,
  27007. HTTPStatusCode: res.StatusCode,
  27008. },
  27009. }
  27010. target := &ret
  27011. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  27012. return nil, err
  27013. }
  27014. return ret, nil
  27015. // {
  27016. // "description": "Returns all of the details about the specified managed instance group. Get a list of available managed instance groups by making a list() request.",
  27017. // "httpMethod": "GET",
  27018. // "id": "compute.instanceGroupManagers.get",
  27019. // "parameterOrder": [
  27020. // "project",
  27021. // "zone",
  27022. // "instanceGroupManager"
  27023. // ],
  27024. // "parameters": {
  27025. // "instanceGroupManager": {
  27026. // "description": "The name of the managed instance group.",
  27027. // "location": "path",
  27028. // "required": true,
  27029. // "type": "string"
  27030. // },
  27031. // "project": {
  27032. // "description": "Project ID for this request.",
  27033. // "location": "path",
  27034. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  27035. // "required": true,
  27036. // "type": "string"
  27037. // },
  27038. // "zone": {
  27039. // "description": "The name of the zone where the managed instance group is located.",
  27040. // "location": "path",
  27041. // "required": true,
  27042. // "type": "string"
  27043. // }
  27044. // },
  27045. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
  27046. // "response": {
  27047. // "$ref": "InstanceGroupManager"
  27048. // },
  27049. // "scopes": [
  27050. // "https://www.googleapis.com/auth/cloud-platform",
  27051. // "https://www.googleapis.com/auth/compute",
  27052. // "https://www.googleapis.com/auth/compute.readonly"
  27053. // ]
  27054. // }
  27055. }
  27056. // method id "compute.instanceGroupManagers.insert":
  27057. type InstanceGroupManagersInsertCall struct {
  27058. s *Service
  27059. project string
  27060. zone string
  27061. instancegroupmanager *InstanceGroupManager
  27062. urlParams_ gensupport.URLParams
  27063. ctx_ context.Context
  27064. header_ http.Header
  27065. }
  27066. // Insert: Creates a managed instance group using the information that
  27067. // you specify in the request. After the group is created, it schedules
  27068. // an action to create instances in the group using the specified
  27069. // instance template. This operation is marked as DONE when the group is
  27070. // created even if the instances in the group have not yet been created.
  27071. // You must separately verify the status of the individual instances
  27072. // with the listmanagedinstances method.
  27073. //
  27074. // A managed instance group can have up to 1000 VM instances per group.
  27075. // Please contact Cloud Support if you need an increase in this limit.
  27076. func (r *InstanceGroupManagersService) Insert(project string, zone string, instancegroupmanager *InstanceGroupManager) *InstanceGroupManagersInsertCall {
  27077. c := &InstanceGroupManagersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27078. c.project = project
  27079. c.zone = zone
  27080. c.instancegroupmanager = instancegroupmanager
  27081. return c
  27082. }
  27083. // Fields allows partial responses to be retrieved. See
  27084. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27085. // for more information.
  27086. func (c *InstanceGroupManagersInsertCall) Fields(s ...googleapi.Field) *InstanceGroupManagersInsertCall {
  27087. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27088. return c
  27089. }
  27090. // Context sets the context to be used in this call's Do method. Any
  27091. // pending HTTP request will be aborted if the provided context is
  27092. // canceled.
  27093. func (c *InstanceGroupManagersInsertCall) Context(ctx context.Context) *InstanceGroupManagersInsertCall {
  27094. c.ctx_ = ctx
  27095. return c
  27096. }
  27097. // Header returns an http.Header that can be modified by the caller to
  27098. // add HTTP headers to the request.
  27099. func (c *InstanceGroupManagersInsertCall) Header() http.Header {
  27100. if c.header_ == nil {
  27101. c.header_ = make(http.Header)
  27102. }
  27103. return c.header_
  27104. }
  27105. func (c *InstanceGroupManagersInsertCall) doRequest(alt string) (*http.Response, error) {
  27106. reqHeaders := make(http.Header)
  27107. for k, v := range c.header_ {
  27108. reqHeaders[k] = v
  27109. }
  27110. reqHeaders.Set("User-Agent", c.s.userAgent())
  27111. var body io.Reader = nil
  27112. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  27113. if err != nil {
  27114. return nil, err
  27115. }
  27116. reqHeaders.Set("Content-Type", "application/json")
  27117. c.urlParams_.Set("alt", alt)
  27118. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers")
  27119. urls += "?" + c.urlParams_.Encode()
  27120. req, _ := http.NewRequest("POST", urls, body)
  27121. req.Header = reqHeaders
  27122. googleapi.Expand(req.URL, map[string]string{
  27123. "project": c.project,
  27124. "zone": c.zone,
  27125. })
  27126. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27127. }
  27128. // Do executes the "compute.instanceGroupManagers.insert" call.
  27129. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  27130. // status code is an error. Response headers are in either
  27131. // *Operation.ServerResponse.Header or (if a response was returned at
  27132. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  27133. // to check whether the returned error was because
  27134. // http.StatusNotModified was returned.
  27135. func (c *InstanceGroupManagersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  27136. gensupport.SetOptions(c.urlParams_, opts...)
  27137. res, err := c.doRequest("json")
  27138. if res != nil && res.StatusCode == http.StatusNotModified {
  27139. if res.Body != nil {
  27140. res.Body.Close()
  27141. }
  27142. return nil, &googleapi.Error{
  27143. Code: res.StatusCode,
  27144. Header: res.Header,
  27145. }
  27146. }
  27147. if err != nil {
  27148. return nil, err
  27149. }
  27150. defer googleapi.CloseBody(res)
  27151. if err := googleapi.CheckResponse(res); err != nil {
  27152. return nil, err
  27153. }
  27154. ret := &Operation{
  27155. ServerResponse: googleapi.ServerResponse{
  27156. Header: res.Header,
  27157. HTTPStatusCode: res.StatusCode,
  27158. },
  27159. }
  27160. target := &ret
  27161. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  27162. return nil, err
  27163. }
  27164. return ret, nil
  27165. // {
  27166. // "description": "Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method.\n\nA managed instance group can have up to 1000 VM instances per group. Please contact Cloud Support if you need an increase in this limit.",
  27167. // "httpMethod": "POST",
  27168. // "id": "compute.instanceGroupManagers.insert",
  27169. // "parameterOrder": [
  27170. // "project",
  27171. // "zone"
  27172. // ],
  27173. // "parameters": {
  27174. // "project": {
  27175. // "description": "Project ID for this request.",
  27176. // "location": "path",
  27177. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  27178. // "required": true,
  27179. // "type": "string"
  27180. // },
  27181. // "zone": {
  27182. // "description": "The name of the zone where you want to create the managed instance group.",
  27183. // "location": "path",
  27184. // "required": true,
  27185. // "type": "string"
  27186. // }
  27187. // },
  27188. // "path": "{project}/zones/{zone}/instanceGroupManagers",
  27189. // "request": {
  27190. // "$ref": "InstanceGroupManager"
  27191. // },
  27192. // "response": {
  27193. // "$ref": "Operation"
  27194. // },
  27195. // "scopes": [
  27196. // "https://www.googleapis.com/auth/cloud-platform",
  27197. // "https://www.googleapis.com/auth/compute"
  27198. // ]
  27199. // }
  27200. }
  27201. // method id "compute.instanceGroupManagers.list":
  27202. type InstanceGroupManagersListCall struct {
  27203. s *Service
  27204. project string
  27205. zone string
  27206. urlParams_ gensupport.URLParams
  27207. ifNoneMatch_ string
  27208. ctx_ context.Context
  27209. header_ http.Header
  27210. }
  27211. // List: Retrieves a list of managed instance groups that are contained
  27212. // within the specified project and zone.
  27213. func (r *InstanceGroupManagersService) List(project string, zone string) *InstanceGroupManagersListCall {
  27214. c := &InstanceGroupManagersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27215. c.project = project
  27216. c.zone = zone
  27217. return c
  27218. }
  27219. // Filter sets the optional parameter "filter": Sets a filter
  27220. // {expression} for filtering listed resources. Your {expression} must
  27221. // be in the format: field_name comparison_string literal_string.
  27222. //
  27223. // The field_name is the name of the field you want to compare. Only
  27224. // atomic field types are supported (string, number, boolean). The
  27225. // comparison_string must be either eq (equals) or ne (not equals). The
  27226. // literal_string is the string value to filter to. The literal value
  27227. // must be valid for the type of field you are filtering by (string,
  27228. // number, boolean). For string fields, the literal value is interpreted
  27229. // as a regular expression using RE2 syntax. The literal value must
  27230. // match the entire field.
  27231. //
  27232. // For example, to filter for instances that do not have a name of
  27233. // example-instance, you would use name ne example-instance.
  27234. //
  27235. // You can filter on nested fields. For example, you could filter on
  27236. // instances that have set the scheduling.automaticRestart field to
  27237. // true. Use filtering on nested fields to take advantage of labels to
  27238. // organize and search for results based on label values.
  27239. //
  27240. // To filter on multiple expressions, provide each separate expression
  27241. // within parentheses. For example, (scheduling.automaticRestart eq
  27242. // true) (zone eq us-central1-f). Multiple expressions are treated as
  27243. // AND expressions, meaning that resources must match all expressions to
  27244. // pass the filters.
  27245. func (c *InstanceGroupManagersListCall) Filter(filter string) *InstanceGroupManagersListCall {
  27246. c.urlParams_.Set("filter", filter)
  27247. return c
  27248. }
  27249. // MaxResults sets the optional parameter "maxResults": The maximum
  27250. // number of results per page that should be returned. If the number of
  27251. // available results is larger than maxResults, Compute Engine returns a
  27252. // nextPageToken that can be used to get the next page of results in
  27253. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  27254. // (Default: 500)
  27255. func (c *InstanceGroupManagersListCall) MaxResults(maxResults int64) *InstanceGroupManagersListCall {
  27256. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  27257. return c
  27258. }
  27259. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  27260. // a certain order. By default, results are returned in alphanumerical
  27261. // order based on the resource name.
  27262. //
  27263. // You can also sort results in descending order based on the creation
  27264. // timestamp using orderBy="creationTimestamp desc". This sorts results
  27265. // based on the creationTimestamp field in reverse chronological order
  27266. // (newest result first). Use this to sort resources like operations so
  27267. // that the newest operation is returned first.
  27268. //
  27269. // Currently, only sorting by name or creationTimestamp desc is
  27270. // supported.
  27271. func (c *InstanceGroupManagersListCall) OrderBy(orderBy string) *InstanceGroupManagersListCall {
  27272. c.urlParams_.Set("orderBy", orderBy)
  27273. return c
  27274. }
  27275. // PageToken sets the optional parameter "pageToken": Specifies a page
  27276. // token to use. Set pageToken to the nextPageToken returned by a
  27277. // previous list request to get the next page of results.
  27278. func (c *InstanceGroupManagersListCall) PageToken(pageToken string) *InstanceGroupManagersListCall {
  27279. c.urlParams_.Set("pageToken", pageToken)
  27280. return c
  27281. }
  27282. // Fields allows partial responses to be retrieved. See
  27283. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27284. // for more information.
  27285. func (c *InstanceGroupManagersListCall) Fields(s ...googleapi.Field) *InstanceGroupManagersListCall {
  27286. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27287. return c
  27288. }
  27289. // IfNoneMatch sets the optional parameter which makes the operation
  27290. // fail if the object's ETag matches the given value. This is useful for
  27291. // getting updates only after the object has changed since the last
  27292. // request. Use googleapi.IsNotModified to check whether the response
  27293. // error from Do is the result of In-None-Match.
  27294. func (c *InstanceGroupManagersListCall) IfNoneMatch(entityTag string) *InstanceGroupManagersListCall {
  27295. c.ifNoneMatch_ = entityTag
  27296. return c
  27297. }
  27298. // Context sets the context to be used in this call's Do method. Any
  27299. // pending HTTP request will be aborted if the provided context is
  27300. // canceled.
  27301. func (c *InstanceGroupManagersListCall) Context(ctx context.Context) *InstanceGroupManagersListCall {
  27302. c.ctx_ = ctx
  27303. return c
  27304. }
  27305. // Header returns an http.Header that can be modified by the caller to
  27306. // add HTTP headers to the request.
  27307. func (c *InstanceGroupManagersListCall) Header() http.Header {
  27308. if c.header_ == nil {
  27309. c.header_ = make(http.Header)
  27310. }
  27311. return c.header_
  27312. }
  27313. func (c *InstanceGroupManagersListCall) doRequest(alt string) (*http.Response, error) {
  27314. reqHeaders := make(http.Header)
  27315. for k, v := range c.header_ {
  27316. reqHeaders[k] = v
  27317. }
  27318. reqHeaders.Set("User-Agent", c.s.userAgent())
  27319. if c.ifNoneMatch_ != "" {
  27320. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  27321. }
  27322. var body io.Reader = nil
  27323. c.urlParams_.Set("alt", alt)
  27324. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers")
  27325. urls += "?" + c.urlParams_.Encode()
  27326. req, _ := http.NewRequest("GET", urls, body)
  27327. req.Header = reqHeaders
  27328. googleapi.Expand(req.URL, map[string]string{
  27329. "project": c.project,
  27330. "zone": c.zone,
  27331. })
  27332. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27333. }
  27334. // Do executes the "compute.instanceGroupManagers.list" call.
  27335. // Exactly one of *InstanceGroupManagerList or error will be non-nil.
  27336. // Any non-2xx status code is an error. Response headers are in either
  27337. // *InstanceGroupManagerList.ServerResponse.Header or (if a response was
  27338. // returned at all) in error.(*googleapi.Error).Header. Use
  27339. // googleapi.IsNotModified to check whether the returned error was
  27340. // because http.StatusNotModified was returned.
  27341. func (c *InstanceGroupManagersListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagerList, error) {
  27342. gensupport.SetOptions(c.urlParams_, opts...)
  27343. res, err := c.doRequest("json")
  27344. if res != nil && res.StatusCode == http.StatusNotModified {
  27345. if res.Body != nil {
  27346. res.Body.Close()
  27347. }
  27348. return nil, &googleapi.Error{
  27349. Code: res.StatusCode,
  27350. Header: res.Header,
  27351. }
  27352. }
  27353. if err != nil {
  27354. return nil, err
  27355. }
  27356. defer googleapi.CloseBody(res)
  27357. if err := googleapi.CheckResponse(res); err != nil {
  27358. return nil, err
  27359. }
  27360. ret := &InstanceGroupManagerList{
  27361. ServerResponse: googleapi.ServerResponse{
  27362. Header: res.Header,
  27363. HTTPStatusCode: res.StatusCode,
  27364. },
  27365. }
  27366. target := &ret
  27367. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  27368. return nil, err
  27369. }
  27370. return ret, nil
  27371. // {
  27372. // "description": "Retrieves a list of managed instance groups that are contained within the specified project and zone.",
  27373. // "httpMethod": "GET",
  27374. // "id": "compute.instanceGroupManagers.list",
  27375. // "parameterOrder": [
  27376. // "project",
  27377. // "zone"
  27378. // ],
  27379. // "parameters": {
  27380. // "filter": {
  27381. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  27382. // "location": "query",
  27383. // "type": "string"
  27384. // },
  27385. // "maxResults": {
  27386. // "default": "500",
  27387. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  27388. // "format": "uint32",
  27389. // "location": "query",
  27390. // "minimum": "0",
  27391. // "type": "integer"
  27392. // },
  27393. // "orderBy": {
  27394. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  27395. // "location": "query",
  27396. // "type": "string"
  27397. // },
  27398. // "pageToken": {
  27399. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  27400. // "location": "query",
  27401. // "type": "string"
  27402. // },
  27403. // "project": {
  27404. // "description": "Project ID for this request.",
  27405. // "location": "path",
  27406. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  27407. // "required": true,
  27408. // "type": "string"
  27409. // },
  27410. // "zone": {
  27411. // "description": "The name of the zone where the managed instance group is located.",
  27412. // "location": "path",
  27413. // "required": true,
  27414. // "type": "string"
  27415. // }
  27416. // },
  27417. // "path": "{project}/zones/{zone}/instanceGroupManagers",
  27418. // "response": {
  27419. // "$ref": "InstanceGroupManagerList"
  27420. // },
  27421. // "scopes": [
  27422. // "https://www.googleapis.com/auth/cloud-platform",
  27423. // "https://www.googleapis.com/auth/compute",
  27424. // "https://www.googleapis.com/auth/compute.readonly"
  27425. // ]
  27426. // }
  27427. }
  27428. // Pages invokes f for each page of results.
  27429. // A non-nil error returned from f will halt the iteration.
  27430. // The provided context supersedes any context provided to the Context method.
  27431. func (c *InstanceGroupManagersListCall) Pages(ctx context.Context, f func(*InstanceGroupManagerList) error) error {
  27432. c.ctx_ = ctx
  27433. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  27434. for {
  27435. x, err := c.Do()
  27436. if err != nil {
  27437. return err
  27438. }
  27439. if err := f(x); err != nil {
  27440. return err
  27441. }
  27442. if x.NextPageToken == "" {
  27443. return nil
  27444. }
  27445. c.PageToken(x.NextPageToken)
  27446. }
  27447. }
  27448. // method id "compute.instanceGroupManagers.listManagedInstances":
  27449. type InstanceGroupManagersListManagedInstancesCall struct {
  27450. s *Service
  27451. project string
  27452. zone string
  27453. instanceGroupManager string
  27454. urlParams_ gensupport.URLParams
  27455. ctx_ context.Context
  27456. header_ http.Header
  27457. }
  27458. // ListManagedInstances: Lists all of the instances in the managed
  27459. // instance group. Each instance in the list has a currentAction, which
  27460. // indicates the action that the managed instance group is performing on
  27461. // the instance. For example, if the group is still creating an
  27462. // instance, the currentAction is CREATING. If a previous action failed,
  27463. // the list displays the errors for that failed action.
  27464. func (r *InstanceGroupManagersService) ListManagedInstances(project string, zone string, instanceGroupManager string) *InstanceGroupManagersListManagedInstancesCall {
  27465. c := &InstanceGroupManagersListManagedInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27466. c.project = project
  27467. c.zone = zone
  27468. c.instanceGroupManager = instanceGroupManager
  27469. return c
  27470. }
  27471. // Filter sets the optional parameter "filter":
  27472. func (c *InstanceGroupManagersListManagedInstancesCall) Filter(filter string) *InstanceGroupManagersListManagedInstancesCall {
  27473. c.urlParams_.Set("filter", filter)
  27474. return c
  27475. }
  27476. // MaxResults sets the optional parameter "maxResults":
  27477. func (c *InstanceGroupManagersListManagedInstancesCall) MaxResults(maxResults int64) *InstanceGroupManagersListManagedInstancesCall {
  27478. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  27479. return c
  27480. }
  27481. // OrderBy sets the optional parameter "order_by":
  27482. func (c *InstanceGroupManagersListManagedInstancesCall) OrderBy(orderBy string) *InstanceGroupManagersListManagedInstancesCall {
  27483. c.urlParams_.Set("order_by", orderBy)
  27484. return c
  27485. }
  27486. // PageToken sets the optional parameter "pageToken":
  27487. func (c *InstanceGroupManagersListManagedInstancesCall) PageToken(pageToken string) *InstanceGroupManagersListManagedInstancesCall {
  27488. c.urlParams_.Set("pageToken", pageToken)
  27489. return c
  27490. }
  27491. // Fields allows partial responses to be retrieved. See
  27492. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27493. // for more information.
  27494. func (c *InstanceGroupManagersListManagedInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersListManagedInstancesCall {
  27495. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27496. return c
  27497. }
  27498. // Context sets the context to be used in this call's Do method. Any
  27499. // pending HTTP request will be aborted if the provided context is
  27500. // canceled.
  27501. func (c *InstanceGroupManagersListManagedInstancesCall) Context(ctx context.Context) *InstanceGroupManagersListManagedInstancesCall {
  27502. c.ctx_ = ctx
  27503. return c
  27504. }
  27505. // Header returns an http.Header that can be modified by the caller to
  27506. // add HTTP headers to the request.
  27507. func (c *InstanceGroupManagersListManagedInstancesCall) Header() http.Header {
  27508. if c.header_ == nil {
  27509. c.header_ = make(http.Header)
  27510. }
  27511. return c.header_
  27512. }
  27513. func (c *InstanceGroupManagersListManagedInstancesCall) doRequest(alt string) (*http.Response, error) {
  27514. reqHeaders := make(http.Header)
  27515. for k, v := range c.header_ {
  27516. reqHeaders[k] = v
  27517. }
  27518. reqHeaders.Set("User-Agent", c.s.userAgent())
  27519. var body io.Reader = nil
  27520. c.urlParams_.Set("alt", alt)
  27521. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances")
  27522. urls += "?" + c.urlParams_.Encode()
  27523. req, _ := http.NewRequest("POST", urls, body)
  27524. req.Header = reqHeaders
  27525. googleapi.Expand(req.URL, map[string]string{
  27526. "project": c.project,
  27527. "zone": c.zone,
  27528. "instanceGroupManager": c.instanceGroupManager,
  27529. })
  27530. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27531. }
  27532. // Do executes the "compute.instanceGroupManagers.listManagedInstances" call.
  27533. // Exactly one of *InstanceGroupManagersListManagedInstancesResponse or
  27534. // error will be non-nil. Any non-2xx status code is an error. Response
  27535. // headers are in either
  27536. // *InstanceGroupManagersListManagedInstancesResponse.ServerResponse.Head
  27537. // er or (if a response was returned at all) in
  27538. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  27539. // whether the returned error was because http.StatusNotModified was
  27540. // returned.
  27541. func (c *InstanceGroupManagersListManagedInstancesCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagersListManagedInstancesResponse, error) {
  27542. gensupport.SetOptions(c.urlParams_, opts...)
  27543. res, err := c.doRequest("json")
  27544. if res != nil && res.StatusCode == http.StatusNotModified {
  27545. if res.Body != nil {
  27546. res.Body.Close()
  27547. }
  27548. return nil, &googleapi.Error{
  27549. Code: res.StatusCode,
  27550. Header: res.Header,
  27551. }
  27552. }
  27553. if err != nil {
  27554. return nil, err
  27555. }
  27556. defer googleapi.CloseBody(res)
  27557. if err := googleapi.CheckResponse(res); err != nil {
  27558. return nil, err
  27559. }
  27560. ret := &InstanceGroupManagersListManagedInstancesResponse{
  27561. ServerResponse: googleapi.ServerResponse{
  27562. Header: res.Header,
  27563. HTTPStatusCode: res.StatusCode,
  27564. },
  27565. }
  27566. target := &ret
  27567. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  27568. return nil, err
  27569. }
  27570. return ret, nil
  27571. // {
  27572. // "description": "Lists all of the instances in the managed instance group. Each instance in the list has a currentAction, which indicates the action that the managed instance group is performing on the instance. For example, if the group is still creating an instance, the currentAction is CREATING. If a previous action failed, the list displays the errors for that failed action.",
  27573. // "httpMethod": "POST",
  27574. // "id": "compute.instanceGroupManagers.listManagedInstances",
  27575. // "parameterOrder": [
  27576. // "project",
  27577. // "zone",
  27578. // "instanceGroupManager"
  27579. // ],
  27580. // "parameters": {
  27581. // "filter": {
  27582. // "location": "query",
  27583. // "type": "string"
  27584. // },
  27585. // "instanceGroupManager": {
  27586. // "description": "The name of the managed instance group.",
  27587. // "location": "path",
  27588. // "required": true,
  27589. // "type": "string"
  27590. // },
  27591. // "maxResults": {
  27592. // "default": "500",
  27593. // "format": "uint32",
  27594. // "location": "query",
  27595. // "minimum": "0",
  27596. // "type": "integer"
  27597. // },
  27598. // "order_by": {
  27599. // "location": "query",
  27600. // "type": "string"
  27601. // },
  27602. // "pageToken": {
  27603. // "location": "query",
  27604. // "type": "string"
  27605. // },
  27606. // "project": {
  27607. // "description": "Project ID for this request.",
  27608. // "location": "path",
  27609. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  27610. // "required": true,
  27611. // "type": "string"
  27612. // },
  27613. // "zone": {
  27614. // "description": "The name of the zone where the managed instance group is located.",
  27615. // "location": "path",
  27616. // "required": true,
  27617. // "type": "string"
  27618. // }
  27619. // },
  27620. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances",
  27621. // "response": {
  27622. // "$ref": "InstanceGroupManagersListManagedInstancesResponse"
  27623. // },
  27624. // "scopes": [
  27625. // "https://www.googleapis.com/auth/cloud-platform",
  27626. // "https://www.googleapis.com/auth/compute",
  27627. // "https://www.googleapis.com/auth/compute.readonly"
  27628. // ]
  27629. // }
  27630. }
  27631. // method id "compute.instanceGroupManagers.recreateInstances":
  27632. type InstanceGroupManagersRecreateInstancesCall struct {
  27633. s *Service
  27634. project string
  27635. zone string
  27636. instanceGroupManager string
  27637. instancegroupmanagersrecreateinstancesrequest *InstanceGroupManagersRecreateInstancesRequest
  27638. urlParams_ gensupport.URLParams
  27639. ctx_ context.Context
  27640. header_ http.Header
  27641. }
  27642. // RecreateInstances: Schedules a group action to recreate the specified
  27643. // instances in the managed instance group. The instances are deleted
  27644. // and recreated using the current instance template for the managed
  27645. // instance group. This operation is marked as DONE when the action is
  27646. // scheduled even if the instances have not yet been recreated. You must
  27647. // separately verify the status of the recreating action with the
  27648. // listmanagedinstances method.
  27649. //
  27650. // If the group is part of a backend service that has enabled connection
  27651. // draining, it can take up to 60 seconds after the connection draining
  27652. // duration has elapsed before the VM instance is removed or
  27653. // deleted.
  27654. //
  27655. // You can specify a maximum of 1000 instances with this method per
  27656. // request.
  27657. func (r *InstanceGroupManagersService) RecreateInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersrecreateinstancesrequest *InstanceGroupManagersRecreateInstancesRequest) *InstanceGroupManagersRecreateInstancesCall {
  27658. c := &InstanceGroupManagersRecreateInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27659. c.project = project
  27660. c.zone = zone
  27661. c.instanceGroupManager = instanceGroupManager
  27662. c.instancegroupmanagersrecreateinstancesrequest = instancegroupmanagersrecreateinstancesrequest
  27663. return c
  27664. }
  27665. // Fields allows partial responses to be retrieved. See
  27666. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27667. // for more information.
  27668. func (c *InstanceGroupManagersRecreateInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersRecreateInstancesCall {
  27669. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27670. return c
  27671. }
  27672. // Context sets the context to be used in this call's Do method. Any
  27673. // pending HTTP request will be aborted if the provided context is
  27674. // canceled.
  27675. func (c *InstanceGroupManagersRecreateInstancesCall) Context(ctx context.Context) *InstanceGroupManagersRecreateInstancesCall {
  27676. c.ctx_ = ctx
  27677. return c
  27678. }
  27679. // Header returns an http.Header that can be modified by the caller to
  27680. // add HTTP headers to the request.
  27681. func (c *InstanceGroupManagersRecreateInstancesCall) Header() http.Header {
  27682. if c.header_ == nil {
  27683. c.header_ = make(http.Header)
  27684. }
  27685. return c.header_
  27686. }
  27687. func (c *InstanceGroupManagersRecreateInstancesCall) doRequest(alt string) (*http.Response, error) {
  27688. reqHeaders := make(http.Header)
  27689. for k, v := range c.header_ {
  27690. reqHeaders[k] = v
  27691. }
  27692. reqHeaders.Set("User-Agent", c.s.userAgent())
  27693. var body io.Reader = nil
  27694. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersrecreateinstancesrequest)
  27695. if err != nil {
  27696. return nil, err
  27697. }
  27698. reqHeaders.Set("Content-Type", "application/json")
  27699. c.urlParams_.Set("alt", alt)
  27700. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances")
  27701. urls += "?" + c.urlParams_.Encode()
  27702. req, _ := http.NewRequest("POST", urls, body)
  27703. req.Header = reqHeaders
  27704. googleapi.Expand(req.URL, map[string]string{
  27705. "project": c.project,
  27706. "zone": c.zone,
  27707. "instanceGroupManager": c.instanceGroupManager,
  27708. })
  27709. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27710. }
  27711. // Do executes the "compute.instanceGroupManagers.recreateInstances" call.
  27712. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  27713. // status code is an error. Response headers are in either
  27714. // *Operation.ServerResponse.Header or (if a response was returned at
  27715. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  27716. // to check whether the returned error was because
  27717. // http.StatusNotModified was returned.
  27718. func (c *InstanceGroupManagersRecreateInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  27719. gensupport.SetOptions(c.urlParams_, opts...)
  27720. res, err := c.doRequest("json")
  27721. if res != nil && res.StatusCode == http.StatusNotModified {
  27722. if res.Body != nil {
  27723. res.Body.Close()
  27724. }
  27725. return nil, &googleapi.Error{
  27726. Code: res.StatusCode,
  27727. Header: res.Header,
  27728. }
  27729. }
  27730. if err != nil {
  27731. return nil, err
  27732. }
  27733. defer googleapi.CloseBody(res)
  27734. if err := googleapi.CheckResponse(res); err != nil {
  27735. return nil, err
  27736. }
  27737. ret := &Operation{
  27738. ServerResponse: googleapi.ServerResponse{
  27739. Header: res.Header,
  27740. HTTPStatusCode: res.StatusCode,
  27741. },
  27742. }
  27743. target := &ret
  27744. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  27745. return nil, err
  27746. }
  27747. return ret, nil
  27748. // {
  27749. // "description": "Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.\n\nYou can specify a maximum of 1000 instances with this method per request.",
  27750. // "httpMethod": "POST",
  27751. // "id": "compute.instanceGroupManagers.recreateInstances",
  27752. // "parameterOrder": [
  27753. // "project",
  27754. // "zone",
  27755. // "instanceGroupManager"
  27756. // ],
  27757. // "parameters": {
  27758. // "instanceGroupManager": {
  27759. // "description": "The name of the managed instance group.",
  27760. // "location": "path",
  27761. // "required": true,
  27762. // "type": "string"
  27763. // },
  27764. // "project": {
  27765. // "description": "Project ID for this request.",
  27766. // "location": "path",
  27767. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  27768. // "required": true,
  27769. // "type": "string"
  27770. // },
  27771. // "zone": {
  27772. // "description": "The name of the zone where the managed instance group is located.",
  27773. // "location": "path",
  27774. // "required": true,
  27775. // "type": "string"
  27776. // }
  27777. // },
  27778. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances",
  27779. // "request": {
  27780. // "$ref": "InstanceGroupManagersRecreateInstancesRequest"
  27781. // },
  27782. // "response": {
  27783. // "$ref": "Operation"
  27784. // },
  27785. // "scopes": [
  27786. // "https://www.googleapis.com/auth/cloud-platform",
  27787. // "https://www.googleapis.com/auth/compute"
  27788. // ]
  27789. // }
  27790. }
  27791. // method id "compute.instanceGroupManagers.resize":
  27792. type InstanceGroupManagersResizeCall struct {
  27793. s *Service
  27794. project string
  27795. zone string
  27796. instanceGroupManager string
  27797. urlParams_ gensupport.URLParams
  27798. ctx_ context.Context
  27799. header_ http.Header
  27800. }
  27801. // Resize: Resizes the managed instance group. If you increase the size,
  27802. // the group creates new instances using the current instance template.
  27803. // If you decrease the size, the group deletes instances. The resize
  27804. // operation is marked DONE when the resize actions are scheduled even
  27805. // if the group has not yet added or deleted any instances. You must
  27806. // separately verify the status of the creating or deleting actions with
  27807. // the listmanagedinstances method.
  27808. //
  27809. // If the group is part of a backend service that has enabled connection
  27810. // draining, it can take up to 60 seconds after the connection draining
  27811. // duration has elapsed before the VM instance is removed or deleted.
  27812. func (r *InstanceGroupManagersService) Resize(project string, zone string, instanceGroupManager string, size int64) *InstanceGroupManagersResizeCall {
  27813. c := &InstanceGroupManagersResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27814. c.project = project
  27815. c.zone = zone
  27816. c.instanceGroupManager = instanceGroupManager
  27817. c.urlParams_.Set("size", fmt.Sprint(size))
  27818. return c
  27819. }
  27820. // Fields allows partial responses to be retrieved. See
  27821. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27822. // for more information.
  27823. func (c *InstanceGroupManagersResizeCall) Fields(s ...googleapi.Field) *InstanceGroupManagersResizeCall {
  27824. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27825. return c
  27826. }
  27827. // Context sets the context to be used in this call's Do method. Any
  27828. // pending HTTP request will be aborted if the provided context is
  27829. // canceled.
  27830. func (c *InstanceGroupManagersResizeCall) Context(ctx context.Context) *InstanceGroupManagersResizeCall {
  27831. c.ctx_ = ctx
  27832. return c
  27833. }
  27834. // Header returns an http.Header that can be modified by the caller to
  27835. // add HTTP headers to the request.
  27836. func (c *InstanceGroupManagersResizeCall) Header() http.Header {
  27837. if c.header_ == nil {
  27838. c.header_ = make(http.Header)
  27839. }
  27840. return c.header_
  27841. }
  27842. func (c *InstanceGroupManagersResizeCall) doRequest(alt string) (*http.Response, error) {
  27843. reqHeaders := make(http.Header)
  27844. for k, v := range c.header_ {
  27845. reqHeaders[k] = v
  27846. }
  27847. reqHeaders.Set("User-Agent", c.s.userAgent())
  27848. var body io.Reader = nil
  27849. c.urlParams_.Set("alt", alt)
  27850. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize")
  27851. urls += "?" + c.urlParams_.Encode()
  27852. req, _ := http.NewRequest("POST", urls, body)
  27853. req.Header = reqHeaders
  27854. googleapi.Expand(req.URL, map[string]string{
  27855. "project": c.project,
  27856. "zone": c.zone,
  27857. "instanceGroupManager": c.instanceGroupManager,
  27858. })
  27859. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27860. }
  27861. // Do executes the "compute.instanceGroupManagers.resize" call.
  27862. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  27863. // status code is an error. Response headers are in either
  27864. // *Operation.ServerResponse.Header or (if a response was returned at
  27865. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  27866. // to check whether the returned error was because
  27867. // http.StatusNotModified was returned.
  27868. func (c *InstanceGroupManagersResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  27869. gensupport.SetOptions(c.urlParams_, opts...)
  27870. res, err := c.doRequest("json")
  27871. if res != nil && res.StatusCode == http.StatusNotModified {
  27872. if res.Body != nil {
  27873. res.Body.Close()
  27874. }
  27875. return nil, &googleapi.Error{
  27876. Code: res.StatusCode,
  27877. Header: res.Header,
  27878. }
  27879. }
  27880. if err != nil {
  27881. return nil, err
  27882. }
  27883. defer googleapi.CloseBody(res)
  27884. if err := googleapi.CheckResponse(res); err != nil {
  27885. return nil, err
  27886. }
  27887. ret := &Operation{
  27888. ServerResponse: googleapi.ServerResponse{
  27889. Header: res.Header,
  27890. HTTPStatusCode: res.StatusCode,
  27891. },
  27892. }
  27893. target := &ret
  27894. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  27895. return nil, err
  27896. }
  27897. return ret, nil
  27898. // {
  27899. // "description": "Resizes the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.",
  27900. // "httpMethod": "POST",
  27901. // "id": "compute.instanceGroupManagers.resize",
  27902. // "parameterOrder": [
  27903. // "project",
  27904. // "zone",
  27905. // "instanceGroupManager",
  27906. // "size"
  27907. // ],
  27908. // "parameters": {
  27909. // "instanceGroupManager": {
  27910. // "description": "The name of the managed instance group.",
  27911. // "location": "path",
  27912. // "required": true,
  27913. // "type": "string"
  27914. // },
  27915. // "project": {
  27916. // "description": "Project ID for this request.",
  27917. // "location": "path",
  27918. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  27919. // "required": true,
  27920. // "type": "string"
  27921. // },
  27922. // "size": {
  27923. // "description": "The number of running instances that the managed instance group should maintain at any given time. The group automatically adds or removes instances to maintain the number of instances specified by this parameter.",
  27924. // "format": "int32",
  27925. // "location": "query",
  27926. // "required": true,
  27927. // "type": "integer"
  27928. // },
  27929. // "zone": {
  27930. // "description": "The name of the zone where the managed instance group is located.",
  27931. // "location": "path",
  27932. // "required": true,
  27933. // "type": "string"
  27934. // }
  27935. // },
  27936. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize",
  27937. // "response": {
  27938. // "$ref": "Operation"
  27939. // },
  27940. // "scopes": [
  27941. // "https://www.googleapis.com/auth/cloud-platform",
  27942. // "https://www.googleapis.com/auth/compute"
  27943. // ]
  27944. // }
  27945. }
  27946. // method id "compute.instanceGroupManagers.setInstanceTemplate":
  27947. type InstanceGroupManagersSetInstanceTemplateCall struct {
  27948. s *Service
  27949. project string
  27950. zone string
  27951. instanceGroupManager string
  27952. instancegroupmanagerssetinstancetemplaterequest *InstanceGroupManagersSetInstanceTemplateRequest
  27953. urlParams_ gensupport.URLParams
  27954. ctx_ context.Context
  27955. header_ http.Header
  27956. }
  27957. // SetInstanceTemplate: Specifies the instance template to use when
  27958. // creating new instances in this group. The templates for existing
  27959. // instances in the group do not change unless you recreate them.
  27960. func (r *InstanceGroupManagersService) SetInstanceTemplate(project string, zone string, instanceGroupManager string, instancegroupmanagerssetinstancetemplaterequest *InstanceGroupManagersSetInstanceTemplateRequest) *InstanceGroupManagersSetInstanceTemplateCall {
  27961. c := &InstanceGroupManagersSetInstanceTemplateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27962. c.project = project
  27963. c.zone = zone
  27964. c.instanceGroupManager = instanceGroupManager
  27965. c.instancegroupmanagerssetinstancetemplaterequest = instancegroupmanagerssetinstancetemplaterequest
  27966. return c
  27967. }
  27968. // Fields allows partial responses to be retrieved. See
  27969. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27970. // for more information.
  27971. func (c *InstanceGroupManagersSetInstanceTemplateCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetInstanceTemplateCall {
  27972. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27973. return c
  27974. }
  27975. // Context sets the context to be used in this call's Do method. Any
  27976. // pending HTTP request will be aborted if the provided context is
  27977. // canceled.
  27978. func (c *InstanceGroupManagersSetInstanceTemplateCall) Context(ctx context.Context) *InstanceGroupManagersSetInstanceTemplateCall {
  27979. c.ctx_ = ctx
  27980. return c
  27981. }
  27982. // Header returns an http.Header that can be modified by the caller to
  27983. // add HTTP headers to the request.
  27984. func (c *InstanceGroupManagersSetInstanceTemplateCall) Header() http.Header {
  27985. if c.header_ == nil {
  27986. c.header_ = make(http.Header)
  27987. }
  27988. return c.header_
  27989. }
  27990. func (c *InstanceGroupManagersSetInstanceTemplateCall) doRequest(alt string) (*http.Response, error) {
  27991. reqHeaders := make(http.Header)
  27992. for k, v := range c.header_ {
  27993. reqHeaders[k] = v
  27994. }
  27995. reqHeaders.Set("User-Agent", c.s.userAgent())
  27996. var body io.Reader = nil
  27997. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssetinstancetemplaterequest)
  27998. if err != nil {
  27999. return nil, err
  28000. }
  28001. reqHeaders.Set("Content-Type", "application/json")
  28002. c.urlParams_.Set("alt", alt)
  28003. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate")
  28004. urls += "?" + c.urlParams_.Encode()
  28005. req, _ := http.NewRequest("POST", urls, body)
  28006. req.Header = reqHeaders
  28007. googleapi.Expand(req.URL, map[string]string{
  28008. "project": c.project,
  28009. "zone": c.zone,
  28010. "instanceGroupManager": c.instanceGroupManager,
  28011. })
  28012. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28013. }
  28014. // Do executes the "compute.instanceGroupManagers.setInstanceTemplate" call.
  28015. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  28016. // status code is an error. Response headers are in either
  28017. // *Operation.ServerResponse.Header or (if a response was returned at
  28018. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  28019. // to check whether the returned error was because
  28020. // http.StatusNotModified was returned.
  28021. func (c *InstanceGroupManagersSetInstanceTemplateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  28022. gensupport.SetOptions(c.urlParams_, opts...)
  28023. res, err := c.doRequest("json")
  28024. if res != nil && res.StatusCode == http.StatusNotModified {
  28025. if res.Body != nil {
  28026. res.Body.Close()
  28027. }
  28028. return nil, &googleapi.Error{
  28029. Code: res.StatusCode,
  28030. Header: res.Header,
  28031. }
  28032. }
  28033. if err != nil {
  28034. return nil, err
  28035. }
  28036. defer googleapi.CloseBody(res)
  28037. if err := googleapi.CheckResponse(res); err != nil {
  28038. return nil, err
  28039. }
  28040. ret := &Operation{
  28041. ServerResponse: googleapi.ServerResponse{
  28042. Header: res.Header,
  28043. HTTPStatusCode: res.StatusCode,
  28044. },
  28045. }
  28046. target := &ret
  28047. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  28048. return nil, err
  28049. }
  28050. return ret, nil
  28051. // {
  28052. // "description": "Specifies the instance template to use when creating new instances in this group. The templates for existing instances in the group do not change unless you recreate them.",
  28053. // "httpMethod": "POST",
  28054. // "id": "compute.instanceGroupManagers.setInstanceTemplate",
  28055. // "parameterOrder": [
  28056. // "project",
  28057. // "zone",
  28058. // "instanceGroupManager"
  28059. // ],
  28060. // "parameters": {
  28061. // "instanceGroupManager": {
  28062. // "description": "The name of the managed instance group.",
  28063. // "location": "path",
  28064. // "required": true,
  28065. // "type": "string"
  28066. // },
  28067. // "project": {
  28068. // "description": "Project ID for this request.",
  28069. // "location": "path",
  28070. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  28071. // "required": true,
  28072. // "type": "string"
  28073. // },
  28074. // "zone": {
  28075. // "description": "The name of the zone where the managed instance group is located.",
  28076. // "location": "path",
  28077. // "required": true,
  28078. // "type": "string"
  28079. // }
  28080. // },
  28081. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate",
  28082. // "request": {
  28083. // "$ref": "InstanceGroupManagersSetInstanceTemplateRequest"
  28084. // },
  28085. // "response": {
  28086. // "$ref": "Operation"
  28087. // },
  28088. // "scopes": [
  28089. // "https://www.googleapis.com/auth/cloud-platform",
  28090. // "https://www.googleapis.com/auth/compute"
  28091. // ]
  28092. // }
  28093. }
  28094. // method id "compute.instanceGroupManagers.setTargetPools":
  28095. type InstanceGroupManagersSetTargetPoolsCall struct {
  28096. s *Service
  28097. project string
  28098. zone string
  28099. instanceGroupManager string
  28100. instancegroupmanagerssettargetpoolsrequest *InstanceGroupManagersSetTargetPoolsRequest
  28101. urlParams_ gensupport.URLParams
  28102. ctx_ context.Context
  28103. header_ http.Header
  28104. }
  28105. // SetTargetPools: Modifies the target pools to which all instances in
  28106. // this managed instance group are assigned. The target pools
  28107. // automatically apply to all of the instances in the managed instance
  28108. // group. This operation is marked DONE when you make the request even
  28109. // if the instances have not yet been added to their target pools. The
  28110. // change might take some time to apply to all of the instances in the
  28111. // group depending on the size of the group.
  28112. func (r *InstanceGroupManagersService) SetTargetPools(project string, zone string, instanceGroupManager string, instancegroupmanagerssettargetpoolsrequest *InstanceGroupManagersSetTargetPoolsRequest) *InstanceGroupManagersSetTargetPoolsCall {
  28113. c := &InstanceGroupManagersSetTargetPoolsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28114. c.project = project
  28115. c.zone = zone
  28116. c.instanceGroupManager = instanceGroupManager
  28117. c.instancegroupmanagerssettargetpoolsrequest = instancegroupmanagerssettargetpoolsrequest
  28118. return c
  28119. }
  28120. // Fields allows partial responses to be retrieved. See
  28121. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28122. // for more information.
  28123. func (c *InstanceGroupManagersSetTargetPoolsCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetTargetPoolsCall {
  28124. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28125. return c
  28126. }
  28127. // Context sets the context to be used in this call's Do method. Any
  28128. // pending HTTP request will be aborted if the provided context is
  28129. // canceled.
  28130. func (c *InstanceGroupManagersSetTargetPoolsCall) Context(ctx context.Context) *InstanceGroupManagersSetTargetPoolsCall {
  28131. c.ctx_ = ctx
  28132. return c
  28133. }
  28134. // Header returns an http.Header that can be modified by the caller to
  28135. // add HTTP headers to the request.
  28136. func (c *InstanceGroupManagersSetTargetPoolsCall) Header() http.Header {
  28137. if c.header_ == nil {
  28138. c.header_ = make(http.Header)
  28139. }
  28140. return c.header_
  28141. }
  28142. func (c *InstanceGroupManagersSetTargetPoolsCall) doRequest(alt string) (*http.Response, error) {
  28143. reqHeaders := make(http.Header)
  28144. for k, v := range c.header_ {
  28145. reqHeaders[k] = v
  28146. }
  28147. reqHeaders.Set("User-Agent", c.s.userAgent())
  28148. var body io.Reader = nil
  28149. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssettargetpoolsrequest)
  28150. if err != nil {
  28151. return nil, err
  28152. }
  28153. reqHeaders.Set("Content-Type", "application/json")
  28154. c.urlParams_.Set("alt", alt)
  28155. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools")
  28156. urls += "?" + c.urlParams_.Encode()
  28157. req, _ := http.NewRequest("POST", urls, body)
  28158. req.Header = reqHeaders
  28159. googleapi.Expand(req.URL, map[string]string{
  28160. "project": c.project,
  28161. "zone": c.zone,
  28162. "instanceGroupManager": c.instanceGroupManager,
  28163. })
  28164. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28165. }
  28166. // Do executes the "compute.instanceGroupManagers.setTargetPools" call.
  28167. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  28168. // status code is an error. Response headers are in either
  28169. // *Operation.ServerResponse.Header or (if a response was returned at
  28170. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  28171. // to check whether the returned error was because
  28172. // http.StatusNotModified was returned.
  28173. func (c *InstanceGroupManagersSetTargetPoolsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  28174. gensupport.SetOptions(c.urlParams_, opts...)
  28175. res, err := c.doRequest("json")
  28176. if res != nil && res.StatusCode == http.StatusNotModified {
  28177. if res.Body != nil {
  28178. res.Body.Close()
  28179. }
  28180. return nil, &googleapi.Error{
  28181. Code: res.StatusCode,
  28182. Header: res.Header,
  28183. }
  28184. }
  28185. if err != nil {
  28186. return nil, err
  28187. }
  28188. defer googleapi.CloseBody(res)
  28189. if err := googleapi.CheckResponse(res); err != nil {
  28190. return nil, err
  28191. }
  28192. ret := &Operation{
  28193. ServerResponse: googleapi.ServerResponse{
  28194. Header: res.Header,
  28195. HTTPStatusCode: res.StatusCode,
  28196. },
  28197. }
  28198. target := &ret
  28199. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  28200. return nil, err
  28201. }
  28202. return ret, nil
  28203. // {
  28204. // "description": "Modifies the target pools to which all instances in this managed instance group are assigned. The target pools automatically apply to all of the instances in the managed instance group. This operation is marked DONE when you make the request even if the instances have not yet been added to their target pools. The change might take some time to apply to all of the instances in the group depending on the size of the group.",
  28205. // "httpMethod": "POST",
  28206. // "id": "compute.instanceGroupManagers.setTargetPools",
  28207. // "parameterOrder": [
  28208. // "project",
  28209. // "zone",
  28210. // "instanceGroupManager"
  28211. // ],
  28212. // "parameters": {
  28213. // "instanceGroupManager": {
  28214. // "description": "The name of the managed instance group.",
  28215. // "location": "path",
  28216. // "required": true,
  28217. // "type": "string"
  28218. // },
  28219. // "project": {
  28220. // "description": "Project ID for this request.",
  28221. // "location": "path",
  28222. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  28223. // "required": true,
  28224. // "type": "string"
  28225. // },
  28226. // "zone": {
  28227. // "description": "The name of the zone where the managed instance group is located.",
  28228. // "location": "path",
  28229. // "required": true,
  28230. // "type": "string"
  28231. // }
  28232. // },
  28233. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools",
  28234. // "request": {
  28235. // "$ref": "InstanceGroupManagersSetTargetPoolsRequest"
  28236. // },
  28237. // "response": {
  28238. // "$ref": "Operation"
  28239. // },
  28240. // "scopes": [
  28241. // "https://www.googleapis.com/auth/cloud-platform",
  28242. // "https://www.googleapis.com/auth/compute"
  28243. // ]
  28244. // }
  28245. }
  28246. // method id "compute.instanceGroups.addInstances":
  28247. type InstanceGroupsAddInstancesCall struct {
  28248. s *Service
  28249. project string
  28250. zone string
  28251. instanceGroup string
  28252. instancegroupsaddinstancesrequest *InstanceGroupsAddInstancesRequest
  28253. urlParams_ gensupport.URLParams
  28254. ctx_ context.Context
  28255. header_ http.Header
  28256. }
  28257. // AddInstances: Adds a list of instances to the specified instance
  28258. // group. All of the instances in the instance group must be in the same
  28259. // network/subnetwork. Read Adding instances for more information.
  28260. func (r *InstanceGroupsService) AddInstances(project string, zone string, instanceGroup string, instancegroupsaddinstancesrequest *InstanceGroupsAddInstancesRequest) *InstanceGroupsAddInstancesCall {
  28261. c := &InstanceGroupsAddInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28262. c.project = project
  28263. c.zone = zone
  28264. c.instanceGroup = instanceGroup
  28265. c.instancegroupsaddinstancesrequest = instancegroupsaddinstancesrequest
  28266. return c
  28267. }
  28268. // Fields allows partial responses to be retrieved. See
  28269. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28270. // for more information.
  28271. func (c *InstanceGroupsAddInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsAddInstancesCall {
  28272. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28273. return c
  28274. }
  28275. // Context sets the context to be used in this call's Do method. Any
  28276. // pending HTTP request will be aborted if the provided context is
  28277. // canceled.
  28278. func (c *InstanceGroupsAddInstancesCall) Context(ctx context.Context) *InstanceGroupsAddInstancesCall {
  28279. c.ctx_ = ctx
  28280. return c
  28281. }
  28282. // Header returns an http.Header that can be modified by the caller to
  28283. // add HTTP headers to the request.
  28284. func (c *InstanceGroupsAddInstancesCall) Header() http.Header {
  28285. if c.header_ == nil {
  28286. c.header_ = make(http.Header)
  28287. }
  28288. return c.header_
  28289. }
  28290. func (c *InstanceGroupsAddInstancesCall) doRequest(alt string) (*http.Response, error) {
  28291. reqHeaders := make(http.Header)
  28292. for k, v := range c.header_ {
  28293. reqHeaders[k] = v
  28294. }
  28295. reqHeaders.Set("User-Agent", c.s.userAgent())
  28296. var body io.Reader = nil
  28297. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupsaddinstancesrequest)
  28298. if err != nil {
  28299. return nil, err
  28300. }
  28301. reqHeaders.Set("Content-Type", "application/json")
  28302. c.urlParams_.Set("alt", alt)
  28303. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances")
  28304. urls += "?" + c.urlParams_.Encode()
  28305. req, _ := http.NewRequest("POST", urls, body)
  28306. req.Header = reqHeaders
  28307. googleapi.Expand(req.URL, map[string]string{
  28308. "project": c.project,
  28309. "zone": c.zone,
  28310. "instanceGroup": c.instanceGroup,
  28311. })
  28312. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28313. }
  28314. // Do executes the "compute.instanceGroups.addInstances" call.
  28315. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  28316. // status code is an error. Response headers are in either
  28317. // *Operation.ServerResponse.Header or (if a response was returned at
  28318. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  28319. // to check whether the returned error was because
  28320. // http.StatusNotModified was returned.
  28321. func (c *InstanceGroupsAddInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  28322. gensupport.SetOptions(c.urlParams_, opts...)
  28323. res, err := c.doRequest("json")
  28324. if res != nil && res.StatusCode == http.StatusNotModified {
  28325. if res.Body != nil {
  28326. res.Body.Close()
  28327. }
  28328. return nil, &googleapi.Error{
  28329. Code: res.StatusCode,
  28330. Header: res.Header,
  28331. }
  28332. }
  28333. if err != nil {
  28334. return nil, err
  28335. }
  28336. defer googleapi.CloseBody(res)
  28337. if err := googleapi.CheckResponse(res); err != nil {
  28338. return nil, err
  28339. }
  28340. ret := &Operation{
  28341. ServerResponse: googleapi.ServerResponse{
  28342. Header: res.Header,
  28343. HTTPStatusCode: res.StatusCode,
  28344. },
  28345. }
  28346. target := &ret
  28347. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  28348. return nil, err
  28349. }
  28350. return ret, nil
  28351. // {
  28352. // "description": "Adds a list of instances to the specified instance group. All of the instances in the instance group must be in the same network/subnetwork. Read Adding instances for more information.",
  28353. // "httpMethod": "POST",
  28354. // "id": "compute.instanceGroups.addInstances",
  28355. // "parameterOrder": [
  28356. // "project",
  28357. // "zone",
  28358. // "instanceGroup"
  28359. // ],
  28360. // "parameters": {
  28361. // "instanceGroup": {
  28362. // "description": "The name of the instance group where you are adding instances.",
  28363. // "location": "path",
  28364. // "required": true,
  28365. // "type": "string"
  28366. // },
  28367. // "project": {
  28368. // "description": "Project ID for this request.",
  28369. // "location": "path",
  28370. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  28371. // "required": true,
  28372. // "type": "string"
  28373. // },
  28374. // "zone": {
  28375. // "description": "The name of the zone where the instance group is located.",
  28376. // "location": "path",
  28377. // "required": true,
  28378. // "type": "string"
  28379. // }
  28380. // },
  28381. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances",
  28382. // "request": {
  28383. // "$ref": "InstanceGroupsAddInstancesRequest"
  28384. // },
  28385. // "response": {
  28386. // "$ref": "Operation"
  28387. // },
  28388. // "scopes": [
  28389. // "https://www.googleapis.com/auth/cloud-platform",
  28390. // "https://www.googleapis.com/auth/compute"
  28391. // ]
  28392. // }
  28393. }
  28394. // method id "compute.instanceGroups.aggregatedList":
  28395. type InstanceGroupsAggregatedListCall struct {
  28396. s *Service
  28397. project string
  28398. urlParams_ gensupport.URLParams
  28399. ifNoneMatch_ string
  28400. ctx_ context.Context
  28401. header_ http.Header
  28402. }
  28403. // AggregatedList: Retrieves the list of instance groups and sorts them
  28404. // by zone.
  28405. func (r *InstanceGroupsService) AggregatedList(project string) *InstanceGroupsAggregatedListCall {
  28406. c := &InstanceGroupsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28407. c.project = project
  28408. return c
  28409. }
  28410. // Filter sets the optional parameter "filter": Sets a filter
  28411. // {expression} for filtering listed resources. Your {expression} must
  28412. // be in the format: field_name comparison_string literal_string.
  28413. //
  28414. // The field_name is the name of the field you want to compare. Only
  28415. // atomic field types are supported (string, number, boolean). The
  28416. // comparison_string must be either eq (equals) or ne (not equals). The
  28417. // literal_string is the string value to filter to. The literal value
  28418. // must be valid for the type of field you are filtering by (string,
  28419. // number, boolean). For string fields, the literal value is interpreted
  28420. // as a regular expression using RE2 syntax. The literal value must
  28421. // match the entire field.
  28422. //
  28423. // For example, to filter for instances that do not have a name of
  28424. // example-instance, you would use name ne example-instance.
  28425. //
  28426. // You can filter on nested fields. For example, you could filter on
  28427. // instances that have set the scheduling.automaticRestart field to
  28428. // true. Use filtering on nested fields to take advantage of labels to
  28429. // organize and search for results based on label values.
  28430. //
  28431. // To filter on multiple expressions, provide each separate expression
  28432. // within parentheses. For example, (scheduling.automaticRestart eq
  28433. // true) (zone eq us-central1-f). Multiple expressions are treated as
  28434. // AND expressions, meaning that resources must match all expressions to
  28435. // pass the filters.
  28436. func (c *InstanceGroupsAggregatedListCall) Filter(filter string) *InstanceGroupsAggregatedListCall {
  28437. c.urlParams_.Set("filter", filter)
  28438. return c
  28439. }
  28440. // MaxResults sets the optional parameter "maxResults": The maximum
  28441. // number of results per page that should be returned. If the number of
  28442. // available results is larger than maxResults, Compute Engine returns a
  28443. // nextPageToken that can be used to get the next page of results in
  28444. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  28445. // (Default: 500)
  28446. func (c *InstanceGroupsAggregatedListCall) MaxResults(maxResults int64) *InstanceGroupsAggregatedListCall {
  28447. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  28448. return c
  28449. }
  28450. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  28451. // a certain order. By default, results are returned in alphanumerical
  28452. // order based on the resource name.
  28453. //
  28454. // You can also sort results in descending order based on the creation
  28455. // timestamp using orderBy="creationTimestamp desc". This sorts results
  28456. // based on the creationTimestamp field in reverse chronological order
  28457. // (newest result first). Use this to sort resources like operations so
  28458. // that the newest operation is returned first.
  28459. //
  28460. // Currently, only sorting by name or creationTimestamp desc is
  28461. // supported.
  28462. func (c *InstanceGroupsAggregatedListCall) OrderBy(orderBy string) *InstanceGroupsAggregatedListCall {
  28463. c.urlParams_.Set("orderBy", orderBy)
  28464. return c
  28465. }
  28466. // PageToken sets the optional parameter "pageToken": Specifies a page
  28467. // token to use. Set pageToken to the nextPageToken returned by a
  28468. // previous list request to get the next page of results.
  28469. func (c *InstanceGroupsAggregatedListCall) PageToken(pageToken string) *InstanceGroupsAggregatedListCall {
  28470. c.urlParams_.Set("pageToken", pageToken)
  28471. return c
  28472. }
  28473. // Fields allows partial responses to be retrieved. See
  28474. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28475. // for more information.
  28476. func (c *InstanceGroupsAggregatedListCall) Fields(s ...googleapi.Field) *InstanceGroupsAggregatedListCall {
  28477. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28478. return c
  28479. }
  28480. // IfNoneMatch sets the optional parameter which makes the operation
  28481. // fail if the object's ETag matches the given value. This is useful for
  28482. // getting updates only after the object has changed since the last
  28483. // request. Use googleapi.IsNotModified to check whether the response
  28484. // error from Do is the result of In-None-Match.
  28485. func (c *InstanceGroupsAggregatedListCall) IfNoneMatch(entityTag string) *InstanceGroupsAggregatedListCall {
  28486. c.ifNoneMatch_ = entityTag
  28487. return c
  28488. }
  28489. // Context sets the context to be used in this call's Do method. Any
  28490. // pending HTTP request will be aborted if the provided context is
  28491. // canceled.
  28492. func (c *InstanceGroupsAggregatedListCall) Context(ctx context.Context) *InstanceGroupsAggregatedListCall {
  28493. c.ctx_ = ctx
  28494. return c
  28495. }
  28496. // Header returns an http.Header that can be modified by the caller to
  28497. // add HTTP headers to the request.
  28498. func (c *InstanceGroupsAggregatedListCall) Header() http.Header {
  28499. if c.header_ == nil {
  28500. c.header_ = make(http.Header)
  28501. }
  28502. return c.header_
  28503. }
  28504. func (c *InstanceGroupsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  28505. reqHeaders := make(http.Header)
  28506. for k, v := range c.header_ {
  28507. reqHeaders[k] = v
  28508. }
  28509. reqHeaders.Set("User-Agent", c.s.userAgent())
  28510. if c.ifNoneMatch_ != "" {
  28511. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  28512. }
  28513. var body io.Reader = nil
  28514. c.urlParams_.Set("alt", alt)
  28515. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instanceGroups")
  28516. urls += "?" + c.urlParams_.Encode()
  28517. req, _ := http.NewRequest("GET", urls, body)
  28518. req.Header = reqHeaders
  28519. googleapi.Expand(req.URL, map[string]string{
  28520. "project": c.project,
  28521. })
  28522. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28523. }
  28524. // Do executes the "compute.instanceGroups.aggregatedList" call.
  28525. // Exactly one of *InstanceGroupAggregatedList or error will be non-nil.
  28526. // Any non-2xx status code is an error. Response headers are in either
  28527. // *InstanceGroupAggregatedList.ServerResponse.Header or (if a response
  28528. // was returned at all) in error.(*googleapi.Error).Header. Use
  28529. // googleapi.IsNotModified to check whether the returned error was
  28530. // because http.StatusNotModified was returned.
  28531. func (c *InstanceGroupsAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupAggregatedList, error) {
  28532. gensupport.SetOptions(c.urlParams_, opts...)
  28533. res, err := c.doRequest("json")
  28534. if res != nil && res.StatusCode == http.StatusNotModified {
  28535. if res.Body != nil {
  28536. res.Body.Close()
  28537. }
  28538. return nil, &googleapi.Error{
  28539. Code: res.StatusCode,
  28540. Header: res.Header,
  28541. }
  28542. }
  28543. if err != nil {
  28544. return nil, err
  28545. }
  28546. defer googleapi.CloseBody(res)
  28547. if err := googleapi.CheckResponse(res); err != nil {
  28548. return nil, err
  28549. }
  28550. ret := &InstanceGroupAggregatedList{
  28551. ServerResponse: googleapi.ServerResponse{
  28552. Header: res.Header,
  28553. HTTPStatusCode: res.StatusCode,
  28554. },
  28555. }
  28556. target := &ret
  28557. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  28558. return nil, err
  28559. }
  28560. return ret, nil
  28561. // {
  28562. // "description": "Retrieves the list of instance groups and sorts them by zone.",
  28563. // "httpMethod": "GET",
  28564. // "id": "compute.instanceGroups.aggregatedList",
  28565. // "parameterOrder": [
  28566. // "project"
  28567. // ],
  28568. // "parameters": {
  28569. // "filter": {
  28570. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  28571. // "location": "query",
  28572. // "type": "string"
  28573. // },
  28574. // "maxResults": {
  28575. // "default": "500",
  28576. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  28577. // "format": "uint32",
  28578. // "location": "query",
  28579. // "minimum": "0",
  28580. // "type": "integer"
  28581. // },
  28582. // "orderBy": {
  28583. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  28584. // "location": "query",
  28585. // "type": "string"
  28586. // },
  28587. // "pageToken": {
  28588. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  28589. // "location": "query",
  28590. // "type": "string"
  28591. // },
  28592. // "project": {
  28593. // "description": "Project ID for this request.",
  28594. // "location": "path",
  28595. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  28596. // "required": true,
  28597. // "type": "string"
  28598. // }
  28599. // },
  28600. // "path": "{project}/aggregated/instanceGroups",
  28601. // "response": {
  28602. // "$ref": "InstanceGroupAggregatedList"
  28603. // },
  28604. // "scopes": [
  28605. // "https://www.googleapis.com/auth/cloud-platform",
  28606. // "https://www.googleapis.com/auth/compute",
  28607. // "https://www.googleapis.com/auth/compute.readonly"
  28608. // ]
  28609. // }
  28610. }
  28611. // Pages invokes f for each page of results.
  28612. // A non-nil error returned from f will halt the iteration.
  28613. // The provided context supersedes any context provided to the Context method.
  28614. func (c *InstanceGroupsAggregatedListCall) Pages(ctx context.Context, f func(*InstanceGroupAggregatedList) error) error {
  28615. c.ctx_ = ctx
  28616. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  28617. for {
  28618. x, err := c.Do()
  28619. if err != nil {
  28620. return err
  28621. }
  28622. if err := f(x); err != nil {
  28623. return err
  28624. }
  28625. if x.NextPageToken == "" {
  28626. return nil
  28627. }
  28628. c.PageToken(x.NextPageToken)
  28629. }
  28630. }
  28631. // method id "compute.instanceGroups.delete":
  28632. type InstanceGroupsDeleteCall struct {
  28633. s *Service
  28634. project string
  28635. zone string
  28636. instanceGroup string
  28637. urlParams_ gensupport.URLParams
  28638. ctx_ context.Context
  28639. header_ http.Header
  28640. }
  28641. // Delete: Deletes the specified instance group. The instances in the
  28642. // group are not deleted. Note that instance group must not belong to a
  28643. // backend service. Read Deleting an instance group for more
  28644. // information.
  28645. func (r *InstanceGroupsService) Delete(project string, zone string, instanceGroup string) *InstanceGroupsDeleteCall {
  28646. c := &InstanceGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28647. c.project = project
  28648. c.zone = zone
  28649. c.instanceGroup = instanceGroup
  28650. return c
  28651. }
  28652. // Fields allows partial responses to be retrieved. See
  28653. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28654. // for more information.
  28655. func (c *InstanceGroupsDeleteCall) Fields(s ...googleapi.Field) *InstanceGroupsDeleteCall {
  28656. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28657. return c
  28658. }
  28659. // Context sets the context to be used in this call's Do method. Any
  28660. // pending HTTP request will be aborted if the provided context is
  28661. // canceled.
  28662. func (c *InstanceGroupsDeleteCall) Context(ctx context.Context) *InstanceGroupsDeleteCall {
  28663. c.ctx_ = ctx
  28664. return c
  28665. }
  28666. // Header returns an http.Header that can be modified by the caller to
  28667. // add HTTP headers to the request.
  28668. func (c *InstanceGroupsDeleteCall) Header() http.Header {
  28669. if c.header_ == nil {
  28670. c.header_ = make(http.Header)
  28671. }
  28672. return c.header_
  28673. }
  28674. func (c *InstanceGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
  28675. reqHeaders := make(http.Header)
  28676. for k, v := range c.header_ {
  28677. reqHeaders[k] = v
  28678. }
  28679. reqHeaders.Set("User-Agent", c.s.userAgent())
  28680. var body io.Reader = nil
  28681. c.urlParams_.Set("alt", alt)
  28682. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}")
  28683. urls += "?" + c.urlParams_.Encode()
  28684. req, _ := http.NewRequest("DELETE", urls, body)
  28685. req.Header = reqHeaders
  28686. googleapi.Expand(req.URL, map[string]string{
  28687. "project": c.project,
  28688. "zone": c.zone,
  28689. "instanceGroup": c.instanceGroup,
  28690. })
  28691. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28692. }
  28693. // Do executes the "compute.instanceGroups.delete" call.
  28694. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  28695. // status code is an error. Response headers are in either
  28696. // *Operation.ServerResponse.Header or (if a response was returned at
  28697. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  28698. // to check whether the returned error was because
  28699. // http.StatusNotModified was returned.
  28700. func (c *InstanceGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  28701. gensupport.SetOptions(c.urlParams_, opts...)
  28702. res, err := c.doRequest("json")
  28703. if res != nil && res.StatusCode == http.StatusNotModified {
  28704. if res.Body != nil {
  28705. res.Body.Close()
  28706. }
  28707. return nil, &googleapi.Error{
  28708. Code: res.StatusCode,
  28709. Header: res.Header,
  28710. }
  28711. }
  28712. if err != nil {
  28713. return nil, err
  28714. }
  28715. defer googleapi.CloseBody(res)
  28716. if err := googleapi.CheckResponse(res); err != nil {
  28717. return nil, err
  28718. }
  28719. ret := &Operation{
  28720. ServerResponse: googleapi.ServerResponse{
  28721. Header: res.Header,
  28722. HTTPStatusCode: res.StatusCode,
  28723. },
  28724. }
  28725. target := &ret
  28726. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  28727. return nil, err
  28728. }
  28729. return ret, nil
  28730. // {
  28731. // "description": "Deletes the specified instance group. The instances in the group are not deleted. Note that instance group must not belong to a backend service. Read Deleting an instance group for more information.",
  28732. // "httpMethod": "DELETE",
  28733. // "id": "compute.instanceGroups.delete",
  28734. // "parameterOrder": [
  28735. // "project",
  28736. // "zone",
  28737. // "instanceGroup"
  28738. // ],
  28739. // "parameters": {
  28740. // "instanceGroup": {
  28741. // "description": "The name of the instance group to delete.",
  28742. // "location": "path",
  28743. // "required": true,
  28744. // "type": "string"
  28745. // },
  28746. // "project": {
  28747. // "description": "Project ID for this request.",
  28748. // "location": "path",
  28749. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  28750. // "required": true,
  28751. // "type": "string"
  28752. // },
  28753. // "zone": {
  28754. // "description": "The name of the zone where the instance group is located.",
  28755. // "location": "path",
  28756. // "required": true,
  28757. // "type": "string"
  28758. // }
  28759. // },
  28760. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}",
  28761. // "response": {
  28762. // "$ref": "Operation"
  28763. // },
  28764. // "scopes": [
  28765. // "https://www.googleapis.com/auth/cloud-platform",
  28766. // "https://www.googleapis.com/auth/compute"
  28767. // ]
  28768. // }
  28769. }
  28770. // method id "compute.instanceGroups.get":
  28771. type InstanceGroupsGetCall struct {
  28772. s *Service
  28773. project string
  28774. zone string
  28775. instanceGroup string
  28776. urlParams_ gensupport.URLParams
  28777. ifNoneMatch_ string
  28778. ctx_ context.Context
  28779. header_ http.Header
  28780. }
  28781. // Get: Returns the specified instance group. Get a list of available
  28782. // instance groups by making a list() request.
  28783. func (r *InstanceGroupsService) Get(project string, zone string, instanceGroup string) *InstanceGroupsGetCall {
  28784. c := &InstanceGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28785. c.project = project
  28786. c.zone = zone
  28787. c.instanceGroup = instanceGroup
  28788. return c
  28789. }
  28790. // Fields allows partial responses to be retrieved. See
  28791. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28792. // for more information.
  28793. func (c *InstanceGroupsGetCall) Fields(s ...googleapi.Field) *InstanceGroupsGetCall {
  28794. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28795. return c
  28796. }
  28797. // IfNoneMatch sets the optional parameter which makes the operation
  28798. // fail if the object's ETag matches the given value. This is useful for
  28799. // getting updates only after the object has changed since the last
  28800. // request. Use googleapi.IsNotModified to check whether the response
  28801. // error from Do is the result of In-None-Match.
  28802. func (c *InstanceGroupsGetCall) IfNoneMatch(entityTag string) *InstanceGroupsGetCall {
  28803. c.ifNoneMatch_ = entityTag
  28804. return c
  28805. }
  28806. // Context sets the context to be used in this call's Do method. Any
  28807. // pending HTTP request will be aborted if the provided context is
  28808. // canceled.
  28809. func (c *InstanceGroupsGetCall) Context(ctx context.Context) *InstanceGroupsGetCall {
  28810. c.ctx_ = ctx
  28811. return c
  28812. }
  28813. // Header returns an http.Header that can be modified by the caller to
  28814. // add HTTP headers to the request.
  28815. func (c *InstanceGroupsGetCall) Header() http.Header {
  28816. if c.header_ == nil {
  28817. c.header_ = make(http.Header)
  28818. }
  28819. return c.header_
  28820. }
  28821. func (c *InstanceGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  28822. reqHeaders := make(http.Header)
  28823. for k, v := range c.header_ {
  28824. reqHeaders[k] = v
  28825. }
  28826. reqHeaders.Set("User-Agent", c.s.userAgent())
  28827. if c.ifNoneMatch_ != "" {
  28828. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  28829. }
  28830. var body io.Reader = nil
  28831. c.urlParams_.Set("alt", alt)
  28832. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}")
  28833. urls += "?" + c.urlParams_.Encode()
  28834. req, _ := http.NewRequest("GET", urls, body)
  28835. req.Header = reqHeaders
  28836. googleapi.Expand(req.URL, map[string]string{
  28837. "project": c.project,
  28838. "zone": c.zone,
  28839. "instanceGroup": c.instanceGroup,
  28840. })
  28841. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28842. }
  28843. // Do executes the "compute.instanceGroups.get" call.
  28844. // Exactly one of *InstanceGroup or error will be non-nil. Any non-2xx
  28845. // status code is an error. Response headers are in either
  28846. // *InstanceGroup.ServerResponse.Header or (if a response was returned
  28847. // at all) in error.(*googleapi.Error).Header. Use
  28848. // googleapi.IsNotModified to check whether the returned error was
  28849. // because http.StatusNotModified was returned.
  28850. func (c *InstanceGroupsGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroup, error) {
  28851. gensupport.SetOptions(c.urlParams_, opts...)
  28852. res, err := c.doRequest("json")
  28853. if res != nil && res.StatusCode == http.StatusNotModified {
  28854. if res.Body != nil {
  28855. res.Body.Close()
  28856. }
  28857. return nil, &googleapi.Error{
  28858. Code: res.StatusCode,
  28859. Header: res.Header,
  28860. }
  28861. }
  28862. if err != nil {
  28863. return nil, err
  28864. }
  28865. defer googleapi.CloseBody(res)
  28866. if err := googleapi.CheckResponse(res); err != nil {
  28867. return nil, err
  28868. }
  28869. ret := &InstanceGroup{
  28870. ServerResponse: googleapi.ServerResponse{
  28871. Header: res.Header,
  28872. HTTPStatusCode: res.StatusCode,
  28873. },
  28874. }
  28875. target := &ret
  28876. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  28877. return nil, err
  28878. }
  28879. return ret, nil
  28880. // {
  28881. // "description": "Returns the specified instance group. Get a list of available instance groups by making a list() request.",
  28882. // "httpMethod": "GET",
  28883. // "id": "compute.instanceGroups.get",
  28884. // "parameterOrder": [
  28885. // "project",
  28886. // "zone",
  28887. // "instanceGroup"
  28888. // ],
  28889. // "parameters": {
  28890. // "instanceGroup": {
  28891. // "description": "The name of the instance group.",
  28892. // "location": "path",
  28893. // "required": true,
  28894. // "type": "string"
  28895. // },
  28896. // "project": {
  28897. // "description": "Project ID for this request.",
  28898. // "location": "path",
  28899. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  28900. // "required": true,
  28901. // "type": "string"
  28902. // },
  28903. // "zone": {
  28904. // "description": "The name of the zone where the instance group is located.",
  28905. // "location": "path",
  28906. // "required": true,
  28907. // "type": "string"
  28908. // }
  28909. // },
  28910. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}",
  28911. // "response": {
  28912. // "$ref": "InstanceGroup"
  28913. // },
  28914. // "scopes": [
  28915. // "https://www.googleapis.com/auth/cloud-platform",
  28916. // "https://www.googleapis.com/auth/compute",
  28917. // "https://www.googleapis.com/auth/compute.readonly"
  28918. // ]
  28919. // }
  28920. }
  28921. // method id "compute.instanceGroups.insert":
  28922. type InstanceGroupsInsertCall struct {
  28923. s *Service
  28924. project string
  28925. zone string
  28926. instancegroup *InstanceGroup
  28927. urlParams_ gensupport.URLParams
  28928. ctx_ context.Context
  28929. header_ http.Header
  28930. }
  28931. // Insert: Creates an instance group in the specified project using the
  28932. // parameters that are included in the request.
  28933. func (r *InstanceGroupsService) Insert(project string, zone string, instancegroup *InstanceGroup) *InstanceGroupsInsertCall {
  28934. c := &InstanceGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28935. c.project = project
  28936. c.zone = zone
  28937. c.instancegroup = instancegroup
  28938. return c
  28939. }
  28940. // Fields allows partial responses to be retrieved. See
  28941. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28942. // for more information.
  28943. func (c *InstanceGroupsInsertCall) Fields(s ...googleapi.Field) *InstanceGroupsInsertCall {
  28944. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28945. return c
  28946. }
  28947. // Context sets the context to be used in this call's Do method. Any
  28948. // pending HTTP request will be aborted if the provided context is
  28949. // canceled.
  28950. func (c *InstanceGroupsInsertCall) Context(ctx context.Context) *InstanceGroupsInsertCall {
  28951. c.ctx_ = ctx
  28952. return c
  28953. }
  28954. // Header returns an http.Header that can be modified by the caller to
  28955. // add HTTP headers to the request.
  28956. func (c *InstanceGroupsInsertCall) Header() http.Header {
  28957. if c.header_ == nil {
  28958. c.header_ = make(http.Header)
  28959. }
  28960. return c.header_
  28961. }
  28962. func (c *InstanceGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  28963. reqHeaders := make(http.Header)
  28964. for k, v := range c.header_ {
  28965. reqHeaders[k] = v
  28966. }
  28967. reqHeaders.Set("User-Agent", c.s.userAgent())
  28968. var body io.Reader = nil
  28969. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroup)
  28970. if err != nil {
  28971. return nil, err
  28972. }
  28973. reqHeaders.Set("Content-Type", "application/json")
  28974. c.urlParams_.Set("alt", alt)
  28975. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups")
  28976. urls += "?" + c.urlParams_.Encode()
  28977. req, _ := http.NewRequest("POST", urls, body)
  28978. req.Header = reqHeaders
  28979. googleapi.Expand(req.URL, map[string]string{
  28980. "project": c.project,
  28981. "zone": c.zone,
  28982. })
  28983. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28984. }
  28985. // Do executes the "compute.instanceGroups.insert" call.
  28986. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  28987. // status code is an error. Response headers are in either
  28988. // *Operation.ServerResponse.Header or (if a response was returned at
  28989. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  28990. // to check whether the returned error was because
  28991. // http.StatusNotModified was returned.
  28992. func (c *InstanceGroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  28993. gensupport.SetOptions(c.urlParams_, opts...)
  28994. res, err := c.doRequest("json")
  28995. if res != nil && res.StatusCode == http.StatusNotModified {
  28996. if res.Body != nil {
  28997. res.Body.Close()
  28998. }
  28999. return nil, &googleapi.Error{
  29000. Code: res.StatusCode,
  29001. Header: res.Header,
  29002. }
  29003. }
  29004. if err != nil {
  29005. return nil, err
  29006. }
  29007. defer googleapi.CloseBody(res)
  29008. if err := googleapi.CheckResponse(res); err != nil {
  29009. return nil, err
  29010. }
  29011. ret := &Operation{
  29012. ServerResponse: googleapi.ServerResponse{
  29013. Header: res.Header,
  29014. HTTPStatusCode: res.StatusCode,
  29015. },
  29016. }
  29017. target := &ret
  29018. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  29019. return nil, err
  29020. }
  29021. return ret, nil
  29022. // {
  29023. // "description": "Creates an instance group in the specified project using the parameters that are included in the request.",
  29024. // "httpMethod": "POST",
  29025. // "id": "compute.instanceGroups.insert",
  29026. // "parameterOrder": [
  29027. // "project",
  29028. // "zone"
  29029. // ],
  29030. // "parameters": {
  29031. // "project": {
  29032. // "description": "Project ID for this request.",
  29033. // "location": "path",
  29034. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  29035. // "required": true,
  29036. // "type": "string"
  29037. // },
  29038. // "zone": {
  29039. // "description": "The name of the zone where you want to create the instance group.",
  29040. // "location": "path",
  29041. // "required": true,
  29042. // "type": "string"
  29043. // }
  29044. // },
  29045. // "path": "{project}/zones/{zone}/instanceGroups",
  29046. // "request": {
  29047. // "$ref": "InstanceGroup"
  29048. // },
  29049. // "response": {
  29050. // "$ref": "Operation"
  29051. // },
  29052. // "scopes": [
  29053. // "https://www.googleapis.com/auth/cloud-platform",
  29054. // "https://www.googleapis.com/auth/compute"
  29055. // ]
  29056. // }
  29057. }
  29058. // method id "compute.instanceGroups.list":
  29059. type InstanceGroupsListCall struct {
  29060. s *Service
  29061. project string
  29062. zone string
  29063. urlParams_ gensupport.URLParams
  29064. ifNoneMatch_ string
  29065. ctx_ context.Context
  29066. header_ http.Header
  29067. }
  29068. // List: Retrieves the list of instance groups that are located in the
  29069. // specified project and zone.
  29070. func (r *InstanceGroupsService) List(project string, zone string) *InstanceGroupsListCall {
  29071. c := &InstanceGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29072. c.project = project
  29073. c.zone = zone
  29074. return c
  29075. }
  29076. // Filter sets the optional parameter "filter": Sets a filter
  29077. // {expression} for filtering listed resources. Your {expression} must
  29078. // be in the format: field_name comparison_string literal_string.
  29079. //
  29080. // The field_name is the name of the field you want to compare. Only
  29081. // atomic field types are supported (string, number, boolean). The
  29082. // comparison_string must be either eq (equals) or ne (not equals). The
  29083. // literal_string is the string value to filter to. The literal value
  29084. // must be valid for the type of field you are filtering by (string,
  29085. // number, boolean). For string fields, the literal value is interpreted
  29086. // as a regular expression using RE2 syntax. The literal value must
  29087. // match the entire field.
  29088. //
  29089. // For example, to filter for instances that do not have a name of
  29090. // example-instance, you would use name ne example-instance.
  29091. //
  29092. // You can filter on nested fields. For example, you could filter on
  29093. // instances that have set the scheduling.automaticRestart field to
  29094. // true. Use filtering on nested fields to take advantage of labels to
  29095. // organize and search for results based on label values.
  29096. //
  29097. // To filter on multiple expressions, provide each separate expression
  29098. // within parentheses. For example, (scheduling.automaticRestart eq
  29099. // true) (zone eq us-central1-f). Multiple expressions are treated as
  29100. // AND expressions, meaning that resources must match all expressions to
  29101. // pass the filters.
  29102. func (c *InstanceGroupsListCall) Filter(filter string) *InstanceGroupsListCall {
  29103. c.urlParams_.Set("filter", filter)
  29104. return c
  29105. }
  29106. // MaxResults sets the optional parameter "maxResults": The maximum
  29107. // number of results per page that should be returned. If the number of
  29108. // available results is larger than maxResults, Compute Engine returns a
  29109. // nextPageToken that can be used to get the next page of results in
  29110. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  29111. // (Default: 500)
  29112. func (c *InstanceGroupsListCall) MaxResults(maxResults int64) *InstanceGroupsListCall {
  29113. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  29114. return c
  29115. }
  29116. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  29117. // a certain order. By default, results are returned in alphanumerical
  29118. // order based on the resource name.
  29119. //
  29120. // You can also sort results in descending order based on the creation
  29121. // timestamp using orderBy="creationTimestamp desc". This sorts results
  29122. // based on the creationTimestamp field in reverse chronological order
  29123. // (newest result first). Use this to sort resources like operations so
  29124. // that the newest operation is returned first.
  29125. //
  29126. // Currently, only sorting by name or creationTimestamp desc is
  29127. // supported.
  29128. func (c *InstanceGroupsListCall) OrderBy(orderBy string) *InstanceGroupsListCall {
  29129. c.urlParams_.Set("orderBy", orderBy)
  29130. return c
  29131. }
  29132. // PageToken sets the optional parameter "pageToken": Specifies a page
  29133. // token to use. Set pageToken to the nextPageToken returned by a
  29134. // previous list request to get the next page of results.
  29135. func (c *InstanceGroupsListCall) PageToken(pageToken string) *InstanceGroupsListCall {
  29136. c.urlParams_.Set("pageToken", pageToken)
  29137. return c
  29138. }
  29139. // Fields allows partial responses to be retrieved. See
  29140. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29141. // for more information.
  29142. func (c *InstanceGroupsListCall) Fields(s ...googleapi.Field) *InstanceGroupsListCall {
  29143. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29144. return c
  29145. }
  29146. // IfNoneMatch sets the optional parameter which makes the operation
  29147. // fail if the object's ETag matches the given value. This is useful for
  29148. // getting updates only after the object has changed since the last
  29149. // request. Use googleapi.IsNotModified to check whether the response
  29150. // error from Do is the result of In-None-Match.
  29151. func (c *InstanceGroupsListCall) IfNoneMatch(entityTag string) *InstanceGroupsListCall {
  29152. c.ifNoneMatch_ = entityTag
  29153. return c
  29154. }
  29155. // Context sets the context to be used in this call's Do method. Any
  29156. // pending HTTP request will be aborted if the provided context is
  29157. // canceled.
  29158. func (c *InstanceGroupsListCall) Context(ctx context.Context) *InstanceGroupsListCall {
  29159. c.ctx_ = ctx
  29160. return c
  29161. }
  29162. // Header returns an http.Header that can be modified by the caller to
  29163. // add HTTP headers to the request.
  29164. func (c *InstanceGroupsListCall) Header() http.Header {
  29165. if c.header_ == nil {
  29166. c.header_ = make(http.Header)
  29167. }
  29168. return c.header_
  29169. }
  29170. func (c *InstanceGroupsListCall) doRequest(alt string) (*http.Response, error) {
  29171. reqHeaders := make(http.Header)
  29172. for k, v := range c.header_ {
  29173. reqHeaders[k] = v
  29174. }
  29175. reqHeaders.Set("User-Agent", c.s.userAgent())
  29176. if c.ifNoneMatch_ != "" {
  29177. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  29178. }
  29179. var body io.Reader = nil
  29180. c.urlParams_.Set("alt", alt)
  29181. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups")
  29182. urls += "?" + c.urlParams_.Encode()
  29183. req, _ := http.NewRequest("GET", urls, body)
  29184. req.Header = reqHeaders
  29185. googleapi.Expand(req.URL, map[string]string{
  29186. "project": c.project,
  29187. "zone": c.zone,
  29188. })
  29189. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29190. }
  29191. // Do executes the "compute.instanceGroups.list" call.
  29192. // Exactly one of *InstanceGroupList or error will be non-nil. Any
  29193. // non-2xx status code is an error. Response headers are in either
  29194. // *InstanceGroupList.ServerResponse.Header or (if a response was
  29195. // returned at all) in error.(*googleapi.Error).Header. Use
  29196. // googleapi.IsNotModified to check whether the returned error was
  29197. // because http.StatusNotModified was returned.
  29198. func (c *InstanceGroupsListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupList, error) {
  29199. gensupport.SetOptions(c.urlParams_, opts...)
  29200. res, err := c.doRequest("json")
  29201. if res != nil && res.StatusCode == http.StatusNotModified {
  29202. if res.Body != nil {
  29203. res.Body.Close()
  29204. }
  29205. return nil, &googleapi.Error{
  29206. Code: res.StatusCode,
  29207. Header: res.Header,
  29208. }
  29209. }
  29210. if err != nil {
  29211. return nil, err
  29212. }
  29213. defer googleapi.CloseBody(res)
  29214. if err := googleapi.CheckResponse(res); err != nil {
  29215. return nil, err
  29216. }
  29217. ret := &InstanceGroupList{
  29218. ServerResponse: googleapi.ServerResponse{
  29219. Header: res.Header,
  29220. HTTPStatusCode: res.StatusCode,
  29221. },
  29222. }
  29223. target := &ret
  29224. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  29225. return nil, err
  29226. }
  29227. return ret, nil
  29228. // {
  29229. // "description": "Retrieves the list of instance groups that are located in the specified project and zone.",
  29230. // "httpMethod": "GET",
  29231. // "id": "compute.instanceGroups.list",
  29232. // "parameterOrder": [
  29233. // "project",
  29234. // "zone"
  29235. // ],
  29236. // "parameters": {
  29237. // "filter": {
  29238. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  29239. // "location": "query",
  29240. // "type": "string"
  29241. // },
  29242. // "maxResults": {
  29243. // "default": "500",
  29244. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  29245. // "format": "uint32",
  29246. // "location": "query",
  29247. // "minimum": "0",
  29248. // "type": "integer"
  29249. // },
  29250. // "orderBy": {
  29251. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  29252. // "location": "query",
  29253. // "type": "string"
  29254. // },
  29255. // "pageToken": {
  29256. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  29257. // "location": "query",
  29258. // "type": "string"
  29259. // },
  29260. // "project": {
  29261. // "description": "Project ID for this request.",
  29262. // "location": "path",
  29263. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  29264. // "required": true,
  29265. // "type": "string"
  29266. // },
  29267. // "zone": {
  29268. // "description": "The name of the zone where the instance group is located.",
  29269. // "location": "path",
  29270. // "required": true,
  29271. // "type": "string"
  29272. // }
  29273. // },
  29274. // "path": "{project}/zones/{zone}/instanceGroups",
  29275. // "response": {
  29276. // "$ref": "InstanceGroupList"
  29277. // },
  29278. // "scopes": [
  29279. // "https://www.googleapis.com/auth/cloud-platform",
  29280. // "https://www.googleapis.com/auth/compute",
  29281. // "https://www.googleapis.com/auth/compute.readonly"
  29282. // ]
  29283. // }
  29284. }
  29285. // Pages invokes f for each page of results.
  29286. // A non-nil error returned from f will halt the iteration.
  29287. // The provided context supersedes any context provided to the Context method.
  29288. func (c *InstanceGroupsListCall) Pages(ctx context.Context, f func(*InstanceGroupList) error) error {
  29289. c.ctx_ = ctx
  29290. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  29291. for {
  29292. x, err := c.Do()
  29293. if err != nil {
  29294. return err
  29295. }
  29296. if err := f(x); err != nil {
  29297. return err
  29298. }
  29299. if x.NextPageToken == "" {
  29300. return nil
  29301. }
  29302. c.PageToken(x.NextPageToken)
  29303. }
  29304. }
  29305. // method id "compute.instanceGroups.listInstances":
  29306. type InstanceGroupsListInstancesCall struct {
  29307. s *Service
  29308. project string
  29309. zone string
  29310. instanceGroup string
  29311. instancegroupslistinstancesrequest *InstanceGroupsListInstancesRequest
  29312. urlParams_ gensupport.URLParams
  29313. ctx_ context.Context
  29314. header_ http.Header
  29315. }
  29316. // ListInstances: Lists the instances in the specified instance group.
  29317. func (r *InstanceGroupsService) ListInstances(project string, zone string, instanceGroup string, instancegroupslistinstancesrequest *InstanceGroupsListInstancesRequest) *InstanceGroupsListInstancesCall {
  29318. c := &InstanceGroupsListInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29319. c.project = project
  29320. c.zone = zone
  29321. c.instanceGroup = instanceGroup
  29322. c.instancegroupslistinstancesrequest = instancegroupslistinstancesrequest
  29323. return c
  29324. }
  29325. // Filter sets the optional parameter "filter": Sets a filter
  29326. // {expression} for filtering listed resources. Your {expression} must
  29327. // be in the format: field_name comparison_string literal_string.
  29328. //
  29329. // The field_name is the name of the field you want to compare. Only
  29330. // atomic field types are supported (string, number, boolean). The
  29331. // comparison_string must be either eq (equals) or ne (not equals). The
  29332. // literal_string is the string value to filter to. The literal value
  29333. // must be valid for the type of field you are filtering by (string,
  29334. // number, boolean). For string fields, the literal value is interpreted
  29335. // as a regular expression using RE2 syntax. The literal value must
  29336. // match the entire field.
  29337. //
  29338. // For example, to filter for instances that do not have a name of
  29339. // example-instance, you would use name ne example-instance.
  29340. //
  29341. // You can filter on nested fields. For example, you could filter on
  29342. // instances that have set the scheduling.automaticRestart field to
  29343. // true. Use filtering on nested fields to take advantage of labels to
  29344. // organize and search for results based on label values.
  29345. //
  29346. // To filter on multiple expressions, provide each separate expression
  29347. // within parentheses. For example, (scheduling.automaticRestart eq
  29348. // true) (zone eq us-central1-f). Multiple expressions are treated as
  29349. // AND expressions, meaning that resources must match all expressions to
  29350. // pass the filters.
  29351. func (c *InstanceGroupsListInstancesCall) Filter(filter string) *InstanceGroupsListInstancesCall {
  29352. c.urlParams_.Set("filter", filter)
  29353. return c
  29354. }
  29355. // MaxResults sets the optional parameter "maxResults": The maximum
  29356. // number of results per page that should be returned. If the number of
  29357. // available results is larger than maxResults, Compute Engine returns a
  29358. // nextPageToken that can be used to get the next page of results in
  29359. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  29360. // (Default: 500)
  29361. func (c *InstanceGroupsListInstancesCall) MaxResults(maxResults int64) *InstanceGroupsListInstancesCall {
  29362. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  29363. return c
  29364. }
  29365. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  29366. // a certain order. By default, results are returned in alphanumerical
  29367. // order based on the resource name.
  29368. //
  29369. // You can also sort results in descending order based on the creation
  29370. // timestamp using orderBy="creationTimestamp desc". This sorts results
  29371. // based on the creationTimestamp field in reverse chronological order
  29372. // (newest result first). Use this to sort resources like operations so
  29373. // that the newest operation is returned first.
  29374. //
  29375. // Currently, only sorting by name or creationTimestamp desc is
  29376. // supported.
  29377. func (c *InstanceGroupsListInstancesCall) OrderBy(orderBy string) *InstanceGroupsListInstancesCall {
  29378. c.urlParams_.Set("orderBy", orderBy)
  29379. return c
  29380. }
  29381. // PageToken sets the optional parameter "pageToken": Specifies a page
  29382. // token to use. Set pageToken to the nextPageToken returned by a
  29383. // previous list request to get the next page of results.
  29384. func (c *InstanceGroupsListInstancesCall) PageToken(pageToken string) *InstanceGroupsListInstancesCall {
  29385. c.urlParams_.Set("pageToken", pageToken)
  29386. return c
  29387. }
  29388. // Fields allows partial responses to be retrieved. See
  29389. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29390. // for more information.
  29391. func (c *InstanceGroupsListInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsListInstancesCall {
  29392. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29393. return c
  29394. }
  29395. // Context sets the context to be used in this call's Do method. Any
  29396. // pending HTTP request will be aborted if the provided context is
  29397. // canceled.
  29398. func (c *InstanceGroupsListInstancesCall) Context(ctx context.Context) *InstanceGroupsListInstancesCall {
  29399. c.ctx_ = ctx
  29400. return c
  29401. }
  29402. // Header returns an http.Header that can be modified by the caller to
  29403. // add HTTP headers to the request.
  29404. func (c *InstanceGroupsListInstancesCall) Header() http.Header {
  29405. if c.header_ == nil {
  29406. c.header_ = make(http.Header)
  29407. }
  29408. return c.header_
  29409. }
  29410. func (c *InstanceGroupsListInstancesCall) doRequest(alt string) (*http.Response, error) {
  29411. reqHeaders := make(http.Header)
  29412. for k, v := range c.header_ {
  29413. reqHeaders[k] = v
  29414. }
  29415. reqHeaders.Set("User-Agent", c.s.userAgent())
  29416. var body io.Reader = nil
  29417. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupslistinstancesrequest)
  29418. if err != nil {
  29419. return nil, err
  29420. }
  29421. reqHeaders.Set("Content-Type", "application/json")
  29422. c.urlParams_.Set("alt", alt)
  29423. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances")
  29424. urls += "?" + c.urlParams_.Encode()
  29425. req, _ := http.NewRequest("POST", urls, body)
  29426. req.Header = reqHeaders
  29427. googleapi.Expand(req.URL, map[string]string{
  29428. "project": c.project,
  29429. "zone": c.zone,
  29430. "instanceGroup": c.instanceGroup,
  29431. })
  29432. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29433. }
  29434. // Do executes the "compute.instanceGroups.listInstances" call.
  29435. // Exactly one of *InstanceGroupsListInstances or error will be non-nil.
  29436. // Any non-2xx status code is an error. Response headers are in either
  29437. // *InstanceGroupsListInstances.ServerResponse.Header or (if a response
  29438. // was returned at all) in error.(*googleapi.Error).Header. Use
  29439. // googleapi.IsNotModified to check whether the returned error was
  29440. // because http.StatusNotModified was returned.
  29441. func (c *InstanceGroupsListInstancesCall) Do(opts ...googleapi.CallOption) (*InstanceGroupsListInstances, error) {
  29442. gensupport.SetOptions(c.urlParams_, opts...)
  29443. res, err := c.doRequest("json")
  29444. if res != nil && res.StatusCode == http.StatusNotModified {
  29445. if res.Body != nil {
  29446. res.Body.Close()
  29447. }
  29448. return nil, &googleapi.Error{
  29449. Code: res.StatusCode,
  29450. Header: res.Header,
  29451. }
  29452. }
  29453. if err != nil {
  29454. return nil, err
  29455. }
  29456. defer googleapi.CloseBody(res)
  29457. if err := googleapi.CheckResponse(res); err != nil {
  29458. return nil, err
  29459. }
  29460. ret := &InstanceGroupsListInstances{
  29461. ServerResponse: googleapi.ServerResponse{
  29462. Header: res.Header,
  29463. HTTPStatusCode: res.StatusCode,
  29464. },
  29465. }
  29466. target := &ret
  29467. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  29468. return nil, err
  29469. }
  29470. return ret, nil
  29471. // {
  29472. // "description": "Lists the instances in the specified instance group.",
  29473. // "httpMethod": "POST",
  29474. // "id": "compute.instanceGroups.listInstances",
  29475. // "parameterOrder": [
  29476. // "project",
  29477. // "zone",
  29478. // "instanceGroup"
  29479. // ],
  29480. // "parameters": {
  29481. // "filter": {
  29482. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  29483. // "location": "query",
  29484. // "type": "string"
  29485. // },
  29486. // "instanceGroup": {
  29487. // "description": "The name of the instance group from which you want to generate a list of included instances.",
  29488. // "location": "path",
  29489. // "required": true,
  29490. // "type": "string"
  29491. // },
  29492. // "maxResults": {
  29493. // "default": "500",
  29494. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  29495. // "format": "uint32",
  29496. // "location": "query",
  29497. // "minimum": "0",
  29498. // "type": "integer"
  29499. // },
  29500. // "orderBy": {
  29501. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  29502. // "location": "query",
  29503. // "type": "string"
  29504. // },
  29505. // "pageToken": {
  29506. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  29507. // "location": "query",
  29508. // "type": "string"
  29509. // },
  29510. // "project": {
  29511. // "description": "Project ID for this request.",
  29512. // "location": "path",
  29513. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  29514. // "required": true,
  29515. // "type": "string"
  29516. // },
  29517. // "zone": {
  29518. // "description": "The name of the zone where the instance group is located.",
  29519. // "location": "path",
  29520. // "required": true,
  29521. // "type": "string"
  29522. // }
  29523. // },
  29524. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances",
  29525. // "request": {
  29526. // "$ref": "InstanceGroupsListInstancesRequest"
  29527. // },
  29528. // "response": {
  29529. // "$ref": "InstanceGroupsListInstances"
  29530. // },
  29531. // "scopes": [
  29532. // "https://www.googleapis.com/auth/cloud-platform",
  29533. // "https://www.googleapis.com/auth/compute",
  29534. // "https://www.googleapis.com/auth/compute.readonly"
  29535. // ]
  29536. // }
  29537. }
  29538. // Pages invokes f for each page of results.
  29539. // A non-nil error returned from f will halt the iteration.
  29540. // The provided context supersedes any context provided to the Context method.
  29541. func (c *InstanceGroupsListInstancesCall) Pages(ctx context.Context, f func(*InstanceGroupsListInstances) error) error {
  29542. c.ctx_ = ctx
  29543. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  29544. for {
  29545. x, err := c.Do()
  29546. if err != nil {
  29547. return err
  29548. }
  29549. if err := f(x); err != nil {
  29550. return err
  29551. }
  29552. if x.NextPageToken == "" {
  29553. return nil
  29554. }
  29555. c.PageToken(x.NextPageToken)
  29556. }
  29557. }
  29558. // method id "compute.instanceGroups.removeInstances":
  29559. type InstanceGroupsRemoveInstancesCall struct {
  29560. s *Service
  29561. project string
  29562. zone string
  29563. instanceGroup string
  29564. instancegroupsremoveinstancesrequest *InstanceGroupsRemoveInstancesRequest
  29565. urlParams_ gensupport.URLParams
  29566. ctx_ context.Context
  29567. header_ http.Header
  29568. }
  29569. // RemoveInstances: Removes one or more instances from the specified
  29570. // instance group, but does not delete those instances.
  29571. //
  29572. // If the group is part of a backend service that has enabled connection
  29573. // draining, it can take up to 60 seconds after the connection draining
  29574. // duration before the VM instance is removed or deleted.
  29575. func (r *InstanceGroupsService) RemoveInstances(project string, zone string, instanceGroup string, instancegroupsremoveinstancesrequest *InstanceGroupsRemoveInstancesRequest) *InstanceGroupsRemoveInstancesCall {
  29576. c := &InstanceGroupsRemoveInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29577. c.project = project
  29578. c.zone = zone
  29579. c.instanceGroup = instanceGroup
  29580. c.instancegroupsremoveinstancesrequest = instancegroupsremoveinstancesrequest
  29581. return c
  29582. }
  29583. // Fields allows partial responses to be retrieved. See
  29584. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29585. // for more information.
  29586. func (c *InstanceGroupsRemoveInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsRemoveInstancesCall {
  29587. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29588. return c
  29589. }
  29590. // Context sets the context to be used in this call's Do method. Any
  29591. // pending HTTP request will be aborted if the provided context is
  29592. // canceled.
  29593. func (c *InstanceGroupsRemoveInstancesCall) Context(ctx context.Context) *InstanceGroupsRemoveInstancesCall {
  29594. c.ctx_ = ctx
  29595. return c
  29596. }
  29597. // Header returns an http.Header that can be modified by the caller to
  29598. // add HTTP headers to the request.
  29599. func (c *InstanceGroupsRemoveInstancesCall) Header() http.Header {
  29600. if c.header_ == nil {
  29601. c.header_ = make(http.Header)
  29602. }
  29603. return c.header_
  29604. }
  29605. func (c *InstanceGroupsRemoveInstancesCall) doRequest(alt string) (*http.Response, error) {
  29606. reqHeaders := make(http.Header)
  29607. for k, v := range c.header_ {
  29608. reqHeaders[k] = v
  29609. }
  29610. reqHeaders.Set("User-Agent", c.s.userAgent())
  29611. var body io.Reader = nil
  29612. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupsremoveinstancesrequest)
  29613. if err != nil {
  29614. return nil, err
  29615. }
  29616. reqHeaders.Set("Content-Type", "application/json")
  29617. c.urlParams_.Set("alt", alt)
  29618. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances")
  29619. urls += "?" + c.urlParams_.Encode()
  29620. req, _ := http.NewRequest("POST", urls, body)
  29621. req.Header = reqHeaders
  29622. googleapi.Expand(req.URL, map[string]string{
  29623. "project": c.project,
  29624. "zone": c.zone,
  29625. "instanceGroup": c.instanceGroup,
  29626. })
  29627. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29628. }
  29629. // Do executes the "compute.instanceGroups.removeInstances" call.
  29630. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  29631. // status code is an error. Response headers are in either
  29632. // *Operation.ServerResponse.Header or (if a response was returned at
  29633. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  29634. // to check whether the returned error was because
  29635. // http.StatusNotModified was returned.
  29636. func (c *InstanceGroupsRemoveInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  29637. gensupport.SetOptions(c.urlParams_, opts...)
  29638. res, err := c.doRequest("json")
  29639. if res != nil && res.StatusCode == http.StatusNotModified {
  29640. if res.Body != nil {
  29641. res.Body.Close()
  29642. }
  29643. return nil, &googleapi.Error{
  29644. Code: res.StatusCode,
  29645. Header: res.Header,
  29646. }
  29647. }
  29648. if err != nil {
  29649. return nil, err
  29650. }
  29651. defer googleapi.CloseBody(res)
  29652. if err := googleapi.CheckResponse(res); err != nil {
  29653. return nil, err
  29654. }
  29655. ret := &Operation{
  29656. ServerResponse: googleapi.ServerResponse{
  29657. Header: res.Header,
  29658. HTTPStatusCode: res.StatusCode,
  29659. },
  29660. }
  29661. target := &ret
  29662. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  29663. return nil, err
  29664. }
  29665. return ret, nil
  29666. // {
  29667. // "description": "Removes one or more instances from the specified instance group, but does not delete those instances.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration before the VM instance is removed or deleted.",
  29668. // "httpMethod": "POST",
  29669. // "id": "compute.instanceGroups.removeInstances",
  29670. // "parameterOrder": [
  29671. // "project",
  29672. // "zone",
  29673. // "instanceGroup"
  29674. // ],
  29675. // "parameters": {
  29676. // "instanceGroup": {
  29677. // "description": "The name of the instance group where the specified instances will be removed.",
  29678. // "location": "path",
  29679. // "required": true,
  29680. // "type": "string"
  29681. // },
  29682. // "project": {
  29683. // "description": "Project ID for this request.",
  29684. // "location": "path",
  29685. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  29686. // "required": true,
  29687. // "type": "string"
  29688. // },
  29689. // "zone": {
  29690. // "description": "The name of the zone where the instance group is located.",
  29691. // "location": "path",
  29692. // "required": true,
  29693. // "type": "string"
  29694. // }
  29695. // },
  29696. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances",
  29697. // "request": {
  29698. // "$ref": "InstanceGroupsRemoveInstancesRequest"
  29699. // },
  29700. // "response": {
  29701. // "$ref": "Operation"
  29702. // },
  29703. // "scopes": [
  29704. // "https://www.googleapis.com/auth/cloud-platform",
  29705. // "https://www.googleapis.com/auth/compute"
  29706. // ]
  29707. // }
  29708. }
  29709. // method id "compute.instanceGroups.setNamedPorts":
  29710. type InstanceGroupsSetNamedPortsCall struct {
  29711. s *Service
  29712. project string
  29713. zone string
  29714. instanceGroup string
  29715. instancegroupssetnamedportsrequest *InstanceGroupsSetNamedPortsRequest
  29716. urlParams_ gensupport.URLParams
  29717. ctx_ context.Context
  29718. header_ http.Header
  29719. }
  29720. // SetNamedPorts: Sets the named ports for the specified instance group.
  29721. func (r *InstanceGroupsService) SetNamedPorts(project string, zone string, instanceGroup string, instancegroupssetnamedportsrequest *InstanceGroupsSetNamedPortsRequest) *InstanceGroupsSetNamedPortsCall {
  29722. c := &InstanceGroupsSetNamedPortsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29723. c.project = project
  29724. c.zone = zone
  29725. c.instanceGroup = instanceGroup
  29726. c.instancegroupssetnamedportsrequest = instancegroupssetnamedportsrequest
  29727. return c
  29728. }
  29729. // Fields allows partial responses to be retrieved. See
  29730. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29731. // for more information.
  29732. func (c *InstanceGroupsSetNamedPortsCall) Fields(s ...googleapi.Field) *InstanceGroupsSetNamedPortsCall {
  29733. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29734. return c
  29735. }
  29736. // Context sets the context to be used in this call's Do method. Any
  29737. // pending HTTP request will be aborted if the provided context is
  29738. // canceled.
  29739. func (c *InstanceGroupsSetNamedPortsCall) Context(ctx context.Context) *InstanceGroupsSetNamedPortsCall {
  29740. c.ctx_ = ctx
  29741. return c
  29742. }
  29743. // Header returns an http.Header that can be modified by the caller to
  29744. // add HTTP headers to the request.
  29745. func (c *InstanceGroupsSetNamedPortsCall) Header() http.Header {
  29746. if c.header_ == nil {
  29747. c.header_ = make(http.Header)
  29748. }
  29749. return c.header_
  29750. }
  29751. func (c *InstanceGroupsSetNamedPortsCall) doRequest(alt string) (*http.Response, error) {
  29752. reqHeaders := make(http.Header)
  29753. for k, v := range c.header_ {
  29754. reqHeaders[k] = v
  29755. }
  29756. reqHeaders.Set("User-Agent", c.s.userAgent())
  29757. var body io.Reader = nil
  29758. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupssetnamedportsrequest)
  29759. if err != nil {
  29760. return nil, err
  29761. }
  29762. reqHeaders.Set("Content-Type", "application/json")
  29763. c.urlParams_.Set("alt", alt)
  29764. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts")
  29765. urls += "?" + c.urlParams_.Encode()
  29766. req, _ := http.NewRequest("POST", urls, body)
  29767. req.Header = reqHeaders
  29768. googleapi.Expand(req.URL, map[string]string{
  29769. "project": c.project,
  29770. "zone": c.zone,
  29771. "instanceGroup": c.instanceGroup,
  29772. })
  29773. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29774. }
  29775. // Do executes the "compute.instanceGroups.setNamedPorts" call.
  29776. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  29777. // status code is an error. Response headers are in either
  29778. // *Operation.ServerResponse.Header or (if a response was returned at
  29779. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  29780. // to check whether the returned error was because
  29781. // http.StatusNotModified was returned.
  29782. func (c *InstanceGroupsSetNamedPortsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  29783. gensupport.SetOptions(c.urlParams_, opts...)
  29784. res, err := c.doRequest("json")
  29785. if res != nil && res.StatusCode == http.StatusNotModified {
  29786. if res.Body != nil {
  29787. res.Body.Close()
  29788. }
  29789. return nil, &googleapi.Error{
  29790. Code: res.StatusCode,
  29791. Header: res.Header,
  29792. }
  29793. }
  29794. if err != nil {
  29795. return nil, err
  29796. }
  29797. defer googleapi.CloseBody(res)
  29798. if err := googleapi.CheckResponse(res); err != nil {
  29799. return nil, err
  29800. }
  29801. ret := &Operation{
  29802. ServerResponse: googleapi.ServerResponse{
  29803. Header: res.Header,
  29804. HTTPStatusCode: res.StatusCode,
  29805. },
  29806. }
  29807. target := &ret
  29808. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  29809. return nil, err
  29810. }
  29811. return ret, nil
  29812. // {
  29813. // "description": "Sets the named ports for the specified instance group.",
  29814. // "httpMethod": "POST",
  29815. // "id": "compute.instanceGroups.setNamedPorts",
  29816. // "parameterOrder": [
  29817. // "project",
  29818. // "zone",
  29819. // "instanceGroup"
  29820. // ],
  29821. // "parameters": {
  29822. // "instanceGroup": {
  29823. // "description": "The name of the instance group where the named ports are updated.",
  29824. // "location": "path",
  29825. // "required": true,
  29826. // "type": "string"
  29827. // },
  29828. // "project": {
  29829. // "description": "Project ID for this request.",
  29830. // "location": "path",
  29831. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  29832. // "required": true,
  29833. // "type": "string"
  29834. // },
  29835. // "zone": {
  29836. // "description": "The name of the zone where the instance group is located.",
  29837. // "location": "path",
  29838. // "required": true,
  29839. // "type": "string"
  29840. // }
  29841. // },
  29842. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts",
  29843. // "request": {
  29844. // "$ref": "InstanceGroupsSetNamedPortsRequest"
  29845. // },
  29846. // "response": {
  29847. // "$ref": "Operation"
  29848. // },
  29849. // "scopes": [
  29850. // "https://www.googleapis.com/auth/cloud-platform",
  29851. // "https://www.googleapis.com/auth/compute"
  29852. // ]
  29853. // }
  29854. }
  29855. // method id "compute.instanceTemplates.delete":
  29856. type InstanceTemplatesDeleteCall struct {
  29857. s *Service
  29858. project string
  29859. instanceTemplate string
  29860. urlParams_ gensupport.URLParams
  29861. ctx_ context.Context
  29862. header_ http.Header
  29863. }
  29864. // Delete: Deletes the specified instance template. If you delete an
  29865. // instance template that is being referenced from another instance
  29866. // group, the instance group will not be able to create or recreate
  29867. // virtual machine instances. Deleting an instance template is permanent
  29868. // and cannot be undone.
  29869. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/delete
  29870. func (r *InstanceTemplatesService) Delete(project string, instanceTemplate string) *InstanceTemplatesDeleteCall {
  29871. c := &InstanceTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29872. c.project = project
  29873. c.instanceTemplate = instanceTemplate
  29874. return c
  29875. }
  29876. // Fields allows partial responses to be retrieved. See
  29877. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29878. // for more information.
  29879. func (c *InstanceTemplatesDeleteCall) Fields(s ...googleapi.Field) *InstanceTemplatesDeleteCall {
  29880. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29881. return c
  29882. }
  29883. // Context sets the context to be used in this call's Do method. Any
  29884. // pending HTTP request will be aborted if the provided context is
  29885. // canceled.
  29886. func (c *InstanceTemplatesDeleteCall) Context(ctx context.Context) *InstanceTemplatesDeleteCall {
  29887. c.ctx_ = ctx
  29888. return c
  29889. }
  29890. // Header returns an http.Header that can be modified by the caller to
  29891. // add HTTP headers to the request.
  29892. func (c *InstanceTemplatesDeleteCall) Header() http.Header {
  29893. if c.header_ == nil {
  29894. c.header_ = make(http.Header)
  29895. }
  29896. return c.header_
  29897. }
  29898. func (c *InstanceTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  29899. reqHeaders := make(http.Header)
  29900. for k, v := range c.header_ {
  29901. reqHeaders[k] = v
  29902. }
  29903. reqHeaders.Set("User-Agent", c.s.userAgent())
  29904. var body io.Reader = nil
  29905. c.urlParams_.Set("alt", alt)
  29906. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{instanceTemplate}")
  29907. urls += "?" + c.urlParams_.Encode()
  29908. req, _ := http.NewRequest("DELETE", urls, body)
  29909. req.Header = reqHeaders
  29910. googleapi.Expand(req.URL, map[string]string{
  29911. "project": c.project,
  29912. "instanceTemplate": c.instanceTemplate,
  29913. })
  29914. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29915. }
  29916. // Do executes the "compute.instanceTemplates.delete" call.
  29917. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  29918. // status code is an error. Response headers are in either
  29919. // *Operation.ServerResponse.Header or (if a response was returned at
  29920. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  29921. // to check whether the returned error was because
  29922. // http.StatusNotModified was returned.
  29923. func (c *InstanceTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  29924. gensupport.SetOptions(c.urlParams_, opts...)
  29925. res, err := c.doRequest("json")
  29926. if res != nil && res.StatusCode == http.StatusNotModified {
  29927. if res.Body != nil {
  29928. res.Body.Close()
  29929. }
  29930. return nil, &googleapi.Error{
  29931. Code: res.StatusCode,
  29932. Header: res.Header,
  29933. }
  29934. }
  29935. if err != nil {
  29936. return nil, err
  29937. }
  29938. defer googleapi.CloseBody(res)
  29939. if err := googleapi.CheckResponse(res); err != nil {
  29940. return nil, err
  29941. }
  29942. ret := &Operation{
  29943. ServerResponse: googleapi.ServerResponse{
  29944. Header: res.Header,
  29945. HTTPStatusCode: res.StatusCode,
  29946. },
  29947. }
  29948. target := &ret
  29949. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  29950. return nil, err
  29951. }
  29952. return ret, nil
  29953. // {
  29954. // "description": "Deletes the specified instance template. If you delete an instance template that is being referenced from another instance group, the instance group will not be able to create or recreate virtual machine instances. Deleting an instance template is permanent and cannot be undone.",
  29955. // "httpMethod": "DELETE",
  29956. // "id": "compute.instanceTemplates.delete",
  29957. // "parameterOrder": [
  29958. // "project",
  29959. // "instanceTemplate"
  29960. // ],
  29961. // "parameters": {
  29962. // "instanceTemplate": {
  29963. // "description": "The name of the instance template to delete.",
  29964. // "location": "path",
  29965. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  29966. // "required": true,
  29967. // "type": "string"
  29968. // },
  29969. // "project": {
  29970. // "description": "Project ID for this request.",
  29971. // "location": "path",
  29972. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  29973. // "required": true,
  29974. // "type": "string"
  29975. // }
  29976. // },
  29977. // "path": "{project}/global/instanceTemplates/{instanceTemplate}",
  29978. // "response": {
  29979. // "$ref": "Operation"
  29980. // },
  29981. // "scopes": [
  29982. // "https://www.googleapis.com/auth/cloud-platform",
  29983. // "https://www.googleapis.com/auth/compute"
  29984. // ]
  29985. // }
  29986. }
  29987. // method id "compute.instanceTemplates.get":
  29988. type InstanceTemplatesGetCall struct {
  29989. s *Service
  29990. project string
  29991. instanceTemplate string
  29992. urlParams_ gensupport.URLParams
  29993. ifNoneMatch_ string
  29994. ctx_ context.Context
  29995. header_ http.Header
  29996. }
  29997. // Get: Returns the specified instance template. Get a list of available
  29998. // instance templates by making a list() request.
  29999. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/get
  30000. func (r *InstanceTemplatesService) Get(project string, instanceTemplate string) *InstanceTemplatesGetCall {
  30001. c := &InstanceTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30002. c.project = project
  30003. c.instanceTemplate = instanceTemplate
  30004. return c
  30005. }
  30006. // Fields allows partial responses to be retrieved. See
  30007. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30008. // for more information.
  30009. func (c *InstanceTemplatesGetCall) Fields(s ...googleapi.Field) *InstanceTemplatesGetCall {
  30010. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30011. return c
  30012. }
  30013. // IfNoneMatch sets the optional parameter which makes the operation
  30014. // fail if the object's ETag matches the given value. This is useful for
  30015. // getting updates only after the object has changed since the last
  30016. // request. Use googleapi.IsNotModified to check whether the response
  30017. // error from Do is the result of In-None-Match.
  30018. func (c *InstanceTemplatesGetCall) IfNoneMatch(entityTag string) *InstanceTemplatesGetCall {
  30019. c.ifNoneMatch_ = entityTag
  30020. return c
  30021. }
  30022. // Context sets the context to be used in this call's Do method. Any
  30023. // pending HTTP request will be aborted if the provided context is
  30024. // canceled.
  30025. func (c *InstanceTemplatesGetCall) Context(ctx context.Context) *InstanceTemplatesGetCall {
  30026. c.ctx_ = ctx
  30027. return c
  30028. }
  30029. // Header returns an http.Header that can be modified by the caller to
  30030. // add HTTP headers to the request.
  30031. func (c *InstanceTemplatesGetCall) Header() http.Header {
  30032. if c.header_ == nil {
  30033. c.header_ = make(http.Header)
  30034. }
  30035. return c.header_
  30036. }
  30037. func (c *InstanceTemplatesGetCall) doRequest(alt string) (*http.Response, error) {
  30038. reqHeaders := make(http.Header)
  30039. for k, v := range c.header_ {
  30040. reqHeaders[k] = v
  30041. }
  30042. reqHeaders.Set("User-Agent", c.s.userAgent())
  30043. if c.ifNoneMatch_ != "" {
  30044. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  30045. }
  30046. var body io.Reader = nil
  30047. c.urlParams_.Set("alt", alt)
  30048. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{instanceTemplate}")
  30049. urls += "?" + c.urlParams_.Encode()
  30050. req, _ := http.NewRequest("GET", urls, body)
  30051. req.Header = reqHeaders
  30052. googleapi.Expand(req.URL, map[string]string{
  30053. "project": c.project,
  30054. "instanceTemplate": c.instanceTemplate,
  30055. })
  30056. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30057. }
  30058. // Do executes the "compute.instanceTemplates.get" call.
  30059. // Exactly one of *InstanceTemplate or error will be non-nil. Any
  30060. // non-2xx status code is an error. Response headers are in either
  30061. // *InstanceTemplate.ServerResponse.Header or (if a response was
  30062. // returned at all) in error.(*googleapi.Error).Header. Use
  30063. // googleapi.IsNotModified to check whether the returned error was
  30064. // because http.StatusNotModified was returned.
  30065. func (c *InstanceTemplatesGetCall) Do(opts ...googleapi.CallOption) (*InstanceTemplate, error) {
  30066. gensupport.SetOptions(c.urlParams_, opts...)
  30067. res, err := c.doRequest("json")
  30068. if res != nil && res.StatusCode == http.StatusNotModified {
  30069. if res.Body != nil {
  30070. res.Body.Close()
  30071. }
  30072. return nil, &googleapi.Error{
  30073. Code: res.StatusCode,
  30074. Header: res.Header,
  30075. }
  30076. }
  30077. if err != nil {
  30078. return nil, err
  30079. }
  30080. defer googleapi.CloseBody(res)
  30081. if err := googleapi.CheckResponse(res); err != nil {
  30082. return nil, err
  30083. }
  30084. ret := &InstanceTemplate{
  30085. ServerResponse: googleapi.ServerResponse{
  30086. Header: res.Header,
  30087. HTTPStatusCode: res.StatusCode,
  30088. },
  30089. }
  30090. target := &ret
  30091. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  30092. return nil, err
  30093. }
  30094. return ret, nil
  30095. // {
  30096. // "description": "Returns the specified instance template. Get a list of available instance templates by making a list() request.",
  30097. // "httpMethod": "GET",
  30098. // "id": "compute.instanceTemplates.get",
  30099. // "parameterOrder": [
  30100. // "project",
  30101. // "instanceTemplate"
  30102. // ],
  30103. // "parameters": {
  30104. // "instanceTemplate": {
  30105. // "description": "The name of the instance template.",
  30106. // "location": "path",
  30107. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  30108. // "required": true,
  30109. // "type": "string"
  30110. // },
  30111. // "project": {
  30112. // "description": "Project ID for this request.",
  30113. // "location": "path",
  30114. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  30115. // "required": true,
  30116. // "type": "string"
  30117. // }
  30118. // },
  30119. // "path": "{project}/global/instanceTemplates/{instanceTemplate}",
  30120. // "response": {
  30121. // "$ref": "InstanceTemplate"
  30122. // },
  30123. // "scopes": [
  30124. // "https://www.googleapis.com/auth/cloud-platform",
  30125. // "https://www.googleapis.com/auth/compute",
  30126. // "https://www.googleapis.com/auth/compute.readonly"
  30127. // ]
  30128. // }
  30129. }
  30130. // method id "compute.instanceTemplates.insert":
  30131. type InstanceTemplatesInsertCall struct {
  30132. s *Service
  30133. project string
  30134. instancetemplate *InstanceTemplate
  30135. urlParams_ gensupport.URLParams
  30136. ctx_ context.Context
  30137. header_ http.Header
  30138. }
  30139. // Insert: Creates an instance template in the specified project using
  30140. // the data that is included in the request. If you are creating a new
  30141. // template to update an existing instance group, your new instance
  30142. // template must use the same network or, if applicable, the same
  30143. // subnetwork as the original template.
  30144. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/insert
  30145. func (r *InstanceTemplatesService) Insert(project string, instancetemplate *InstanceTemplate) *InstanceTemplatesInsertCall {
  30146. c := &InstanceTemplatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30147. c.project = project
  30148. c.instancetemplate = instancetemplate
  30149. return c
  30150. }
  30151. // Fields allows partial responses to be retrieved. See
  30152. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30153. // for more information.
  30154. func (c *InstanceTemplatesInsertCall) Fields(s ...googleapi.Field) *InstanceTemplatesInsertCall {
  30155. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30156. return c
  30157. }
  30158. // Context sets the context to be used in this call's Do method. Any
  30159. // pending HTTP request will be aborted if the provided context is
  30160. // canceled.
  30161. func (c *InstanceTemplatesInsertCall) Context(ctx context.Context) *InstanceTemplatesInsertCall {
  30162. c.ctx_ = ctx
  30163. return c
  30164. }
  30165. // Header returns an http.Header that can be modified by the caller to
  30166. // add HTTP headers to the request.
  30167. func (c *InstanceTemplatesInsertCall) Header() http.Header {
  30168. if c.header_ == nil {
  30169. c.header_ = make(http.Header)
  30170. }
  30171. return c.header_
  30172. }
  30173. func (c *InstanceTemplatesInsertCall) doRequest(alt string) (*http.Response, error) {
  30174. reqHeaders := make(http.Header)
  30175. for k, v := range c.header_ {
  30176. reqHeaders[k] = v
  30177. }
  30178. reqHeaders.Set("User-Agent", c.s.userAgent())
  30179. var body io.Reader = nil
  30180. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancetemplate)
  30181. if err != nil {
  30182. return nil, err
  30183. }
  30184. reqHeaders.Set("Content-Type", "application/json")
  30185. c.urlParams_.Set("alt", alt)
  30186. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates")
  30187. urls += "?" + c.urlParams_.Encode()
  30188. req, _ := http.NewRequest("POST", urls, body)
  30189. req.Header = reqHeaders
  30190. googleapi.Expand(req.URL, map[string]string{
  30191. "project": c.project,
  30192. })
  30193. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30194. }
  30195. // Do executes the "compute.instanceTemplates.insert" call.
  30196. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  30197. // status code is an error. Response headers are in either
  30198. // *Operation.ServerResponse.Header or (if a response was returned at
  30199. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  30200. // to check whether the returned error was because
  30201. // http.StatusNotModified was returned.
  30202. func (c *InstanceTemplatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  30203. gensupport.SetOptions(c.urlParams_, opts...)
  30204. res, err := c.doRequest("json")
  30205. if res != nil && res.StatusCode == http.StatusNotModified {
  30206. if res.Body != nil {
  30207. res.Body.Close()
  30208. }
  30209. return nil, &googleapi.Error{
  30210. Code: res.StatusCode,
  30211. Header: res.Header,
  30212. }
  30213. }
  30214. if err != nil {
  30215. return nil, err
  30216. }
  30217. defer googleapi.CloseBody(res)
  30218. if err := googleapi.CheckResponse(res); err != nil {
  30219. return nil, err
  30220. }
  30221. ret := &Operation{
  30222. ServerResponse: googleapi.ServerResponse{
  30223. Header: res.Header,
  30224. HTTPStatusCode: res.StatusCode,
  30225. },
  30226. }
  30227. target := &ret
  30228. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  30229. return nil, err
  30230. }
  30231. return ret, nil
  30232. // {
  30233. // "description": "Creates an instance template in the specified project using the data that is included in the request. If you are creating a new template to update an existing instance group, your new instance template must use the same network or, if applicable, the same subnetwork as the original template.",
  30234. // "httpMethod": "POST",
  30235. // "id": "compute.instanceTemplates.insert",
  30236. // "parameterOrder": [
  30237. // "project"
  30238. // ],
  30239. // "parameters": {
  30240. // "project": {
  30241. // "description": "Project ID for this request.",
  30242. // "location": "path",
  30243. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  30244. // "required": true,
  30245. // "type": "string"
  30246. // }
  30247. // },
  30248. // "path": "{project}/global/instanceTemplates",
  30249. // "request": {
  30250. // "$ref": "InstanceTemplate"
  30251. // },
  30252. // "response": {
  30253. // "$ref": "Operation"
  30254. // },
  30255. // "scopes": [
  30256. // "https://www.googleapis.com/auth/cloud-platform",
  30257. // "https://www.googleapis.com/auth/compute"
  30258. // ]
  30259. // }
  30260. }
  30261. // method id "compute.instanceTemplates.list":
  30262. type InstanceTemplatesListCall struct {
  30263. s *Service
  30264. project string
  30265. urlParams_ gensupport.URLParams
  30266. ifNoneMatch_ string
  30267. ctx_ context.Context
  30268. header_ http.Header
  30269. }
  30270. // List: Retrieves a list of instance templates that are contained
  30271. // within the specified project and zone.
  30272. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/list
  30273. func (r *InstanceTemplatesService) List(project string) *InstanceTemplatesListCall {
  30274. c := &InstanceTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30275. c.project = project
  30276. return c
  30277. }
  30278. // Filter sets the optional parameter "filter": Sets a filter
  30279. // {expression} for filtering listed resources. Your {expression} must
  30280. // be in the format: field_name comparison_string literal_string.
  30281. //
  30282. // The field_name is the name of the field you want to compare. Only
  30283. // atomic field types are supported (string, number, boolean). The
  30284. // comparison_string must be either eq (equals) or ne (not equals). The
  30285. // literal_string is the string value to filter to. The literal value
  30286. // must be valid for the type of field you are filtering by (string,
  30287. // number, boolean). For string fields, the literal value is interpreted
  30288. // as a regular expression using RE2 syntax. The literal value must
  30289. // match the entire field.
  30290. //
  30291. // For example, to filter for instances that do not have a name of
  30292. // example-instance, you would use name ne example-instance.
  30293. //
  30294. // You can filter on nested fields. For example, you could filter on
  30295. // instances that have set the scheduling.automaticRestart field to
  30296. // true. Use filtering on nested fields to take advantage of labels to
  30297. // organize and search for results based on label values.
  30298. //
  30299. // To filter on multiple expressions, provide each separate expression
  30300. // within parentheses. For example, (scheduling.automaticRestart eq
  30301. // true) (zone eq us-central1-f). Multiple expressions are treated as
  30302. // AND expressions, meaning that resources must match all expressions to
  30303. // pass the filters.
  30304. func (c *InstanceTemplatesListCall) Filter(filter string) *InstanceTemplatesListCall {
  30305. c.urlParams_.Set("filter", filter)
  30306. return c
  30307. }
  30308. // MaxResults sets the optional parameter "maxResults": The maximum
  30309. // number of results per page that should be returned. If the number of
  30310. // available results is larger than maxResults, Compute Engine returns a
  30311. // nextPageToken that can be used to get the next page of results in
  30312. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  30313. // (Default: 500)
  30314. func (c *InstanceTemplatesListCall) MaxResults(maxResults int64) *InstanceTemplatesListCall {
  30315. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  30316. return c
  30317. }
  30318. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  30319. // a certain order. By default, results are returned in alphanumerical
  30320. // order based on the resource name.
  30321. //
  30322. // You can also sort results in descending order based on the creation
  30323. // timestamp using orderBy="creationTimestamp desc". This sorts results
  30324. // based on the creationTimestamp field in reverse chronological order
  30325. // (newest result first). Use this to sort resources like operations so
  30326. // that the newest operation is returned first.
  30327. //
  30328. // Currently, only sorting by name or creationTimestamp desc is
  30329. // supported.
  30330. func (c *InstanceTemplatesListCall) OrderBy(orderBy string) *InstanceTemplatesListCall {
  30331. c.urlParams_.Set("orderBy", orderBy)
  30332. return c
  30333. }
  30334. // PageToken sets the optional parameter "pageToken": Specifies a page
  30335. // token to use. Set pageToken to the nextPageToken returned by a
  30336. // previous list request to get the next page of results.
  30337. func (c *InstanceTemplatesListCall) PageToken(pageToken string) *InstanceTemplatesListCall {
  30338. c.urlParams_.Set("pageToken", pageToken)
  30339. return c
  30340. }
  30341. // Fields allows partial responses to be retrieved. See
  30342. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30343. // for more information.
  30344. func (c *InstanceTemplatesListCall) Fields(s ...googleapi.Field) *InstanceTemplatesListCall {
  30345. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30346. return c
  30347. }
  30348. // IfNoneMatch sets the optional parameter which makes the operation
  30349. // fail if the object's ETag matches the given value. This is useful for
  30350. // getting updates only after the object has changed since the last
  30351. // request. Use googleapi.IsNotModified to check whether the response
  30352. // error from Do is the result of In-None-Match.
  30353. func (c *InstanceTemplatesListCall) IfNoneMatch(entityTag string) *InstanceTemplatesListCall {
  30354. c.ifNoneMatch_ = entityTag
  30355. return c
  30356. }
  30357. // Context sets the context to be used in this call's Do method. Any
  30358. // pending HTTP request will be aborted if the provided context is
  30359. // canceled.
  30360. func (c *InstanceTemplatesListCall) Context(ctx context.Context) *InstanceTemplatesListCall {
  30361. c.ctx_ = ctx
  30362. return c
  30363. }
  30364. // Header returns an http.Header that can be modified by the caller to
  30365. // add HTTP headers to the request.
  30366. func (c *InstanceTemplatesListCall) Header() http.Header {
  30367. if c.header_ == nil {
  30368. c.header_ = make(http.Header)
  30369. }
  30370. return c.header_
  30371. }
  30372. func (c *InstanceTemplatesListCall) doRequest(alt string) (*http.Response, error) {
  30373. reqHeaders := make(http.Header)
  30374. for k, v := range c.header_ {
  30375. reqHeaders[k] = v
  30376. }
  30377. reqHeaders.Set("User-Agent", c.s.userAgent())
  30378. if c.ifNoneMatch_ != "" {
  30379. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  30380. }
  30381. var body io.Reader = nil
  30382. c.urlParams_.Set("alt", alt)
  30383. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates")
  30384. urls += "?" + c.urlParams_.Encode()
  30385. req, _ := http.NewRequest("GET", urls, body)
  30386. req.Header = reqHeaders
  30387. googleapi.Expand(req.URL, map[string]string{
  30388. "project": c.project,
  30389. })
  30390. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30391. }
  30392. // Do executes the "compute.instanceTemplates.list" call.
  30393. // Exactly one of *InstanceTemplateList or error will be non-nil. Any
  30394. // non-2xx status code is an error. Response headers are in either
  30395. // *InstanceTemplateList.ServerResponse.Header or (if a response was
  30396. // returned at all) in error.(*googleapi.Error).Header. Use
  30397. // googleapi.IsNotModified to check whether the returned error was
  30398. // because http.StatusNotModified was returned.
  30399. func (c *InstanceTemplatesListCall) Do(opts ...googleapi.CallOption) (*InstanceTemplateList, error) {
  30400. gensupport.SetOptions(c.urlParams_, opts...)
  30401. res, err := c.doRequest("json")
  30402. if res != nil && res.StatusCode == http.StatusNotModified {
  30403. if res.Body != nil {
  30404. res.Body.Close()
  30405. }
  30406. return nil, &googleapi.Error{
  30407. Code: res.StatusCode,
  30408. Header: res.Header,
  30409. }
  30410. }
  30411. if err != nil {
  30412. return nil, err
  30413. }
  30414. defer googleapi.CloseBody(res)
  30415. if err := googleapi.CheckResponse(res); err != nil {
  30416. return nil, err
  30417. }
  30418. ret := &InstanceTemplateList{
  30419. ServerResponse: googleapi.ServerResponse{
  30420. Header: res.Header,
  30421. HTTPStatusCode: res.StatusCode,
  30422. },
  30423. }
  30424. target := &ret
  30425. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  30426. return nil, err
  30427. }
  30428. return ret, nil
  30429. // {
  30430. // "description": "Retrieves a list of instance templates that are contained within the specified project and zone.",
  30431. // "httpMethod": "GET",
  30432. // "id": "compute.instanceTemplates.list",
  30433. // "parameterOrder": [
  30434. // "project"
  30435. // ],
  30436. // "parameters": {
  30437. // "filter": {
  30438. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  30439. // "location": "query",
  30440. // "type": "string"
  30441. // },
  30442. // "maxResults": {
  30443. // "default": "500",
  30444. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  30445. // "format": "uint32",
  30446. // "location": "query",
  30447. // "minimum": "0",
  30448. // "type": "integer"
  30449. // },
  30450. // "orderBy": {
  30451. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  30452. // "location": "query",
  30453. // "type": "string"
  30454. // },
  30455. // "pageToken": {
  30456. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  30457. // "location": "query",
  30458. // "type": "string"
  30459. // },
  30460. // "project": {
  30461. // "description": "Project ID for this request.",
  30462. // "location": "path",
  30463. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  30464. // "required": true,
  30465. // "type": "string"
  30466. // }
  30467. // },
  30468. // "path": "{project}/global/instanceTemplates",
  30469. // "response": {
  30470. // "$ref": "InstanceTemplateList"
  30471. // },
  30472. // "scopes": [
  30473. // "https://www.googleapis.com/auth/cloud-platform",
  30474. // "https://www.googleapis.com/auth/compute",
  30475. // "https://www.googleapis.com/auth/compute.readonly"
  30476. // ]
  30477. // }
  30478. }
  30479. // Pages invokes f for each page of results.
  30480. // A non-nil error returned from f will halt the iteration.
  30481. // The provided context supersedes any context provided to the Context method.
  30482. func (c *InstanceTemplatesListCall) Pages(ctx context.Context, f func(*InstanceTemplateList) error) error {
  30483. c.ctx_ = ctx
  30484. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  30485. for {
  30486. x, err := c.Do()
  30487. if err != nil {
  30488. return err
  30489. }
  30490. if err := f(x); err != nil {
  30491. return err
  30492. }
  30493. if x.NextPageToken == "" {
  30494. return nil
  30495. }
  30496. c.PageToken(x.NextPageToken)
  30497. }
  30498. }
  30499. // method id "compute.instances.addAccessConfig":
  30500. type InstancesAddAccessConfigCall struct {
  30501. s *Service
  30502. project string
  30503. zone string
  30504. instance string
  30505. accessconfig *AccessConfig
  30506. urlParams_ gensupport.URLParams
  30507. ctx_ context.Context
  30508. header_ http.Header
  30509. }
  30510. // AddAccessConfig: Adds an access config to an instance's network
  30511. // interface.
  30512. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/addAccessConfig
  30513. func (r *InstancesService) AddAccessConfig(project string, zone string, instance string, networkInterface string, accessconfig *AccessConfig) *InstancesAddAccessConfigCall {
  30514. c := &InstancesAddAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30515. c.project = project
  30516. c.zone = zone
  30517. c.instance = instance
  30518. c.urlParams_.Set("networkInterface", networkInterface)
  30519. c.accessconfig = accessconfig
  30520. return c
  30521. }
  30522. // Fields allows partial responses to be retrieved. See
  30523. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30524. // for more information.
  30525. func (c *InstancesAddAccessConfigCall) Fields(s ...googleapi.Field) *InstancesAddAccessConfigCall {
  30526. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30527. return c
  30528. }
  30529. // Context sets the context to be used in this call's Do method. Any
  30530. // pending HTTP request will be aborted if the provided context is
  30531. // canceled.
  30532. func (c *InstancesAddAccessConfigCall) Context(ctx context.Context) *InstancesAddAccessConfigCall {
  30533. c.ctx_ = ctx
  30534. return c
  30535. }
  30536. // Header returns an http.Header that can be modified by the caller to
  30537. // add HTTP headers to the request.
  30538. func (c *InstancesAddAccessConfigCall) Header() http.Header {
  30539. if c.header_ == nil {
  30540. c.header_ = make(http.Header)
  30541. }
  30542. return c.header_
  30543. }
  30544. func (c *InstancesAddAccessConfigCall) doRequest(alt string) (*http.Response, error) {
  30545. reqHeaders := make(http.Header)
  30546. for k, v := range c.header_ {
  30547. reqHeaders[k] = v
  30548. }
  30549. reqHeaders.Set("User-Agent", c.s.userAgent())
  30550. var body io.Reader = nil
  30551. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessconfig)
  30552. if err != nil {
  30553. return nil, err
  30554. }
  30555. reqHeaders.Set("Content-Type", "application/json")
  30556. c.urlParams_.Set("alt", alt)
  30557. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/addAccessConfig")
  30558. urls += "?" + c.urlParams_.Encode()
  30559. req, _ := http.NewRequest("POST", urls, body)
  30560. req.Header = reqHeaders
  30561. googleapi.Expand(req.URL, map[string]string{
  30562. "project": c.project,
  30563. "zone": c.zone,
  30564. "instance": c.instance,
  30565. })
  30566. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30567. }
  30568. // Do executes the "compute.instances.addAccessConfig" call.
  30569. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  30570. // status code is an error. Response headers are in either
  30571. // *Operation.ServerResponse.Header or (if a response was returned at
  30572. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  30573. // to check whether the returned error was because
  30574. // http.StatusNotModified was returned.
  30575. func (c *InstancesAddAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  30576. gensupport.SetOptions(c.urlParams_, opts...)
  30577. res, err := c.doRequest("json")
  30578. if res != nil && res.StatusCode == http.StatusNotModified {
  30579. if res.Body != nil {
  30580. res.Body.Close()
  30581. }
  30582. return nil, &googleapi.Error{
  30583. Code: res.StatusCode,
  30584. Header: res.Header,
  30585. }
  30586. }
  30587. if err != nil {
  30588. return nil, err
  30589. }
  30590. defer googleapi.CloseBody(res)
  30591. if err := googleapi.CheckResponse(res); err != nil {
  30592. return nil, err
  30593. }
  30594. ret := &Operation{
  30595. ServerResponse: googleapi.ServerResponse{
  30596. Header: res.Header,
  30597. HTTPStatusCode: res.StatusCode,
  30598. },
  30599. }
  30600. target := &ret
  30601. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  30602. return nil, err
  30603. }
  30604. return ret, nil
  30605. // {
  30606. // "description": "Adds an access config to an instance's network interface.",
  30607. // "httpMethod": "POST",
  30608. // "id": "compute.instances.addAccessConfig",
  30609. // "parameterOrder": [
  30610. // "project",
  30611. // "zone",
  30612. // "instance",
  30613. // "networkInterface"
  30614. // ],
  30615. // "parameters": {
  30616. // "instance": {
  30617. // "description": "The instance name for this request.",
  30618. // "location": "path",
  30619. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  30620. // "required": true,
  30621. // "type": "string"
  30622. // },
  30623. // "networkInterface": {
  30624. // "description": "The name of the network interface to add to this instance.",
  30625. // "location": "query",
  30626. // "required": true,
  30627. // "type": "string"
  30628. // },
  30629. // "project": {
  30630. // "description": "Project ID for this request.",
  30631. // "location": "path",
  30632. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  30633. // "required": true,
  30634. // "type": "string"
  30635. // },
  30636. // "zone": {
  30637. // "description": "The name of the zone for this request.",
  30638. // "location": "path",
  30639. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  30640. // "required": true,
  30641. // "type": "string"
  30642. // }
  30643. // },
  30644. // "path": "{project}/zones/{zone}/instances/{instance}/addAccessConfig",
  30645. // "request": {
  30646. // "$ref": "AccessConfig"
  30647. // },
  30648. // "response": {
  30649. // "$ref": "Operation"
  30650. // },
  30651. // "scopes": [
  30652. // "https://www.googleapis.com/auth/cloud-platform",
  30653. // "https://www.googleapis.com/auth/compute"
  30654. // ]
  30655. // }
  30656. }
  30657. // method id "compute.instances.aggregatedList":
  30658. type InstancesAggregatedListCall struct {
  30659. s *Service
  30660. project string
  30661. urlParams_ gensupport.URLParams
  30662. ifNoneMatch_ string
  30663. ctx_ context.Context
  30664. header_ http.Header
  30665. }
  30666. // AggregatedList: Retrieves aggregated list of instances.
  30667. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/aggregatedList
  30668. func (r *InstancesService) AggregatedList(project string) *InstancesAggregatedListCall {
  30669. c := &InstancesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30670. c.project = project
  30671. return c
  30672. }
  30673. // Filter sets the optional parameter "filter": Sets a filter
  30674. // {expression} for filtering listed resources. Your {expression} must
  30675. // be in the format: field_name comparison_string literal_string.
  30676. //
  30677. // The field_name is the name of the field you want to compare. Only
  30678. // atomic field types are supported (string, number, boolean). The
  30679. // comparison_string must be either eq (equals) or ne (not equals). The
  30680. // literal_string is the string value to filter to. The literal value
  30681. // must be valid for the type of field you are filtering by (string,
  30682. // number, boolean). For string fields, the literal value is interpreted
  30683. // as a regular expression using RE2 syntax. The literal value must
  30684. // match the entire field.
  30685. //
  30686. // For example, to filter for instances that do not have a name of
  30687. // example-instance, you would use name ne example-instance.
  30688. //
  30689. // You can filter on nested fields. For example, you could filter on
  30690. // instances that have set the scheduling.automaticRestart field to
  30691. // true. Use filtering on nested fields to take advantage of labels to
  30692. // organize and search for results based on label values.
  30693. //
  30694. // To filter on multiple expressions, provide each separate expression
  30695. // within parentheses. For example, (scheduling.automaticRestart eq
  30696. // true) (zone eq us-central1-f). Multiple expressions are treated as
  30697. // AND expressions, meaning that resources must match all expressions to
  30698. // pass the filters.
  30699. func (c *InstancesAggregatedListCall) Filter(filter string) *InstancesAggregatedListCall {
  30700. c.urlParams_.Set("filter", filter)
  30701. return c
  30702. }
  30703. // MaxResults sets the optional parameter "maxResults": The maximum
  30704. // number of results per page that should be returned. If the number of
  30705. // available results is larger than maxResults, Compute Engine returns a
  30706. // nextPageToken that can be used to get the next page of results in
  30707. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  30708. // (Default: 500)
  30709. func (c *InstancesAggregatedListCall) MaxResults(maxResults int64) *InstancesAggregatedListCall {
  30710. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  30711. return c
  30712. }
  30713. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  30714. // a certain order. By default, results are returned in alphanumerical
  30715. // order based on the resource name.
  30716. //
  30717. // You can also sort results in descending order based on the creation
  30718. // timestamp using orderBy="creationTimestamp desc". This sorts results
  30719. // based on the creationTimestamp field in reverse chronological order
  30720. // (newest result first). Use this to sort resources like operations so
  30721. // that the newest operation is returned first.
  30722. //
  30723. // Currently, only sorting by name or creationTimestamp desc is
  30724. // supported.
  30725. func (c *InstancesAggregatedListCall) OrderBy(orderBy string) *InstancesAggregatedListCall {
  30726. c.urlParams_.Set("orderBy", orderBy)
  30727. return c
  30728. }
  30729. // PageToken sets the optional parameter "pageToken": Specifies a page
  30730. // token to use. Set pageToken to the nextPageToken returned by a
  30731. // previous list request to get the next page of results.
  30732. func (c *InstancesAggregatedListCall) PageToken(pageToken string) *InstancesAggregatedListCall {
  30733. c.urlParams_.Set("pageToken", pageToken)
  30734. return c
  30735. }
  30736. // Fields allows partial responses to be retrieved. See
  30737. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30738. // for more information.
  30739. func (c *InstancesAggregatedListCall) Fields(s ...googleapi.Field) *InstancesAggregatedListCall {
  30740. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30741. return c
  30742. }
  30743. // IfNoneMatch sets the optional parameter which makes the operation
  30744. // fail if the object's ETag matches the given value. This is useful for
  30745. // getting updates only after the object has changed since the last
  30746. // request. Use googleapi.IsNotModified to check whether the response
  30747. // error from Do is the result of In-None-Match.
  30748. func (c *InstancesAggregatedListCall) IfNoneMatch(entityTag string) *InstancesAggregatedListCall {
  30749. c.ifNoneMatch_ = entityTag
  30750. return c
  30751. }
  30752. // Context sets the context to be used in this call's Do method. Any
  30753. // pending HTTP request will be aborted if the provided context is
  30754. // canceled.
  30755. func (c *InstancesAggregatedListCall) Context(ctx context.Context) *InstancesAggregatedListCall {
  30756. c.ctx_ = ctx
  30757. return c
  30758. }
  30759. // Header returns an http.Header that can be modified by the caller to
  30760. // add HTTP headers to the request.
  30761. func (c *InstancesAggregatedListCall) Header() http.Header {
  30762. if c.header_ == nil {
  30763. c.header_ = make(http.Header)
  30764. }
  30765. return c.header_
  30766. }
  30767. func (c *InstancesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  30768. reqHeaders := make(http.Header)
  30769. for k, v := range c.header_ {
  30770. reqHeaders[k] = v
  30771. }
  30772. reqHeaders.Set("User-Agent", c.s.userAgent())
  30773. if c.ifNoneMatch_ != "" {
  30774. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  30775. }
  30776. var body io.Reader = nil
  30777. c.urlParams_.Set("alt", alt)
  30778. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instances")
  30779. urls += "?" + c.urlParams_.Encode()
  30780. req, _ := http.NewRequest("GET", urls, body)
  30781. req.Header = reqHeaders
  30782. googleapi.Expand(req.URL, map[string]string{
  30783. "project": c.project,
  30784. })
  30785. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30786. }
  30787. // Do executes the "compute.instances.aggregatedList" call.
  30788. // Exactly one of *InstanceAggregatedList or error will be non-nil. Any
  30789. // non-2xx status code is an error. Response headers are in either
  30790. // *InstanceAggregatedList.ServerResponse.Header or (if a response was
  30791. // returned at all) in error.(*googleapi.Error).Header. Use
  30792. // googleapi.IsNotModified to check whether the returned error was
  30793. // because http.StatusNotModified was returned.
  30794. func (c *InstancesAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceAggregatedList, error) {
  30795. gensupport.SetOptions(c.urlParams_, opts...)
  30796. res, err := c.doRequest("json")
  30797. if res != nil && res.StatusCode == http.StatusNotModified {
  30798. if res.Body != nil {
  30799. res.Body.Close()
  30800. }
  30801. return nil, &googleapi.Error{
  30802. Code: res.StatusCode,
  30803. Header: res.Header,
  30804. }
  30805. }
  30806. if err != nil {
  30807. return nil, err
  30808. }
  30809. defer googleapi.CloseBody(res)
  30810. if err := googleapi.CheckResponse(res); err != nil {
  30811. return nil, err
  30812. }
  30813. ret := &InstanceAggregatedList{
  30814. ServerResponse: googleapi.ServerResponse{
  30815. Header: res.Header,
  30816. HTTPStatusCode: res.StatusCode,
  30817. },
  30818. }
  30819. target := &ret
  30820. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  30821. return nil, err
  30822. }
  30823. return ret, nil
  30824. // {
  30825. // "description": "Retrieves aggregated list of instances.",
  30826. // "httpMethod": "GET",
  30827. // "id": "compute.instances.aggregatedList",
  30828. // "parameterOrder": [
  30829. // "project"
  30830. // ],
  30831. // "parameters": {
  30832. // "filter": {
  30833. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  30834. // "location": "query",
  30835. // "type": "string"
  30836. // },
  30837. // "maxResults": {
  30838. // "default": "500",
  30839. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  30840. // "format": "uint32",
  30841. // "location": "query",
  30842. // "minimum": "0",
  30843. // "type": "integer"
  30844. // },
  30845. // "orderBy": {
  30846. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  30847. // "location": "query",
  30848. // "type": "string"
  30849. // },
  30850. // "pageToken": {
  30851. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  30852. // "location": "query",
  30853. // "type": "string"
  30854. // },
  30855. // "project": {
  30856. // "description": "Project ID for this request.",
  30857. // "location": "path",
  30858. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  30859. // "required": true,
  30860. // "type": "string"
  30861. // }
  30862. // },
  30863. // "path": "{project}/aggregated/instances",
  30864. // "response": {
  30865. // "$ref": "InstanceAggregatedList"
  30866. // },
  30867. // "scopes": [
  30868. // "https://www.googleapis.com/auth/cloud-platform",
  30869. // "https://www.googleapis.com/auth/compute",
  30870. // "https://www.googleapis.com/auth/compute.readonly"
  30871. // ]
  30872. // }
  30873. }
  30874. // Pages invokes f for each page of results.
  30875. // A non-nil error returned from f will halt the iteration.
  30876. // The provided context supersedes any context provided to the Context method.
  30877. func (c *InstancesAggregatedListCall) Pages(ctx context.Context, f func(*InstanceAggregatedList) error) error {
  30878. c.ctx_ = ctx
  30879. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  30880. for {
  30881. x, err := c.Do()
  30882. if err != nil {
  30883. return err
  30884. }
  30885. if err := f(x); err != nil {
  30886. return err
  30887. }
  30888. if x.NextPageToken == "" {
  30889. return nil
  30890. }
  30891. c.PageToken(x.NextPageToken)
  30892. }
  30893. }
  30894. // method id "compute.instances.attachDisk":
  30895. type InstancesAttachDiskCall struct {
  30896. s *Service
  30897. project string
  30898. zone string
  30899. instance string
  30900. attacheddisk *AttachedDisk
  30901. urlParams_ gensupport.URLParams
  30902. ctx_ context.Context
  30903. header_ http.Header
  30904. }
  30905. // AttachDisk: Attaches an existing Disk resource to an instance. You
  30906. // must first create the disk before you can attach it. It is not
  30907. // possible to create and attach a disk at the same time. For more
  30908. // information, read Adding a persistent disk to your instance.
  30909. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/attachDisk
  30910. func (r *InstancesService) AttachDisk(project string, zone string, instance string, attacheddisk *AttachedDisk) *InstancesAttachDiskCall {
  30911. c := &InstancesAttachDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30912. c.project = project
  30913. c.zone = zone
  30914. c.instance = instance
  30915. c.attacheddisk = attacheddisk
  30916. return c
  30917. }
  30918. // Fields allows partial responses to be retrieved. See
  30919. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30920. // for more information.
  30921. func (c *InstancesAttachDiskCall) Fields(s ...googleapi.Field) *InstancesAttachDiskCall {
  30922. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30923. return c
  30924. }
  30925. // Context sets the context to be used in this call's Do method. Any
  30926. // pending HTTP request will be aborted if the provided context is
  30927. // canceled.
  30928. func (c *InstancesAttachDiskCall) Context(ctx context.Context) *InstancesAttachDiskCall {
  30929. c.ctx_ = ctx
  30930. return c
  30931. }
  30932. // Header returns an http.Header that can be modified by the caller to
  30933. // add HTTP headers to the request.
  30934. func (c *InstancesAttachDiskCall) Header() http.Header {
  30935. if c.header_ == nil {
  30936. c.header_ = make(http.Header)
  30937. }
  30938. return c.header_
  30939. }
  30940. func (c *InstancesAttachDiskCall) doRequest(alt string) (*http.Response, error) {
  30941. reqHeaders := make(http.Header)
  30942. for k, v := range c.header_ {
  30943. reqHeaders[k] = v
  30944. }
  30945. reqHeaders.Set("User-Agent", c.s.userAgent())
  30946. var body io.Reader = nil
  30947. body, err := googleapi.WithoutDataWrapper.JSONReader(c.attacheddisk)
  30948. if err != nil {
  30949. return nil, err
  30950. }
  30951. reqHeaders.Set("Content-Type", "application/json")
  30952. c.urlParams_.Set("alt", alt)
  30953. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/attachDisk")
  30954. urls += "?" + c.urlParams_.Encode()
  30955. req, _ := http.NewRequest("POST", urls, body)
  30956. req.Header = reqHeaders
  30957. googleapi.Expand(req.URL, map[string]string{
  30958. "project": c.project,
  30959. "zone": c.zone,
  30960. "instance": c.instance,
  30961. })
  30962. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30963. }
  30964. // Do executes the "compute.instances.attachDisk" call.
  30965. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  30966. // status code is an error. Response headers are in either
  30967. // *Operation.ServerResponse.Header or (if a response was returned at
  30968. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  30969. // to check whether the returned error was because
  30970. // http.StatusNotModified was returned.
  30971. func (c *InstancesAttachDiskCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  30972. gensupport.SetOptions(c.urlParams_, opts...)
  30973. res, err := c.doRequest("json")
  30974. if res != nil && res.StatusCode == http.StatusNotModified {
  30975. if res.Body != nil {
  30976. res.Body.Close()
  30977. }
  30978. return nil, &googleapi.Error{
  30979. Code: res.StatusCode,
  30980. Header: res.Header,
  30981. }
  30982. }
  30983. if err != nil {
  30984. return nil, err
  30985. }
  30986. defer googleapi.CloseBody(res)
  30987. if err := googleapi.CheckResponse(res); err != nil {
  30988. return nil, err
  30989. }
  30990. ret := &Operation{
  30991. ServerResponse: googleapi.ServerResponse{
  30992. Header: res.Header,
  30993. HTTPStatusCode: res.StatusCode,
  30994. },
  30995. }
  30996. target := &ret
  30997. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  30998. return nil, err
  30999. }
  31000. return ret, nil
  31001. // {
  31002. // "description": "Attaches an existing Disk resource to an instance. You must first create the disk before you can attach it. It is not possible to create and attach a disk at the same time. For more information, read Adding a persistent disk to your instance.",
  31003. // "httpMethod": "POST",
  31004. // "id": "compute.instances.attachDisk",
  31005. // "parameterOrder": [
  31006. // "project",
  31007. // "zone",
  31008. // "instance"
  31009. // ],
  31010. // "parameters": {
  31011. // "instance": {
  31012. // "description": "The instance name for this request.",
  31013. // "location": "path",
  31014. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31015. // "required": true,
  31016. // "type": "string"
  31017. // },
  31018. // "project": {
  31019. // "description": "Project ID for this request.",
  31020. // "location": "path",
  31021. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31022. // "required": true,
  31023. // "type": "string"
  31024. // },
  31025. // "zone": {
  31026. // "description": "The name of the zone for this request.",
  31027. // "location": "path",
  31028. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31029. // "required": true,
  31030. // "type": "string"
  31031. // }
  31032. // },
  31033. // "path": "{project}/zones/{zone}/instances/{instance}/attachDisk",
  31034. // "request": {
  31035. // "$ref": "AttachedDisk"
  31036. // },
  31037. // "response": {
  31038. // "$ref": "Operation"
  31039. // },
  31040. // "scopes": [
  31041. // "https://www.googleapis.com/auth/cloud-platform",
  31042. // "https://www.googleapis.com/auth/compute"
  31043. // ]
  31044. // }
  31045. }
  31046. // method id "compute.instances.delete":
  31047. type InstancesDeleteCall struct {
  31048. s *Service
  31049. project string
  31050. zone string
  31051. instance string
  31052. urlParams_ gensupport.URLParams
  31053. ctx_ context.Context
  31054. header_ http.Header
  31055. }
  31056. // Delete: Deletes the specified Instance resource. For more
  31057. // information, see Stopping or Deleting an Instance.
  31058. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/delete
  31059. func (r *InstancesService) Delete(project string, zone string, instance string) *InstancesDeleteCall {
  31060. c := &InstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31061. c.project = project
  31062. c.zone = zone
  31063. c.instance = instance
  31064. return c
  31065. }
  31066. // Fields allows partial responses to be retrieved. See
  31067. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31068. // for more information.
  31069. func (c *InstancesDeleteCall) Fields(s ...googleapi.Field) *InstancesDeleteCall {
  31070. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31071. return c
  31072. }
  31073. // Context sets the context to be used in this call's Do method. Any
  31074. // pending HTTP request will be aborted if the provided context is
  31075. // canceled.
  31076. func (c *InstancesDeleteCall) Context(ctx context.Context) *InstancesDeleteCall {
  31077. c.ctx_ = ctx
  31078. return c
  31079. }
  31080. // Header returns an http.Header that can be modified by the caller to
  31081. // add HTTP headers to the request.
  31082. func (c *InstancesDeleteCall) Header() http.Header {
  31083. if c.header_ == nil {
  31084. c.header_ = make(http.Header)
  31085. }
  31086. return c.header_
  31087. }
  31088. func (c *InstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
  31089. reqHeaders := make(http.Header)
  31090. for k, v := range c.header_ {
  31091. reqHeaders[k] = v
  31092. }
  31093. reqHeaders.Set("User-Agent", c.s.userAgent())
  31094. var body io.Reader = nil
  31095. c.urlParams_.Set("alt", alt)
  31096. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}")
  31097. urls += "?" + c.urlParams_.Encode()
  31098. req, _ := http.NewRequest("DELETE", urls, body)
  31099. req.Header = reqHeaders
  31100. googleapi.Expand(req.URL, map[string]string{
  31101. "project": c.project,
  31102. "zone": c.zone,
  31103. "instance": c.instance,
  31104. })
  31105. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31106. }
  31107. // Do executes the "compute.instances.delete" call.
  31108. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  31109. // status code is an error. Response headers are in either
  31110. // *Operation.ServerResponse.Header or (if a response was returned at
  31111. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  31112. // to check whether the returned error was because
  31113. // http.StatusNotModified was returned.
  31114. func (c *InstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  31115. gensupport.SetOptions(c.urlParams_, opts...)
  31116. res, err := c.doRequest("json")
  31117. if res != nil && res.StatusCode == http.StatusNotModified {
  31118. if res.Body != nil {
  31119. res.Body.Close()
  31120. }
  31121. return nil, &googleapi.Error{
  31122. Code: res.StatusCode,
  31123. Header: res.Header,
  31124. }
  31125. }
  31126. if err != nil {
  31127. return nil, err
  31128. }
  31129. defer googleapi.CloseBody(res)
  31130. if err := googleapi.CheckResponse(res); err != nil {
  31131. return nil, err
  31132. }
  31133. ret := &Operation{
  31134. ServerResponse: googleapi.ServerResponse{
  31135. Header: res.Header,
  31136. HTTPStatusCode: res.StatusCode,
  31137. },
  31138. }
  31139. target := &ret
  31140. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  31141. return nil, err
  31142. }
  31143. return ret, nil
  31144. // {
  31145. // "description": "Deletes the specified Instance resource. For more information, see Stopping or Deleting an Instance.",
  31146. // "httpMethod": "DELETE",
  31147. // "id": "compute.instances.delete",
  31148. // "parameterOrder": [
  31149. // "project",
  31150. // "zone",
  31151. // "instance"
  31152. // ],
  31153. // "parameters": {
  31154. // "instance": {
  31155. // "description": "Name of the instance resource to delete.",
  31156. // "location": "path",
  31157. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31158. // "required": true,
  31159. // "type": "string"
  31160. // },
  31161. // "project": {
  31162. // "description": "Project ID for this request.",
  31163. // "location": "path",
  31164. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31165. // "required": true,
  31166. // "type": "string"
  31167. // },
  31168. // "zone": {
  31169. // "description": "The name of the zone for this request.",
  31170. // "location": "path",
  31171. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31172. // "required": true,
  31173. // "type": "string"
  31174. // }
  31175. // },
  31176. // "path": "{project}/zones/{zone}/instances/{instance}",
  31177. // "response": {
  31178. // "$ref": "Operation"
  31179. // },
  31180. // "scopes": [
  31181. // "https://www.googleapis.com/auth/cloud-platform",
  31182. // "https://www.googleapis.com/auth/compute"
  31183. // ]
  31184. // }
  31185. }
  31186. // method id "compute.instances.deleteAccessConfig":
  31187. type InstancesDeleteAccessConfigCall struct {
  31188. s *Service
  31189. project string
  31190. zone string
  31191. instance string
  31192. urlParams_ gensupport.URLParams
  31193. ctx_ context.Context
  31194. header_ http.Header
  31195. }
  31196. // DeleteAccessConfig: Deletes an access config from an instance's
  31197. // network interface.
  31198. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/deleteAccessConfig
  31199. func (r *InstancesService) DeleteAccessConfig(project string, zone string, instance string, accessConfig string, networkInterface string) *InstancesDeleteAccessConfigCall {
  31200. c := &InstancesDeleteAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31201. c.project = project
  31202. c.zone = zone
  31203. c.instance = instance
  31204. c.urlParams_.Set("accessConfig", accessConfig)
  31205. c.urlParams_.Set("networkInterface", networkInterface)
  31206. return c
  31207. }
  31208. // Fields allows partial responses to be retrieved. See
  31209. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31210. // for more information.
  31211. func (c *InstancesDeleteAccessConfigCall) Fields(s ...googleapi.Field) *InstancesDeleteAccessConfigCall {
  31212. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31213. return c
  31214. }
  31215. // Context sets the context to be used in this call's Do method. Any
  31216. // pending HTTP request will be aborted if the provided context is
  31217. // canceled.
  31218. func (c *InstancesDeleteAccessConfigCall) Context(ctx context.Context) *InstancesDeleteAccessConfigCall {
  31219. c.ctx_ = ctx
  31220. return c
  31221. }
  31222. // Header returns an http.Header that can be modified by the caller to
  31223. // add HTTP headers to the request.
  31224. func (c *InstancesDeleteAccessConfigCall) Header() http.Header {
  31225. if c.header_ == nil {
  31226. c.header_ = make(http.Header)
  31227. }
  31228. return c.header_
  31229. }
  31230. func (c *InstancesDeleteAccessConfigCall) doRequest(alt string) (*http.Response, error) {
  31231. reqHeaders := make(http.Header)
  31232. for k, v := range c.header_ {
  31233. reqHeaders[k] = v
  31234. }
  31235. reqHeaders.Set("User-Agent", c.s.userAgent())
  31236. var body io.Reader = nil
  31237. c.urlParams_.Set("alt", alt)
  31238. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/deleteAccessConfig")
  31239. urls += "?" + c.urlParams_.Encode()
  31240. req, _ := http.NewRequest("POST", urls, body)
  31241. req.Header = reqHeaders
  31242. googleapi.Expand(req.URL, map[string]string{
  31243. "project": c.project,
  31244. "zone": c.zone,
  31245. "instance": c.instance,
  31246. })
  31247. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31248. }
  31249. // Do executes the "compute.instances.deleteAccessConfig" call.
  31250. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  31251. // status code is an error. Response headers are in either
  31252. // *Operation.ServerResponse.Header or (if a response was returned at
  31253. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  31254. // to check whether the returned error was because
  31255. // http.StatusNotModified was returned.
  31256. func (c *InstancesDeleteAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  31257. gensupport.SetOptions(c.urlParams_, opts...)
  31258. res, err := c.doRequest("json")
  31259. if res != nil && res.StatusCode == http.StatusNotModified {
  31260. if res.Body != nil {
  31261. res.Body.Close()
  31262. }
  31263. return nil, &googleapi.Error{
  31264. Code: res.StatusCode,
  31265. Header: res.Header,
  31266. }
  31267. }
  31268. if err != nil {
  31269. return nil, err
  31270. }
  31271. defer googleapi.CloseBody(res)
  31272. if err := googleapi.CheckResponse(res); err != nil {
  31273. return nil, err
  31274. }
  31275. ret := &Operation{
  31276. ServerResponse: googleapi.ServerResponse{
  31277. Header: res.Header,
  31278. HTTPStatusCode: res.StatusCode,
  31279. },
  31280. }
  31281. target := &ret
  31282. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  31283. return nil, err
  31284. }
  31285. return ret, nil
  31286. // {
  31287. // "description": "Deletes an access config from an instance's network interface.",
  31288. // "httpMethod": "POST",
  31289. // "id": "compute.instances.deleteAccessConfig",
  31290. // "parameterOrder": [
  31291. // "project",
  31292. // "zone",
  31293. // "instance",
  31294. // "accessConfig",
  31295. // "networkInterface"
  31296. // ],
  31297. // "parameters": {
  31298. // "accessConfig": {
  31299. // "description": "The name of the access config to delete.",
  31300. // "location": "query",
  31301. // "required": true,
  31302. // "type": "string"
  31303. // },
  31304. // "instance": {
  31305. // "description": "The instance name for this request.",
  31306. // "location": "path",
  31307. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31308. // "required": true,
  31309. // "type": "string"
  31310. // },
  31311. // "networkInterface": {
  31312. // "description": "The name of the network interface.",
  31313. // "location": "query",
  31314. // "required": true,
  31315. // "type": "string"
  31316. // },
  31317. // "project": {
  31318. // "description": "Project ID for this request.",
  31319. // "location": "path",
  31320. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31321. // "required": true,
  31322. // "type": "string"
  31323. // },
  31324. // "zone": {
  31325. // "description": "The name of the zone for this request.",
  31326. // "location": "path",
  31327. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31328. // "required": true,
  31329. // "type": "string"
  31330. // }
  31331. // },
  31332. // "path": "{project}/zones/{zone}/instances/{instance}/deleteAccessConfig",
  31333. // "response": {
  31334. // "$ref": "Operation"
  31335. // },
  31336. // "scopes": [
  31337. // "https://www.googleapis.com/auth/cloud-platform",
  31338. // "https://www.googleapis.com/auth/compute"
  31339. // ]
  31340. // }
  31341. }
  31342. // method id "compute.instances.detachDisk":
  31343. type InstancesDetachDiskCall struct {
  31344. s *Service
  31345. project string
  31346. zone string
  31347. instance string
  31348. urlParams_ gensupport.URLParams
  31349. ctx_ context.Context
  31350. header_ http.Header
  31351. }
  31352. // DetachDisk: Detaches a disk from an instance.
  31353. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/detachDisk
  31354. func (r *InstancesService) DetachDisk(project string, zone string, instance string, deviceName string) *InstancesDetachDiskCall {
  31355. c := &InstancesDetachDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31356. c.project = project
  31357. c.zone = zone
  31358. c.instance = instance
  31359. c.urlParams_.Set("deviceName", deviceName)
  31360. return c
  31361. }
  31362. // Fields allows partial responses to be retrieved. See
  31363. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31364. // for more information.
  31365. func (c *InstancesDetachDiskCall) Fields(s ...googleapi.Field) *InstancesDetachDiskCall {
  31366. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31367. return c
  31368. }
  31369. // Context sets the context to be used in this call's Do method. Any
  31370. // pending HTTP request will be aborted if the provided context is
  31371. // canceled.
  31372. func (c *InstancesDetachDiskCall) Context(ctx context.Context) *InstancesDetachDiskCall {
  31373. c.ctx_ = ctx
  31374. return c
  31375. }
  31376. // Header returns an http.Header that can be modified by the caller to
  31377. // add HTTP headers to the request.
  31378. func (c *InstancesDetachDiskCall) Header() http.Header {
  31379. if c.header_ == nil {
  31380. c.header_ = make(http.Header)
  31381. }
  31382. return c.header_
  31383. }
  31384. func (c *InstancesDetachDiskCall) doRequest(alt string) (*http.Response, error) {
  31385. reqHeaders := make(http.Header)
  31386. for k, v := range c.header_ {
  31387. reqHeaders[k] = v
  31388. }
  31389. reqHeaders.Set("User-Agent", c.s.userAgent())
  31390. var body io.Reader = nil
  31391. c.urlParams_.Set("alt", alt)
  31392. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/detachDisk")
  31393. urls += "?" + c.urlParams_.Encode()
  31394. req, _ := http.NewRequest("POST", urls, body)
  31395. req.Header = reqHeaders
  31396. googleapi.Expand(req.URL, map[string]string{
  31397. "project": c.project,
  31398. "zone": c.zone,
  31399. "instance": c.instance,
  31400. })
  31401. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31402. }
  31403. // Do executes the "compute.instances.detachDisk" call.
  31404. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  31405. // status code is an error. Response headers are in either
  31406. // *Operation.ServerResponse.Header or (if a response was returned at
  31407. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  31408. // to check whether the returned error was because
  31409. // http.StatusNotModified was returned.
  31410. func (c *InstancesDetachDiskCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  31411. gensupport.SetOptions(c.urlParams_, opts...)
  31412. res, err := c.doRequest("json")
  31413. if res != nil && res.StatusCode == http.StatusNotModified {
  31414. if res.Body != nil {
  31415. res.Body.Close()
  31416. }
  31417. return nil, &googleapi.Error{
  31418. Code: res.StatusCode,
  31419. Header: res.Header,
  31420. }
  31421. }
  31422. if err != nil {
  31423. return nil, err
  31424. }
  31425. defer googleapi.CloseBody(res)
  31426. if err := googleapi.CheckResponse(res); err != nil {
  31427. return nil, err
  31428. }
  31429. ret := &Operation{
  31430. ServerResponse: googleapi.ServerResponse{
  31431. Header: res.Header,
  31432. HTTPStatusCode: res.StatusCode,
  31433. },
  31434. }
  31435. target := &ret
  31436. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  31437. return nil, err
  31438. }
  31439. return ret, nil
  31440. // {
  31441. // "description": "Detaches a disk from an instance.",
  31442. // "httpMethod": "POST",
  31443. // "id": "compute.instances.detachDisk",
  31444. // "parameterOrder": [
  31445. // "project",
  31446. // "zone",
  31447. // "instance",
  31448. // "deviceName"
  31449. // ],
  31450. // "parameters": {
  31451. // "deviceName": {
  31452. // "description": "Disk device name to detach.",
  31453. // "location": "query",
  31454. // "required": true,
  31455. // "type": "string"
  31456. // },
  31457. // "instance": {
  31458. // "description": "Instance name.",
  31459. // "location": "path",
  31460. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31461. // "required": true,
  31462. // "type": "string"
  31463. // },
  31464. // "project": {
  31465. // "description": "Project ID for this request.",
  31466. // "location": "path",
  31467. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31468. // "required": true,
  31469. // "type": "string"
  31470. // },
  31471. // "zone": {
  31472. // "description": "The name of the zone for this request.",
  31473. // "location": "path",
  31474. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31475. // "required": true,
  31476. // "type": "string"
  31477. // }
  31478. // },
  31479. // "path": "{project}/zones/{zone}/instances/{instance}/detachDisk",
  31480. // "response": {
  31481. // "$ref": "Operation"
  31482. // },
  31483. // "scopes": [
  31484. // "https://www.googleapis.com/auth/cloud-platform",
  31485. // "https://www.googleapis.com/auth/compute"
  31486. // ]
  31487. // }
  31488. }
  31489. // method id "compute.instances.get":
  31490. type InstancesGetCall struct {
  31491. s *Service
  31492. project string
  31493. zone string
  31494. instance string
  31495. urlParams_ gensupport.URLParams
  31496. ifNoneMatch_ string
  31497. ctx_ context.Context
  31498. header_ http.Header
  31499. }
  31500. // Get: Returns the specified Instance resource. Get a list of available
  31501. // instances by making a list() request.
  31502. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/get
  31503. func (r *InstancesService) Get(project string, zone string, instance string) *InstancesGetCall {
  31504. c := &InstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31505. c.project = project
  31506. c.zone = zone
  31507. c.instance = instance
  31508. return c
  31509. }
  31510. // Fields allows partial responses to be retrieved. See
  31511. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31512. // for more information.
  31513. func (c *InstancesGetCall) Fields(s ...googleapi.Field) *InstancesGetCall {
  31514. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31515. return c
  31516. }
  31517. // IfNoneMatch sets the optional parameter which makes the operation
  31518. // fail if the object's ETag matches the given value. This is useful for
  31519. // getting updates only after the object has changed since the last
  31520. // request. Use googleapi.IsNotModified to check whether the response
  31521. // error from Do is the result of In-None-Match.
  31522. func (c *InstancesGetCall) IfNoneMatch(entityTag string) *InstancesGetCall {
  31523. c.ifNoneMatch_ = entityTag
  31524. return c
  31525. }
  31526. // Context sets the context to be used in this call's Do method. Any
  31527. // pending HTTP request will be aborted if the provided context is
  31528. // canceled.
  31529. func (c *InstancesGetCall) Context(ctx context.Context) *InstancesGetCall {
  31530. c.ctx_ = ctx
  31531. return c
  31532. }
  31533. // Header returns an http.Header that can be modified by the caller to
  31534. // add HTTP headers to the request.
  31535. func (c *InstancesGetCall) Header() http.Header {
  31536. if c.header_ == nil {
  31537. c.header_ = make(http.Header)
  31538. }
  31539. return c.header_
  31540. }
  31541. func (c *InstancesGetCall) doRequest(alt string) (*http.Response, error) {
  31542. reqHeaders := make(http.Header)
  31543. for k, v := range c.header_ {
  31544. reqHeaders[k] = v
  31545. }
  31546. reqHeaders.Set("User-Agent", c.s.userAgent())
  31547. if c.ifNoneMatch_ != "" {
  31548. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31549. }
  31550. var body io.Reader = nil
  31551. c.urlParams_.Set("alt", alt)
  31552. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}")
  31553. urls += "?" + c.urlParams_.Encode()
  31554. req, _ := http.NewRequest("GET", urls, body)
  31555. req.Header = reqHeaders
  31556. googleapi.Expand(req.URL, map[string]string{
  31557. "project": c.project,
  31558. "zone": c.zone,
  31559. "instance": c.instance,
  31560. })
  31561. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31562. }
  31563. // Do executes the "compute.instances.get" call.
  31564. // Exactly one of *Instance or error will be non-nil. Any non-2xx status
  31565. // code is an error. Response headers are in either
  31566. // *Instance.ServerResponse.Header or (if a response was returned at
  31567. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  31568. // to check whether the returned error was because
  31569. // http.StatusNotModified was returned.
  31570. func (c *InstancesGetCall) Do(opts ...googleapi.CallOption) (*Instance, error) {
  31571. gensupport.SetOptions(c.urlParams_, opts...)
  31572. res, err := c.doRequest("json")
  31573. if res != nil && res.StatusCode == http.StatusNotModified {
  31574. if res.Body != nil {
  31575. res.Body.Close()
  31576. }
  31577. return nil, &googleapi.Error{
  31578. Code: res.StatusCode,
  31579. Header: res.Header,
  31580. }
  31581. }
  31582. if err != nil {
  31583. return nil, err
  31584. }
  31585. defer googleapi.CloseBody(res)
  31586. if err := googleapi.CheckResponse(res); err != nil {
  31587. return nil, err
  31588. }
  31589. ret := &Instance{
  31590. ServerResponse: googleapi.ServerResponse{
  31591. Header: res.Header,
  31592. HTTPStatusCode: res.StatusCode,
  31593. },
  31594. }
  31595. target := &ret
  31596. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  31597. return nil, err
  31598. }
  31599. return ret, nil
  31600. // {
  31601. // "description": "Returns the specified Instance resource. Get a list of available instances by making a list() request.",
  31602. // "httpMethod": "GET",
  31603. // "id": "compute.instances.get",
  31604. // "parameterOrder": [
  31605. // "project",
  31606. // "zone",
  31607. // "instance"
  31608. // ],
  31609. // "parameters": {
  31610. // "instance": {
  31611. // "description": "Name of the instance resource to return.",
  31612. // "location": "path",
  31613. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31614. // "required": true,
  31615. // "type": "string"
  31616. // },
  31617. // "project": {
  31618. // "description": "Project ID for this request.",
  31619. // "location": "path",
  31620. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31621. // "required": true,
  31622. // "type": "string"
  31623. // },
  31624. // "zone": {
  31625. // "description": "The name of the zone for this request.",
  31626. // "location": "path",
  31627. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31628. // "required": true,
  31629. // "type": "string"
  31630. // }
  31631. // },
  31632. // "path": "{project}/zones/{zone}/instances/{instance}",
  31633. // "response": {
  31634. // "$ref": "Instance"
  31635. // },
  31636. // "scopes": [
  31637. // "https://www.googleapis.com/auth/cloud-platform",
  31638. // "https://www.googleapis.com/auth/compute",
  31639. // "https://www.googleapis.com/auth/compute.readonly"
  31640. // ]
  31641. // }
  31642. }
  31643. // method id "compute.instances.getSerialPortOutput":
  31644. type InstancesGetSerialPortOutputCall struct {
  31645. s *Service
  31646. project string
  31647. zone string
  31648. instance string
  31649. urlParams_ gensupport.URLParams
  31650. ifNoneMatch_ string
  31651. ctx_ context.Context
  31652. header_ http.Header
  31653. }
  31654. // GetSerialPortOutput: Returns the specified instance's serial port
  31655. // output.
  31656. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/getSerialPortOutput
  31657. func (r *InstancesService) GetSerialPortOutput(project string, zone string, instance string) *InstancesGetSerialPortOutputCall {
  31658. c := &InstancesGetSerialPortOutputCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31659. c.project = project
  31660. c.zone = zone
  31661. c.instance = instance
  31662. return c
  31663. }
  31664. // Port sets the optional parameter "port": Specifies which COM or
  31665. // serial port to retrieve data from.
  31666. func (c *InstancesGetSerialPortOutputCall) Port(port int64) *InstancesGetSerialPortOutputCall {
  31667. c.urlParams_.Set("port", fmt.Sprint(port))
  31668. return c
  31669. }
  31670. // Start sets the optional parameter "start": Returns output starting
  31671. // from a specific byte position. Use this to page through output when
  31672. // the output is too large to return in a single request. For the
  31673. // initial request, leave this field unspecified. For subsequent calls,
  31674. // this field should be set to the next value returned in the previous
  31675. // call.
  31676. func (c *InstancesGetSerialPortOutputCall) Start(start int64) *InstancesGetSerialPortOutputCall {
  31677. c.urlParams_.Set("start", fmt.Sprint(start))
  31678. return c
  31679. }
  31680. // Fields allows partial responses to be retrieved. See
  31681. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31682. // for more information.
  31683. func (c *InstancesGetSerialPortOutputCall) Fields(s ...googleapi.Field) *InstancesGetSerialPortOutputCall {
  31684. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31685. return c
  31686. }
  31687. // IfNoneMatch sets the optional parameter which makes the operation
  31688. // fail if the object's ETag matches the given value. This is useful for
  31689. // getting updates only after the object has changed since the last
  31690. // request. Use googleapi.IsNotModified to check whether the response
  31691. // error from Do is the result of In-None-Match.
  31692. func (c *InstancesGetSerialPortOutputCall) IfNoneMatch(entityTag string) *InstancesGetSerialPortOutputCall {
  31693. c.ifNoneMatch_ = entityTag
  31694. return c
  31695. }
  31696. // Context sets the context to be used in this call's Do method. Any
  31697. // pending HTTP request will be aborted if the provided context is
  31698. // canceled.
  31699. func (c *InstancesGetSerialPortOutputCall) Context(ctx context.Context) *InstancesGetSerialPortOutputCall {
  31700. c.ctx_ = ctx
  31701. return c
  31702. }
  31703. // Header returns an http.Header that can be modified by the caller to
  31704. // add HTTP headers to the request.
  31705. func (c *InstancesGetSerialPortOutputCall) Header() http.Header {
  31706. if c.header_ == nil {
  31707. c.header_ = make(http.Header)
  31708. }
  31709. return c.header_
  31710. }
  31711. func (c *InstancesGetSerialPortOutputCall) doRequest(alt string) (*http.Response, error) {
  31712. reqHeaders := make(http.Header)
  31713. for k, v := range c.header_ {
  31714. reqHeaders[k] = v
  31715. }
  31716. reqHeaders.Set("User-Agent", c.s.userAgent())
  31717. if c.ifNoneMatch_ != "" {
  31718. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31719. }
  31720. var body io.Reader = nil
  31721. c.urlParams_.Set("alt", alt)
  31722. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/serialPort")
  31723. urls += "?" + c.urlParams_.Encode()
  31724. req, _ := http.NewRequest("GET", urls, body)
  31725. req.Header = reqHeaders
  31726. googleapi.Expand(req.URL, map[string]string{
  31727. "project": c.project,
  31728. "zone": c.zone,
  31729. "instance": c.instance,
  31730. })
  31731. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31732. }
  31733. // Do executes the "compute.instances.getSerialPortOutput" call.
  31734. // Exactly one of *SerialPortOutput or error will be non-nil. Any
  31735. // non-2xx status code is an error. Response headers are in either
  31736. // *SerialPortOutput.ServerResponse.Header or (if a response was
  31737. // returned at all) in error.(*googleapi.Error).Header. Use
  31738. // googleapi.IsNotModified to check whether the returned error was
  31739. // because http.StatusNotModified was returned.
  31740. func (c *InstancesGetSerialPortOutputCall) Do(opts ...googleapi.CallOption) (*SerialPortOutput, error) {
  31741. gensupport.SetOptions(c.urlParams_, opts...)
  31742. res, err := c.doRequest("json")
  31743. if res != nil && res.StatusCode == http.StatusNotModified {
  31744. if res.Body != nil {
  31745. res.Body.Close()
  31746. }
  31747. return nil, &googleapi.Error{
  31748. Code: res.StatusCode,
  31749. Header: res.Header,
  31750. }
  31751. }
  31752. if err != nil {
  31753. return nil, err
  31754. }
  31755. defer googleapi.CloseBody(res)
  31756. if err := googleapi.CheckResponse(res); err != nil {
  31757. return nil, err
  31758. }
  31759. ret := &SerialPortOutput{
  31760. ServerResponse: googleapi.ServerResponse{
  31761. Header: res.Header,
  31762. HTTPStatusCode: res.StatusCode,
  31763. },
  31764. }
  31765. target := &ret
  31766. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  31767. return nil, err
  31768. }
  31769. return ret, nil
  31770. // {
  31771. // "description": "Returns the specified instance's serial port output.",
  31772. // "httpMethod": "GET",
  31773. // "id": "compute.instances.getSerialPortOutput",
  31774. // "parameterOrder": [
  31775. // "project",
  31776. // "zone",
  31777. // "instance"
  31778. // ],
  31779. // "parameters": {
  31780. // "instance": {
  31781. // "description": "Name of the instance scoping this request.",
  31782. // "location": "path",
  31783. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31784. // "required": true,
  31785. // "type": "string"
  31786. // },
  31787. // "port": {
  31788. // "default": "1",
  31789. // "description": "Specifies which COM or serial port to retrieve data from.",
  31790. // "format": "int32",
  31791. // "location": "query",
  31792. // "maximum": "4",
  31793. // "minimum": "1",
  31794. // "type": "integer"
  31795. // },
  31796. // "project": {
  31797. // "description": "Project ID for this request.",
  31798. // "location": "path",
  31799. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31800. // "required": true,
  31801. // "type": "string"
  31802. // },
  31803. // "start": {
  31804. // "description": "Returns output starting from a specific byte position. Use this to page through output when the output is too large to return in a single request. For the initial request, leave this field unspecified. For subsequent calls, this field should be set to the next value returned in the previous call.",
  31805. // "format": "int64",
  31806. // "location": "query",
  31807. // "type": "string"
  31808. // },
  31809. // "zone": {
  31810. // "description": "The name of the zone for this request.",
  31811. // "location": "path",
  31812. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31813. // "required": true,
  31814. // "type": "string"
  31815. // }
  31816. // },
  31817. // "path": "{project}/zones/{zone}/instances/{instance}/serialPort",
  31818. // "response": {
  31819. // "$ref": "SerialPortOutput"
  31820. // },
  31821. // "scopes": [
  31822. // "https://www.googleapis.com/auth/cloud-platform",
  31823. // "https://www.googleapis.com/auth/compute",
  31824. // "https://www.googleapis.com/auth/compute.readonly"
  31825. // ]
  31826. // }
  31827. }
  31828. // method id "compute.instances.insert":
  31829. type InstancesInsertCall struct {
  31830. s *Service
  31831. project string
  31832. zone string
  31833. instance *Instance
  31834. urlParams_ gensupport.URLParams
  31835. ctx_ context.Context
  31836. header_ http.Header
  31837. }
  31838. // Insert: Creates an instance resource in the specified project using
  31839. // the data included in the request.
  31840. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/insert
  31841. func (r *InstancesService) Insert(project string, zone string, instance *Instance) *InstancesInsertCall {
  31842. c := &InstancesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31843. c.project = project
  31844. c.zone = zone
  31845. c.instance = instance
  31846. return c
  31847. }
  31848. // Fields allows partial responses to be retrieved. See
  31849. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31850. // for more information.
  31851. func (c *InstancesInsertCall) Fields(s ...googleapi.Field) *InstancesInsertCall {
  31852. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31853. return c
  31854. }
  31855. // Context sets the context to be used in this call's Do method. Any
  31856. // pending HTTP request will be aborted if the provided context is
  31857. // canceled.
  31858. func (c *InstancesInsertCall) Context(ctx context.Context) *InstancesInsertCall {
  31859. c.ctx_ = ctx
  31860. return c
  31861. }
  31862. // Header returns an http.Header that can be modified by the caller to
  31863. // add HTTP headers to the request.
  31864. func (c *InstancesInsertCall) Header() http.Header {
  31865. if c.header_ == nil {
  31866. c.header_ = make(http.Header)
  31867. }
  31868. return c.header_
  31869. }
  31870. func (c *InstancesInsertCall) doRequest(alt string) (*http.Response, error) {
  31871. reqHeaders := make(http.Header)
  31872. for k, v := range c.header_ {
  31873. reqHeaders[k] = v
  31874. }
  31875. reqHeaders.Set("User-Agent", c.s.userAgent())
  31876. var body io.Reader = nil
  31877. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance)
  31878. if err != nil {
  31879. return nil, err
  31880. }
  31881. reqHeaders.Set("Content-Type", "application/json")
  31882. c.urlParams_.Set("alt", alt)
  31883. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances")
  31884. urls += "?" + c.urlParams_.Encode()
  31885. req, _ := http.NewRequest("POST", urls, body)
  31886. req.Header = reqHeaders
  31887. googleapi.Expand(req.URL, map[string]string{
  31888. "project": c.project,
  31889. "zone": c.zone,
  31890. })
  31891. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31892. }
  31893. // Do executes the "compute.instances.insert" call.
  31894. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  31895. // status code is an error. Response headers are in either
  31896. // *Operation.ServerResponse.Header or (if a response was returned at
  31897. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  31898. // to check whether the returned error was because
  31899. // http.StatusNotModified was returned.
  31900. func (c *InstancesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  31901. gensupport.SetOptions(c.urlParams_, opts...)
  31902. res, err := c.doRequest("json")
  31903. if res != nil && res.StatusCode == http.StatusNotModified {
  31904. if res.Body != nil {
  31905. res.Body.Close()
  31906. }
  31907. return nil, &googleapi.Error{
  31908. Code: res.StatusCode,
  31909. Header: res.Header,
  31910. }
  31911. }
  31912. if err != nil {
  31913. return nil, err
  31914. }
  31915. defer googleapi.CloseBody(res)
  31916. if err := googleapi.CheckResponse(res); err != nil {
  31917. return nil, err
  31918. }
  31919. ret := &Operation{
  31920. ServerResponse: googleapi.ServerResponse{
  31921. Header: res.Header,
  31922. HTTPStatusCode: res.StatusCode,
  31923. },
  31924. }
  31925. target := &ret
  31926. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  31927. return nil, err
  31928. }
  31929. return ret, nil
  31930. // {
  31931. // "description": "Creates an instance resource in the specified project using the data included in the request.",
  31932. // "httpMethod": "POST",
  31933. // "id": "compute.instances.insert",
  31934. // "parameterOrder": [
  31935. // "project",
  31936. // "zone"
  31937. // ],
  31938. // "parameters": {
  31939. // "project": {
  31940. // "description": "Project ID for this request.",
  31941. // "location": "path",
  31942. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31943. // "required": true,
  31944. // "type": "string"
  31945. // },
  31946. // "zone": {
  31947. // "description": "The name of the zone for this request.",
  31948. // "location": "path",
  31949. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31950. // "required": true,
  31951. // "type": "string"
  31952. // }
  31953. // },
  31954. // "path": "{project}/zones/{zone}/instances",
  31955. // "request": {
  31956. // "$ref": "Instance"
  31957. // },
  31958. // "response": {
  31959. // "$ref": "Operation"
  31960. // },
  31961. // "scopes": [
  31962. // "https://www.googleapis.com/auth/cloud-platform",
  31963. // "https://www.googleapis.com/auth/compute"
  31964. // ]
  31965. // }
  31966. }
  31967. // method id "compute.instances.list":
  31968. type InstancesListCall struct {
  31969. s *Service
  31970. project string
  31971. zone string
  31972. urlParams_ gensupport.URLParams
  31973. ifNoneMatch_ string
  31974. ctx_ context.Context
  31975. header_ http.Header
  31976. }
  31977. // List: Retrieves the list of instances contained within the specified
  31978. // zone.
  31979. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/list
  31980. func (r *InstancesService) List(project string, zone string) *InstancesListCall {
  31981. c := &InstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31982. c.project = project
  31983. c.zone = zone
  31984. return c
  31985. }
  31986. // Filter sets the optional parameter "filter": Sets a filter
  31987. // {expression} for filtering listed resources. Your {expression} must
  31988. // be in the format: field_name comparison_string literal_string.
  31989. //
  31990. // The field_name is the name of the field you want to compare. Only
  31991. // atomic field types are supported (string, number, boolean). The
  31992. // comparison_string must be either eq (equals) or ne (not equals). The
  31993. // literal_string is the string value to filter to. The literal value
  31994. // must be valid for the type of field you are filtering by (string,
  31995. // number, boolean). For string fields, the literal value is interpreted
  31996. // as a regular expression using RE2 syntax. The literal value must
  31997. // match the entire field.
  31998. //
  31999. // For example, to filter for instances that do not have a name of
  32000. // example-instance, you would use name ne example-instance.
  32001. //
  32002. // You can filter on nested fields. For example, you could filter on
  32003. // instances that have set the scheduling.automaticRestart field to
  32004. // true. Use filtering on nested fields to take advantage of labels to
  32005. // organize and search for results based on label values.
  32006. //
  32007. // To filter on multiple expressions, provide each separate expression
  32008. // within parentheses. For example, (scheduling.automaticRestart eq
  32009. // true) (zone eq us-central1-f). Multiple expressions are treated as
  32010. // AND expressions, meaning that resources must match all expressions to
  32011. // pass the filters.
  32012. func (c *InstancesListCall) Filter(filter string) *InstancesListCall {
  32013. c.urlParams_.Set("filter", filter)
  32014. return c
  32015. }
  32016. // MaxResults sets the optional parameter "maxResults": The maximum
  32017. // number of results per page that should be returned. If the number of
  32018. // available results is larger than maxResults, Compute Engine returns a
  32019. // nextPageToken that can be used to get the next page of results in
  32020. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  32021. // (Default: 500)
  32022. func (c *InstancesListCall) MaxResults(maxResults int64) *InstancesListCall {
  32023. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  32024. return c
  32025. }
  32026. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  32027. // a certain order. By default, results are returned in alphanumerical
  32028. // order based on the resource name.
  32029. //
  32030. // You can also sort results in descending order based on the creation
  32031. // timestamp using orderBy="creationTimestamp desc". This sorts results
  32032. // based on the creationTimestamp field in reverse chronological order
  32033. // (newest result first). Use this to sort resources like operations so
  32034. // that the newest operation is returned first.
  32035. //
  32036. // Currently, only sorting by name or creationTimestamp desc is
  32037. // supported.
  32038. func (c *InstancesListCall) OrderBy(orderBy string) *InstancesListCall {
  32039. c.urlParams_.Set("orderBy", orderBy)
  32040. return c
  32041. }
  32042. // PageToken sets the optional parameter "pageToken": Specifies a page
  32043. // token to use. Set pageToken to the nextPageToken returned by a
  32044. // previous list request to get the next page of results.
  32045. func (c *InstancesListCall) PageToken(pageToken string) *InstancesListCall {
  32046. c.urlParams_.Set("pageToken", pageToken)
  32047. return c
  32048. }
  32049. // Fields allows partial responses to be retrieved. See
  32050. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32051. // for more information.
  32052. func (c *InstancesListCall) Fields(s ...googleapi.Field) *InstancesListCall {
  32053. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32054. return c
  32055. }
  32056. // IfNoneMatch sets the optional parameter which makes the operation
  32057. // fail if the object's ETag matches the given value. This is useful for
  32058. // getting updates only after the object has changed since the last
  32059. // request. Use googleapi.IsNotModified to check whether the response
  32060. // error from Do is the result of In-None-Match.
  32061. func (c *InstancesListCall) IfNoneMatch(entityTag string) *InstancesListCall {
  32062. c.ifNoneMatch_ = entityTag
  32063. return c
  32064. }
  32065. // Context sets the context to be used in this call's Do method. Any
  32066. // pending HTTP request will be aborted if the provided context is
  32067. // canceled.
  32068. func (c *InstancesListCall) Context(ctx context.Context) *InstancesListCall {
  32069. c.ctx_ = ctx
  32070. return c
  32071. }
  32072. // Header returns an http.Header that can be modified by the caller to
  32073. // add HTTP headers to the request.
  32074. func (c *InstancesListCall) Header() http.Header {
  32075. if c.header_ == nil {
  32076. c.header_ = make(http.Header)
  32077. }
  32078. return c.header_
  32079. }
  32080. func (c *InstancesListCall) doRequest(alt string) (*http.Response, error) {
  32081. reqHeaders := make(http.Header)
  32082. for k, v := range c.header_ {
  32083. reqHeaders[k] = v
  32084. }
  32085. reqHeaders.Set("User-Agent", c.s.userAgent())
  32086. if c.ifNoneMatch_ != "" {
  32087. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32088. }
  32089. var body io.Reader = nil
  32090. c.urlParams_.Set("alt", alt)
  32091. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances")
  32092. urls += "?" + c.urlParams_.Encode()
  32093. req, _ := http.NewRequest("GET", urls, body)
  32094. req.Header = reqHeaders
  32095. googleapi.Expand(req.URL, map[string]string{
  32096. "project": c.project,
  32097. "zone": c.zone,
  32098. })
  32099. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32100. }
  32101. // Do executes the "compute.instances.list" call.
  32102. // Exactly one of *InstanceList or error will be non-nil. Any non-2xx
  32103. // status code is an error. Response headers are in either
  32104. // *InstanceList.ServerResponse.Header or (if a response was returned at
  32105. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  32106. // to check whether the returned error was because
  32107. // http.StatusNotModified was returned.
  32108. func (c *InstancesListCall) Do(opts ...googleapi.CallOption) (*InstanceList, error) {
  32109. gensupport.SetOptions(c.urlParams_, opts...)
  32110. res, err := c.doRequest("json")
  32111. if res != nil && res.StatusCode == http.StatusNotModified {
  32112. if res.Body != nil {
  32113. res.Body.Close()
  32114. }
  32115. return nil, &googleapi.Error{
  32116. Code: res.StatusCode,
  32117. Header: res.Header,
  32118. }
  32119. }
  32120. if err != nil {
  32121. return nil, err
  32122. }
  32123. defer googleapi.CloseBody(res)
  32124. if err := googleapi.CheckResponse(res); err != nil {
  32125. return nil, err
  32126. }
  32127. ret := &InstanceList{
  32128. ServerResponse: googleapi.ServerResponse{
  32129. Header: res.Header,
  32130. HTTPStatusCode: res.StatusCode,
  32131. },
  32132. }
  32133. target := &ret
  32134. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  32135. return nil, err
  32136. }
  32137. return ret, nil
  32138. // {
  32139. // "description": "Retrieves the list of instances contained within the specified zone.",
  32140. // "httpMethod": "GET",
  32141. // "id": "compute.instances.list",
  32142. // "parameterOrder": [
  32143. // "project",
  32144. // "zone"
  32145. // ],
  32146. // "parameters": {
  32147. // "filter": {
  32148. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  32149. // "location": "query",
  32150. // "type": "string"
  32151. // },
  32152. // "maxResults": {
  32153. // "default": "500",
  32154. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  32155. // "format": "uint32",
  32156. // "location": "query",
  32157. // "minimum": "0",
  32158. // "type": "integer"
  32159. // },
  32160. // "orderBy": {
  32161. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  32162. // "location": "query",
  32163. // "type": "string"
  32164. // },
  32165. // "pageToken": {
  32166. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  32167. // "location": "query",
  32168. // "type": "string"
  32169. // },
  32170. // "project": {
  32171. // "description": "Project ID for this request.",
  32172. // "location": "path",
  32173. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32174. // "required": true,
  32175. // "type": "string"
  32176. // },
  32177. // "zone": {
  32178. // "description": "The name of the zone for this request.",
  32179. // "location": "path",
  32180. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32181. // "required": true,
  32182. // "type": "string"
  32183. // }
  32184. // },
  32185. // "path": "{project}/zones/{zone}/instances",
  32186. // "response": {
  32187. // "$ref": "InstanceList"
  32188. // },
  32189. // "scopes": [
  32190. // "https://www.googleapis.com/auth/cloud-platform",
  32191. // "https://www.googleapis.com/auth/compute",
  32192. // "https://www.googleapis.com/auth/compute.readonly"
  32193. // ]
  32194. // }
  32195. }
  32196. // Pages invokes f for each page of results.
  32197. // A non-nil error returned from f will halt the iteration.
  32198. // The provided context supersedes any context provided to the Context method.
  32199. func (c *InstancesListCall) Pages(ctx context.Context, f func(*InstanceList) error) error {
  32200. c.ctx_ = ctx
  32201. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  32202. for {
  32203. x, err := c.Do()
  32204. if err != nil {
  32205. return err
  32206. }
  32207. if err := f(x); err != nil {
  32208. return err
  32209. }
  32210. if x.NextPageToken == "" {
  32211. return nil
  32212. }
  32213. c.PageToken(x.NextPageToken)
  32214. }
  32215. }
  32216. // method id "compute.instances.reset":
  32217. type InstancesResetCall struct {
  32218. s *Service
  32219. project string
  32220. zone string
  32221. instance string
  32222. urlParams_ gensupport.URLParams
  32223. ctx_ context.Context
  32224. header_ http.Header
  32225. }
  32226. // Reset: Performs a reset on the instance. For more information, see
  32227. // Resetting an instance.
  32228. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/reset
  32229. func (r *InstancesService) Reset(project string, zone string, instance string) *InstancesResetCall {
  32230. c := &InstancesResetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32231. c.project = project
  32232. c.zone = zone
  32233. c.instance = instance
  32234. return c
  32235. }
  32236. // Fields allows partial responses to be retrieved. See
  32237. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32238. // for more information.
  32239. func (c *InstancesResetCall) Fields(s ...googleapi.Field) *InstancesResetCall {
  32240. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32241. return c
  32242. }
  32243. // Context sets the context to be used in this call's Do method. Any
  32244. // pending HTTP request will be aborted if the provided context is
  32245. // canceled.
  32246. func (c *InstancesResetCall) Context(ctx context.Context) *InstancesResetCall {
  32247. c.ctx_ = ctx
  32248. return c
  32249. }
  32250. // Header returns an http.Header that can be modified by the caller to
  32251. // add HTTP headers to the request.
  32252. func (c *InstancesResetCall) Header() http.Header {
  32253. if c.header_ == nil {
  32254. c.header_ = make(http.Header)
  32255. }
  32256. return c.header_
  32257. }
  32258. func (c *InstancesResetCall) doRequest(alt string) (*http.Response, error) {
  32259. reqHeaders := make(http.Header)
  32260. for k, v := range c.header_ {
  32261. reqHeaders[k] = v
  32262. }
  32263. reqHeaders.Set("User-Agent", c.s.userAgent())
  32264. var body io.Reader = nil
  32265. c.urlParams_.Set("alt", alt)
  32266. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/reset")
  32267. urls += "?" + c.urlParams_.Encode()
  32268. req, _ := http.NewRequest("POST", urls, body)
  32269. req.Header = reqHeaders
  32270. googleapi.Expand(req.URL, map[string]string{
  32271. "project": c.project,
  32272. "zone": c.zone,
  32273. "instance": c.instance,
  32274. })
  32275. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32276. }
  32277. // Do executes the "compute.instances.reset" call.
  32278. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  32279. // status code is an error. Response headers are in either
  32280. // *Operation.ServerResponse.Header or (if a response was returned at
  32281. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  32282. // to check whether the returned error was because
  32283. // http.StatusNotModified was returned.
  32284. func (c *InstancesResetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  32285. gensupport.SetOptions(c.urlParams_, opts...)
  32286. res, err := c.doRequest("json")
  32287. if res != nil && res.StatusCode == http.StatusNotModified {
  32288. if res.Body != nil {
  32289. res.Body.Close()
  32290. }
  32291. return nil, &googleapi.Error{
  32292. Code: res.StatusCode,
  32293. Header: res.Header,
  32294. }
  32295. }
  32296. if err != nil {
  32297. return nil, err
  32298. }
  32299. defer googleapi.CloseBody(res)
  32300. if err := googleapi.CheckResponse(res); err != nil {
  32301. return nil, err
  32302. }
  32303. ret := &Operation{
  32304. ServerResponse: googleapi.ServerResponse{
  32305. Header: res.Header,
  32306. HTTPStatusCode: res.StatusCode,
  32307. },
  32308. }
  32309. target := &ret
  32310. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  32311. return nil, err
  32312. }
  32313. return ret, nil
  32314. // {
  32315. // "description": "Performs a reset on the instance. For more information, see Resetting an instance.",
  32316. // "httpMethod": "POST",
  32317. // "id": "compute.instances.reset",
  32318. // "parameterOrder": [
  32319. // "project",
  32320. // "zone",
  32321. // "instance"
  32322. // ],
  32323. // "parameters": {
  32324. // "instance": {
  32325. // "description": "Name of the instance scoping this request.",
  32326. // "location": "path",
  32327. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32328. // "required": true,
  32329. // "type": "string"
  32330. // },
  32331. // "project": {
  32332. // "description": "Project ID for this request.",
  32333. // "location": "path",
  32334. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32335. // "required": true,
  32336. // "type": "string"
  32337. // },
  32338. // "zone": {
  32339. // "description": "The name of the zone for this request.",
  32340. // "location": "path",
  32341. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32342. // "required": true,
  32343. // "type": "string"
  32344. // }
  32345. // },
  32346. // "path": "{project}/zones/{zone}/instances/{instance}/reset",
  32347. // "response": {
  32348. // "$ref": "Operation"
  32349. // },
  32350. // "scopes": [
  32351. // "https://www.googleapis.com/auth/cloud-platform",
  32352. // "https://www.googleapis.com/auth/compute"
  32353. // ]
  32354. // }
  32355. }
  32356. // method id "compute.instances.setDiskAutoDelete":
  32357. type InstancesSetDiskAutoDeleteCall struct {
  32358. s *Service
  32359. project string
  32360. zone string
  32361. instance string
  32362. urlParams_ gensupport.URLParams
  32363. ctx_ context.Context
  32364. header_ http.Header
  32365. }
  32366. // SetDiskAutoDelete: Sets the auto-delete flag for a disk attached to
  32367. // an instance.
  32368. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setDiskAutoDelete
  32369. func (r *InstancesService) SetDiskAutoDelete(project string, zone string, instance string, autoDelete bool, deviceName string) *InstancesSetDiskAutoDeleteCall {
  32370. c := &InstancesSetDiskAutoDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32371. c.project = project
  32372. c.zone = zone
  32373. c.instance = instance
  32374. c.urlParams_.Set("autoDelete", fmt.Sprint(autoDelete))
  32375. c.urlParams_.Set("deviceName", deviceName)
  32376. return c
  32377. }
  32378. // Fields allows partial responses to be retrieved. See
  32379. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32380. // for more information.
  32381. func (c *InstancesSetDiskAutoDeleteCall) Fields(s ...googleapi.Field) *InstancesSetDiskAutoDeleteCall {
  32382. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32383. return c
  32384. }
  32385. // Context sets the context to be used in this call's Do method. Any
  32386. // pending HTTP request will be aborted if the provided context is
  32387. // canceled.
  32388. func (c *InstancesSetDiskAutoDeleteCall) Context(ctx context.Context) *InstancesSetDiskAutoDeleteCall {
  32389. c.ctx_ = ctx
  32390. return c
  32391. }
  32392. // Header returns an http.Header that can be modified by the caller to
  32393. // add HTTP headers to the request.
  32394. func (c *InstancesSetDiskAutoDeleteCall) Header() http.Header {
  32395. if c.header_ == nil {
  32396. c.header_ = make(http.Header)
  32397. }
  32398. return c.header_
  32399. }
  32400. func (c *InstancesSetDiskAutoDeleteCall) doRequest(alt string) (*http.Response, error) {
  32401. reqHeaders := make(http.Header)
  32402. for k, v := range c.header_ {
  32403. reqHeaders[k] = v
  32404. }
  32405. reqHeaders.Set("User-Agent", c.s.userAgent())
  32406. var body io.Reader = nil
  32407. c.urlParams_.Set("alt", alt)
  32408. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete")
  32409. urls += "?" + c.urlParams_.Encode()
  32410. req, _ := http.NewRequest("POST", urls, body)
  32411. req.Header = reqHeaders
  32412. googleapi.Expand(req.URL, map[string]string{
  32413. "project": c.project,
  32414. "zone": c.zone,
  32415. "instance": c.instance,
  32416. })
  32417. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32418. }
  32419. // Do executes the "compute.instances.setDiskAutoDelete" call.
  32420. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  32421. // status code is an error. Response headers are in either
  32422. // *Operation.ServerResponse.Header or (if a response was returned at
  32423. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  32424. // to check whether the returned error was because
  32425. // http.StatusNotModified was returned.
  32426. func (c *InstancesSetDiskAutoDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  32427. gensupport.SetOptions(c.urlParams_, opts...)
  32428. res, err := c.doRequest("json")
  32429. if res != nil && res.StatusCode == http.StatusNotModified {
  32430. if res.Body != nil {
  32431. res.Body.Close()
  32432. }
  32433. return nil, &googleapi.Error{
  32434. Code: res.StatusCode,
  32435. Header: res.Header,
  32436. }
  32437. }
  32438. if err != nil {
  32439. return nil, err
  32440. }
  32441. defer googleapi.CloseBody(res)
  32442. if err := googleapi.CheckResponse(res); err != nil {
  32443. return nil, err
  32444. }
  32445. ret := &Operation{
  32446. ServerResponse: googleapi.ServerResponse{
  32447. Header: res.Header,
  32448. HTTPStatusCode: res.StatusCode,
  32449. },
  32450. }
  32451. target := &ret
  32452. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  32453. return nil, err
  32454. }
  32455. return ret, nil
  32456. // {
  32457. // "description": "Sets the auto-delete flag for a disk attached to an instance.",
  32458. // "httpMethod": "POST",
  32459. // "id": "compute.instances.setDiskAutoDelete",
  32460. // "parameterOrder": [
  32461. // "project",
  32462. // "zone",
  32463. // "instance",
  32464. // "autoDelete",
  32465. // "deviceName"
  32466. // ],
  32467. // "parameters": {
  32468. // "autoDelete": {
  32469. // "description": "Whether to auto-delete the disk when the instance is deleted.",
  32470. // "location": "query",
  32471. // "required": true,
  32472. // "type": "boolean"
  32473. // },
  32474. // "deviceName": {
  32475. // "description": "The device name of the disk to modify.",
  32476. // "location": "query",
  32477. // "pattern": "\\w[\\w.-]{0,254}",
  32478. // "required": true,
  32479. // "type": "string"
  32480. // },
  32481. // "instance": {
  32482. // "description": "The instance name.",
  32483. // "location": "path",
  32484. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32485. // "required": true,
  32486. // "type": "string"
  32487. // },
  32488. // "project": {
  32489. // "description": "Project ID for this request.",
  32490. // "location": "path",
  32491. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32492. // "required": true,
  32493. // "type": "string"
  32494. // },
  32495. // "zone": {
  32496. // "description": "The name of the zone for this request.",
  32497. // "location": "path",
  32498. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32499. // "required": true,
  32500. // "type": "string"
  32501. // }
  32502. // },
  32503. // "path": "{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete",
  32504. // "response": {
  32505. // "$ref": "Operation"
  32506. // },
  32507. // "scopes": [
  32508. // "https://www.googleapis.com/auth/cloud-platform",
  32509. // "https://www.googleapis.com/auth/compute"
  32510. // ]
  32511. // }
  32512. }
  32513. // method id "compute.instances.setLabels":
  32514. type InstancesSetLabelsCall struct {
  32515. s *Service
  32516. project string
  32517. zone string
  32518. instance string
  32519. instancessetlabelsrequest *InstancesSetLabelsRequest
  32520. urlParams_ gensupport.URLParams
  32521. ctx_ context.Context
  32522. header_ http.Header
  32523. }
  32524. // SetLabels: Sets labels on an instance. To learn more about labels,
  32525. // read the Labeling Resources documentation.
  32526. func (r *InstancesService) SetLabels(project string, zone string, instance string, instancessetlabelsrequest *InstancesSetLabelsRequest) *InstancesSetLabelsCall {
  32527. c := &InstancesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32528. c.project = project
  32529. c.zone = zone
  32530. c.instance = instance
  32531. c.instancessetlabelsrequest = instancessetlabelsrequest
  32532. return c
  32533. }
  32534. // Fields allows partial responses to be retrieved. See
  32535. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32536. // for more information.
  32537. func (c *InstancesSetLabelsCall) Fields(s ...googleapi.Field) *InstancesSetLabelsCall {
  32538. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32539. return c
  32540. }
  32541. // Context sets the context to be used in this call's Do method. Any
  32542. // pending HTTP request will be aborted if the provided context is
  32543. // canceled.
  32544. func (c *InstancesSetLabelsCall) Context(ctx context.Context) *InstancesSetLabelsCall {
  32545. c.ctx_ = ctx
  32546. return c
  32547. }
  32548. // Header returns an http.Header that can be modified by the caller to
  32549. // add HTTP headers to the request.
  32550. func (c *InstancesSetLabelsCall) Header() http.Header {
  32551. if c.header_ == nil {
  32552. c.header_ = make(http.Header)
  32553. }
  32554. return c.header_
  32555. }
  32556. func (c *InstancesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  32557. reqHeaders := make(http.Header)
  32558. for k, v := range c.header_ {
  32559. reqHeaders[k] = v
  32560. }
  32561. reqHeaders.Set("User-Agent", c.s.userAgent())
  32562. var body io.Reader = nil
  32563. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetlabelsrequest)
  32564. if err != nil {
  32565. return nil, err
  32566. }
  32567. reqHeaders.Set("Content-Type", "application/json")
  32568. c.urlParams_.Set("alt", alt)
  32569. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setLabels")
  32570. urls += "?" + c.urlParams_.Encode()
  32571. req, _ := http.NewRequest("POST", urls, body)
  32572. req.Header = reqHeaders
  32573. googleapi.Expand(req.URL, map[string]string{
  32574. "project": c.project,
  32575. "zone": c.zone,
  32576. "instance": c.instance,
  32577. })
  32578. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32579. }
  32580. // Do executes the "compute.instances.setLabels" call.
  32581. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  32582. // status code is an error. Response headers are in either
  32583. // *Operation.ServerResponse.Header or (if a response was returned at
  32584. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  32585. // to check whether the returned error was because
  32586. // http.StatusNotModified was returned.
  32587. func (c *InstancesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  32588. gensupport.SetOptions(c.urlParams_, opts...)
  32589. res, err := c.doRequest("json")
  32590. if res != nil && res.StatusCode == http.StatusNotModified {
  32591. if res.Body != nil {
  32592. res.Body.Close()
  32593. }
  32594. return nil, &googleapi.Error{
  32595. Code: res.StatusCode,
  32596. Header: res.Header,
  32597. }
  32598. }
  32599. if err != nil {
  32600. return nil, err
  32601. }
  32602. defer googleapi.CloseBody(res)
  32603. if err := googleapi.CheckResponse(res); err != nil {
  32604. return nil, err
  32605. }
  32606. ret := &Operation{
  32607. ServerResponse: googleapi.ServerResponse{
  32608. Header: res.Header,
  32609. HTTPStatusCode: res.StatusCode,
  32610. },
  32611. }
  32612. target := &ret
  32613. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  32614. return nil, err
  32615. }
  32616. return ret, nil
  32617. // {
  32618. // "description": "Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation.",
  32619. // "httpMethod": "POST",
  32620. // "id": "compute.instances.setLabels",
  32621. // "parameterOrder": [
  32622. // "project",
  32623. // "zone",
  32624. // "instance"
  32625. // ],
  32626. // "parameters": {
  32627. // "instance": {
  32628. // "description": "Name of the instance scoping this request.",
  32629. // "location": "path",
  32630. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32631. // "required": true,
  32632. // "type": "string"
  32633. // },
  32634. // "project": {
  32635. // "description": "Project ID for this request.",
  32636. // "location": "path",
  32637. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32638. // "required": true,
  32639. // "type": "string"
  32640. // },
  32641. // "zone": {
  32642. // "description": "The name of the zone for this request.",
  32643. // "location": "path",
  32644. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32645. // "required": true,
  32646. // "type": "string"
  32647. // }
  32648. // },
  32649. // "path": "{project}/zones/{zone}/instances/{instance}/setLabels",
  32650. // "request": {
  32651. // "$ref": "InstancesSetLabelsRequest"
  32652. // },
  32653. // "response": {
  32654. // "$ref": "Operation"
  32655. // },
  32656. // "scopes": [
  32657. // "https://www.googleapis.com/auth/cloud-platform",
  32658. // "https://www.googleapis.com/auth/compute"
  32659. // ]
  32660. // }
  32661. }
  32662. // method id "compute.instances.setMachineType":
  32663. type InstancesSetMachineTypeCall struct {
  32664. s *Service
  32665. project string
  32666. zone string
  32667. instance string
  32668. instancessetmachinetyperequest *InstancesSetMachineTypeRequest
  32669. urlParams_ gensupport.URLParams
  32670. ctx_ context.Context
  32671. header_ http.Header
  32672. }
  32673. // SetMachineType: Changes the machine type for a stopped instance to
  32674. // the machine type specified in the request.
  32675. func (r *InstancesService) SetMachineType(project string, zone string, instance string, instancessetmachinetyperequest *InstancesSetMachineTypeRequest) *InstancesSetMachineTypeCall {
  32676. c := &InstancesSetMachineTypeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32677. c.project = project
  32678. c.zone = zone
  32679. c.instance = instance
  32680. c.instancessetmachinetyperequest = instancessetmachinetyperequest
  32681. return c
  32682. }
  32683. // Fields allows partial responses to be retrieved. See
  32684. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32685. // for more information.
  32686. func (c *InstancesSetMachineTypeCall) Fields(s ...googleapi.Field) *InstancesSetMachineTypeCall {
  32687. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32688. return c
  32689. }
  32690. // Context sets the context to be used in this call's Do method. Any
  32691. // pending HTTP request will be aborted if the provided context is
  32692. // canceled.
  32693. func (c *InstancesSetMachineTypeCall) Context(ctx context.Context) *InstancesSetMachineTypeCall {
  32694. c.ctx_ = ctx
  32695. return c
  32696. }
  32697. // Header returns an http.Header that can be modified by the caller to
  32698. // add HTTP headers to the request.
  32699. func (c *InstancesSetMachineTypeCall) Header() http.Header {
  32700. if c.header_ == nil {
  32701. c.header_ = make(http.Header)
  32702. }
  32703. return c.header_
  32704. }
  32705. func (c *InstancesSetMachineTypeCall) doRequest(alt string) (*http.Response, error) {
  32706. reqHeaders := make(http.Header)
  32707. for k, v := range c.header_ {
  32708. reqHeaders[k] = v
  32709. }
  32710. reqHeaders.Set("User-Agent", c.s.userAgent())
  32711. var body io.Reader = nil
  32712. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmachinetyperequest)
  32713. if err != nil {
  32714. return nil, err
  32715. }
  32716. reqHeaders.Set("Content-Type", "application/json")
  32717. c.urlParams_.Set("alt", alt)
  32718. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMachineType")
  32719. urls += "?" + c.urlParams_.Encode()
  32720. req, _ := http.NewRequest("POST", urls, body)
  32721. req.Header = reqHeaders
  32722. googleapi.Expand(req.URL, map[string]string{
  32723. "project": c.project,
  32724. "zone": c.zone,
  32725. "instance": c.instance,
  32726. })
  32727. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32728. }
  32729. // Do executes the "compute.instances.setMachineType" call.
  32730. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  32731. // status code is an error. Response headers are in either
  32732. // *Operation.ServerResponse.Header or (if a response was returned at
  32733. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  32734. // to check whether the returned error was because
  32735. // http.StatusNotModified was returned.
  32736. func (c *InstancesSetMachineTypeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  32737. gensupport.SetOptions(c.urlParams_, opts...)
  32738. res, err := c.doRequest("json")
  32739. if res != nil && res.StatusCode == http.StatusNotModified {
  32740. if res.Body != nil {
  32741. res.Body.Close()
  32742. }
  32743. return nil, &googleapi.Error{
  32744. Code: res.StatusCode,
  32745. Header: res.Header,
  32746. }
  32747. }
  32748. if err != nil {
  32749. return nil, err
  32750. }
  32751. defer googleapi.CloseBody(res)
  32752. if err := googleapi.CheckResponse(res); err != nil {
  32753. return nil, err
  32754. }
  32755. ret := &Operation{
  32756. ServerResponse: googleapi.ServerResponse{
  32757. Header: res.Header,
  32758. HTTPStatusCode: res.StatusCode,
  32759. },
  32760. }
  32761. target := &ret
  32762. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  32763. return nil, err
  32764. }
  32765. return ret, nil
  32766. // {
  32767. // "description": "Changes the machine type for a stopped instance to the machine type specified in the request.",
  32768. // "httpMethod": "POST",
  32769. // "id": "compute.instances.setMachineType",
  32770. // "parameterOrder": [
  32771. // "project",
  32772. // "zone",
  32773. // "instance"
  32774. // ],
  32775. // "parameters": {
  32776. // "instance": {
  32777. // "description": "Name of the instance scoping this request.",
  32778. // "location": "path",
  32779. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32780. // "required": true,
  32781. // "type": "string"
  32782. // },
  32783. // "project": {
  32784. // "description": "Project ID for this request.",
  32785. // "location": "path",
  32786. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32787. // "required": true,
  32788. // "type": "string"
  32789. // },
  32790. // "zone": {
  32791. // "description": "The name of the zone for this request.",
  32792. // "location": "path",
  32793. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32794. // "required": true,
  32795. // "type": "string"
  32796. // }
  32797. // },
  32798. // "path": "{project}/zones/{zone}/instances/{instance}/setMachineType",
  32799. // "request": {
  32800. // "$ref": "InstancesSetMachineTypeRequest"
  32801. // },
  32802. // "response": {
  32803. // "$ref": "Operation"
  32804. // },
  32805. // "scopes": [
  32806. // "https://www.googleapis.com/auth/cloud-platform",
  32807. // "https://www.googleapis.com/auth/compute"
  32808. // ]
  32809. // }
  32810. }
  32811. // method id "compute.instances.setMetadata":
  32812. type InstancesSetMetadataCall struct {
  32813. s *Service
  32814. project string
  32815. zone string
  32816. instance string
  32817. metadata *Metadata
  32818. urlParams_ gensupport.URLParams
  32819. ctx_ context.Context
  32820. header_ http.Header
  32821. }
  32822. // SetMetadata: Sets metadata for the specified instance to the data
  32823. // included in the request.
  32824. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setMetadata
  32825. func (r *InstancesService) SetMetadata(project string, zone string, instance string, metadata *Metadata) *InstancesSetMetadataCall {
  32826. c := &InstancesSetMetadataCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32827. c.project = project
  32828. c.zone = zone
  32829. c.instance = instance
  32830. c.metadata = metadata
  32831. return c
  32832. }
  32833. // Fields allows partial responses to be retrieved. See
  32834. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32835. // for more information.
  32836. func (c *InstancesSetMetadataCall) Fields(s ...googleapi.Field) *InstancesSetMetadataCall {
  32837. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32838. return c
  32839. }
  32840. // Context sets the context to be used in this call's Do method. Any
  32841. // pending HTTP request will be aborted if the provided context is
  32842. // canceled.
  32843. func (c *InstancesSetMetadataCall) Context(ctx context.Context) *InstancesSetMetadataCall {
  32844. c.ctx_ = ctx
  32845. return c
  32846. }
  32847. // Header returns an http.Header that can be modified by the caller to
  32848. // add HTTP headers to the request.
  32849. func (c *InstancesSetMetadataCall) Header() http.Header {
  32850. if c.header_ == nil {
  32851. c.header_ = make(http.Header)
  32852. }
  32853. return c.header_
  32854. }
  32855. func (c *InstancesSetMetadataCall) doRequest(alt string) (*http.Response, error) {
  32856. reqHeaders := make(http.Header)
  32857. for k, v := range c.header_ {
  32858. reqHeaders[k] = v
  32859. }
  32860. reqHeaders.Set("User-Agent", c.s.userAgent())
  32861. var body io.Reader = nil
  32862. body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata)
  32863. if err != nil {
  32864. return nil, err
  32865. }
  32866. reqHeaders.Set("Content-Type", "application/json")
  32867. c.urlParams_.Set("alt", alt)
  32868. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMetadata")
  32869. urls += "?" + c.urlParams_.Encode()
  32870. req, _ := http.NewRequest("POST", urls, body)
  32871. req.Header = reqHeaders
  32872. googleapi.Expand(req.URL, map[string]string{
  32873. "project": c.project,
  32874. "zone": c.zone,
  32875. "instance": c.instance,
  32876. })
  32877. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32878. }
  32879. // Do executes the "compute.instances.setMetadata" call.
  32880. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  32881. // status code is an error. Response headers are in either
  32882. // *Operation.ServerResponse.Header or (if a response was returned at
  32883. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  32884. // to check whether the returned error was because
  32885. // http.StatusNotModified was returned.
  32886. func (c *InstancesSetMetadataCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  32887. gensupport.SetOptions(c.urlParams_, opts...)
  32888. res, err := c.doRequest("json")
  32889. if res != nil && res.StatusCode == http.StatusNotModified {
  32890. if res.Body != nil {
  32891. res.Body.Close()
  32892. }
  32893. return nil, &googleapi.Error{
  32894. Code: res.StatusCode,
  32895. Header: res.Header,
  32896. }
  32897. }
  32898. if err != nil {
  32899. return nil, err
  32900. }
  32901. defer googleapi.CloseBody(res)
  32902. if err := googleapi.CheckResponse(res); err != nil {
  32903. return nil, err
  32904. }
  32905. ret := &Operation{
  32906. ServerResponse: googleapi.ServerResponse{
  32907. Header: res.Header,
  32908. HTTPStatusCode: res.StatusCode,
  32909. },
  32910. }
  32911. target := &ret
  32912. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  32913. return nil, err
  32914. }
  32915. return ret, nil
  32916. // {
  32917. // "description": "Sets metadata for the specified instance to the data included in the request.",
  32918. // "httpMethod": "POST",
  32919. // "id": "compute.instances.setMetadata",
  32920. // "parameterOrder": [
  32921. // "project",
  32922. // "zone",
  32923. // "instance"
  32924. // ],
  32925. // "parameters": {
  32926. // "instance": {
  32927. // "description": "Name of the instance scoping this request.",
  32928. // "location": "path",
  32929. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32930. // "required": true,
  32931. // "type": "string"
  32932. // },
  32933. // "project": {
  32934. // "description": "Project ID for this request.",
  32935. // "location": "path",
  32936. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32937. // "required": true,
  32938. // "type": "string"
  32939. // },
  32940. // "zone": {
  32941. // "description": "The name of the zone for this request.",
  32942. // "location": "path",
  32943. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32944. // "required": true,
  32945. // "type": "string"
  32946. // }
  32947. // },
  32948. // "path": "{project}/zones/{zone}/instances/{instance}/setMetadata",
  32949. // "request": {
  32950. // "$ref": "Metadata"
  32951. // },
  32952. // "response": {
  32953. // "$ref": "Operation"
  32954. // },
  32955. // "scopes": [
  32956. // "https://www.googleapis.com/auth/cloud-platform",
  32957. // "https://www.googleapis.com/auth/compute"
  32958. // ]
  32959. // }
  32960. }
  32961. // method id "compute.instances.setScheduling":
  32962. type InstancesSetSchedulingCall struct {
  32963. s *Service
  32964. project string
  32965. zone string
  32966. instance string
  32967. scheduling *Scheduling
  32968. urlParams_ gensupport.URLParams
  32969. ctx_ context.Context
  32970. header_ http.Header
  32971. }
  32972. // SetScheduling: Sets an instance's scheduling options.
  32973. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setScheduling
  32974. func (r *InstancesService) SetScheduling(project string, zone string, instance string, scheduling *Scheduling) *InstancesSetSchedulingCall {
  32975. c := &InstancesSetSchedulingCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32976. c.project = project
  32977. c.zone = zone
  32978. c.instance = instance
  32979. c.scheduling = scheduling
  32980. return c
  32981. }
  32982. // Fields allows partial responses to be retrieved. See
  32983. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32984. // for more information.
  32985. func (c *InstancesSetSchedulingCall) Fields(s ...googleapi.Field) *InstancesSetSchedulingCall {
  32986. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32987. return c
  32988. }
  32989. // Context sets the context to be used in this call's Do method. Any
  32990. // pending HTTP request will be aborted if the provided context is
  32991. // canceled.
  32992. func (c *InstancesSetSchedulingCall) Context(ctx context.Context) *InstancesSetSchedulingCall {
  32993. c.ctx_ = ctx
  32994. return c
  32995. }
  32996. // Header returns an http.Header that can be modified by the caller to
  32997. // add HTTP headers to the request.
  32998. func (c *InstancesSetSchedulingCall) Header() http.Header {
  32999. if c.header_ == nil {
  33000. c.header_ = make(http.Header)
  33001. }
  33002. return c.header_
  33003. }
  33004. func (c *InstancesSetSchedulingCall) doRequest(alt string) (*http.Response, error) {
  33005. reqHeaders := make(http.Header)
  33006. for k, v := range c.header_ {
  33007. reqHeaders[k] = v
  33008. }
  33009. reqHeaders.Set("User-Agent", c.s.userAgent())
  33010. var body io.Reader = nil
  33011. body, err := googleapi.WithoutDataWrapper.JSONReader(c.scheduling)
  33012. if err != nil {
  33013. return nil, err
  33014. }
  33015. reqHeaders.Set("Content-Type", "application/json")
  33016. c.urlParams_.Set("alt", alt)
  33017. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setScheduling")
  33018. urls += "?" + c.urlParams_.Encode()
  33019. req, _ := http.NewRequest("POST", urls, body)
  33020. req.Header = reqHeaders
  33021. googleapi.Expand(req.URL, map[string]string{
  33022. "project": c.project,
  33023. "zone": c.zone,
  33024. "instance": c.instance,
  33025. })
  33026. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33027. }
  33028. // Do executes the "compute.instances.setScheduling" call.
  33029. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  33030. // status code is an error. Response headers are in either
  33031. // *Operation.ServerResponse.Header or (if a response was returned at
  33032. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  33033. // to check whether the returned error was because
  33034. // http.StatusNotModified was returned.
  33035. func (c *InstancesSetSchedulingCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  33036. gensupport.SetOptions(c.urlParams_, opts...)
  33037. res, err := c.doRequest("json")
  33038. if res != nil && res.StatusCode == http.StatusNotModified {
  33039. if res.Body != nil {
  33040. res.Body.Close()
  33041. }
  33042. return nil, &googleapi.Error{
  33043. Code: res.StatusCode,
  33044. Header: res.Header,
  33045. }
  33046. }
  33047. if err != nil {
  33048. return nil, err
  33049. }
  33050. defer googleapi.CloseBody(res)
  33051. if err := googleapi.CheckResponse(res); err != nil {
  33052. return nil, err
  33053. }
  33054. ret := &Operation{
  33055. ServerResponse: googleapi.ServerResponse{
  33056. Header: res.Header,
  33057. HTTPStatusCode: res.StatusCode,
  33058. },
  33059. }
  33060. target := &ret
  33061. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  33062. return nil, err
  33063. }
  33064. return ret, nil
  33065. // {
  33066. // "description": "Sets an instance's scheduling options.",
  33067. // "httpMethod": "POST",
  33068. // "id": "compute.instances.setScheduling",
  33069. // "parameterOrder": [
  33070. // "project",
  33071. // "zone",
  33072. // "instance"
  33073. // ],
  33074. // "parameters": {
  33075. // "instance": {
  33076. // "description": "Instance name.",
  33077. // "location": "path",
  33078. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33079. // "required": true,
  33080. // "type": "string"
  33081. // },
  33082. // "project": {
  33083. // "description": "Project ID for this request.",
  33084. // "location": "path",
  33085. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33086. // "required": true,
  33087. // "type": "string"
  33088. // },
  33089. // "zone": {
  33090. // "description": "The name of the zone for this request.",
  33091. // "location": "path",
  33092. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33093. // "required": true,
  33094. // "type": "string"
  33095. // }
  33096. // },
  33097. // "path": "{project}/zones/{zone}/instances/{instance}/setScheduling",
  33098. // "request": {
  33099. // "$ref": "Scheduling"
  33100. // },
  33101. // "response": {
  33102. // "$ref": "Operation"
  33103. // },
  33104. // "scopes": [
  33105. // "https://www.googleapis.com/auth/cloud-platform",
  33106. // "https://www.googleapis.com/auth/compute"
  33107. // ]
  33108. // }
  33109. }
  33110. // method id "compute.instances.setServiceAccount":
  33111. type InstancesSetServiceAccountCall struct {
  33112. s *Service
  33113. project string
  33114. zone string
  33115. instance string
  33116. instancessetserviceaccountrequest *InstancesSetServiceAccountRequest
  33117. urlParams_ gensupport.URLParams
  33118. ctx_ context.Context
  33119. header_ http.Header
  33120. }
  33121. // SetServiceAccount: Sets the service account on the instance. For more
  33122. // information, read Changing the service account and access scopes for
  33123. // an instance.
  33124. func (r *InstancesService) SetServiceAccount(project string, zone string, instance string, instancessetserviceaccountrequest *InstancesSetServiceAccountRequest) *InstancesSetServiceAccountCall {
  33125. c := &InstancesSetServiceAccountCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33126. c.project = project
  33127. c.zone = zone
  33128. c.instance = instance
  33129. c.instancessetserviceaccountrequest = instancessetserviceaccountrequest
  33130. return c
  33131. }
  33132. // Fields allows partial responses to be retrieved. See
  33133. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33134. // for more information.
  33135. func (c *InstancesSetServiceAccountCall) Fields(s ...googleapi.Field) *InstancesSetServiceAccountCall {
  33136. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33137. return c
  33138. }
  33139. // Context sets the context to be used in this call's Do method. Any
  33140. // pending HTTP request will be aborted if the provided context is
  33141. // canceled.
  33142. func (c *InstancesSetServiceAccountCall) Context(ctx context.Context) *InstancesSetServiceAccountCall {
  33143. c.ctx_ = ctx
  33144. return c
  33145. }
  33146. // Header returns an http.Header that can be modified by the caller to
  33147. // add HTTP headers to the request.
  33148. func (c *InstancesSetServiceAccountCall) Header() http.Header {
  33149. if c.header_ == nil {
  33150. c.header_ = make(http.Header)
  33151. }
  33152. return c.header_
  33153. }
  33154. func (c *InstancesSetServiceAccountCall) doRequest(alt string) (*http.Response, error) {
  33155. reqHeaders := make(http.Header)
  33156. for k, v := range c.header_ {
  33157. reqHeaders[k] = v
  33158. }
  33159. reqHeaders.Set("User-Agent", c.s.userAgent())
  33160. var body io.Reader = nil
  33161. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetserviceaccountrequest)
  33162. if err != nil {
  33163. return nil, err
  33164. }
  33165. reqHeaders.Set("Content-Type", "application/json")
  33166. c.urlParams_.Set("alt", alt)
  33167. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setServiceAccount")
  33168. urls += "?" + c.urlParams_.Encode()
  33169. req, _ := http.NewRequest("POST", urls, body)
  33170. req.Header = reqHeaders
  33171. googleapi.Expand(req.URL, map[string]string{
  33172. "project": c.project,
  33173. "zone": c.zone,
  33174. "instance": c.instance,
  33175. })
  33176. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33177. }
  33178. // Do executes the "compute.instances.setServiceAccount" call.
  33179. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  33180. // status code is an error. Response headers are in either
  33181. // *Operation.ServerResponse.Header or (if a response was returned at
  33182. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  33183. // to check whether the returned error was because
  33184. // http.StatusNotModified was returned.
  33185. func (c *InstancesSetServiceAccountCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  33186. gensupport.SetOptions(c.urlParams_, opts...)
  33187. res, err := c.doRequest("json")
  33188. if res != nil && res.StatusCode == http.StatusNotModified {
  33189. if res.Body != nil {
  33190. res.Body.Close()
  33191. }
  33192. return nil, &googleapi.Error{
  33193. Code: res.StatusCode,
  33194. Header: res.Header,
  33195. }
  33196. }
  33197. if err != nil {
  33198. return nil, err
  33199. }
  33200. defer googleapi.CloseBody(res)
  33201. if err := googleapi.CheckResponse(res); err != nil {
  33202. return nil, err
  33203. }
  33204. ret := &Operation{
  33205. ServerResponse: googleapi.ServerResponse{
  33206. Header: res.Header,
  33207. HTTPStatusCode: res.StatusCode,
  33208. },
  33209. }
  33210. target := &ret
  33211. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  33212. return nil, err
  33213. }
  33214. return ret, nil
  33215. // {
  33216. // "description": "Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance.",
  33217. // "httpMethod": "POST",
  33218. // "id": "compute.instances.setServiceAccount",
  33219. // "parameterOrder": [
  33220. // "project",
  33221. // "zone",
  33222. // "instance"
  33223. // ],
  33224. // "parameters": {
  33225. // "instance": {
  33226. // "description": "Name of the instance resource to start.",
  33227. // "location": "path",
  33228. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33229. // "required": true,
  33230. // "type": "string"
  33231. // },
  33232. // "project": {
  33233. // "description": "Project ID for this request.",
  33234. // "location": "path",
  33235. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33236. // "required": true,
  33237. // "type": "string"
  33238. // },
  33239. // "zone": {
  33240. // "description": "The name of the zone for this request.",
  33241. // "location": "path",
  33242. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33243. // "required": true,
  33244. // "type": "string"
  33245. // }
  33246. // },
  33247. // "path": "{project}/zones/{zone}/instances/{instance}/setServiceAccount",
  33248. // "request": {
  33249. // "$ref": "InstancesSetServiceAccountRequest"
  33250. // },
  33251. // "response": {
  33252. // "$ref": "Operation"
  33253. // },
  33254. // "scopes": [
  33255. // "https://www.googleapis.com/auth/cloud-platform",
  33256. // "https://www.googleapis.com/auth/compute"
  33257. // ]
  33258. // }
  33259. }
  33260. // method id "compute.instances.setTags":
  33261. type InstancesSetTagsCall struct {
  33262. s *Service
  33263. project string
  33264. zone string
  33265. instance string
  33266. tags *Tags
  33267. urlParams_ gensupport.URLParams
  33268. ctx_ context.Context
  33269. header_ http.Header
  33270. }
  33271. // SetTags: Sets tags for the specified instance to the data included in
  33272. // the request.
  33273. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setTags
  33274. func (r *InstancesService) SetTags(project string, zone string, instance string, tags *Tags) *InstancesSetTagsCall {
  33275. c := &InstancesSetTagsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33276. c.project = project
  33277. c.zone = zone
  33278. c.instance = instance
  33279. c.tags = tags
  33280. return c
  33281. }
  33282. // Fields allows partial responses to be retrieved. See
  33283. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33284. // for more information.
  33285. func (c *InstancesSetTagsCall) Fields(s ...googleapi.Field) *InstancesSetTagsCall {
  33286. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33287. return c
  33288. }
  33289. // Context sets the context to be used in this call's Do method. Any
  33290. // pending HTTP request will be aborted if the provided context is
  33291. // canceled.
  33292. func (c *InstancesSetTagsCall) Context(ctx context.Context) *InstancesSetTagsCall {
  33293. c.ctx_ = ctx
  33294. return c
  33295. }
  33296. // Header returns an http.Header that can be modified by the caller to
  33297. // add HTTP headers to the request.
  33298. func (c *InstancesSetTagsCall) Header() http.Header {
  33299. if c.header_ == nil {
  33300. c.header_ = make(http.Header)
  33301. }
  33302. return c.header_
  33303. }
  33304. func (c *InstancesSetTagsCall) doRequest(alt string) (*http.Response, error) {
  33305. reqHeaders := make(http.Header)
  33306. for k, v := range c.header_ {
  33307. reqHeaders[k] = v
  33308. }
  33309. reqHeaders.Set("User-Agent", c.s.userAgent())
  33310. var body io.Reader = nil
  33311. body, err := googleapi.WithoutDataWrapper.JSONReader(c.tags)
  33312. if err != nil {
  33313. return nil, err
  33314. }
  33315. reqHeaders.Set("Content-Type", "application/json")
  33316. c.urlParams_.Set("alt", alt)
  33317. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setTags")
  33318. urls += "?" + c.urlParams_.Encode()
  33319. req, _ := http.NewRequest("POST", urls, body)
  33320. req.Header = reqHeaders
  33321. googleapi.Expand(req.URL, map[string]string{
  33322. "project": c.project,
  33323. "zone": c.zone,
  33324. "instance": c.instance,
  33325. })
  33326. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33327. }
  33328. // Do executes the "compute.instances.setTags" call.
  33329. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  33330. // status code is an error. Response headers are in either
  33331. // *Operation.ServerResponse.Header or (if a response was returned at
  33332. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  33333. // to check whether the returned error was because
  33334. // http.StatusNotModified was returned.
  33335. func (c *InstancesSetTagsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  33336. gensupport.SetOptions(c.urlParams_, opts...)
  33337. res, err := c.doRequest("json")
  33338. if res != nil && res.StatusCode == http.StatusNotModified {
  33339. if res.Body != nil {
  33340. res.Body.Close()
  33341. }
  33342. return nil, &googleapi.Error{
  33343. Code: res.StatusCode,
  33344. Header: res.Header,
  33345. }
  33346. }
  33347. if err != nil {
  33348. return nil, err
  33349. }
  33350. defer googleapi.CloseBody(res)
  33351. if err := googleapi.CheckResponse(res); err != nil {
  33352. return nil, err
  33353. }
  33354. ret := &Operation{
  33355. ServerResponse: googleapi.ServerResponse{
  33356. Header: res.Header,
  33357. HTTPStatusCode: res.StatusCode,
  33358. },
  33359. }
  33360. target := &ret
  33361. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  33362. return nil, err
  33363. }
  33364. return ret, nil
  33365. // {
  33366. // "description": "Sets tags for the specified instance to the data included in the request.",
  33367. // "httpMethod": "POST",
  33368. // "id": "compute.instances.setTags",
  33369. // "parameterOrder": [
  33370. // "project",
  33371. // "zone",
  33372. // "instance"
  33373. // ],
  33374. // "parameters": {
  33375. // "instance": {
  33376. // "description": "Name of the instance scoping this request.",
  33377. // "location": "path",
  33378. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33379. // "required": true,
  33380. // "type": "string"
  33381. // },
  33382. // "project": {
  33383. // "description": "Project ID for this request.",
  33384. // "location": "path",
  33385. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33386. // "required": true,
  33387. // "type": "string"
  33388. // },
  33389. // "zone": {
  33390. // "description": "The name of the zone for this request.",
  33391. // "location": "path",
  33392. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33393. // "required": true,
  33394. // "type": "string"
  33395. // }
  33396. // },
  33397. // "path": "{project}/zones/{zone}/instances/{instance}/setTags",
  33398. // "request": {
  33399. // "$ref": "Tags"
  33400. // },
  33401. // "response": {
  33402. // "$ref": "Operation"
  33403. // },
  33404. // "scopes": [
  33405. // "https://www.googleapis.com/auth/cloud-platform",
  33406. // "https://www.googleapis.com/auth/compute"
  33407. // ]
  33408. // }
  33409. }
  33410. // method id "compute.instances.start":
  33411. type InstancesStartCall struct {
  33412. s *Service
  33413. project string
  33414. zone string
  33415. instance string
  33416. urlParams_ gensupport.URLParams
  33417. ctx_ context.Context
  33418. header_ http.Header
  33419. }
  33420. // Start: Starts an instance that was stopped using the using the
  33421. // instances().stop method. For more information, see Restart an
  33422. // instance.
  33423. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/start
  33424. func (r *InstancesService) Start(project string, zone string, instance string) *InstancesStartCall {
  33425. c := &InstancesStartCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33426. c.project = project
  33427. c.zone = zone
  33428. c.instance = instance
  33429. return c
  33430. }
  33431. // Fields allows partial responses to be retrieved. See
  33432. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33433. // for more information.
  33434. func (c *InstancesStartCall) Fields(s ...googleapi.Field) *InstancesStartCall {
  33435. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33436. return c
  33437. }
  33438. // Context sets the context to be used in this call's Do method. Any
  33439. // pending HTTP request will be aborted if the provided context is
  33440. // canceled.
  33441. func (c *InstancesStartCall) Context(ctx context.Context) *InstancesStartCall {
  33442. c.ctx_ = ctx
  33443. return c
  33444. }
  33445. // Header returns an http.Header that can be modified by the caller to
  33446. // add HTTP headers to the request.
  33447. func (c *InstancesStartCall) Header() http.Header {
  33448. if c.header_ == nil {
  33449. c.header_ = make(http.Header)
  33450. }
  33451. return c.header_
  33452. }
  33453. func (c *InstancesStartCall) doRequest(alt string) (*http.Response, error) {
  33454. reqHeaders := make(http.Header)
  33455. for k, v := range c.header_ {
  33456. reqHeaders[k] = v
  33457. }
  33458. reqHeaders.Set("User-Agent", c.s.userAgent())
  33459. var body io.Reader = nil
  33460. c.urlParams_.Set("alt", alt)
  33461. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/start")
  33462. urls += "?" + c.urlParams_.Encode()
  33463. req, _ := http.NewRequest("POST", urls, body)
  33464. req.Header = reqHeaders
  33465. googleapi.Expand(req.URL, map[string]string{
  33466. "project": c.project,
  33467. "zone": c.zone,
  33468. "instance": c.instance,
  33469. })
  33470. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33471. }
  33472. // Do executes the "compute.instances.start" call.
  33473. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  33474. // status code is an error. Response headers are in either
  33475. // *Operation.ServerResponse.Header or (if a response was returned at
  33476. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  33477. // to check whether the returned error was because
  33478. // http.StatusNotModified was returned.
  33479. func (c *InstancesStartCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  33480. gensupport.SetOptions(c.urlParams_, opts...)
  33481. res, err := c.doRequest("json")
  33482. if res != nil && res.StatusCode == http.StatusNotModified {
  33483. if res.Body != nil {
  33484. res.Body.Close()
  33485. }
  33486. return nil, &googleapi.Error{
  33487. Code: res.StatusCode,
  33488. Header: res.Header,
  33489. }
  33490. }
  33491. if err != nil {
  33492. return nil, err
  33493. }
  33494. defer googleapi.CloseBody(res)
  33495. if err := googleapi.CheckResponse(res); err != nil {
  33496. return nil, err
  33497. }
  33498. ret := &Operation{
  33499. ServerResponse: googleapi.ServerResponse{
  33500. Header: res.Header,
  33501. HTTPStatusCode: res.StatusCode,
  33502. },
  33503. }
  33504. target := &ret
  33505. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  33506. return nil, err
  33507. }
  33508. return ret, nil
  33509. // {
  33510. // "description": "Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance.",
  33511. // "httpMethod": "POST",
  33512. // "id": "compute.instances.start",
  33513. // "parameterOrder": [
  33514. // "project",
  33515. // "zone",
  33516. // "instance"
  33517. // ],
  33518. // "parameters": {
  33519. // "instance": {
  33520. // "description": "Name of the instance resource to start.",
  33521. // "location": "path",
  33522. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33523. // "required": true,
  33524. // "type": "string"
  33525. // },
  33526. // "project": {
  33527. // "description": "Project ID for this request.",
  33528. // "location": "path",
  33529. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33530. // "required": true,
  33531. // "type": "string"
  33532. // },
  33533. // "zone": {
  33534. // "description": "The name of the zone for this request.",
  33535. // "location": "path",
  33536. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33537. // "required": true,
  33538. // "type": "string"
  33539. // }
  33540. // },
  33541. // "path": "{project}/zones/{zone}/instances/{instance}/start",
  33542. // "response": {
  33543. // "$ref": "Operation"
  33544. // },
  33545. // "scopes": [
  33546. // "https://www.googleapis.com/auth/cloud-platform",
  33547. // "https://www.googleapis.com/auth/compute"
  33548. // ]
  33549. // }
  33550. }
  33551. // method id "compute.instances.startWithEncryptionKey":
  33552. type InstancesStartWithEncryptionKeyCall struct {
  33553. s *Service
  33554. project string
  33555. zone string
  33556. instance string
  33557. instancesstartwithencryptionkeyrequest *InstancesStartWithEncryptionKeyRequest
  33558. urlParams_ gensupport.URLParams
  33559. ctx_ context.Context
  33560. header_ http.Header
  33561. }
  33562. // StartWithEncryptionKey: Starts an instance that was stopped using the
  33563. // using the instances().stop method. For more information, see Restart
  33564. // an instance.
  33565. func (r *InstancesService) StartWithEncryptionKey(project string, zone string, instance string, instancesstartwithencryptionkeyrequest *InstancesStartWithEncryptionKeyRequest) *InstancesStartWithEncryptionKeyCall {
  33566. c := &InstancesStartWithEncryptionKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33567. c.project = project
  33568. c.zone = zone
  33569. c.instance = instance
  33570. c.instancesstartwithencryptionkeyrequest = instancesstartwithencryptionkeyrequest
  33571. return c
  33572. }
  33573. // Fields allows partial responses to be retrieved. See
  33574. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33575. // for more information.
  33576. func (c *InstancesStartWithEncryptionKeyCall) Fields(s ...googleapi.Field) *InstancesStartWithEncryptionKeyCall {
  33577. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33578. return c
  33579. }
  33580. // Context sets the context to be used in this call's Do method. Any
  33581. // pending HTTP request will be aborted if the provided context is
  33582. // canceled.
  33583. func (c *InstancesStartWithEncryptionKeyCall) Context(ctx context.Context) *InstancesStartWithEncryptionKeyCall {
  33584. c.ctx_ = ctx
  33585. return c
  33586. }
  33587. // Header returns an http.Header that can be modified by the caller to
  33588. // add HTTP headers to the request.
  33589. func (c *InstancesStartWithEncryptionKeyCall) Header() http.Header {
  33590. if c.header_ == nil {
  33591. c.header_ = make(http.Header)
  33592. }
  33593. return c.header_
  33594. }
  33595. func (c *InstancesStartWithEncryptionKeyCall) doRequest(alt string) (*http.Response, error) {
  33596. reqHeaders := make(http.Header)
  33597. for k, v := range c.header_ {
  33598. reqHeaders[k] = v
  33599. }
  33600. reqHeaders.Set("User-Agent", c.s.userAgent())
  33601. var body io.Reader = nil
  33602. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesstartwithencryptionkeyrequest)
  33603. if err != nil {
  33604. return nil, err
  33605. }
  33606. reqHeaders.Set("Content-Type", "application/json")
  33607. c.urlParams_.Set("alt", alt)
  33608. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/startWithEncryptionKey")
  33609. urls += "?" + c.urlParams_.Encode()
  33610. req, _ := http.NewRequest("POST", urls, body)
  33611. req.Header = reqHeaders
  33612. googleapi.Expand(req.URL, map[string]string{
  33613. "project": c.project,
  33614. "zone": c.zone,
  33615. "instance": c.instance,
  33616. })
  33617. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33618. }
  33619. // Do executes the "compute.instances.startWithEncryptionKey" call.
  33620. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  33621. // status code is an error. Response headers are in either
  33622. // *Operation.ServerResponse.Header or (if a response was returned at
  33623. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  33624. // to check whether the returned error was because
  33625. // http.StatusNotModified was returned.
  33626. func (c *InstancesStartWithEncryptionKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  33627. gensupport.SetOptions(c.urlParams_, opts...)
  33628. res, err := c.doRequest("json")
  33629. if res != nil && res.StatusCode == http.StatusNotModified {
  33630. if res.Body != nil {
  33631. res.Body.Close()
  33632. }
  33633. return nil, &googleapi.Error{
  33634. Code: res.StatusCode,
  33635. Header: res.Header,
  33636. }
  33637. }
  33638. if err != nil {
  33639. return nil, err
  33640. }
  33641. defer googleapi.CloseBody(res)
  33642. if err := googleapi.CheckResponse(res); err != nil {
  33643. return nil, err
  33644. }
  33645. ret := &Operation{
  33646. ServerResponse: googleapi.ServerResponse{
  33647. Header: res.Header,
  33648. HTTPStatusCode: res.StatusCode,
  33649. },
  33650. }
  33651. target := &ret
  33652. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  33653. return nil, err
  33654. }
  33655. return ret, nil
  33656. // {
  33657. // "description": "Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance.",
  33658. // "httpMethod": "POST",
  33659. // "id": "compute.instances.startWithEncryptionKey",
  33660. // "parameterOrder": [
  33661. // "project",
  33662. // "zone",
  33663. // "instance"
  33664. // ],
  33665. // "parameters": {
  33666. // "instance": {
  33667. // "description": "Name of the instance resource to start.",
  33668. // "location": "path",
  33669. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33670. // "required": true,
  33671. // "type": "string"
  33672. // },
  33673. // "project": {
  33674. // "description": "Project ID for this request.",
  33675. // "location": "path",
  33676. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33677. // "required": true,
  33678. // "type": "string"
  33679. // },
  33680. // "zone": {
  33681. // "description": "The name of the zone for this request.",
  33682. // "location": "path",
  33683. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33684. // "required": true,
  33685. // "type": "string"
  33686. // }
  33687. // },
  33688. // "path": "{project}/zones/{zone}/instances/{instance}/startWithEncryptionKey",
  33689. // "request": {
  33690. // "$ref": "InstancesStartWithEncryptionKeyRequest"
  33691. // },
  33692. // "response": {
  33693. // "$ref": "Operation"
  33694. // },
  33695. // "scopes": [
  33696. // "https://www.googleapis.com/auth/cloud-platform",
  33697. // "https://www.googleapis.com/auth/compute"
  33698. // ]
  33699. // }
  33700. }
  33701. // method id "compute.instances.stop":
  33702. type InstancesStopCall struct {
  33703. s *Service
  33704. project string
  33705. zone string
  33706. instance string
  33707. urlParams_ gensupport.URLParams
  33708. ctx_ context.Context
  33709. header_ http.Header
  33710. }
  33711. // Stop: Stops a running instance, shutting it down cleanly, and allows
  33712. // you to restart the instance at a later time. Stopped instances do not
  33713. // incur per-minute, virtual machine usage charges while they are
  33714. // stopped, but any resources that the virtual machine is using, such as
  33715. // persistent disks and static IP addresses, will continue to be charged
  33716. // until they are deleted. For more information, see Stopping an
  33717. // instance.
  33718. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/stop
  33719. func (r *InstancesService) Stop(project string, zone string, instance string) *InstancesStopCall {
  33720. c := &InstancesStopCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33721. c.project = project
  33722. c.zone = zone
  33723. c.instance = instance
  33724. return c
  33725. }
  33726. // Fields allows partial responses to be retrieved. See
  33727. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33728. // for more information.
  33729. func (c *InstancesStopCall) Fields(s ...googleapi.Field) *InstancesStopCall {
  33730. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33731. return c
  33732. }
  33733. // Context sets the context to be used in this call's Do method. Any
  33734. // pending HTTP request will be aborted if the provided context is
  33735. // canceled.
  33736. func (c *InstancesStopCall) Context(ctx context.Context) *InstancesStopCall {
  33737. c.ctx_ = ctx
  33738. return c
  33739. }
  33740. // Header returns an http.Header that can be modified by the caller to
  33741. // add HTTP headers to the request.
  33742. func (c *InstancesStopCall) Header() http.Header {
  33743. if c.header_ == nil {
  33744. c.header_ = make(http.Header)
  33745. }
  33746. return c.header_
  33747. }
  33748. func (c *InstancesStopCall) doRequest(alt string) (*http.Response, error) {
  33749. reqHeaders := make(http.Header)
  33750. for k, v := range c.header_ {
  33751. reqHeaders[k] = v
  33752. }
  33753. reqHeaders.Set("User-Agent", c.s.userAgent())
  33754. var body io.Reader = nil
  33755. c.urlParams_.Set("alt", alt)
  33756. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/stop")
  33757. urls += "?" + c.urlParams_.Encode()
  33758. req, _ := http.NewRequest("POST", urls, body)
  33759. req.Header = reqHeaders
  33760. googleapi.Expand(req.URL, map[string]string{
  33761. "project": c.project,
  33762. "zone": c.zone,
  33763. "instance": c.instance,
  33764. })
  33765. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33766. }
  33767. // Do executes the "compute.instances.stop" call.
  33768. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  33769. // status code is an error. Response headers are in either
  33770. // *Operation.ServerResponse.Header or (if a response was returned at
  33771. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  33772. // to check whether the returned error was because
  33773. // http.StatusNotModified was returned.
  33774. func (c *InstancesStopCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  33775. gensupport.SetOptions(c.urlParams_, opts...)
  33776. res, err := c.doRequest("json")
  33777. if res != nil && res.StatusCode == http.StatusNotModified {
  33778. if res.Body != nil {
  33779. res.Body.Close()
  33780. }
  33781. return nil, &googleapi.Error{
  33782. Code: res.StatusCode,
  33783. Header: res.Header,
  33784. }
  33785. }
  33786. if err != nil {
  33787. return nil, err
  33788. }
  33789. defer googleapi.CloseBody(res)
  33790. if err := googleapi.CheckResponse(res); err != nil {
  33791. return nil, err
  33792. }
  33793. ret := &Operation{
  33794. ServerResponse: googleapi.ServerResponse{
  33795. Header: res.Header,
  33796. HTTPStatusCode: res.StatusCode,
  33797. },
  33798. }
  33799. target := &ret
  33800. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  33801. return nil, err
  33802. }
  33803. return ret, nil
  33804. // {
  33805. // "description": "Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur per-minute, virtual machine usage charges while they are stopped, but any resources that the virtual machine is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted. For more information, see Stopping an instance.",
  33806. // "httpMethod": "POST",
  33807. // "id": "compute.instances.stop",
  33808. // "parameterOrder": [
  33809. // "project",
  33810. // "zone",
  33811. // "instance"
  33812. // ],
  33813. // "parameters": {
  33814. // "instance": {
  33815. // "description": "Name of the instance resource to stop.",
  33816. // "location": "path",
  33817. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33818. // "required": true,
  33819. // "type": "string"
  33820. // },
  33821. // "project": {
  33822. // "description": "Project ID for this request.",
  33823. // "location": "path",
  33824. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33825. // "required": true,
  33826. // "type": "string"
  33827. // },
  33828. // "zone": {
  33829. // "description": "The name of the zone for this request.",
  33830. // "location": "path",
  33831. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33832. // "required": true,
  33833. // "type": "string"
  33834. // }
  33835. // },
  33836. // "path": "{project}/zones/{zone}/instances/{instance}/stop",
  33837. // "response": {
  33838. // "$ref": "Operation"
  33839. // },
  33840. // "scopes": [
  33841. // "https://www.googleapis.com/auth/cloud-platform",
  33842. // "https://www.googleapis.com/auth/compute"
  33843. // ]
  33844. // }
  33845. }
  33846. // method id "compute.licenses.get":
  33847. type LicensesGetCall struct {
  33848. s *Service
  33849. project string
  33850. license string
  33851. urlParams_ gensupport.URLParams
  33852. ifNoneMatch_ string
  33853. ctx_ context.Context
  33854. header_ http.Header
  33855. }
  33856. // Get: Returns the specified License resource. Get a list of available
  33857. // licenses by making a list() request.
  33858. // For details, see https://cloud.google.com/compute/docs/reference/latest/licenses/get
  33859. func (r *LicensesService) Get(project string, license string) *LicensesGetCall {
  33860. c := &LicensesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33861. c.project = project
  33862. c.license = license
  33863. return c
  33864. }
  33865. // Fields allows partial responses to be retrieved. See
  33866. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33867. // for more information.
  33868. func (c *LicensesGetCall) Fields(s ...googleapi.Field) *LicensesGetCall {
  33869. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33870. return c
  33871. }
  33872. // IfNoneMatch sets the optional parameter which makes the operation
  33873. // fail if the object's ETag matches the given value. This is useful for
  33874. // getting updates only after the object has changed since the last
  33875. // request. Use googleapi.IsNotModified to check whether the response
  33876. // error from Do is the result of In-None-Match.
  33877. func (c *LicensesGetCall) IfNoneMatch(entityTag string) *LicensesGetCall {
  33878. c.ifNoneMatch_ = entityTag
  33879. return c
  33880. }
  33881. // Context sets the context to be used in this call's Do method. Any
  33882. // pending HTTP request will be aborted if the provided context is
  33883. // canceled.
  33884. func (c *LicensesGetCall) Context(ctx context.Context) *LicensesGetCall {
  33885. c.ctx_ = ctx
  33886. return c
  33887. }
  33888. // Header returns an http.Header that can be modified by the caller to
  33889. // add HTTP headers to the request.
  33890. func (c *LicensesGetCall) Header() http.Header {
  33891. if c.header_ == nil {
  33892. c.header_ = make(http.Header)
  33893. }
  33894. return c.header_
  33895. }
  33896. func (c *LicensesGetCall) doRequest(alt string) (*http.Response, error) {
  33897. reqHeaders := make(http.Header)
  33898. for k, v := range c.header_ {
  33899. reqHeaders[k] = v
  33900. }
  33901. reqHeaders.Set("User-Agent", c.s.userAgent())
  33902. if c.ifNoneMatch_ != "" {
  33903. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33904. }
  33905. var body io.Reader = nil
  33906. c.urlParams_.Set("alt", alt)
  33907. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{license}")
  33908. urls += "?" + c.urlParams_.Encode()
  33909. req, _ := http.NewRequest("GET", urls, body)
  33910. req.Header = reqHeaders
  33911. googleapi.Expand(req.URL, map[string]string{
  33912. "project": c.project,
  33913. "license": c.license,
  33914. })
  33915. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33916. }
  33917. // Do executes the "compute.licenses.get" call.
  33918. // Exactly one of *License or error will be non-nil. Any non-2xx status
  33919. // code is an error. Response headers are in either
  33920. // *License.ServerResponse.Header or (if a response was returned at all)
  33921. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  33922. // check whether the returned error was because http.StatusNotModified
  33923. // was returned.
  33924. func (c *LicensesGetCall) Do(opts ...googleapi.CallOption) (*License, error) {
  33925. gensupport.SetOptions(c.urlParams_, opts...)
  33926. res, err := c.doRequest("json")
  33927. if res != nil && res.StatusCode == http.StatusNotModified {
  33928. if res.Body != nil {
  33929. res.Body.Close()
  33930. }
  33931. return nil, &googleapi.Error{
  33932. Code: res.StatusCode,
  33933. Header: res.Header,
  33934. }
  33935. }
  33936. if err != nil {
  33937. return nil, err
  33938. }
  33939. defer googleapi.CloseBody(res)
  33940. if err := googleapi.CheckResponse(res); err != nil {
  33941. return nil, err
  33942. }
  33943. ret := &License{
  33944. ServerResponse: googleapi.ServerResponse{
  33945. Header: res.Header,
  33946. HTTPStatusCode: res.StatusCode,
  33947. },
  33948. }
  33949. target := &ret
  33950. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  33951. return nil, err
  33952. }
  33953. return ret, nil
  33954. // {
  33955. // "description": "Returns the specified License resource. Get a list of available licenses by making a list() request.",
  33956. // "httpMethod": "GET",
  33957. // "id": "compute.licenses.get",
  33958. // "parameterOrder": [
  33959. // "project",
  33960. // "license"
  33961. // ],
  33962. // "parameters": {
  33963. // "license": {
  33964. // "description": "Name of the License resource to return.",
  33965. // "location": "path",
  33966. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33967. // "required": true,
  33968. // "type": "string"
  33969. // },
  33970. // "project": {
  33971. // "description": "Project ID for this request.",
  33972. // "location": "path",
  33973. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33974. // "required": true,
  33975. // "type": "string"
  33976. // }
  33977. // },
  33978. // "path": "{project}/global/licenses/{license}",
  33979. // "response": {
  33980. // "$ref": "License"
  33981. // },
  33982. // "scopes": [
  33983. // "https://www.googleapis.com/auth/cloud-platform",
  33984. // "https://www.googleapis.com/auth/compute",
  33985. // "https://www.googleapis.com/auth/compute.readonly"
  33986. // ]
  33987. // }
  33988. }
  33989. // method id "compute.machineTypes.aggregatedList":
  33990. type MachineTypesAggregatedListCall struct {
  33991. s *Service
  33992. project string
  33993. urlParams_ gensupport.URLParams
  33994. ifNoneMatch_ string
  33995. ctx_ context.Context
  33996. header_ http.Header
  33997. }
  33998. // AggregatedList: Retrieves an aggregated list of machine types.
  33999. // For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/aggregatedList
  34000. func (r *MachineTypesService) AggregatedList(project string) *MachineTypesAggregatedListCall {
  34001. c := &MachineTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34002. c.project = project
  34003. return c
  34004. }
  34005. // Filter sets the optional parameter "filter": Sets a filter
  34006. // {expression} for filtering listed resources. Your {expression} must
  34007. // be in the format: field_name comparison_string literal_string.
  34008. //
  34009. // The field_name is the name of the field you want to compare. Only
  34010. // atomic field types are supported (string, number, boolean). The
  34011. // comparison_string must be either eq (equals) or ne (not equals). The
  34012. // literal_string is the string value to filter to. The literal value
  34013. // must be valid for the type of field you are filtering by (string,
  34014. // number, boolean). For string fields, the literal value is interpreted
  34015. // as a regular expression using RE2 syntax. The literal value must
  34016. // match the entire field.
  34017. //
  34018. // For example, to filter for instances that do not have a name of
  34019. // example-instance, you would use name ne example-instance.
  34020. //
  34021. // You can filter on nested fields. For example, you could filter on
  34022. // instances that have set the scheduling.automaticRestart field to
  34023. // true. Use filtering on nested fields to take advantage of labels to
  34024. // organize and search for results based on label values.
  34025. //
  34026. // To filter on multiple expressions, provide each separate expression
  34027. // within parentheses. For example, (scheduling.automaticRestart eq
  34028. // true) (zone eq us-central1-f). Multiple expressions are treated as
  34029. // AND expressions, meaning that resources must match all expressions to
  34030. // pass the filters.
  34031. func (c *MachineTypesAggregatedListCall) Filter(filter string) *MachineTypesAggregatedListCall {
  34032. c.urlParams_.Set("filter", filter)
  34033. return c
  34034. }
  34035. // MaxResults sets the optional parameter "maxResults": The maximum
  34036. // number of results per page that should be returned. If the number of
  34037. // available results is larger than maxResults, Compute Engine returns a
  34038. // nextPageToken that can be used to get the next page of results in
  34039. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  34040. // (Default: 500)
  34041. func (c *MachineTypesAggregatedListCall) MaxResults(maxResults int64) *MachineTypesAggregatedListCall {
  34042. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  34043. return c
  34044. }
  34045. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  34046. // a certain order. By default, results are returned in alphanumerical
  34047. // order based on the resource name.
  34048. //
  34049. // You can also sort results in descending order based on the creation
  34050. // timestamp using orderBy="creationTimestamp desc". This sorts results
  34051. // based on the creationTimestamp field in reverse chronological order
  34052. // (newest result first). Use this to sort resources like operations so
  34053. // that the newest operation is returned first.
  34054. //
  34055. // Currently, only sorting by name or creationTimestamp desc is
  34056. // supported.
  34057. func (c *MachineTypesAggregatedListCall) OrderBy(orderBy string) *MachineTypesAggregatedListCall {
  34058. c.urlParams_.Set("orderBy", orderBy)
  34059. return c
  34060. }
  34061. // PageToken sets the optional parameter "pageToken": Specifies a page
  34062. // token to use. Set pageToken to the nextPageToken returned by a
  34063. // previous list request to get the next page of results.
  34064. func (c *MachineTypesAggregatedListCall) PageToken(pageToken string) *MachineTypesAggregatedListCall {
  34065. c.urlParams_.Set("pageToken", pageToken)
  34066. return c
  34067. }
  34068. // Fields allows partial responses to be retrieved. See
  34069. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34070. // for more information.
  34071. func (c *MachineTypesAggregatedListCall) Fields(s ...googleapi.Field) *MachineTypesAggregatedListCall {
  34072. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34073. return c
  34074. }
  34075. // IfNoneMatch sets the optional parameter which makes the operation
  34076. // fail if the object's ETag matches the given value. This is useful for
  34077. // getting updates only after the object has changed since the last
  34078. // request. Use googleapi.IsNotModified to check whether the response
  34079. // error from Do is the result of In-None-Match.
  34080. func (c *MachineTypesAggregatedListCall) IfNoneMatch(entityTag string) *MachineTypesAggregatedListCall {
  34081. c.ifNoneMatch_ = entityTag
  34082. return c
  34083. }
  34084. // Context sets the context to be used in this call's Do method. Any
  34085. // pending HTTP request will be aborted if the provided context is
  34086. // canceled.
  34087. func (c *MachineTypesAggregatedListCall) Context(ctx context.Context) *MachineTypesAggregatedListCall {
  34088. c.ctx_ = ctx
  34089. return c
  34090. }
  34091. // Header returns an http.Header that can be modified by the caller to
  34092. // add HTTP headers to the request.
  34093. func (c *MachineTypesAggregatedListCall) Header() http.Header {
  34094. if c.header_ == nil {
  34095. c.header_ = make(http.Header)
  34096. }
  34097. return c.header_
  34098. }
  34099. func (c *MachineTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  34100. reqHeaders := make(http.Header)
  34101. for k, v := range c.header_ {
  34102. reqHeaders[k] = v
  34103. }
  34104. reqHeaders.Set("User-Agent", c.s.userAgent())
  34105. if c.ifNoneMatch_ != "" {
  34106. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  34107. }
  34108. var body io.Reader = nil
  34109. c.urlParams_.Set("alt", alt)
  34110. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/machineTypes")
  34111. urls += "?" + c.urlParams_.Encode()
  34112. req, _ := http.NewRequest("GET", urls, body)
  34113. req.Header = reqHeaders
  34114. googleapi.Expand(req.URL, map[string]string{
  34115. "project": c.project,
  34116. })
  34117. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34118. }
  34119. // Do executes the "compute.machineTypes.aggregatedList" call.
  34120. // Exactly one of *MachineTypeAggregatedList or error will be non-nil.
  34121. // Any non-2xx status code is an error. Response headers are in either
  34122. // *MachineTypeAggregatedList.ServerResponse.Header or (if a response
  34123. // was returned at all) in error.(*googleapi.Error).Header. Use
  34124. // googleapi.IsNotModified to check whether the returned error was
  34125. // because http.StatusNotModified was returned.
  34126. func (c *MachineTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*MachineTypeAggregatedList, error) {
  34127. gensupport.SetOptions(c.urlParams_, opts...)
  34128. res, err := c.doRequest("json")
  34129. if res != nil && res.StatusCode == http.StatusNotModified {
  34130. if res.Body != nil {
  34131. res.Body.Close()
  34132. }
  34133. return nil, &googleapi.Error{
  34134. Code: res.StatusCode,
  34135. Header: res.Header,
  34136. }
  34137. }
  34138. if err != nil {
  34139. return nil, err
  34140. }
  34141. defer googleapi.CloseBody(res)
  34142. if err := googleapi.CheckResponse(res); err != nil {
  34143. return nil, err
  34144. }
  34145. ret := &MachineTypeAggregatedList{
  34146. ServerResponse: googleapi.ServerResponse{
  34147. Header: res.Header,
  34148. HTTPStatusCode: res.StatusCode,
  34149. },
  34150. }
  34151. target := &ret
  34152. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  34153. return nil, err
  34154. }
  34155. return ret, nil
  34156. // {
  34157. // "description": "Retrieves an aggregated list of machine types.",
  34158. // "httpMethod": "GET",
  34159. // "id": "compute.machineTypes.aggregatedList",
  34160. // "parameterOrder": [
  34161. // "project"
  34162. // ],
  34163. // "parameters": {
  34164. // "filter": {
  34165. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  34166. // "location": "query",
  34167. // "type": "string"
  34168. // },
  34169. // "maxResults": {
  34170. // "default": "500",
  34171. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  34172. // "format": "uint32",
  34173. // "location": "query",
  34174. // "minimum": "0",
  34175. // "type": "integer"
  34176. // },
  34177. // "orderBy": {
  34178. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  34179. // "location": "query",
  34180. // "type": "string"
  34181. // },
  34182. // "pageToken": {
  34183. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  34184. // "location": "query",
  34185. // "type": "string"
  34186. // },
  34187. // "project": {
  34188. // "description": "Project ID for this request.",
  34189. // "location": "path",
  34190. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34191. // "required": true,
  34192. // "type": "string"
  34193. // }
  34194. // },
  34195. // "path": "{project}/aggregated/machineTypes",
  34196. // "response": {
  34197. // "$ref": "MachineTypeAggregatedList"
  34198. // },
  34199. // "scopes": [
  34200. // "https://www.googleapis.com/auth/cloud-platform",
  34201. // "https://www.googleapis.com/auth/compute",
  34202. // "https://www.googleapis.com/auth/compute.readonly"
  34203. // ]
  34204. // }
  34205. }
  34206. // Pages invokes f for each page of results.
  34207. // A non-nil error returned from f will halt the iteration.
  34208. // The provided context supersedes any context provided to the Context method.
  34209. func (c *MachineTypesAggregatedListCall) Pages(ctx context.Context, f func(*MachineTypeAggregatedList) error) error {
  34210. c.ctx_ = ctx
  34211. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  34212. for {
  34213. x, err := c.Do()
  34214. if err != nil {
  34215. return err
  34216. }
  34217. if err := f(x); err != nil {
  34218. return err
  34219. }
  34220. if x.NextPageToken == "" {
  34221. return nil
  34222. }
  34223. c.PageToken(x.NextPageToken)
  34224. }
  34225. }
  34226. // method id "compute.machineTypes.get":
  34227. type MachineTypesGetCall struct {
  34228. s *Service
  34229. project string
  34230. zone string
  34231. machineType string
  34232. urlParams_ gensupport.URLParams
  34233. ifNoneMatch_ string
  34234. ctx_ context.Context
  34235. header_ http.Header
  34236. }
  34237. // Get: Returns the specified machine type. Get a list of available
  34238. // machine types by making a list() request.
  34239. // For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/get
  34240. func (r *MachineTypesService) Get(project string, zone string, machineType string) *MachineTypesGetCall {
  34241. c := &MachineTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34242. c.project = project
  34243. c.zone = zone
  34244. c.machineType = machineType
  34245. return c
  34246. }
  34247. // Fields allows partial responses to be retrieved. See
  34248. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34249. // for more information.
  34250. func (c *MachineTypesGetCall) Fields(s ...googleapi.Field) *MachineTypesGetCall {
  34251. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34252. return c
  34253. }
  34254. // IfNoneMatch sets the optional parameter which makes the operation
  34255. // fail if the object's ETag matches the given value. This is useful for
  34256. // getting updates only after the object has changed since the last
  34257. // request. Use googleapi.IsNotModified to check whether the response
  34258. // error from Do is the result of In-None-Match.
  34259. func (c *MachineTypesGetCall) IfNoneMatch(entityTag string) *MachineTypesGetCall {
  34260. c.ifNoneMatch_ = entityTag
  34261. return c
  34262. }
  34263. // Context sets the context to be used in this call's Do method. Any
  34264. // pending HTTP request will be aborted if the provided context is
  34265. // canceled.
  34266. func (c *MachineTypesGetCall) Context(ctx context.Context) *MachineTypesGetCall {
  34267. c.ctx_ = ctx
  34268. return c
  34269. }
  34270. // Header returns an http.Header that can be modified by the caller to
  34271. // add HTTP headers to the request.
  34272. func (c *MachineTypesGetCall) Header() http.Header {
  34273. if c.header_ == nil {
  34274. c.header_ = make(http.Header)
  34275. }
  34276. return c.header_
  34277. }
  34278. func (c *MachineTypesGetCall) doRequest(alt string) (*http.Response, error) {
  34279. reqHeaders := make(http.Header)
  34280. for k, v := range c.header_ {
  34281. reqHeaders[k] = v
  34282. }
  34283. reqHeaders.Set("User-Agent", c.s.userAgent())
  34284. if c.ifNoneMatch_ != "" {
  34285. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  34286. }
  34287. var body io.Reader = nil
  34288. c.urlParams_.Set("alt", alt)
  34289. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/machineTypes/{machineType}")
  34290. urls += "?" + c.urlParams_.Encode()
  34291. req, _ := http.NewRequest("GET", urls, body)
  34292. req.Header = reqHeaders
  34293. googleapi.Expand(req.URL, map[string]string{
  34294. "project": c.project,
  34295. "zone": c.zone,
  34296. "machineType": c.machineType,
  34297. })
  34298. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34299. }
  34300. // Do executes the "compute.machineTypes.get" call.
  34301. // Exactly one of *MachineType or error will be non-nil. Any non-2xx
  34302. // status code is an error. Response headers are in either
  34303. // *MachineType.ServerResponse.Header or (if a response was returned at
  34304. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  34305. // to check whether the returned error was because
  34306. // http.StatusNotModified was returned.
  34307. func (c *MachineTypesGetCall) Do(opts ...googleapi.CallOption) (*MachineType, error) {
  34308. gensupport.SetOptions(c.urlParams_, opts...)
  34309. res, err := c.doRequest("json")
  34310. if res != nil && res.StatusCode == http.StatusNotModified {
  34311. if res.Body != nil {
  34312. res.Body.Close()
  34313. }
  34314. return nil, &googleapi.Error{
  34315. Code: res.StatusCode,
  34316. Header: res.Header,
  34317. }
  34318. }
  34319. if err != nil {
  34320. return nil, err
  34321. }
  34322. defer googleapi.CloseBody(res)
  34323. if err := googleapi.CheckResponse(res); err != nil {
  34324. return nil, err
  34325. }
  34326. ret := &MachineType{
  34327. ServerResponse: googleapi.ServerResponse{
  34328. Header: res.Header,
  34329. HTTPStatusCode: res.StatusCode,
  34330. },
  34331. }
  34332. target := &ret
  34333. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  34334. return nil, err
  34335. }
  34336. return ret, nil
  34337. // {
  34338. // "description": "Returns the specified machine type. Get a list of available machine types by making a list() request.",
  34339. // "httpMethod": "GET",
  34340. // "id": "compute.machineTypes.get",
  34341. // "parameterOrder": [
  34342. // "project",
  34343. // "zone",
  34344. // "machineType"
  34345. // ],
  34346. // "parameters": {
  34347. // "machineType": {
  34348. // "description": "Name of the machine type to return.",
  34349. // "location": "path",
  34350. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34351. // "required": true,
  34352. // "type": "string"
  34353. // },
  34354. // "project": {
  34355. // "description": "Project ID for this request.",
  34356. // "location": "path",
  34357. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34358. // "required": true,
  34359. // "type": "string"
  34360. // },
  34361. // "zone": {
  34362. // "description": "The name of the zone for this request.",
  34363. // "location": "path",
  34364. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34365. // "required": true,
  34366. // "type": "string"
  34367. // }
  34368. // },
  34369. // "path": "{project}/zones/{zone}/machineTypes/{machineType}",
  34370. // "response": {
  34371. // "$ref": "MachineType"
  34372. // },
  34373. // "scopes": [
  34374. // "https://www.googleapis.com/auth/cloud-platform",
  34375. // "https://www.googleapis.com/auth/compute",
  34376. // "https://www.googleapis.com/auth/compute.readonly"
  34377. // ]
  34378. // }
  34379. }
  34380. // method id "compute.machineTypes.list":
  34381. type MachineTypesListCall struct {
  34382. s *Service
  34383. project string
  34384. zone string
  34385. urlParams_ gensupport.URLParams
  34386. ifNoneMatch_ string
  34387. ctx_ context.Context
  34388. header_ http.Header
  34389. }
  34390. // List: Retrieves a list of machine types available to the specified
  34391. // project.
  34392. // For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/list
  34393. func (r *MachineTypesService) List(project string, zone string) *MachineTypesListCall {
  34394. c := &MachineTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34395. c.project = project
  34396. c.zone = zone
  34397. return c
  34398. }
  34399. // Filter sets the optional parameter "filter": Sets a filter
  34400. // {expression} for filtering listed resources. Your {expression} must
  34401. // be in the format: field_name comparison_string literal_string.
  34402. //
  34403. // The field_name is the name of the field you want to compare. Only
  34404. // atomic field types are supported (string, number, boolean). The
  34405. // comparison_string must be either eq (equals) or ne (not equals). The
  34406. // literal_string is the string value to filter to. The literal value
  34407. // must be valid for the type of field you are filtering by (string,
  34408. // number, boolean). For string fields, the literal value is interpreted
  34409. // as a regular expression using RE2 syntax. The literal value must
  34410. // match the entire field.
  34411. //
  34412. // For example, to filter for instances that do not have a name of
  34413. // example-instance, you would use name ne example-instance.
  34414. //
  34415. // You can filter on nested fields. For example, you could filter on
  34416. // instances that have set the scheduling.automaticRestart field to
  34417. // true. Use filtering on nested fields to take advantage of labels to
  34418. // organize and search for results based on label values.
  34419. //
  34420. // To filter on multiple expressions, provide each separate expression
  34421. // within parentheses. For example, (scheduling.automaticRestart eq
  34422. // true) (zone eq us-central1-f). Multiple expressions are treated as
  34423. // AND expressions, meaning that resources must match all expressions to
  34424. // pass the filters.
  34425. func (c *MachineTypesListCall) Filter(filter string) *MachineTypesListCall {
  34426. c.urlParams_.Set("filter", filter)
  34427. return c
  34428. }
  34429. // MaxResults sets the optional parameter "maxResults": The maximum
  34430. // number of results per page that should be returned. If the number of
  34431. // available results is larger than maxResults, Compute Engine returns a
  34432. // nextPageToken that can be used to get the next page of results in
  34433. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  34434. // (Default: 500)
  34435. func (c *MachineTypesListCall) MaxResults(maxResults int64) *MachineTypesListCall {
  34436. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  34437. return c
  34438. }
  34439. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  34440. // a certain order. By default, results are returned in alphanumerical
  34441. // order based on the resource name.
  34442. //
  34443. // You can also sort results in descending order based on the creation
  34444. // timestamp using orderBy="creationTimestamp desc". This sorts results
  34445. // based on the creationTimestamp field in reverse chronological order
  34446. // (newest result first). Use this to sort resources like operations so
  34447. // that the newest operation is returned first.
  34448. //
  34449. // Currently, only sorting by name or creationTimestamp desc is
  34450. // supported.
  34451. func (c *MachineTypesListCall) OrderBy(orderBy string) *MachineTypesListCall {
  34452. c.urlParams_.Set("orderBy", orderBy)
  34453. return c
  34454. }
  34455. // PageToken sets the optional parameter "pageToken": Specifies a page
  34456. // token to use. Set pageToken to the nextPageToken returned by a
  34457. // previous list request to get the next page of results.
  34458. func (c *MachineTypesListCall) PageToken(pageToken string) *MachineTypesListCall {
  34459. c.urlParams_.Set("pageToken", pageToken)
  34460. return c
  34461. }
  34462. // Fields allows partial responses to be retrieved. See
  34463. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34464. // for more information.
  34465. func (c *MachineTypesListCall) Fields(s ...googleapi.Field) *MachineTypesListCall {
  34466. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34467. return c
  34468. }
  34469. // IfNoneMatch sets the optional parameter which makes the operation
  34470. // fail if the object's ETag matches the given value. This is useful for
  34471. // getting updates only after the object has changed since the last
  34472. // request. Use googleapi.IsNotModified to check whether the response
  34473. // error from Do is the result of In-None-Match.
  34474. func (c *MachineTypesListCall) IfNoneMatch(entityTag string) *MachineTypesListCall {
  34475. c.ifNoneMatch_ = entityTag
  34476. return c
  34477. }
  34478. // Context sets the context to be used in this call's Do method. Any
  34479. // pending HTTP request will be aborted if the provided context is
  34480. // canceled.
  34481. func (c *MachineTypesListCall) Context(ctx context.Context) *MachineTypesListCall {
  34482. c.ctx_ = ctx
  34483. return c
  34484. }
  34485. // Header returns an http.Header that can be modified by the caller to
  34486. // add HTTP headers to the request.
  34487. func (c *MachineTypesListCall) Header() http.Header {
  34488. if c.header_ == nil {
  34489. c.header_ = make(http.Header)
  34490. }
  34491. return c.header_
  34492. }
  34493. func (c *MachineTypesListCall) doRequest(alt string) (*http.Response, error) {
  34494. reqHeaders := make(http.Header)
  34495. for k, v := range c.header_ {
  34496. reqHeaders[k] = v
  34497. }
  34498. reqHeaders.Set("User-Agent", c.s.userAgent())
  34499. if c.ifNoneMatch_ != "" {
  34500. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  34501. }
  34502. var body io.Reader = nil
  34503. c.urlParams_.Set("alt", alt)
  34504. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/machineTypes")
  34505. urls += "?" + c.urlParams_.Encode()
  34506. req, _ := http.NewRequest("GET", urls, body)
  34507. req.Header = reqHeaders
  34508. googleapi.Expand(req.URL, map[string]string{
  34509. "project": c.project,
  34510. "zone": c.zone,
  34511. })
  34512. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34513. }
  34514. // Do executes the "compute.machineTypes.list" call.
  34515. // Exactly one of *MachineTypeList or error will be non-nil. Any non-2xx
  34516. // status code is an error. Response headers are in either
  34517. // *MachineTypeList.ServerResponse.Header or (if a response was returned
  34518. // at all) in error.(*googleapi.Error).Header. Use
  34519. // googleapi.IsNotModified to check whether the returned error was
  34520. // because http.StatusNotModified was returned.
  34521. func (c *MachineTypesListCall) Do(opts ...googleapi.CallOption) (*MachineTypeList, error) {
  34522. gensupport.SetOptions(c.urlParams_, opts...)
  34523. res, err := c.doRequest("json")
  34524. if res != nil && res.StatusCode == http.StatusNotModified {
  34525. if res.Body != nil {
  34526. res.Body.Close()
  34527. }
  34528. return nil, &googleapi.Error{
  34529. Code: res.StatusCode,
  34530. Header: res.Header,
  34531. }
  34532. }
  34533. if err != nil {
  34534. return nil, err
  34535. }
  34536. defer googleapi.CloseBody(res)
  34537. if err := googleapi.CheckResponse(res); err != nil {
  34538. return nil, err
  34539. }
  34540. ret := &MachineTypeList{
  34541. ServerResponse: googleapi.ServerResponse{
  34542. Header: res.Header,
  34543. HTTPStatusCode: res.StatusCode,
  34544. },
  34545. }
  34546. target := &ret
  34547. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  34548. return nil, err
  34549. }
  34550. return ret, nil
  34551. // {
  34552. // "description": "Retrieves a list of machine types available to the specified project.",
  34553. // "httpMethod": "GET",
  34554. // "id": "compute.machineTypes.list",
  34555. // "parameterOrder": [
  34556. // "project",
  34557. // "zone"
  34558. // ],
  34559. // "parameters": {
  34560. // "filter": {
  34561. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  34562. // "location": "query",
  34563. // "type": "string"
  34564. // },
  34565. // "maxResults": {
  34566. // "default": "500",
  34567. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  34568. // "format": "uint32",
  34569. // "location": "query",
  34570. // "minimum": "0",
  34571. // "type": "integer"
  34572. // },
  34573. // "orderBy": {
  34574. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  34575. // "location": "query",
  34576. // "type": "string"
  34577. // },
  34578. // "pageToken": {
  34579. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  34580. // "location": "query",
  34581. // "type": "string"
  34582. // },
  34583. // "project": {
  34584. // "description": "Project ID for this request.",
  34585. // "location": "path",
  34586. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34587. // "required": true,
  34588. // "type": "string"
  34589. // },
  34590. // "zone": {
  34591. // "description": "The name of the zone for this request.",
  34592. // "location": "path",
  34593. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34594. // "required": true,
  34595. // "type": "string"
  34596. // }
  34597. // },
  34598. // "path": "{project}/zones/{zone}/machineTypes",
  34599. // "response": {
  34600. // "$ref": "MachineTypeList"
  34601. // },
  34602. // "scopes": [
  34603. // "https://www.googleapis.com/auth/cloud-platform",
  34604. // "https://www.googleapis.com/auth/compute",
  34605. // "https://www.googleapis.com/auth/compute.readonly"
  34606. // ]
  34607. // }
  34608. }
  34609. // Pages invokes f for each page of results.
  34610. // A non-nil error returned from f will halt the iteration.
  34611. // The provided context supersedes any context provided to the Context method.
  34612. func (c *MachineTypesListCall) Pages(ctx context.Context, f func(*MachineTypeList) error) error {
  34613. c.ctx_ = ctx
  34614. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  34615. for {
  34616. x, err := c.Do()
  34617. if err != nil {
  34618. return err
  34619. }
  34620. if err := f(x); err != nil {
  34621. return err
  34622. }
  34623. if x.NextPageToken == "" {
  34624. return nil
  34625. }
  34626. c.PageToken(x.NextPageToken)
  34627. }
  34628. }
  34629. // method id "compute.networks.addPeering":
  34630. type NetworksAddPeeringCall struct {
  34631. s *Service
  34632. project string
  34633. network string
  34634. networksaddpeeringrequest *NetworksAddPeeringRequest
  34635. urlParams_ gensupport.URLParams
  34636. ctx_ context.Context
  34637. header_ http.Header
  34638. }
  34639. // AddPeering: Adds a peering to the specified network.
  34640. func (r *NetworksService) AddPeering(project string, network string, networksaddpeeringrequest *NetworksAddPeeringRequest) *NetworksAddPeeringCall {
  34641. c := &NetworksAddPeeringCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34642. c.project = project
  34643. c.network = network
  34644. c.networksaddpeeringrequest = networksaddpeeringrequest
  34645. return c
  34646. }
  34647. // Fields allows partial responses to be retrieved. See
  34648. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34649. // for more information.
  34650. func (c *NetworksAddPeeringCall) Fields(s ...googleapi.Field) *NetworksAddPeeringCall {
  34651. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34652. return c
  34653. }
  34654. // Context sets the context to be used in this call's Do method. Any
  34655. // pending HTTP request will be aborted if the provided context is
  34656. // canceled.
  34657. func (c *NetworksAddPeeringCall) Context(ctx context.Context) *NetworksAddPeeringCall {
  34658. c.ctx_ = ctx
  34659. return c
  34660. }
  34661. // Header returns an http.Header that can be modified by the caller to
  34662. // add HTTP headers to the request.
  34663. func (c *NetworksAddPeeringCall) Header() http.Header {
  34664. if c.header_ == nil {
  34665. c.header_ = make(http.Header)
  34666. }
  34667. return c.header_
  34668. }
  34669. func (c *NetworksAddPeeringCall) doRequest(alt string) (*http.Response, error) {
  34670. reqHeaders := make(http.Header)
  34671. for k, v := range c.header_ {
  34672. reqHeaders[k] = v
  34673. }
  34674. reqHeaders.Set("User-Agent", c.s.userAgent())
  34675. var body io.Reader = nil
  34676. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networksaddpeeringrequest)
  34677. if err != nil {
  34678. return nil, err
  34679. }
  34680. reqHeaders.Set("Content-Type", "application/json")
  34681. c.urlParams_.Set("alt", alt)
  34682. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/addPeering")
  34683. urls += "?" + c.urlParams_.Encode()
  34684. req, _ := http.NewRequest("POST", urls, body)
  34685. req.Header = reqHeaders
  34686. googleapi.Expand(req.URL, map[string]string{
  34687. "project": c.project,
  34688. "network": c.network,
  34689. })
  34690. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34691. }
  34692. // Do executes the "compute.networks.addPeering" call.
  34693. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  34694. // status code is an error. Response headers are in either
  34695. // *Operation.ServerResponse.Header or (if a response was returned at
  34696. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  34697. // to check whether the returned error was because
  34698. // http.StatusNotModified was returned.
  34699. func (c *NetworksAddPeeringCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  34700. gensupport.SetOptions(c.urlParams_, opts...)
  34701. res, err := c.doRequest("json")
  34702. if res != nil && res.StatusCode == http.StatusNotModified {
  34703. if res.Body != nil {
  34704. res.Body.Close()
  34705. }
  34706. return nil, &googleapi.Error{
  34707. Code: res.StatusCode,
  34708. Header: res.Header,
  34709. }
  34710. }
  34711. if err != nil {
  34712. return nil, err
  34713. }
  34714. defer googleapi.CloseBody(res)
  34715. if err := googleapi.CheckResponse(res); err != nil {
  34716. return nil, err
  34717. }
  34718. ret := &Operation{
  34719. ServerResponse: googleapi.ServerResponse{
  34720. Header: res.Header,
  34721. HTTPStatusCode: res.StatusCode,
  34722. },
  34723. }
  34724. target := &ret
  34725. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  34726. return nil, err
  34727. }
  34728. return ret, nil
  34729. // {
  34730. // "description": "Adds a peering to the specified network.",
  34731. // "httpMethod": "POST",
  34732. // "id": "compute.networks.addPeering",
  34733. // "parameterOrder": [
  34734. // "project",
  34735. // "network"
  34736. // ],
  34737. // "parameters": {
  34738. // "network": {
  34739. // "description": "Name of the network resource to add peering to.",
  34740. // "location": "path",
  34741. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34742. // "required": true,
  34743. // "type": "string"
  34744. // },
  34745. // "project": {
  34746. // "description": "Project ID for this request.",
  34747. // "location": "path",
  34748. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34749. // "required": true,
  34750. // "type": "string"
  34751. // }
  34752. // },
  34753. // "path": "{project}/global/networks/{network}/addPeering",
  34754. // "request": {
  34755. // "$ref": "NetworksAddPeeringRequest"
  34756. // },
  34757. // "response": {
  34758. // "$ref": "Operation"
  34759. // },
  34760. // "scopes": [
  34761. // "https://www.googleapis.com/auth/cloud-platform",
  34762. // "https://www.googleapis.com/auth/compute"
  34763. // ]
  34764. // }
  34765. }
  34766. // method id "compute.networks.delete":
  34767. type NetworksDeleteCall struct {
  34768. s *Service
  34769. project string
  34770. network string
  34771. urlParams_ gensupport.URLParams
  34772. ctx_ context.Context
  34773. header_ http.Header
  34774. }
  34775. // Delete: Deletes the specified network.
  34776. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/delete
  34777. func (r *NetworksService) Delete(project string, network string) *NetworksDeleteCall {
  34778. c := &NetworksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34779. c.project = project
  34780. c.network = network
  34781. return c
  34782. }
  34783. // Fields allows partial responses to be retrieved. See
  34784. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34785. // for more information.
  34786. func (c *NetworksDeleteCall) Fields(s ...googleapi.Field) *NetworksDeleteCall {
  34787. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34788. return c
  34789. }
  34790. // Context sets the context to be used in this call's Do method. Any
  34791. // pending HTTP request will be aborted if the provided context is
  34792. // canceled.
  34793. func (c *NetworksDeleteCall) Context(ctx context.Context) *NetworksDeleteCall {
  34794. c.ctx_ = ctx
  34795. return c
  34796. }
  34797. // Header returns an http.Header that can be modified by the caller to
  34798. // add HTTP headers to the request.
  34799. func (c *NetworksDeleteCall) Header() http.Header {
  34800. if c.header_ == nil {
  34801. c.header_ = make(http.Header)
  34802. }
  34803. return c.header_
  34804. }
  34805. func (c *NetworksDeleteCall) doRequest(alt string) (*http.Response, error) {
  34806. reqHeaders := make(http.Header)
  34807. for k, v := range c.header_ {
  34808. reqHeaders[k] = v
  34809. }
  34810. reqHeaders.Set("User-Agent", c.s.userAgent())
  34811. var body io.Reader = nil
  34812. c.urlParams_.Set("alt", alt)
  34813. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}")
  34814. urls += "?" + c.urlParams_.Encode()
  34815. req, _ := http.NewRequest("DELETE", urls, body)
  34816. req.Header = reqHeaders
  34817. googleapi.Expand(req.URL, map[string]string{
  34818. "project": c.project,
  34819. "network": c.network,
  34820. })
  34821. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34822. }
  34823. // Do executes the "compute.networks.delete" call.
  34824. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  34825. // status code is an error. Response headers are in either
  34826. // *Operation.ServerResponse.Header or (if a response was returned at
  34827. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  34828. // to check whether the returned error was because
  34829. // http.StatusNotModified was returned.
  34830. func (c *NetworksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  34831. gensupport.SetOptions(c.urlParams_, opts...)
  34832. res, err := c.doRequest("json")
  34833. if res != nil && res.StatusCode == http.StatusNotModified {
  34834. if res.Body != nil {
  34835. res.Body.Close()
  34836. }
  34837. return nil, &googleapi.Error{
  34838. Code: res.StatusCode,
  34839. Header: res.Header,
  34840. }
  34841. }
  34842. if err != nil {
  34843. return nil, err
  34844. }
  34845. defer googleapi.CloseBody(res)
  34846. if err := googleapi.CheckResponse(res); err != nil {
  34847. return nil, err
  34848. }
  34849. ret := &Operation{
  34850. ServerResponse: googleapi.ServerResponse{
  34851. Header: res.Header,
  34852. HTTPStatusCode: res.StatusCode,
  34853. },
  34854. }
  34855. target := &ret
  34856. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  34857. return nil, err
  34858. }
  34859. return ret, nil
  34860. // {
  34861. // "description": "Deletes the specified network.",
  34862. // "httpMethod": "DELETE",
  34863. // "id": "compute.networks.delete",
  34864. // "parameterOrder": [
  34865. // "project",
  34866. // "network"
  34867. // ],
  34868. // "parameters": {
  34869. // "network": {
  34870. // "description": "Name of the network to delete.",
  34871. // "location": "path",
  34872. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34873. // "required": true,
  34874. // "type": "string"
  34875. // },
  34876. // "project": {
  34877. // "description": "Project ID for this request.",
  34878. // "location": "path",
  34879. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34880. // "required": true,
  34881. // "type": "string"
  34882. // }
  34883. // },
  34884. // "path": "{project}/global/networks/{network}",
  34885. // "response": {
  34886. // "$ref": "Operation"
  34887. // },
  34888. // "scopes": [
  34889. // "https://www.googleapis.com/auth/cloud-platform",
  34890. // "https://www.googleapis.com/auth/compute"
  34891. // ]
  34892. // }
  34893. }
  34894. // method id "compute.networks.get":
  34895. type NetworksGetCall struct {
  34896. s *Service
  34897. project string
  34898. network string
  34899. urlParams_ gensupport.URLParams
  34900. ifNoneMatch_ string
  34901. ctx_ context.Context
  34902. header_ http.Header
  34903. }
  34904. // Get: Returns the specified network. Get a list of available networks
  34905. // by making a list() request.
  34906. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/get
  34907. func (r *NetworksService) Get(project string, network string) *NetworksGetCall {
  34908. c := &NetworksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34909. c.project = project
  34910. c.network = network
  34911. return c
  34912. }
  34913. // Fields allows partial responses to be retrieved. See
  34914. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34915. // for more information.
  34916. func (c *NetworksGetCall) Fields(s ...googleapi.Field) *NetworksGetCall {
  34917. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34918. return c
  34919. }
  34920. // IfNoneMatch sets the optional parameter which makes the operation
  34921. // fail if the object's ETag matches the given value. This is useful for
  34922. // getting updates only after the object has changed since the last
  34923. // request. Use googleapi.IsNotModified to check whether the response
  34924. // error from Do is the result of In-None-Match.
  34925. func (c *NetworksGetCall) IfNoneMatch(entityTag string) *NetworksGetCall {
  34926. c.ifNoneMatch_ = entityTag
  34927. return c
  34928. }
  34929. // Context sets the context to be used in this call's Do method. Any
  34930. // pending HTTP request will be aborted if the provided context is
  34931. // canceled.
  34932. func (c *NetworksGetCall) Context(ctx context.Context) *NetworksGetCall {
  34933. c.ctx_ = ctx
  34934. return c
  34935. }
  34936. // Header returns an http.Header that can be modified by the caller to
  34937. // add HTTP headers to the request.
  34938. func (c *NetworksGetCall) Header() http.Header {
  34939. if c.header_ == nil {
  34940. c.header_ = make(http.Header)
  34941. }
  34942. return c.header_
  34943. }
  34944. func (c *NetworksGetCall) doRequest(alt string) (*http.Response, error) {
  34945. reqHeaders := make(http.Header)
  34946. for k, v := range c.header_ {
  34947. reqHeaders[k] = v
  34948. }
  34949. reqHeaders.Set("User-Agent", c.s.userAgent())
  34950. if c.ifNoneMatch_ != "" {
  34951. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  34952. }
  34953. var body io.Reader = nil
  34954. c.urlParams_.Set("alt", alt)
  34955. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}")
  34956. urls += "?" + c.urlParams_.Encode()
  34957. req, _ := http.NewRequest("GET", urls, body)
  34958. req.Header = reqHeaders
  34959. googleapi.Expand(req.URL, map[string]string{
  34960. "project": c.project,
  34961. "network": c.network,
  34962. })
  34963. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34964. }
  34965. // Do executes the "compute.networks.get" call.
  34966. // Exactly one of *Network or error will be non-nil. Any non-2xx status
  34967. // code is an error. Response headers are in either
  34968. // *Network.ServerResponse.Header or (if a response was returned at all)
  34969. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  34970. // check whether the returned error was because http.StatusNotModified
  34971. // was returned.
  34972. func (c *NetworksGetCall) Do(opts ...googleapi.CallOption) (*Network, error) {
  34973. gensupport.SetOptions(c.urlParams_, opts...)
  34974. res, err := c.doRequest("json")
  34975. if res != nil && res.StatusCode == http.StatusNotModified {
  34976. if res.Body != nil {
  34977. res.Body.Close()
  34978. }
  34979. return nil, &googleapi.Error{
  34980. Code: res.StatusCode,
  34981. Header: res.Header,
  34982. }
  34983. }
  34984. if err != nil {
  34985. return nil, err
  34986. }
  34987. defer googleapi.CloseBody(res)
  34988. if err := googleapi.CheckResponse(res); err != nil {
  34989. return nil, err
  34990. }
  34991. ret := &Network{
  34992. ServerResponse: googleapi.ServerResponse{
  34993. Header: res.Header,
  34994. HTTPStatusCode: res.StatusCode,
  34995. },
  34996. }
  34997. target := &ret
  34998. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  34999. return nil, err
  35000. }
  35001. return ret, nil
  35002. // {
  35003. // "description": "Returns the specified network. Get a list of available networks by making a list() request.",
  35004. // "httpMethod": "GET",
  35005. // "id": "compute.networks.get",
  35006. // "parameterOrder": [
  35007. // "project",
  35008. // "network"
  35009. // ],
  35010. // "parameters": {
  35011. // "network": {
  35012. // "description": "Name of the network to return.",
  35013. // "location": "path",
  35014. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  35015. // "required": true,
  35016. // "type": "string"
  35017. // },
  35018. // "project": {
  35019. // "description": "Project ID for this request.",
  35020. // "location": "path",
  35021. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35022. // "required": true,
  35023. // "type": "string"
  35024. // }
  35025. // },
  35026. // "path": "{project}/global/networks/{network}",
  35027. // "response": {
  35028. // "$ref": "Network"
  35029. // },
  35030. // "scopes": [
  35031. // "https://www.googleapis.com/auth/cloud-platform",
  35032. // "https://www.googleapis.com/auth/compute",
  35033. // "https://www.googleapis.com/auth/compute.readonly"
  35034. // ]
  35035. // }
  35036. }
  35037. // method id "compute.networks.insert":
  35038. type NetworksInsertCall struct {
  35039. s *Service
  35040. project string
  35041. network *Network
  35042. urlParams_ gensupport.URLParams
  35043. ctx_ context.Context
  35044. header_ http.Header
  35045. }
  35046. // Insert: Creates a network in the specified project using the data
  35047. // included in the request.
  35048. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/insert
  35049. func (r *NetworksService) Insert(project string, network *Network) *NetworksInsertCall {
  35050. c := &NetworksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35051. c.project = project
  35052. c.network = network
  35053. return c
  35054. }
  35055. // Fields allows partial responses to be retrieved. See
  35056. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35057. // for more information.
  35058. func (c *NetworksInsertCall) Fields(s ...googleapi.Field) *NetworksInsertCall {
  35059. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35060. return c
  35061. }
  35062. // Context sets the context to be used in this call's Do method. Any
  35063. // pending HTTP request will be aborted if the provided context is
  35064. // canceled.
  35065. func (c *NetworksInsertCall) Context(ctx context.Context) *NetworksInsertCall {
  35066. c.ctx_ = ctx
  35067. return c
  35068. }
  35069. // Header returns an http.Header that can be modified by the caller to
  35070. // add HTTP headers to the request.
  35071. func (c *NetworksInsertCall) Header() http.Header {
  35072. if c.header_ == nil {
  35073. c.header_ = make(http.Header)
  35074. }
  35075. return c.header_
  35076. }
  35077. func (c *NetworksInsertCall) doRequest(alt string) (*http.Response, error) {
  35078. reqHeaders := make(http.Header)
  35079. for k, v := range c.header_ {
  35080. reqHeaders[k] = v
  35081. }
  35082. reqHeaders.Set("User-Agent", c.s.userAgent())
  35083. var body io.Reader = nil
  35084. body, err := googleapi.WithoutDataWrapper.JSONReader(c.network)
  35085. if err != nil {
  35086. return nil, err
  35087. }
  35088. reqHeaders.Set("Content-Type", "application/json")
  35089. c.urlParams_.Set("alt", alt)
  35090. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks")
  35091. urls += "?" + c.urlParams_.Encode()
  35092. req, _ := http.NewRequest("POST", urls, body)
  35093. req.Header = reqHeaders
  35094. googleapi.Expand(req.URL, map[string]string{
  35095. "project": c.project,
  35096. })
  35097. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35098. }
  35099. // Do executes the "compute.networks.insert" call.
  35100. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  35101. // status code is an error. Response headers are in either
  35102. // *Operation.ServerResponse.Header or (if a response was returned at
  35103. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35104. // to check whether the returned error was because
  35105. // http.StatusNotModified was returned.
  35106. func (c *NetworksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  35107. gensupport.SetOptions(c.urlParams_, opts...)
  35108. res, err := c.doRequest("json")
  35109. if res != nil && res.StatusCode == http.StatusNotModified {
  35110. if res.Body != nil {
  35111. res.Body.Close()
  35112. }
  35113. return nil, &googleapi.Error{
  35114. Code: res.StatusCode,
  35115. Header: res.Header,
  35116. }
  35117. }
  35118. if err != nil {
  35119. return nil, err
  35120. }
  35121. defer googleapi.CloseBody(res)
  35122. if err := googleapi.CheckResponse(res); err != nil {
  35123. return nil, err
  35124. }
  35125. ret := &Operation{
  35126. ServerResponse: googleapi.ServerResponse{
  35127. Header: res.Header,
  35128. HTTPStatusCode: res.StatusCode,
  35129. },
  35130. }
  35131. target := &ret
  35132. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  35133. return nil, err
  35134. }
  35135. return ret, nil
  35136. // {
  35137. // "description": "Creates a network in the specified project using the data included in the request.",
  35138. // "httpMethod": "POST",
  35139. // "id": "compute.networks.insert",
  35140. // "parameterOrder": [
  35141. // "project"
  35142. // ],
  35143. // "parameters": {
  35144. // "project": {
  35145. // "description": "Project ID for this request.",
  35146. // "location": "path",
  35147. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35148. // "required": true,
  35149. // "type": "string"
  35150. // }
  35151. // },
  35152. // "path": "{project}/global/networks",
  35153. // "request": {
  35154. // "$ref": "Network"
  35155. // },
  35156. // "response": {
  35157. // "$ref": "Operation"
  35158. // },
  35159. // "scopes": [
  35160. // "https://www.googleapis.com/auth/cloud-platform",
  35161. // "https://www.googleapis.com/auth/compute"
  35162. // ]
  35163. // }
  35164. }
  35165. // method id "compute.networks.list":
  35166. type NetworksListCall struct {
  35167. s *Service
  35168. project string
  35169. urlParams_ gensupport.URLParams
  35170. ifNoneMatch_ string
  35171. ctx_ context.Context
  35172. header_ http.Header
  35173. }
  35174. // List: Retrieves the list of networks available to the specified
  35175. // project.
  35176. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/list
  35177. func (r *NetworksService) List(project string) *NetworksListCall {
  35178. c := &NetworksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35179. c.project = project
  35180. return c
  35181. }
  35182. // Filter sets the optional parameter "filter": Sets a filter
  35183. // {expression} for filtering listed resources. Your {expression} must
  35184. // be in the format: field_name comparison_string literal_string.
  35185. //
  35186. // The field_name is the name of the field you want to compare. Only
  35187. // atomic field types are supported (string, number, boolean). The
  35188. // comparison_string must be either eq (equals) or ne (not equals). The
  35189. // literal_string is the string value to filter to. The literal value
  35190. // must be valid for the type of field you are filtering by (string,
  35191. // number, boolean). For string fields, the literal value is interpreted
  35192. // as a regular expression using RE2 syntax. The literal value must
  35193. // match the entire field.
  35194. //
  35195. // For example, to filter for instances that do not have a name of
  35196. // example-instance, you would use name ne example-instance.
  35197. //
  35198. // You can filter on nested fields. For example, you could filter on
  35199. // instances that have set the scheduling.automaticRestart field to
  35200. // true. Use filtering on nested fields to take advantage of labels to
  35201. // organize and search for results based on label values.
  35202. //
  35203. // To filter on multiple expressions, provide each separate expression
  35204. // within parentheses. For example, (scheduling.automaticRestart eq
  35205. // true) (zone eq us-central1-f). Multiple expressions are treated as
  35206. // AND expressions, meaning that resources must match all expressions to
  35207. // pass the filters.
  35208. func (c *NetworksListCall) Filter(filter string) *NetworksListCall {
  35209. c.urlParams_.Set("filter", filter)
  35210. return c
  35211. }
  35212. // MaxResults sets the optional parameter "maxResults": The maximum
  35213. // number of results per page that should be returned. If the number of
  35214. // available results is larger than maxResults, Compute Engine returns a
  35215. // nextPageToken that can be used to get the next page of results in
  35216. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  35217. // (Default: 500)
  35218. func (c *NetworksListCall) MaxResults(maxResults int64) *NetworksListCall {
  35219. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  35220. return c
  35221. }
  35222. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  35223. // a certain order. By default, results are returned in alphanumerical
  35224. // order based on the resource name.
  35225. //
  35226. // You can also sort results in descending order based on the creation
  35227. // timestamp using orderBy="creationTimestamp desc". This sorts results
  35228. // based on the creationTimestamp field in reverse chronological order
  35229. // (newest result first). Use this to sort resources like operations so
  35230. // that the newest operation is returned first.
  35231. //
  35232. // Currently, only sorting by name or creationTimestamp desc is
  35233. // supported.
  35234. func (c *NetworksListCall) OrderBy(orderBy string) *NetworksListCall {
  35235. c.urlParams_.Set("orderBy", orderBy)
  35236. return c
  35237. }
  35238. // PageToken sets the optional parameter "pageToken": Specifies a page
  35239. // token to use. Set pageToken to the nextPageToken returned by a
  35240. // previous list request to get the next page of results.
  35241. func (c *NetworksListCall) PageToken(pageToken string) *NetworksListCall {
  35242. c.urlParams_.Set("pageToken", pageToken)
  35243. return c
  35244. }
  35245. // Fields allows partial responses to be retrieved. See
  35246. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35247. // for more information.
  35248. func (c *NetworksListCall) Fields(s ...googleapi.Field) *NetworksListCall {
  35249. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35250. return c
  35251. }
  35252. // IfNoneMatch sets the optional parameter which makes the operation
  35253. // fail if the object's ETag matches the given value. This is useful for
  35254. // getting updates only after the object has changed since the last
  35255. // request. Use googleapi.IsNotModified to check whether the response
  35256. // error from Do is the result of In-None-Match.
  35257. func (c *NetworksListCall) IfNoneMatch(entityTag string) *NetworksListCall {
  35258. c.ifNoneMatch_ = entityTag
  35259. return c
  35260. }
  35261. // Context sets the context to be used in this call's Do method. Any
  35262. // pending HTTP request will be aborted if the provided context is
  35263. // canceled.
  35264. func (c *NetworksListCall) Context(ctx context.Context) *NetworksListCall {
  35265. c.ctx_ = ctx
  35266. return c
  35267. }
  35268. // Header returns an http.Header that can be modified by the caller to
  35269. // add HTTP headers to the request.
  35270. func (c *NetworksListCall) Header() http.Header {
  35271. if c.header_ == nil {
  35272. c.header_ = make(http.Header)
  35273. }
  35274. return c.header_
  35275. }
  35276. func (c *NetworksListCall) doRequest(alt string) (*http.Response, error) {
  35277. reqHeaders := make(http.Header)
  35278. for k, v := range c.header_ {
  35279. reqHeaders[k] = v
  35280. }
  35281. reqHeaders.Set("User-Agent", c.s.userAgent())
  35282. if c.ifNoneMatch_ != "" {
  35283. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  35284. }
  35285. var body io.Reader = nil
  35286. c.urlParams_.Set("alt", alt)
  35287. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks")
  35288. urls += "?" + c.urlParams_.Encode()
  35289. req, _ := http.NewRequest("GET", urls, body)
  35290. req.Header = reqHeaders
  35291. googleapi.Expand(req.URL, map[string]string{
  35292. "project": c.project,
  35293. })
  35294. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35295. }
  35296. // Do executes the "compute.networks.list" call.
  35297. // Exactly one of *NetworkList or error will be non-nil. Any non-2xx
  35298. // status code is an error. Response headers are in either
  35299. // *NetworkList.ServerResponse.Header or (if a response was returned at
  35300. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35301. // to check whether the returned error was because
  35302. // http.StatusNotModified was returned.
  35303. func (c *NetworksListCall) Do(opts ...googleapi.CallOption) (*NetworkList, error) {
  35304. gensupport.SetOptions(c.urlParams_, opts...)
  35305. res, err := c.doRequest("json")
  35306. if res != nil && res.StatusCode == http.StatusNotModified {
  35307. if res.Body != nil {
  35308. res.Body.Close()
  35309. }
  35310. return nil, &googleapi.Error{
  35311. Code: res.StatusCode,
  35312. Header: res.Header,
  35313. }
  35314. }
  35315. if err != nil {
  35316. return nil, err
  35317. }
  35318. defer googleapi.CloseBody(res)
  35319. if err := googleapi.CheckResponse(res); err != nil {
  35320. return nil, err
  35321. }
  35322. ret := &NetworkList{
  35323. ServerResponse: googleapi.ServerResponse{
  35324. Header: res.Header,
  35325. HTTPStatusCode: res.StatusCode,
  35326. },
  35327. }
  35328. target := &ret
  35329. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  35330. return nil, err
  35331. }
  35332. return ret, nil
  35333. // {
  35334. // "description": "Retrieves the list of networks available to the specified project.",
  35335. // "httpMethod": "GET",
  35336. // "id": "compute.networks.list",
  35337. // "parameterOrder": [
  35338. // "project"
  35339. // ],
  35340. // "parameters": {
  35341. // "filter": {
  35342. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  35343. // "location": "query",
  35344. // "type": "string"
  35345. // },
  35346. // "maxResults": {
  35347. // "default": "500",
  35348. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  35349. // "format": "uint32",
  35350. // "location": "query",
  35351. // "minimum": "0",
  35352. // "type": "integer"
  35353. // },
  35354. // "orderBy": {
  35355. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  35356. // "location": "query",
  35357. // "type": "string"
  35358. // },
  35359. // "pageToken": {
  35360. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  35361. // "location": "query",
  35362. // "type": "string"
  35363. // },
  35364. // "project": {
  35365. // "description": "Project ID for this request.",
  35366. // "location": "path",
  35367. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35368. // "required": true,
  35369. // "type": "string"
  35370. // }
  35371. // },
  35372. // "path": "{project}/global/networks",
  35373. // "response": {
  35374. // "$ref": "NetworkList"
  35375. // },
  35376. // "scopes": [
  35377. // "https://www.googleapis.com/auth/cloud-platform",
  35378. // "https://www.googleapis.com/auth/compute",
  35379. // "https://www.googleapis.com/auth/compute.readonly"
  35380. // ]
  35381. // }
  35382. }
  35383. // Pages invokes f for each page of results.
  35384. // A non-nil error returned from f will halt the iteration.
  35385. // The provided context supersedes any context provided to the Context method.
  35386. func (c *NetworksListCall) Pages(ctx context.Context, f func(*NetworkList) error) error {
  35387. c.ctx_ = ctx
  35388. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  35389. for {
  35390. x, err := c.Do()
  35391. if err != nil {
  35392. return err
  35393. }
  35394. if err := f(x); err != nil {
  35395. return err
  35396. }
  35397. if x.NextPageToken == "" {
  35398. return nil
  35399. }
  35400. c.PageToken(x.NextPageToken)
  35401. }
  35402. }
  35403. // method id "compute.networks.removePeering":
  35404. type NetworksRemovePeeringCall struct {
  35405. s *Service
  35406. project string
  35407. network string
  35408. networksremovepeeringrequest *NetworksRemovePeeringRequest
  35409. urlParams_ gensupport.URLParams
  35410. ctx_ context.Context
  35411. header_ http.Header
  35412. }
  35413. // RemovePeering: Removes a peering from the specified network.
  35414. func (r *NetworksService) RemovePeering(project string, network string, networksremovepeeringrequest *NetworksRemovePeeringRequest) *NetworksRemovePeeringCall {
  35415. c := &NetworksRemovePeeringCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35416. c.project = project
  35417. c.network = network
  35418. c.networksremovepeeringrequest = networksremovepeeringrequest
  35419. return c
  35420. }
  35421. // Fields allows partial responses to be retrieved. See
  35422. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35423. // for more information.
  35424. func (c *NetworksRemovePeeringCall) Fields(s ...googleapi.Field) *NetworksRemovePeeringCall {
  35425. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35426. return c
  35427. }
  35428. // Context sets the context to be used in this call's Do method. Any
  35429. // pending HTTP request will be aborted if the provided context is
  35430. // canceled.
  35431. func (c *NetworksRemovePeeringCall) Context(ctx context.Context) *NetworksRemovePeeringCall {
  35432. c.ctx_ = ctx
  35433. return c
  35434. }
  35435. // Header returns an http.Header that can be modified by the caller to
  35436. // add HTTP headers to the request.
  35437. func (c *NetworksRemovePeeringCall) Header() http.Header {
  35438. if c.header_ == nil {
  35439. c.header_ = make(http.Header)
  35440. }
  35441. return c.header_
  35442. }
  35443. func (c *NetworksRemovePeeringCall) doRequest(alt string) (*http.Response, error) {
  35444. reqHeaders := make(http.Header)
  35445. for k, v := range c.header_ {
  35446. reqHeaders[k] = v
  35447. }
  35448. reqHeaders.Set("User-Agent", c.s.userAgent())
  35449. var body io.Reader = nil
  35450. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networksremovepeeringrequest)
  35451. if err != nil {
  35452. return nil, err
  35453. }
  35454. reqHeaders.Set("Content-Type", "application/json")
  35455. c.urlParams_.Set("alt", alt)
  35456. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/removePeering")
  35457. urls += "?" + c.urlParams_.Encode()
  35458. req, _ := http.NewRequest("POST", urls, body)
  35459. req.Header = reqHeaders
  35460. googleapi.Expand(req.URL, map[string]string{
  35461. "project": c.project,
  35462. "network": c.network,
  35463. })
  35464. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35465. }
  35466. // Do executes the "compute.networks.removePeering" call.
  35467. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  35468. // status code is an error. Response headers are in either
  35469. // *Operation.ServerResponse.Header or (if a response was returned at
  35470. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35471. // to check whether the returned error was because
  35472. // http.StatusNotModified was returned.
  35473. func (c *NetworksRemovePeeringCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  35474. gensupport.SetOptions(c.urlParams_, opts...)
  35475. res, err := c.doRequest("json")
  35476. if res != nil && res.StatusCode == http.StatusNotModified {
  35477. if res.Body != nil {
  35478. res.Body.Close()
  35479. }
  35480. return nil, &googleapi.Error{
  35481. Code: res.StatusCode,
  35482. Header: res.Header,
  35483. }
  35484. }
  35485. if err != nil {
  35486. return nil, err
  35487. }
  35488. defer googleapi.CloseBody(res)
  35489. if err := googleapi.CheckResponse(res); err != nil {
  35490. return nil, err
  35491. }
  35492. ret := &Operation{
  35493. ServerResponse: googleapi.ServerResponse{
  35494. Header: res.Header,
  35495. HTTPStatusCode: res.StatusCode,
  35496. },
  35497. }
  35498. target := &ret
  35499. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  35500. return nil, err
  35501. }
  35502. return ret, nil
  35503. // {
  35504. // "description": "Removes a peering from the specified network.",
  35505. // "httpMethod": "POST",
  35506. // "id": "compute.networks.removePeering",
  35507. // "parameterOrder": [
  35508. // "project",
  35509. // "network"
  35510. // ],
  35511. // "parameters": {
  35512. // "network": {
  35513. // "description": "Name of the network resource to remove peering from.",
  35514. // "location": "path",
  35515. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  35516. // "required": true,
  35517. // "type": "string"
  35518. // },
  35519. // "project": {
  35520. // "description": "Project ID for this request.",
  35521. // "location": "path",
  35522. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35523. // "required": true,
  35524. // "type": "string"
  35525. // }
  35526. // },
  35527. // "path": "{project}/global/networks/{network}/removePeering",
  35528. // "request": {
  35529. // "$ref": "NetworksRemovePeeringRequest"
  35530. // },
  35531. // "response": {
  35532. // "$ref": "Operation"
  35533. // },
  35534. // "scopes": [
  35535. // "https://www.googleapis.com/auth/cloud-platform",
  35536. // "https://www.googleapis.com/auth/compute"
  35537. // ]
  35538. // }
  35539. }
  35540. // method id "compute.networks.switchToCustomMode":
  35541. type NetworksSwitchToCustomModeCall struct {
  35542. s *Service
  35543. project string
  35544. network string
  35545. urlParams_ gensupport.URLParams
  35546. ctx_ context.Context
  35547. header_ http.Header
  35548. }
  35549. // SwitchToCustomMode: Switches the network mode from auto subnet mode
  35550. // to custom subnet mode.
  35551. func (r *NetworksService) SwitchToCustomMode(project string, network string) *NetworksSwitchToCustomModeCall {
  35552. c := &NetworksSwitchToCustomModeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35553. c.project = project
  35554. c.network = network
  35555. return c
  35556. }
  35557. // Fields allows partial responses to be retrieved. See
  35558. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35559. // for more information.
  35560. func (c *NetworksSwitchToCustomModeCall) Fields(s ...googleapi.Field) *NetworksSwitchToCustomModeCall {
  35561. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35562. return c
  35563. }
  35564. // Context sets the context to be used in this call's Do method. Any
  35565. // pending HTTP request will be aborted if the provided context is
  35566. // canceled.
  35567. func (c *NetworksSwitchToCustomModeCall) Context(ctx context.Context) *NetworksSwitchToCustomModeCall {
  35568. c.ctx_ = ctx
  35569. return c
  35570. }
  35571. // Header returns an http.Header that can be modified by the caller to
  35572. // add HTTP headers to the request.
  35573. func (c *NetworksSwitchToCustomModeCall) Header() http.Header {
  35574. if c.header_ == nil {
  35575. c.header_ = make(http.Header)
  35576. }
  35577. return c.header_
  35578. }
  35579. func (c *NetworksSwitchToCustomModeCall) doRequest(alt string) (*http.Response, error) {
  35580. reqHeaders := make(http.Header)
  35581. for k, v := range c.header_ {
  35582. reqHeaders[k] = v
  35583. }
  35584. reqHeaders.Set("User-Agent", c.s.userAgent())
  35585. var body io.Reader = nil
  35586. c.urlParams_.Set("alt", alt)
  35587. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/switchToCustomMode")
  35588. urls += "?" + c.urlParams_.Encode()
  35589. req, _ := http.NewRequest("POST", urls, body)
  35590. req.Header = reqHeaders
  35591. googleapi.Expand(req.URL, map[string]string{
  35592. "project": c.project,
  35593. "network": c.network,
  35594. })
  35595. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35596. }
  35597. // Do executes the "compute.networks.switchToCustomMode" call.
  35598. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  35599. // status code is an error. Response headers are in either
  35600. // *Operation.ServerResponse.Header or (if a response was returned at
  35601. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35602. // to check whether the returned error was because
  35603. // http.StatusNotModified was returned.
  35604. func (c *NetworksSwitchToCustomModeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  35605. gensupport.SetOptions(c.urlParams_, opts...)
  35606. res, err := c.doRequest("json")
  35607. if res != nil && res.StatusCode == http.StatusNotModified {
  35608. if res.Body != nil {
  35609. res.Body.Close()
  35610. }
  35611. return nil, &googleapi.Error{
  35612. Code: res.StatusCode,
  35613. Header: res.Header,
  35614. }
  35615. }
  35616. if err != nil {
  35617. return nil, err
  35618. }
  35619. defer googleapi.CloseBody(res)
  35620. if err := googleapi.CheckResponse(res); err != nil {
  35621. return nil, err
  35622. }
  35623. ret := &Operation{
  35624. ServerResponse: googleapi.ServerResponse{
  35625. Header: res.Header,
  35626. HTTPStatusCode: res.StatusCode,
  35627. },
  35628. }
  35629. target := &ret
  35630. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  35631. return nil, err
  35632. }
  35633. return ret, nil
  35634. // {
  35635. // "description": "Switches the network mode from auto subnet mode to custom subnet mode.",
  35636. // "httpMethod": "POST",
  35637. // "id": "compute.networks.switchToCustomMode",
  35638. // "parameterOrder": [
  35639. // "project",
  35640. // "network"
  35641. // ],
  35642. // "parameters": {
  35643. // "network": {
  35644. // "description": "Name of the network to be updated.",
  35645. // "location": "path",
  35646. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  35647. // "required": true,
  35648. // "type": "string"
  35649. // },
  35650. // "project": {
  35651. // "description": "Project ID for this request.",
  35652. // "location": "path",
  35653. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35654. // "required": true,
  35655. // "type": "string"
  35656. // }
  35657. // },
  35658. // "path": "{project}/global/networks/{network}/switchToCustomMode",
  35659. // "response": {
  35660. // "$ref": "Operation"
  35661. // },
  35662. // "scopes": [
  35663. // "https://www.googleapis.com/auth/cloud-platform",
  35664. // "https://www.googleapis.com/auth/compute"
  35665. // ]
  35666. // }
  35667. }
  35668. // method id "compute.projects.disableXpnHost":
  35669. type ProjectsDisableXpnHostCall struct {
  35670. s *Service
  35671. project string
  35672. urlParams_ gensupport.URLParams
  35673. ctx_ context.Context
  35674. header_ http.Header
  35675. }
  35676. // DisableXpnHost: Disable this project as an XPN host project.
  35677. func (r *ProjectsService) DisableXpnHost(project string) *ProjectsDisableXpnHostCall {
  35678. c := &ProjectsDisableXpnHostCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35679. c.project = project
  35680. return c
  35681. }
  35682. // Fields allows partial responses to be retrieved. See
  35683. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35684. // for more information.
  35685. func (c *ProjectsDisableXpnHostCall) Fields(s ...googleapi.Field) *ProjectsDisableXpnHostCall {
  35686. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35687. return c
  35688. }
  35689. // Context sets the context to be used in this call's Do method. Any
  35690. // pending HTTP request will be aborted if the provided context is
  35691. // canceled.
  35692. func (c *ProjectsDisableXpnHostCall) Context(ctx context.Context) *ProjectsDisableXpnHostCall {
  35693. c.ctx_ = ctx
  35694. return c
  35695. }
  35696. // Header returns an http.Header that can be modified by the caller to
  35697. // add HTTP headers to the request.
  35698. func (c *ProjectsDisableXpnHostCall) Header() http.Header {
  35699. if c.header_ == nil {
  35700. c.header_ = make(http.Header)
  35701. }
  35702. return c.header_
  35703. }
  35704. func (c *ProjectsDisableXpnHostCall) doRequest(alt string) (*http.Response, error) {
  35705. reqHeaders := make(http.Header)
  35706. for k, v := range c.header_ {
  35707. reqHeaders[k] = v
  35708. }
  35709. reqHeaders.Set("User-Agent", c.s.userAgent())
  35710. var body io.Reader = nil
  35711. c.urlParams_.Set("alt", alt)
  35712. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/disableXpnHost")
  35713. urls += "?" + c.urlParams_.Encode()
  35714. req, _ := http.NewRequest("POST", urls, body)
  35715. req.Header = reqHeaders
  35716. googleapi.Expand(req.URL, map[string]string{
  35717. "project": c.project,
  35718. })
  35719. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35720. }
  35721. // Do executes the "compute.projects.disableXpnHost" call.
  35722. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  35723. // status code is an error. Response headers are in either
  35724. // *Operation.ServerResponse.Header or (if a response was returned at
  35725. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35726. // to check whether the returned error was because
  35727. // http.StatusNotModified was returned.
  35728. func (c *ProjectsDisableXpnHostCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  35729. gensupport.SetOptions(c.urlParams_, opts...)
  35730. res, err := c.doRequest("json")
  35731. if res != nil && res.StatusCode == http.StatusNotModified {
  35732. if res.Body != nil {
  35733. res.Body.Close()
  35734. }
  35735. return nil, &googleapi.Error{
  35736. Code: res.StatusCode,
  35737. Header: res.Header,
  35738. }
  35739. }
  35740. if err != nil {
  35741. return nil, err
  35742. }
  35743. defer googleapi.CloseBody(res)
  35744. if err := googleapi.CheckResponse(res); err != nil {
  35745. return nil, err
  35746. }
  35747. ret := &Operation{
  35748. ServerResponse: googleapi.ServerResponse{
  35749. Header: res.Header,
  35750. HTTPStatusCode: res.StatusCode,
  35751. },
  35752. }
  35753. target := &ret
  35754. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  35755. return nil, err
  35756. }
  35757. return ret, nil
  35758. // {
  35759. // "description": "Disable this project as an XPN host project.",
  35760. // "httpMethod": "POST",
  35761. // "id": "compute.projects.disableXpnHost",
  35762. // "parameterOrder": [
  35763. // "project"
  35764. // ],
  35765. // "parameters": {
  35766. // "project": {
  35767. // "description": "Project ID for this request.",
  35768. // "location": "path",
  35769. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35770. // "required": true,
  35771. // "type": "string"
  35772. // }
  35773. // },
  35774. // "path": "{project}/disableXpnHost",
  35775. // "response": {
  35776. // "$ref": "Operation"
  35777. // },
  35778. // "scopes": [
  35779. // "https://www.googleapis.com/auth/cloud-platform",
  35780. // "https://www.googleapis.com/auth/compute"
  35781. // ]
  35782. // }
  35783. }
  35784. // method id "compute.projects.disableXpnResource":
  35785. type ProjectsDisableXpnResourceCall struct {
  35786. s *Service
  35787. project string
  35788. projectsdisablexpnresourcerequest *ProjectsDisableXpnResourceRequest
  35789. urlParams_ gensupport.URLParams
  35790. ctx_ context.Context
  35791. header_ http.Header
  35792. }
  35793. // DisableXpnResource: Disable an XPN resource associated with this host
  35794. // project.
  35795. func (r *ProjectsService) DisableXpnResource(project string, projectsdisablexpnresourcerequest *ProjectsDisableXpnResourceRequest) *ProjectsDisableXpnResourceCall {
  35796. c := &ProjectsDisableXpnResourceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35797. c.project = project
  35798. c.projectsdisablexpnresourcerequest = projectsdisablexpnresourcerequest
  35799. return c
  35800. }
  35801. // Fields allows partial responses to be retrieved. See
  35802. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35803. // for more information.
  35804. func (c *ProjectsDisableXpnResourceCall) Fields(s ...googleapi.Field) *ProjectsDisableXpnResourceCall {
  35805. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35806. return c
  35807. }
  35808. // Context sets the context to be used in this call's Do method. Any
  35809. // pending HTTP request will be aborted if the provided context is
  35810. // canceled.
  35811. func (c *ProjectsDisableXpnResourceCall) Context(ctx context.Context) *ProjectsDisableXpnResourceCall {
  35812. c.ctx_ = ctx
  35813. return c
  35814. }
  35815. // Header returns an http.Header that can be modified by the caller to
  35816. // add HTTP headers to the request.
  35817. func (c *ProjectsDisableXpnResourceCall) Header() http.Header {
  35818. if c.header_ == nil {
  35819. c.header_ = make(http.Header)
  35820. }
  35821. return c.header_
  35822. }
  35823. func (c *ProjectsDisableXpnResourceCall) doRequest(alt string) (*http.Response, error) {
  35824. reqHeaders := make(http.Header)
  35825. for k, v := range c.header_ {
  35826. reqHeaders[k] = v
  35827. }
  35828. reqHeaders.Set("User-Agent", c.s.userAgent())
  35829. var body io.Reader = nil
  35830. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectsdisablexpnresourcerequest)
  35831. if err != nil {
  35832. return nil, err
  35833. }
  35834. reqHeaders.Set("Content-Type", "application/json")
  35835. c.urlParams_.Set("alt", alt)
  35836. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/disableXpnResource")
  35837. urls += "?" + c.urlParams_.Encode()
  35838. req, _ := http.NewRequest("POST", urls, body)
  35839. req.Header = reqHeaders
  35840. googleapi.Expand(req.URL, map[string]string{
  35841. "project": c.project,
  35842. })
  35843. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35844. }
  35845. // Do executes the "compute.projects.disableXpnResource" call.
  35846. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  35847. // status code is an error. Response headers are in either
  35848. // *Operation.ServerResponse.Header or (if a response was returned at
  35849. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35850. // to check whether the returned error was because
  35851. // http.StatusNotModified was returned.
  35852. func (c *ProjectsDisableXpnResourceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  35853. gensupport.SetOptions(c.urlParams_, opts...)
  35854. res, err := c.doRequest("json")
  35855. if res != nil && res.StatusCode == http.StatusNotModified {
  35856. if res.Body != nil {
  35857. res.Body.Close()
  35858. }
  35859. return nil, &googleapi.Error{
  35860. Code: res.StatusCode,
  35861. Header: res.Header,
  35862. }
  35863. }
  35864. if err != nil {
  35865. return nil, err
  35866. }
  35867. defer googleapi.CloseBody(res)
  35868. if err := googleapi.CheckResponse(res); err != nil {
  35869. return nil, err
  35870. }
  35871. ret := &Operation{
  35872. ServerResponse: googleapi.ServerResponse{
  35873. Header: res.Header,
  35874. HTTPStatusCode: res.StatusCode,
  35875. },
  35876. }
  35877. target := &ret
  35878. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  35879. return nil, err
  35880. }
  35881. return ret, nil
  35882. // {
  35883. // "description": "Disable an XPN resource associated with this host project.",
  35884. // "httpMethod": "POST",
  35885. // "id": "compute.projects.disableXpnResource",
  35886. // "parameterOrder": [
  35887. // "project"
  35888. // ],
  35889. // "parameters": {
  35890. // "project": {
  35891. // "description": "Project ID for this request.",
  35892. // "location": "path",
  35893. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35894. // "required": true,
  35895. // "type": "string"
  35896. // }
  35897. // },
  35898. // "path": "{project}/disableXpnResource",
  35899. // "request": {
  35900. // "$ref": "ProjectsDisableXpnResourceRequest"
  35901. // },
  35902. // "response": {
  35903. // "$ref": "Operation"
  35904. // },
  35905. // "scopes": [
  35906. // "https://www.googleapis.com/auth/cloud-platform",
  35907. // "https://www.googleapis.com/auth/compute"
  35908. // ]
  35909. // }
  35910. }
  35911. // method id "compute.projects.enableXpnHost":
  35912. type ProjectsEnableXpnHostCall struct {
  35913. s *Service
  35914. project string
  35915. urlParams_ gensupport.URLParams
  35916. ctx_ context.Context
  35917. header_ http.Header
  35918. }
  35919. // EnableXpnHost: Enable this project as an XPN host project.
  35920. func (r *ProjectsService) EnableXpnHost(project string) *ProjectsEnableXpnHostCall {
  35921. c := &ProjectsEnableXpnHostCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35922. c.project = project
  35923. return c
  35924. }
  35925. // Fields allows partial responses to be retrieved. See
  35926. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35927. // for more information.
  35928. func (c *ProjectsEnableXpnHostCall) Fields(s ...googleapi.Field) *ProjectsEnableXpnHostCall {
  35929. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35930. return c
  35931. }
  35932. // Context sets the context to be used in this call's Do method. Any
  35933. // pending HTTP request will be aborted if the provided context is
  35934. // canceled.
  35935. func (c *ProjectsEnableXpnHostCall) Context(ctx context.Context) *ProjectsEnableXpnHostCall {
  35936. c.ctx_ = ctx
  35937. return c
  35938. }
  35939. // Header returns an http.Header that can be modified by the caller to
  35940. // add HTTP headers to the request.
  35941. func (c *ProjectsEnableXpnHostCall) Header() http.Header {
  35942. if c.header_ == nil {
  35943. c.header_ = make(http.Header)
  35944. }
  35945. return c.header_
  35946. }
  35947. func (c *ProjectsEnableXpnHostCall) doRequest(alt string) (*http.Response, error) {
  35948. reqHeaders := make(http.Header)
  35949. for k, v := range c.header_ {
  35950. reqHeaders[k] = v
  35951. }
  35952. reqHeaders.Set("User-Agent", c.s.userAgent())
  35953. var body io.Reader = nil
  35954. c.urlParams_.Set("alt", alt)
  35955. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/enableXpnHost")
  35956. urls += "?" + c.urlParams_.Encode()
  35957. req, _ := http.NewRequest("POST", urls, body)
  35958. req.Header = reqHeaders
  35959. googleapi.Expand(req.URL, map[string]string{
  35960. "project": c.project,
  35961. })
  35962. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35963. }
  35964. // Do executes the "compute.projects.enableXpnHost" call.
  35965. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  35966. // status code is an error. Response headers are in either
  35967. // *Operation.ServerResponse.Header or (if a response was returned at
  35968. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35969. // to check whether the returned error was because
  35970. // http.StatusNotModified was returned.
  35971. func (c *ProjectsEnableXpnHostCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  35972. gensupport.SetOptions(c.urlParams_, opts...)
  35973. res, err := c.doRequest("json")
  35974. if res != nil && res.StatusCode == http.StatusNotModified {
  35975. if res.Body != nil {
  35976. res.Body.Close()
  35977. }
  35978. return nil, &googleapi.Error{
  35979. Code: res.StatusCode,
  35980. Header: res.Header,
  35981. }
  35982. }
  35983. if err != nil {
  35984. return nil, err
  35985. }
  35986. defer googleapi.CloseBody(res)
  35987. if err := googleapi.CheckResponse(res); err != nil {
  35988. return nil, err
  35989. }
  35990. ret := &Operation{
  35991. ServerResponse: googleapi.ServerResponse{
  35992. Header: res.Header,
  35993. HTTPStatusCode: res.StatusCode,
  35994. },
  35995. }
  35996. target := &ret
  35997. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  35998. return nil, err
  35999. }
  36000. return ret, nil
  36001. // {
  36002. // "description": "Enable this project as an XPN host project.",
  36003. // "httpMethod": "POST",
  36004. // "id": "compute.projects.enableXpnHost",
  36005. // "parameterOrder": [
  36006. // "project"
  36007. // ],
  36008. // "parameters": {
  36009. // "project": {
  36010. // "description": "Project ID for this request.",
  36011. // "location": "path",
  36012. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36013. // "required": true,
  36014. // "type": "string"
  36015. // }
  36016. // },
  36017. // "path": "{project}/enableXpnHost",
  36018. // "response": {
  36019. // "$ref": "Operation"
  36020. // },
  36021. // "scopes": [
  36022. // "https://www.googleapis.com/auth/cloud-platform",
  36023. // "https://www.googleapis.com/auth/compute"
  36024. // ]
  36025. // }
  36026. }
  36027. // method id "compute.projects.enableXpnResource":
  36028. type ProjectsEnableXpnResourceCall struct {
  36029. s *Service
  36030. project string
  36031. projectsenablexpnresourcerequest *ProjectsEnableXpnResourceRequest
  36032. urlParams_ gensupport.URLParams
  36033. ctx_ context.Context
  36034. header_ http.Header
  36035. }
  36036. // EnableXpnResource: Enable XPN resource (a.k.a service project or
  36037. // service folder in the future) for a host project, so that subnetworks
  36038. // in the host project can be used by instances in the service project
  36039. // or folder.
  36040. func (r *ProjectsService) EnableXpnResource(project string, projectsenablexpnresourcerequest *ProjectsEnableXpnResourceRequest) *ProjectsEnableXpnResourceCall {
  36041. c := &ProjectsEnableXpnResourceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36042. c.project = project
  36043. c.projectsenablexpnresourcerequest = projectsenablexpnresourcerequest
  36044. return c
  36045. }
  36046. // Fields allows partial responses to be retrieved. See
  36047. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36048. // for more information.
  36049. func (c *ProjectsEnableXpnResourceCall) Fields(s ...googleapi.Field) *ProjectsEnableXpnResourceCall {
  36050. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36051. return c
  36052. }
  36053. // Context sets the context to be used in this call's Do method. Any
  36054. // pending HTTP request will be aborted if the provided context is
  36055. // canceled.
  36056. func (c *ProjectsEnableXpnResourceCall) Context(ctx context.Context) *ProjectsEnableXpnResourceCall {
  36057. c.ctx_ = ctx
  36058. return c
  36059. }
  36060. // Header returns an http.Header that can be modified by the caller to
  36061. // add HTTP headers to the request.
  36062. func (c *ProjectsEnableXpnResourceCall) Header() http.Header {
  36063. if c.header_ == nil {
  36064. c.header_ = make(http.Header)
  36065. }
  36066. return c.header_
  36067. }
  36068. func (c *ProjectsEnableXpnResourceCall) doRequest(alt string) (*http.Response, error) {
  36069. reqHeaders := make(http.Header)
  36070. for k, v := range c.header_ {
  36071. reqHeaders[k] = v
  36072. }
  36073. reqHeaders.Set("User-Agent", c.s.userAgent())
  36074. var body io.Reader = nil
  36075. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectsenablexpnresourcerequest)
  36076. if err != nil {
  36077. return nil, err
  36078. }
  36079. reqHeaders.Set("Content-Type", "application/json")
  36080. c.urlParams_.Set("alt", alt)
  36081. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/enableXpnResource")
  36082. urls += "?" + c.urlParams_.Encode()
  36083. req, _ := http.NewRequest("POST", urls, body)
  36084. req.Header = reqHeaders
  36085. googleapi.Expand(req.URL, map[string]string{
  36086. "project": c.project,
  36087. })
  36088. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36089. }
  36090. // Do executes the "compute.projects.enableXpnResource" call.
  36091. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  36092. // status code is an error. Response headers are in either
  36093. // *Operation.ServerResponse.Header or (if a response was returned at
  36094. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36095. // to check whether the returned error was because
  36096. // http.StatusNotModified was returned.
  36097. func (c *ProjectsEnableXpnResourceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  36098. gensupport.SetOptions(c.urlParams_, opts...)
  36099. res, err := c.doRequest("json")
  36100. if res != nil && res.StatusCode == http.StatusNotModified {
  36101. if res.Body != nil {
  36102. res.Body.Close()
  36103. }
  36104. return nil, &googleapi.Error{
  36105. Code: res.StatusCode,
  36106. Header: res.Header,
  36107. }
  36108. }
  36109. if err != nil {
  36110. return nil, err
  36111. }
  36112. defer googleapi.CloseBody(res)
  36113. if err := googleapi.CheckResponse(res); err != nil {
  36114. return nil, err
  36115. }
  36116. ret := &Operation{
  36117. ServerResponse: googleapi.ServerResponse{
  36118. Header: res.Header,
  36119. HTTPStatusCode: res.StatusCode,
  36120. },
  36121. }
  36122. target := &ret
  36123. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  36124. return nil, err
  36125. }
  36126. return ret, nil
  36127. // {
  36128. // "description": "Enable XPN resource (a.k.a service project or service folder in the future) for a host project, so that subnetworks in the host project can be used by instances in the service project or folder.",
  36129. // "httpMethod": "POST",
  36130. // "id": "compute.projects.enableXpnResource",
  36131. // "parameterOrder": [
  36132. // "project"
  36133. // ],
  36134. // "parameters": {
  36135. // "project": {
  36136. // "description": "Project ID for this request.",
  36137. // "location": "path",
  36138. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36139. // "required": true,
  36140. // "type": "string"
  36141. // }
  36142. // },
  36143. // "path": "{project}/enableXpnResource",
  36144. // "request": {
  36145. // "$ref": "ProjectsEnableXpnResourceRequest"
  36146. // },
  36147. // "response": {
  36148. // "$ref": "Operation"
  36149. // },
  36150. // "scopes": [
  36151. // "https://www.googleapis.com/auth/cloud-platform",
  36152. // "https://www.googleapis.com/auth/compute"
  36153. // ]
  36154. // }
  36155. }
  36156. // method id "compute.projects.get":
  36157. type ProjectsGetCall struct {
  36158. s *Service
  36159. project string
  36160. urlParams_ gensupport.URLParams
  36161. ifNoneMatch_ string
  36162. ctx_ context.Context
  36163. header_ http.Header
  36164. }
  36165. // Get: Returns the specified Project resource.
  36166. // For details, see https://cloud.google.com/compute/docs/reference/latest/projects/get
  36167. func (r *ProjectsService) Get(project string) *ProjectsGetCall {
  36168. c := &ProjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36169. c.project = project
  36170. return c
  36171. }
  36172. // Fields allows partial responses to be retrieved. See
  36173. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36174. // for more information.
  36175. func (c *ProjectsGetCall) Fields(s ...googleapi.Field) *ProjectsGetCall {
  36176. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36177. return c
  36178. }
  36179. // IfNoneMatch sets the optional parameter which makes the operation
  36180. // fail if the object's ETag matches the given value. This is useful for
  36181. // getting updates only after the object has changed since the last
  36182. // request. Use googleapi.IsNotModified to check whether the response
  36183. // error from Do is the result of In-None-Match.
  36184. func (c *ProjectsGetCall) IfNoneMatch(entityTag string) *ProjectsGetCall {
  36185. c.ifNoneMatch_ = entityTag
  36186. return c
  36187. }
  36188. // Context sets the context to be used in this call's Do method. Any
  36189. // pending HTTP request will be aborted if the provided context is
  36190. // canceled.
  36191. func (c *ProjectsGetCall) Context(ctx context.Context) *ProjectsGetCall {
  36192. c.ctx_ = ctx
  36193. return c
  36194. }
  36195. // Header returns an http.Header that can be modified by the caller to
  36196. // add HTTP headers to the request.
  36197. func (c *ProjectsGetCall) Header() http.Header {
  36198. if c.header_ == nil {
  36199. c.header_ = make(http.Header)
  36200. }
  36201. return c.header_
  36202. }
  36203. func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) {
  36204. reqHeaders := make(http.Header)
  36205. for k, v := range c.header_ {
  36206. reqHeaders[k] = v
  36207. }
  36208. reqHeaders.Set("User-Agent", c.s.userAgent())
  36209. if c.ifNoneMatch_ != "" {
  36210. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36211. }
  36212. var body io.Reader = nil
  36213. c.urlParams_.Set("alt", alt)
  36214. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}")
  36215. urls += "?" + c.urlParams_.Encode()
  36216. req, _ := http.NewRequest("GET", urls, body)
  36217. req.Header = reqHeaders
  36218. googleapi.Expand(req.URL, map[string]string{
  36219. "project": c.project,
  36220. })
  36221. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36222. }
  36223. // Do executes the "compute.projects.get" call.
  36224. // Exactly one of *Project or error will be non-nil. Any non-2xx status
  36225. // code is an error. Response headers are in either
  36226. // *Project.ServerResponse.Header or (if a response was returned at all)
  36227. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  36228. // check whether the returned error was because http.StatusNotModified
  36229. // was returned.
  36230. func (c *ProjectsGetCall) Do(opts ...googleapi.CallOption) (*Project, error) {
  36231. gensupport.SetOptions(c.urlParams_, opts...)
  36232. res, err := c.doRequest("json")
  36233. if res != nil && res.StatusCode == http.StatusNotModified {
  36234. if res.Body != nil {
  36235. res.Body.Close()
  36236. }
  36237. return nil, &googleapi.Error{
  36238. Code: res.StatusCode,
  36239. Header: res.Header,
  36240. }
  36241. }
  36242. if err != nil {
  36243. return nil, err
  36244. }
  36245. defer googleapi.CloseBody(res)
  36246. if err := googleapi.CheckResponse(res); err != nil {
  36247. return nil, err
  36248. }
  36249. ret := &Project{
  36250. ServerResponse: googleapi.ServerResponse{
  36251. Header: res.Header,
  36252. HTTPStatusCode: res.StatusCode,
  36253. },
  36254. }
  36255. target := &ret
  36256. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  36257. return nil, err
  36258. }
  36259. return ret, nil
  36260. // {
  36261. // "description": "Returns the specified Project resource.",
  36262. // "httpMethod": "GET",
  36263. // "id": "compute.projects.get",
  36264. // "parameterOrder": [
  36265. // "project"
  36266. // ],
  36267. // "parameters": {
  36268. // "project": {
  36269. // "description": "Project ID for this request.",
  36270. // "location": "path",
  36271. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36272. // "required": true,
  36273. // "type": "string"
  36274. // }
  36275. // },
  36276. // "path": "{project}",
  36277. // "response": {
  36278. // "$ref": "Project"
  36279. // },
  36280. // "scopes": [
  36281. // "https://www.googleapis.com/auth/cloud-platform",
  36282. // "https://www.googleapis.com/auth/compute",
  36283. // "https://www.googleapis.com/auth/compute.readonly"
  36284. // ]
  36285. // }
  36286. }
  36287. // method id "compute.projects.getXpnHost":
  36288. type ProjectsGetXpnHostCall struct {
  36289. s *Service
  36290. project string
  36291. urlParams_ gensupport.URLParams
  36292. ifNoneMatch_ string
  36293. ctx_ context.Context
  36294. header_ http.Header
  36295. }
  36296. // GetXpnHost: Get the XPN host project that this project links to. May
  36297. // be empty if no link exists.
  36298. func (r *ProjectsService) GetXpnHost(project string) *ProjectsGetXpnHostCall {
  36299. c := &ProjectsGetXpnHostCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36300. c.project = project
  36301. return c
  36302. }
  36303. // Fields allows partial responses to be retrieved. See
  36304. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36305. // for more information.
  36306. func (c *ProjectsGetXpnHostCall) Fields(s ...googleapi.Field) *ProjectsGetXpnHostCall {
  36307. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36308. return c
  36309. }
  36310. // IfNoneMatch sets the optional parameter which makes the operation
  36311. // fail if the object's ETag matches the given value. This is useful for
  36312. // getting updates only after the object has changed since the last
  36313. // request. Use googleapi.IsNotModified to check whether the response
  36314. // error from Do is the result of In-None-Match.
  36315. func (c *ProjectsGetXpnHostCall) IfNoneMatch(entityTag string) *ProjectsGetXpnHostCall {
  36316. c.ifNoneMatch_ = entityTag
  36317. return c
  36318. }
  36319. // Context sets the context to be used in this call's Do method. Any
  36320. // pending HTTP request will be aborted if the provided context is
  36321. // canceled.
  36322. func (c *ProjectsGetXpnHostCall) Context(ctx context.Context) *ProjectsGetXpnHostCall {
  36323. c.ctx_ = ctx
  36324. return c
  36325. }
  36326. // Header returns an http.Header that can be modified by the caller to
  36327. // add HTTP headers to the request.
  36328. func (c *ProjectsGetXpnHostCall) Header() http.Header {
  36329. if c.header_ == nil {
  36330. c.header_ = make(http.Header)
  36331. }
  36332. return c.header_
  36333. }
  36334. func (c *ProjectsGetXpnHostCall) doRequest(alt string) (*http.Response, error) {
  36335. reqHeaders := make(http.Header)
  36336. for k, v := range c.header_ {
  36337. reqHeaders[k] = v
  36338. }
  36339. reqHeaders.Set("User-Agent", c.s.userAgent())
  36340. if c.ifNoneMatch_ != "" {
  36341. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36342. }
  36343. var body io.Reader = nil
  36344. c.urlParams_.Set("alt", alt)
  36345. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/getXpnHost")
  36346. urls += "?" + c.urlParams_.Encode()
  36347. req, _ := http.NewRequest("GET", urls, body)
  36348. req.Header = reqHeaders
  36349. googleapi.Expand(req.URL, map[string]string{
  36350. "project": c.project,
  36351. })
  36352. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36353. }
  36354. // Do executes the "compute.projects.getXpnHost" call.
  36355. // Exactly one of *Project or error will be non-nil. Any non-2xx status
  36356. // code is an error. Response headers are in either
  36357. // *Project.ServerResponse.Header or (if a response was returned at all)
  36358. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  36359. // check whether the returned error was because http.StatusNotModified
  36360. // was returned.
  36361. func (c *ProjectsGetXpnHostCall) Do(opts ...googleapi.CallOption) (*Project, error) {
  36362. gensupport.SetOptions(c.urlParams_, opts...)
  36363. res, err := c.doRequest("json")
  36364. if res != nil && res.StatusCode == http.StatusNotModified {
  36365. if res.Body != nil {
  36366. res.Body.Close()
  36367. }
  36368. return nil, &googleapi.Error{
  36369. Code: res.StatusCode,
  36370. Header: res.Header,
  36371. }
  36372. }
  36373. if err != nil {
  36374. return nil, err
  36375. }
  36376. defer googleapi.CloseBody(res)
  36377. if err := googleapi.CheckResponse(res); err != nil {
  36378. return nil, err
  36379. }
  36380. ret := &Project{
  36381. ServerResponse: googleapi.ServerResponse{
  36382. Header: res.Header,
  36383. HTTPStatusCode: res.StatusCode,
  36384. },
  36385. }
  36386. target := &ret
  36387. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  36388. return nil, err
  36389. }
  36390. return ret, nil
  36391. // {
  36392. // "description": "Get the XPN host project that this project links to. May be empty if no link exists.",
  36393. // "httpMethod": "GET",
  36394. // "id": "compute.projects.getXpnHost",
  36395. // "parameterOrder": [
  36396. // "project"
  36397. // ],
  36398. // "parameters": {
  36399. // "project": {
  36400. // "description": "Project ID for this request.",
  36401. // "location": "path",
  36402. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36403. // "required": true,
  36404. // "type": "string"
  36405. // }
  36406. // },
  36407. // "path": "{project}/getXpnHost",
  36408. // "response": {
  36409. // "$ref": "Project"
  36410. // },
  36411. // "scopes": [
  36412. // "https://www.googleapis.com/auth/cloud-platform",
  36413. // "https://www.googleapis.com/auth/compute",
  36414. // "https://www.googleapis.com/auth/compute.readonly"
  36415. // ]
  36416. // }
  36417. }
  36418. // method id "compute.projects.getXpnResources":
  36419. type ProjectsGetXpnResourcesCall struct {
  36420. s *Service
  36421. project string
  36422. urlParams_ gensupport.URLParams
  36423. ifNoneMatch_ string
  36424. ctx_ context.Context
  36425. header_ http.Header
  36426. }
  36427. // GetXpnResources: Get XPN resources associated with this host project.
  36428. func (r *ProjectsService) GetXpnResources(project string) *ProjectsGetXpnResourcesCall {
  36429. c := &ProjectsGetXpnResourcesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36430. c.project = project
  36431. return c
  36432. }
  36433. // Filter sets the optional parameter "filter":
  36434. func (c *ProjectsGetXpnResourcesCall) Filter(filter string) *ProjectsGetXpnResourcesCall {
  36435. c.urlParams_.Set("filter", filter)
  36436. return c
  36437. }
  36438. // MaxResults sets the optional parameter "maxResults":
  36439. func (c *ProjectsGetXpnResourcesCall) MaxResults(maxResults int64) *ProjectsGetXpnResourcesCall {
  36440. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  36441. return c
  36442. }
  36443. // OrderBy sets the optional parameter "order_by":
  36444. func (c *ProjectsGetXpnResourcesCall) OrderBy(orderBy string) *ProjectsGetXpnResourcesCall {
  36445. c.urlParams_.Set("order_by", orderBy)
  36446. return c
  36447. }
  36448. // PageToken sets the optional parameter "pageToken":
  36449. func (c *ProjectsGetXpnResourcesCall) PageToken(pageToken string) *ProjectsGetXpnResourcesCall {
  36450. c.urlParams_.Set("pageToken", pageToken)
  36451. return c
  36452. }
  36453. // Fields allows partial responses to be retrieved. See
  36454. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36455. // for more information.
  36456. func (c *ProjectsGetXpnResourcesCall) Fields(s ...googleapi.Field) *ProjectsGetXpnResourcesCall {
  36457. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36458. return c
  36459. }
  36460. // IfNoneMatch sets the optional parameter which makes the operation
  36461. // fail if the object's ETag matches the given value. This is useful for
  36462. // getting updates only after the object has changed since the last
  36463. // request. Use googleapi.IsNotModified to check whether the response
  36464. // error from Do is the result of In-None-Match.
  36465. func (c *ProjectsGetXpnResourcesCall) IfNoneMatch(entityTag string) *ProjectsGetXpnResourcesCall {
  36466. c.ifNoneMatch_ = entityTag
  36467. return c
  36468. }
  36469. // Context sets the context to be used in this call's Do method. Any
  36470. // pending HTTP request will be aborted if the provided context is
  36471. // canceled.
  36472. func (c *ProjectsGetXpnResourcesCall) Context(ctx context.Context) *ProjectsGetXpnResourcesCall {
  36473. c.ctx_ = ctx
  36474. return c
  36475. }
  36476. // Header returns an http.Header that can be modified by the caller to
  36477. // add HTTP headers to the request.
  36478. func (c *ProjectsGetXpnResourcesCall) Header() http.Header {
  36479. if c.header_ == nil {
  36480. c.header_ = make(http.Header)
  36481. }
  36482. return c.header_
  36483. }
  36484. func (c *ProjectsGetXpnResourcesCall) doRequest(alt string) (*http.Response, error) {
  36485. reqHeaders := make(http.Header)
  36486. for k, v := range c.header_ {
  36487. reqHeaders[k] = v
  36488. }
  36489. reqHeaders.Set("User-Agent", c.s.userAgent())
  36490. if c.ifNoneMatch_ != "" {
  36491. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36492. }
  36493. var body io.Reader = nil
  36494. c.urlParams_.Set("alt", alt)
  36495. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/getXpnResources")
  36496. urls += "?" + c.urlParams_.Encode()
  36497. req, _ := http.NewRequest("GET", urls, body)
  36498. req.Header = reqHeaders
  36499. googleapi.Expand(req.URL, map[string]string{
  36500. "project": c.project,
  36501. })
  36502. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36503. }
  36504. // Do executes the "compute.projects.getXpnResources" call.
  36505. // Exactly one of *ProjectsGetXpnResources or error will be non-nil. Any
  36506. // non-2xx status code is an error. Response headers are in either
  36507. // *ProjectsGetXpnResources.ServerResponse.Header or (if a response was
  36508. // returned at all) in error.(*googleapi.Error).Header. Use
  36509. // googleapi.IsNotModified to check whether the returned error was
  36510. // because http.StatusNotModified was returned.
  36511. func (c *ProjectsGetXpnResourcesCall) Do(opts ...googleapi.CallOption) (*ProjectsGetXpnResources, error) {
  36512. gensupport.SetOptions(c.urlParams_, opts...)
  36513. res, err := c.doRequest("json")
  36514. if res != nil && res.StatusCode == http.StatusNotModified {
  36515. if res.Body != nil {
  36516. res.Body.Close()
  36517. }
  36518. return nil, &googleapi.Error{
  36519. Code: res.StatusCode,
  36520. Header: res.Header,
  36521. }
  36522. }
  36523. if err != nil {
  36524. return nil, err
  36525. }
  36526. defer googleapi.CloseBody(res)
  36527. if err := googleapi.CheckResponse(res); err != nil {
  36528. return nil, err
  36529. }
  36530. ret := &ProjectsGetXpnResources{
  36531. ServerResponse: googleapi.ServerResponse{
  36532. Header: res.Header,
  36533. HTTPStatusCode: res.StatusCode,
  36534. },
  36535. }
  36536. target := &ret
  36537. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  36538. return nil, err
  36539. }
  36540. return ret, nil
  36541. // {
  36542. // "description": "Get XPN resources associated with this host project.",
  36543. // "httpMethod": "GET",
  36544. // "id": "compute.projects.getXpnResources",
  36545. // "parameterOrder": [
  36546. // "project"
  36547. // ],
  36548. // "parameters": {
  36549. // "filter": {
  36550. // "location": "query",
  36551. // "type": "string"
  36552. // },
  36553. // "maxResults": {
  36554. // "default": "500",
  36555. // "format": "uint32",
  36556. // "location": "query",
  36557. // "minimum": "0",
  36558. // "type": "integer"
  36559. // },
  36560. // "order_by": {
  36561. // "location": "query",
  36562. // "type": "string"
  36563. // },
  36564. // "pageToken": {
  36565. // "location": "query",
  36566. // "type": "string"
  36567. // },
  36568. // "project": {
  36569. // "description": "Project ID for this request.",
  36570. // "location": "path",
  36571. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36572. // "required": true,
  36573. // "type": "string"
  36574. // }
  36575. // },
  36576. // "path": "{project}/getXpnResources",
  36577. // "response": {
  36578. // "$ref": "ProjectsGetXpnResources"
  36579. // },
  36580. // "scopes": [
  36581. // "https://www.googleapis.com/auth/cloud-platform",
  36582. // "https://www.googleapis.com/auth/compute",
  36583. // "https://www.googleapis.com/auth/compute.readonly"
  36584. // ]
  36585. // }
  36586. }
  36587. // Pages invokes f for each page of results.
  36588. // A non-nil error returned from f will halt the iteration.
  36589. // The provided context supersedes any context provided to the Context method.
  36590. func (c *ProjectsGetXpnResourcesCall) Pages(ctx context.Context, f func(*ProjectsGetXpnResources) error) error {
  36591. c.ctx_ = ctx
  36592. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  36593. for {
  36594. x, err := c.Do()
  36595. if err != nil {
  36596. return err
  36597. }
  36598. if err := f(x); err != nil {
  36599. return err
  36600. }
  36601. if x.NextPageToken == "" {
  36602. return nil
  36603. }
  36604. c.PageToken(x.NextPageToken)
  36605. }
  36606. }
  36607. // method id "compute.projects.listXpnHosts":
  36608. type ProjectsListXpnHostsCall struct {
  36609. s *Service
  36610. project string
  36611. projectslistxpnhostsrequest *ProjectsListXpnHostsRequest
  36612. urlParams_ gensupport.URLParams
  36613. ctx_ context.Context
  36614. header_ http.Header
  36615. }
  36616. // ListXpnHosts: List all XPN host projects visible to the user in an
  36617. // organization.
  36618. func (r *ProjectsService) ListXpnHosts(project string, projectslistxpnhostsrequest *ProjectsListXpnHostsRequest) *ProjectsListXpnHostsCall {
  36619. c := &ProjectsListXpnHostsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36620. c.project = project
  36621. c.projectslistxpnhostsrequest = projectslistxpnhostsrequest
  36622. return c
  36623. }
  36624. // Filter sets the optional parameter "filter":
  36625. func (c *ProjectsListXpnHostsCall) Filter(filter string) *ProjectsListXpnHostsCall {
  36626. c.urlParams_.Set("filter", filter)
  36627. return c
  36628. }
  36629. // MaxResults sets the optional parameter "maxResults":
  36630. func (c *ProjectsListXpnHostsCall) MaxResults(maxResults int64) *ProjectsListXpnHostsCall {
  36631. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  36632. return c
  36633. }
  36634. // OrderBy sets the optional parameter "order_by":
  36635. func (c *ProjectsListXpnHostsCall) OrderBy(orderBy string) *ProjectsListXpnHostsCall {
  36636. c.urlParams_.Set("order_by", orderBy)
  36637. return c
  36638. }
  36639. // PageToken sets the optional parameter "pageToken":
  36640. func (c *ProjectsListXpnHostsCall) PageToken(pageToken string) *ProjectsListXpnHostsCall {
  36641. c.urlParams_.Set("pageToken", pageToken)
  36642. return c
  36643. }
  36644. // Fields allows partial responses to be retrieved. See
  36645. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36646. // for more information.
  36647. func (c *ProjectsListXpnHostsCall) Fields(s ...googleapi.Field) *ProjectsListXpnHostsCall {
  36648. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36649. return c
  36650. }
  36651. // Context sets the context to be used in this call's Do method. Any
  36652. // pending HTTP request will be aborted if the provided context is
  36653. // canceled.
  36654. func (c *ProjectsListXpnHostsCall) Context(ctx context.Context) *ProjectsListXpnHostsCall {
  36655. c.ctx_ = ctx
  36656. return c
  36657. }
  36658. // Header returns an http.Header that can be modified by the caller to
  36659. // add HTTP headers to the request.
  36660. func (c *ProjectsListXpnHostsCall) Header() http.Header {
  36661. if c.header_ == nil {
  36662. c.header_ = make(http.Header)
  36663. }
  36664. return c.header_
  36665. }
  36666. func (c *ProjectsListXpnHostsCall) doRequest(alt string) (*http.Response, error) {
  36667. reqHeaders := make(http.Header)
  36668. for k, v := range c.header_ {
  36669. reqHeaders[k] = v
  36670. }
  36671. reqHeaders.Set("User-Agent", c.s.userAgent())
  36672. var body io.Reader = nil
  36673. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectslistxpnhostsrequest)
  36674. if err != nil {
  36675. return nil, err
  36676. }
  36677. reqHeaders.Set("Content-Type", "application/json")
  36678. c.urlParams_.Set("alt", alt)
  36679. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/listXpnHosts")
  36680. urls += "?" + c.urlParams_.Encode()
  36681. req, _ := http.NewRequest("POST", urls, body)
  36682. req.Header = reqHeaders
  36683. googleapi.Expand(req.URL, map[string]string{
  36684. "project": c.project,
  36685. })
  36686. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36687. }
  36688. // Do executes the "compute.projects.listXpnHosts" call.
  36689. // Exactly one of *XpnHostList or error will be non-nil. Any non-2xx
  36690. // status code is an error. Response headers are in either
  36691. // *XpnHostList.ServerResponse.Header or (if a response was returned at
  36692. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36693. // to check whether the returned error was because
  36694. // http.StatusNotModified was returned.
  36695. func (c *ProjectsListXpnHostsCall) Do(opts ...googleapi.CallOption) (*XpnHostList, error) {
  36696. gensupport.SetOptions(c.urlParams_, opts...)
  36697. res, err := c.doRequest("json")
  36698. if res != nil && res.StatusCode == http.StatusNotModified {
  36699. if res.Body != nil {
  36700. res.Body.Close()
  36701. }
  36702. return nil, &googleapi.Error{
  36703. Code: res.StatusCode,
  36704. Header: res.Header,
  36705. }
  36706. }
  36707. if err != nil {
  36708. return nil, err
  36709. }
  36710. defer googleapi.CloseBody(res)
  36711. if err := googleapi.CheckResponse(res); err != nil {
  36712. return nil, err
  36713. }
  36714. ret := &XpnHostList{
  36715. ServerResponse: googleapi.ServerResponse{
  36716. Header: res.Header,
  36717. HTTPStatusCode: res.StatusCode,
  36718. },
  36719. }
  36720. target := &ret
  36721. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  36722. return nil, err
  36723. }
  36724. return ret, nil
  36725. // {
  36726. // "description": "List all XPN host projects visible to the user in an organization.",
  36727. // "httpMethod": "POST",
  36728. // "id": "compute.projects.listXpnHosts",
  36729. // "parameterOrder": [
  36730. // "project"
  36731. // ],
  36732. // "parameters": {
  36733. // "filter": {
  36734. // "location": "query",
  36735. // "type": "string"
  36736. // },
  36737. // "maxResults": {
  36738. // "default": "500",
  36739. // "format": "uint32",
  36740. // "location": "query",
  36741. // "minimum": "0",
  36742. // "type": "integer"
  36743. // },
  36744. // "order_by": {
  36745. // "location": "query",
  36746. // "type": "string"
  36747. // },
  36748. // "pageToken": {
  36749. // "location": "query",
  36750. // "type": "string"
  36751. // },
  36752. // "project": {
  36753. // "description": "Project ID for this request.",
  36754. // "location": "path",
  36755. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36756. // "required": true,
  36757. // "type": "string"
  36758. // }
  36759. // },
  36760. // "path": "{project}/listXpnHosts",
  36761. // "request": {
  36762. // "$ref": "ProjectsListXpnHostsRequest"
  36763. // },
  36764. // "response": {
  36765. // "$ref": "XpnHostList"
  36766. // },
  36767. // "scopes": [
  36768. // "https://www.googleapis.com/auth/cloud-platform",
  36769. // "https://www.googleapis.com/auth/compute",
  36770. // "https://www.googleapis.com/auth/compute.readonly"
  36771. // ]
  36772. // }
  36773. }
  36774. // Pages invokes f for each page of results.
  36775. // A non-nil error returned from f will halt the iteration.
  36776. // The provided context supersedes any context provided to the Context method.
  36777. func (c *ProjectsListXpnHostsCall) Pages(ctx context.Context, f func(*XpnHostList) error) error {
  36778. c.ctx_ = ctx
  36779. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  36780. for {
  36781. x, err := c.Do()
  36782. if err != nil {
  36783. return err
  36784. }
  36785. if err := f(x); err != nil {
  36786. return err
  36787. }
  36788. if x.NextPageToken == "" {
  36789. return nil
  36790. }
  36791. c.PageToken(x.NextPageToken)
  36792. }
  36793. }
  36794. // method id "compute.projects.moveDisk":
  36795. type ProjectsMoveDiskCall struct {
  36796. s *Service
  36797. project string
  36798. diskmoverequest *DiskMoveRequest
  36799. urlParams_ gensupport.URLParams
  36800. ctx_ context.Context
  36801. header_ http.Header
  36802. }
  36803. // MoveDisk: Moves a persistent disk from one zone to another.
  36804. func (r *ProjectsService) MoveDisk(project string, diskmoverequest *DiskMoveRequest) *ProjectsMoveDiskCall {
  36805. c := &ProjectsMoveDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36806. c.project = project
  36807. c.diskmoverequest = diskmoverequest
  36808. return c
  36809. }
  36810. // Fields allows partial responses to be retrieved. See
  36811. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36812. // for more information.
  36813. func (c *ProjectsMoveDiskCall) Fields(s ...googleapi.Field) *ProjectsMoveDiskCall {
  36814. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36815. return c
  36816. }
  36817. // Context sets the context to be used in this call's Do method. Any
  36818. // pending HTTP request will be aborted if the provided context is
  36819. // canceled.
  36820. func (c *ProjectsMoveDiskCall) Context(ctx context.Context) *ProjectsMoveDiskCall {
  36821. c.ctx_ = ctx
  36822. return c
  36823. }
  36824. // Header returns an http.Header that can be modified by the caller to
  36825. // add HTTP headers to the request.
  36826. func (c *ProjectsMoveDiskCall) Header() http.Header {
  36827. if c.header_ == nil {
  36828. c.header_ = make(http.Header)
  36829. }
  36830. return c.header_
  36831. }
  36832. func (c *ProjectsMoveDiskCall) doRequest(alt string) (*http.Response, error) {
  36833. reqHeaders := make(http.Header)
  36834. for k, v := range c.header_ {
  36835. reqHeaders[k] = v
  36836. }
  36837. reqHeaders.Set("User-Agent", c.s.userAgent())
  36838. var body io.Reader = nil
  36839. body, err := googleapi.WithoutDataWrapper.JSONReader(c.diskmoverequest)
  36840. if err != nil {
  36841. return nil, err
  36842. }
  36843. reqHeaders.Set("Content-Type", "application/json")
  36844. c.urlParams_.Set("alt", alt)
  36845. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/moveDisk")
  36846. urls += "?" + c.urlParams_.Encode()
  36847. req, _ := http.NewRequest("POST", urls, body)
  36848. req.Header = reqHeaders
  36849. googleapi.Expand(req.URL, map[string]string{
  36850. "project": c.project,
  36851. })
  36852. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36853. }
  36854. // Do executes the "compute.projects.moveDisk" call.
  36855. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  36856. // status code is an error. Response headers are in either
  36857. // *Operation.ServerResponse.Header or (if a response was returned at
  36858. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36859. // to check whether the returned error was because
  36860. // http.StatusNotModified was returned.
  36861. func (c *ProjectsMoveDiskCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  36862. gensupport.SetOptions(c.urlParams_, opts...)
  36863. res, err := c.doRequest("json")
  36864. if res != nil && res.StatusCode == http.StatusNotModified {
  36865. if res.Body != nil {
  36866. res.Body.Close()
  36867. }
  36868. return nil, &googleapi.Error{
  36869. Code: res.StatusCode,
  36870. Header: res.Header,
  36871. }
  36872. }
  36873. if err != nil {
  36874. return nil, err
  36875. }
  36876. defer googleapi.CloseBody(res)
  36877. if err := googleapi.CheckResponse(res); err != nil {
  36878. return nil, err
  36879. }
  36880. ret := &Operation{
  36881. ServerResponse: googleapi.ServerResponse{
  36882. Header: res.Header,
  36883. HTTPStatusCode: res.StatusCode,
  36884. },
  36885. }
  36886. target := &ret
  36887. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  36888. return nil, err
  36889. }
  36890. return ret, nil
  36891. // {
  36892. // "description": "Moves a persistent disk from one zone to another.",
  36893. // "httpMethod": "POST",
  36894. // "id": "compute.projects.moveDisk",
  36895. // "parameterOrder": [
  36896. // "project"
  36897. // ],
  36898. // "parameters": {
  36899. // "project": {
  36900. // "description": "Project ID for this request.",
  36901. // "location": "path",
  36902. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36903. // "required": true,
  36904. // "type": "string"
  36905. // }
  36906. // },
  36907. // "path": "{project}/moveDisk",
  36908. // "request": {
  36909. // "$ref": "DiskMoveRequest"
  36910. // },
  36911. // "response": {
  36912. // "$ref": "Operation"
  36913. // },
  36914. // "scopes": [
  36915. // "https://www.googleapis.com/auth/cloud-platform",
  36916. // "https://www.googleapis.com/auth/compute"
  36917. // ]
  36918. // }
  36919. }
  36920. // method id "compute.projects.moveInstance":
  36921. type ProjectsMoveInstanceCall struct {
  36922. s *Service
  36923. project string
  36924. instancemoverequest *InstanceMoveRequest
  36925. urlParams_ gensupport.URLParams
  36926. ctx_ context.Context
  36927. header_ http.Header
  36928. }
  36929. // MoveInstance: Moves an instance and its attached persistent disks
  36930. // from one zone to another.
  36931. func (r *ProjectsService) MoveInstance(project string, instancemoverequest *InstanceMoveRequest) *ProjectsMoveInstanceCall {
  36932. c := &ProjectsMoveInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36933. c.project = project
  36934. c.instancemoverequest = instancemoverequest
  36935. return c
  36936. }
  36937. // Fields allows partial responses to be retrieved. See
  36938. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36939. // for more information.
  36940. func (c *ProjectsMoveInstanceCall) Fields(s ...googleapi.Field) *ProjectsMoveInstanceCall {
  36941. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36942. return c
  36943. }
  36944. // Context sets the context to be used in this call's Do method. Any
  36945. // pending HTTP request will be aborted if the provided context is
  36946. // canceled.
  36947. func (c *ProjectsMoveInstanceCall) Context(ctx context.Context) *ProjectsMoveInstanceCall {
  36948. c.ctx_ = ctx
  36949. return c
  36950. }
  36951. // Header returns an http.Header that can be modified by the caller to
  36952. // add HTTP headers to the request.
  36953. func (c *ProjectsMoveInstanceCall) Header() http.Header {
  36954. if c.header_ == nil {
  36955. c.header_ = make(http.Header)
  36956. }
  36957. return c.header_
  36958. }
  36959. func (c *ProjectsMoveInstanceCall) doRequest(alt string) (*http.Response, error) {
  36960. reqHeaders := make(http.Header)
  36961. for k, v := range c.header_ {
  36962. reqHeaders[k] = v
  36963. }
  36964. reqHeaders.Set("User-Agent", c.s.userAgent())
  36965. var body io.Reader = nil
  36966. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancemoverequest)
  36967. if err != nil {
  36968. return nil, err
  36969. }
  36970. reqHeaders.Set("Content-Type", "application/json")
  36971. c.urlParams_.Set("alt", alt)
  36972. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/moveInstance")
  36973. urls += "?" + c.urlParams_.Encode()
  36974. req, _ := http.NewRequest("POST", urls, body)
  36975. req.Header = reqHeaders
  36976. googleapi.Expand(req.URL, map[string]string{
  36977. "project": c.project,
  36978. })
  36979. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36980. }
  36981. // Do executes the "compute.projects.moveInstance" call.
  36982. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  36983. // status code is an error. Response headers are in either
  36984. // *Operation.ServerResponse.Header or (if a response was returned at
  36985. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36986. // to check whether the returned error was because
  36987. // http.StatusNotModified was returned.
  36988. func (c *ProjectsMoveInstanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  36989. gensupport.SetOptions(c.urlParams_, opts...)
  36990. res, err := c.doRequest("json")
  36991. if res != nil && res.StatusCode == http.StatusNotModified {
  36992. if res.Body != nil {
  36993. res.Body.Close()
  36994. }
  36995. return nil, &googleapi.Error{
  36996. Code: res.StatusCode,
  36997. Header: res.Header,
  36998. }
  36999. }
  37000. if err != nil {
  37001. return nil, err
  37002. }
  37003. defer googleapi.CloseBody(res)
  37004. if err := googleapi.CheckResponse(res); err != nil {
  37005. return nil, err
  37006. }
  37007. ret := &Operation{
  37008. ServerResponse: googleapi.ServerResponse{
  37009. Header: res.Header,
  37010. HTTPStatusCode: res.StatusCode,
  37011. },
  37012. }
  37013. target := &ret
  37014. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  37015. return nil, err
  37016. }
  37017. return ret, nil
  37018. // {
  37019. // "description": "Moves an instance and its attached persistent disks from one zone to another.",
  37020. // "httpMethod": "POST",
  37021. // "id": "compute.projects.moveInstance",
  37022. // "parameterOrder": [
  37023. // "project"
  37024. // ],
  37025. // "parameters": {
  37026. // "project": {
  37027. // "description": "Project ID for this request.",
  37028. // "location": "path",
  37029. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37030. // "required": true,
  37031. // "type": "string"
  37032. // }
  37033. // },
  37034. // "path": "{project}/moveInstance",
  37035. // "request": {
  37036. // "$ref": "InstanceMoveRequest"
  37037. // },
  37038. // "response": {
  37039. // "$ref": "Operation"
  37040. // },
  37041. // "scopes": [
  37042. // "https://www.googleapis.com/auth/cloud-platform",
  37043. // "https://www.googleapis.com/auth/compute"
  37044. // ]
  37045. // }
  37046. }
  37047. // method id "compute.projects.setCommonInstanceMetadata":
  37048. type ProjectsSetCommonInstanceMetadataCall struct {
  37049. s *Service
  37050. project string
  37051. metadata *Metadata
  37052. urlParams_ gensupport.URLParams
  37053. ctx_ context.Context
  37054. header_ http.Header
  37055. }
  37056. // SetCommonInstanceMetadata: Sets metadata common to all instances
  37057. // within the specified project using the data included in the request.
  37058. // For details, see https://cloud.google.com/compute/docs/reference/latest/projects/setCommonInstanceMetadata
  37059. func (r *ProjectsService) SetCommonInstanceMetadata(project string, metadata *Metadata) *ProjectsSetCommonInstanceMetadataCall {
  37060. c := &ProjectsSetCommonInstanceMetadataCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37061. c.project = project
  37062. c.metadata = metadata
  37063. return c
  37064. }
  37065. // Fields allows partial responses to be retrieved. See
  37066. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37067. // for more information.
  37068. func (c *ProjectsSetCommonInstanceMetadataCall) Fields(s ...googleapi.Field) *ProjectsSetCommonInstanceMetadataCall {
  37069. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37070. return c
  37071. }
  37072. // Context sets the context to be used in this call's Do method. Any
  37073. // pending HTTP request will be aborted if the provided context is
  37074. // canceled.
  37075. func (c *ProjectsSetCommonInstanceMetadataCall) Context(ctx context.Context) *ProjectsSetCommonInstanceMetadataCall {
  37076. c.ctx_ = ctx
  37077. return c
  37078. }
  37079. // Header returns an http.Header that can be modified by the caller to
  37080. // add HTTP headers to the request.
  37081. func (c *ProjectsSetCommonInstanceMetadataCall) Header() http.Header {
  37082. if c.header_ == nil {
  37083. c.header_ = make(http.Header)
  37084. }
  37085. return c.header_
  37086. }
  37087. func (c *ProjectsSetCommonInstanceMetadataCall) doRequest(alt string) (*http.Response, error) {
  37088. reqHeaders := make(http.Header)
  37089. for k, v := range c.header_ {
  37090. reqHeaders[k] = v
  37091. }
  37092. reqHeaders.Set("User-Agent", c.s.userAgent())
  37093. var body io.Reader = nil
  37094. body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata)
  37095. if err != nil {
  37096. return nil, err
  37097. }
  37098. reqHeaders.Set("Content-Type", "application/json")
  37099. c.urlParams_.Set("alt", alt)
  37100. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setCommonInstanceMetadata")
  37101. urls += "?" + c.urlParams_.Encode()
  37102. req, _ := http.NewRequest("POST", urls, body)
  37103. req.Header = reqHeaders
  37104. googleapi.Expand(req.URL, map[string]string{
  37105. "project": c.project,
  37106. })
  37107. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37108. }
  37109. // Do executes the "compute.projects.setCommonInstanceMetadata" call.
  37110. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  37111. // status code is an error. Response headers are in either
  37112. // *Operation.ServerResponse.Header or (if a response was returned at
  37113. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37114. // to check whether the returned error was because
  37115. // http.StatusNotModified was returned.
  37116. func (c *ProjectsSetCommonInstanceMetadataCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  37117. gensupport.SetOptions(c.urlParams_, opts...)
  37118. res, err := c.doRequest("json")
  37119. if res != nil && res.StatusCode == http.StatusNotModified {
  37120. if res.Body != nil {
  37121. res.Body.Close()
  37122. }
  37123. return nil, &googleapi.Error{
  37124. Code: res.StatusCode,
  37125. Header: res.Header,
  37126. }
  37127. }
  37128. if err != nil {
  37129. return nil, err
  37130. }
  37131. defer googleapi.CloseBody(res)
  37132. if err := googleapi.CheckResponse(res); err != nil {
  37133. return nil, err
  37134. }
  37135. ret := &Operation{
  37136. ServerResponse: googleapi.ServerResponse{
  37137. Header: res.Header,
  37138. HTTPStatusCode: res.StatusCode,
  37139. },
  37140. }
  37141. target := &ret
  37142. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  37143. return nil, err
  37144. }
  37145. return ret, nil
  37146. // {
  37147. // "description": "Sets metadata common to all instances within the specified project using the data included in the request.",
  37148. // "httpMethod": "POST",
  37149. // "id": "compute.projects.setCommonInstanceMetadata",
  37150. // "parameterOrder": [
  37151. // "project"
  37152. // ],
  37153. // "parameters": {
  37154. // "project": {
  37155. // "description": "Project ID for this request.",
  37156. // "location": "path",
  37157. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37158. // "required": true,
  37159. // "type": "string"
  37160. // }
  37161. // },
  37162. // "path": "{project}/setCommonInstanceMetadata",
  37163. // "request": {
  37164. // "$ref": "Metadata"
  37165. // },
  37166. // "response": {
  37167. // "$ref": "Operation"
  37168. // },
  37169. // "scopes": [
  37170. // "https://www.googleapis.com/auth/cloud-platform",
  37171. // "https://www.googleapis.com/auth/compute"
  37172. // ]
  37173. // }
  37174. }
  37175. // method id "compute.projects.setUsageExportBucket":
  37176. type ProjectsSetUsageExportBucketCall struct {
  37177. s *Service
  37178. project string
  37179. usageexportlocation *UsageExportLocation
  37180. urlParams_ gensupport.URLParams
  37181. ctx_ context.Context
  37182. header_ http.Header
  37183. }
  37184. // SetUsageExportBucket: Enables the usage export feature and sets the
  37185. // usage export bucket where reports are stored. If you provide an empty
  37186. // request body using this method, the usage export feature will be
  37187. // disabled.
  37188. // For details, see https://cloud.google.com/compute/docs/reference/latest/projects/setUsageExportBucket
  37189. func (r *ProjectsService) SetUsageExportBucket(project string, usageexportlocation *UsageExportLocation) *ProjectsSetUsageExportBucketCall {
  37190. c := &ProjectsSetUsageExportBucketCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37191. c.project = project
  37192. c.usageexportlocation = usageexportlocation
  37193. return c
  37194. }
  37195. // Fields allows partial responses to be retrieved. See
  37196. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37197. // for more information.
  37198. func (c *ProjectsSetUsageExportBucketCall) Fields(s ...googleapi.Field) *ProjectsSetUsageExportBucketCall {
  37199. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37200. return c
  37201. }
  37202. // Context sets the context to be used in this call's Do method. Any
  37203. // pending HTTP request will be aborted if the provided context is
  37204. // canceled.
  37205. func (c *ProjectsSetUsageExportBucketCall) Context(ctx context.Context) *ProjectsSetUsageExportBucketCall {
  37206. c.ctx_ = ctx
  37207. return c
  37208. }
  37209. // Header returns an http.Header that can be modified by the caller to
  37210. // add HTTP headers to the request.
  37211. func (c *ProjectsSetUsageExportBucketCall) Header() http.Header {
  37212. if c.header_ == nil {
  37213. c.header_ = make(http.Header)
  37214. }
  37215. return c.header_
  37216. }
  37217. func (c *ProjectsSetUsageExportBucketCall) doRequest(alt string) (*http.Response, error) {
  37218. reqHeaders := make(http.Header)
  37219. for k, v := range c.header_ {
  37220. reqHeaders[k] = v
  37221. }
  37222. reqHeaders.Set("User-Agent", c.s.userAgent())
  37223. var body io.Reader = nil
  37224. body, err := googleapi.WithoutDataWrapper.JSONReader(c.usageexportlocation)
  37225. if err != nil {
  37226. return nil, err
  37227. }
  37228. reqHeaders.Set("Content-Type", "application/json")
  37229. c.urlParams_.Set("alt", alt)
  37230. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setUsageExportBucket")
  37231. urls += "?" + c.urlParams_.Encode()
  37232. req, _ := http.NewRequest("POST", urls, body)
  37233. req.Header = reqHeaders
  37234. googleapi.Expand(req.URL, map[string]string{
  37235. "project": c.project,
  37236. })
  37237. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37238. }
  37239. // Do executes the "compute.projects.setUsageExportBucket" call.
  37240. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  37241. // status code is an error. Response headers are in either
  37242. // *Operation.ServerResponse.Header or (if a response was returned at
  37243. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37244. // to check whether the returned error was because
  37245. // http.StatusNotModified was returned.
  37246. func (c *ProjectsSetUsageExportBucketCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  37247. gensupport.SetOptions(c.urlParams_, opts...)
  37248. res, err := c.doRequest("json")
  37249. if res != nil && res.StatusCode == http.StatusNotModified {
  37250. if res.Body != nil {
  37251. res.Body.Close()
  37252. }
  37253. return nil, &googleapi.Error{
  37254. Code: res.StatusCode,
  37255. Header: res.Header,
  37256. }
  37257. }
  37258. if err != nil {
  37259. return nil, err
  37260. }
  37261. defer googleapi.CloseBody(res)
  37262. if err := googleapi.CheckResponse(res); err != nil {
  37263. return nil, err
  37264. }
  37265. ret := &Operation{
  37266. ServerResponse: googleapi.ServerResponse{
  37267. Header: res.Header,
  37268. HTTPStatusCode: res.StatusCode,
  37269. },
  37270. }
  37271. target := &ret
  37272. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  37273. return nil, err
  37274. }
  37275. return ret, nil
  37276. // {
  37277. // "description": "Enables the usage export feature and sets the usage export bucket where reports are stored. If you provide an empty request body using this method, the usage export feature will be disabled.",
  37278. // "httpMethod": "POST",
  37279. // "id": "compute.projects.setUsageExportBucket",
  37280. // "parameterOrder": [
  37281. // "project"
  37282. // ],
  37283. // "parameters": {
  37284. // "project": {
  37285. // "description": "Project ID for this request.",
  37286. // "location": "path",
  37287. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37288. // "required": true,
  37289. // "type": "string"
  37290. // }
  37291. // },
  37292. // "path": "{project}/setUsageExportBucket",
  37293. // "request": {
  37294. // "$ref": "UsageExportLocation"
  37295. // },
  37296. // "response": {
  37297. // "$ref": "Operation"
  37298. // },
  37299. // "scopes": [
  37300. // "https://www.googleapis.com/auth/cloud-platform",
  37301. // "https://www.googleapis.com/auth/compute",
  37302. // "https://www.googleapis.com/auth/devstorage.full_control",
  37303. // "https://www.googleapis.com/auth/devstorage.read_only",
  37304. // "https://www.googleapis.com/auth/devstorage.read_write"
  37305. // ]
  37306. // }
  37307. }
  37308. // method id "compute.regionAutoscalers.delete":
  37309. type RegionAutoscalersDeleteCall struct {
  37310. s *Service
  37311. project string
  37312. region string
  37313. autoscaler string
  37314. urlParams_ gensupport.URLParams
  37315. ctx_ context.Context
  37316. header_ http.Header
  37317. }
  37318. // Delete: Deletes the specified autoscaler.
  37319. func (r *RegionAutoscalersService) Delete(project string, region string, autoscaler string) *RegionAutoscalersDeleteCall {
  37320. c := &RegionAutoscalersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37321. c.project = project
  37322. c.region = region
  37323. c.autoscaler = autoscaler
  37324. return c
  37325. }
  37326. // Fields allows partial responses to be retrieved. See
  37327. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37328. // for more information.
  37329. func (c *RegionAutoscalersDeleteCall) Fields(s ...googleapi.Field) *RegionAutoscalersDeleteCall {
  37330. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37331. return c
  37332. }
  37333. // Context sets the context to be used in this call's Do method. Any
  37334. // pending HTTP request will be aborted if the provided context is
  37335. // canceled.
  37336. func (c *RegionAutoscalersDeleteCall) Context(ctx context.Context) *RegionAutoscalersDeleteCall {
  37337. c.ctx_ = ctx
  37338. return c
  37339. }
  37340. // Header returns an http.Header that can be modified by the caller to
  37341. // add HTTP headers to the request.
  37342. func (c *RegionAutoscalersDeleteCall) Header() http.Header {
  37343. if c.header_ == nil {
  37344. c.header_ = make(http.Header)
  37345. }
  37346. return c.header_
  37347. }
  37348. func (c *RegionAutoscalersDeleteCall) doRequest(alt string) (*http.Response, error) {
  37349. reqHeaders := make(http.Header)
  37350. for k, v := range c.header_ {
  37351. reqHeaders[k] = v
  37352. }
  37353. reqHeaders.Set("User-Agent", c.s.userAgent())
  37354. var body io.Reader = nil
  37355. c.urlParams_.Set("alt", alt)
  37356. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers/{autoscaler}")
  37357. urls += "?" + c.urlParams_.Encode()
  37358. req, _ := http.NewRequest("DELETE", urls, body)
  37359. req.Header = reqHeaders
  37360. googleapi.Expand(req.URL, map[string]string{
  37361. "project": c.project,
  37362. "region": c.region,
  37363. "autoscaler": c.autoscaler,
  37364. })
  37365. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37366. }
  37367. // Do executes the "compute.regionAutoscalers.delete" call.
  37368. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  37369. // status code is an error. Response headers are in either
  37370. // *Operation.ServerResponse.Header or (if a response was returned at
  37371. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37372. // to check whether the returned error was because
  37373. // http.StatusNotModified was returned.
  37374. func (c *RegionAutoscalersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  37375. gensupport.SetOptions(c.urlParams_, opts...)
  37376. res, err := c.doRequest("json")
  37377. if res != nil && res.StatusCode == http.StatusNotModified {
  37378. if res.Body != nil {
  37379. res.Body.Close()
  37380. }
  37381. return nil, &googleapi.Error{
  37382. Code: res.StatusCode,
  37383. Header: res.Header,
  37384. }
  37385. }
  37386. if err != nil {
  37387. return nil, err
  37388. }
  37389. defer googleapi.CloseBody(res)
  37390. if err := googleapi.CheckResponse(res); err != nil {
  37391. return nil, err
  37392. }
  37393. ret := &Operation{
  37394. ServerResponse: googleapi.ServerResponse{
  37395. Header: res.Header,
  37396. HTTPStatusCode: res.StatusCode,
  37397. },
  37398. }
  37399. target := &ret
  37400. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  37401. return nil, err
  37402. }
  37403. return ret, nil
  37404. // {
  37405. // "description": "Deletes the specified autoscaler.",
  37406. // "httpMethod": "DELETE",
  37407. // "id": "compute.regionAutoscalers.delete",
  37408. // "parameterOrder": [
  37409. // "project",
  37410. // "region",
  37411. // "autoscaler"
  37412. // ],
  37413. // "parameters": {
  37414. // "autoscaler": {
  37415. // "description": "Name of the autoscaler to delete.",
  37416. // "location": "path",
  37417. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  37418. // "required": true,
  37419. // "type": "string"
  37420. // },
  37421. // "project": {
  37422. // "description": "Project ID for this request.",
  37423. // "location": "path",
  37424. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37425. // "required": true,
  37426. // "type": "string"
  37427. // },
  37428. // "region": {
  37429. // "description": "Name of the region scoping this request.",
  37430. // "location": "path",
  37431. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  37432. // "required": true,
  37433. // "type": "string"
  37434. // }
  37435. // },
  37436. // "path": "{project}/regions/{region}/autoscalers/{autoscaler}",
  37437. // "response": {
  37438. // "$ref": "Operation"
  37439. // },
  37440. // "scopes": [
  37441. // "https://www.googleapis.com/auth/cloud-platform",
  37442. // "https://www.googleapis.com/auth/compute"
  37443. // ]
  37444. // }
  37445. }
  37446. // method id "compute.regionAutoscalers.get":
  37447. type RegionAutoscalersGetCall struct {
  37448. s *Service
  37449. project string
  37450. region string
  37451. autoscaler string
  37452. urlParams_ gensupport.URLParams
  37453. ifNoneMatch_ string
  37454. ctx_ context.Context
  37455. header_ http.Header
  37456. }
  37457. // Get: Returns the specified autoscaler.
  37458. func (r *RegionAutoscalersService) Get(project string, region string, autoscaler string) *RegionAutoscalersGetCall {
  37459. c := &RegionAutoscalersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37460. c.project = project
  37461. c.region = region
  37462. c.autoscaler = autoscaler
  37463. return c
  37464. }
  37465. // Fields allows partial responses to be retrieved. See
  37466. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37467. // for more information.
  37468. func (c *RegionAutoscalersGetCall) Fields(s ...googleapi.Field) *RegionAutoscalersGetCall {
  37469. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37470. return c
  37471. }
  37472. // IfNoneMatch sets the optional parameter which makes the operation
  37473. // fail if the object's ETag matches the given value. This is useful for
  37474. // getting updates only after the object has changed since the last
  37475. // request. Use googleapi.IsNotModified to check whether the response
  37476. // error from Do is the result of In-None-Match.
  37477. func (c *RegionAutoscalersGetCall) IfNoneMatch(entityTag string) *RegionAutoscalersGetCall {
  37478. c.ifNoneMatch_ = entityTag
  37479. return c
  37480. }
  37481. // Context sets the context to be used in this call's Do method. Any
  37482. // pending HTTP request will be aborted if the provided context is
  37483. // canceled.
  37484. func (c *RegionAutoscalersGetCall) Context(ctx context.Context) *RegionAutoscalersGetCall {
  37485. c.ctx_ = ctx
  37486. return c
  37487. }
  37488. // Header returns an http.Header that can be modified by the caller to
  37489. // add HTTP headers to the request.
  37490. func (c *RegionAutoscalersGetCall) Header() http.Header {
  37491. if c.header_ == nil {
  37492. c.header_ = make(http.Header)
  37493. }
  37494. return c.header_
  37495. }
  37496. func (c *RegionAutoscalersGetCall) doRequest(alt string) (*http.Response, error) {
  37497. reqHeaders := make(http.Header)
  37498. for k, v := range c.header_ {
  37499. reqHeaders[k] = v
  37500. }
  37501. reqHeaders.Set("User-Agent", c.s.userAgent())
  37502. if c.ifNoneMatch_ != "" {
  37503. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37504. }
  37505. var body io.Reader = nil
  37506. c.urlParams_.Set("alt", alt)
  37507. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers/{autoscaler}")
  37508. urls += "?" + c.urlParams_.Encode()
  37509. req, _ := http.NewRequest("GET", urls, body)
  37510. req.Header = reqHeaders
  37511. googleapi.Expand(req.URL, map[string]string{
  37512. "project": c.project,
  37513. "region": c.region,
  37514. "autoscaler": c.autoscaler,
  37515. })
  37516. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37517. }
  37518. // Do executes the "compute.regionAutoscalers.get" call.
  37519. // Exactly one of *Autoscaler or error will be non-nil. Any non-2xx
  37520. // status code is an error. Response headers are in either
  37521. // *Autoscaler.ServerResponse.Header or (if a response was returned at
  37522. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37523. // to check whether the returned error was because
  37524. // http.StatusNotModified was returned.
  37525. func (c *RegionAutoscalersGetCall) Do(opts ...googleapi.CallOption) (*Autoscaler, error) {
  37526. gensupport.SetOptions(c.urlParams_, opts...)
  37527. res, err := c.doRequest("json")
  37528. if res != nil && res.StatusCode == http.StatusNotModified {
  37529. if res.Body != nil {
  37530. res.Body.Close()
  37531. }
  37532. return nil, &googleapi.Error{
  37533. Code: res.StatusCode,
  37534. Header: res.Header,
  37535. }
  37536. }
  37537. if err != nil {
  37538. return nil, err
  37539. }
  37540. defer googleapi.CloseBody(res)
  37541. if err := googleapi.CheckResponse(res); err != nil {
  37542. return nil, err
  37543. }
  37544. ret := &Autoscaler{
  37545. ServerResponse: googleapi.ServerResponse{
  37546. Header: res.Header,
  37547. HTTPStatusCode: res.StatusCode,
  37548. },
  37549. }
  37550. target := &ret
  37551. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  37552. return nil, err
  37553. }
  37554. return ret, nil
  37555. // {
  37556. // "description": "Returns the specified autoscaler.",
  37557. // "httpMethod": "GET",
  37558. // "id": "compute.regionAutoscalers.get",
  37559. // "parameterOrder": [
  37560. // "project",
  37561. // "region",
  37562. // "autoscaler"
  37563. // ],
  37564. // "parameters": {
  37565. // "autoscaler": {
  37566. // "description": "Name of the autoscaler to return.",
  37567. // "location": "path",
  37568. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  37569. // "required": true,
  37570. // "type": "string"
  37571. // },
  37572. // "project": {
  37573. // "description": "Project ID for this request.",
  37574. // "location": "path",
  37575. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37576. // "required": true,
  37577. // "type": "string"
  37578. // },
  37579. // "region": {
  37580. // "description": "Name of the region scoping this request.",
  37581. // "location": "path",
  37582. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  37583. // "required": true,
  37584. // "type": "string"
  37585. // }
  37586. // },
  37587. // "path": "{project}/regions/{region}/autoscalers/{autoscaler}",
  37588. // "response": {
  37589. // "$ref": "Autoscaler"
  37590. // },
  37591. // "scopes": [
  37592. // "https://www.googleapis.com/auth/cloud-platform",
  37593. // "https://www.googleapis.com/auth/compute",
  37594. // "https://www.googleapis.com/auth/compute.readonly"
  37595. // ]
  37596. // }
  37597. }
  37598. // method id "compute.regionAutoscalers.insert":
  37599. type RegionAutoscalersInsertCall struct {
  37600. s *Service
  37601. project string
  37602. region string
  37603. autoscaler *Autoscaler
  37604. urlParams_ gensupport.URLParams
  37605. ctx_ context.Context
  37606. header_ http.Header
  37607. }
  37608. // Insert: Creates an autoscaler in the specified project using the data
  37609. // included in the request.
  37610. func (r *RegionAutoscalersService) Insert(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersInsertCall {
  37611. c := &RegionAutoscalersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37612. c.project = project
  37613. c.region = region
  37614. c.autoscaler = autoscaler
  37615. return c
  37616. }
  37617. // Fields allows partial responses to be retrieved. See
  37618. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37619. // for more information.
  37620. func (c *RegionAutoscalersInsertCall) Fields(s ...googleapi.Field) *RegionAutoscalersInsertCall {
  37621. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37622. return c
  37623. }
  37624. // Context sets the context to be used in this call's Do method. Any
  37625. // pending HTTP request will be aborted if the provided context is
  37626. // canceled.
  37627. func (c *RegionAutoscalersInsertCall) Context(ctx context.Context) *RegionAutoscalersInsertCall {
  37628. c.ctx_ = ctx
  37629. return c
  37630. }
  37631. // Header returns an http.Header that can be modified by the caller to
  37632. // add HTTP headers to the request.
  37633. func (c *RegionAutoscalersInsertCall) Header() http.Header {
  37634. if c.header_ == nil {
  37635. c.header_ = make(http.Header)
  37636. }
  37637. return c.header_
  37638. }
  37639. func (c *RegionAutoscalersInsertCall) doRequest(alt string) (*http.Response, error) {
  37640. reqHeaders := make(http.Header)
  37641. for k, v := range c.header_ {
  37642. reqHeaders[k] = v
  37643. }
  37644. reqHeaders.Set("User-Agent", c.s.userAgent())
  37645. var body io.Reader = nil
  37646. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  37647. if err != nil {
  37648. return nil, err
  37649. }
  37650. reqHeaders.Set("Content-Type", "application/json")
  37651. c.urlParams_.Set("alt", alt)
  37652. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers")
  37653. urls += "?" + c.urlParams_.Encode()
  37654. req, _ := http.NewRequest("POST", urls, body)
  37655. req.Header = reqHeaders
  37656. googleapi.Expand(req.URL, map[string]string{
  37657. "project": c.project,
  37658. "region": c.region,
  37659. })
  37660. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37661. }
  37662. // Do executes the "compute.regionAutoscalers.insert" call.
  37663. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  37664. // status code is an error. Response headers are in either
  37665. // *Operation.ServerResponse.Header or (if a response was returned at
  37666. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37667. // to check whether the returned error was because
  37668. // http.StatusNotModified was returned.
  37669. func (c *RegionAutoscalersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  37670. gensupport.SetOptions(c.urlParams_, opts...)
  37671. res, err := c.doRequest("json")
  37672. if res != nil && res.StatusCode == http.StatusNotModified {
  37673. if res.Body != nil {
  37674. res.Body.Close()
  37675. }
  37676. return nil, &googleapi.Error{
  37677. Code: res.StatusCode,
  37678. Header: res.Header,
  37679. }
  37680. }
  37681. if err != nil {
  37682. return nil, err
  37683. }
  37684. defer googleapi.CloseBody(res)
  37685. if err := googleapi.CheckResponse(res); err != nil {
  37686. return nil, err
  37687. }
  37688. ret := &Operation{
  37689. ServerResponse: googleapi.ServerResponse{
  37690. Header: res.Header,
  37691. HTTPStatusCode: res.StatusCode,
  37692. },
  37693. }
  37694. target := &ret
  37695. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  37696. return nil, err
  37697. }
  37698. return ret, nil
  37699. // {
  37700. // "description": "Creates an autoscaler in the specified project using the data included in the request.",
  37701. // "httpMethod": "POST",
  37702. // "id": "compute.regionAutoscalers.insert",
  37703. // "parameterOrder": [
  37704. // "project",
  37705. // "region"
  37706. // ],
  37707. // "parameters": {
  37708. // "project": {
  37709. // "description": "Project ID for this request.",
  37710. // "location": "path",
  37711. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37712. // "required": true,
  37713. // "type": "string"
  37714. // },
  37715. // "region": {
  37716. // "description": "Name of the region scoping this request.",
  37717. // "location": "path",
  37718. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  37719. // "required": true,
  37720. // "type": "string"
  37721. // }
  37722. // },
  37723. // "path": "{project}/regions/{region}/autoscalers",
  37724. // "request": {
  37725. // "$ref": "Autoscaler"
  37726. // },
  37727. // "response": {
  37728. // "$ref": "Operation"
  37729. // },
  37730. // "scopes": [
  37731. // "https://www.googleapis.com/auth/cloud-platform",
  37732. // "https://www.googleapis.com/auth/compute"
  37733. // ]
  37734. // }
  37735. }
  37736. // method id "compute.regionAutoscalers.list":
  37737. type RegionAutoscalersListCall struct {
  37738. s *Service
  37739. project string
  37740. region string
  37741. urlParams_ gensupport.URLParams
  37742. ifNoneMatch_ string
  37743. ctx_ context.Context
  37744. header_ http.Header
  37745. }
  37746. // List: Retrieves a list of autoscalers contained within the specified
  37747. // region.
  37748. func (r *RegionAutoscalersService) List(project string, region string) *RegionAutoscalersListCall {
  37749. c := &RegionAutoscalersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37750. c.project = project
  37751. c.region = region
  37752. return c
  37753. }
  37754. // Filter sets the optional parameter "filter": Sets a filter
  37755. // {expression} for filtering listed resources. Your {expression} must
  37756. // be in the format: field_name comparison_string literal_string.
  37757. //
  37758. // The field_name is the name of the field you want to compare. Only
  37759. // atomic field types are supported (string, number, boolean). The
  37760. // comparison_string must be either eq (equals) or ne (not equals). The
  37761. // literal_string is the string value to filter to. The literal value
  37762. // must be valid for the type of field you are filtering by (string,
  37763. // number, boolean). For string fields, the literal value is interpreted
  37764. // as a regular expression using RE2 syntax. The literal value must
  37765. // match the entire field.
  37766. //
  37767. // For example, to filter for instances that do not have a name of
  37768. // example-instance, you would use name ne example-instance.
  37769. //
  37770. // You can filter on nested fields. For example, you could filter on
  37771. // instances that have set the scheduling.automaticRestart field to
  37772. // true. Use filtering on nested fields to take advantage of labels to
  37773. // organize and search for results based on label values.
  37774. //
  37775. // To filter on multiple expressions, provide each separate expression
  37776. // within parentheses. For example, (scheduling.automaticRestart eq
  37777. // true) (zone eq us-central1-f). Multiple expressions are treated as
  37778. // AND expressions, meaning that resources must match all expressions to
  37779. // pass the filters.
  37780. func (c *RegionAutoscalersListCall) Filter(filter string) *RegionAutoscalersListCall {
  37781. c.urlParams_.Set("filter", filter)
  37782. return c
  37783. }
  37784. // MaxResults sets the optional parameter "maxResults": The maximum
  37785. // number of results per page that should be returned. If the number of
  37786. // available results is larger than maxResults, Compute Engine returns a
  37787. // nextPageToken that can be used to get the next page of results in
  37788. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  37789. // (Default: 500)
  37790. func (c *RegionAutoscalersListCall) MaxResults(maxResults int64) *RegionAutoscalersListCall {
  37791. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  37792. return c
  37793. }
  37794. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  37795. // a certain order. By default, results are returned in alphanumerical
  37796. // order based on the resource name.
  37797. //
  37798. // You can also sort results in descending order based on the creation
  37799. // timestamp using orderBy="creationTimestamp desc". This sorts results
  37800. // based on the creationTimestamp field in reverse chronological order
  37801. // (newest result first). Use this to sort resources like operations so
  37802. // that the newest operation is returned first.
  37803. //
  37804. // Currently, only sorting by name or creationTimestamp desc is
  37805. // supported.
  37806. func (c *RegionAutoscalersListCall) OrderBy(orderBy string) *RegionAutoscalersListCall {
  37807. c.urlParams_.Set("orderBy", orderBy)
  37808. return c
  37809. }
  37810. // PageToken sets the optional parameter "pageToken": Specifies a page
  37811. // token to use. Set pageToken to the nextPageToken returned by a
  37812. // previous list request to get the next page of results.
  37813. func (c *RegionAutoscalersListCall) PageToken(pageToken string) *RegionAutoscalersListCall {
  37814. c.urlParams_.Set("pageToken", pageToken)
  37815. return c
  37816. }
  37817. // Fields allows partial responses to be retrieved. See
  37818. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37819. // for more information.
  37820. func (c *RegionAutoscalersListCall) Fields(s ...googleapi.Field) *RegionAutoscalersListCall {
  37821. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37822. return c
  37823. }
  37824. // IfNoneMatch sets the optional parameter which makes the operation
  37825. // fail if the object's ETag matches the given value. This is useful for
  37826. // getting updates only after the object has changed since the last
  37827. // request. Use googleapi.IsNotModified to check whether the response
  37828. // error from Do is the result of In-None-Match.
  37829. func (c *RegionAutoscalersListCall) IfNoneMatch(entityTag string) *RegionAutoscalersListCall {
  37830. c.ifNoneMatch_ = entityTag
  37831. return c
  37832. }
  37833. // Context sets the context to be used in this call's Do method. Any
  37834. // pending HTTP request will be aborted if the provided context is
  37835. // canceled.
  37836. func (c *RegionAutoscalersListCall) Context(ctx context.Context) *RegionAutoscalersListCall {
  37837. c.ctx_ = ctx
  37838. return c
  37839. }
  37840. // Header returns an http.Header that can be modified by the caller to
  37841. // add HTTP headers to the request.
  37842. func (c *RegionAutoscalersListCall) Header() http.Header {
  37843. if c.header_ == nil {
  37844. c.header_ = make(http.Header)
  37845. }
  37846. return c.header_
  37847. }
  37848. func (c *RegionAutoscalersListCall) doRequest(alt string) (*http.Response, error) {
  37849. reqHeaders := make(http.Header)
  37850. for k, v := range c.header_ {
  37851. reqHeaders[k] = v
  37852. }
  37853. reqHeaders.Set("User-Agent", c.s.userAgent())
  37854. if c.ifNoneMatch_ != "" {
  37855. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37856. }
  37857. var body io.Reader = nil
  37858. c.urlParams_.Set("alt", alt)
  37859. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers")
  37860. urls += "?" + c.urlParams_.Encode()
  37861. req, _ := http.NewRequest("GET", urls, body)
  37862. req.Header = reqHeaders
  37863. googleapi.Expand(req.URL, map[string]string{
  37864. "project": c.project,
  37865. "region": c.region,
  37866. })
  37867. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37868. }
  37869. // Do executes the "compute.regionAutoscalers.list" call.
  37870. // Exactly one of *RegionAutoscalerList or error will be non-nil. Any
  37871. // non-2xx status code is an error. Response headers are in either
  37872. // *RegionAutoscalerList.ServerResponse.Header or (if a response was
  37873. // returned at all) in error.(*googleapi.Error).Header. Use
  37874. // googleapi.IsNotModified to check whether the returned error was
  37875. // because http.StatusNotModified was returned.
  37876. func (c *RegionAutoscalersListCall) Do(opts ...googleapi.CallOption) (*RegionAutoscalerList, error) {
  37877. gensupport.SetOptions(c.urlParams_, opts...)
  37878. res, err := c.doRequest("json")
  37879. if res != nil && res.StatusCode == http.StatusNotModified {
  37880. if res.Body != nil {
  37881. res.Body.Close()
  37882. }
  37883. return nil, &googleapi.Error{
  37884. Code: res.StatusCode,
  37885. Header: res.Header,
  37886. }
  37887. }
  37888. if err != nil {
  37889. return nil, err
  37890. }
  37891. defer googleapi.CloseBody(res)
  37892. if err := googleapi.CheckResponse(res); err != nil {
  37893. return nil, err
  37894. }
  37895. ret := &RegionAutoscalerList{
  37896. ServerResponse: googleapi.ServerResponse{
  37897. Header: res.Header,
  37898. HTTPStatusCode: res.StatusCode,
  37899. },
  37900. }
  37901. target := &ret
  37902. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  37903. return nil, err
  37904. }
  37905. return ret, nil
  37906. // {
  37907. // "description": "Retrieves a list of autoscalers contained within the specified region.",
  37908. // "httpMethod": "GET",
  37909. // "id": "compute.regionAutoscalers.list",
  37910. // "parameterOrder": [
  37911. // "project",
  37912. // "region"
  37913. // ],
  37914. // "parameters": {
  37915. // "filter": {
  37916. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  37917. // "location": "query",
  37918. // "type": "string"
  37919. // },
  37920. // "maxResults": {
  37921. // "default": "500",
  37922. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  37923. // "format": "uint32",
  37924. // "location": "query",
  37925. // "minimum": "0",
  37926. // "type": "integer"
  37927. // },
  37928. // "orderBy": {
  37929. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  37930. // "location": "query",
  37931. // "type": "string"
  37932. // },
  37933. // "pageToken": {
  37934. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  37935. // "location": "query",
  37936. // "type": "string"
  37937. // },
  37938. // "project": {
  37939. // "description": "Project ID for this request.",
  37940. // "location": "path",
  37941. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37942. // "required": true,
  37943. // "type": "string"
  37944. // },
  37945. // "region": {
  37946. // "description": "Name of the region scoping this request.",
  37947. // "location": "path",
  37948. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  37949. // "required": true,
  37950. // "type": "string"
  37951. // }
  37952. // },
  37953. // "path": "{project}/regions/{region}/autoscalers",
  37954. // "response": {
  37955. // "$ref": "RegionAutoscalerList"
  37956. // },
  37957. // "scopes": [
  37958. // "https://www.googleapis.com/auth/cloud-platform",
  37959. // "https://www.googleapis.com/auth/compute",
  37960. // "https://www.googleapis.com/auth/compute.readonly"
  37961. // ]
  37962. // }
  37963. }
  37964. // Pages invokes f for each page of results.
  37965. // A non-nil error returned from f will halt the iteration.
  37966. // The provided context supersedes any context provided to the Context method.
  37967. func (c *RegionAutoscalersListCall) Pages(ctx context.Context, f func(*RegionAutoscalerList) error) error {
  37968. c.ctx_ = ctx
  37969. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  37970. for {
  37971. x, err := c.Do()
  37972. if err != nil {
  37973. return err
  37974. }
  37975. if err := f(x); err != nil {
  37976. return err
  37977. }
  37978. if x.NextPageToken == "" {
  37979. return nil
  37980. }
  37981. c.PageToken(x.NextPageToken)
  37982. }
  37983. }
  37984. // method id "compute.regionAutoscalers.patch":
  37985. type RegionAutoscalersPatchCall struct {
  37986. s *Service
  37987. project string
  37988. region string
  37989. autoscaler *Autoscaler
  37990. urlParams_ gensupport.URLParams
  37991. ctx_ context.Context
  37992. header_ http.Header
  37993. }
  37994. // Patch: Updates an autoscaler in the specified project using the data
  37995. // included in the request. This method supports patch semantics.
  37996. func (r *RegionAutoscalersService) Patch(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersPatchCall {
  37997. c := &RegionAutoscalersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37998. c.project = project
  37999. c.region = region
  38000. c.autoscaler = autoscaler
  38001. return c
  38002. }
  38003. // Autoscaler sets the optional parameter "autoscaler": Name of the
  38004. // autoscaler to patch.
  38005. func (c *RegionAutoscalersPatchCall) Autoscaler(autoscaler string) *RegionAutoscalersPatchCall {
  38006. c.urlParams_.Set("autoscaler", autoscaler)
  38007. return c
  38008. }
  38009. // Fields allows partial responses to be retrieved. See
  38010. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38011. // for more information.
  38012. func (c *RegionAutoscalersPatchCall) Fields(s ...googleapi.Field) *RegionAutoscalersPatchCall {
  38013. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38014. return c
  38015. }
  38016. // Context sets the context to be used in this call's Do method. Any
  38017. // pending HTTP request will be aborted if the provided context is
  38018. // canceled.
  38019. func (c *RegionAutoscalersPatchCall) Context(ctx context.Context) *RegionAutoscalersPatchCall {
  38020. c.ctx_ = ctx
  38021. return c
  38022. }
  38023. // Header returns an http.Header that can be modified by the caller to
  38024. // add HTTP headers to the request.
  38025. func (c *RegionAutoscalersPatchCall) Header() http.Header {
  38026. if c.header_ == nil {
  38027. c.header_ = make(http.Header)
  38028. }
  38029. return c.header_
  38030. }
  38031. func (c *RegionAutoscalersPatchCall) doRequest(alt string) (*http.Response, error) {
  38032. reqHeaders := make(http.Header)
  38033. for k, v := range c.header_ {
  38034. reqHeaders[k] = v
  38035. }
  38036. reqHeaders.Set("User-Agent", c.s.userAgent())
  38037. var body io.Reader = nil
  38038. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  38039. if err != nil {
  38040. return nil, err
  38041. }
  38042. reqHeaders.Set("Content-Type", "application/json")
  38043. c.urlParams_.Set("alt", alt)
  38044. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers")
  38045. urls += "?" + c.urlParams_.Encode()
  38046. req, _ := http.NewRequest("PATCH", urls, body)
  38047. req.Header = reqHeaders
  38048. googleapi.Expand(req.URL, map[string]string{
  38049. "project": c.project,
  38050. "region": c.region,
  38051. })
  38052. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38053. }
  38054. // Do executes the "compute.regionAutoscalers.patch" call.
  38055. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  38056. // status code is an error. Response headers are in either
  38057. // *Operation.ServerResponse.Header or (if a response was returned at
  38058. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  38059. // to check whether the returned error was because
  38060. // http.StatusNotModified was returned.
  38061. func (c *RegionAutoscalersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  38062. gensupport.SetOptions(c.urlParams_, opts...)
  38063. res, err := c.doRequest("json")
  38064. if res != nil && res.StatusCode == http.StatusNotModified {
  38065. if res.Body != nil {
  38066. res.Body.Close()
  38067. }
  38068. return nil, &googleapi.Error{
  38069. Code: res.StatusCode,
  38070. Header: res.Header,
  38071. }
  38072. }
  38073. if err != nil {
  38074. return nil, err
  38075. }
  38076. defer googleapi.CloseBody(res)
  38077. if err := googleapi.CheckResponse(res); err != nil {
  38078. return nil, err
  38079. }
  38080. ret := &Operation{
  38081. ServerResponse: googleapi.ServerResponse{
  38082. Header: res.Header,
  38083. HTTPStatusCode: res.StatusCode,
  38084. },
  38085. }
  38086. target := &ret
  38087. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  38088. return nil, err
  38089. }
  38090. return ret, nil
  38091. // {
  38092. // "description": "Updates an autoscaler in the specified project using the data included in the request. This method supports patch semantics.",
  38093. // "httpMethod": "PATCH",
  38094. // "id": "compute.regionAutoscalers.patch",
  38095. // "parameterOrder": [
  38096. // "project",
  38097. // "region"
  38098. // ],
  38099. // "parameters": {
  38100. // "autoscaler": {
  38101. // "description": "Name of the autoscaler to patch.",
  38102. // "location": "query",
  38103. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  38104. // "type": "string"
  38105. // },
  38106. // "project": {
  38107. // "description": "Project ID for this request.",
  38108. // "location": "path",
  38109. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38110. // "required": true,
  38111. // "type": "string"
  38112. // },
  38113. // "region": {
  38114. // "description": "Name of the region scoping this request.",
  38115. // "location": "path",
  38116. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  38117. // "required": true,
  38118. // "type": "string"
  38119. // }
  38120. // },
  38121. // "path": "{project}/regions/{region}/autoscalers",
  38122. // "request": {
  38123. // "$ref": "Autoscaler"
  38124. // },
  38125. // "response": {
  38126. // "$ref": "Operation"
  38127. // },
  38128. // "scopes": [
  38129. // "https://www.googleapis.com/auth/cloud-platform",
  38130. // "https://www.googleapis.com/auth/compute",
  38131. // "https://www.googleapis.com/auth/compute.readonly"
  38132. // ]
  38133. // }
  38134. }
  38135. // method id "compute.regionAutoscalers.update":
  38136. type RegionAutoscalersUpdateCall struct {
  38137. s *Service
  38138. project string
  38139. region string
  38140. autoscaler *Autoscaler
  38141. urlParams_ gensupport.URLParams
  38142. ctx_ context.Context
  38143. header_ http.Header
  38144. }
  38145. // Update: Updates an autoscaler in the specified project using the data
  38146. // included in the request.
  38147. func (r *RegionAutoscalersService) Update(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersUpdateCall {
  38148. c := &RegionAutoscalersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38149. c.project = project
  38150. c.region = region
  38151. c.autoscaler = autoscaler
  38152. return c
  38153. }
  38154. // Autoscaler sets the optional parameter "autoscaler": Name of the
  38155. // autoscaler to update.
  38156. func (c *RegionAutoscalersUpdateCall) Autoscaler(autoscaler string) *RegionAutoscalersUpdateCall {
  38157. c.urlParams_.Set("autoscaler", autoscaler)
  38158. return c
  38159. }
  38160. // Fields allows partial responses to be retrieved. See
  38161. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38162. // for more information.
  38163. func (c *RegionAutoscalersUpdateCall) Fields(s ...googleapi.Field) *RegionAutoscalersUpdateCall {
  38164. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38165. return c
  38166. }
  38167. // Context sets the context to be used in this call's Do method. Any
  38168. // pending HTTP request will be aborted if the provided context is
  38169. // canceled.
  38170. func (c *RegionAutoscalersUpdateCall) Context(ctx context.Context) *RegionAutoscalersUpdateCall {
  38171. c.ctx_ = ctx
  38172. return c
  38173. }
  38174. // Header returns an http.Header that can be modified by the caller to
  38175. // add HTTP headers to the request.
  38176. func (c *RegionAutoscalersUpdateCall) Header() http.Header {
  38177. if c.header_ == nil {
  38178. c.header_ = make(http.Header)
  38179. }
  38180. return c.header_
  38181. }
  38182. func (c *RegionAutoscalersUpdateCall) doRequest(alt string) (*http.Response, error) {
  38183. reqHeaders := make(http.Header)
  38184. for k, v := range c.header_ {
  38185. reqHeaders[k] = v
  38186. }
  38187. reqHeaders.Set("User-Agent", c.s.userAgent())
  38188. var body io.Reader = nil
  38189. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  38190. if err != nil {
  38191. return nil, err
  38192. }
  38193. reqHeaders.Set("Content-Type", "application/json")
  38194. c.urlParams_.Set("alt", alt)
  38195. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers")
  38196. urls += "?" + c.urlParams_.Encode()
  38197. req, _ := http.NewRequest("PUT", urls, body)
  38198. req.Header = reqHeaders
  38199. googleapi.Expand(req.URL, map[string]string{
  38200. "project": c.project,
  38201. "region": c.region,
  38202. })
  38203. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38204. }
  38205. // Do executes the "compute.regionAutoscalers.update" call.
  38206. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  38207. // status code is an error. Response headers are in either
  38208. // *Operation.ServerResponse.Header or (if a response was returned at
  38209. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  38210. // to check whether the returned error was because
  38211. // http.StatusNotModified was returned.
  38212. func (c *RegionAutoscalersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  38213. gensupport.SetOptions(c.urlParams_, opts...)
  38214. res, err := c.doRequest("json")
  38215. if res != nil && res.StatusCode == http.StatusNotModified {
  38216. if res.Body != nil {
  38217. res.Body.Close()
  38218. }
  38219. return nil, &googleapi.Error{
  38220. Code: res.StatusCode,
  38221. Header: res.Header,
  38222. }
  38223. }
  38224. if err != nil {
  38225. return nil, err
  38226. }
  38227. defer googleapi.CloseBody(res)
  38228. if err := googleapi.CheckResponse(res); err != nil {
  38229. return nil, err
  38230. }
  38231. ret := &Operation{
  38232. ServerResponse: googleapi.ServerResponse{
  38233. Header: res.Header,
  38234. HTTPStatusCode: res.StatusCode,
  38235. },
  38236. }
  38237. target := &ret
  38238. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  38239. return nil, err
  38240. }
  38241. return ret, nil
  38242. // {
  38243. // "description": "Updates an autoscaler in the specified project using the data included in the request.",
  38244. // "httpMethod": "PUT",
  38245. // "id": "compute.regionAutoscalers.update",
  38246. // "parameterOrder": [
  38247. // "project",
  38248. // "region"
  38249. // ],
  38250. // "parameters": {
  38251. // "autoscaler": {
  38252. // "description": "Name of the autoscaler to update.",
  38253. // "location": "query",
  38254. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  38255. // "type": "string"
  38256. // },
  38257. // "project": {
  38258. // "description": "Project ID for this request.",
  38259. // "location": "path",
  38260. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38261. // "required": true,
  38262. // "type": "string"
  38263. // },
  38264. // "region": {
  38265. // "description": "Name of the region scoping this request.",
  38266. // "location": "path",
  38267. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  38268. // "required": true,
  38269. // "type": "string"
  38270. // }
  38271. // },
  38272. // "path": "{project}/regions/{region}/autoscalers",
  38273. // "request": {
  38274. // "$ref": "Autoscaler"
  38275. // },
  38276. // "response": {
  38277. // "$ref": "Operation"
  38278. // },
  38279. // "scopes": [
  38280. // "https://www.googleapis.com/auth/cloud-platform",
  38281. // "https://www.googleapis.com/auth/compute"
  38282. // ]
  38283. // }
  38284. }
  38285. // method id "compute.regionBackendServices.delete":
  38286. type RegionBackendServicesDeleteCall struct {
  38287. s *Service
  38288. project string
  38289. region string
  38290. backendService string
  38291. urlParams_ gensupport.URLParams
  38292. ctx_ context.Context
  38293. header_ http.Header
  38294. }
  38295. // Delete: Deletes the specified regional BackendService resource.
  38296. func (r *RegionBackendServicesService) Delete(project string, region string, backendService string) *RegionBackendServicesDeleteCall {
  38297. c := &RegionBackendServicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38298. c.project = project
  38299. c.region = region
  38300. c.backendService = backendService
  38301. return c
  38302. }
  38303. // Fields allows partial responses to be retrieved. See
  38304. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38305. // for more information.
  38306. func (c *RegionBackendServicesDeleteCall) Fields(s ...googleapi.Field) *RegionBackendServicesDeleteCall {
  38307. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38308. return c
  38309. }
  38310. // Context sets the context to be used in this call's Do method. Any
  38311. // pending HTTP request will be aborted if the provided context is
  38312. // canceled.
  38313. func (c *RegionBackendServicesDeleteCall) Context(ctx context.Context) *RegionBackendServicesDeleteCall {
  38314. c.ctx_ = ctx
  38315. return c
  38316. }
  38317. // Header returns an http.Header that can be modified by the caller to
  38318. // add HTTP headers to the request.
  38319. func (c *RegionBackendServicesDeleteCall) Header() http.Header {
  38320. if c.header_ == nil {
  38321. c.header_ = make(http.Header)
  38322. }
  38323. return c.header_
  38324. }
  38325. func (c *RegionBackendServicesDeleteCall) doRequest(alt string) (*http.Response, error) {
  38326. reqHeaders := make(http.Header)
  38327. for k, v := range c.header_ {
  38328. reqHeaders[k] = v
  38329. }
  38330. reqHeaders.Set("User-Agent", c.s.userAgent())
  38331. var body io.Reader = nil
  38332. c.urlParams_.Set("alt", alt)
  38333. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}")
  38334. urls += "?" + c.urlParams_.Encode()
  38335. req, _ := http.NewRequest("DELETE", urls, body)
  38336. req.Header = reqHeaders
  38337. googleapi.Expand(req.URL, map[string]string{
  38338. "project": c.project,
  38339. "region": c.region,
  38340. "backendService": c.backendService,
  38341. })
  38342. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38343. }
  38344. // Do executes the "compute.regionBackendServices.delete" call.
  38345. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  38346. // status code is an error. Response headers are in either
  38347. // *Operation.ServerResponse.Header or (if a response was returned at
  38348. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  38349. // to check whether the returned error was because
  38350. // http.StatusNotModified was returned.
  38351. func (c *RegionBackendServicesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  38352. gensupport.SetOptions(c.urlParams_, opts...)
  38353. res, err := c.doRequest("json")
  38354. if res != nil && res.StatusCode == http.StatusNotModified {
  38355. if res.Body != nil {
  38356. res.Body.Close()
  38357. }
  38358. return nil, &googleapi.Error{
  38359. Code: res.StatusCode,
  38360. Header: res.Header,
  38361. }
  38362. }
  38363. if err != nil {
  38364. return nil, err
  38365. }
  38366. defer googleapi.CloseBody(res)
  38367. if err := googleapi.CheckResponse(res); err != nil {
  38368. return nil, err
  38369. }
  38370. ret := &Operation{
  38371. ServerResponse: googleapi.ServerResponse{
  38372. Header: res.Header,
  38373. HTTPStatusCode: res.StatusCode,
  38374. },
  38375. }
  38376. target := &ret
  38377. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  38378. return nil, err
  38379. }
  38380. return ret, nil
  38381. // {
  38382. // "description": "Deletes the specified regional BackendService resource.",
  38383. // "httpMethod": "DELETE",
  38384. // "id": "compute.regionBackendServices.delete",
  38385. // "parameterOrder": [
  38386. // "project",
  38387. // "region",
  38388. // "backendService"
  38389. // ],
  38390. // "parameters": {
  38391. // "backendService": {
  38392. // "description": "Name of the BackendService resource to delete.",
  38393. // "location": "path",
  38394. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  38395. // "required": true,
  38396. // "type": "string"
  38397. // },
  38398. // "project": {
  38399. // "description": "Project ID for this request.",
  38400. // "location": "path",
  38401. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38402. // "required": true,
  38403. // "type": "string"
  38404. // },
  38405. // "region": {
  38406. // "description": "Name of the region scoping this request.",
  38407. // "location": "path",
  38408. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  38409. // "required": true,
  38410. // "type": "string"
  38411. // }
  38412. // },
  38413. // "path": "{project}/regions/{region}/backendServices/{backendService}",
  38414. // "response": {
  38415. // "$ref": "Operation"
  38416. // },
  38417. // "scopes": [
  38418. // "https://www.googleapis.com/auth/cloud-platform",
  38419. // "https://www.googleapis.com/auth/compute"
  38420. // ]
  38421. // }
  38422. }
  38423. // method id "compute.regionBackendServices.get":
  38424. type RegionBackendServicesGetCall struct {
  38425. s *Service
  38426. project string
  38427. region string
  38428. backendService string
  38429. urlParams_ gensupport.URLParams
  38430. ifNoneMatch_ string
  38431. ctx_ context.Context
  38432. header_ http.Header
  38433. }
  38434. // Get: Returns the specified regional BackendService resource.
  38435. func (r *RegionBackendServicesService) Get(project string, region string, backendService string) *RegionBackendServicesGetCall {
  38436. c := &RegionBackendServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38437. c.project = project
  38438. c.region = region
  38439. c.backendService = backendService
  38440. return c
  38441. }
  38442. // Fields allows partial responses to be retrieved. See
  38443. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38444. // for more information.
  38445. func (c *RegionBackendServicesGetCall) Fields(s ...googleapi.Field) *RegionBackendServicesGetCall {
  38446. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38447. return c
  38448. }
  38449. // IfNoneMatch sets the optional parameter which makes the operation
  38450. // fail if the object's ETag matches the given value. This is useful for
  38451. // getting updates only after the object has changed since the last
  38452. // request. Use googleapi.IsNotModified to check whether the response
  38453. // error from Do is the result of In-None-Match.
  38454. func (c *RegionBackendServicesGetCall) IfNoneMatch(entityTag string) *RegionBackendServicesGetCall {
  38455. c.ifNoneMatch_ = entityTag
  38456. return c
  38457. }
  38458. // Context sets the context to be used in this call's Do method. Any
  38459. // pending HTTP request will be aborted if the provided context is
  38460. // canceled.
  38461. func (c *RegionBackendServicesGetCall) Context(ctx context.Context) *RegionBackendServicesGetCall {
  38462. c.ctx_ = ctx
  38463. return c
  38464. }
  38465. // Header returns an http.Header that can be modified by the caller to
  38466. // add HTTP headers to the request.
  38467. func (c *RegionBackendServicesGetCall) Header() http.Header {
  38468. if c.header_ == nil {
  38469. c.header_ = make(http.Header)
  38470. }
  38471. return c.header_
  38472. }
  38473. func (c *RegionBackendServicesGetCall) doRequest(alt string) (*http.Response, error) {
  38474. reqHeaders := make(http.Header)
  38475. for k, v := range c.header_ {
  38476. reqHeaders[k] = v
  38477. }
  38478. reqHeaders.Set("User-Agent", c.s.userAgent())
  38479. if c.ifNoneMatch_ != "" {
  38480. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38481. }
  38482. var body io.Reader = nil
  38483. c.urlParams_.Set("alt", alt)
  38484. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}")
  38485. urls += "?" + c.urlParams_.Encode()
  38486. req, _ := http.NewRequest("GET", urls, body)
  38487. req.Header = reqHeaders
  38488. googleapi.Expand(req.URL, map[string]string{
  38489. "project": c.project,
  38490. "region": c.region,
  38491. "backendService": c.backendService,
  38492. })
  38493. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38494. }
  38495. // Do executes the "compute.regionBackendServices.get" call.
  38496. // Exactly one of *BackendService or error will be non-nil. Any non-2xx
  38497. // status code is an error. Response headers are in either
  38498. // *BackendService.ServerResponse.Header or (if a response was returned
  38499. // at all) in error.(*googleapi.Error).Header. Use
  38500. // googleapi.IsNotModified to check whether the returned error was
  38501. // because http.StatusNotModified was returned.
  38502. func (c *RegionBackendServicesGetCall) Do(opts ...googleapi.CallOption) (*BackendService, error) {
  38503. gensupport.SetOptions(c.urlParams_, opts...)
  38504. res, err := c.doRequest("json")
  38505. if res != nil && res.StatusCode == http.StatusNotModified {
  38506. if res.Body != nil {
  38507. res.Body.Close()
  38508. }
  38509. return nil, &googleapi.Error{
  38510. Code: res.StatusCode,
  38511. Header: res.Header,
  38512. }
  38513. }
  38514. if err != nil {
  38515. return nil, err
  38516. }
  38517. defer googleapi.CloseBody(res)
  38518. if err := googleapi.CheckResponse(res); err != nil {
  38519. return nil, err
  38520. }
  38521. ret := &BackendService{
  38522. ServerResponse: googleapi.ServerResponse{
  38523. Header: res.Header,
  38524. HTTPStatusCode: res.StatusCode,
  38525. },
  38526. }
  38527. target := &ret
  38528. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  38529. return nil, err
  38530. }
  38531. return ret, nil
  38532. // {
  38533. // "description": "Returns the specified regional BackendService resource.",
  38534. // "httpMethod": "GET",
  38535. // "id": "compute.regionBackendServices.get",
  38536. // "parameterOrder": [
  38537. // "project",
  38538. // "region",
  38539. // "backendService"
  38540. // ],
  38541. // "parameters": {
  38542. // "backendService": {
  38543. // "description": "Name of the BackendService resource to return.",
  38544. // "location": "path",
  38545. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  38546. // "required": true,
  38547. // "type": "string"
  38548. // },
  38549. // "project": {
  38550. // "description": "Project ID for this request.",
  38551. // "location": "path",
  38552. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38553. // "required": true,
  38554. // "type": "string"
  38555. // },
  38556. // "region": {
  38557. // "description": "Name of the region scoping this request.",
  38558. // "location": "path",
  38559. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  38560. // "required": true,
  38561. // "type": "string"
  38562. // }
  38563. // },
  38564. // "path": "{project}/regions/{region}/backendServices/{backendService}",
  38565. // "response": {
  38566. // "$ref": "BackendService"
  38567. // },
  38568. // "scopes": [
  38569. // "https://www.googleapis.com/auth/cloud-platform",
  38570. // "https://www.googleapis.com/auth/compute",
  38571. // "https://www.googleapis.com/auth/compute.readonly"
  38572. // ]
  38573. // }
  38574. }
  38575. // method id "compute.regionBackendServices.getHealth":
  38576. type RegionBackendServicesGetHealthCall struct {
  38577. s *Service
  38578. project string
  38579. region string
  38580. backendService string
  38581. resourcegroupreference *ResourceGroupReference
  38582. urlParams_ gensupport.URLParams
  38583. ctx_ context.Context
  38584. header_ http.Header
  38585. }
  38586. // GetHealth: Gets the most recent health check results for this
  38587. // regional BackendService.
  38588. func (r *RegionBackendServicesService) GetHealth(project string, region string, backendService string, resourcegroupreference *ResourceGroupReference) *RegionBackendServicesGetHealthCall {
  38589. c := &RegionBackendServicesGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38590. c.project = project
  38591. c.region = region
  38592. c.backendService = backendService
  38593. c.resourcegroupreference = resourcegroupreference
  38594. return c
  38595. }
  38596. // Fields allows partial responses to be retrieved. See
  38597. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38598. // for more information.
  38599. func (c *RegionBackendServicesGetHealthCall) Fields(s ...googleapi.Field) *RegionBackendServicesGetHealthCall {
  38600. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38601. return c
  38602. }
  38603. // Context sets the context to be used in this call's Do method. Any
  38604. // pending HTTP request will be aborted if the provided context is
  38605. // canceled.
  38606. func (c *RegionBackendServicesGetHealthCall) Context(ctx context.Context) *RegionBackendServicesGetHealthCall {
  38607. c.ctx_ = ctx
  38608. return c
  38609. }
  38610. // Header returns an http.Header that can be modified by the caller to
  38611. // add HTTP headers to the request.
  38612. func (c *RegionBackendServicesGetHealthCall) Header() http.Header {
  38613. if c.header_ == nil {
  38614. c.header_ = make(http.Header)
  38615. }
  38616. return c.header_
  38617. }
  38618. func (c *RegionBackendServicesGetHealthCall) doRequest(alt string) (*http.Response, error) {
  38619. reqHeaders := make(http.Header)
  38620. for k, v := range c.header_ {
  38621. reqHeaders[k] = v
  38622. }
  38623. reqHeaders.Set("User-Agent", c.s.userAgent())
  38624. var body io.Reader = nil
  38625. body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcegroupreference)
  38626. if err != nil {
  38627. return nil, err
  38628. }
  38629. reqHeaders.Set("Content-Type", "application/json")
  38630. c.urlParams_.Set("alt", alt)
  38631. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}/getHealth")
  38632. urls += "?" + c.urlParams_.Encode()
  38633. req, _ := http.NewRequest("POST", urls, body)
  38634. req.Header = reqHeaders
  38635. googleapi.Expand(req.URL, map[string]string{
  38636. "project": c.project,
  38637. "region": c.region,
  38638. "backendService": c.backendService,
  38639. })
  38640. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38641. }
  38642. // Do executes the "compute.regionBackendServices.getHealth" call.
  38643. // Exactly one of *BackendServiceGroupHealth or error will be non-nil.
  38644. // Any non-2xx status code is an error. Response headers are in either
  38645. // *BackendServiceGroupHealth.ServerResponse.Header or (if a response
  38646. // was returned at all) in error.(*googleapi.Error).Header. Use
  38647. // googleapi.IsNotModified to check whether the returned error was
  38648. // because http.StatusNotModified was returned.
  38649. func (c *RegionBackendServicesGetHealthCall) Do(opts ...googleapi.CallOption) (*BackendServiceGroupHealth, error) {
  38650. gensupport.SetOptions(c.urlParams_, opts...)
  38651. res, err := c.doRequest("json")
  38652. if res != nil && res.StatusCode == http.StatusNotModified {
  38653. if res.Body != nil {
  38654. res.Body.Close()
  38655. }
  38656. return nil, &googleapi.Error{
  38657. Code: res.StatusCode,
  38658. Header: res.Header,
  38659. }
  38660. }
  38661. if err != nil {
  38662. return nil, err
  38663. }
  38664. defer googleapi.CloseBody(res)
  38665. if err := googleapi.CheckResponse(res); err != nil {
  38666. return nil, err
  38667. }
  38668. ret := &BackendServiceGroupHealth{
  38669. ServerResponse: googleapi.ServerResponse{
  38670. Header: res.Header,
  38671. HTTPStatusCode: res.StatusCode,
  38672. },
  38673. }
  38674. target := &ret
  38675. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  38676. return nil, err
  38677. }
  38678. return ret, nil
  38679. // {
  38680. // "description": "Gets the most recent health check results for this regional BackendService.",
  38681. // "httpMethod": "POST",
  38682. // "id": "compute.regionBackendServices.getHealth",
  38683. // "parameterOrder": [
  38684. // "project",
  38685. // "region",
  38686. // "backendService"
  38687. // ],
  38688. // "parameters": {
  38689. // "backendService": {
  38690. // "description": "Name of the BackendService resource to which the queried instance belongs.",
  38691. // "location": "path",
  38692. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  38693. // "required": true,
  38694. // "type": "string"
  38695. // },
  38696. // "project": {
  38697. // "location": "path",
  38698. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38699. // "required": true,
  38700. // "type": "string"
  38701. // },
  38702. // "region": {
  38703. // "description": "Name of the region scoping this request.",
  38704. // "location": "path",
  38705. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  38706. // "required": true,
  38707. // "type": "string"
  38708. // }
  38709. // },
  38710. // "path": "{project}/regions/{region}/backendServices/{backendService}/getHealth",
  38711. // "request": {
  38712. // "$ref": "ResourceGroupReference"
  38713. // },
  38714. // "response": {
  38715. // "$ref": "BackendServiceGroupHealth"
  38716. // },
  38717. // "scopes": [
  38718. // "https://www.googleapis.com/auth/cloud-platform",
  38719. // "https://www.googleapis.com/auth/compute",
  38720. // "https://www.googleapis.com/auth/compute.readonly"
  38721. // ]
  38722. // }
  38723. }
  38724. // method id "compute.regionBackendServices.insert":
  38725. type RegionBackendServicesInsertCall struct {
  38726. s *Service
  38727. project string
  38728. region string
  38729. backendservice *BackendService
  38730. urlParams_ gensupport.URLParams
  38731. ctx_ context.Context
  38732. header_ http.Header
  38733. }
  38734. // Insert: Creates a regional BackendService resource in the specified
  38735. // project using the data included in the request. There are several
  38736. // restrictions and guidelines to keep in mind when creating a regional
  38737. // backend service. Read Restrictions and Guidelines for more
  38738. // information.
  38739. func (r *RegionBackendServicesService) Insert(project string, region string, backendservice *BackendService) *RegionBackendServicesInsertCall {
  38740. c := &RegionBackendServicesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38741. c.project = project
  38742. c.region = region
  38743. c.backendservice = backendservice
  38744. return c
  38745. }
  38746. // Fields allows partial responses to be retrieved. See
  38747. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38748. // for more information.
  38749. func (c *RegionBackendServicesInsertCall) Fields(s ...googleapi.Field) *RegionBackendServicesInsertCall {
  38750. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38751. return c
  38752. }
  38753. // Context sets the context to be used in this call's Do method. Any
  38754. // pending HTTP request will be aborted if the provided context is
  38755. // canceled.
  38756. func (c *RegionBackendServicesInsertCall) Context(ctx context.Context) *RegionBackendServicesInsertCall {
  38757. c.ctx_ = ctx
  38758. return c
  38759. }
  38760. // Header returns an http.Header that can be modified by the caller to
  38761. // add HTTP headers to the request.
  38762. func (c *RegionBackendServicesInsertCall) Header() http.Header {
  38763. if c.header_ == nil {
  38764. c.header_ = make(http.Header)
  38765. }
  38766. return c.header_
  38767. }
  38768. func (c *RegionBackendServicesInsertCall) doRequest(alt string) (*http.Response, error) {
  38769. reqHeaders := make(http.Header)
  38770. for k, v := range c.header_ {
  38771. reqHeaders[k] = v
  38772. }
  38773. reqHeaders.Set("User-Agent", c.s.userAgent())
  38774. var body io.Reader = nil
  38775. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  38776. if err != nil {
  38777. return nil, err
  38778. }
  38779. reqHeaders.Set("Content-Type", "application/json")
  38780. c.urlParams_.Set("alt", alt)
  38781. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices")
  38782. urls += "?" + c.urlParams_.Encode()
  38783. req, _ := http.NewRequest("POST", urls, body)
  38784. req.Header = reqHeaders
  38785. googleapi.Expand(req.URL, map[string]string{
  38786. "project": c.project,
  38787. "region": c.region,
  38788. })
  38789. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38790. }
  38791. // Do executes the "compute.regionBackendServices.insert" call.
  38792. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  38793. // status code is an error. Response headers are in either
  38794. // *Operation.ServerResponse.Header or (if a response was returned at
  38795. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  38796. // to check whether the returned error was because
  38797. // http.StatusNotModified was returned.
  38798. func (c *RegionBackendServicesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  38799. gensupport.SetOptions(c.urlParams_, opts...)
  38800. res, err := c.doRequest("json")
  38801. if res != nil && res.StatusCode == http.StatusNotModified {
  38802. if res.Body != nil {
  38803. res.Body.Close()
  38804. }
  38805. return nil, &googleapi.Error{
  38806. Code: res.StatusCode,
  38807. Header: res.Header,
  38808. }
  38809. }
  38810. if err != nil {
  38811. return nil, err
  38812. }
  38813. defer googleapi.CloseBody(res)
  38814. if err := googleapi.CheckResponse(res); err != nil {
  38815. return nil, err
  38816. }
  38817. ret := &Operation{
  38818. ServerResponse: googleapi.ServerResponse{
  38819. Header: res.Header,
  38820. HTTPStatusCode: res.StatusCode,
  38821. },
  38822. }
  38823. target := &ret
  38824. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  38825. return nil, err
  38826. }
  38827. return ret, nil
  38828. // {
  38829. // "description": "Creates a regional BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to keep in mind when creating a regional backend service. Read Restrictions and Guidelines for more information.",
  38830. // "httpMethod": "POST",
  38831. // "id": "compute.regionBackendServices.insert",
  38832. // "parameterOrder": [
  38833. // "project",
  38834. // "region"
  38835. // ],
  38836. // "parameters": {
  38837. // "project": {
  38838. // "description": "Project ID for this request.",
  38839. // "location": "path",
  38840. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38841. // "required": true,
  38842. // "type": "string"
  38843. // },
  38844. // "region": {
  38845. // "description": "Name of the region scoping this request.",
  38846. // "location": "path",
  38847. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  38848. // "required": true,
  38849. // "type": "string"
  38850. // }
  38851. // },
  38852. // "path": "{project}/regions/{region}/backendServices",
  38853. // "request": {
  38854. // "$ref": "BackendService"
  38855. // },
  38856. // "response": {
  38857. // "$ref": "Operation"
  38858. // },
  38859. // "scopes": [
  38860. // "https://www.googleapis.com/auth/cloud-platform",
  38861. // "https://www.googleapis.com/auth/compute"
  38862. // ]
  38863. // }
  38864. }
  38865. // method id "compute.regionBackendServices.list":
  38866. type RegionBackendServicesListCall struct {
  38867. s *Service
  38868. project string
  38869. region string
  38870. urlParams_ gensupport.URLParams
  38871. ifNoneMatch_ string
  38872. ctx_ context.Context
  38873. header_ http.Header
  38874. }
  38875. // List: Retrieves the list of regional BackendService resources
  38876. // available to the specified project in the given region.
  38877. func (r *RegionBackendServicesService) List(project string, region string) *RegionBackendServicesListCall {
  38878. c := &RegionBackendServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38879. c.project = project
  38880. c.region = region
  38881. return c
  38882. }
  38883. // Filter sets the optional parameter "filter": Sets a filter
  38884. // {expression} for filtering listed resources. Your {expression} must
  38885. // be in the format: field_name comparison_string literal_string.
  38886. //
  38887. // The field_name is the name of the field you want to compare. Only
  38888. // atomic field types are supported (string, number, boolean). The
  38889. // comparison_string must be either eq (equals) or ne (not equals). The
  38890. // literal_string is the string value to filter to. The literal value
  38891. // must be valid for the type of field you are filtering by (string,
  38892. // number, boolean). For string fields, the literal value is interpreted
  38893. // as a regular expression using RE2 syntax. The literal value must
  38894. // match the entire field.
  38895. //
  38896. // For example, to filter for instances that do not have a name of
  38897. // example-instance, you would use name ne example-instance.
  38898. //
  38899. // You can filter on nested fields. For example, you could filter on
  38900. // instances that have set the scheduling.automaticRestart field to
  38901. // true. Use filtering on nested fields to take advantage of labels to
  38902. // organize and search for results based on label values.
  38903. //
  38904. // To filter on multiple expressions, provide each separate expression
  38905. // within parentheses. For example, (scheduling.automaticRestart eq
  38906. // true) (zone eq us-central1-f). Multiple expressions are treated as
  38907. // AND expressions, meaning that resources must match all expressions to
  38908. // pass the filters.
  38909. func (c *RegionBackendServicesListCall) Filter(filter string) *RegionBackendServicesListCall {
  38910. c.urlParams_.Set("filter", filter)
  38911. return c
  38912. }
  38913. // MaxResults sets the optional parameter "maxResults": The maximum
  38914. // number of results per page that should be returned. If the number of
  38915. // available results is larger than maxResults, Compute Engine returns a
  38916. // nextPageToken that can be used to get the next page of results in
  38917. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  38918. // (Default: 500)
  38919. func (c *RegionBackendServicesListCall) MaxResults(maxResults int64) *RegionBackendServicesListCall {
  38920. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  38921. return c
  38922. }
  38923. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  38924. // a certain order. By default, results are returned in alphanumerical
  38925. // order based on the resource name.
  38926. //
  38927. // You can also sort results in descending order based on the creation
  38928. // timestamp using orderBy="creationTimestamp desc". This sorts results
  38929. // based on the creationTimestamp field in reverse chronological order
  38930. // (newest result first). Use this to sort resources like operations so
  38931. // that the newest operation is returned first.
  38932. //
  38933. // Currently, only sorting by name or creationTimestamp desc is
  38934. // supported.
  38935. func (c *RegionBackendServicesListCall) OrderBy(orderBy string) *RegionBackendServicesListCall {
  38936. c.urlParams_.Set("orderBy", orderBy)
  38937. return c
  38938. }
  38939. // PageToken sets the optional parameter "pageToken": Specifies a page
  38940. // token to use. Set pageToken to the nextPageToken returned by a
  38941. // previous list request to get the next page of results.
  38942. func (c *RegionBackendServicesListCall) PageToken(pageToken string) *RegionBackendServicesListCall {
  38943. c.urlParams_.Set("pageToken", pageToken)
  38944. return c
  38945. }
  38946. // Fields allows partial responses to be retrieved. See
  38947. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38948. // for more information.
  38949. func (c *RegionBackendServicesListCall) Fields(s ...googleapi.Field) *RegionBackendServicesListCall {
  38950. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38951. return c
  38952. }
  38953. // IfNoneMatch sets the optional parameter which makes the operation
  38954. // fail if the object's ETag matches the given value. This is useful for
  38955. // getting updates only after the object has changed since the last
  38956. // request. Use googleapi.IsNotModified to check whether the response
  38957. // error from Do is the result of In-None-Match.
  38958. func (c *RegionBackendServicesListCall) IfNoneMatch(entityTag string) *RegionBackendServicesListCall {
  38959. c.ifNoneMatch_ = entityTag
  38960. return c
  38961. }
  38962. // Context sets the context to be used in this call's Do method. Any
  38963. // pending HTTP request will be aborted if the provided context is
  38964. // canceled.
  38965. func (c *RegionBackendServicesListCall) Context(ctx context.Context) *RegionBackendServicesListCall {
  38966. c.ctx_ = ctx
  38967. return c
  38968. }
  38969. // Header returns an http.Header that can be modified by the caller to
  38970. // add HTTP headers to the request.
  38971. func (c *RegionBackendServicesListCall) Header() http.Header {
  38972. if c.header_ == nil {
  38973. c.header_ = make(http.Header)
  38974. }
  38975. return c.header_
  38976. }
  38977. func (c *RegionBackendServicesListCall) doRequest(alt string) (*http.Response, error) {
  38978. reqHeaders := make(http.Header)
  38979. for k, v := range c.header_ {
  38980. reqHeaders[k] = v
  38981. }
  38982. reqHeaders.Set("User-Agent", c.s.userAgent())
  38983. if c.ifNoneMatch_ != "" {
  38984. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38985. }
  38986. var body io.Reader = nil
  38987. c.urlParams_.Set("alt", alt)
  38988. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices")
  38989. urls += "?" + c.urlParams_.Encode()
  38990. req, _ := http.NewRequest("GET", urls, body)
  38991. req.Header = reqHeaders
  38992. googleapi.Expand(req.URL, map[string]string{
  38993. "project": c.project,
  38994. "region": c.region,
  38995. })
  38996. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38997. }
  38998. // Do executes the "compute.regionBackendServices.list" call.
  38999. // Exactly one of *BackendServiceList or error will be non-nil. Any
  39000. // non-2xx status code is an error. Response headers are in either
  39001. // *BackendServiceList.ServerResponse.Header or (if a response was
  39002. // returned at all) in error.(*googleapi.Error).Header. Use
  39003. // googleapi.IsNotModified to check whether the returned error was
  39004. // because http.StatusNotModified was returned.
  39005. func (c *RegionBackendServicesListCall) Do(opts ...googleapi.CallOption) (*BackendServiceList, error) {
  39006. gensupport.SetOptions(c.urlParams_, opts...)
  39007. res, err := c.doRequest("json")
  39008. if res != nil && res.StatusCode == http.StatusNotModified {
  39009. if res.Body != nil {
  39010. res.Body.Close()
  39011. }
  39012. return nil, &googleapi.Error{
  39013. Code: res.StatusCode,
  39014. Header: res.Header,
  39015. }
  39016. }
  39017. if err != nil {
  39018. return nil, err
  39019. }
  39020. defer googleapi.CloseBody(res)
  39021. if err := googleapi.CheckResponse(res); err != nil {
  39022. return nil, err
  39023. }
  39024. ret := &BackendServiceList{
  39025. ServerResponse: googleapi.ServerResponse{
  39026. Header: res.Header,
  39027. HTTPStatusCode: res.StatusCode,
  39028. },
  39029. }
  39030. target := &ret
  39031. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  39032. return nil, err
  39033. }
  39034. return ret, nil
  39035. // {
  39036. // "description": "Retrieves the list of regional BackendService resources available to the specified project in the given region.",
  39037. // "httpMethod": "GET",
  39038. // "id": "compute.regionBackendServices.list",
  39039. // "parameterOrder": [
  39040. // "project",
  39041. // "region"
  39042. // ],
  39043. // "parameters": {
  39044. // "filter": {
  39045. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  39046. // "location": "query",
  39047. // "type": "string"
  39048. // },
  39049. // "maxResults": {
  39050. // "default": "500",
  39051. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  39052. // "format": "uint32",
  39053. // "location": "query",
  39054. // "minimum": "0",
  39055. // "type": "integer"
  39056. // },
  39057. // "orderBy": {
  39058. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  39059. // "location": "query",
  39060. // "type": "string"
  39061. // },
  39062. // "pageToken": {
  39063. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  39064. // "location": "query",
  39065. // "type": "string"
  39066. // },
  39067. // "project": {
  39068. // "description": "Project ID for this request.",
  39069. // "location": "path",
  39070. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39071. // "required": true,
  39072. // "type": "string"
  39073. // },
  39074. // "region": {
  39075. // "description": "Name of the region scoping this request.",
  39076. // "location": "path",
  39077. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  39078. // "required": true,
  39079. // "type": "string"
  39080. // }
  39081. // },
  39082. // "path": "{project}/regions/{region}/backendServices",
  39083. // "response": {
  39084. // "$ref": "BackendServiceList"
  39085. // },
  39086. // "scopes": [
  39087. // "https://www.googleapis.com/auth/cloud-platform",
  39088. // "https://www.googleapis.com/auth/compute",
  39089. // "https://www.googleapis.com/auth/compute.readonly"
  39090. // ]
  39091. // }
  39092. }
  39093. // Pages invokes f for each page of results.
  39094. // A non-nil error returned from f will halt the iteration.
  39095. // The provided context supersedes any context provided to the Context method.
  39096. func (c *RegionBackendServicesListCall) Pages(ctx context.Context, f func(*BackendServiceList) error) error {
  39097. c.ctx_ = ctx
  39098. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  39099. for {
  39100. x, err := c.Do()
  39101. if err != nil {
  39102. return err
  39103. }
  39104. if err := f(x); err != nil {
  39105. return err
  39106. }
  39107. if x.NextPageToken == "" {
  39108. return nil
  39109. }
  39110. c.PageToken(x.NextPageToken)
  39111. }
  39112. }
  39113. // method id "compute.regionBackendServices.patch":
  39114. type RegionBackendServicesPatchCall struct {
  39115. s *Service
  39116. project string
  39117. region string
  39118. backendService string
  39119. backendservice *BackendService
  39120. urlParams_ gensupport.URLParams
  39121. ctx_ context.Context
  39122. header_ http.Header
  39123. }
  39124. // Patch: Updates the specified regional BackendService resource with
  39125. // the data included in the request. There are several restrictions and
  39126. // guidelines to keep in mind when updating a backend service. Read
  39127. // Restrictions and Guidelines for more information. This method
  39128. // supports patch semantics.
  39129. func (r *RegionBackendServicesService) Patch(project string, region string, backendService string, backendservice *BackendService) *RegionBackendServicesPatchCall {
  39130. c := &RegionBackendServicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39131. c.project = project
  39132. c.region = region
  39133. c.backendService = backendService
  39134. c.backendservice = backendservice
  39135. return c
  39136. }
  39137. // Fields allows partial responses to be retrieved. See
  39138. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39139. // for more information.
  39140. func (c *RegionBackendServicesPatchCall) Fields(s ...googleapi.Field) *RegionBackendServicesPatchCall {
  39141. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39142. return c
  39143. }
  39144. // Context sets the context to be used in this call's Do method. Any
  39145. // pending HTTP request will be aborted if the provided context is
  39146. // canceled.
  39147. func (c *RegionBackendServicesPatchCall) Context(ctx context.Context) *RegionBackendServicesPatchCall {
  39148. c.ctx_ = ctx
  39149. return c
  39150. }
  39151. // Header returns an http.Header that can be modified by the caller to
  39152. // add HTTP headers to the request.
  39153. func (c *RegionBackendServicesPatchCall) Header() http.Header {
  39154. if c.header_ == nil {
  39155. c.header_ = make(http.Header)
  39156. }
  39157. return c.header_
  39158. }
  39159. func (c *RegionBackendServicesPatchCall) doRequest(alt string) (*http.Response, error) {
  39160. reqHeaders := make(http.Header)
  39161. for k, v := range c.header_ {
  39162. reqHeaders[k] = v
  39163. }
  39164. reqHeaders.Set("User-Agent", c.s.userAgent())
  39165. var body io.Reader = nil
  39166. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  39167. if err != nil {
  39168. return nil, err
  39169. }
  39170. reqHeaders.Set("Content-Type", "application/json")
  39171. c.urlParams_.Set("alt", alt)
  39172. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}")
  39173. urls += "?" + c.urlParams_.Encode()
  39174. req, _ := http.NewRequest("PATCH", urls, body)
  39175. req.Header = reqHeaders
  39176. googleapi.Expand(req.URL, map[string]string{
  39177. "project": c.project,
  39178. "region": c.region,
  39179. "backendService": c.backendService,
  39180. })
  39181. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39182. }
  39183. // Do executes the "compute.regionBackendServices.patch" call.
  39184. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  39185. // status code is an error. Response headers are in either
  39186. // *Operation.ServerResponse.Header or (if a response was returned at
  39187. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39188. // to check whether the returned error was because
  39189. // http.StatusNotModified was returned.
  39190. func (c *RegionBackendServicesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  39191. gensupport.SetOptions(c.urlParams_, opts...)
  39192. res, err := c.doRequest("json")
  39193. if res != nil && res.StatusCode == http.StatusNotModified {
  39194. if res.Body != nil {
  39195. res.Body.Close()
  39196. }
  39197. return nil, &googleapi.Error{
  39198. Code: res.StatusCode,
  39199. Header: res.Header,
  39200. }
  39201. }
  39202. if err != nil {
  39203. return nil, err
  39204. }
  39205. defer googleapi.CloseBody(res)
  39206. if err := googleapi.CheckResponse(res); err != nil {
  39207. return nil, err
  39208. }
  39209. ret := &Operation{
  39210. ServerResponse: googleapi.ServerResponse{
  39211. Header: res.Header,
  39212. HTTPStatusCode: res.StatusCode,
  39213. },
  39214. }
  39215. target := &ret
  39216. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  39217. return nil, err
  39218. }
  39219. return ret, nil
  39220. // {
  39221. // "description": "Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports patch semantics.",
  39222. // "httpMethod": "PATCH",
  39223. // "id": "compute.regionBackendServices.patch",
  39224. // "parameterOrder": [
  39225. // "project",
  39226. // "region",
  39227. // "backendService"
  39228. // ],
  39229. // "parameters": {
  39230. // "backendService": {
  39231. // "description": "Name of the BackendService resource to patch.",
  39232. // "location": "path",
  39233. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  39234. // "required": true,
  39235. // "type": "string"
  39236. // },
  39237. // "project": {
  39238. // "description": "Project ID for this request.",
  39239. // "location": "path",
  39240. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39241. // "required": true,
  39242. // "type": "string"
  39243. // },
  39244. // "region": {
  39245. // "description": "Name of the region scoping this request.",
  39246. // "location": "path",
  39247. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  39248. // "required": true,
  39249. // "type": "string"
  39250. // }
  39251. // },
  39252. // "path": "{project}/regions/{region}/backendServices/{backendService}",
  39253. // "request": {
  39254. // "$ref": "BackendService"
  39255. // },
  39256. // "response": {
  39257. // "$ref": "Operation"
  39258. // },
  39259. // "scopes": [
  39260. // "https://www.googleapis.com/auth/cloud-platform",
  39261. // "https://www.googleapis.com/auth/compute",
  39262. // "https://www.googleapis.com/auth/compute.readonly"
  39263. // ]
  39264. // }
  39265. }
  39266. // method id "compute.regionBackendServices.update":
  39267. type RegionBackendServicesUpdateCall struct {
  39268. s *Service
  39269. project string
  39270. region string
  39271. backendService string
  39272. backendservice *BackendService
  39273. urlParams_ gensupport.URLParams
  39274. ctx_ context.Context
  39275. header_ http.Header
  39276. }
  39277. // Update: Updates the specified regional BackendService resource with
  39278. // the data included in the request. There are several restrictions and
  39279. // guidelines to keep in mind when updating a backend service. Read
  39280. // Restrictions and Guidelines for more information.
  39281. func (r *RegionBackendServicesService) Update(project string, region string, backendService string, backendservice *BackendService) *RegionBackendServicesUpdateCall {
  39282. c := &RegionBackendServicesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39283. c.project = project
  39284. c.region = region
  39285. c.backendService = backendService
  39286. c.backendservice = backendservice
  39287. return c
  39288. }
  39289. // Fields allows partial responses to be retrieved. See
  39290. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39291. // for more information.
  39292. func (c *RegionBackendServicesUpdateCall) Fields(s ...googleapi.Field) *RegionBackendServicesUpdateCall {
  39293. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39294. return c
  39295. }
  39296. // Context sets the context to be used in this call's Do method. Any
  39297. // pending HTTP request will be aborted if the provided context is
  39298. // canceled.
  39299. func (c *RegionBackendServicesUpdateCall) Context(ctx context.Context) *RegionBackendServicesUpdateCall {
  39300. c.ctx_ = ctx
  39301. return c
  39302. }
  39303. // Header returns an http.Header that can be modified by the caller to
  39304. // add HTTP headers to the request.
  39305. func (c *RegionBackendServicesUpdateCall) Header() http.Header {
  39306. if c.header_ == nil {
  39307. c.header_ = make(http.Header)
  39308. }
  39309. return c.header_
  39310. }
  39311. func (c *RegionBackendServicesUpdateCall) doRequest(alt string) (*http.Response, error) {
  39312. reqHeaders := make(http.Header)
  39313. for k, v := range c.header_ {
  39314. reqHeaders[k] = v
  39315. }
  39316. reqHeaders.Set("User-Agent", c.s.userAgent())
  39317. var body io.Reader = nil
  39318. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  39319. if err != nil {
  39320. return nil, err
  39321. }
  39322. reqHeaders.Set("Content-Type", "application/json")
  39323. c.urlParams_.Set("alt", alt)
  39324. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}")
  39325. urls += "?" + c.urlParams_.Encode()
  39326. req, _ := http.NewRequest("PUT", urls, body)
  39327. req.Header = reqHeaders
  39328. googleapi.Expand(req.URL, map[string]string{
  39329. "project": c.project,
  39330. "region": c.region,
  39331. "backendService": c.backendService,
  39332. })
  39333. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39334. }
  39335. // Do executes the "compute.regionBackendServices.update" call.
  39336. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  39337. // status code is an error. Response headers are in either
  39338. // *Operation.ServerResponse.Header or (if a response was returned at
  39339. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39340. // to check whether the returned error was because
  39341. // http.StatusNotModified was returned.
  39342. func (c *RegionBackendServicesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  39343. gensupport.SetOptions(c.urlParams_, opts...)
  39344. res, err := c.doRequest("json")
  39345. if res != nil && res.StatusCode == http.StatusNotModified {
  39346. if res.Body != nil {
  39347. res.Body.Close()
  39348. }
  39349. return nil, &googleapi.Error{
  39350. Code: res.StatusCode,
  39351. Header: res.Header,
  39352. }
  39353. }
  39354. if err != nil {
  39355. return nil, err
  39356. }
  39357. defer googleapi.CloseBody(res)
  39358. if err := googleapi.CheckResponse(res); err != nil {
  39359. return nil, err
  39360. }
  39361. ret := &Operation{
  39362. ServerResponse: googleapi.ServerResponse{
  39363. Header: res.Header,
  39364. HTTPStatusCode: res.StatusCode,
  39365. },
  39366. }
  39367. target := &ret
  39368. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  39369. return nil, err
  39370. }
  39371. return ret, nil
  39372. // {
  39373. // "description": "Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information.",
  39374. // "httpMethod": "PUT",
  39375. // "id": "compute.regionBackendServices.update",
  39376. // "parameterOrder": [
  39377. // "project",
  39378. // "region",
  39379. // "backendService"
  39380. // ],
  39381. // "parameters": {
  39382. // "backendService": {
  39383. // "description": "Name of the BackendService resource to update.",
  39384. // "location": "path",
  39385. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  39386. // "required": true,
  39387. // "type": "string"
  39388. // },
  39389. // "project": {
  39390. // "description": "Project ID for this request.",
  39391. // "location": "path",
  39392. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39393. // "required": true,
  39394. // "type": "string"
  39395. // },
  39396. // "region": {
  39397. // "description": "Name of the region scoping this request.",
  39398. // "location": "path",
  39399. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  39400. // "required": true,
  39401. // "type": "string"
  39402. // }
  39403. // },
  39404. // "path": "{project}/regions/{region}/backendServices/{backendService}",
  39405. // "request": {
  39406. // "$ref": "BackendService"
  39407. // },
  39408. // "response": {
  39409. // "$ref": "Operation"
  39410. // },
  39411. // "scopes": [
  39412. // "https://www.googleapis.com/auth/cloud-platform",
  39413. // "https://www.googleapis.com/auth/compute"
  39414. // ]
  39415. // }
  39416. }
  39417. // method id "compute.regionInstanceGroupManagers.abandonInstances":
  39418. type RegionInstanceGroupManagersAbandonInstancesCall struct {
  39419. s *Service
  39420. project string
  39421. region string
  39422. instanceGroupManager string
  39423. regioninstancegroupmanagersabandoninstancesrequest *RegionInstanceGroupManagersAbandonInstancesRequest
  39424. urlParams_ gensupport.URLParams
  39425. ctx_ context.Context
  39426. header_ http.Header
  39427. }
  39428. // AbandonInstances: Schedules a group action to remove the specified
  39429. // instances from the managed instance group. Abandoning an instance
  39430. // does not delete the instance, but it does remove the instance from
  39431. // any target pools that are applied by the managed instance group. This
  39432. // method reduces the targetSize of the managed instance group by the
  39433. // number of instances that you abandon. This operation is marked as
  39434. // DONE when the action is scheduled even if the instances have not yet
  39435. // been removed from the group. You must separately verify the status of
  39436. // the abandoning action with the listmanagedinstances method.
  39437. //
  39438. // If the group is part of a backend service that has enabled connection
  39439. // draining, it can take up to 60 seconds after the connection draining
  39440. // duration has elapsed before the VM instance is removed or
  39441. // deleted.
  39442. //
  39443. // You can specify a maximum of 1000 instances with this method per
  39444. // request.
  39445. func (r *RegionInstanceGroupManagersService) AbandonInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersabandoninstancesrequest *RegionInstanceGroupManagersAbandonInstancesRequest) *RegionInstanceGroupManagersAbandonInstancesCall {
  39446. c := &RegionInstanceGroupManagersAbandonInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39447. c.project = project
  39448. c.region = region
  39449. c.instanceGroupManager = instanceGroupManager
  39450. c.regioninstancegroupmanagersabandoninstancesrequest = regioninstancegroupmanagersabandoninstancesrequest
  39451. return c
  39452. }
  39453. // Fields allows partial responses to be retrieved. See
  39454. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39455. // for more information.
  39456. func (c *RegionInstanceGroupManagersAbandonInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersAbandonInstancesCall {
  39457. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39458. return c
  39459. }
  39460. // Context sets the context to be used in this call's Do method. Any
  39461. // pending HTTP request will be aborted if the provided context is
  39462. // canceled.
  39463. func (c *RegionInstanceGroupManagersAbandonInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersAbandonInstancesCall {
  39464. c.ctx_ = ctx
  39465. return c
  39466. }
  39467. // Header returns an http.Header that can be modified by the caller to
  39468. // add HTTP headers to the request.
  39469. func (c *RegionInstanceGroupManagersAbandonInstancesCall) Header() http.Header {
  39470. if c.header_ == nil {
  39471. c.header_ = make(http.Header)
  39472. }
  39473. return c.header_
  39474. }
  39475. func (c *RegionInstanceGroupManagersAbandonInstancesCall) doRequest(alt string) (*http.Response, error) {
  39476. reqHeaders := make(http.Header)
  39477. for k, v := range c.header_ {
  39478. reqHeaders[k] = v
  39479. }
  39480. reqHeaders.Set("User-Agent", c.s.userAgent())
  39481. var body io.Reader = nil
  39482. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersabandoninstancesrequest)
  39483. if err != nil {
  39484. return nil, err
  39485. }
  39486. reqHeaders.Set("Content-Type", "application/json")
  39487. c.urlParams_.Set("alt", alt)
  39488. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/abandonInstances")
  39489. urls += "?" + c.urlParams_.Encode()
  39490. req, _ := http.NewRequest("POST", urls, body)
  39491. req.Header = reqHeaders
  39492. googleapi.Expand(req.URL, map[string]string{
  39493. "project": c.project,
  39494. "region": c.region,
  39495. "instanceGroupManager": c.instanceGroupManager,
  39496. })
  39497. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39498. }
  39499. // Do executes the "compute.regionInstanceGroupManagers.abandonInstances" call.
  39500. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  39501. // status code is an error. Response headers are in either
  39502. // *Operation.ServerResponse.Header or (if a response was returned at
  39503. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39504. // to check whether the returned error was because
  39505. // http.StatusNotModified was returned.
  39506. func (c *RegionInstanceGroupManagersAbandonInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  39507. gensupport.SetOptions(c.urlParams_, opts...)
  39508. res, err := c.doRequest("json")
  39509. if res != nil && res.StatusCode == http.StatusNotModified {
  39510. if res.Body != nil {
  39511. res.Body.Close()
  39512. }
  39513. return nil, &googleapi.Error{
  39514. Code: res.StatusCode,
  39515. Header: res.Header,
  39516. }
  39517. }
  39518. if err != nil {
  39519. return nil, err
  39520. }
  39521. defer googleapi.CloseBody(res)
  39522. if err := googleapi.CheckResponse(res); err != nil {
  39523. return nil, err
  39524. }
  39525. ret := &Operation{
  39526. ServerResponse: googleapi.ServerResponse{
  39527. Header: res.Header,
  39528. HTTPStatusCode: res.StatusCode,
  39529. },
  39530. }
  39531. target := &ret
  39532. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  39533. return nil, err
  39534. }
  39535. return ret, nil
  39536. // {
  39537. // "description": "Schedules a group action to remove the specified instances from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.\n\nYou can specify a maximum of 1000 instances with this method per request.",
  39538. // "httpMethod": "POST",
  39539. // "id": "compute.regionInstanceGroupManagers.abandonInstances",
  39540. // "parameterOrder": [
  39541. // "project",
  39542. // "region",
  39543. // "instanceGroupManager"
  39544. // ],
  39545. // "parameters": {
  39546. // "instanceGroupManager": {
  39547. // "description": "Name of the managed instance group.",
  39548. // "location": "path",
  39549. // "required": true,
  39550. // "type": "string"
  39551. // },
  39552. // "project": {
  39553. // "description": "Project ID for this request.",
  39554. // "location": "path",
  39555. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39556. // "required": true,
  39557. // "type": "string"
  39558. // },
  39559. // "region": {
  39560. // "description": "Name of the region scoping this request.",
  39561. // "location": "path",
  39562. // "required": true,
  39563. // "type": "string"
  39564. // }
  39565. // },
  39566. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/abandonInstances",
  39567. // "request": {
  39568. // "$ref": "RegionInstanceGroupManagersAbandonInstancesRequest"
  39569. // },
  39570. // "response": {
  39571. // "$ref": "Operation"
  39572. // },
  39573. // "scopes": [
  39574. // "https://www.googleapis.com/auth/cloud-platform",
  39575. // "https://www.googleapis.com/auth/compute"
  39576. // ]
  39577. // }
  39578. }
  39579. // method id "compute.regionInstanceGroupManagers.delete":
  39580. type RegionInstanceGroupManagersDeleteCall struct {
  39581. s *Service
  39582. project string
  39583. region string
  39584. instanceGroupManager string
  39585. urlParams_ gensupport.URLParams
  39586. ctx_ context.Context
  39587. header_ http.Header
  39588. }
  39589. // Delete: Deletes the specified managed instance group and all of the
  39590. // instances in that group.
  39591. func (r *RegionInstanceGroupManagersService) Delete(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersDeleteCall {
  39592. c := &RegionInstanceGroupManagersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39593. c.project = project
  39594. c.region = region
  39595. c.instanceGroupManager = instanceGroupManager
  39596. return c
  39597. }
  39598. // Fields allows partial responses to be retrieved. See
  39599. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39600. // for more information.
  39601. func (c *RegionInstanceGroupManagersDeleteCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersDeleteCall {
  39602. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39603. return c
  39604. }
  39605. // Context sets the context to be used in this call's Do method. Any
  39606. // pending HTTP request will be aborted if the provided context is
  39607. // canceled.
  39608. func (c *RegionInstanceGroupManagersDeleteCall) Context(ctx context.Context) *RegionInstanceGroupManagersDeleteCall {
  39609. c.ctx_ = ctx
  39610. return c
  39611. }
  39612. // Header returns an http.Header that can be modified by the caller to
  39613. // add HTTP headers to the request.
  39614. func (c *RegionInstanceGroupManagersDeleteCall) Header() http.Header {
  39615. if c.header_ == nil {
  39616. c.header_ = make(http.Header)
  39617. }
  39618. return c.header_
  39619. }
  39620. func (c *RegionInstanceGroupManagersDeleteCall) doRequest(alt string) (*http.Response, error) {
  39621. reqHeaders := make(http.Header)
  39622. for k, v := range c.header_ {
  39623. reqHeaders[k] = v
  39624. }
  39625. reqHeaders.Set("User-Agent", c.s.userAgent())
  39626. var body io.Reader = nil
  39627. c.urlParams_.Set("alt", alt)
  39628. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")
  39629. urls += "?" + c.urlParams_.Encode()
  39630. req, _ := http.NewRequest("DELETE", urls, body)
  39631. req.Header = reqHeaders
  39632. googleapi.Expand(req.URL, map[string]string{
  39633. "project": c.project,
  39634. "region": c.region,
  39635. "instanceGroupManager": c.instanceGroupManager,
  39636. })
  39637. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39638. }
  39639. // Do executes the "compute.regionInstanceGroupManagers.delete" call.
  39640. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  39641. // status code is an error. Response headers are in either
  39642. // *Operation.ServerResponse.Header or (if a response was returned at
  39643. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39644. // to check whether the returned error was because
  39645. // http.StatusNotModified was returned.
  39646. func (c *RegionInstanceGroupManagersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  39647. gensupport.SetOptions(c.urlParams_, opts...)
  39648. res, err := c.doRequest("json")
  39649. if res != nil && res.StatusCode == http.StatusNotModified {
  39650. if res.Body != nil {
  39651. res.Body.Close()
  39652. }
  39653. return nil, &googleapi.Error{
  39654. Code: res.StatusCode,
  39655. Header: res.Header,
  39656. }
  39657. }
  39658. if err != nil {
  39659. return nil, err
  39660. }
  39661. defer googleapi.CloseBody(res)
  39662. if err := googleapi.CheckResponse(res); err != nil {
  39663. return nil, err
  39664. }
  39665. ret := &Operation{
  39666. ServerResponse: googleapi.ServerResponse{
  39667. Header: res.Header,
  39668. HTTPStatusCode: res.StatusCode,
  39669. },
  39670. }
  39671. target := &ret
  39672. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  39673. return nil, err
  39674. }
  39675. return ret, nil
  39676. // {
  39677. // "description": "Deletes the specified managed instance group and all of the instances in that group.",
  39678. // "httpMethod": "DELETE",
  39679. // "id": "compute.regionInstanceGroupManagers.delete",
  39680. // "parameterOrder": [
  39681. // "project",
  39682. // "region",
  39683. // "instanceGroupManager"
  39684. // ],
  39685. // "parameters": {
  39686. // "instanceGroupManager": {
  39687. // "description": "Name of the managed instance group to delete.",
  39688. // "location": "path",
  39689. // "required": true,
  39690. // "type": "string"
  39691. // },
  39692. // "project": {
  39693. // "description": "Project ID for this request.",
  39694. // "location": "path",
  39695. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39696. // "required": true,
  39697. // "type": "string"
  39698. // },
  39699. // "region": {
  39700. // "description": "Name of the region scoping this request.",
  39701. // "location": "path",
  39702. // "required": true,
  39703. // "type": "string"
  39704. // }
  39705. // },
  39706. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}",
  39707. // "response": {
  39708. // "$ref": "Operation"
  39709. // },
  39710. // "scopes": [
  39711. // "https://www.googleapis.com/auth/cloud-platform",
  39712. // "https://www.googleapis.com/auth/compute"
  39713. // ]
  39714. // }
  39715. }
  39716. // method id "compute.regionInstanceGroupManagers.deleteInstances":
  39717. type RegionInstanceGroupManagersDeleteInstancesCall struct {
  39718. s *Service
  39719. project string
  39720. region string
  39721. instanceGroupManager string
  39722. regioninstancegroupmanagersdeleteinstancesrequest *RegionInstanceGroupManagersDeleteInstancesRequest
  39723. urlParams_ gensupport.URLParams
  39724. ctx_ context.Context
  39725. header_ http.Header
  39726. }
  39727. // DeleteInstances: Schedules a group action to delete the specified
  39728. // instances in the managed instance group. The instances are also
  39729. // removed from any target pools of which they were a member. This
  39730. // method reduces the targetSize of the managed instance group by the
  39731. // number of instances that you delete. This operation is marked as DONE
  39732. // when the action is scheduled even if the instances are still being
  39733. // deleted. You must separately verify the status of the deleting action
  39734. // with the listmanagedinstances method.
  39735. //
  39736. // If the group is part of a backend service that has enabled connection
  39737. // draining, it can take up to 60 seconds after the connection draining
  39738. // duration has elapsed before the VM instance is removed or
  39739. // deleted.
  39740. //
  39741. // You can specify a maximum of 1000 instances with this method per
  39742. // request.
  39743. func (r *RegionInstanceGroupManagersService) DeleteInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersdeleteinstancesrequest *RegionInstanceGroupManagersDeleteInstancesRequest) *RegionInstanceGroupManagersDeleteInstancesCall {
  39744. c := &RegionInstanceGroupManagersDeleteInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39745. c.project = project
  39746. c.region = region
  39747. c.instanceGroupManager = instanceGroupManager
  39748. c.regioninstancegroupmanagersdeleteinstancesrequest = regioninstancegroupmanagersdeleteinstancesrequest
  39749. return c
  39750. }
  39751. // Fields allows partial responses to be retrieved. See
  39752. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39753. // for more information.
  39754. func (c *RegionInstanceGroupManagersDeleteInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersDeleteInstancesCall {
  39755. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39756. return c
  39757. }
  39758. // Context sets the context to be used in this call's Do method. Any
  39759. // pending HTTP request will be aborted if the provided context is
  39760. // canceled.
  39761. func (c *RegionInstanceGroupManagersDeleteInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersDeleteInstancesCall {
  39762. c.ctx_ = ctx
  39763. return c
  39764. }
  39765. // Header returns an http.Header that can be modified by the caller to
  39766. // add HTTP headers to the request.
  39767. func (c *RegionInstanceGroupManagersDeleteInstancesCall) Header() http.Header {
  39768. if c.header_ == nil {
  39769. c.header_ = make(http.Header)
  39770. }
  39771. return c.header_
  39772. }
  39773. func (c *RegionInstanceGroupManagersDeleteInstancesCall) doRequest(alt string) (*http.Response, error) {
  39774. reqHeaders := make(http.Header)
  39775. for k, v := range c.header_ {
  39776. reqHeaders[k] = v
  39777. }
  39778. reqHeaders.Set("User-Agent", c.s.userAgent())
  39779. var body io.Reader = nil
  39780. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersdeleteinstancesrequest)
  39781. if err != nil {
  39782. return nil, err
  39783. }
  39784. reqHeaders.Set("Content-Type", "application/json")
  39785. c.urlParams_.Set("alt", alt)
  39786. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deleteInstances")
  39787. urls += "?" + c.urlParams_.Encode()
  39788. req, _ := http.NewRequest("POST", urls, body)
  39789. req.Header = reqHeaders
  39790. googleapi.Expand(req.URL, map[string]string{
  39791. "project": c.project,
  39792. "region": c.region,
  39793. "instanceGroupManager": c.instanceGroupManager,
  39794. })
  39795. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39796. }
  39797. // Do executes the "compute.regionInstanceGroupManagers.deleteInstances" call.
  39798. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  39799. // status code is an error. Response headers are in either
  39800. // *Operation.ServerResponse.Header or (if a response was returned at
  39801. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39802. // to check whether the returned error was because
  39803. // http.StatusNotModified was returned.
  39804. func (c *RegionInstanceGroupManagersDeleteInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  39805. gensupport.SetOptions(c.urlParams_, opts...)
  39806. res, err := c.doRequest("json")
  39807. if res != nil && res.StatusCode == http.StatusNotModified {
  39808. if res.Body != nil {
  39809. res.Body.Close()
  39810. }
  39811. return nil, &googleapi.Error{
  39812. Code: res.StatusCode,
  39813. Header: res.Header,
  39814. }
  39815. }
  39816. if err != nil {
  39817. return nil, err
  39818. }
  39819. defer googleapi.CloseBody(res)
  39820. if err := googleapi.CheckResponse(res); err != nil {
  39821. return nil, err
  39822. }
  39823. ret := &Operation{
  39824. ServerResponse: googleapi.ServerResponse{
  39825. Header: res.Header,
  39826. HTTPStatusCode: res.StatusCode,
  39827. },
  39828. }
  39829. target := &ret
  39830. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  39831. return nil, err
  39832. }
  39833. return ret, nil
  39834. // {
  39835. // "description": "Schedules a group action to delete the specified instances in the managed instance group. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.\n\nYou can specify a maximum of 1000 instances with this method per request.",
  39836. // "httpMethod": "POST",
  39837. // "id": "compute.regionInstanceGroupManagers.deleteInstances",
  39838. // "parameterOrder": [
  39839. // "project",
  39840. // "region",
  39841. // "instanceGroupManager"
  39842. // ],
  39843. // "parameters": {
  39844. // "instanceGroupManager": {
  39845. // "description": "Name of the managed instance group.",
  39846. // "location": "path",
  39847. // "required": true,
  39848. // "type": "string"
  39849. // },
  39850. // "project": {
  39851. // "description": "Project ID for this request.",
  39852. // "location": "path",
  39853. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39854. // "required": true,
  39855. // "type": "string"
  39856. // },
  39857. // "region": {
  39858. // "description": "Name of the region scoping this request.",
  39859. // "location": "path",
  39860. // "required": true,
  39861. // "type": "string"
  39862. // }
  39863. // },
  39864. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deleteInstances",
  39865. // "request": {
  39866. // "$ref": "RegionInstanceGroupManagersDeleteInstancesRequest"
  39867. // },
  39868. // "response": {
  39869. // "$ref": "Operation"
  39870. // },
  39871. // "scopes": [
  39872. // "https://www.googleapis.com/auth/cloud-platform",
  39873. // "https://www.googleapis.com/auth/compute"
  39874. // ]
  39875. // }
  39876. }
  39877. // method id "compute.regionInstanceGroupManagers.get":
  39878. type RegionInstanceGroupManagersGetCall struct {
  39879. s *Service
  39880. project string
  39881. region string
  39882. instanceGroupManager string
  39883. urlParams_ gensupport.URLParams
  39884. ifNoneMatch_ string
  39885. ctx_ context.Context
  39886. header_ http.Header
  39887. }
  39888. // Get: Returns all of the details about the specified managed instance
  39889. // group.
  39890. func (r *RegionInstanceGroupManagersService) Get(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersGetCall {
  39891. c := &RegionInstanceGroupManagersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39892. c.project = project
  39893. c.region = region
  39894. c.instanceGroupManager = instanceGroupManager
  39895. return c
  39896. }
  39897. // Fields allows partial responses to be retrieved. See
  39898. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39899. // for more information.
  39900. func (c *RegionInstanceGroupManagersGetCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersGetCall {
  39901. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39902. return c
  39903. }
  39904. // IfNoneMatch sets the optional parameter which makes the operation
  39905. // fail if the object's ETag matches the given value. This is useful for
  39906. // getting updates only after the object has changed since the last
  39907. // request. Use googleapi.IsNotModified to check whether the response
  39908. // error from Do is the result of In-None-Match.
  39909. func (c *RegionInstanceGroupManagersGetCall) IfNoneMatch(entityTag string) *RegionInstanceGroupManagersGetCall {
  39910. c.ifNoneMatch_ = entityTag
  39911. return c
  39912. }
  39913. // Context sets the context to be used in this call's Do method. Any
  39914. // pending HTTP request will be aborted if the provided context is
  39915. // canceled.
  39916. func (c *RegionInstanceGroupManagersGetCall) Context(ctx context.Context) *RegionInstanceGroupManagersGetCall {
  39917. c.ctx_ = ctx
  39918. return c
  39919. }
  39920. // Header returns an http.Header that can be modified by the caller to
  39921. // add HTTP headers to the request.
  39922. func (c *RegionInstanceGroupManagersGetCall) Header() http.Header {
  39923. if c.header_ == nil {
  39924. c.header_ = make(http.Header)
  39925. }
  39926. return c.header_
  39927. }
  39928. func (c *RegionInstanceGroupManagersGetCall) doRequest(alt string) (*http.Response, error) {
  39929. reqHeaders := make(http.Header)
  39930. for k, v := range c.header_ {
  39931. reqHeaders[k] = v
  39932. }
  39933. reqHeaders.Set("User-Agent", c.s.userAgent())
  39934. if c.ifNoneMatch_ != "" {
  39935. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  39936. }
  39937. var body io.Reader = nil
  39938. c.urlParams_.Set("alt", alt)
  39939. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")
  39940. urls += "?" + c.urlParams_.Encode()
  39941. req, _ := http.NewRequest("GET", urls, body)
  39942. req.Header = reqHeaders
  39943. googleapi.Expand(req.URL, map[string]string{
  39944. "project": c.project,
  39945. "region": c.region,
  39946. "instanceGroupManager": c.instanceGroupManager,
  39947. })
  39948. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39949. }
  39950. // Do executes the "compute.regionInstanceGroupManagers.get" call.
  39951. // Exactly one of *InstanceGroupManager or error will be non-nil. Any
  39952. // non-2xx status code is an error. Response headers are in either
  39953. // *InstanceGroupManager.ServerResponse.Header or (if a response was
  39954. // returned at all) in error.(*googleapi.Error).Header. Use
  39955. // googleapi.IsNotModified to check whether the returned error was
  39956. // because http.StatusNotModified was returned.
  39957. func (c *RegionInstanceGroupManagersGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManager, error) {
  39958. gensupport.SetOptions(c.urlParams_, opts...)
  39959. res, err := c.doRequest("json")
  39960. if res != nil && res.StatusCode == http.StatusNotModified {
  39961. if res.Body != nil {
  39962. res.Body.Close()
  39963. }
  39964. return nil, &googleapi.Error{
  39965. Code: res.StatusCode,
  39966. Header: res.Header,
  39967. }
  39968. }
  39969. if err != nil {
  39970. return nil, err
  39971. }
  39972. defer googleapi.CloseBody(res)
  39973. if err := googleapi.CheckResponse(res); err != nil {
  39974. return nil, err
  39975. }
  39976. ret := &InstanceGroupManager{
  39977. ServerResponse: googleapi.ServerResponse{
  39978. Header: res.Header,
  39979. HTTPStatusCode: res.StatusCode,
  39980. },
  39981. }
  39982. target := &ret
  39983. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  39984. return nil, err
  39985. }
  39986. return ret, nil
  39987. // {
  39988. // "description": "Returns all of the details about the specified managed instance group.",
  39989. // "httpMethod": "GET",
  39990. // "id": "compute.regionInstanceGroupManagers.get",
  39991. // "parameterOrder": [
  39992. // "project",
  39993. // "region",
  39994. // "instanceGroupManager"
  39995. // ],
  39996. // "parameters": {
  39997. // "instanceGroupManager": {
  39998. // "description": "Name of the managed instance group to return.",
  39999. // "location": "path",
  40000. // "required": true,
  40001. // "type": "string"
  40002. // },
  40003. // "project": {
  40004. // "description": "Project ID for this request.",
  40005. // "location": "path",
  40006. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40007. // "required": true,
  40008. // "type": "string"
  40009. // },
  40010. // "region": {
  40011. // "description": "Name of the region scoping this request.",
  40012. // "location": "path",
  40013. // "required": true,
  40014. // "type": "string"
  40015. // }
  40016. // },
  40017. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}",
  40018. // "response": {
  40019. // "$ref": "InstanceGroupManager"
  40020. // },
  40021. // "scopes": [
  40022. // "https://www.googleapis.com/auth/cloud-platform",
  40023. // "https://www.googleapis.com/auth/compute",
  40024. // "https://www.googleapis.com/auth/compute.readonly"
  40025. // ]
  40026. // }
  40027. }
  40028. // method id "compute.regionInstanceGroupManagers.insert":
  40029. type RegionInstanceGroupManagersInsertCall struct {
  40030. s *Service
  40031. project string
  40032. region string
  40033. instancegroupmanager *InstanceGroupManager
  40034. urlParams_ gensupport.URLParams
  40035. ctx_ context.Context
  40036. header_ http.Header
  40037. }
  40038. // Insert: Creates a managed instance group using the information that
  40039. // you specify in the request. After the group is created, it schedules
  40040. // an action to create instances in the group using the specified
  40041. // instance template. This operation is marked as DONE when the group is
  40042. // created even if the instances in the group have not yet been created.
  40043. // You must separately verify the status of the individual instances
  40044. // with the listmanagedinstances method.
  40045. //
  40046. // A regional managed instance group can contain up to 2000 instances.
  40047. func (r *RegionInstanceGroupManagersService) Insert(project string, region string, instancegroupmanager *InstanceGroupManager) *RegionInstanceGroupManagersInsertCall {
  40048. c := &RegionInstanceGroupManagersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40049. c.project = project
  40050. c.region = region
  40051. c.instancegroupmanager = instancegroupmanager
  40052. return c
  40053. }
  40054. // Fields allows partial responses to be retrieved. See
  40055. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40056. // for more information.
  40057. func (c *RegionInstanceGroupManagersInsertCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersInsertCall {
  40058. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40059. return c
  40060. }
  40061. // Context sets the context to be used in this call's Do method. Any
  40062. // pending HTTP request will be aborted if the provided context is
  40063. // canceled.
  40064. func (c *RegionInstanceGroupManagersInsertCall) Context(ctx context.Context) *RegionInstanceGroupManagersInsertCall {
  40065. c.ctx_ = ctx
  40066. return c
  40067. }
  40068. // Header returns an http.Header that can be modified by the caller to
  40069. // add HTTP headers to the request.
  40070. func (c *RegionInstanceGroupManagersInsertCall) Header() http.Header {
  40071. if c.header_ == nil {
  40072. c.header_ = make(http.Header)
  40073. }
  40074. return c.header_
  40075. }
  40076. func (c *RegionInstanceGroupManagersInsertCall) doRequest(alt string) (*http.Response, error) {
  40077. reqHeaders := make(http.Header)
  40078. for k, v := range c.header_ {
  40079. reqHeaders[k] = v
  40080. }
  40081. reqHeaders.Set("User-Agent", c.s.userAgent())
  40082. var body io.Reader = nil
  40083. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  40084. if err != nil {
  40085. return nil, err
  40086. }
  40087. reqHeaders.Set("Content-Type", "application/json")
  40088. c.urlParams_.Set("alt", alt)
  40089. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers")
  40090. urls += "?" + c.urlParams_.Encode()
  40091. req, _ := http.NewRequest("POST", urls, body)
  40092. req.Header = reqHeaders
  40093. googleapi.Expand(req.URL, map[string]string{
  40094. "project": c.project,
  40095. "region": c.region,
  40096. })
  40097. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40098. }
  40099. // Do executes the "compute.regionInstanceGroupManagers.insert" call.
  40100. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  40101. // status code is an error. Response headers are in either
  40102. // *Operation.ServerResponse.Header or (if a response was returned at
  40103. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  40104. // to check whether the returned error was because
  40105. // http.StatusNotModified was returned.
  40106. func (c *RegionInstanceGroupManagersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  40107. gensupport.SetOptions(c.urlParams_, opts...)
  40108. res, err := c.doRequest("json")
  40109. if res != nil && res.StatusCode == http.StatusNotModified {
  40110. if res.Body != nil {
  40111. res.Body.Close()
  40112. }
  40113. return nil, &googleapi.Error{
  40114. Code: res.StatusCode,
  40115. Header: res.Header,
  40116. }
  40117. }
  40118. if err != nil {
  40119. return nil, err
  40120. }
  40121. defer googleapi.CloseBody(res)
  40122. if err := googleapi.CheckResponse(res); err != nil {
  40123. return nil, err
  40124. }
  40125. ret := &Operation{
  40126. ServerResponse: googleapi.ServerResponse{
  40127. Header: res.Header,
  40128. HTTPStatusCode: res.StatusCode,
  40129. },
  40130. }
  40131. target := &ret
  40132. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  40133. return nil, err
  40134. }
  40135. return ret, nil
  40136. // {
  40137. // "description": "Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method.\n\nA regional managed instance group can contain up to 2000 instances.",
  40138. // "httpMethod": "POST",
  40139. // "id": "compute.regionInstanceGroupManagers.insert",
  40140. // "parameterOrder": [
  40141. // "project",
  40142. // "region"
  40143. // ],
  40144. // "parameters": {
  40145. // "project": {
  40146. // "description": "Project ID for this request.",
  40147. // "location": "path",
  40148. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40149. // "required": true,
  40150. // "type": "string"
  40151. // },
  40152. // "region": {
  40153. // "description": "Name of the region scoping this request.",
  40154. // "location": "path",
  40155. // "required": true,
  40156. // "type": "string"
  40157. // }
  40158. // },
  40159. // "path": "{project}/regions/{region}/instanceGroupManagers",
  40160. // "request": {
  40161. // "$ref": "InstanceGroupManager"
  40162. // },
  40163. // "response": {
  40164. // "$ref": "Operation"
  40165. // },
  40166. // "scopes": [
  40167. // "https://www.googleapis.com/auth/cloud-platform",
  40168. // "https://www.googleapis.com/auth/compute"
  40169. // ]
  40170. // }
  40171. }
  40172. // method id "compute.regionInstanceGroupManagers.list":
  40173. type RegionInstanceGroupManagersListCall struct {
  40174. s *Service
  40175. project string
  40176. region string
  40177. urlParams_ gensupport.URLParams
  40178. ifNoneMatch_ string
  40179. ctx_ context.Context
  40180. header_ http.Header
  40181. }
  40182. // List: Retrieves the list of managed instance groups that are
  40183. // contained within the specified region.
  40184. func (r *RegionInstanceGroupManagersService) List(project string, region string) *RegionInstanceGroupManagersListCall {
  40185. c := &RegionInstanceGroupManagersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40186. c.project = project
  40187. c.region = region
  40188. return c
  40189. }
  40190. // Filter sets the optional parameter "filter": Sets a filter
  40191. // {expression} for filtering listed resources. Your {expression} must
  40192. // be in the format: field_name comparison_string literal_string.
  40193. //
  40194. // The field_name is the name of the field you want to compare. Only
  40195. // atomic field types are supported (string, number, boolean). The
  40196. // comparison_string must be either eq (equals) or ne (not equals). The
  40197. // literal_string is the string value to filter to. The literal value
  40198. // must be valid for the type of field you are filtering by (string,
  40199. // number, boolean). For string fields, the literal value is interpreted
  40200. // as a regular expression using RE2 syntax. The literal value must
  40201. // match the entire field.
  40202. //
  40203. // For example, to filter for instances that do not have a name of
  40204. // example-instance, you would use name ne example-instance.
  40205. //
  40206. // You can filter on nested fields. For example, you could filter on
  40207. // instances that have set the scheduling.automaticRestart field to
  40208. // true. Use filtering on nested fields to take advantage of labels to
  40209. // organize and search for results based on label values.
  40210. //
  40211. // To filter on multiple expressions, provide each separate expression
  40212. // within parentheses. For example, (scheduling.automaticRestart eq
  40213. // true) (zone eq us-central1-f). Multiple expressions are treated as
  40214. // AND expressions, meaning that resources must match all expressions to
  40215. // pass the filters.
  40216. func (c *RegionInstanceGroupManagersListCall) Filter(filter string) *RegionInstanceGroupManagersListCall {
  40217. c.urlParams_.Set("filter", filter)
  40218. return c
  40219. }
  40220. // MaxResults sets the optional parameter "maxResults": The maximum
  40221. // number of results per page that should be returned. If the number of
  40222. // available results is larger than maxResults, Compute Engine returns a
  40223. // nextPageToken that can be used to get the next page of results in
  40224. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  40225. // (Default: 500)
  40226. func (c *RegionInstanceGroupManagersListCall) MaxResults(maxResults int64) *RegionInstanceGroupManagersListCall {
  40227. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  40228. return c
  40229. }
  40230. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  40231. // a certain order. By default, results are returned in alphanumerical
  40232. // order based on the resource name.
  40233. //
  40234. // You can also sort results in descending order based on the creation
  40235. // timestamp using orderBy="creationTimestamp desc". This sorts results
  40236. // based on the creationTimestamp field in reverse chronological order
  40237. // (newest result first). Use this to sort resources like operations so
  40238. // that the newest operation is returned first.
  40239. //
  40240. // Currently, only sorting by name or creationTimestamp desc is
  40241. // supported.
  40242. func (c *RegionInstanceGroupManagersListCall) OrderBy(orderBy string) *RegionInstanceGroupManagersListCall {
  40243. c.urlParams_.Set("orderBy", orderBy)
  40244. return c
  40245. }
  40246. // PageToken sets the optional parameter "pageToken": Specifies a page
  40247. // token to use. Set pageToken to the nextPageToken returned by a
  40248. // previous list request to get the next page of results.
  40249. func (c *RegionInstanceGroupManagersListCall) PageToken(pageToken string) *RegionInstanceGroupManagersListCall {
  40250. c.urlParams_.Set("pageToken", pageToken)
  40251. return c
  40252. }
  40253. // Fields allows partial responses to be retrieved. See
  40254. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40255. // for more information.
  40256. func (c *RegionInstanceGroupManagersListCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersListCall {
  40257. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40258. return c
  40259. }
  40260. // IfNoneMatch sets the optional parameter which makes the operation
  40261. // fail if the object's ETag matches the given value. This is useful for
  40262. // getting updates only after the object has changed since the last
  40263. // request. Use googleapi.IsNotModified to check whether the response
  40264. // error from Do is the result of In-None-Match.
  40265. func (c *RegionInstanceGroupManagersListCall) IfNoneMatch(entityTag string) *RegionInstanceGroupManagersListCall {
  40266. c.ifNoneMatch_ = entityTag
  40267. return c
  40268. }
  40269. // Context sets the context to be used in this call's Do method. Any
  40270. // pending HTTP request will be aborted if the provided context is
  40271. // canceled.
  40272. func (c *RegionInstanceGroupManagersListCall) Context(ctx context.Context) *RegionInstanceGroupManagersListCall {
  40273. c.ctx_ = ctx
  40274. return c
  40275. }
  40276. // Header returns an http.Header that can be modified by the caller to
  40277. // add HTTP headers to the request.
  40278. func (c *RegionInstanceGroupManagersListCall) Header() http.Header {
  40279. if c.header_ == nil {
  40280. c.header_ = make(http.Header)
  40281. }
  40282. return c.header_
  40283. }
  40284. func (c *RegionInstanceGroupManagersListCall) doRequest(alt string) (*http.Response, error) {
  40285. reqHeaders := make(http.Header)
  40286. for k, v := range c.header_ {
  40287. reqHeaders[k] = v
  40288. }
  40289. reqHeaders.Set("User-Agent", c.s.userAgent())
  40290. if c.ifNoneMatch_ != "" {
  40291. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  40292. }
  40293. var body io.Reader = nil
  40294. c.urlParams_.Set("alt", alt)
  40295. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers")
  40296. urls += "?" + c.urlParams_.Encode()
  40297. req, _ := http.NewRequest("GET", urls, body)
  40298. req.Header = reqHeaders
  40299. googleapi.Expand(req.URL, map[string]string{
  40300. "project": c.project,
  40301. "region": c.region,
  40302. })
  40303. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40304. }
  40305. // Do executes the "compute.regionInstanceGroupManagers.list" call.
  40306. // Exactly one of *RegionInstanceGroupManagerList or error will be
  40307. // non-nil. Any non-2xx status code is an error. Response headers are in
  40308. // either *RegionInstanceGroupManagerList.ServerResponse.Header or (if a
  40309. // response was returned at all) in error.(*googleapi.Error).Header. Use
  40310. // googleapi.IsNotModified to check whether the returned error was
  40311. // because http.StatusNotModified was returned.
  40312. func (c *RegionInstanceGroupManagersListCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupManagerList, error) {
  40313. gensupport.SetOptions(c.urlParams_, opts...)
  40314. res, err := c.doRequest("json")
  40315. if res != nil && res.StatusCode == http.StatusNotModified {
  40316. if res.Body != nil {
  40317. res.Body.Close()
  40318. }
  40319. return nil, &googleapi.Error{
  40320. Code: res.StatusCode,
  40321. Header: res.Header,
  40322. }
  40323. }
  40324. if err != nil {
  40325. return nil, err
  40326. }
  40327. defer googleapi.CloseBody(res)
  40328. if err := googleapi.CheckResponse(res); err != nil {
  40329. return nil, err
  40330. }
  40331. ret := &RegionInstanceGroupManagerList{
  40332. ServerResponse: googleapi.ServerResponse{
  40333. Header: res.Header,
  40334. HTTPStatusCode: res.StatusCode,
  40335. },
  40336. }
  40337. target := &ret
  40338. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  40339. return nil, err
  40340. }
  40341. return ret, nil
  40342. // {
  40343. // "description": "Retrieves the list of managed instance groups that are contained within the specified region.",
  40344. // "httpMethod": "GET",
  40345. // "id": "compute.regionInstanceGroupManagers.list",
  40346. // "parameterOrder": [
  40347. // "project",
  40348. // "region"
  40349. // ],
  40350. // "parameters": {
  40351. // "filter": {
  40352. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  40353. // "location": "query",
  40354. // "type": "string"
  40355. // },
  40356. // "maxResults": {
  40357. // "default": "500",
  40358. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  40359. // "format": "uint32",
  40360. // "location": "query",
  40361. // "minimum": "0",
  40362. // "type": "integer"
  40363. // },
  40364. // "orderBy": {
  40365. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  40366. // "location": "query",
  40367. // "type": "string"
  40368. // },
  40369. // "pageToken": {
  40370. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  40371. // "location": "query",
  40372. // "type": "string"
  40373. // },
  40374. // "project": {
  40375. // "description": "Project ID for this request.",
  40376. // "location": "path",
  40377. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40378. // "required": true,
  40379. // "type": "string"
  40380. // },
  40381. // "region": {
  40382. // "description": "Name of the region scoping this request.",
  40383. // "location": "path",
  40384. // "required": true,
  40385. // "type": "string"
  40386. // }
  40387. // },
  40388. // "path": "{project}/regions/{region}/instanceGroupManagers",
  40389. // "response": {
  40390. // "$ref": "RegionInstanceGroupManagerList"
  40391. // },
  40392. // "scopes": [
  40393. // "https://www.googleapis.com/auth/cloud-platform",
  40394. // "https://www.googleapis.com/auth/compute",
  40395. // "https://www.googleapis.com/auth/compute.readonly"
  40396. // ]
  40397. // }
  40398. }
  40399. // Pages invokes f for each page of results.
  40400. // A non-nil error returned from f will halt the iteration.
  40401. // The provided context supersedes any context provided to the Context method.
  40402. func (c *RegionInstanceGroupManagersListCall) Pages(ctx context.Context, f func(*RegionInstanceGroupManagerList) error) error {
  40403. c.ctx_ = ctx
  40404. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  40405. for {
  40406. x, err := c.Do()
  40407. if err != nil {
  40408. return err
  40409. }
  40410. if err := f(x); err != nil {
  40411. return err
  40412. }
  40413. if x.NextPageToken == "" {
  40414. return nil
  40415. }
  40416. c.PageToken(x.NextPageToken)
  40417. }
  40418. }
  40419. // method id "compute.regionInstanceGroupManagers.listManagedInstances":
  40420. type RegionInstanceGroupManagersListManagedInstancesCall struct {
  40421. s *Service
  40422. project string
  40423. region string
  40424. instanceGroupManager string
  40425. urlParams_ gensupport.URLParams
  40426. ctx_ context.Context
  40427. header_ http.Header
  40428. }
  40429. // ListManagedInstances: Lists the instances in the managed instance
  40430. // group and instances that are scheduled to be created. The list
  40431. // includes any current actions that the group has scheduled for its
  40432. // instances.
  40433. func (r *RegionInstanceGroupManagersService) ListManagedInstances(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersListManagedInstancesCall {
  40434. c := &RegionInstanceGroupManagersListManagedInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40435. c.project = project
  40436. c.region = region
  40437. c.instanceGroupManager = instanceGroupManager
  40438. return c
  40439. }
  40440. // Filter sets the optional parameter "filter":
  40441. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Filter(filter string) *RegionInstanceGroupManagersListManagedInstancesCall {
  40442. c.urlParams_.Set("filter", filter)
  40443. return c
  40444. }
  40445. // MaxResults sets the optional parameter "maxResults":
  40446. func (c *RegionInstanceGroupManagersListManagedInstancesCall) MaxResults(maxResults int64) *RegionInstanceGroupManagersListManagedInstancesCall {
  40447. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  40448. return c
  40449. }
  40450. // OrderBy sets the optional parameter "order_by":
  40451. func (c *RegionInstanceGroupManagersListManagedInstancesCall) OrderBy(orderBy string) *RegionInstanceGroupManagersListManagedInstancesCall {
  40452. c.urlParams_.Set("order_by", orderBy)
  40453. return c
  40454. }
  40455. // PageToken sets the optional parameter "pageToken":
  40456. func (c *RegionInstanceGroupManagersListManagedInstancesCall) PageToken(pageToken string) *RegionInstanceGroupManagersListManagedInstancesCall {
  40457. c.urlParams_.Set("pageToken", pageToken)
  40458. return c
  40459. }
  40460. // Fields allows partial responses to be retrieved. See
  40461. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40462. // for more information.
  40463. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersListManagedInstancesCall {
  40464. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40465. return c
  40466. }
  40467. // Context sets the context to be used in this call's Do method. Any
  40468. // pending HTTP request will be aborted if the provided context is
  40469. // canceled.
  40470. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersListManagedInstancesCall {
  40471. c.ctx_ = ctx
  40472. return c
  40473. }
  40474. // Header returns an http.Header that can be modified by the caller to
  40475. // add HTTP headers to the request.
  40476. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Header() http.Header {
  40477. if c.header_ == nil {
  40478. c.header_ = make(http.Header)
  40479. }
  40480. return c.header_
  40481. }
  40482. func (c *RegionInstanceGroupManagersListManagedInstancesCall) doRequest(alt string) (*http.Response, error) {
  40483. reqHeaders := make(http.Header)
  40484. for k, v := range c.header_ {
  40485. reqHeaders[k] = v
  40486. }
  40487. reqHeaders.Set("User-Agent", c.s.userAgent())
  40488. var body io.Reader = nil
  40489. c.urlParams_.Set("alt", alt)
  40490. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances")
  40491. urls += "?" + c.urlParams_.Encode()
  40492. req, _ := http.NewRequest("POST", urls, body)
  40493. req.Header = reqHeaders
  40494. googleapi.Expand(req.URL, map[string]string{
  40495. "project": c.project,
  40496. "region": c.region,
  40497. "instanceGroupManager": c.instanceGroupManager,
  40498. })
  40499. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40500. }
  40501. // Do executes the "compute.regionInstanceGroupManagers.listManagedInstances" call.
  40502. // Exactly one of *RegionInstanceGroupManagersListInstancesResponse or
  40503. // error will be non-nil. Any non-2xx status code is an error. Response
  40504. // headers are in either
  40505. // *RegionInstanceGroupManagersListInstancesResponse.ServerResponse.Heade
  40506. // r or (if a response was returned at all) in
  40507. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  40508. // whether the returned error was because http.StatusNotModified was
  40509. // returned.
  40510. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupManagersListInstancesResponse, error) {
  40511. gensupport.SetOptions(c.urlParams_, opts...)
  40512. res, err := c.doRequest("json")
  40513. if res != nil && res.StatusCode == http.StatusNotModified {
  40514. if res.Body != nil {
  40515. res.Body.Close()
  40516. }
  40517. return nil, &googleapi.Error{
  40518. Code: res.StatusCode,
  40519. Header: res.Header,
  40520. }
  40521. }
  40522. if err != nil {
  40523. return nil, err
  40524. }
  40525. defer googleapi.CloseBody(res)
  40526. if err := googleapi.CheckResponse(res); err != nil {
  40527. return nil, err
  40528. }
  40529. ret := &RegionInstanceGroupManagersListInstancesResponse{
  40530. ServerResponse: googleapi.ServerResponse{
  40531. Header: res.Header,
  40532. HTTPStatusCode: res.StatusCode,
  40533. },
  40534. }
  40535. target := &ret
  40536. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  40537. return nil, err
  40538. }
  40539. return ret, nil
  40540. // {
  40541. // "description": "Lists the instances in the managed instance group and instances that are scheduled to be created. The list includes any current actions that the group has scheduled for its instances.",
  40542. // "httpMethod": "POST",
  40543. // "id": "compute.regionInstanceGroupManagers.listManagedInstances",
  40544. // "parameterOrder": [
  40545. // "project",
  40546. // "region",
  40547. // "instanceGroupManager"
  40548. // ],
  40549. // "parameters": {
  40550. // "filter": {
  40551. // "location": "query",
  40552. // "type": "string"
  40553. // },
  40554. // "instanceGroupManager": {
  40555. // "description": "The name of the managed instance group.",
  40556. // "location": "path",
  40557. // "required": true,
  40558. // "type": "string"
  40559. // },
  40560. // "maxResults": {
  40561. // "default": "500",
  40562. // "format": "uint32",
  40563. // "location": "query",
  40564. // "minimum": "0",
  40565. // "type": "integer"
  40566. // },
  40567. // "order_by": {
  40568. // "location": "query",
  40569. // "type": "string"
  40570. // },
  40571. // "pageToken": {
  40572. // "location": "query",
  40573. // "type": "string"
  40574. // },
  40575. // "project": {
  40576. // "description": "Project ID for this request.",
  40577. // "location": "path",
  40578. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40579. // "required": true,
  40580. // "type": "string"
  40581. // },
  40582. // "region": {
  40583. // "description": "Name of the region scoping this request.",
  40584. // "location": "path",
  40585. // "required": true,
  40586. // "type": "string"
  40587. // }
  40588. // },
  40589. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances",
  40590. // "response": {
  40591. // "$ref": "RegionInstanceGroupManagersListInstancesResponse"
  40592. // },
  40593. // "scopes": [
  40594. // "https://www.googleapis.com/auth/cloud-platform",
  40595. // "https://www.googleapis.com/auth/compute",
  40596. // "https://www.googleapis.com/auth/compute.readonly"
  40597. // ]
  40598. // }
  40599. }
  40600. // method id "compute.regionInstanceGroupManagers.recreateInstances":
  40601. type RegionInstanceGroupManagersRecreateInstancesCall struct {
  40602. s *Service
  40603. project string
  40604. region string
  40605. instanceGroupManager string
  40606. regioninstancegroupmanagersrecreaterequest *RegionInstanceGroupManagersRecreateRequest
  40607. urlParams_ gensupport.URLParams
  40608. ctx_ context.Context
  40609. header_ http.Header
  40610. }
  40611. // RecreateInstances: Schedules a group action to recreate the specified
  40612. // instances in the managed instance group. The instances are deleted
  40613. // and recreated using the current instance template for the managed
  40614. // instance group. This operation is marked as DONE when the action is
  40615. // scheduled even if the instances have not yet been recreated. You must
  40616. // separately verify the status of the recreating action with the
  40617. // listmanagedinstances method.
  40618. //
  40619. // If the group is part of a backend service that has enabled connection
  40620. // draining, it can take up to 60 seconds after the connection draining
  40621. // duration has elapsed before the VM instance is removed or
  40622. // deleted.
  40623. //
  40624. // You can specify a maximum of 1000 instances with this method per
  40625. // request.
  40626. func (r *RegionInstanceGroupManagersService) RecreateInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersrecreaterequest *RegionInstanceGroupManagersRecreateRequest) *RegionInstanceGroupManagersRecreateInstancesCall {
  40627. c := &RegionInstanceGroupManagersRecreateInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40628. c.project = project
  40629. c.region = region
  40630. c.instanceGroupManager = instanceGroupManager
  40631. c.regioninstancegroupmanagersrecreaterequest = regioninstancegroupmanagersrecreaterequest
  40632. return c
  40633. }
  40634. // Fields allows partial responses to be retrieved. See
  40635. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40636. // for more information.
  40637. func (c *RegionInstanceGroupManagersRecreateInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersRecreateInstancesCall {
  40638. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40639. return c
  40640. }
  40641. // Context sets the context to be used in this call's Do method. Any
  40642. // pending HTTP request will be aborted if the provided context is
  40643. // canceled.
  40644. func (c *RegionInstanceGroupManagersRecreateInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersRecreateInstancesCall {
  40645. c.ctx_ = ctx
  40646. return c
  40647. }
  40648. // Header returns an http.Header that can be modified by the caller to
  40649. // add HTTP headers to the request.
  40650. func (c *RegionInstanceGroupManagersRecreateInstancesCall) Header() http.Header {
  40651. if c.header_ == nil {
  40652. c.header_ = make(http.Header)
  40653. }
  40654. return c.header_
  40655. }
  40656. func (c *RegionInstanceGroupManagersRecreateInstancesCall) doRequest(alt string) (*http.Response, error) {
  40657. reqHeaders := make(http.Header)
  40658. for k, v := range c.header_ {
  40659. reqHeaders[k] = v
  40660. }
  40661. reqHeaders.Set("User-Agent", c.s.userAgent())
  40662. var body io.Reader = nil
  40663. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersrecreaterequest)
  40664. if err != nil {
  40665. return nil, err
  40666. }
  40667. reqHeaders.Set("Content-Type", "application/json")
  40668. c.urlParams_.Set("alt", alt)
  40669. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/recreateInstances")
  40670. urls += "?" + c.urlParams_.Encode()
  40671. req, _ := http.NewRequest("POST", urls, body)
  40672. req.Header = reqHeaders
  40673. googleapi.Expand(req.URL, map[string]string{
  40674. "project": c.project,
  40675. "region": c.region,
  40676. "instanceGroupManager": c.instanceGroupManager,
  40677. })
  40678. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40679. }
  40680. // Do executes the "compute.regionInstanceGroupManagers.recreateInstances" call.
  40681. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  40682. // status code is an error. Response headers are in either
  40683. // *Operation.ServerResponse.Header or (if a response was returned at
  40684. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  40685. // to check whether the returned error was because
  40686. // http.StatusNotModified was returned.
  40687. func (c *RegionInstanceGroupManagersRecreateInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  40688. gensupport.SetOptions(c.urlParams_, opts...)
  40689. res, err := c.doRequest("json")
  40690. if res != nil && res.StatusCode == http.StatusNotModified {
  40691. if res.Body != nil {
  40692. res.Body.Close()
  40693. }
  40694. return nil, &googleapi.Error{
  40695. Code: res.StatusCode,
  40696. Header: res.Header,
  40697. }
  40698. }
  40699. if err != nil {
  40700. return nil, err
  40701. }
  40702. defer googleapi.CloseBody(res)
  40703. if err := googleapi.CheckResponse(res); err != nil {
  40704. return nil, err
  40705. }
  40706. ret := &Operation{
  40707. ServerResponse: googleapi.ServerResponse{
  40708. Header: res.Header,
  40709. HTTPStatusCode: res.StatusCode,
  40710. },
  40711. }
  40712. target := &ret
  40713. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  40714. return nil, err
  40715. }
  40716. return ret, nil
  40717. // {
  40718. // "description": "Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.\n\nYou can specify a maximum of 1000 instances with this method per request.",
  40719. // "httpMethod": "POST",
  40720. // "id": "compute.regionInstanceGroupManagers.recreateInstances",
  40721. // "parameterOrder": [
  40722. // "project",
  40723. // "region",
  40724. // "instanceGroupManager"
  40725. // ],
  40726. // "parameters": {
  40727. // "instanceGroupManager": {
  40728. // "description": "Name of the managed instance group.",
  40729. // "location": "path",
  40730. // "required": true,
  40731. // "type": "string"
  40732. // },
  40733. // "project": {
  40734. // "description": "Project ID for this request.",
  40735. // "location": "path",
  40736. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40737. // "required": true,
  40738. // "type": "string"
  40739. // },
  40740. // "region": {
  40741. // "description": "Name of the region scoping this request.",
  40742. // "location": "path",
  40743. // "required": true,
  40744. // "type": "string"
  40745. // }
  40746. // },
  40747. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/recreateInstances",
  40748. // "request": {
  40749. // "$ref": "RegionInstanceGroupManagersRecreateRequest"
  40750. // },
  40751. // "response": {
  40752. // "$ref": "Operation"
  40753. // },
  40754. // "scopes": [
  40755. // "https://www.googleapis.com/auth/cloud-platform",
  40756. // "https://www.googleapis.com/auth/compute"
  40757. // ]
  40758. // }
  40759. }
  40760. // method id "compute.regionInstanceGroupManagers.resize":
  40761. type RegionInstanceGroupManagersResizeCall struct {
  40762. s *Service
  40763. project string
  40764. region string
  40765. instanceGroupManager string
  40766. urlParams_ gensupport.URLParams
  40767. ctx_ context.Context
  40768. header_ http.Header
  40769. }
  40770. // Resize: Changes the intended size for the managed instance group. If
  40771. // you increase the size, the group schedules actions to create new
  40772. // instances using the current instance template. If you decrease the
  40773. // size, the group schedules delete actions on one or more instances.
  40774. // The resize operation is marked DONE when the resize actions are
  40775. // scheduled even if the group has not yet added or deleted any
  40776. // instances. You must separately verify the status of the creating or
  40777. // deleting actions with the listmanagedinstances method.
  40778. //
  40779. // If the group is part of a backend service that has enabled connection
  40780. // draining, it can take up to 60 seconds after the connection draining
  40781. // duration has elapsed before the VM instance is removed or deleted.
  40782. func (r *RegionInstanceGroupManagersService) Resize(project string, region string, instanceGroupManager string, size int64) *RegionInstanceGroupManagersResizeCall {
  40783. c := &RegionInstanceGroupManagersResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40784. c.project = project
  40785. c.region = region
  40786. c.instanceGroupManager = instanceGroupManager
  40787. c.urlParams_.Set("size", fmt.Sprint(size))
  40788. return c
  40789. }
  40790. // Fields allows partial responses to be retrieved. See
  40791. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40792. // for more information.
  40793. func (c *RegionInstanceGroupManagersResizeCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersResizeCall {
  40794. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40795. return c
  40796. }
  40797. // Context sets the context to be used in this call's Do method. Any
  40798. // pending HTTP request will be aborted if the provided context is
  40799. // canceled.
  40800. func (c *RegionInstanceGroupManagersResizeCall) Context(ctx context.Context) *RegionInstanceGroupManagersResizeCall {
  40801. c.ctx_ = ctx
  40802. return c
  40803. }
  40804. // Header returns an http.Header that can be modified by the caller to
  40805. // add HTTP headers to the request.
  40806. func (c *RegionInstanceGroupManagersResizeCall) Header() http.Header {
  40807. if c.header_ == nil {
  40808. c.header_ = make(http.Header)
  40809. }
  40810. return c.header_
  40811. }
  40812. func (c *RegionInstanceGroupManagersResizeCall) doRequest(alt string) (*http.Response, error) {
  40813. reqHeaders := make(http.Header)
  40814. for k, v := range c.header_ {
  40815. reqHeaders[k] = v
  40816. }
  40817. reqHeaders.Set("User-Agent", c.s.userAgent())
  40818. var body io.Reader = nil
  40819. c.urlParams_.Set("alt", alt)
  40820. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize")
  40821. urls += "?" + c.urlParams_.Encode()
  40822. req, _ := http.NewRequest("POST", urls, body)
  40823. req.Header = reqHeaders
  40824. googleapi.Expand(req.URL, map[string]string{
  40825. "project": c.project,
  40826. "region": c.region,
  40827. "instanceGroupManager": c.instanceGroupManager,
  40828. })
  40829. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40830. }
  40831. // Do executes the "compute.regionInstanceGroupManagers.resize" call.
  40832. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  40833. // status code is an error. Response headers are in either
  40834. // *Operation.ServerResponse.Header or (if a response was returned at
  40835. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  40836. // to check whether the returned error was because
  40837. // http.StatusNotModified was returned.
  40838. func (c *RegionInstanceGroupManagersResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  40839. gensupport.SetOptions(c.urlParams_, opts...)
  40840. res, err := c.doRequest("json")
  40841. if res != nil && res.StatusCode == http.StatusNotModified {
  40842. if res.Body != nil {
  40843. res.Body.Close()
  40844. }
  40845. return nil, &googleapi.Error{
  40846. Code: res.StatusCode,
  40847. Header: res.Header,
  40848. }
  40849. }
  40850. if err != nil {
  40851. return nil, err
  40852. }
  40853. defer googleapi.CloseBody(res)
  40854. if err := googleapi.CheckResponse(res); err != nil {
  40855. return nil, err
  40856. }
  40857. ret := &Operation{
  40858. ServerResponse: googleapi.ServerResponse{
  40859. Header: res.Header,
  40860. HTTPStatusCode: res.StatusCode,
  40861. },
  40862. }
  40863. target := &ret
  40864. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  40865. return nil, err
  40866. }
  40867. return ret, nil
  40868. // {
  40869. // "description": "Changes the intended size for the managed instance group. If you increase the size, the group schedules actions to create new instances using the current instance template. If you decrease the size, the group schedules delete actions on one or more instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.",
  40870. // "httpMethod": "POST",
  40871. // "id": "compute.regionInstanceGroupManagers.resize",
  40872. // "parameterOrder": [
  40873. // "project",
  40874. // "region",
  40875. // "instanceGroupManager",
  40876. // "size"
  40877. // ],
  40878. // "parameters": {
  40879. // "instanceGroupManager": {
  40880. // "description": "Name of the managed instance group.",
  40881. // "location": "path",
  40882. // "required": true,
  40883. // "type": "string"
  40884. // },
  40885. // "project": {
  40886. // "description": "Project ID for this request.",
  40887. // "location": "path",
  40888. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40889. // "required": true,
  40890. // "type": "string"
  40891. // },
  40892. // "region": {
  40893. // "description": "Name of the region scoping this request.",
  40894. // "location": "path",
  40895. // "required": true,
  40896. // "type": "string"
  40897. // },
  40898. // "size": {
  40899. // "description": "Number of instances that should exist in this instance group manager.",
  40900. // "format": "int32",
  40901. // "location": "query",
  40902. // "minimum": "0",
  40903. // "required": true,
  40904. // "type": "integer"
  40905. // }
  40906. // },
  40907. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize",
  40908. // "response": {
  40909. // "$ref": "Operation"
  40910. // },
  40911. // "scopes": [
  40912. // "https://www.googleapis.com/auth/cloud-platform",
  40913. // "https://www.googleapis.com/auth/compute"
  40914. // ]
  40915. // }
  40916. }
  40917. // method id "compute.regionInstanceGroupManagers.setInstanceTemplate":
  40918. type RegionInstanceGroupManagersSetInstanceTemplateCall struct {
  40919. s *Service
  40920. project string
  40921. region string
  40922. instanceGroupManager string
  40923. regioninstancegroupmanagerssettemplaterequest *RegionInstanceGroupManagersSetTemplateRequest
  40924. urlParams_ gensupport.URLParams
  40925. ctx_ context.Context
  40926. header_ http.Header
  40927. }
  40928. // SetInstanceTemplate: Sets the instance template to use when creating
  40929. // new instances or recreating instances in this group. Existing
  40930. // instances are not affected.
  40931. func (r *RegionInstanceGroupManagersService) SetInstanceTemplate(project string, region string, instanceGroupManager string, regioninstancegroupmanagerssettemplaterequest *RegionInstanceGroupManagersSetTemplateRequest) *RegionInstanceGroupManagersSetInstanceTemplateCall {
  40932. c := &RegionInstanceGroupManagersSetInstanceTemplateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40933. c.project = project
  40934. c.region = region
  40935. c.instanceGroupManager = instanceGroupManager
  40936. c.regioninstancegroupmanagerssettemplaterequest = regioninstancegroupmanagerssettemplaterequest
  40937. return c
  40938. }
  40939. // Fields allows partial responses to be retrieved. See
  40940. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40941. // for more information.
  40942. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersSetInstanceTemplateCall {
  40943. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40944. return c
  40945. }
  40946. // Context sets the context to be used in this call's Do method. Any
  40947. // pending HTTP request will be aborted if the provided context is
  40948. // canceled.
  40949. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Context(ctx context.Context) *RegionInstanceGroupManagersSetInstanceTemplateCall {
  40950. c.ctx_ = ctx
  40951. return c
  40952. }
  40953. // Header returns an http.Header that can be modified by the caller to
  40954. // add HTTP headers to the request.
  40955. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Header() http.Header {
  40956. if c.header_ == nil {
  40957. c.header_ = make(http.Header)
  40958. }
  40959. return c.header_
  40960. }
  40961. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) doRequest(alt string) (*http.Response, error) {
  40962. reqHeaders := make(http.Header)
  40963. for k, v := range c.header_ {
  40964. reqHeaders[k] = v
  40965. }
  40966. reqHeaders.Set("User-Agent", c.s.userAgent())
  40967. var body io.Reader = nil
  40968. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssettemplaterequest)
  40969. if err != nil {
  40970. return nil, err
  40971. }
  40972. reqHeaders.Set("Content-Type", "application/json")
  40973. c.urlParams_.Set("alt", alt)
  40974. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate")
  40975. urls += "?" + c.urlParams_.Encode()
  40976. req, _ := http.NewRequest("POST", urls, body)
  40977. req.Header = reqHeaders
  40978. googleapi.Expand(req.URL, map[string]string{
  40979. "project": c.project,
  40980. "region": c.region,
  40981. "instanceGroupManager": c.instanceGroupManager,
  40982. })
  40983. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40984. }
  40985. // Do executes the "compute.regionInstanceGroupManagers.setInstanceTemplate" call.
  40986. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  40987. // status code is an error. Response headers are in either
  40988. // *Operation.ServerResponse.Header or (if a response was returned at
  40989. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  40990. // to check whether the returned error was because
  40991. // http.StatusNotModified was returned.
  40992. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  40993. gensupport.SetOptions(c.urlParams_, opts...)
  40994. res, err := c.doRequest("json")
  40995. if res != nil && res.StatusCode == http.StatusNotModified {
  40996. if res.Body != nil {
  40997. res.Body.Close()
  40998. }
  40999. return nil, &googleapi.Error{
  41000. Code: res.StatusCode,
  41001. Header: res.Header,
  41002. }
  41003. }
  41004. if err != nil {
  41005. return nil, err
  41006. }
  41007. defer googleapi.CloseBody(res)
  41008. if err := googleapi.CheckResponse(res); err != nil {
  41009. return nil, err
  41010. }
  41011. ret := &Operation{
  41012. ServerResponse: googleapi.ServerResponse{
  41013. Header: res.Header,
  41014. HTTPStatusCode: res.StatusCode,
  41015. },
  41016. }
  41017. target := &ret
  41018. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  41019. return nil, err
  41020. }
  41021. return ret, nil
  41022. // {
  41023. // "description": "Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected.",
  41024. // "httpMethod": "POST",
  41025. // "id": "compute.regionInstanceGroupManagers.setInstanceTemplate",
  41026. // "parameterOrder": [
  41027. // "project",
  41028. // "region",
  41029. // "instanceGroupManager"
  41030. // ],
  41031. // "parameters": {
  41032. // "instanceGroupManager": {
  41033. // "description": "The name of the managed instance group.",
  41034. // "location": "path",
  41035. // "required": true,
  41036. // "type": "string"
  41037. // },
  41038. // "project": {
  41039. // "description": "Project ID for this request.",
  41040. // "location": "path",
  41041. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41042. // "required": true,
  41043. // "type": "string"
  41044. // },
  41045. // "region": {
  41046. // "description": "Name of the region scoping this request.",
  41047. // "location": "path",
  41048. // "required": true,
  41049. // "type": "string"
  41050. // }
  41051. // },
  41052. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate",
  41053. // "request": {
  41054. // "$ref": "RegionInstanceGroupManagersSetTemplateRequest"
  41055. // },
  41056. // "response": {
  41057. // "$ref": "Operation"
  41058. // },
  41059. // "scopes": [
  41060. // "https://www.googleapis.com/auth/cloud-platform",
  41061. // "https://www.googleapis.com/auth/compute"
  41062. // ]
  41063. // }
  41064. }
  41065. // method id "compute.regionInstanceGroupManagers.setTargetPools":
  41066. type RegionInstanceGroupManagersSetTargetPoolsCall struct {
  41067. s *Service
  41068. project string
  41069. region string
  41070. instanceGroupManager string
  41071. regioninstancegroupmanagerssettargetpoolsrequest *RegionInstanceGroupManagersSetTargetPoolsRequest
  41072. urlParams_ gensupport.URLParams
  41073. ctx_ context.Context
  41074. header_ http.Header
  41075. }
  41076. // SetTargetPools: Modifies the target pools to which all new instances
  41077. // in this group are assigned. Existing instances in the group are not
  41078. // affected.
  41079. func (r *RegionInstanceGroupManagersService) SetTargetPools(project string, region string, instanceGroupManager string, regioninstancegroupmanagerssettargetpoolsrequest *RegionInstanceGroupManagersSetTargetPoolsRequest) *RegionInstanceGroupManagersSetTargetPoolsCall {
  41080. c := &RegionInstanceGroupManagersSetTargetPoolsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41081. c.project = project
  41082. c.region = region
  41083. c.instanceGroupManager = instanceGroupManager
  41084. c.regioninstancegroupmanagerssettargetpoolsrequest = regioninstancegroupmanagerssettargetpoolsrequest
  41085. return c
  41086. }
  41087. // Fields allows partial responses to be retrieved. See
  41088. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41089. // for more information.
  41090. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersSetTargetPoolsCall {
  41091. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41092. return c
  41093. }
  41094. // Context sets the context to be used in this call's Do method. Any
  41095. // pending HTTP request will be aborted if the provided context is
  41096. // canceled.
  41097. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Context(ctx context.Context) *RegionInstanceGroupManagersSetTargetPoolsCall {
  41098. c.ctx_ = ctx
  41099. return c
  41100. }
  41101. // Header returns an http.Header that can be modified by the caller to
  41102. // add HTTP headers to the request.
  41103. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Header() http.Header {
  41104. if c.header_ == nil {
  41105. c.header_ = make(http.Header)
  41106. }
  41107. return c.header_
  41108. }
  41109. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) doRequest(alt string) (*http.Response, error) {
  41110. reqHeaders := make(http.Header)
  41111. for k, v := range c.header_ {
  41112. reqHeaders[k] = v
  41113. }
  41114. reqHeaders.Set("User-Agent", c.s.userAgent())
  41115. var body io.Reader = nil
  41116. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssettargetpoolsrequest)
  41117. if err != nil {
  41118. return nil, err
  41119. }
  41120. reqHeaders.Set("Content-Type", "application/json")
  41121. c.urlParams_.Set("alt", alt)
  41122. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setTargetPools")
  41123. urls += "?" + c.urlParams_.Encode()
  41124. req, _ := http.NewRequest("POST", urls, body)
  41125. req.Header = reqHeaders
  41126. googleapi.Expand(req.URL, map[string]string{
  41127. "project": c.project,
  41128. "region": c.region,
  41129. "instanceGroupManager": c.instanceGroupManager,
  41130. })
  41131. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41132. }
  41133. // Do executes the "compute.regionInstanceGroupManagers.setTargetPools" call.
  41134. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  41135. // status code is an error. Response headers are in either
  41136. // *Operation.ServerResponse.Header or (if a response was returned at
  41137. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41138. // to check whether the returned error was because
  41139. // http.StatusNotModified was returned.
  41140. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  41141. gensupport.SetOptions(c.urlParams_, opts...)
  41142. res, err := c.doRequest("json")
  41143. if res != nil && res.StatusCode == http.StatusNotModified {
  41144. if res.Body != nil {
  41145. res.Body.Close()
  41146. }
  41147. return nil, &googleapi.Error{
  41148. Code: res.StatusCode,
  41149. Header: res.Header,
  41150. }
  41151. }
  41152. if err != nil {
  41153. return nil, err
  41154. }
  41155. defer googleapi.CloseBody(res)
  41156. if err := googleapi.CheckResponse(res); err != nil {
  41157. return nil, err
  41158. }
  41159. ret := &Operation{
  41160. ServerResponse: googleapi.ServerResponse{
  41161. Header: res.Header,
  41162. HTTPStatusCode: res.StatusCode,
  41163. },
  41164. }
  41165. target := &ret
  41166. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  41167. return nil, err
  41168. }
  41169. return ret, nil
  41170. // {
  41171. // "description": "Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected.",
  41172. // "httpMethod": "POST",
  41173. // "id": "compute.regionInstanceGroupManagers.setTargetPools",
  41174. // "parameterOrder": [
  41175. // "project",
  41176. // "region",
  41177. // "instanceGroupManager"
  41178. // ],
  41179. // "parameters": {
  41180. // "instanceGroupManager": {
  41181. // "description": "Name of the managed instance group.",
  41182. // "location": "path",
  41183. // "required": true,
  41184. // "type": "string"
  41185. // },
  41186. // "project": {
  41187. // "description": "Project ID for this request.",
  41188. // "location": "path",
  41189. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41190. // "required": true,
  41191. // "type": "string"
  41192. // },
  41193. // "region": {
  41194. // "description": "Name of the region scoping this request.",
  41195. // "location": "path",
  41196. // "required": true,
  41197. // "type": "string"
  41198. // }
  41199. // },
  41200. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setTargetPools",
  41201. // "request": {
  41202. // "$ref": "RegionInstanceGroupManagersSetTargetPoolsRequest"
  41203. // },
  41204. // "response": {
  41205. // "$ref": "Operation"
  41206. // },
  41207. // "scopes": [
  41208. // "https://www.googleapis.com/auth/cloud-platform",
  41209. // "https://www.googleapis.com/auth/compute"
  41210. // ]
  41211. // }
  41212. }
  41213. // method id "compute.regionInstanceGroups.get":
  41214. type RegionInstanceGroupsGetCall struct {
  41215. s *Service
  41216. project string
  41217. region string
  41218. instanceGroup string
  41219. urlParams_ gensupport.URLParams
  41220. ifNoneMatch_ string
  41221. ctx_ context.Context
  41222. header_ http.Header
  41223. }
  41224. // Get: Returns the specified instance group resource.
  41225. func (r *RegionInstanceGroupsService) Get(project string, region string, instanceGroup string) *RegionInstanceGroupsGetCall {
  41226. c := &RegionInstanceGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41227. c.project = project
  41228. c.region = region
  41229. c.instanceGroup = instanceGroup
  41230. return c
  41231. }
  41232. // Fields allows partial responses to be retrieved. See
  41233. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41234. // for more information.
  41235. func (c *RegionInstanceGroupsGetCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsGetCall {
  41236. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41237. return c
  41238. }
  41239. // IfNoneMatch sets the optional parameter which makes the operation
  41240. // fail if the object's ETag matches the given value. This is useful for
  41241. // getting updates only after the object has changed since the last
  41242. // request. Use googleapi.IsNotModified to check whether the response
  41243. // error from Do is the result of In-None-Match.
  41244. func (c *RegionInstanceGroupsGetCall) IfNoneMatch(entityTag string) *RegionInstanceGroupsGetCall {
  41245. c.ifNoneMatch_ = entityTag
  41246. return c
  41247. }
  41248. // Context sets the context to be used in this call's Do method. Any
  41249. // pending HTTP request will be aborted if the provided context is
  41250. // canceled.
  41251. func (c *RegionInstanceGroupsGetCall) Context(ctx context.Context) *RegionInstanceGroupsGetCall {
  41252. c.ctx_ = ctx
  41253. return c
  41254. }
  41255. // Header returns an http.Header that can be modified by the caller to
  41256. // add HTTP headers to the request.
  41257. func (c *RegionInstanceGroupsGetCall) Header() http.Header {
  41258. if c.header_ == nil {
  41259. c.header_ = make(http.Header)
  41260. }
  41261. return c.header_
  41262. }
  41263. func (c *RegionInstanceGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  41264. reqHeaders := make(http.Header)
  41265. for k, v := range c.header_ {
  41266. reqHeaders[k] = v
  41267. }
  41268. reqHeaders.Set("User-Agent", c.s.userAgent())
  41269. if c.ifNoneMatch_ != "" {
  41270. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  41271. }
  41272. var body io.Reader = nil
  41273. c.urlParams_.Set("alt", alt)
  41274. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups/{instanceGroup}")
  41275. urls += "?" + c.urlParams_.Encode()
  41276. req, _ := http.NewRequest("GET", urls, body)
  41277. req.Header = reqHeaders
  41278. googleapi.Expand(req.URL, map[string]string{
  41279. "project": c.project,
  41280. "region": c.region,
  41281. "instanceGroup": c.instanceGroup,
  41282. })
  41283. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41284. }
  41285. // Do executes the "compute.regionInstanceGroups.get" call.
  41286. // Exactly one of *InstanceGroup or error will be non-nil. Any non-2xx
  41287. // status code is an error. Response headers are in either
  41288. // *InstanceGroup.ServerResponse.Header or (if a response was returned
  41289. // at all) in error.(*googleapi.Error).Header. Use
  41290. // googleapi.IsNotModified to check whether the returned error was
  41291. // because http.StatusNotModified was returned.
  41292. func (c *RegionInstanceGroupsGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroup, error) {
  41293. gensupport.SetOptions(c.urlParams_, opts...)
  41294. res, err := c.doRequest("json")
  41295. if res != nil && res.StatusCode == http.StatusNotModified {
  41296. if res.Body != nil {
  41297. res.Body.Close()
  41298. }
  41299. return nil, &googleapi.Error{
  41300. Code: res.StatusCode,
  41301. Header: res.Header,
  41302. }
  41303. }
  41304. if err != nil {
  41305. return nil, err
  41306. }
  41307. defer googleapi.CloseBody(res)
  41308. if err := googleapi.CheckResponse(res); err != nil {
  41309. return nil, err
  41310. }
  41311. ret := &InstanceGroup{
  41312. ServerResponse: googleapi.ServerResponse{
  41313. Header: res.Header,
  41314. HTTPStatusCode: res.StatusCode,
  41315. },
  41316. }
  41317. target := &ret
  41318. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  41319. return nil, err
  41320. }
  41321. return ret, nil
  41322. // {
  41323. // "description": "Returns the specified instance group resource.",
  41324. // "httpMethod": "GET",
  41325. // "id": "compute.regionInstanceGroups.get",
  41326. // "parameterOrder": [
  41327. // "project",
  41328. // "region",
  41329. // "instanceGroup"
  41330. // ],
  41331. // "parameters": {
  41332. // "instanceGroup": {
  41333. // "description": "Name of the instance group resource to return.",
  41334. // "location": "path",
  41335. // "required": true,
  41336. // "type": "string"
  41337. // },
  41338. // "project": {
  41339. // "description": "Project ID for this request.",
  41340. // "location": "path",
  41341. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41342. // "required": true,
  41343. // "type": "string"
  41344. // },
  41345. // "region": {
  41346. // "description": "Name of the region scoping this request.",
  41347. // "location": "path",
  41348. // "required": true,
  41349. // "type": "string"
  41350. // }
  41351. // },
  41352. // "path": "{project}/regions/{region}/instanceGroups/{instanceGroup}",
  41353. // "response": {
  41354. // "$ref": "InstanceGroup"
  41355. // },
  41356. // "scopes": [
  41357. // "https://www.googleapis.com/auth/cloud-platform",
  41358. // "https://www.googleapis.com/auth/compute",
  41359. // "https://www.googleapis.com/auth/compute.readonly"
  41360. // ]
  41361. // }
  41362. }
  41363. // method id "compute.regionInstanceGroups.list":
  41364. type RegionInstanceGroupsListCall struct {
  41365. s *Service
  41366. project string
  41367. region string
  41368. urlParams_ gensupport.URLParams
  41369. ifNoneMatch_ string
  41370. ctx_ context.Context
  41371. header_ http.Header
  41372. }
  41373. // List: Retrieves the list of instance group resources contained within
  41374. // the specified region.
  41375. func (r *RegionInstanceGroupsService) List(project string, region string) *RegionInstanceGroupsListCall {
  41376. c := &RegionInstanceGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41377. c.project = project
  41378. c.region = region
  41379. return c
  41380. }
  41381. // Filter sets the optional parameter "filter": Sets a filter
  41382. // {expression} for filtering listed resources. Your {expression} must
  41383. // be in the format: field_name comparison_string literal_string.
  41384. //
  41385. // The field_name is the name of the field you want to compare. Only
  41386. // atomic field types are supported (string, number, boolean). The
  41387. // comparison_string must be either eq (equals) or ne (not equals). The
  41388. // literal_string is the string value to filter to. The literal value
  41389. // must be valid for the type of field you are filtering by (string,
  41390. // number, boolean). For string fields, the literal value is interpreted
  41391. // as a regular expression using RE2 syntax. The literal value must
  41392. // match the entire field.
  41393. //
  41394. // For example, to filter for instances that do not have a name of
  41395. // example-instance, you would use name ne example-instance.
  41396. //
  41397. // You can filter on nested fields. For example, you could filter on
  41398. // instances that have set the scheduling.automaticRestart field to
  41399. // true. Use filtering on nested fields to take advantage of labels to
  41400. // organize and search for results based on label values.
  41401. //
  41402. // To filter on multiple expressions, provide each separate expression
  41403. // within parentheses. For example, (scheduling.automaticRestart eq
  41404. // true) (zone eq us-central1-f). Multiple expressions are treated as
  41405. // AND expressions, meaning that resources must match all expressions to
  41406. // pass the filters.
  41407. func (c *RegionInstanceGroupsListCall) Filter(filter string) *RegionInstanceGroupsListCall {
  41408. c.urlParams_.Set("filter", filter)
  41409. return c
  41410. }
  41411. // MaxResults sets the optional parameter "maxResults": The maximum
  41412. // number of results per page that should be returned. If the number of
  41413. // available results is larger than maxResults, Compute Engine returns a
  41414. // nextPageToken that can be used to get the next page of results in
  41415. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  41416. // (Default: 500)
  41417. func (c *RegionInstanceGroupsListCall) MaxResults(maxResults int64) *RegionInstanceGroupsListCall {
  41418. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  41419. return c
  41420. }
  41421. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  41422. // a certain order. By default, results are returned in alphanumerical
  41423. // order based on the resource name.
  41424. //
  41425. // You can also sort results in descending order based on the creation
  41426. // timestamp using orderBy="creationTimestamp desc". This sorts results
  41427. // based on the creationTimestamp field in reverse chronological order
  41428. // (newest result first). Use this to sort resources like operations so
  41429. // that the newest operation is returned first.
  41430. //
  41431. // Currently, only sorting by name or creationTimestamp desc is
  41432. // supported.
  41433. func (c *RegionInstanceGroupsListCall) OrderBy(orderBy string) *RegionInstanceGroupsListCall {
  41434. c.urlParams_.Set("orderBy", orderBy)
  41435. return c
  41436. }
  41437. // PageToken sets the optional parameter "pageToken": Specifies a page
  41438. // token to use. Set pageToken to the nextPageToken returned by a
  41439. // previous list request to get the next page of results.
  41440. func (c *RegionInstanceGroupsListCall) PageToken(pageToken string) *RegionInstanceGroupsListCall {
  41441. c.urlParams_.Set("pageToken", pageToken)
  41442. return c
  41443. }
  41444. // Fields allows partial responses to be retrieved. See
  41445. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41446. // for more information.
  41447. func (c *RegionInstanceGroupsListCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsListCall {
  41448. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41449. return c
  41450. }
  41451. // IfNoneMatch sets the optional parameter which makes the operation
  41452. // fail if the object's ETag matches the given value. This is useful for
  41453. // getting updates only after the object has changed since the last
  41454. // request. Use googleapi.IsNotModified to check whether the response
  41455. // error from Do is the result of In-None-Match.
  41456. func (c *RegionInstanceGroupsListCall) IfNoneMatch(entityTag string) *RegionInstanceGroupsListCall {
  41457. c.ifNoneMatch_ = entityTag
  41458. return c
  41459. }
  41460. // Context sets the context to be used in this call's Do method. Any
  41461. // pending HTTP request will be aborted if the provided context is
  41462. // canceled.
  41463. func (c *RegionInstanceGroupsListCall) Context(ctx context.Context) *RegionInstanceGroupsListCall {
  41464. c.ctx_ = ctx
  41465. return c
  41466. }
  41467. // Header returns an http.Header that can be modified by the caller to
  41468. // add HTTP headers to the request.
  41469. func (c *RegionInstanceGroupsListCall) Header() http.Header {
  41470. if c.header_ == nil {
  41471. c.header_ = make(http.Header)
  41472. }
  41473. return c.header_
  41474. }
  41475. func (c *RegionInstanceGroupsListCall) doRequest(alt string) (*http.Response, error) {
  41476. reqHeaders := make(http.Header)
  41477. for k, v := range c.header_ {
  41478. reqHeaders[k] = v
  41479. }
  41480. reqHeaders.Set("User-Agent", c.s.userAgent())
  41481. if c.ifNoneMatch_ != "" {
  41482. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  41483. }
  41484. var body io.Reader = nil
  41485. c.urlParams_.Set("alt", alt)
  41486. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups")
  41487. urls += "?" + c.urlParams_.Encode()
  41488. req, _ := http.NewRequest("GET", urls, body)
  41489. req.Header = reqHeaders
  41490. googleapi.Expand(req.URL, map[string]string{
  41491. "project": c.project,
  41492. "region": c.region,
  41493. })
  41494. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41495. }
  41496. // Do executes the "compute.regionInstanceGroups.list" call.
  41497. // Exactly one of *RegionInstanceGroupList or error will be non-nil. Any
  41498. // non-2xx status code is an error. Response headers are in either
  41499. // *RegionInstanceGroupList.ServerResponse.Header or (if a response was
  41500. // returned at all) in error.(*googleapi.Error).Header. Use
  41501. // googleapi.IsNotModified to check whether the returned error was
  41502. // because http.StatusNotModified was returned.
  41503. func (c *RegionInstanceGroupsListCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupList, error) {
  41504. gensupport.SetOptions(c.urlParams_, opts...)
  41505. res, err := c.doRequest("json")
  41506. if res != nil && res.StatusCode == http.StatusNotModified {
  41507. if res.Body != nil {
  41508. res.Body.Close()
  41509. }
  41510. return nil, &googleapi.Error{
  41511. Code: res.StatusCode,
  41512. Header: res.Header,
  41513. }
  41514. }
  41515. if err != nil {
  41516. return nil, err
  41517. }
  41518. defer googleapi.CloseBody(res)
  41519. if err := googleapi.CheckResponse(res); err != nil {
  41520. return nil, err
  41521. }
  41522. ret := &RegionInstanceGroupList{
  41523. ServerResponse: googleapi.ServerResponse{
  41524. Header: res.Header,
  41525. HTTPStatusCode: res.StatusCode,
  41526. },
  41527. }
  41528. target := &ret
  41529. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  41530. return nil, err
  41531. }
  41532. return ret, nil
  41533. // {
  41534. // "description": "Retrieves the list of instance group resources contained within the specified region.",
  41535. // "httpMethod": "GET",
  41536. // "id": "compute.regionInstanceGroups.list",
  41537. // "parameterOrder": [
  41538. // "project",
  41539. // "region"
  41540. // ],
  41541. // "parameters": {
  41542. // "filter": {
  41543. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  41544. // "location": "query",
  41545. // "type": "string"
  41546. // },
  41547. // "maxResults": {
  41548. // "default": "500",
  41549. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  41550. // "format": "uint32",
  41551. // "location": "query",
  41552. // "minimum": "0",
  41553. // "type": "integer"
  41554. // },
  41555. // "orderBy": {
  41556. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  41557. // "location": "query",
  41558. // "type": "string"
  41559. // },
  41560. // "pageToken": {
  41561. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  41562. // "location": "query",
  41563. // "type": "string"
  41564. // },
  41565. // "project": {
  41566. // "description": "Project ID for this request.",
  41567. // "location": "path",
  41568. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41569. // "required": true,
  41570. // "type": "string"
  41571. // },
  41572. // "region": {
  41573. // "description": "Name of the region scoping this request.",
  41574. // "location": "path",
  41575. // "required": true,
  41576. // "type": "string"
  41577. // }
  41578. // },
  41579. // "path": "{project}/regions/{region}/instanceGroups",
  41580. // "response": {
  41581. // "$ref": "RegionInstanceGroupList"
  41582. // },
  41583. // "scopes": [
  41584. // "https://www.googleapis.com/auth/cloud-platform",
  41585. // "https://www.googleapis.com/auth/compute",
  41586. // "https://www.googleapis.com/auth/compute.readonly"
  41587. // ]
  41588. // }
  41589. }
  41590. // Pages invokes f for each page of results.
  41591. // A non-nil error returned from f will halt the iteration.
  41592. // The provided context supersedes any context provided to the Context method.
  41593. func (c *RegionInstanceGroupsListCall) Pages(ctx context.Context, f func(*RegionInstanceGroupList) error) error {
  41594. c.ctx_ = ctx
  41595. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  41596. for {
  41597. x, err := c.Do()
  41598. if err != nil {
  41599. return err
  41600. }
  41601. if err := f(x); err != nil {
  41602. return err
  41603. }
  41604. if x.NextPageToken == "" {
  41605. return nil
  41606. }
  41607. c.PageToken(x.NextPageToken)
  41608. }
  41609. }
  41610. // method id "compute.regionInstanceGroups.listInstances":
  41611. type RegionInstanceGroupsListInstancesCall struct {
  41612. s *Service
  41613. project string
  41614. region string
  41615. instanceGroup string
  41616. regioninstancegroupslistinstancesrequest *RegionInstanceGroupsListInstancesRequest
  41617. urlParams_ gensupport.URLParams
  41618. ctx_ context.Context
  41619. header_ http.Header
  41620. }
  41621. // ListInstances: Lists the instances in the specified instance group
  41622. // and displays information about the named ports. Depending on the
  41623. // specified options, this method can list all instances or only the
  41624. // instances that are running.
  41625. func (r *RegionInstanceGroupsService) ListInstances(project string, region string, instanceGroup string, regioninstancegroupslistinstancesrequest *RegionInstanceGroupsListInstancesRequest) *RegionInstanceGroupsListInstancesCall {
  41626. c := &RegionInstanceGroupsListInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41627. c.project = project
  41628. c.region = region
  41629. c.instanceGroup = instanceGroup
  41630. c.regioninstancegroupslistinstancesrequest = regioninstancegroupslistinstancesrequest
  41631. return c
  41632. }
  41633. // Filter sets the optional parameter "filter": Sets a filter
  41634. // {expression} for filtering listed resources. Your {expression} must
  41635. // be in the format: field_name comparison_string literal_string.
  41636. //
  41637. // The field_name is the name of the field you want to compare. Only
  41638. // atomic field types are supported (string, number, boolean). The
  41639. // comparison_string must be either eq (equals) or ne (not equals). The
  41640. // literal_string is the string value to filter to. The literal value
  41641. // must be valid for the type of field you are filtering by (string,
  41642. // number, boolean). For string fields, the literal value is interpreted
  41643. // as a regular expression using RE2 syntax. The literal value must
  41644. // match the entire field.
  41645. //
  41646. // For example, to filter for instances that do not have a name of
  41647. // example-instance, you would use name ne example-instance.
  41648. //
  41649. // You can filter on nested fields. For example, you could filter on
  41650. // instances that have set the scheduling.automaticRestart field to
  41651. // true. Use filtering on nested fields to take advantage of labels to
  41652. // organize and search for results based on label values.
  41653. //
  41654. // To filter on multiple expressions, provide each separate expression
  41655. // within parentheses. For example, (scheduling.automaticRestart eq
  41656. // true) (zone eq us-central1-f). Multiple expressions are treated as
  41657. // AND expressions, meaning that resources must match all expressions to
  41658. // pass the filters.
  41659. func (c *RegionInstanceGroupsListInstancesCall) Filter(filter string) *RegionInstanceGroupsListInstancesCall {
  41660. c.urlParams_.Set("filter", filter)
  41661. return c
  41662. }
  41663. // MaxResults sets the optional parameter "maxResults": The maximum
  41664. // number of results per page that should be returned. If the number of
  41665. // available results is larger than maxResults, Compute Engine returns a
  41666. // nextPageToken that can be used to get the next page of results in
  41667. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  41668. // (Default: 500)
  41669. func (c *RegionInstanceGroupsListInstancesCall) MaxResults(maxResults int64) *RegionInstanceGroupsListInstancesCall {
  41670. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  41671. return c
  41672. }
  41673. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  41674. // a certain order. By default, results are returned in alphanumerical
  41675. // order based on the resource name.
  41676. //
  41677. // You can also sort results in descending order based on the creation
  41678. // timestamp using orderBy="creationTimestamp desc". This sorts results
  41679. // based on the creationTimestamp field in reverse chronological order
  41680. // (newest result first). Use this to sort resources like operations so
  41681. // that the newest operation is returned first.
  41682. //
  41683. // Currently, only sorting by name or creationTimestamp desc is
  41684. // supported.
  41685. func (c *RegionInstanceGroupsListInstancesCall) OrderBy(orderBy string) *RegionInstanceGroupsListInstancesCall {
  41686. c.urlParams_.Set("orderBy", orderBy)
  41687. return c
  41688. }
  41689. // PageToken sets the optional parameter "pageToken": Specifies a page
  41690. // token to use. Set pageToken to the nextPageToken returned by a
  41691. // previous list request to get the next page of results.
  41692. func (c *RegionInstanceGroupsListInstancesCall) PageToken(pageToken string) *RegionInstanceGroupsListInstancesCall {
  41693. c.urlParams_.Set("pageToken", pageToken)
  41694. return c
  41695. }
  41696. // Fields allows partial responses to be retrieved. See
  41697. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41698. // for more information.
  41699. func (c *RegionInstanceGroupsListInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsListInstancesCall {
  41700. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41701. return c
  41702. }
  41703. // Context sets the context to be used in this call's Do method. Any
  41704. // pending HTTP request will be aborted if the provided context is
  41705. // canceled.
  41706. func (c *RegionInstanceGroupsListInstancesCall) Context(ctx context.Context) *RegionInstanceGroupsListInstancesCall {
  41707. c.ctx_ = ctx
  41708. return c
  41709. }
  41710. // Header returns an http.Header that can be modified by the caller to
  41711. // add HTTP headers to the request.
  41712. func (c *RegionInstanceGroupsListInstancesCall) Header() http.Header {
  41713. if c.header_ == nil {
  41714. c.header_ = make(http.Header)
  41715. }
  41716. return c.header_
  41717. }
  41718. func (c *RegionInstanceGroupsListInstancesCall) doRequest(alt string) (*http.Response, error) {
  41719. reqHeaders := make(http.Header)
  41720. for k, v := range c.header_ {
  41721. reqHeaders[k] = v
  41722. }
  41723. reqHeaders.Set("User-Agent", c.s.userAgent())
  41724. var body io.Reader = nil
  41725. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupslistinstancesrequest)
  41726. if err != nil {
  41727. return nil, err
  41728. }
  41729. reqHeaders.Set("Content-Type", "application/json")
  41730. c.urlParams_.Set("alt", alt)
  41731. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups/{instanceGroup}/listInstances")
  41732. urls += "?" + c.urlParams_.Encode()
  41733. req, _ := http.NewRequest("POST", urls, body)
  41734. req.Header = reqHeaders
  41735. googleapi.Expand(req.URL, map[string]string{
  41736. "project": c.project,
  41737. "region": c.region,
  41738. "instanceGroup": c.instanceGroup,
  41739. })
  41740. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41741. }
  41742. // Do executes the "compute.regionInstanceGroups.listInstances" call.
  41743. // Exactly one of *RegionInstanceGroupsListInstances or error will be
  41744. // non-nil. Any non-2xx status code is an error. Response headers are in
  41745. // either *RegionInstanceGroupsListInstances.ServerResponse.Header or
  41746. // (if a response was returned at all) in
  41747. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  41748. // whether the returned error was because http.StatusNotModified was
  41749. // returned.
  41750. func (c *RegionInstanceGroupsListInstancesCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupsListInstances, error) {
  41751. gensupport.SetOptions(c.urlParams_, opts...)
  41752. res, err := c.doRequest("json")
  41753. if res != nil && res.StatusCode == http.StatusNotModified {
  41754. if res.Body != nil {
  41755. res.Body.Close()
  41756. }
  41757. return nil, &googleapi.Error{
  41758. Code: res.StatusCode,
  41759. Header: res.Header,
  41760. }
  41761. }
  41762. if err != nil {
  41763. return nil, err
  41764. }
  41765. defer googleapi.CloseBody(res)
  41766. if err := googleapi.CheckResponse(res); err != nil {
  41767. return nil, err
  41768. }
  41769. ret := &RegionInstanceGroupsListInstances{
  41770. ServerResponse: googleapi.ServerResponse{
  41771. Header: res.Header,
  41772. HTTPStatusCode: res.StatusCode,
  41773. },
  41774. }
  41775. target := &ret
  41776. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  41777. return nil, err
  41778. }
  41779. return ret, nil
  41780. // {
  41781. // "description": "Lists the instances in the specified instance group and displays information about the named ports. Depending on the specified options, this method can list all instances or only the instances that are running.",
  41782. // "httpMethod": "POST",
  41783. // "id": "compute.regionInstanceGroups.listInstances",
  41784. // "parameterOrder": [
  41785. // "project",
  41786. // "region",
  41787. // "instanceGroup"
  41788. // ],
  41789. // "parameters": {
  41790. // "filter": {
  41791. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  41792. // "location": "query",
  41793. // "type": "string"
  41794. // },
  41795. // "instanceGroup": {
  41796. // "description": "Name of the regional instance group for which we want to list the instances.",
  41797. // "location": "path",
  41798. // "required": true,
  41799. // "type": "string"
  41800. // },
  41801. // "maxResults": {
  41802. // "default": "500",
  41803. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  41804. // "format": "uint32",
  41805. // "location": "query",
  41806. // "minimum": "0",
  41807. // "type": "integer"
  41808. // },
  41809. // "orderBy": {
  41810. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  41811. // "location": "query",
  41812. // "type": "string"
  41813. // },
  41814. // "pageToken": {
  41815. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  41816. // "location": "query",
  41817. // "type": "string"
  41818. // },
  41819. // "project": {
  41820. // "description": "Project ID for this request.",
  41821. // "location": "path",
  41822. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41823. // "required": true,
  41824. // "type": "string"
  41825. // },
  41826. // "region": {
  41827. // "description": "Name of the region scoping this request.",
  41828. // "location": "path",
  41829. // "required": true,
  41830. // "type": "string"
  41831. // }
  41832. // },
  41833. // "path": "{project}/regions/{region}/instanceGroups/{instanceGroup}/listInstances",
  41834. // "request": {
  41835. // "$ref": "RegionInstanceGroupsListInstancesRequest"
  41836. // },
  41837. // "response": {
  41838. // "$ref": "RegionInstanceGroupsListInstances"
  41839. // },
  41840. // "scopes": [
  41841. // "https://www.googleapis.com/auth/cloud-platform",
  41842. // "https://www.googleapis.com/auth/compute",
  41843. // "https://www.googleapis.com/auth/compute.readonly"
  41844. // ]
  41845. // }
  41846. }
  41847. // Pages invokes f for each page of results.
  41848. // A non-nil error returned from f will halt the iteration.
  41849. // The provided context supersedes any context provided to the Context method.
  41850. func (c *RegionInstanceGroupsListInstancesCall) Pages(ctx context.Context, f func(*RegionInstanceGroupsListInstances) error) error {
  41851. c.ctx_ = ctx
  41852. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  41853. for {
  41854. x, err := c.Do()
  41855. if err != nil {
  41856. return err
  41857. }
  41858. if err := f(x); err != nil {
  41859. return err
  41860. }
  41861. if x.NextPageToken == "" {
  41862. return nil
  41863. }
  41864. c.PageToken(x.NextPageToken)
  41865. }
  41866. }
  41867. // method id "compute.regionInstanceGroups.setNamedPorts":
  41868. type RegionInstanceGroupsSetNamedPortsCall struct {
  41869. s *Service
  41870. project string
  41871. region string
  41872. instanceGroup string
  41873. regioninstancegroupssetnamedportsrequest *RegionInstanceGroupsSetNamedPortsRequest
  41874. urlParams_ gensupport.URLParams
  41875. ctx_ context.Context
  41876. header_ http.Header
  41877. }
  41878. // SetNamedPorts: Sets the named ports for the specified regional
  41879. // instance group.
  41880. func (r *RegionInstanceGroupsService) SetNamedPorts(project string, region string, instanceGroup string, regioninstancegroupssetnamedportsrequest *RegionInstanceGroupsSetNamedPortsRequest) *RegionInstanceGroupsSetNamedPortsCall {
  41881. c := &RegionInstanceGroupsSetNamedPortsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41882. c.project = project
  41883. c.region = region
  41884. c.instanceGroup = instanceGroup
  41885. c.regioninstancegroupssetnamedportsrequest = regioninstancegroupssetnamedportsrequest
  41886. return c
  41887. }
  41888. // Fields allows partial responses to be retrieved. See
  41889. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41890. // for more information.
  41891. func (c *RegionInstanceGroupsSetNamedPortsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsSetNamedPortsCall {
  41892. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41893. return c
  41894. }
  41895. // Context sets the context to be used in this call's Do method. Any
  41896. // pending HTTP request will be aborted if the provided context is
  41897. // canceled.
  41898. func (c *RegionInstanceGroupsSetNamedPortsCall) Context(ctx context.Context) *RegionInstanceGroupsSetNamedPortsCall {
  41899. c.ctx_ = ctx
  41900. return c
  41901. }
  41902. // Header returns an http.Header that can be modified by the caller to
  41903. // add HTTP headers to the request.
  41904. func (c *RegionInstanceGroupsSetNamedPortsCall) Header() http.Header {
  41905. if c.header_ == nil {
  41906. c.header_ = make(http.Header)
  41907. }
  41908. return c.header_
  41909. }
  41910. func (c *RegionInstanceGroupsSetNamedPortsCall) doRequest(alt string) (*http.Response, error) {
  41911. reqHeaders := make(http.Header)
  41912. for k, v := range c.header_ {
  41913. reqHeaders[k] = v
  41914. }
  41915. reqHeaders.Set("User-Agent", c.s.userAgent())
  41916. var body io.Reader = nil
  41917. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupssetnamedportsrequest)
  41918. if err != nil {
  41919. return nil, err
  41920. }
  41921. reqHeaders.Set("Content-Type", "application/json")
  41922. c.urlParams_.Set("alt", alt)
  41923. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups/{instanceGroup}/setNamedPorts")
  41924. urls += "?" + c.urlParams_.Encode()
  41925. req, _ := http.NewRequest("POST", urls, body)
  41926. req.Header = reqHeaders
  41927. googleapi.Expand(req.URL, map[string]string{
  41928. "project": c.project,
  41929. "region": c.region,
  41930. "instanceGroup": c.instanceGroup,
  41931. })
  41932. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41933. }
  41934. // Do executes the "compute.regionInstanceGroups.setNamedPorts" call.
  41935. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  41936. // status code is an error. Response headers are in either
  41937. // *Operation.ServerResponse.Header or (if a response was returned at
  41938. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41939. // to check whether the returned error was because
  41940. // http.StatusNotModified was returned.
  41941. func (c *RegionInstanceGroupsSetNamedPortsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  41942. gensupport.SetOptions(c.urlParams_, opts...)
  41943. res, err := c.doRequest("json")
  41944. if res != nil && res.StatusCode == http.StatusNotModified {
  41945. if res.Body != nil {
  41946. res.Body.Close()
  41947. }
  41948. return nil, &googleapi.Error{
  41949. Code: res.StatusCode,
  41950. Header: res.Header,
  41951. }
  41952. }
  41953. if err != nil {
  41954. return nil, err
  41955. }
  41956. defer googleapi.CloseBody(res)
  41957. if err := googleapi.CheckResponse(res); err != nil {
  41958. return nil, err
  41959. }
  41960. ret := &Operation{
  41961. ServerResponse: googleapi.ServerResponse{
  41962. Header: res.Header,
  41963. HTTPStatusCode: res.StatusCode,
  41964. },
  41965. }
  41966. target := &ret
  41967. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  41968. return nil, err
  41969. }
  41970. return ret, nil
  41971. // {
  41972. // "description": "Sets the named ports for the specified regional instance group.",
  41973. // "httpMethod": "POST",
  41974. // "id": "compute.regionInstanceGroups.setNamedPorts",
  41975. // "parameterOrder": [
  41976. // "project",
  41977. // "region",
  41978. // "instanceGroup"
  41979. // ],
  41980. // "parameters": {
  41981. // "instanceGroup": {
  41982. // "description": "The name of the regional instance group where the named ports are updated.",
  41983. // "location": "path",
  41984. // "required": true,
  41985. // "type": "string"
  41986. // },
  41987. // "project": {
  41988. // "description": "Project ID for this request.",
  41989. // "location": "path",
  41990. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41991. // "required": true,
  41992. // "type": "string"
  41993. // },
  41994. // "region": {
  41995. // "description": "Name of the region scoping this request.",
  41996. // "location": "path",
  41997. // "required": true,
  41998. // "type": "string"
  41999. // }
  42000. // },
  42001. // "path": "{project}/regions/{region}/instanceGroups/{instanceGroup}/setNamedPorts",
  42002. // "request": {
  42003. // "$ref": "RegionInstanceGroupsSetNamedPortsRequest"
  42004. // },
  42005. // "response": {
  42006. // "$ref": "Operation"
  42007. // },
  42008. // "scopes": [
  42009. // "https://www.googleapis.com/auth/cloud-platform",
  42010. // "https://www.googleapis.com/auth/compute"
  42011. // ]
  42012. // }
  42013. }
  42014. // method id "compute.regionOperations.delete":
  42015. type RegionOperationsDeleteCall struct {
  42016. s *Service
  42017. project string
  42018. region string
  42019. operation string
  42020. urlParams_ gensupport.URLParams
  42021. ctx_ context.Context
  42022. header_ http.Header
  42023. }
  42024. // Delete: Deletes the specified region-specific Operations resource.
  42025. // For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/delete
  42026. func (r *RegionOperationsService) Delete(project string, region string, operation string) *RegionOperationsDeleteCall {
  42027. c := &RegionOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42028. c.project = project
  42029. c.region = region
  42030. c.operation = operation
  42031. return c
  42032. }
  42033. // Fields allows partial responses to be retrieved. See
  42034. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42035. // for more information.
  42036. func (c *RegionOperationsDeleteCall) Fields(s ...googleapi.Field) *RegionOperationsDeleteCall {
  42037. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42038. return c
  42039. }
  42040. // Context sets the context to be used in this call's Do method. Any
  42041. // pending HTTP request will be aborted if the provided context is
  42042. // canceled.
  42043. func (c *RegionOperationsDeleteCall) Context(ctx context.Context) *RegionOperationsDeleteCall {
  42044. c.ctx_ = ctx
  42045. return c
  42046. }
  42047. // Header returns an http.Header that can be modified by the caller to
  42048. // add HTTP headers to the request.
  42049. func (c *RegionOperationsDeleteCall) Header() http.Header {
  42050. if c.header_ == nil {
  42051. c.header_ = make(http.Header)
  42052. }
  42053. return c.header_
  42054. }
  42055. func (c *RegionOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  42056. reqHeaders := make(http.Header)
  42057. for k, v := range c.header_ {
  42058. reqHeaders[k] = v
  42059. }
  42060. reqHeaders.Set("User-Agent", c.s.userAgent())
  42061. var body io.Reader = nil
  42062. c.urlParams_.Set("alt", alt)
  42063. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations/{operation}")
  42064. urls += "?" + c.urlParams_.Encode()
  42065. req, _ := http.NewRequest("DELETE", urls, body)
  42066. req.Header = reqHeaders
  42067. googleapi.Expand(req.URL, map[string]string{
  42068. "project": c.project,
  42069. "region": c.region,
  42070. "operation": c.operation,
  42071. })
  42072. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42073. }
  42074. // Do executes the "compute.regionOperations.delete" call.
  42075. func (c *RegionOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  42076. gensupport.SetOptions(c.urlParams_, opts...)
  42077. res, err := c.doRequest("json")
  42078. if err != nil {
  42079. return err
  42080. }
  42081. defer googleapi.CloseBody(res)
  42082. if err := googleapi.CheckResponse(res); err != nil {
  42083. return err
  42084. }
  42085. return nil
  42086. // {
  42087. // "description": "Deletes the specified region-specific Operations resource.",
  42088. // "httpMethod": "DELETE",
  42089. // "id": "compute.regionOperations.delete",
  42090. // "parameterOrder": [
  42091. // "project",
  42092. // "region",
  42093. // "operation"
  42094. // ],
  42095. // "parameters": {
  42096. // "operation": {
  42097. // "description": "Name of the Operations resource to delete.",
  42098. // "location": "path",
  42099. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  42100. // "required": true,
  42101. // "type": "string"
  42102. // },
  42103. // "project": {
  42104. // "description": "Project ID for this request.",
  42105. // "location": "path",
  42106. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42107. // "required": true,
  42108. // "type": "string"
  42109. // },
  42110. // "region": {
  42111. // "description": "Name of the region for this request.",
  42112. // "location": "path",
  42113. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  42114. // "required": true,
  42115. // "type": "string"
  42116. // }
  42117. // },
  42118. // "path": "{project}/regions/{region}/operations/{operation}",
  42119. // "scopes": [
  42120. // "https://www.googleapis.com/auth/cloud-platform",
  42121. // "https://www.googleapis.com/auth/compute"
  42122. // ]
  42123. // }
  42124. }
  42125. // method id "compute.regionOperations.get":
  42126. type RegionOperationsGetCall struct {
  42127. s *Service
  42128. project string
  42129. region string
  42130. operation string
  42131. urlParams_ gensupport.URLParams
  42132. ifNoneMatch_ string
  42133. ctx_ context.Context
  42134. header_ http.Header
  42135. }
  42136. // Get: Retrieves the specified region-specific Operations resource.
  42137. // For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/get
  42138. func (r *RegionOperationsService) Get(project string, region string, operation string) *RegionOperationsGetCall {
  42139. c := &RegionOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42140. c.project = project
  42141. c.region = region
  42142. c.operation = operation
  42143. return c
  42144. }
  42145. // Fields allows partial responses to be retrieved. See
  42146. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42147. // for more information.
  42148. func (c *RegionOperationsGetCall) Fields(s ...googleapi.Field) *RegionOperationsGetCall {
  42149. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42150. return c
  42151. }
  42152. // IfNoneMatch sets the optional parameter which makes the operation
  42153. // fail if the object's ETag matches the given value. This is useful for
  42154. // getting updates only after the object has changed since the last
  42155. // request. Use googleapi.IsNotModified to check whether the response
  42156. // error from Do is the result of In-None-Match.
  42157. func (c *RegionOperationsGetCall) IfNoneMatch(entityTag string) *RegionOperationsGetCall {
  42158. c.ifNoneMatch_ = entityTag
  42159. return c
  42160. }
  42161. // Context sets the context to be used in this call's Do method. Any
  42162. // pending HTTP request will be aborted if the provided context is
  42163. // canceled.
  42164. func (c *RegionOperationsGetCall) Context(ctx context.Context) *RegionOperationsGetCall {
  42165. c.ctx_ = ctx
  42166. return c
  42167. }
  42168. // Header returns an http.Header that can be modified by the caller to
  42169. // add HTTP headers to the request.
  42170. func (c *RegionOperationsGetCall) Header() http.Header {
  42171. if c.header_ == nil {
  42172. c.header_ = make(http.Header)
  42173. }
  42174. return c.header_
  42175. }
  42176. func (c *RegionOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  42177. reqHeaders := make(http.Header)
  42178. for k, v := range c.header_ {
  42179. reqHeaders[k] = v
  42180. }
  42181. reqHeaders.Set("User-Agent", c.s.userAgent())
  42182. if c.ifNoneMatch_ != "" {
  42183. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42184. }
  42185. var body io.Reader = nil
  42186. c.urlParams_.Set("alt", alt)
  42187. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations/{operation}")
  42188. urls += "?" + c.urlParams_.Encode()
  42189. req, _ := http.NewRequest("GET", urls, body)
  42190. req.Header = reqHeaders
  42191. googleapi.Expand(req.URL, map[string]string{
  42192. "project": c.project,
  42193. "region": c.region,
  42194. "operation": c.operation,
  42195. })
  42196. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42197. }
  42198. // Do executes the "compute.regionOperations.get" call.
  42199. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  42200. // status code is an error. Response headers are in either
  42201. // *Operation.ServerResponse.Header or (if a response was returned at
  42202. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42203. // to check whether the returned error was because
  42204. // http.StatusNotModified was returned.
  42205. func (c *RegionOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  42206. gensupport.SetOptions(c.urlParams_, opts...)
  42207. res, err := c.doRequest("json")
  42208. if res != nil && res.StatusCode == http.StatusNotModified {
  42209. if res.Body != nil {
  42210. res.Body.Close()
  42211. }
  42212. return nil, &googleapi.Error{
  42213. Code: res.StatusCode,
  42214. Header: res.Header,
  42215. }
  42216. }
  42217. if err != nil {
  42218. return nil, err
  42219. }
  42220. defer googleapi.CloseBody(res)
  42221. if err := googleapi.CheckResponse(res); err != nil {
  42222. return nil, err
  42223. }
  42224. ret := &Operation{
  42225. ServerResponse: googleapi.ServerResponse{
  42226. Header: res.Header,
  42227. HTTPStatusCode: res.StatusCode,
  42228. },
  42229. }
  42230. target := &ret
  42231. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  42232. return nil, err
  42233. }
  42234. return ret, nil
  42235. // {
  42236. // "description": "Retrieves the specified region-specific Operations resource.",
  42237. // "httpMethod": "GET",
  42238. // "id": "compute.regionOperations.get",
  42239. // "parameterOrder": [
  42240. // "project",
  42241. // "region",
  42242. // "operation"
  42243. // ],
  42244. // "parameters": {
  42245. // "operation": {
  42246. // "description": "Name of the Operations resource to return.",
  42247. // "location": "path",
  42248. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  42249. // "required": true,
  42250. // "type": "string"
  42251. // },
  42252. // "project": {
  42253. // "description": "Project ID for this request.",
  42254. // "location": "path",
  42255. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42256. // "required": true,
  42257. // "type": "string"
  42258. // },
  42259. // "region": {
  42260. // "description": "Name of the region for this request.",
  42261. // "location": "path",
  42262. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  42263. // "required": true,
  42264. // "type": "string"
  42265. // }
  42266. // },
  42267. // "path": "{project}/regions/{region}/operations/{operation}",
  42268. // "response": {
  42269. // "$ref": "Operation"
  42270. // },
  42271. // "scopes": [
  42272. // "https://www.googleapis.com/auth/cloud-platform",
  42273. // "https://www.googleapis.com/auth/compute",
  42274. // "https://www.googleapis.com/auth/compute.readonly"
  42275. // ]
  42276. // }
  42277. }
  42278. // method id "compute.regionOperations.list":
  42279. type RegionOperationsListCall struct {
  42280. s *Service
  42281. project string
  42282. region string
  42283. urlParams_ gensupport.URLParams
  42284. ifNoneMatch_ string
  42285. ctx_ context.Context
  42286. header_ http.Header
  42287. }
  42288. // List: Retrieves a list of Operation resources contained within the
  42289. // specified region.
  42290. // For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/list
  42291. func (r *RegionOperationsService) List(project string, region string) *RegionOperationsListCall {
  42292. c := &RegionOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42293. c.project = project
  42294. c.region = region
  42295. return c
  42296. }
  42297. // Filter sets the optional parameter "filter": Sets a filter
  42298. // {expression} for filtering listed resources. Your {expression} must
  42299. // be in the format: field_name comparison_string literal_string.
  42300. //
  42301. // The field_name is the name of the field you want to compare. Only
  42302. // atomic field types are supported (string, number, boolean). The
  42303. // comparison_string must be either eq (equals) or ne (not equals). The
  42304. // literal_string is the string value to filter to. The literal value
  42305. // must be valid for the type of field you are filtering by (string,
  42306. // number, boolean). For string fields, the literal value is interpreted
  42307. // as a regular expression using RE2 syntax. The literal value must
  42308. // match the entire field.
  42309. //
  42310. // For example, to filter for instances that do not have a name of
  42311. // example-instance, you would use name ne example-instance.
  42312. //
  42313. // You can filter on nested fields. For example, you could filter on
  42314. // instances that have set the scheduling.automaticRestart field to
  42315. // true. Use filtering on nested fields to take advantage of labels to
  42316. // organize and search for results based on label values.
  42317. //
  42318. // To filter on multiple expressions, provide each separate expression
  42319. // within parentheses. For example, (scheduling.automaticRestart eq
  42320. // true) (zone eq us-central1-f). Multiple expressions are treated as
  42321. // AND expressions, meaning that resources must match all expressions to
  42322. // pass the filters.
  42323. func (c *RegionOperationsListCall) Filter(filter string) *RegionOperationsListCall {
  42324. c.urlParams_.Set("filter", filter)
  42325. return c
  42326. }
  42327. // MaxResults sets the optional parameter "maxResults": The maximum
  42328. // number of results per page that should be returned. If the number of
  42329. // available results is larger than maxResults, Compute Engine returns a
  42330. // nextPageToken that can be used to get the next page of results in
  42331. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  42332. // (Default: 500)
  42333. func (c *RegionOperationsListCall) MaxResults(maxResults int64) *RegionOperationsListCall {
  42334. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  42335. return c
  42336. }
  42337. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  42338. // a certain order. By default, results are returned in alphanumerical
  42339. // order based on the resource name.
  42340. //
  42341. // You can also sort results in descending order based on the creation
  42342. // timestamp using orderBy="creationTimestamp desc". This sorts results
  42343. // based on the creationTimestamp field in reverse chronological order
  42344. // (newest result first). Use this to sort resources like operations so
  42345. // that the newest operation is returned first.
  42346. //
  42347. // Currently, only sorting by name or creationTimestamp desc is
  42348. // supported.
  42349. func (c *RegionOperationsListCall) OrderBy(orderBy string) *RegionOperationsListCall {
  42350. c.urlParams_.Set("orderBy", orderBy)
  42351. return c
  42352. }
  42353. // PageToken sets the optional parameter "pageToken": Specifies a page
  42354. // token to use. Set pageToken to the nextPageToken returned by a
  42355. // previous list request to get the next page of results.
  42356. func (c *RegionOperationsListCall) PageToken(pageToken string) *RegionOperationsListCall {
  42357. c.urlParams_.Set("pageToken", pageToken)
  42358. return c
  42359. }
  42360. // Fields allows partial responses to be retrieved. See
  42361. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42362. // for more information.
  42363. func (c *RegionOperationsListCall) Fields(s ...googleapi.Field) *RegionOperationsListCall {
  42364. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42365. return c
  42366. }
  42367. // IfNoneMatch sets the optional parameter which makes the operation
  42368. // fail if the object's ETag matches the given value. This is useful for
  42369. // getting updates only after the object has changed since the last
  42370. // request. Use googleapi.IsNotModified to check whether the response
  42371. // error from Do is the result of In-None-Match.
  42372. func (c *RegionOperationsListCall) IfNoneMatch(entityTag string) *RegionOperationsListCall {
  42373. c.ifNoneMatch_ = entityTag
  42374. return c
  42375. }
  42376. // Context sets the context to be used in this call's Do method. Any
  42377. // pending HTTP request will be aborted if the provided context is
  42378. // canceled.
  42379. func (c *RegionOperationsListCall) Context(ctx context.Context) *RegionOperationsListCall {
  42380. c.ctx_ = ctx
  42381. return c
  42382. }
  42383. // Header returns an http.Header that can be modified by the caller to
  42384. // add HTTP headers to the request.
  42385. func (c *RegionOperationsListCall) Header() http.Header {
  42386. if c.header_ == nil {
  42387. c.header_ = make(http.Header)
  42388. }
  42389. return c.header_
  42390. }
  42391. func (c *RegionOperationsListCall) doRequest(alt string) (*http.Response, error) {
  42392. reqHeaders := make(http.Header)
  42393. for k, v := range c.header_ {
  42394. reqHeaders[k] = v
  42395. }
  42396. reqHeaders.Set("User-Agent", c.s.userAgent())
  42397. if c.ifNoneMatch_ != "" {
  42398. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42399. }
  42400. var body io.Reader = nil
  42401. c.urlParams_.Set("alt", alt)
  42402. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations")
  42403. urls += "?" + c.urlParams_.Encode()
  42404. req, _ := http.NewRequest("GET", urls, body)
  42405. req.Header = reqHeaders
  42406. googleapi.Expand(req.URL, map[string]string{
  42407. "project": c.project,
  42408. "region": c.region,
  42409. })
  42410. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42411. }
  42412. // Do executes the "compute.regionOperations.list" call.
  42413. // Exactly one of *OperationList or error will be non-nil. Any non-2xx
  42414. // status code is an error. Response headers are in either
  42415. // *OperationList.ServerResponse.Header or (if a response was returned
  42416. // at all) in error.(*googleapi.Error).Header. Use
  42417. // googleapi.IsNotModified to check whether the returned error was
  42418. // because http.StatusNotModified was returned.
  42419. func (c *RegionOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, error) {
  42420. gensupport.SetOptions(c.urlParams_, opts...)
  42421. res, err := c.doRequest("json")
  42422. if res != nil && res.StatusCode == http.StatusNotModified {
  42423. if res.Body != nil {
  42424. res.Body.Close()
  42425. }
  42426. return nil, &googleapi.Error{
  42427. Code: res.StatusCode,
  42428. Header: res.Header,
  42429. }
  42430. }
  42431. if err != nil {
  42432. return nil, err
  42433. }
  42434. defer googleapi.CloseBody(res)
  42435. if err := googleapi.CheckResponse(res); err != nil {
  42436. return nil, err
  42437. }
  42438. ret := &OperationList{
  42439. ServerResponse: googleapi.ServerResponse{
  42440. Header: res.Header,
  42441. HTTPStatusCode: res.StatusCode,
  42442. },
  42443. }
  42444. target := &ret
  42445. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  42446. return nil, err
  42447. }
  42448. return ret, nil
  42449. // {
  42450. // "description": "Retrieves a list of Operation resources contained within the specified region.",
  42451. // "httpMethod": "GET",
  42452. // "id": "compute.regionOperations.list",
  42453. // "parameterOrder": [
  42454. // "project",
  42455. // "region"
  42456. // ],
  42457. // "parameters": {
  42458. // "filter": {
  42459. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  42460. // "location": "query",
  42461. // "type": "string"
  42462. // },
  42463. // "maxResults": {
  42464. // "default": "500",
  42465. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  42466. // "format": "uint32",
  42467. // "location": "query",
  42468. // "minimum": "0",
  42469. // "type": "integer"
  42470. // },
  42471. // "orderBy": {
  42472. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  42473. // "location": "query",
  42474. // "type": "string"
  42475. // },
  42476. // "pageToken": {
  42477. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  42478. // "location": "query",
  42479. // "type": "string"
  42480. // },
  42481. // "project": {
  42482. // "description": "Project ID for this request.",
  42483. // "location": "path",
  42484. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42485. // "required": true,
  42486. // "type": "string"
  42487. // },
  42488. // "region": {
  42489. // "description": "Name of the region for this request.",
  42490. // "location": "path",
  42491. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  42492. // "required": true,
  42493. // "type": "string"
  42494. // }
  42495. // },
  42496. // "path": "{project}/regions/{region}/operations",
  42497. // "response": {
  42498. // "$ref": "OperationList"
  42499. // },
  42500. // "scopes": [
  42501. // "https://www.googleapis.com/auth/cloud-platform",
  42502. // "https://www.googleapis.com/auth/compute",
  42503. // "https://www.googleapis.com/auth/compute.readonly"
  42504. // ]
  42505. // }
  42506. }
  42507. // Pages invokes f for each page of results.
  42508. // A non-nil error returned from f will halt the iteration.
  42509. // The provided context supersedes any context provided to the Context method.
  42510. func (c *RegionOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
  42511. c.ctx_ = ctx
  42512. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  42513. for {
  42514. x, err := c.Do()
  42515. if err != nil {
  42516. return err
  42517. }
  42518. if err := f(x); err != nil {
  42519. return err
  42520. }
  42521. if x.NextPageToken == "" {
  42522. return nil
  42523. }
  42524. c.PageToken(x.NextPageToken)
  42525. }
  42526. }
  42527. // method id "compute.regions.get":
  42528. type RegionsGetCall struct {
  42529. s *Service
  42530. project string
  42531. region string
  42532. urlParams_ gensupport.URLParams
  42533. ifNoneMatch_ string
  42534. ctx_ context.Context
  42535. header_ http.Header
  42536. }
  42537. // Get: Returns the specified Region resource. Get a list of available
  42538. // regions by making a list() request.
  42539. // For details, see https://cloud.google.com/compute/docs/reference/latest/regions/get
  42540. func (r *RegionsService) Get(project string, region string) *RegionsGetCall {
  42541. c := &RegionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42542. c.project = project
  42543. c.region = region
  42544. return c
  42545. }
  42546. // Fields allows partial responses to be retrieved. See
  42547. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42548. // for more information.
  42549. func (c *RegionsGetCall) Fields(s ...googleapi.Field) *RegionsGetCall {
  42550. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42551. return c
  42552. }
  42553. // IfNoneMatch sets the optional parameter which makes the operation
  42554. // fail if the object's ETag matches the given value. This is useful for
  42555. // getting updates only after the object has changed since the last
  42556. // request. Use googleapi.IsNotModified to check whether the response
  42557. // error from Do is the result of In-None-Match.
  42558. func (c *RegionsGetCall) IfNoneMatch(entityTag string) *RegionsGetCall {
  42559. c.ifNoneMatch_ = entityTag
  42560. return c
  42561. }
  42562. // Context sets the context to be used in this call's Do method. Any
  42563. // pending HTTP request will be aborted if the provided context is
  42564. // canceled.
  42565. func (c *RegionsGetCall) Context(ctx context.Context) *RegionsGetCall {
  42566. c.ctx_ = ctx
  42567. return c
  42568. }
  42569. // Header returns an http.Header that can be modified by the caller to
  42570. // add HTTP headers to the request.
  42571. func (c *RegionsGetCall) Header() http.Header {
  42572. if c.header_ == nil {
  42573. c.header_ = make(http.Header)
  42574. }
  42575. return c.header_
  42576. }
  42577. func (c *RegionsGetCall) doRequest(alt string) (*http.Response, error) {
  42578. reqHeaders := make(http.Header)
  42579. for k, v := range c.header_ {
  42580. reqHeaders[k] = v
  42581. }
  42582. reqHeaders.Set("User-Agent", c.s.userAgent())
  42583. if c.ifNoneMatch_ != "" {
  42584. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42585. }
  42586. var body io.Reader = nil
  42587. c.urlParams_.Set("alt", alt)
  42588. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}")
  42589. urls += "?" + c.urlParams_.Encode()
  42590. req, _ := http.NewRequest("GET", urls, body)
  42591. req.Header = reqHeaders
  42592. googleapi.Expand(req.URL, map[string]string{
  42593. "project": c.project,
  42594. "region": c.region,
  42595. })
  42596. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42597. }
  42598. // Do executes the "compute.regions.get" call.
  42599. // Exactly one of *Region or error will be non-nil. Any non-2xx status
  42600. // code is an error. Response headers are in either
  42601. // *Region.ServerResponse.Header or (if a response was returned at all)
  42602. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  42603. // check whether the returned error was because http.StatusNotModified
  42604. // was returned.
  42605. func (c *RegionsGetCall) Do(opts ...googleapi.CallOption) (*Region, error) {
  42606. gensupport.SetOptions(c.urlParams_, opts...)
  42607. res, err := c.doRequest("json")
  42608. if res != nil && res.StatusCode == http.StatusNotModified {
  42609. if res.Body != nil {
  42610. res.Body.Close()
  42611. }
  42612. return nil, &googleapi.Error{
  42613. Code: res.StatusCode,
  42614. Header: res.Header,
  42615. }
  42616. }
  42617. if err != nil {
  42618. return nil, err
  42619. }
  42620. defer googleapi.CloseBody(res)
  42621. if err := googleapi.CheckResponse(res); err != nil {
  42622. return nil, err
  42623. }
  42624. ret := &Region{
  42625. ServerResponse: googleapi.ServerResponse{
  42626. Header: res.Header,
  42627. HTTPStatusCode: res.StatusCode,
  42628. },
  42629. }
  42630. target := &ret
  42631. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  42632. return nil, err
  42633. }
  42634. return ret, nil
  42635. // {
  42636. // "description": "Returns the specified Region resource. Get a list of available regions by making a list() request.",
  42637. // "httpMethod": "GET",
  42638. // "id": "compute.regions.get",
  42639. // "parameterOrder": [
  42640. // "project",
  42641. // "region"
  42642. // ],
  42643. // "parameters": {
  42644. // "project": {
  42645. // "description": "Project ID for this request.",
  42646. // "location": "path",
  42647. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42648. // "required": true,
  42649. // "type": "string"
  42650. // },
  42651. // "region": {
  42652. // "description": "Name of the region resource to return.",
  42653. // "location": "path",
  42654. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  42655. // "required": true,
  42656. // "type": "string"
  42657. // }
  42658. // },
  42659. // "path": "{project}/regions/{region}",
  42660. // "response": {
  42661. // "$ref": "Region"
  42662. // },
  42663. // "scopes": [
  42664. // "https://www.googleapis.com/auth/cloud-platform",
  42665. // "https://www.googleapis.com/auth/compute",
  42666. // "https://www.googleapis.com/auth/compute.readonly"
  42667. // ]
  42668. // }
  42669. }
  42670. // method id "compute.regions.list":
  42671. type RegionsListCall struct {
  42672. s *Service
  42673. project string
  42674. urlParams_ gensupport.URLParams
  42675. ifNoneMatch_ string
  42676. ctx_ context.Context
  42677. header_ http.Header
  42678. }
  42679. // List: Retrieves the list of region resources available to the
  42680. // specified project.
  42681. // For details, see https://cloud.google.com/compute/docs/reference/latest/regions/list
  42682. func (r *RegionsService) List(project string) *RegionsListCall {
  42683. c := &RegionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42684. c.project = project
  42685. return c
  42686. }
  42687. // Filter sets the optional parameter "filter": Sets a filter
  42688. // {expression} for filtering listed resources. Your {expression} must
  42689. // be in the format: field_name comparison_string literal_string.
  42690. //
  42691. // The field_name is the name of the field you want to compare. Only
  42692. // atomic field types are supported (string, number, boolean). The
  42693. // comparison_string must be either eq (equals) or ne (not equals). The
  42694. // literal_string is the string value to filter to. The literal value
  42695. // must be valid for the type of field you are filtering by (string,
  42696. // number, boolean). For string fields, the literal value is interpreted
  42697. // as a regular expression using RE2 syntax. The literal value must
  42698. // match the entire field.
  42699. //
  42700. // For example, to filter for instances that do not have a name of
  42701. // example-instance, you would use name ne example-instance.
  42702. //
  42703. // You can filter on nested fields. For example, you could filter on
  42704. // instances that have set the scheduling.automaticRestart field to
  42705. // true. Use filtering on nested fields to take advantage of labels to
  42706. // organize and search for results based on label values.
  42707. //
  42708. // To filter on multiple expressions, provide each separate expression
  42709. // within parentheses. For example, (scheduling.automaticRestart eq
  42710. // true) (zone eq us-central1-f). Multiple expressions are treated as
  42711. // AND expressions, meaning that resources must match all expressions to
  42712. // pass the filters.
  42713. func (c *RegionsListCall) Filter(filter string) *RegionsListCall {
  42714. c.urlParams_.Set("filter", filter)
  42715. return c
  42716. }
  42717. // MaxResults sets the optional parameter "maxResults": The maximum
  42718. // number of results per page that should be returned. If the number of
  42719. // available results is larger than maxResults, Compute Engine returns a
  42720. // nextPageToken that can be used to get the next page of results in
  42721. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  42722. // (Default: 500)
  42723. func (c *RegionsListCall) MaxResults(maxResults int64) *RegionsListCall {
  42724. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  42725. return c
  42726. }
  42727. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  42728. // a certain order. By default, results are returned in alphanumerical
  42729. // order based on the resource name.
  42730. //
  42731. // You can also sort results in descending order based on the creation
  42732. // timestamp using orderBy="creationTimestamp desc". This sorts results
  42733. // based on the creationTimestamp field in reverse chronological order
  42734. // (newest result first). Use this to sort resources like operations so
  42735. // that the newest operation is returned first.
  42736. //
  42737. // Currently, only sorting by name or creationTimestamp desc is
  42738. // supported.
  42739. func (c *RegionsListCall) OrderBy(orderBy string) *RegionsListCall {
  42740. c.urlParams_.Set("orderBy", orderBy)
  42741. return c
  42742. }
  42743. // PageToken sets the optional parameter "pageToken": Specifies a page
  42744. // token to use. Set pageToken to the nextPageToken returned by a
  42745. // previous list request to get the next page of results.
  42746. func (c *RegionsListCall) PageToken(pageToken string) *RegionsListCall {
  42747. c.urlParams_.Set("pageToken", pageToken)
  42748. return c
  42749. }
  42750. // Fields allows partial responses to be retrieved. See
  42751. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42752. // for more information.
  42753. func (c *RegionsListCall) Fields(s ...googleapi.Field) *RegionsListCall {
  42754. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42755. return c
  42756. }
  42757. // IfNoneMatch sets the optional parameter which makes the operation
  42758. // fail if the object's ETag matches the given value. This is useful for
  42759. // getting updates only after the object has changed since the last
  42760. // request. Use googleapi.IsNotModified to check whether the response
  42761. // error from Do is the result of In-None-Match.
  42762. func (c *RegionsListCall) IfNoneMatch(entityTag string) *RegionsListCall {
  42763. c.ifNoneMatch_ = entityTag
  42764. return c
  42765. }
  42766. // Context sets the context to be used in this call's Do method. Any
  42767. // pending HTTP request will be aborted if the provided context is
  42768. // canceled.
  42769. func (c *RegionsListCall) Context(ctx context.Context) *RegionsListCall {
  42770. c.ctx_ = ctx
  42771. return c
  42772. }
  42773. // Header returns an http.Header that can be modified by the caller to
  42774. // add HTTP headers to the request.
  42775. func (c *RegionsListCall) Header() http.Header {
  42776. if c.header_ == nil {
  42777. c.header_ = make(http.Header)
  42778. }
  42779. return c.header_
  42780. }
  42781. func (c *RegionsListCall) doRequest(alt string) (*http.Response, error) {
  42782. reqHeaders := make(http.Header)
  42783. for k, v := range c.header_ {
  42784. reqHeaders[k] = v
  42785. }
  42786. reqHeaders.Set("User-Agent", c.s.userAgent())
  42787. if c.ifNoneMatch_ != "" {
  42788. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42789. }
  42790. var body io.Reader = nil
  42791. c.urlParams_.Set("alt", alt)
  42792. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions")
  42793. urls += "?" + c.urlParams_.Encode()
  42794. req, _ := http.NewRequest("GET", urls, body)
  42795. req.Header = reqHeaders
  42796. googleapi.Expand(req.URL, map[string]string{
  42797. "project": c.project,
  42798. })
  42799. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42800. }
  42801. // Do executes the "compute.regions.list" call.
  42802. // Exactly one of *RegionList or error will be non-nil. Any non-2xx
  42803. // status code is an error. Response headers are in either
  42804. // *RegionList.ServerResponse.Header or (if a response was returned at
  42805. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42806. // to check whether the returned error was because
  42807. // http.StatusNotModified was returned.
  42808. func (c *RegionsListCall) Do(opts ...googleapi.CallOption) (*RegionList, error) {
  42809. gensupport.SetOptions(c.urlParams_, opts...)
  42810. res, err := c.doRequest("json")
  42811. if res != nil && res.StatusCode == http.StatusNotModified {
  42812. if res.Body != nil {
  42813. res.Body.Close()
  42814. }
  42815. return nil, &googleapi.Error{
  42816. Code: res.StatusCode,
  42817. Header: res.Header,
  42818. }
  42819. }
  42820. if err != nil {
  42821. return nil, err
  42822. }
  42823. defer googleapi.CloseBody(res)
  42824. if err := googleapi.CheckResponse(res); err != nil {
  42825. return nil, err
  42826. }
  42827. ret := &RegionList{
  42828. ServerResponse: googleapi.ServerResponse{
  42829. Header: res.Header,
  42830. HTTPStatusCode: res.StatusCode,
  42831. },
  42832. }
  42833. target := &ret
  42834. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  42835. return nil, err
  42836. }
  42837. return ret, nil
  42838. // {
  42839. // "description": "Retrieves the list of region resources available to the specified project.",
  42840. // "httpMethod": "GET",
  42841. // "id": "compute.regions.list",
  42842. // "parameterOrder": [
  42843. // "project"
  42844. // ],
  42845. // "parameters": {
  42846. // "filter": {
  42847. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  42848. // "location": "query",
  42849. // "type": "string"
  42850. // },
  42851. // "maxResults": {
  42852. // "default": "500",
  42853. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  42854. // "format": "uint32",
  42855. // "location": "query",
  42856. // "minimum": "0",
  42857. // "type": "integer"
  42858. // },
  42859. // "orderBy": {
  42860. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  42861. // "location": "query",
  42862. // "type": "string"
  42863. // },
  42864. // "pageToken": {
  42865. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  42866. // "location": "query",
  42867. // "type": "string"
  42868. // },
  42869. // "project": {
  42870. // "description": "Project ID for this request.",
  42871. // "location": "path",
  42872. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42873. // "required": true,
  42874. // "type": "string"
  42875. // }
  42876. // },
  42877. // "path": "{project}/regions",
  42878. // "response": {
  42879. // "$ref": "RegionList"
  42880. // },
  42881. // "scopes": [
  42882. // "https://www.googleapis.com/auth/cloud-platform",
  42883. // "https://www.googleapis.com/auth/compute",
  42884. // "https://www.googleapis.com/auth/compute.readonly"
  42885. // ]
  42886. // }
  42887. }
  42888. // Pages invokes f for each page of results.
  42889. // A non-nil error returned from f will halt the iteration.
  42890. // The provided context supersedes any context provided to the Context method.
  42891. func (c *RegionsListCall) Pages(ctx context.Context, f func(*RegionList) error) error {
  42892. c.ctx_ = ctx
  42893. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  42894. for {
  42895. x, err := c.Do()
  42896. if err != nil {
  42897. return err
  42898. }
  42899. if err := f(x); err != nil {
  42900. return err
  42901. }
  42902. if x.NextPageToken == "" {
  42903. return nil
  42904. }
  42905. c.PageToken(x.NextPageToken)
  42906. }
  42907. }
  42908. // method id "compute.routers.aggregatedList":
  42909. type RoutersAggregatedListCall struct {
  42910. s *Service
  42911. project string
  42912. urlParams_ gensupport.URLParams
  42913. ifNoneMatch_ string
  42914. ctx_ context.Context
  42915. header_ http.Header
  42916. }
  42917. // AggregatedList: Retrieves an aggregated list of routers.
  42918. func (r *RoutersService) AggregatedList(project string) *RoutersAggregatedListCall {
  42919. c := &RoutersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42920. c.project = project
  42921. return c
  42922. }
  42923. // Filter sets the optional parameter "filter": Sets a filter
  42924. // {expression} for filtering listed resources. Your {expression} must
  42925. // be in the format: field_name comparison_string literal_string.
  42926. //
  42927. // The field_name is the name of the field you want to compare. Only
  42928. // atomic field types are supported (string, number, boolean). The
  42929. // comparison_string must be either eq (equals) or ne (not equals). The
  42930. // literal_string is the string value to filter to. The literal value
  42931. // must be valid for the type of field you are filtering by (string,
  42932. // number, boolean). For string fields, the literal value is interpreted
  42933. // as a regular expression using RE2 syntax. The literal value must
  42934. // match the entire field.
  42935. //
  42936. // For example, to filter for instances that do not have a name of
  42937. // example-instance, you would use name ne example-instance.
  42938. //
  42939. // You can filter on nested fields. For example, you could filter on
  42940. // instances that have set the scheduling.automaticRestart field to
  42941. // true. Use filtering on nested fields to take advantage of labels to
  42942. // organize and search for results based on label values.
  42943. //
  42944. // To filter on multiple expressions, provide each separate expression
  42945. // within parentheses. For example, (scheduling.automaticRestart eq
  42946. // true) (zone eq us-central1-f). Multiple expressions are treated as
  42947. // AND expressions, meaning that resources must match all expressions to
  42948. // pass the filters.
  42949. func (c *RoutersAggregatedListCall) Filter(filter string) *RoutersAggregatedListCall {
  42950. c.urlParams_.Set("filter", filter)
  42951. return c
  42952. }
  42953. // MaxResults sets the optional parameter "maxResults": The maximum
  42954. // number of results per page that should be returned. If the number of
  42955. // available results is larger than maxResults, Compute Engine returns a
  42956. // nextPageToken that can be used to get the next page of results in
  42957. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  42958. // (Default: 500)
  42959. func (c *RoutersAggregatedListCall) MaxResults(maxResults int64) *RoutersAggregatedListCall {
  42960. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  42961. return c
  42962. }
  42963. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  42964. // a certain order. By default, results are returned in alphanumerical
  42965. // order based on the resource name.
  42966. //
  42967. // You can also sort results in descending order based on the creation
  42968. // timestamp using orderBy="creationTimestamp desc". This sorts results
  42969. // based on the creationTimestamp field in reverse chronological order
  42970. // (newest result first). Use this to sort resources like operations so
  42971. // that the newest operation is returned first.
  42972. //
  42973. // Currently, only sorting by name or creationTimestamp desc is
  42974. // supported.
  42975. func (c *RoutersAggregatedListCall) OrderBy(orderBy string) *RoutersAggregatedListCall {
  42976. c.urlParams_.Set("orderBy", orderBy)
  42977. return c
  42978. }
  42979. // PageToken sets the optional parameter "pageToken": Specifies a page
  42980. // token to use. Set pageToken to the nextPageToken returned by a
  42981. // previous list request to get the next page of results.
  42982. func (c *RoutersAggregatedListCall) PageToken(pageToken string) *RoutersAggregatedListCall {
  42983. c.urlParams_.Set("pageToken", pageToken)
  42984. return c
  42985. }
  42986. // Fields allows partial responses to be retrieved. See
  42987. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42988. // for more information.
  42989. func (c *RoutersAggregatedListCall) Fields(s ...googleapi.Field) *RoutersAggregatedListCall {
  42990. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42991. return c
  42992. }
  42993. // IfNoneMatch sets the optional parameter which makes the operation
  42994. // fail if the object's ETag matches the given value. This is useful for
  42995. // getting updates only after the object has changed since the last
  42996. // request. Use googleapi.IsNotModified to check whether the response
  42997. // error from Do is the result of In-None-Match.
  42998. func (c *RoutersAggregatedListCall) IfNoneMatch(entityTag string) *RoutersAggregatedListCall {
  42999. c.ifNoneMatch_ = entityTag
  43000. return c
  43001. }
  43002. // Context sets the context to be used in this call's Do method. Any
  43003. // pending HTTP request will be aborted if the provided context is
  43004. // canceled.
  43005. func (c *RoutersAggregatedListCall) Context(ctx context.Context) *RoutersAggregatedListCall {
  43006. c.ctx_ = ctx
  43007. return c
  43008. }
  43009. // Header returns an http.Header that can be modified by the caller to
  43010. // add HTTP headers to the request.
  43011. func (c *RoutersAggregatedListCall) Header() http.Header {
  43012. if c.header_ == nil {
  43013. c.header_ = make(http.Header)
  43014. }
  43015. return c.header_
  43016. }
  43017. func (c *RoutersAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  43018. reqHeaders := make(http.Header)
  43019. for k, v := range c.header_ {
  43020. reqHeaders[k] = v
  43021. }
  43022. reqHeaders.Set("User-Agent", c.s.userAgent())
  43023. if c.ifNoneMatch_ != "" {
  43024. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43025. }
  43026. var body io.Reader = nil
  43027. c.urlParams_.Set("alt", alt)
  43028. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/routers")
  43029. urls += "?" + c.urlParams_.Encode()
  43030. req, _ := http.NewRequest("GET", urls, body)
  43031. req.Header = reqHeaders
  43032. googleapi.Expand(req.URL, map[string]string{
  43033. "project": c.project,
  43034. })
  43035. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43036. }
  43037. // Do executes the "compute.routers.aggregatedList" call.
  43038. // Exactly one of *RouterAggregatedList or error will be non-nil. Any
  43039. // non-2xx status code is an error. Response headers are in either
  43040. // *RouterAggregatedList.ServerResponse.Header or (if a response was
  43041. // returned at all) in error.(*googleapi.Error).Header. Use
  43042. // googleapi.IsNotModified to check whether the returned error was
  43043. // because http.StatusNotModified was returned.
  43044. func (c *RoutersAggregatedListCall) Do(opts ...googleapi.CallOption) (*RouterAggregatedList, error) {
  43045. gensupport.SetOptions(c.urlParams_, opts...)
  43046. res, err := c.doRequest("json")
  43047. if res != nil && res.StatusCode == http.StatusNotModified {
  43048. if res.Body != nil {
  43049. res.Body.Close()
  43050. }
  43051. return nil, &googleapi.Error{
  43052. Code: res.StatusCode,
  43053. Header: res.Header,
  43054. }
  43055. }
  43056. if err != nil {
  43057. return nil, err
  43058. }
  43059. defer googleapi.CloseBody(res)
  43060. if err := googleapi.CheckResponse(res); err != nil {
  43061. return nil, err
  43062. }
  43063. ret := &RouterAggregatedList{
  43064. ServerResponse: googleapi.ServerResponse{
  43065. Header: res.Header,
  43066. HTTPStatusCode: res.StatusCode,
  43067. },
  43068. }
  43069. target := &ret
  43070. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  43071. return nil, err
  43072. }
  43073. return ret, nil
  43074. // {
  43075. // "description": "Retrieves an aggregated list of routers.",
  43076. // "httpMethod": "GET",
  43077. // "id": "compute.routers.aggregatedList",
  43078. // "parameterOrder": [
  43079. // "project"
  43080. // ],
  43081. // "parameters": {
  43082. // "filter": {
  43083. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  43084. // "location": "query",
  43085. // "type": "string"
  43086. // },
  43087. // "maxResults": {
  43088. // "default": "500",
  43089. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  43090. // "format": "uint32",
  43091. // "location": "query",
  43092. // "minimum": "0",
  43093. // "type": "integer"
  43094. // },
  43095. // "orderBy": {
  43096. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  43097. // "location": "query",
  43098. // "type": "string"
  43099. // },
  43100. // "pageToken": {
  43101. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  43102. // "location": "query",
  43103. // "type": "string"
  43104. // },
  43105. // "project": {
  43106. // "description": "Project ID for this request.",
  43107. // "location": "path",
  43108. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43109. // "required": true,
  43110. // "type": "string"
  43111. // }
  43112. // },
  43113. // "path": "{project}/aggregated/routers",
  43114. // "response": {
  43115. // "$ref": "RouterAggregatedList"
  43116. // },
  43117. // "scopes": [
  43118. // "https://www.googleapis.com/auth/cloud-platform",
  43119. // "https://www.googleapis.com/auth/compute",
  43120. // "https://www.googleapis.com/auth/compute.readonly"
  43121. // ]
  43122. // }
  43123. }
  43124. // Pages invokes f for each page of results.
  43125. // A non-nil error returned from f will halt the iteration.
  43126. // The provided context supersedes any context provided to the Context method.
  43127. func (c *RoutersAggregatedListCall) Pages(ctx context.Context, f func(*RouterAggregatedList) error) error {
  43128. c.ctx_ = ctx
  43129. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  43130. for {
  43131. x, err := c.Do()
  43132. if err != nil {
  43133. return err
  43134. }
  43135. if err := f(x); err != nil {
  43136. return err
  43137. }
  43138. if x.NextPageToken == "" {
  43139. return nil
  43140. }
  43141. c.PageToken(x.NextPageToken)
  43142. }
  43143. }
  43144. // method id "compute.routers.delete":
  43145. type RoutersDeleteCall struct {
  43146. s *Service
  43147. project string
  43148. region string
  43149. router string
  43150. urlParams_ gensupport.URLParams
  43151. ctx_ context.Context
  43152. header_ http.Header
  43153. }
  43154. // Delete: Deletes the specified Router resource.
  43155. func (r *RoutersService) Delete(project string, region string, router string) *RoutersDeleteCall {
  43156. c := &RoutersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43157. c.project = project
  43158. c.region = region
  43159. c.router = router
  43160. return c
  43161. }
  43162. // Fields allows partial responses to be retrieved. See
  43163. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43164. // for more information.
  43165. func (c *RoutersDeleteCall) Fields(s ...googleapi.Field) *RoutersDeleteCall {
  43166. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43167. return c
  43168. }
  43169. // Context sets the context to be used in this call's Do method. Any
  43170. // pending HTTP request will be aborted if the provided context is
  43171. // canceled.
  43172. func (c *RoutersDeleteCall) Context(ctx context.Context) *RoutersDeleteCall {
  43173. c.ctx_ = ctx
  43174. return c
  43175. }
  43176. // Header returns an http.Header that can be modified by the caller to
  43177. // add HTTP headers to the request.
  43178. func (c *RoutersDeleteCall) Header() http.Header {
  43179. if c.header_ == nil {
  43180. c.header_ = make(http.Header)
  43181. }
  43182. return c.header_
  43183. }
  43184. func (c *RoutersDeleteCall) doRequest(alt string) (*http.Response, error) {
  43185. reqHeaders := make(http.Header)
  43186. for k, v := range c.header_ {
  43187. reqHeaders[k] = v
  43188. }
  43189. reqHeaders.Set("User-Agent", c.s.userAgent())
  43190. var body io.Reader = nil
  43191. c.urlParams_.Set("alt", alt)
  43192. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}")
  43193. urls += "?" + c.urlParams_.Encode()
  43194. req, _ := http.NewRequest("DELETE", urls, body)
  43195. req.Header = reqHeaders
  43196. googleapi.Expand(req.URL, map[string]string{
  43197. "project": c.project,
  43198. "region": c.region,
  43199. "router": c.router,
  43200. })
  43201. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43202. }
  43203. // Do executes the "compute.routers.delete" call.
  43204. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  43205. // status code is an error. Response headers are in either
  43206. // *Operation.ServerResponse.Header or (if a response was returned at
  43207. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43208. // to check whether the returned error was because
  43209. // http.StatusNotModified was returned.
  43210. func (c *RoutersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  43211. gensupport.SetOptions(c.urlParams_, opts...)
  43212. res, err := c.doRequest("json")
  43213. if res != nil && res.StatusCode == http.StatusNotModified {
  43214. if res.Body != nil {
  43215. res.Body.Close()
  43216. }
  43217. return nil, &googleapi.Error{
  43218. Code: res.StatusCode,
  43219. Header: res.Header,
  43220. }
  43221. }
  43222. if err != nil {
  43223. return nil, err
  43224. }
  43225. defer googleapi.CloseBody(res)
  43226. if err := googleapi.CheckResponse(res); err != nil {
  43227. return nil, err
  43228. }
  43229. ret := &Operation{
  43230. ServerResponse: googleapi.ServerResponse{
  43231. Header: res.Header,
  43232. HTTPStatusCode: res.StatusCode,
  43233. },
  43234. }
  43235. target := &ret
  43236. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  43237. return nil, err
  43238. }
  43239. return ret, nil
  43240. // {
  43241. // "description": "Deletes the specified Router resource.",
  43242. // "httpMethod": "DELETE",
  43243. // "id": "compute.routers.delete",
  43244. // "parameterOrder": [
  43245. // "project",
  43246. // "region",
  43247. // "router"
  43248. // ],
  43249. // "parameters": {
  43250. // "project": {
  43251. // "description": "Project ID for this request.",
  43252. // "location": "path",
  43253. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43254. // "required": true,
  43255. // "type": "string"
  43256. // },
  43257. // "region": {
  43258. // "description": "Name of the region for this request.",
  43259. // "location": "path",
  43260. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  43261. // "required": true,
  43262. // "type": "string"
  43263. // },
  43264. // "router": {
  43265. // "description": "Name of the Router resource to delete.",
  43266. // "location": "path",
  43267. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  43268. // "required": true,
  43269. // "type": "string"
  43270. // }
  43271. // },
  43272. // "path": "{project}/regions/{region}/routers/{router}",
  43273. // "response": {
  43274. // "$ref": "Operation"
  43275. // },
  43276. // "scopes": [
  43277. // "https://www.googleapis.com/auth/cloud-platform",
  43278. // "https://www.googleapis.com/auth/compute"
  43279. // ]
  43280. // }
  43281. }
  43282. // method id "compute.routers.get":
  43283. type RoutersGetCall struct {
  43284. s *Service
  43285. project string
  43286. region string
  43287. router string
  43288. urlParams_ gensupport.URLParams
  43289. ifNoneMatch_ string
  43290. ctx_ context.Context
  43291. header_ http.Header
  43292. }
  43293. // Get: Returns the specified Router resource. Get a list of available
  43294. // routers by making a list() request.
  43295. func (r *RoutersService) Get(project string, region string, router string) *RoutersGetCall {
  43296. c := &RoutersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43297. c.project = project
  43298. c.region = region
  43299. c.router = router
  43300. return c
  43301. }
  43302. // Fields allows partial responses to be retrieved. See
  43303. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43304. // for more information.
  43305. func (c *RoutersGetCall) Fields(s ...googleapi.Field) *RoutersGetCall {
  43306. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43307. return c
  43308. }
  43309. // IfNoneMatch sets the optional parameter which makes the operation
  43310. // fail if the object's ETag matches the given value. This is useful for
  43311. // getting updates only after the object has changed since the last
  43312. // request. Use googleapi.IsNotModified to check whether the response
  43313. // error from Do is the result of In-None-Match.
  43314. func (c *RoutersGetCall) IfNoneMatch(entityTag string) *RoutersGetCall {
  43315. c.ifNoneMatch_ = entityTag
  43316. return c
  43317. }
  43318. // Context sets the context to be used in this call's Do method. Any
  43319. // pending HTTP request will be aborted if the provided context is
  43320. // canceled.
  43321. func (c *RoutersGetCall) Context(ctx context.Context) *RoutersGetCall {
  43322. c.ctx_ = ctx
  43323. return c
  43324. }
  43325. // Header returns an http.Header that can be modified by the caller to
  43326. // add HTTP headers to the request.
  43327. func (c *RoutersGetCall) Header() http.Header {
  43328. if c.header_ == nil {
  43329. c.header_ = make(http.Header)
  43330. }
  43331. return c.header_
  43332. }
  43333. func (c *RoutersGetCall) doRequest(alt string) (*http.Response, error) {
  43334. reqHeaders := make(http.Header)
  43335. for k, v := range c.header_ {
  43336. reqHeaders[k] = v
  43337. }
  43338. reqHeaders.Set("User-Agent", c.s.userAgent())
  43339. if c.ifNoneMatch_ != "" {
  43340. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43341. }
  43342. var body io.Reader = nil
  43343. c.urlParams_.Set("alt", alt)
  43344. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}")
  43345. urls += "?" + c.urlParams_.Encode()
  43346. req, _ := http.NewRequest("GET", urls, body)
  43347. req.Header = reqHeaders
  43348. googleapi.Expand(req.URL, map[string]string{
  43349. "project": c.project,
  43350. "region": c.region,
  43351. "router": c.router,
  43352. })
  43353. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43354. }
  43355. // Do executes the "compute.routers.get" call.
  43356. // Exactly one of *Router or error will be non-nil. Any non-2xx status
  43357. // code is an error. Response headers are in either
  43358. // *Router.ServerResponse.Header or (if a response was returned at all)
  43359. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  43360. // check whether the returned error was because http.StatusNotModified
  43361. // was returned.
  43362. func (c *RoutersGetCall) Do(opts ...googleapi.CallOption) (*Router, error) {
  43363. gensupport.SetOptions(c.urlParams_, opts...)
  43364. res, err := c.doRequest("json")
  43365. if res != nil && res.StatusCode == http.StatusNotModified {
  43366. if res.Body != nil {
  43367. res.Body.Close()
  43368. }
  43369. return nil, &googleapi.Error{
  43370. Code: res.StatusCode,
  43371. Header: res.Header,
  43372. }
  43373. }
  43374. if err != nil {
  43375. return nil, err
  43376. }
  43377. defer googleapi.CloseBody(res)
  43378. if err := googleapi.CheckResponse(res); err != nil {
  43379. return nil, err
  43380. }
  43381. ret := &Router{
  43382. ServerResponse: googleapi.ServerResponse{
  43383. Header: res.Header,
  43384. HTTPStatusCode: res.StatusCode,
  43385. },
  43386. }
  43387. target := &ret
  43388. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  43389. return nil, err
  43390. }
  43391. return ret, nil
  43392. // {
  43393. // "description": "Returns the specified Router resource. Get a list of available routers by making a list() request.",
  43394. // "httpMethod": "GET",
  43395. // "id": "compute.routers.get",
  43396. // "parameterOrder": [
  43397. // "project",
  43398. // "region",
  43399. // "router"
  43400. // ],
  43401. // "parameters": {
  43402. // "project": {
  43403. // "description": "Project ID for this request.",
  43404. // "location": "path",
  43405. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43406. // "required": true,
  43407. // "type": "string"
  43408. // },
  43409. // "region": {
  43410. // "description": "Name of the region for this request.",
  43411. // "location": "path",
  43412. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  43413. // "required": true,
  43414. // "type": "string"
  43415. // },
  43416. // "router": {
  43417. // "description": "Name of the Router resource to return.",
  43418. // "location": "path",
  43419. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  43420. // "required": true,
  43421. // "type": "string"
  43422. // }
  43423. // },
  43424. // "path": "{project}/regions/{region}/routers/{router}",
  43425. // "response": {
  43426. // "$ref": "Router"
  43427. // },
  43428. // "scopes": [
  43429. // "https://www.googleapis.com/auth/cloud-platform",
  43430. // "https://www.googleapis.com/auth/compute",
  43431. // "https://www.googleapis.com/auth/compute.readonly"
  43432. // ]
  43433. // }
  43434. }
  43435. // method id "compute.routers.getRouterStatus":
  43436. type RoutersGetRouterStatusCall struct {
  43437. s *Service
  43438. project string
  43439. region string
  43440. router string
  43441. urlParams_ gensupport.URLParams
  43442. ifNoneMatch_ string
  43443. ctx_ context.Context
  43444. header_ http.Header
  43445. }
  43446. // GetRouterStatus: Retrieves runtime information of the specified
  43447. // router.
  43448. func (r *RoutersService) GetRouterStatus(project string, region string, router string) *RoutersGetRouterStatusCall {
  43449. c := &RoutersGetRouterStatusCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43450. c.project = project
  43451. c.region = region
  43452. c.router = router
  43453. return c
  43454. }
  43455. // Fields allows partial responses to be retrieved. See
  43456. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43457. // for more information.
  43458. func (c *RoutersGetRouterStatusCall) Fields(s ...googleapi.Field) *RoutersGetRouterStatusCall {
  43459. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43460. return c
  43461. }
  43462. // IfNoneMatch sets the optional parameter which makes the operation
  43463. // fail if the object's ETag matches the given value. This is useful for
  43464. // getting updates only after the object has changed since the last
  43465. // request. Use googleapi.IsNotModified to check whether the response
  43466. // error from Do is the result of In-None-Match.
  43467. func (c *RoutersGetRouterStatusCall) IfNoneMatch(entityTag string) *RoutersGetRouterStatusCall {
  43468. c.ifNoneMatch_ = entityTag
  43469. return c
  43470. }
  43471. // Context sets the context to be used in this call's Do method. Any
  43472. // pending HTTP request will be aborted if the provided context is
  43473. // canceled.
  43474. func (c *RoutersGetRouterStatusCall) Context(ctx context.Context) *RoutersGetRouterStatusCall {
  43475. c.ctx_ = ctx
  43476. return c
  43477. }
  43478. // Header returns an http.Header that can be modified by the caller to
  43479. // add HTTP headers to the request.
  43480. func (c *RoutersGetRouterStatusCall) Header() http.Header {
  43481. if c.header_ == nil {
  43482. c.header_ = make(http.Header)
  43483. }
  43484. return c.header_
  43485. }
  43486. func (c *RoutersGetRouterStatusCall) doRequest(alt string) (*http.Response, error) {
  43487. reqHeaders := make(http.Header)
  43488. for k, v := range c.header_ {
  43489. reqHeaders[k] = v
  43490. }
  43491. reqHeaders.Set("User-Agent", c.s.userAgent())
  43492. if c.ifNoneMatch_ != "" {
  43493. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43494. }
  43495. var body io.Reader = nil
  43496. c.urlParams_.Set("alt", alt)
  43497. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}/getRouterStatus")
  43498. urls += "?" + c.urlParams_.Encode()
  43499. req, _ := http.NewRequest("GET", urls, body)
  43500. req.Header = reqHeaders
  43501. googleapi.Expand(req.URL, map[string]string{
  43502. "project": c.project,
  43503. "region": c.region,
  43504. "router": c.router,
  43505. })
  43506. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43507. }
  43508. // Do executes the "compute.routers.getRouterStatus" call.
  43509. // Exactly one of *RouterStatusResponse or error will be non-nil. Any
  43510. // non-2xx status code is an error. Response headers are in either
  43511. // *RouterStatusResponse.ServerResponse.Header or (if a response was
  43512. // returned at all) in error.(*googleapi.Error).Header. Use
  43513. // googleapi.IsNotModified to check whether the returned error was
  43514. // because http.StatusNotModified was returned.
  43515. func (c *RoutersGetRouterStatusCall) Do(opts ...googleapi.CallOption) (*RouterStatusResponse, error) {
  43516. gensupport.SetOptions(c.urlParams_, opts...)
  43517. res, err := c.doRequest("json")
  43518. if res != nil && res.StatusCode == http.StatusNotModified {
  43519. if res.Body != nil {
  43520. res.Body.Close()
  43521. }
  43522. return nil, &googleapi.Error{
  43523. Code: res.StatusCode,
  43524. Header: res.Header,
  43525. }
  43526. }
  43527. if err != nil {
  43528. return nil, err
  43529. }
  43530. defer googleapi.CloseBody(res)
  43531. if err := googleapi.CheckResponse(res); err != nil {
  43532. return nil, err
  43533. }
  43534. ret := &RouterStatusResponse{
  43535. ServerResponse: googleapi.ServerResponse{
  43536. Header: res.Header,
  43537. HTTPStatusCode: res.StatusCode,
  43538. },
  43539. }
  43540. target := &ret
  43541. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  43542. return nil, err
  43543. }
  43544. return ret, nil
  43545. // {
  43546. // "description": "Retrieves runtime information of the specified router.",
  43547. // "httpMethod": "GET",
  43548. // "id": "compute.routers.getRouterStatus",
  43549. // "parameterOrder": [
  43550. // "project",
  43551. // "region",
  43552. // "router"
  43553. // ],
  43554. // "parameters": {
  43555. // "project": {
  43556. // "description": "Project ID for this request.",
  43557. // "location": "path",
  43558. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43559. // "required": true,
  43560. // "type": "string"
  43561. // },
  43562. // "region": {
  43563. // "description": "Name of the region for this request.",
  43564. // "location": "path",
  43565. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  43566. // "required": true,
  43567. // "type": "string"
  43568. // },
  43569. // "router": {
  43570. // "description": "Name of the Router resource to query.",
  43571. // "location": "path",
  43572. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  43573. // "required": true,
  43574. // "type": "string"
  43575. // }
  43576. // },
  43577. // "path": "{project}/regions/{region}/routers/{router}/getRouterStatus",
  43578. // "response": {
  43579. // "$ref": "RouterStatusResponse"
  43580. // },
  43581. // "scopes": [
  43582. // "https://www.googleapis.com/auth/cloud-platform",
  43583. // "https://www.googleapis.com/auth/compute",
  43584. // "https://www.googleapis.com/auth/compute.readonly"
  43585. // ]
  43586. // }
  43587. }
  43588. // method id "compute.routers.insert":
  43589. type RoutersInsertCall struct {
  43590. s *Service
  43591. project string
  43592. region string
  43593. router *Router
  43594. urlParams_ gensupport.URLParams
  43595. ctx_ context.Context
  43596. header_ http.Header
  43597. }
  43598. // Insert: Creates a Router resource in the specified project and region
  43599. // using the data included in the request.
  43600. func (r *RoutersService) Insert(project string, region string, router *Router) *RoutersInsertCall {
  43601. c := &RoutersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43602. c.project = project
  43603. c.region = region
  43604. c.router = router
  43605. return c
  43606. }
  43607. // Fields allows partial responses to be retrieved. See
  43608. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43609. // for more information.
  43610. func (c *RoutersInsertCall) Fields(s ...googleapi.Field) *RoutersInsertCall {
  43611. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43612. return c
  43613. }
  43614. // Context sets the context to be used in this call's Do method. Any
  43615. // pending HTTP request will be aborted if the provided context is
  43616. // canceled.
  43617. func (c *RoutersInsertCall) Context(ctx context.Context) *RoutersInsertCall {
  43618. c.ctx_ = ctx
  43619. return c
  43620. }
  43621. // Header returns an http.Header that can be modified by the caller to
  43622. // add HTTP headers to the request.
  43623. func (c *RoutersInsertCall) Header() http.Header {
  43624. if c.header_ == nil {
  43625. c.header_ = make(http.Header)
  43626. }
  43627. return c.header_
  43628. }
  43629. func (c *RoutersInsertCall) doRequest(alt string) (*http.Response, error) {
  43630. reqHeaders := make(http.Header)
  43631. for k, v := range c.header_ {
  43632. reqHeaders[k] = v
  43633. }
  43634. reqHeaders.Set("User-Agent", c.s.userAgent())
  43635. var body io.Reader = nil
  43636. body, err := googleapi.WithoutDataWrapper.JSONReader(c.router)
  43637. if err != nil {
  43638. return nil, err
  43639. }
  43640. reqHeaders.Set("Content-Type", "application/json")
  43641. c.urlParams_.Set("alt", alt)
  43642. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers")
  43643. urls += "?" + c.urlParams_.Encode()
  43644. req, _ := http.NewRequest("POST", urls, body)
  43645. req.Header = reqHeaders
  43646. googleapi.Expand(req.URL, map[string]string{
  43647. "project": c.project,
  43648. "region": c.region,
  43649. })
  43650. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43651. }
  43652. // Do executes the "compute.routers.insert" call.
  43653. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  43654. // status code is an error. Response headers are in either
  43655. // *Operation.ServerResponse.Header or (if a response was returned at
  43656. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43657. // to check whether the returned error was because
  43658. // http.StatusNotModified was returned.
  43659. func (c *RoutersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  43660. gensupport.SetOptions(c.urlParams_, opts...)
  43661. res, err := c.doRequest("json")
  43662. if res != nil && res.StatusCode == http.StatusNotModified {
  43663. if res.Body != nil {
  43664. res.Body.Close()
  43665. }
  43666. return nil, &googleapi.Error{
  43667. Code: res.StatusCode,
  43668. Header: res.Header,
  43669. }
  43670. }
  43671. if err != nil {
  43672. return nil, err
  43673. }
  43674. defer googleapi.CloseBody(res)
  43675. if err := googleapi.CheckResponse(res); err != nil {
  43676. return nil, err
  43677. }
  43678. ret := &Operation{
  43679. ServerResponse: googleapi.ServerResponse{
  43680. Header: res.Header,
  43681. HTTPStatusCode: res.StatusCode,
  43682. },
  43683. }
  43684. target := &ret
  43685. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  43686. return nil, err
  43687. }
  43688. return ret, nil
  43689. // {
  43690. // "description": "Creates a Router resource in the specified project and region using the data included in the request.",
  43691. // "httpMethod": "POST",
  43692. // "id": "compute.routers.insert",
  43693. // "parameterOrder": [
  43694. // "project",
  43695. // "region"
  43696. // ],
  43697. // "parameters": {
  43698. // "project": {
  43699. // "description": "Project ID for this request.",
  43700. // "location": "path",
  43701. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43702. // "required": true,
  43703. // "type": "string"
  43704. // },
  43705. // "region": {
  43706. // "description": "Name of the region for this request.",
  43707. // "location": "path",
  43708. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  43709. // "required": true,
  43710. // "type": "string"
  43711. // }
  43712. // },
  43713. // "path": "{project}/regions/{region}/routers",
  43714. // "request": {
  43715. // "$ref": "Router"
  43716. // },
  43717. // "response": {
  43718. // "$ref": "Operation"
  43719. // },
  43720. // "scopes": [
  43721. // "https://www.googleapis.com/auth/cloud-platform",
  43722. // "https://www.googleapis.com/auth/compute"
  43723. // ]
  43724. // }
  43725. }
  43726. // method id "compute.routers.list":
  43727. type RoutersListCall struct {
  43728. s *Service
  43729. project string
  43730. region string
  43731. urlParams_ gensupport.URLParams
  43732. ifNoneMatch_ string
  43733. ctx_ context.Context
  43734. header_ http.Header
  43735. }
  43736. // List: Retrieves a list of Router resources available to the specified
  43737. // project.
  43738. func (r *RoutersService) List(project string, region string) *RoutersListCall {
  43739. c := &RoutersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43740. c.project = project
  43741. c.region = region
  43742. return c
  43743. }
  43744. // Filter sets the optional parameter "filter": Sets a filter
  43745. // {expression} for filtering listed resources. Your {expression} must
  43746. // be in the format: field_name comparison_string literal_string.
  43747. //
  43748. // The field_name is the name of the field you want to compare. Only
  43749. // atomic field types are supported (string, number, boolean). The
  43750. // comparison_string must be either eq (equals) or ne (not equals). The
  43751. // literal_string is the string value to filter to. The literal value
  43752. // must be valid for the type of field you are filtering by (string,
  43753. // number, boolean). For string fields, the literal value is interpreted
  43754. // as a regular expression using RE2 syntax. The literal value must
  43755. // match the entire field.
  43756. //
  43757. // For example, to filter for instances that do not have a name of
  43758. // example-instance, you would use name ne example-instance.
  43759. //
  43760. // You can filter on nested fields. For example, you could filter on
  43761. // instances that have set the scheduling.automaticRestart field to
  43762. // true. Use filtering on nested fields to take advantage of labels to
  43763. // organize and search for results based on label values.
  43764. //
  43765. // To filter on multiple expressions, provide each separate expression
  43766. // within parentheses. For example, (scheduling.automaticRestart eq
  43767. // true) (zone eq us-central1-f). Multiple expressions are treated as
  43768. // AND expressions, meaning that resources must match all expressions to
  43769. // pass the filters.
  43770. func (c *RoutersListCall) Filter(filter string) *RoutersListCall {
  43771. c.urlParams_.Set("filter", filter)
  43772. return c
  43773. }
  43774. // MaxResults sets the optional parameter "maxResults": The maximum
  43775. // number of results per page that should be returned. If the number of
  43776. // available results is larger than maxResults, Compute Engine returns a
  43777. // nextPageToken that can be used to get the next page of results in
  43778. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  43779. // (Default: 500)
  43780. func (c *RoutersListCall) MaxResults(maxResults int64) *RoutersListCall {
  43781. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  43782. return c
  43783. }
  43784. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  43785. // a certain order. By default, results are returned in alphanumerical
  43786. // order based on the resource name.
  43787. //
  43788. // You can also sort results in descending order based on the creation
  43789. // timestamp using orderBy="creationTimestamp desc". This sorts results
  43790. // based on the creationTimestamp field in reverse chronological order
  43791. // (newest result first). Use this to sort resources like operations so
  43792. // that the newest operation is returned first.
  43793. //
  43794. // Currently, only sorting by name or creationTimestamp desc is
  43795. // supported.
  43796. func (c *RoutersListCall) OrderBy(orderBy string) *RoutersListCall {
  43797. c.urlParams_.Set("orderBy", orderBy)
  43798. return c
  43799. }
  43800. // PageToken sets the optional parameter "pageToken": Specifies a page
  43801. // token to use. Set pageToken to the nextPageToken returned by a
  43802. // previous list request to get the next page of results.
  43803. func (c *RoutersListCall) PageToken(pageToken string) *RoutersListCall {
  43804. c.urlParams_.Set("pageToken", pageToken)
  43805. return c
  43806. }
  43807. // Fields allows partial responses to be retrieved. See
  43808. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43809. // for more information.
  43810. func (c *RoutersListCall) Fields(s ...googleapi.Field) *RoutersListCall {
  43811. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43812. return c
  43813. }
  43814. // IfNoneMatch sets the optional parameter which makes the operation
  43815. // fail if the object's ETag matches the given value. This is useful for
  43816. // getting updates only after the object has changed since the last
  43817. // request. Use googleapi.IsNotModified to check whether the response
  43818. // error from Do is the result of In-None-Match.
  43819. func (c *RoutersListCall) IfNoneMatch(entityTag string) *RoutersListCall {
  43820. c.ifNoneMatch_ = entityTag
  43821. return c
  43822. }
  43823. // Context sets the context to be used in this call's Do method. Any
  43824. // pending HTTP request will be aborted if the provided context is
  43825. // canceled.
  43826. func (c *RoutersListCall) Context(ctx context.Context) *RoutersListCall {
  43827. c.ctx_ = ctx
  43828. return c
  43829. }
  43830. // Header returns an http.Header that can be modified by the caller to
  43831. // add HTTP headers to the request.
  43832. func (c *RoutersListCall) Header() http.Header {
  43833. if c.header_ == nil {
  43834. c.header_ = make(http.Header)
  43835. }
  43836. return c.header_
  43837. }
  43838. func (c *RoutersListCall) doRequest(alt string) (*http.Response, error) {
  43839. reqHeaders := make(http.Header)
  43840. for k, v := range c.header_ {
  43841. reqHeaders[k] = v
  43842. }
  43843. reqHeaders.Set("User-Agent", c.s.userAgent())
  43844. if c.ifNoneMatch_ != "" {
  43845. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43846. }
  43847. var body io.Reader = nil
  43848. c.urlParams_.Set("alt", alt)
  43849. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers")
  43850. urls += "?" + c.urlParams_.Encode()
  43851. req, _ := http.NewRequest("GET", urls, body)
  43852. req.Header = reqHeaders
  43853. googleapi.Expand(req.URL, map[string]string{
  43854. "project": c.project,
  43855. "region": c.region,
  43856. })
  43857. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43858. }
  43859. // Do executes the "compute.routers.list" call.
  43860. // Exactly one of *RouterList or error will be non-nil. Any non-2xx
  43861. // status code is an error. Response headers are in either
  43862. // *RouterList.ServerResponse.Header or (if a response was returned at
  43863. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43864. // to check whether the returned error was because
  43865. // http.StatusNotModified was returned.
  43866. func (c *RoutersListCall) Do(opts ...googleapi.CallOption) (*RouterList, error) {
  43867. gensupport.SetOptions(c.urlParams_, opts...)
  43868. res, err := c.doRequest("json")
  43869. if res != nil && res.StatusCode == http.StatusNotModified {
  43870. if res.Body != nil {
  43871. res.Body.Close()
  43872. }
  43873. return nil, &googleapi.Error{
  43874. Code: res.StatusCode,
  43875. Header: res.Header,
  43876. }
  43877. }
  43878. if err != nil {
  43879. return nil, err
  43880. }
  43881. defer googleapi.CloseBody(res)
  43882. if err := googleapi.CheckResponse(res); err != nil {
  43883. return nil, err
  43884. }
  43885. ret := &RouterList{
  43886. ServerResponse: googleapi.ServerResponse{
  43887. Header: res.Header,
  43888. HTTPStatusCode: res.StatusCode,
  43889. },
  43890. }
  43891. target := &ret
  43892. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  43893. return nil, err
  43894. }
  43895. return ret, nil
  43896. // {
  43897. // "description": "Retrieves a list of Router resources available to the specified project.",
  43898. // "httpMethod": "GET",
  43899. // "id": "compute.routers.list",
  43900. // "parameterOrder": [
  43901. // "project",
  43902. // "region"
  43903. // ],
  43904. // "parameters": {
  43905. // "filter": {
  43906. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  43907. // "location": "query",
  43908. // "type": "string"
  43909. // },
  43910. // "maxResults": {
  43911. // "default": "500",
  43912. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  43913. // "format": "uint32",
  43914. // "location": "query",
  43915. // "minimum": "0",
  43916. // "type": "integer"
  43917. // },
  43918. // "orderBy": {
  43919. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  43920. // "location": "query",
  43921. // "type": "string"
  43922. // },
  43923. // "pageToken": {
  43924. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  43925. // "location": "query",
  43926. // "type": "string"
  43927. // },
  43928. // "project": {
  43929. // "description": "Project ID for this request.",
  43930. // "location": "path",
  43931. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43932. // "required": true,
  43933. // "type": "string"
  43934. // },
  43935. // "region": {
  43936. // "description": "Name of the region for this request.",
  43937. // "location": "path",
  43938. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  43939. // "required": true,
  43940. // "type": "string"
  43941. // }
  43942. // },
  43943. // "path": "{project}/regions/{region}/routers",
  43944. // "response": {
  43945. // "$ref": "RouterList"
  43946. // },
  43947. // "scopes": [
  43948. // "https://www.googleapis.com/auth/cloud-platform",
  43949. // "https://www.googleapis.com/auth/compute",
  43950. // "https://www.googleapis.com/auth/compute.readonly"
  43951. // ]
  43952. // }
  43953. }
  43954. // Pages invokes f for each page of results.
  43955. // A non-nil error returned from f will halt the iteration.
  43956. // The provided context supersedes any context provided to the Context method.
  43957. func (c *RoutersListCall) Pages(ctx context.Context, f func(*RouterList) error) error {
  43958. c.ctx_ = ctx
  43959. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  43960. for {
  43961. x, err := c.Do()
  43962. if err != nil {
  43963. return err
  43964. }
  43965. if err := f(x); err != nil {
  43966. return err
  43967. }
  43968. if x.NextPageToken == "" {
  43969. return nil
  43970. }
  43971. c.PageToken(x.NextPageToken)
  43972. }
  43973. }
  43974. // method id "compute.routers.patch":
  43975. type RoutersPatchCall struct {
  43976. s *Service
  43977. project string
  43978. region string
  43979. router string
  43980. router2 *Router
  43981. urlParams_ gensupport.URLParams
  43982. ctx_ context.Context
  43983. header_ http.Header
  43984. }
  43985. // Patch: Patches the specified Router resource with the data included
  43986. // in the request. This method supports patch semantics.
  43987. func (r *RoutersService) Patch(project string, region string, router string, router2 *Router) *RoutersPatchCall {
  43988. c := &RoutersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43989. c.project = project
  43990. c.region = region
  43991. c.router = router
  43992. c.router2 = router2
  43993. return c
  43994. }
  43995. // Fields allows partial responses to be retrieved. See
  43996. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43997. // for more information.
  43998. func (c *RoutersPatchCall) Fields(s ...googleapi.Field) *RoutersPatchCall {
  43999. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44000. return c
  44001. }
  44002. // Context sets the context to be used in this call's Do method. Any
  44003. // pending HTTP request will be aborted if the provided context is
  44004. // canceled.
  44005. func (c *RoutersPatchCall) Context(ctx context.Context) *RoutersPatchCall {
  44006. c.ctx_ = ctx
  44007. return c
  44008. }
  44009. // Header returns an http.Header that can be modified by the caller to
  44010. // add HTTP headers to the request.
  44011. func (c *RoutersPatchCall) Header() http.Header {
  44012. if c.header_ == nil {
  44013. c.header_ = make(http.Header)
  44014. }
  44015. return c.header_
  44016. }
  44017. func (c *RoutersPatchCall) doRequest(alt string) (*http.Response, error) {
  44018. reqHeaders := make(http.Header)
  44019. for k, v := range c.header_ {
  44020. reqHeaders[k] = v
  44021. }
  44022. reqHeaders.Set("User-Agent", c.s.userAgent())
  44023. var body io.Reader = nil
  44024. body, err := googleapi.WithoutDataWrapper.JSONReader(c.router2)
  44025. if err != nil {
  44026. return nil, err
  44027. }
  44028. reqHeaders.Set("Content-Type", "application/json")
  44029. c.urlParams_.Set("alt", alt)
  44030. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}")
  44031. urls += "?" + c.urlParams_.Encode()
  44032. req, _ := http.NewRequest("PATCH", urls, body)
  44033. req.Header = reqHeaders
  44034. googleapi.Expand(req.URL, map[string]string{
  44035. "project": c.project,
  44036. "region": c.region,
  44037. "router": c.router,
  44038. })
  44039. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44040. }
  44041. // Do executes the "compute.routers.patch" call.
  44042. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  44043. // status code is an error. Response headers are in either
  44044. // *Operation.ServerResponse.Header or (if a response was returned at
  44045. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44046. // to check whether the returned error was because
  44047. // http.StatusNotModified was returned.
  44048. func (c *RoutersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  44049. gensupport.SetOptions(c.urlParams_, opts...)
  44050. res, err := c.doRequest("json")
  44051. if res != nil && res.StatusCode == http.StatusNotModified {
  44052. if res.Body != nil {
  44053. res.Body.Close()
  44054. }
  44055. return nil, &googleapi.Error{
  44056. Code: res.StatusCode,
  44057. Header: res.Header,
  44058. }
  44059. }
  44060. if err != nil {
  44061. return nil, err
  44062. }
  44063. defer googleapi.CloseBody(res)
  44064. if err := googleapi.CheckResponse(res); err != nil {
  44065. return nil, err
  44066. }
  44067. ret := &Operation{
  44068. ServerResponse: googleapi.ServerResponse{
  44069. Header: res.Header,
  44070. HTTPStatusCode: res.StatusCode,
  44071. },
  44072. }
  44073. target := &ret
  44074. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  44075. return nil, err
  44076. }
  44077. return ret, nil
  44078. // {
  44079. // "description": "Patches the specified Router resource with the data included in the request. This method supports patch semantics.",
  44080. // "httpMethod": "PATCH",
  44081. // "id": "compute.routers.patch",
  44082. // "parameterOrder": [
  44083. // "project",
  44084. // "region",
  44085. // "router"
  44086. // ],
  44087. // "parameters": {
  44088. // "project": {
  44089. // "description": "Project ID for this request.",
  44090. // "location": "path",
  44091. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44092. // "required": true,
  44093. // "type": "string"
  44094. // },
  44095. // "region": {
  44096. // "description": "Name of the region for this request.",
  44097. // "location": "path",
  44098. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  44099. // "required": true,
  44100. // "type": "string"
  44101. // },
  44102. // "router": {
  44103. // "description": "Name of the Router resource to patch.",
  44104. // "location": "path",
  44105. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  44106. // "required": true,
  44107. // "type": "string"
  44108. // }
  44109. // },
  44110. // "path": "{project}/regions/{region}/routers/{router}",
  44111. // "request": {
  44112. // "$ref": "Router"
  44113. // },
  44114. // "response": {
  44115. // "$ref": "Operation"
  44116. // },
  44117. // "scopes": [
  44118. // "https://www.googleapis.com/auth/cloud-platform",
  44119. // "https://www.googleapis.com/auth/compute",
  44120. // "https://www.googleapis.com/auth/compute.readonly"
  44121. // ]
  44122. // }
  44123. }
  44124. // method id "compute.routers.preview":
  44125. type RoutersPreviewCall struct {
  44126. s *Service
  44127. project string
  44128. region string
  44129. router string
  44130. router2 *Router
  44131. urlParams_ gensupport.URLParams
  44132. ctx_ context.Context
  44133. header_ http.Header
  44134. }
  44135. // Preview: Preview fields auto-generated during router create and
  44136. // update operations. Calling this method does NOT create or update the
  44137. // router.
  44138. func (r *RoutersService) Preview(project string, region string, router string, router2 *Router) *RoutersPreviewCall {
  44139. c := &RoutersPreviewCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44140. c.project = project
  44141. c.region = region
  44142. c.router = router
  44143. c.router2 = router2
  44144. return c
  44145. }
  44146. // Fields allows partial responses to be retrieved. See
  44147. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44148. // for more information.
  44149. func (c *RoutersPreviewCall) Fields(s ...googleapi.Field) *RoutersPreviewCall {
  44150. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44151. return c
  44152. }
  44153. // Context sets the context to be used in this call's Do method. Any
  44154. // pending HTTP request will be aborted if the provided context is
  44155. // canceled.
  44156. func (c *RoutersPreviewCall) Context(ctx context.Context) *RoutersPreviewCall {
  44157. c.ctx_ = ctx
  44158. return c
  44159. }
  44160. // Header returns an http.Header that can be modified by the caller to
  44161. // add HTTP headers to the request.
  44162. func (c *RoutersPreviewCall) Header() http.Header {
  44163. if c.header_ == nil {
  44164. c.header_ = make(http.Header)
  44165. }
  44166. return c.header_
  44167. }
  44168. func (c *RoutersPreviewCall) doRequest(alt string) (*http.Response, error) {
  44169. reqHeaders := make(http.Header)
  44170. for k, v := range c.header_ {
  44171. reqHeaders[k] = v
  44172. }
  44173. reqHeaders.Set("User-Agent", c.s.userAgent())
  44174. var body io.Reader = nil
  44175. body, err := googleapi.WithoutDataWrapper.JSONReader(c.router2)
  44176. if err != nil {
  44177. return nil, err
  44178. }
  44179. reqHeaders.Set("Content-Type", "application/json")
  44180. c.urlParams_.Set("alt", alt)
  44181. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}/preview")
  44182. urls += "?" + c.urlParams_.Encode()
  44183. req, _ := http.NewRequest("POST", urls, body)
  44184. req.Header = reqHeaders
  44185. googleapi.Expand(req.URL, map[string]string{
  44186. "project": c.project,
  44187. "region": c.region,
  44188. "router": c.router,
  44189. })
  44190. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44191. }
  44192. // Do executes the "compute.routers.preview" call.
  44193. // Exactly one of *RoutersPreviewResponse or error will be non-nil. Any
  44194. // non-2xx status code is an error. Response headers are in either
  44195. // *RoutersPreviewResponse.ServerResponse.Header or (if a response was
  44196. // returned at all) in error.(*googleapi.Error).Header. Use
  44197. // googleapi.IsNotModified to check whether the returned error was
  44198. // because http.StatusNotModified was returned.
  44199. func (c *RoutersPreviewCall) Do(opts ...googleapi.CallOption) (*RoutersPreviewResponse, error) {
  44200. gensupport.SetOptions(c.urlParams_, opts...)
  44201. res, err := c.doRequest("json")
  44202. if res != nil && res.StatusCode == http.StatusNotModified {
  44203. if res.Body != nil {
  44204. res.Body.Close()
  44205. }
  44206. return nil, &googleapi.Error{
  44207. Code: res.StatusCode,
  44208. Header: res.Header,
  44209. }
  44210. }
  44211. if err != nil {
  44212. return nil, err
  44213. }
  44214. defer googleapi.CloseBody(res)
  44215. if err := googleapi.CheckResponse(res); err != nil {
  44216. return nil, err
  44217. }
  44218. ret := &RoutersPreviewResponse{
  44219. ServerResponse: googleapi.ServerResponse{
  44220. Header: res.Header,
  44221. HTTPStatusCode: res.StatusCode,
  44222. },
  44223. }
  44224. target := &ret
  44225. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  44226. return nil, err
  44227. }
  44228. return ret, nil
  44229. // {
  44230. // "description": "Preview fields auto-generated during router create and update operations. Calling this method does NOT create or update the router.",
  44231. // "httpMethod": "POST",
  44232. // "id": "compute.routers.preview",
  44233. // "parameterOrder": [
  44234. // "project",
  44235. // "region",
  44236. // "router"
  44237. // ],
  44238. // "parameters": {
  44239. // "project": {
  44240. // "description": "Project ID for this request.",
  44241. // "location": "path",
  44242. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44243. // "required": true,
  44244. // "type": "string"
  44245. // },
  44246. // "region": {
  44247. // "description": "Name of the region for this request.",
  44248. // "location": "path",
  44249. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  44250. // "required": true,
  44251. // "type": "string"
  44252. // },
  44253. // "router": {
  44254. // "description": "Name of the Router resource to query.",
  44255. // "location": "path",
  44256. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  44257. // "required": true,
  44258. // "type": "string"
  44259. // }
  44260. // },
  44261. // "path": "{project}/regions/{region}/routers/{router}/preview",
  44262. // "request": {
  44263. // "$ref": "Router"
  44264. // },
  44265. // "response": {
  44266. // "$ref": "RoutersPreviewResponse"
  44267. // },
  44268. // "scopes": [
  44269. // "https://www.googleapis.com/auth/cloud-platform",
  44270. // "https://www.googleapis.com/auth/compute",
  44271. // "https://www.googleapis.com/auth/compute.readonly"
  44272. // ]
  44273. // }
  44274. }
  44275. // method id "compute.routers.update":
  44276. type RoutersUpdateCall struct {
  44277. s *Service
  44278. project string
  44279. region string
  44280. router string
  44281. router2 *Router
  44282. urlParams_ gensupport.URLParams
  44283. ctx_ context.Context
  44284. header_ http.Header
  44285. }
  44286. // Update: Updates the specified Router resource with the data included
  44287. // in the request.
  44288. func (r *RoutersService) Update(project string, region string, router string, router2 *Router) *RoutersUpdateCall {
  44289. c := &RoutersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44290. c.project = project
  44291. c.region = region
  44292. c.router = router
  44293. c.router2 = router2
  44294. return c
  44295. }
  44296. // Fields allows partial responses to be retrieved. See
  44297. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44298. // for more information.
  44299. func (c *RoutersUpdateCall) Fields(s ...googleapi.Field) *RoutersUpdateCall {
  44300. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44301. return c
  44302. }
  44303. // Context sets the context to be used in this call's Do method. Any
  44304. // pending HTTP request will be aborted if the provided context is
  44305. // canceled.
  44306. func (c *RoutersUpdateCall) Context(ctx context.Context) *RoutersUpdateCall {
  44307. c.ctx_ = ctx
  44308. return c
  44309. }
  44310. // Header returns an http.Header that can be modified by the caller to
  44311. // add HTTP headers to the request.
  44312. func (c *RoutersUpdateCall) Header() http.Header {
  44313. if c.header_ == nil {
  44314. c.header_ = make(http.Header)
  44315. }
  44316. return c.header_
  44317. }
  44318. func (c *RoutersUpdateCall) doRequest(alt string) (*http.Response, error) {
  44319. reqHeaders := make(http.Header)
  44320. for k, v := range c.header_ {
  44321. reqHeaders[k] = v
  44322. }
  44323. reqHeaders.Set("User-Agent", c.s.userAgent())
  44324. var body io.Reader = nil
  44325. body, err := googleapi.WithoutDataWrapper.JSONReader(c.router2)
  44326. if err != nil {
  44327. return nil, err
  44328. }
  44329. reqHeaders.Set("Content-Type", "application/json")
  44330. c.urlParams_.Set("alt", alt)
  44331. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}")
  44332. urls += "?" + c.urlParams_.Encode()
  44333. req, _ := http.NewRequest("PUT", urls, body)
  44334. req.Header = reqHeaders
  44335. googleapi.Expand(req.URL, map[string]string{
  44336. "project": c.project,
  44337. "region": c.region,
  44338. "router": c.router,
  44339. })
  44340. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44341. }
  44342. // Do executes the "compute.routers.update" call.
  44343. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  44344. // status code is an error. Response headers are in either
  44345. // *Operation.ServerResponse.Header or (if a response was returned at
  44346. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44347. // to check whether the returned error was because
  44348. // http.StatusNotModified was returned.
  44349. func (c *RoutersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  44350. gensupport.SetOptions(c.urlParams_, opts...)
  44351. res, err := c.doRequest("json")
  44352. if res != nil && res.StatusCode == http.StatusNotModified {
  44353. if res.Body != nil {
  44354. res.Body.Close()
  44355. }
  44356. return nil, &googleapi.Error{
  44357. Code: res.StatusCode,
  44358. Header: res.Header,
  44359. }
  44360. }
  44361. if err != nil {
  44362. return nil, err
  44363. }
  44364. defer googleapi.CloseBody(res)
  44365. if err := googleapi.CheckResponse(res); err != nil {
  44366. return nil, err
  44367. }
  44368. ret := &Operation{
  44369. ServerResponse: googleapi.ServerResponse{
  44370. Header: res.Header,
  44371. HTTPStatusCode: res.StatusCode,
  44372. },
  44373. }
  44374. target := &ret
  44375. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  44376. return nil, err
  44377. }
  44378. return ret, nil
  44379. // {
  44380. // "description": "Updates the specified Router resource with the data included in the request.",
  44381. // "httpMethod": "PUT",
  44382. // "id": "compute.routers.update",
  44383. // "parameterOrder": [
  44384. // "project",
  44385. // "region",
  44386. // "router"
  44387. // ],
  44388. // "parameters": {
  44389. // "project": {
  44390. // "description": "Project ID for this request.",
  44391. // "location": "path",
  44392. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44393. // "required": true,
  44394. // "type": "string"
  44395. // },
  44396. // "region": {
  44397. // "description": "Name of the region for this request.",
  44398. // "location": "path",
  44399. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  44400. // "required": true,
  44401. // "type": "string"
  44402. // },
  44403. // "router": {
  44404. // "description": "Name of the Router resource to update.",
  44405. // "location": "path",
  44406. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  44407. // "required": true,
  44408. // "type": "string"
  44409. // }
  44410. // },
  44411. // "path": "{project}/regions/{region}/routers/{router}",
  44412. // "request": {
  44413. // "$ref": "Router"
  44414. // },
  44415. // "response": {
  44416. // "$ref": "Operation"
  44417. // },
  44418. // "scopes": [
  44419. // "https://www.googleapis.com/auth/cloud-platform",
  44420. // "https://www.googleapis.com/auth/compute"
  44421. // ]
  44422. // }
  44423. }
  44424. // method id "compute.routes.delete":
  44425. type RoutesDeleteCall struct {
  44426. s *Service
  44427. project string
  44428. route string
  44429. urlParams_ gensupport.URLParams
  44430. ctx_ context.Context
  44431. header_ http.Header
  44432. }
  44433. // Delete: Deletes the specified Route resource.
  44434. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/delete
  44435. func (r *RoutesService) Delete(project string, route string) *RoutesDeleteCall {
  44436. c := &RoutesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44437. c.project = project
  44438. c.route = route
  44439. return c
  44440. }
  44441. // Fields allows partial responses to be retrieved. See
  44442. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44443. // for more information.
  44444. func (c *RoutesDeleteCall) Fields(s ...googleapi.Field) *RoutesDeleteCall {
  44445. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44446. return c
  44447. }
  44448. // Context sets the context to be used in this call's Do method. Any
  44449. // pending HTTP request will be aborted if the provided context is
  44450. // canceled.
  44451. func (c *RoutesDeleteCall) Context(ctx context.Context) *RoutesDeleteCall {
  44452. c.ctx_ = ctx
  44453. return c
  44454. }
  44455. // Header returns an http.Header that can be modified by the caller to
  44456. // add HTTP headers to the request.
  44457. func (c *RoutesDeleteCall) Header() http.Header {
  44458. if c.header_ == nil {
  44459. c.header_ = make(http.Header)
  44460. }
  44461. return c.header_
  44462. }
  44463. func (c *RoutesDeleteCall) doRequest(alt string) (*http.Response, error) {
  44464. reqHeaders := make(http.Header)
  44465. for k, v := range c.header_ {
  44466. reqHeaders[k] = v
  44467. }
  44468. reqHeaders.Set("User-Agent", c.s.userAgent())
  44469. var body io.Reader = nil
  44470. c.urlParams_.Set("alt", alt)
  44471. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes/{route}")
  44472. urls += "?" + c.urlParams_.Encode()
  44473. req, _ := http.NewRequest("DELETE", urls, body)
  44474. req.Header = reqHeaders
  44475. googleapi.Expand(req.URL, map[string]string{
  44476. "project": c.project,
  44477. "route": c.route,
  44478. })
  44479. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44480. }
  44481. // Do executes the "compute.routes.delete" call.
  44482. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  44483. // status code is an error. Response headers are in either
  44484. // *Operation.ServerResponse.Header or (if a response was returned at
  44485. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44486. // to check whether the returned error was because
  44487. // http.StatusNotModified was returned.
  44488. func (c *RoutesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  44489. gensupport.SetOptions(c.urlParams_, opts...)
  44490. res, err := c.doRequest("json")
  44491. if res != nil && res.StatusCode == http.StatusNotModified {
  44492. if res.Body != nil {
  44493. res.Body.Close()
  44494. }
  44495. return nil, &googleapi.Error{
  44496. Code: res.StatusCode,
  44497. Header: res.Header,
  44498. }
  44499. }
  44500. if err != nil {
  44501. return nil, err
  44502. }
  44503. defer googleapi.CloseBody(res)
  44504. if err := googleapi.CheckResponse(res); err != nil {
  44505. return nil, err
  44506. }
  44507. ret := &Operation{
  44508. ServerResponse: googleapi.ServerResponse{
  44509. Header: res.Header,
  44510. HTTPStatusCode: res.StatusCode,
  44511. },
  44512. }
  44513. target := &ret
  44514. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  44515. return nil, err
  44516. }
  44517. return ret, nil
  44518. // {
  44519. // "description": "Deletes the specified Route resource.",
  44520. // "httpMethod": "DELETE",
  44521. // "id": "compute.routes.delete",
  44522. // "parameterOrder": [
  44523. // "project",
  44524. // "route"
  44525. // ],
  44526. // "parameters": {
  44527. // "project": {
  44528. // "description": "Project ID for this request.",
  44529. // "location": "path",
  44530. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44531. // "required": true,
  44532. // "type": "string"
  44533. // },
  44534. // "route": {
  44535. // "description": "Name of the Route resource to delete.",
  44536. // "location": "path",
  44537. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  44538. // "required": true,
  44539. // "type": "string"
  44540. // }
  44541. // },
  44542. // "path": "{project}/global/routes/{route}",
  44543. // "response": {
  44544. // "$ref": "Operation"
  44545. // },
  44546. // "scopes": [
  44547. // "https://www.googleapis.com/auth/cloud-platform",
  44548. // "https://www.googleapis.com/auth/compute"
  44549. // ]
  44550. // }
  44551. }
  44552. // method id "compute.routes.get":
  44553. type RoutesGetCall struct {
  44554. s *Service
  44555. project string
  44556. route string
  44557. urlParams_ gensupport.URLParams
  44558. ifNoneMatch_ string
  44559. ctx_ context.Context
  44560. header_ http.Header
  44561. }
  44562. // Get: Returns the specified Route resource. Get a list of available
  44563. // routes by making a list() request.
  44564. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/get
  44565. func (r *RoutesService) Get(project string, route string) *RoutesGetCall {
  44566. c := &RoutesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44567. c.project = project
  44568. c.route = route
  44569. return c
  44570. }
  44571. // Fields allows partial responses to be retrieved. See
  44572. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44573. // for more information.
  44574. func (c *RoutesGetCall) Fields(s ...googleapi.Field) *RoutesGetCall {
  44575. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44576. return c
  44577. }
  44578. // IfNoneMatch sets the optional parameter which makes the operation
  44579. // fail if the object's ETag matches the given value. This is useful for
  44580. // getting updates only after the object has changed since the last
  44581. // request. Use googleapi.IsNotModified to check whether the response
  44582. // error from Do is the result of In-None-Match.
  44583. func (c *RoutesGetCall) IfNoneMatch(entityTag string) *RoutesGetCall {
  44584. c.ifNoneMatch_ = entityTag
  44585. return c
  44586. }
  44587. // Context sets the context to be used in this call's Do method. Any
  44588. // pending HTTP request will be aborted if the provided context is
  44589. // canceled.
  44590. func (c *RoutesGetCall) Context(ctx context.Context) *RoutesGetCall {
  44591. c.ctx_ = ctx
  44592. return c
  44593. }
  44594. // Header returns an http.Header that can be modified by the caller to
  44595. // add HTTP headers to the request.
  44596. func (c *RoutesGetCall) Header() http.Header {
  44597. if c.header_ == nil {
  44598. c.header_ = make(http.Header)
  44599. }
  44600. return c.header_
  44601. }
  44602. func (c *RoutesGetCall) doRequest(alt string) (*http.Response, error) {
  44603. reqHeaders := make(http.Header)
  44604. for k, v := range c.header_ {
  44605. reqHeaders[k] = v
  44606. }
  44607. reqHeaders.Set("User-Agent", c.s.userAgent())
  44608. if c.ifNoneMatch_ != "" {
  44609. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44610. }
  44611. var body io.Reader = nil
  44612. c.urlParams_.Set("alt", alt)
  44613. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes/{route}")
  44614. urls += "?" + c.urlParams_.Encode()
  44615. req, _ := http.NewRequest("GET", urls, body)
  44616. req.Header = reqHeaders
  44617. googleapi.Expand(req.URL, map[string]string{
  44618. "project": c.project,
  44619. "route": c.route,
  44620. })
  44621. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44622. }
  44623. // Do executes the "compute.routes.get" call.
  44624. // Exactly one of *Route or error will be non-nil. Any non-2xx status
  44625. // code is an error. Response headers are in either
  44626. // *Route.ServerResponse.Header or (if a response was returned at all)
  44627. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  44628. // check whether the returned error was because http.StatusNotModified
  44629. // was returned.
  44630. func (c *RoutesGetCall) Do(opts ...googleapi.CallOption) (*Route, error) {
  44631. gensupport.SetOptions(c.urlParams_, opts...)
  44632. res, err := c.doRequest("json")
  44633. if res != nil && res.StatusCode == http.StatusNotModified {
  44634. if res.Body != nil {
  44635. res.Body.Close()
  44636. }
  44637. return nil, &googleapi.Error{
  44638. Code: res.StatusCode,
  44639. Header: res.Header,
  44640. }
  44641. }
  44642. if err != nil {
  44643. return nil, err
  44644. }
  44645. defer googleapi.CloseBody(res)
  44646. if err := googleapi.CheckResponse(res); err != nil {
  44647. return nil, err
  44648. }
  44649. ret := &Route{
  44650. ServerResponse: googleapi.ServerResponse{
  44651. Header: res.Header,
  44652. HTTPStatusCode: res.StatusCode,
  44653. },
  44654. }
  44655. target := &ret
  44656. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  44657. return nil, err
  44658. }
  44659. return ret, nil
  44660. // {
  44661. // "description": "Returns the specified Route resource. Get a list of available routes by making a list() request.",
  44662. // "httpMethod": "GET",
  44663. // "id": "compute.routes.get",
  44664. // "parameterOrder": [
  44665. // "project",
  44666. // "route"
  44667. // ],
  44668. // "parameters": {
  44669. // "project": {
  44670. // "description": "Project ID for this request.",
  44671. // "location": "path",
  44672. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44673. // "required": true,
  44674. // "type": "string"
  44675. // },
  44676. // "route": {
  44677. // "description": "Name of the Route resource to return.",
  44678. // "location": "path",
  44679. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  44680. // "required": true,
  44681. // "type": "string"
  44682. // }
  44683. // },
  44684. // "path": "{project}/global/routes/{route}",
  44685. // "response": {
  44686. // "$ref": "Route"
  44687. // },
  44688. // "scopes": [
  44689. // "https://www.googleapis.com/auth/cloud-platform",
  44690. // "https://www.googleapis.com/auth/compute",
  44691. // "https://www.googleapis.com/auth/compute.readonly"
  44692. // ]
  44693. // }
  44694. }
  44695. // method id "compute.routes.insert":
  44696. type RoutesInsertCall struct {
  44697. s *Service
  44698. project string
  44699. route *Route
  44700. urlParams_ gensupport.URLParams
  44701. ctx_ context.Context
  44702. header_ http.Header
  44703. }
  44704. // Insert: Creates a Route resource in the specified project using the
  44705. // data included in the request.
  44706. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/insert
  44707. func (r *RoutesService) Insert(project string, route *Route) *RoutesInsertCall {
  44708. c := &RoutesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44709. c.project = project
  44710. c.route = route
  44711. return c
  44712. }
  44713. // Fields allows partial responses to be retrieved. See
  44714. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44715. // for more information.
  44716. func (c *RoutesInsertCall) Fields(s ...googleapi.Field) *RoutesInsertCall {
  44717. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44718. return c
  44719. }
  44720. // Context sets the context to be used in this call's Do method. Any
  44721. // pending HTTP request will be aborted if the provided context is
  44722. // canceled.
  44723. func (c *RoutesInsertCall) Context(ctx context.Context) *RoutesInsertCall {
  44724. c.ctx_ = ctx
  44725. return c
  44726. }
  44727. // Header returns an http.Header that can be modified by the caller to
  44728. // add HTTP headers to the request.
  44729. func (c *RoutesInsertCall) Header() http.Header {
  44730. if c.header_ == nil {
  44731. c.header_ = make(http.Header)
  44732. }
  44733. return c.header_
  44734. }
  44735. func (c *RoutesInsertCall) doRequest(alt string) (*http.Response, error) {
  44736. reqHeaders := make(http.Header)
  44737. for k, v := range c.header_ {
  44738. reqHeaders[k] = v
  44739. }
  44740. reqHeaders.Set("User-Agent", c.s.userAgent())
  44741. var body io.Reader = nil
  44742. body, err := googleapi.WithoutDataWrapper.JSONReader(c.route)
  44743. if err != nil {
  44744. return nil, err
  44745. }
  44746. reqHeaders.Set("Content-Type", "application/json")
  44747. c.urlParams_.Set("alt", alt)
  44748. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes")
  44749. urls += "?" + c.urlParams_.Encode()
  44750. req, _ := http.NewRequest("POST", urls, body)
  44751. req.Header = reqHeaders
  44752. googleapi.Expand(req.URL, map[string]string{
  44753. "project": c.project,
  44754. })
  44755. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44756. }
  44757. // Do executes the "compute.routes.insert" call.
  44758. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  44759. // status code is an error. Response headers are in either
  44760. // *Operation.ServerResponse.Header or (if a response was returned at
  44761. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44762. // to check whether the returned error was because
  44763. // http.StatusNotModified was returned.
  44764. func (c *RoutesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  44765. gensupport.SetOptions(c.urlParams_, opts...)
  44766. res, err := c.doRequest("json")
  44767. if res != nil && res.StatusCode == http.StatusNotModified {
  44768. if res.Body != nil {
  44769. res.Body.Close()
  44770. }
  44771. return nil, &googleapi.Error{
  44772. Code: res.StatusCode,
  44773. Header: res.Header,
  44774. }
  44775. }
  44776. if err != nil {
  44777. return nil, err
  44778. }
  44779. defer googleapi.CloseBody(res)
  44780. if err := googleapi.CheckResponse(res); err != nil {
  44781. return nil, err
  44782. }
  44783. ret := &Operation{
  44784. ServerResponse: googleapi.ServerResponse{
  44785. Header: res.Header,
  44786. HTTPStatusCode: res.StatusCode,
  44787. },
  44788. }
  44789. target := &ret
  44790. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  44791. return nil, err
  44792. }
  44793. return ret, nil
  44794. // {
  44795. // "description": "Creates a Route resource in the specified project using the data included in the request.",
  44796. // "httpMethod": "POST",
  44797. // "id": "compute.routes.insert",
  44798. // "parameterOrder": [
  44799. // "project"
  44800. // ],
  44801. // "parameters": {
  44802. // "project": {
  44803. // "description": "Project ID for this request.",
  44804. // "location": "path",
  44805. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44806. // "required": true,
  44807. // "type": "string"
  44808. // }
  44809. // },
  44810. // "path": "{project}/global/routes",
  44811. // "request": {
  44812. // "$ref": "Route"
  44813. // },
  44814. // "response": {
  44815. // "$ref": "Operation"
  44816. // },
  44817. // "scopes": [
  44818. // "https://www.googleapis.com/auth/cloud-platform",
  44819. // "https://www.googleapis.com/auth/compute"
  44820. // ]
  44821. // }
  44822. }
  44823. // method id "compute.routes.list":
  44824. type RoutesListCall struct {
  44825. s *Service
  44826. project string
  44827. urlParams_ gensupport.URLParams
  44828. ifNoneMatch_ string
  44829. ctx_ context.Context
  44830. header_ http.Header
  44831. }
  44832. // List: Retrieves the list of Route resources available to the
  44833. // specified project.
  44834. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/list
  44835. func (r *RoutesService) List(project string) *RoutesListCall {
  44836. c := &RoutesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44837. c.project = project
  44838. return c
  44839. }
  44840. // Filter sets the optional parameter "filter": Sets a filter
  44841. // {expression} for filtering listed resources. Your {expression} must
  44842. // be in the format: field_name comparison_string literal_string.
  44843. //
  44844. // The field_name is the name of the field you want to compare. Only
  44845. // atomic field types are supported (string, number, boolean). The
  44846. // comparison_string must be either eq (equals) or ne (not equals). The
  44847. // literal_string is the string value to filter to. The literal value
  44848. // must be valid for the type of field you are filtering by (string,
  44849. // number, boolean). For string fields, the literal value is interpreted
  44850. // as a regular expression using RE2 syntax. The literal value must
  44851. // match the entire field.
  44852. //
  44853. // For example, to filter for instances that do not have a name of
  44854. // example-instance, you would use name ne example-instance.
  44855. //
  44856. // You can filter on nested fields. For example, you could filter on
  44857. // instances that have set the scheduling.automaticRestart field to
  44858. // true. Use filtering on nested fields to take advantage of labels to
  44859. // organize and search for results based on label values.
  44860. //
  44861. // To filter on multiple expressions, provide each separate expression
  44862. // within parentheses. For example, (scheduling.automaticRestart eq
  44863. // true) (zone eq us-central1-f). Multiple expressions are treated as
  44864. // AND expressions, meaning that resources must match all expressions to
  44865. // pass the filters.
  44866. func (c *RoutesListCall) Filter(filter string) *RoutesListCall {
  44867. c.urlParams_.Set("filter", filter)
  44868. return c
  44869. }
  44870. // MaxResults sets the optional parameter "maxResults": The maximum
  44871. // number of results per page that should be returned. If the number of
  44872. // available results is larger than maxResults, Compute Engine returns a
  44873. // nextPageToken that can be used to get the next page of results in
  44874. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  44875. // (Default: 500)
  44876. func (c *RoutesListCall) MaxResults(maxResults int64) *RoutesListCall {
  44877. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  44878. return c
  44879. }
  44880. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  44881. // a certain order. By default, results are returned in alphanumerical
  44882. // order based on the resource name.
  44883. //
  44884. // You can also sort results in descending order based on the creation
  44885. // timestamp using orderBy="creationTimestamp desc". This sorts results
  44886. // based on the creationTimestamp field in reverse chronological order
  44887. // (newest result first). Use this to sort resources like operations so
  44888. // that the newest operation is returned first.
  44889. //
  44890. // Currently, only sorting by name or creationTimestamp desc is
  44891. // supported.
  44892. func (c *RoutesListCall) OrderBy(orderBy string) *RoutesListCall {
  44893. c.urlParams_.Set("orderBy", orderBy)
  44894. return c
  44895. }
  44896. // PageToken sets the optional parameter "pageToken": Specifies a page
  44897. // token to use. Set pageToken to the nextPageToken returned by a
  44898. // previous list request to get the next page of results.
  44899. func (c *RoutesListCall) PageToken(pageToken string) *RoutesListCall {
  44900. c.urlParams_.Set("pageToken", pageToken)
  44901. return c
  44902. }
  44903. // Fields allows partial responses to be retrieved. See
  44904. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44905. // for more information.
  44906. func (c *RoutesListCall) Fields(s ...googleapi.Field) *RoutesListCall {
  44907. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44908. return c
  44909. }
  44910. // IfNoneMatch sets the optional parameter which makes the operation
  44911. // fail if the object's ETag matches the given value. This is useful for
  44912. // getting updates only after the object has changed since the last
  44913. // request. Use googleapi.IsNotModified to check whether the response
  44914. // error from Do is the result of In-None-Match.
  44915. func (c *RoutesListCall) IfNoneMatch(entityTag string) *RoutesListCall {
  44916. c.ifNoneMatch_ = entityTag
  44917. return c
  44918. }
  44919. // Context sets the context to be used in this call's Do method. Any
  44920. // pending HTTP request will be aborted if the provided context is
  44921. // canceled.
  44922. func (c *RoutesListCall) Context(ctx context.Context) *RoutesListCall {
  44923. c.ctx_ = ctx
  44924. return c
  44925. }
  44926. // Header returns an http.Header that can be modified by the caller to
  44927. // add HTTP headers to the request.
  44928. func (c *RoutesListCall) Header() http.Header {
  44929. if c.header_ == nil {
  44930. c.header_ = make(http.Header)
  44931. }
  44932. return c.header_
  44933. }
  44934. func (c *RoutesListCall) doRequest(alt string) (*http.Response, error) {
  44935. reqHeaders := make(http.Header)
  44936. for k, v := range c.header_ {
  44937. reqHeaders[k] = v
  44938. }
  44939. reqHeaders.Set("User-Agent", c.s.userAgent())
  44940. if c.ifNoneMatch_ != "" {
  44941. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44942. }
  44943. var body io.Reader = nil
  44944. c.urlParams_.Set("alt", alt)
  44945. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes")
  44946. urls += "?" + c.urlParams_.Encode()
  44947. req, _ := http.NewRequest("GET", urls, body)
  44948. req.Header = reqHeaders
  44949. googleapi.Expand(req.URL, map[string]string{
  44950. "project": c.project,
  44951. })
  44952. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44953. }
  44954. // Do executes the "compute.routes.list" call.
  44955. // Exactly one of *RouteList or error will be non-nil. Any non-2xx
  44956. // status code is an error. Response headers are in either
  44957. // *RouteList.ServerResponse.Header or (if a response was returned at
  44958. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44959. // to check whether the returned error was because
  44960. // http.StatusNotModified was returned.
  44961. func (c *RoutesListCall) Do(opts ...googleapi.CallOption) (*RouteList, error) {
  44962. gensupport.SetOptions(c.urlParams_, opts...)
  44963. res, err := c.doRequest("json")
  44964. if res != nil && res.StatusCode == http.StatusNotModified {
  44965. if res.Body != nil {
  44966. res.Body.Close()
  44967. }
  44968. return nil, &googleapi.Error{
  44969. Code: res.StatusCode,
  44970. Header: res.Header,
  44971. }
  44972. }
  44973. if err != nil {
  44974. return nil, err
  44975. }
  44976. defer googleapi.CloseBody(res)
  44977. if err := googleapi.CheckResponse(res); err != nil {
  44978. return nil, err
  44979. }
  44980. ret := &RouteList{
  44981. ServerResponse: googleapi.ServerResponse{
  44982. Header: res.Header,
  44983. HTTPStatusCode: res.StatusCode,
  44984. },
  44985. }
  44986. target := &ret
  44987. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  44988. return nil, err
  44989. }
  44990. return ret, nil
  44991. // {
  44992. // "description": "Retrieves the list of Route resources available to the specified project.",
  44993. // "httpMethod": "GET",
  44994. // "id": "compute.routes.list",
  44995. // "parameterOrder": [
  44996. // "project"
  44997. // ],
  44998. // "parameters": {
  44999. // "filter": {
  45000. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  45001. // "location": "query",
  45002. // "type": "string"
  45003. // },
  45004. // "maxResults": {
  45005. // "default": "500",
  45006. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  45007. // "format": "uint32",
  45008. // "location": "query",
  45009. // "minimum": "0",
  45010. // "type": "integer"
  45011. // },
  45012. // "orderBy": {
  45013. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  45014. // "location": "query",
  45015. // "type": "string"
  45016. // },
  45017. // "pageToken": {
  45018. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  45019. // "location": "query",
  45020. // "type": "string"
  45021. // },
  45022. // "project": {
  45023. // "description": "Project ID for this request.",
  45024. // "location": "path",
  45025. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45026. // "required": true,
  45027. // "type": "string"
  45028. // }
  45029. // },
  45030. // "path": "{project}/global/routes",
  45031. // "response": {
  45032. // "$ref": "RouteList"
  45033. // },
  45034. // "scopes": [
  45035. // "https://www.googleapis.com/auth/cloud-platform",
  45036. // "https://www.googleapis.com/auth/compute",
  45037. // "https://www.googleapis.com/auth/compute.readonly"
  45038. // ]
  45039. // }
  45040. }
  45041. // Pages invokes f for each page of results.
  45042. // A non-nil error returned from f will halt the iteration.
  45043. // The provided context supersedes any context provided to the Context method.
  45044. func (c *RoutesListCall) Pages(ctx context.Context, f func(*RouteList) error) error {
  45045. c.ctx_ = ctx
  45046. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  45047. for {
  45048. x, err := c.Do()
  45049. if err != nil {
  45050. return err
  45051. }
  45052. if err := f(x); err != nil {
  45053. return err
  45054. }
  45055. if x.NextPageToken == "" {
  45056. return nil
  45057. }
  45058. c.PageToken(x.NextPageToken)
  45059. }
  45060. }
  45061. // method id "compute.snapshots.delete":
  45062. type SnapshotsDeleteCall struct {
  45063. s *Service
  45064. project string
  45065. snapshot string
  45066. urlParams_ gensupport.URLParams
  45067. ctx_ context.Context
  45068. header_ http.Header
  45069. }
  45070. // Delete: Deletes the specified Snapshot resource. Keep in mind that
  45071. // deleting a single snapshot might not necessarily delete all the data
  45072. // on that snapshot. If any data on the snapshot that is marked for
  45073. // deletion is needed for subsequent snapshots, the data will be moved
  45074. // to the next corresponding snapshot.
  45075. //
  45076. // For more information, see Deleting snaphots.
  45077. // For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/delete
  45078. func (r *SnapshotsService) Delete(project string, snapshot string) *SnapshotsDeleteCall {
  45079. c := &SnapshotsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45080. c.project = project
  45081. c.snapshot = snapshot
  45082. return c
  45083. }
  45084. // Fields allows partial responses to be retrieved. See
  45085. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45086. // for more information.
  45087. func (c *SnapshotsDeleteCall) Fields(s ...googleapi.Field) *SnapshotsDeleteCall {
  45088. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45089. return c
  45090. }
  45091. // Context sets the context to be used in this call's Do method. Any
  45092. // pending HTTP request will be aborted if the provided context is
  45093. // canceled.
  45094. func (c *SnapshotsDeleteCall) Context(ctx context.Context) *SnapshotsDeleteCall {
  45095. c.ctx_ = ctx
  45096. return c
  45097. }
  45098. // Header returns an http.Header that can be modified by the caller to
  45099. // add HTTP headers to the request.
  45100. func (c *SnapshotsDeleteCall) Header() http.Header {
  45101. if c.header_ == nil {
  45102. c.header_ = make(http.Header)
  45103. }
  45104. return c.header_
  45105. }
  45106. func (c *SnapshotsDeleteCall) doRequest(alt string) (*http.Response, error) {
  45107. reqHeaders := make(http.Header)
  45108. for k, v := range c.header_ {
  45109. reqHeaders[k] = v
  45110. }
  45111. reqHeaders.Set("User-Agent", c.s.userAgent())
  45112. var body io.Reader = nil
  45113. c.urlParams_.Set("alt", alt)
  45114. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{snapshot}")
  45115. urls += "?" + c.urlParams_.Encode()
  45116. req, _ := http.NewRequest("DELETE", urls, body)
  45117. req.Header = reqHeaders
  45118. googleapi.Expand(req.URL, map[string]string{
  45119. "project": c.project,
  45120. "snapshot": c.snapshot,
  45121. })
  45122. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45123. }
  45124. // Do executes the "compute.snapshots.delete" call.
  45125. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  45126. // status code is an error. Response headers are in either
  45127. // *Operation.ServerResponse.Header or (if a response was returned at
  45128. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45129. // to check whether the returned error was because
  45130. // http.StatusNotModified was returned.
  45131. func (c *SnapshotsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  45132. gensupport.SetOptions(c.urlParams_, opts...)
  45133. res, err := c.doRequest("json")
  45134. if res != nil && res.StatusCode == http.StatusNotModified {
  45135. if res.Body != nil {
  45136. res.Body.Close()
  45137. }
  45138. return nil, &googleapi.Error{
  45139. Code: res.StatusCode,
  45140. Header: res.Header,
  45141. }
  45142. }
  45143. if err != nil {
  45144. return nil, err
  45145. }
  45146. defer googleapi.CloseBody(res)
  45147. if err := googleapi.CheckResponse(res); err != nil {
  45148. return nil, err
  45149. }
  45150. ret := &Operation{
  45151. ServerResponse: googleapi.ServerResponse{
  45152. Header: res.Header,
  45153. HTTPStatusCode: res.StatusCode,
  45154. },
  45155. }
  45156. target := &ret
  45157. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  45158. return nil, err
  45159. }
  45160. return ret, nil
  45161. // {
  45162. // "description": "Deletes the specified Snapshot resource. Keep in mind that deleting a single snapshot might not necessarily delete all the data on that snapshot. If any data on the snapshot that is marked for deletion is needed for subsequent snapshots, the data will be moved to the next corresponding snapshot.\n\nFor more information, see Deleting snaphots.",
  45163. // "httpMethod": "DELETE",
  45164. // "id": "compute.snapshots.delete",
  45165. // "parameterOrder": [
  45166. // "project",
  45167. // "snapshot"
  45168. // ],
  45169. // "parameters": {
  45170. // "project": {
  45171. // "description": "Project ID for this request.",
  45172. // "location": "path",
  45173. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45174. // "required": true,
  45175. // "type": "string"
  45176. // },
  45177. // "snapshot": {
  45178. // "description": "Name of the Snapshot resource to delete.",
  45179. // "location": "path",
  45180. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  45181. // "required": true,
  45182. // "type": "string"
  45183. // }
  45184. // },
  45185. // "path": "{project}/global/snapshots/{snapshot}",
  45186. // "response": {
  45187. // "$ref": "Operation"
  45188. // },
  45189. // "scopes": [
  45190. // "https://www.googleapis.com/auth/cloud-platform",
  45191. // "https://www.googleapis.com/auth/compute"
  45192. // ]
  45193. // }
  45194. }
  45195. // method id "compute.snapshots.get":
  45196. type SnapshotsGetCall struct {
  45197. s *Service
  45198. project string
  45199. snapshot string
  45200. urlParams_ gensupport.URLParams
  45201. ifNoneMatch_ string
  45202. ctx_ context.Context
  45203. header_ http.Header
  45204. }
  45205. // Get: Returns the specified Snapshot resource. Get a list of available
  45206. // snapshots by making a list() request.
  45207. // For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/get
  45208. func (r *SnapshotsService) Get(project string, snapshot string) *SnapshotsGetCall {
  45209. c := &SnapshotsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45210. c.project = project
  45211. c.snapshot = snapshot
  45212. return c
  45213. }
  45214. // Fields allows partial responses to be retrieved. See
  45215. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45216. // for more information.
  45217. func (c *SnapshotsGetCall) Fields(s ...googleapi.Field) *SnapshotsGetCall {
  45218. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45219. return c
  45220. }
  45221. // IfNoneMatch sets the optional parameter which makes the operation
  45222. // fail if the object's ETag matches the given value. This is useful for
  45223. // getting updates only after the object has changed since the last
  45224. // request. Use googleapi.IsNotModified to check whether the response
  45225. // error from Do is the result of In-None-Match.
  45226. func (c *SnapshotsGetCall) IfNoneMatch(entityTag string) *SnapshotsGetCall {
  45227. c.ifNoneMatch_ = entityTag
  45228. return c
  45229. }
  45230. // Context sets the context to be used in this call's Do method. Any
  45231. // pending HTTP request will be aborted if the provided context is
  45232. // canceled.
  45233. func (c *SnapshotsGetCall) Context(ctx context.Context) *SnapshotsGetCall {
  45234. c.ctx_ = ctx
  45235. return c
  45236. }
  45237. // Header returns an http.Header that can be modified by the caller to
  45238. // add HTTP headers to the request.
  45239. func (c *SnapshotsGetCall) Header() http.Header {
  45240. if c.header_ == nil {
  45241. c.header_ = make(http.Header)
  45242. }
  45243. return c.header_
  45244. }
  45245. func (c *SnapshotsGetCall) doRequest(alt string) (*http.Response, error) {
  45246. reqHeaders := make(http.Header)
  45247. for k, v := range c.header_ {
  45248. reqHeaders[k] = v
  45249. }
  45250. reqHeaders.Set("User-Agent", c.s.userAgent())
  45251. if c.ifNoneMatch_ != "" {
  45252. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  45253. }
  45254. var body io.Reader = nil
  45255. c.urlParams_.Set("alt", alt)
  45256. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{snapshot}")
  45257. urls += "?" + c.urlParams_.Encode()
  45258. req, _ := http.NewRequest("GET", urls, body)
  45259. req.Header = reqHeaders
  45260. googleapi.Expand(req.URL, map[string]string{
  45261. "project": c.project,
  45262. "snapshot": c.snapshot,
  45263. })
  45264. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45265. }
  45266. // Do executes the "compute.snapshots.get" call.
  45267. // Exactly one of *Snapshot or error will be non-nil. Any non-2xx status
  45268. // code is an error. Response headers are in either
  45269. // *Snapshot.ServerResponse.Header or (if a response was returned at
  45270. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45271. // to check whether the returned error was because
  45272. // http.StatusNotModified was returned.
  45273. func (c *SnapshotsGetCall) Do(opts ...googleapi.CallOption) (*Snapshot, error) {
  45274. gensupport.SetOptions(c.urlParams_, opts...)
  45275. res, err := c.doRequest("json")
  45276. if res != nil && res.StatusCode == http.StatusNotModified {
  45277. if res.Body != nil {
  45278. res.Body.Close()
  45279. }
  45280. return nil, &googleapi.Error{
  45281. Code: res.StatusCode,
  45282. Header: res.Header,
  45283. }
  45284. }
  45285. if err != nil {
  45286. return nil, err
  45287. }
  45288. defer googleapi.CloseBody(res)
  45289. if err := googleapi.CheckResponse(res); err != nil {
  45290. return nil, err
  45291. }
  45292. ret := &Snapshot{
  45293. ServerResponse: googleapi.ServerResponse{
  45294. Header: res.Header,
  45295. HTTPStatusCode: res.StatusCode,
  45296. },
  45297. }
  45298. target := &ret
  45299. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  45300. return nil, err
  45301. }
  45302. return ret, nil
  45303. // {
  45304. // "description": "Returns the specified Snapshot resource. Get a list of available snapshots by making a list() request.",
  45305. // "httpMethod": "GET",
  45306. // "id": "compute.snapshots.get",
  45307. // "parameterOrder": [
  45308. // "project",
  45309. // "snapshot"
  45310. // ],
  45311. // "parameters": {
  45312. // "project": {
  45313. // "description": "Project ID for this request.",
  45314. // "location": "path",
  45315. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45316. // "required": true,
  45317. // "type": "string"
  45318. // },
  45319. // "snapshot": {
  45320. // "description": "Name of the Snapshot resource to return.",
  45321. // "location": "path",
  45322. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  45323. // "required": true,
  45324. // "type": "string"
  45325. // }
  45326. // },
  45327. // "path": "{project}/global/snapshots/{snapshot}",
  45328. // "response": {
  45329. // "$ref": "Snapshot"
  45330. // },
  45331. // "scopes": [
  45332. // "https://www.googleapis.com/auth/cloud-platform",
  45333. // "https://www.googleapis.com/auth/compute",
  45334. // "https://www.googleapis.com/auth/compute.readonly"
  45335. // ]
  45336. // }
  45337. }
  45338. // method id "compute.snapshots.list":
  45339. type SnapshotsListCall struct {
  45340. s *Service
  45341. project string
  45342. urlParams_ gensupport.URLParams
  45343. ifNoneMatch_ string
  45344. ctx_ context.Context
  45345. header_ http.Header
  45346. }
  45347. // List: Retrieves the list of Snapshot resources contained within the
  45348. // specified project.
  45349. // For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/list
  45350. func (r *SnapshotsService) List(project string) *SnapshotsListCall {
  45351. c := &SnapshotsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45352. c.project = project
  45353. return c
  45354. }
  45355. // Filter sets the optional parameter "filter": Sets a filter
  45356. // {expression} for filtering listed resources. Your {expression} must
  45357. // be in the format: field_name comparison_string literal_string.
  45358. //
  45359. // The field_name is the name of the field you want to compare. Only
  45360. // atomic field types are supported (string, number, boolean). The
  45361. // comparison_string must be either eq (equals) or ne (not equals). The
  45362. // literal_string is the string value to filter to. The literal value
  45363. // must be valid for the type of field you are filtering by (string,
  45364. // number, boolean). For string fields, the literal value is interpreted
  45365. // as a regular expression using RE2 syntax. The literal value must
  45366. // match the entire field.
  45367. //
  45368. // For example, to filter for instances that do not have a name of
  45369. // example-instance, you would use name ne example-instance.
  45370. //
  45371. // You can filter on nested fields. For example, you could filter on
  45372. // instances that have set the scheduling.automaticRestart field to
  45373. // true. Use filtering on nested fields to take advantage of labels to
  45374. // organize and search for results based on label values.
  45375. //
  45376. // To filter on multiple expressions, provide each separate expression
  45377. // within parentheses. For example, (scheduling.automaticRestart eq
  45378. // true) (zone eq us-central1-f). Multiple expressions are treated as
  45379. // AND expressions, meaning that resources must match all expressions to
  45380. // pass the filters.
  45381. func (c *SnapshotsListCall) Filter(filter string) *SnapshotsListCall {
  45382. c.urlParams_.Set("filter", filter)
  45383. return c
  45384. }
  45385. // MaxResults sets the optional parameter "maxResults": The maximum
  45386. // number of results per page that should be returned. If the number of
  45387. // available results is larger than maxResults, Compute Engine returns a
  45388. // nextPageToken that can be used to get the next page of results in
  45389. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  45390. // (Default: 500)
  45391. func (c *SnapshotsListCall) MaxResults(maxResults int64) *SnapshotsListCall {
  45392. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  45393. return c
  45394. }
  45395. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  45396. // a certain order. By default, results are returned in alphanumerical
  45397. // order based on the resource name.
  45398. //
  45399. // You can also sort results in descending order based on the creation
  45400. // timestamp using orderBy="creationTimestamp desc". This sorts results
  45401. // based on the creationTimestamp field in reverse chronological order
  45402. // (newest result first). Use this to sort resources like operations so
  45403. // that the newest operation is returned first.
  45404. //
  45405. // Currently, only sorting by name or creationTimestamp desc is
  45406. // supported.
  45407. func (c *SnapshotsListCall) OrderBy(orderBy string) *SnapshotsListCall {
  45408. c.urlParams_.Set("orderBy", orderBy)
  45409. return c
  45410. }
  45411. // PageToken sets the optional parameter "pageToken": Specifies a page
  45412. // token to use. Set pageToken to the nextPageToken returned by a
  45413. // previous list request to get the next page of results.
  45414. func (c *SnapshotsListCall) PageToken(pageToken string) *SnapshotsListCall {
  45415. c.urlParams_.Set("pageToken", pageToken)
  45416. return c
  45417. }
  45418. // Fields allows partial responses to be retrieved. See
  45419. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45420. // for more information.
  45421. func (c *SnapshotsListCall) Fields(s ...googleapi.Field) *SnapshotsListCall {
  45422. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45423. return c
  45424. }
  45425. // IfNoneMatch sets the optional parameter which makes the operation
  45426. // fail if the object's ETag matches the given value. This is useful for
  45427. // getting updates only after the object has changed since the last
  45428. // request. Use googleapi.IsNotModified to check whether the response
  45429. // error from Do is the result of In-None-Match.
  45430. func (c *SnapshotsListCall) IfNoneMatch(entityTag string) *SnapshotsListCall {
  45431. c.ifNoneMatch_ = entityTag
  45432. return c
  45433. }
  45434. // Context sets the context to be used in this call's Do method. Any
  45435. // pending HTTP request will be aborted if the provided context is
  45436. // canceled.
  45437. func (c *SnapshotsListCall) Context(ctx context.Context) *SnapshotsListCall {
  45438. c.ctx_ = ctx
  45439. return c
  45440. }
  45441. // Header returns an http.Header that can be modified by the caller to
  45442. // add HTTP headers to the request.
  45443. func (c *SnapshotsListCall) Header() http.Header {
  45444. if c.header_ == nil {
  45445. c.header_ = make(http.Header)
  45446. }
  45447. return c.header_
  45448. }
  45449. func (c *SnapshotsListCall) doRequest(alt string) (*http.Response, error) {
  45450. reqHeaders := make(http.Header)
  45451. for k, v := range c.header_ {
  45452. reqHeaders[k] = v
  45453. }
  45454. reqHeaders.Set("User-Agent", c.s.userAgent())
  45455. if c.ifNoneMatch_ != "" {
  45456. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  45457. }
  45458. var body io.Reader = nil
  45459. c.urlParams_.Set("alt", alt)
  45460. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots")
  45461. urls += "?" + c.urlParams_.Encode()
  45462. req, _ := http.NewRequest("GET", urls, body)
  45463. req.Header = reqHeaders
  45464. googleapi.Expand(req.URL, map[string]string{
  45465. "project": c.project,
  45466. })
  45467. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45468. }
  45469. // Do executes the "compute.snapshots.list" call.
  45470. // Exactly one of *SnapshotList or error will be non-nil. Any non-2xx
  45471. // status code is an error. Response headers are in either
  45472. // *SnapshotList.ServerResponse.Header or (if a response was returned at
  45473. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45474. // to check whether the returned error was because
  45475. // http.StatusNotModified was returned.
  45476. func (c *SnapshotsListCall) Do(opts ...googleapi.CallOption) (*SnapshotList, error) {
  45477. gensupport.SetOptions(c.urlParams_, opts...)
  45478. res, err := c.doRequest("json")
  45479. if res != nil && res.StatusCode == http.StatusNotModified {
  45480. if res.Body != nil {
  45481. res.Body.Close()
  45482. }
  45483. return nil, &googleapi.Error{
  45484. Code: res.StatusCode,
  45485. Header: res.Header,
  45486. }
  45487. }
  45488. if err != nil {
  45489. return nil, err
  45490. }
  45491. defer googleapi.CloseBody(res)
  45492. if err := googleapi.CheckResponse(res); err != nil {
  45493. return nil, err
  45494. }
  45495. ret := &SnapshotList{
  45496. ServerResponse: googleapi.ServerResponse{
  45497. Header: res.Header,
  45498. HTTPStatusCode: res.StatusCode,
  45499. },
  45500. }
  45501. target := &ret
  45502. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  45503. return nil, err
  45504. }
  45505. return ret, nil
  45506. // {
  45507. // "description": "Retrieves the list of Snapshot resources contained within the specified project.",
  45508. // "httpMethod": "GET",
  45509. // "id": "compute.snapshots.list",
  45510. // "parameterOrder": [
  45511. // "project"
  45512. // ],
  45513. // "parameters": {
  45514. // "filter": {
  45515. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  45516. // "location": "query",
  45517. // "type": "string"
  45518. // },
  45519. // "maxResults": {
  45520. // "default": "500",
  45521. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  45522. // "format": "uint32",
  45523. // "location": "query",
  45524. // "minimum": "0",
  45525. // "type": "integer"
  45526. // },
  45527. // "orderBy": {
  45528. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  45529. // "location": "query",
  45530. // "type": "string"
  45531. // },
  45532. // "pageToken": {
  45533. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  45534. // "location": "query",
  45535. // "type": "string"
  45536. // },
  45537. // "project": {
  45538. // "description": "Project ID for this request.",
  45539. // "location": "path",
  45540. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45541. // "required": true,
  45542. // "type": "string"
  45543. // }
  45544. // },
  45545. // "path": "{project}/global/snapshots",
  45546. // "response": {
  45547. // "$ref": "SnapshotList"
  45548. // },
  45549. // "scopes": [
  45550. // "https://www.googleapis.com/auth/cloud-platform",
  45551. // "https://www.googleapis.com/auth/compute",
  45552. // "https://www.googleapis.com/auth/compute.readonly"
  45553. // ]
  45554. // }
  45555. }
  45556. // Pages invokes f for each page of results.
  45557. // A non-nil error returned from f will halt the iteration.
  45558. // The provided context supersedes any context provided to the Context method.
  45559. func (c *SnapshotsListCall) Pages(ctx context.Context, f func(*SnapshotList) error) error {
  45560. c.ctx_ = ctx
  45561. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  45562. for {
  45563. x, err := c.Do()
  45564. if err != nil {
  45565. return err
  45566. }
  45567. if err := f(x); err != nil {
  45568. return err
  45569. }
  45570. if x.NextPageToken == "" {
  45571. return nil
  45572. }
  45573. c.PageToken(x.NextPageToken)
  45574. }
  45575. }
  45576. // method id "compute.snapshots.setLabels":
  45577. type SnapshotsSetLabelsCall struct {
  45578. s *Service
  45579. project string
  45580. resource string
  45581. globalsetlabelsrequest *GlobalSetLabelsRequest
  45582. urlParams_ gensupport.URLParams
  45583. ctx_ context.Context
  45584. header_ http.Header
  45585. }
  45586. // SetLabels: Sets the labels on a snapshot. To learn more about labels,
  45587. // read the Labeling Resources documentation.
  45588. func (r *SnapshotsService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *SnapshotsSetLabelsCall {
  45589. c := &SnapshotsSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45590. c.project = project
  45591. c.resource = resource
  45592. c.globalsetlabelsrequest = globalsetlabelsrequest
  45593. return c
  45594. }
  45595. // Fields allows partial responses to be retrieved. See
  45596. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45597. // for more information.
  45598. func (c *SnapshotsSetLabelsCall) Fields(s ...googleapi.Field) *SnapshotsSetLabelsCall {
  45599. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45600. return c
  45601. }
  45602. // Context sets the context to be used in this call's Do method. Any
  45603. // pending HTTP request will be aborted if the provided context is
  45604. // canceled.
  45605. func (c *SnapshotsSetLabelsCall) Context(ctx context.Context) *SnapshotsSetLabelsCall {
  45606. c.ctx_ = ctx
  45607. return c
  45608. }
  45609. // Header returns an http.Header that can be modified by the caller to
  45610. // add HTTP headers to the request.
  45611. func (c *SnapshotsSetLabelsCall) Header() http.Header {
  45612. if c.header_ == nil {
  45613. c.header_ = make(http.Header)
  45614. }
  45615. return c.header_
  45616. }
  45617. func (c *SnapshotsSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  45618. reqHeaders := make(http.Header)
  45619. for k, v := range c.header_ {
  45620. reqHeaders[k] = v
  45621. }
  45622. reqHeaders.Set("User-Agent", c.s.userAgent())
  45623. var body io.Reader = nil
  45624. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  45625. if err != nil {
  45626. return nil, err
  45627. }
  45628. reqHeaders.Set("Content-Type", "application/json")
  45629. c.urlParams_.Set("alt", alt)
  45630. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{resource}/setLabels")
  45631. urls += "?" + c.urlParams_.Encode()
  45632. req, _ := http.NewRequest("POST", urls, body)
  45633. req.Header = reqHeaders
  45634. googleapi.Expand(req.URL, map[string]string{
  45635. "project": c.project,
  45636. "resource": c.resource,
  45637. })
  45638. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45639. }
  45640. // Do executes the "compute.snapshots.setLabels" call.
  45641. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  45642. // status code is an error. Response headers are in either
  45643. // *Operation.ServerResponse.Header or (if a response was returned at
  45644. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45645. // to check whether the returned error was because
  45646. // http.StatusNotModified was returned.
  45647. func (c *SnapshotsSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  45648. gensupport.SetOptions(c.urlParams_, opts...)
  45649. res, err := c.doRequest("json")
  45650. if res != nil && res.StatusCode == http.StatusNotModified {
  45651. if res.Body != nil {
  45652. res.Body.Close()
  45653. }
  45654. return nil, &googleapi.Error{
  45655. Code: res.StatusCode,
  45656. Header: res.Header,
  45657. }
  45658. }
  45659. if err != nil {
  45660. return nil, err
  45661. }
  45662. defer googleapi.CloseBody(res)
  45663. if err := googleapi.CheckResponse(res); err != nil {
  45664. return nil, err
  45665. }
  45666. ret := &Operation{
  45667. ServerResponse: googleapi.ServerResponse{
  45668. Header: res.Header,
  45669. HTTPStatusCode: res.StatusCode,
  45670. },
  45671. }
  45672. target := &ret
  45673. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  45674. return nil, err
  45675. }
  45676. return ret, nil
  45677. // {
  45678. // "description": "Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation.",
  45679. // "httpMethod": "POST",
  45680. // "id": "compute.snapshots.setLabels",
  45681. // "parameterOrder": [
  45682. // "project",
  45683. // "resource"
  45684. // ],
  45685. // "parameters": {
  45686. // "project": {
  45687. // "description": "Project ID for this request.",
  45688. // "location": "path",
  45689. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45690. // "required": true,
  45691. // "type": "string"
  45692. // },
  45693. // "resource": {
  45694. // "description": "Name of the resource for this request.",
  45695. // "location": "path",
  45696. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?",
  45697. // "required": true,
  45698. // "type": "string"
  45699. // }
  45700. // },
  45701. // "path": "{project}/global/snapshots/{resource}/setLabels",
  45702. // "request": {
  45703. // "$ref": "GlobalSetLabelsRequest"
  45704. // },
  45705. // "response": {
  45706. // "$ref": "Operation"
  45707. // },
  45708. // "scopes": [
  45709. // "https://www.googleapis.com/auth/cloud-platform",
  45710. // "https://www.googleapis.com/auth/compute"
  45711. // ]
  45712. // }
  45713. }
  45714. // method id "compute.sslCertificates.delete":
  45715. type SslCertificatesDeleteCall struct {
  45716. s *Service
  45717. project string
  45718. sslCertificate string
  45719. urlParams_ gensupport.URLParams
  45720. ctx_ context.Context
  45721. header_ http.Header
  45722. }
  45723. // Delete: Deletes the specified SslCertificate resource.
  45724. func (r *SslCertificatesService) Delete(project string, sslCertificate string) *SslCertificatesDeleteCall {
  45725. c := &SslCertificatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45726. c.project = project
  45727. c.sslCertificate = sslCertificate
  45728. return c
  45729. }
  45730. // Fields allows partial responses to be retrieved. See
  45731. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45732. // for more information.
  45733. func (c *SslCertificatesDeleteCall) Fields(s ...googleapi.Field) *SslCertificatesDeleteCall {
  45734. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45735. return c
  45736. }
  45737. // Context sets the context to be used in this call's Do method. Any
  45738. // pending HTTP request will be aborted if the provided context is
  45739. // canceled.
  45740. func (c *SslCertificatesDeleteCall) Context(ctx context.Context) *SslCertificatesDeleteCall {
  45741. c.ctx_ = ctx
  45742. return c
  45743. }
  45744. // Header returns an http.Header that can be modified by the caller to
  45745. // add HTTP headers to the request.
  45746. func (c *SslCertificatesDeleteCall) Header() http.Header {
  45747. if c.header_ == nil {
  45748. c.header_ = make(http.Header)
  45749. }
  45750. return c.header_
  45751. }
  45752. func (c *SslCertificatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  45753. reqHeaders := make(http.Header)
  45754. for k, v := range c.header_ {
  45755. reqHeaders[k] = v
  45756. }
  45757. reqHeaders.Set("User-Agent", c.s.userAgent())
  45758. var body io.Reader = nil
  45759. c.urlParams_.Set("alt", alt)
  45760. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates/{sslCertificate}")
  45761. urls += "?" + c.urlParams_.Encode()
  45762. req, _ := http.NewRequest("DELETE", urls, body)
  45763. req.Header = reqHeaders
  45764. googleapi.Expand(req.URL, map[string]string{
  45765. "project": c.project,
  45766. "sslCertificate": c.sslCertificate,
  45767. })
  45768. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45769. }
  45770. // Do executes the "compute.sslCertificates.delete" call.
  45771. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  45772. // status code is an error. Response headers are in either
  45773. // *Operation.ServerResponse.Header or (if a response was returned at
  45774. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45775. // to check whether the returned error was because
  45776. // http.StatusNotModified was returned.
  45777. func (c *SslCertificatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  45778. gensupport.SetOptions(c.urlParams_, opts...)
  45779. res, err := c.doRequest("json")
  45780. if res != nil && res.StatusCode == http.StatusNotModified {
  45781. if res.Body != nil {
  45782. res.Body.Close()
  45783. }
  45784. return nil, &googleapi.Error{
  45785. Code: res.StatusCode,
  45786. Header: res.Header,
  45787. }
  45788. }
  45789. if err != nil {
  45790. return nil, err
  45791. }
  45792. defer googleapi.CloseBody(res)
  45793. if err := googleapi.CheckResponse(res); err != nil {
  45794. return nil, err
  45795. }
  45796. ret := &Operation{
  45797. ServerResponse: googleapi.ServerResponse{
  45798. Header: res.Header,
  45799. HTTPStatusCode: res.StatusCode,
  45800. },
  45801. }
  45802. target := &ret
  45803. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  45804. return nil, err
  45805. }
  45806. return ret, nil
  45807. // {
  45808. // "description": "Deletes the specified SslCertificate resource.",
  45809. // "httpMethod": "DELETE",
  45810. // "id": "compute.sslCertificates.delete",
  45811. // "parameterOrder": [
  45812. // "project",
  45813. // "sslCertificate"
  45814. // ],
  45815. // "parameters": {
  45816. // "project": {
  45817. // "description": "Project ID for this request.",
  45818. // "location": "path",
  45819. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45820. // "required": true,
  45821. // "type": "string"
  45822. // },
  45823. // "sslCertificate": {
  45824. // "description": "Name of the SslCertificate resource to delete.",
  45825. // "location": "path",
  45826. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  45827. // "required": true,
  45828. // "type": "string"
  45829. // }
  45830. // },
  45831. // "path": "{project}/global/sslCertificates/{sslCertificate}",
  45832. // "response": {
  45833. // "$ref": "Operation"
  45834. // },
  45835. // "scopes": [
  45836. // "https://www.googleapis.com/auth/cloud-platform",
  45837. // "https://www.googleapis.com/auth/compute"
  45838. // ]
  45839. // }
  45840. }
  45841. // method id "compute.sslCertificates.get":
  45842. type SslCertificatesGetCall struct {
  45843. s *Service
  45844. project string
  45845. sslCertificate string
  45846. urlParams_ gensupport.URLParams
  45847. ifNoneMatch_ string
  45848. ctx_ context.Context
  45849. header_ http.Header
  45850. }
  45851. // Get: Returns the specified SslCertificate resource. Get a list of
  45852. // available SSL certificates by making a list() request.
  45853. func (r *SslCertificatesService) Get(project string, sslCertificate string) *SslCertificatesGetCall {
  45854. c := &SslCertificatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45855. c.project = project
  45856. c.sslCertificate = sslCertificate
  45857. return c
  45858. }
  45859. // Fields allows partial responses to be retrieved. See
  45860. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45861. // for more information.
  45862. func (c *SslCertificatesGetCall) Fields(s ...googleapi.Field) *SslCertificatesGetCall {
  45863. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45864. return c
  45865. }
  45866. // IfNoneMatch sets the optional parameter which makes the operation
  45867. // fail if the object's ETag matches the given value. This is useful for
  45868. // getting updates only after the object has changed since the last
  45869. // request. Use googleapi.IsNotModified to check whether the response
  45870. // error from Do is the result of In-None-Match.
  45871. func (c *SslCertificatesGetCall) IfNoneMatch(entityTag string) *SslCertificatesGetCall {
  45872. c.ifNoneMatch_ = entityTag
  45873. return c
  45874. }
  45875. // Context sets the context to be used in this call's Do method. Any
  45876. // pending HTTP request will be aborted if the provided context is
  45877. // canceled.
  45878. func (c *SslCertificatesGetCall) Context(ctx context.Context) *SslCertificatesGetCall {
  45879. c.ctx_ = ctx
  45880. return c
  45881. }
  45882. // Header returns an http.Header that can be modified by the caller to
  45883. // add HTTP headers to the request.
  45884. func (c *SslCertificatesGetCall) Header() http.Header {
  45885. if c.header_ == nil {
  45886. c.header_ = make(http.Header)
  45887. }
  45888. return c.header_
  45889. }
  45890. func (c *SslCertificatesGetCall) doRequest(alt string) (*http.Response, error) {
  45891. reqHeaders := make(http.Header)
  45892. for k, v := range c.header_ {
  45893. reqHeaders[k] = v
  45894. }
  45895. reqHeaders.Set("User-Agent", c.s.userAgent())
  45896. if c.ifNoneMatch_ != "" {
  45897. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  45898. }
  45899. var body io.Reader = nil
  45900. c.urlParams_.Set("alt", alt)
  45901. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates/{sslCertificate}")
  45902. urls += "?" + c.urlParams_.Encode()
  45903. req, _ := http.NewRequest("GET", urls, body)
  45904. req.Header = reqHeaders
  45905. googleapi.Expand(req.URL, map[string]string{
  45906. "project": c.project,
  45907. "sslCertificate": c.sslCertificate,
  45908. })
  45909. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45910. }
  45911. // Do executes the "compute.sslCertificates.get" call.
  45912. // Exactly one of *SslCertificate or error will be non-nil. Any non-2xx
  45913. // status code is an error. Response headers are in either
  45914. // *SslCertificate.ServerResponse.Header or (if a response was returned
  45915. // at all) in error.(*googleapi.Error).Header. Use
  45916. // googleapi.IsNotModified to check whether the returned error was
  45917. // because http.StatusNotModified was returned.
  45918. func (c *SslCertificatesGetCall) Do(opts ...googleapi.CallOption) (*SslCertificate, error) {
  45919. gensupport.SetOptions(c.urlParams_, opts...)
  45920. res, err := c.doRequest("json")
  45921. if res != nil && res.StatusCode == http.StatusNotModified {
  45922. if res.Body != nil {
  45923. res.Body.Close()
  45924. }
  45925. return nil, &googleapi.Error{
  45926. Code: res.StatusCode,
  45927. Header: res.Header,
  45928. }
  45929. }
  45930. if err != nil {
  45931. return nil, err
  45932. }
  45933. defer googleapi.CloseBody(res)
  45934. if err := googleapi.CheckResponse(res); err != nil {
  45935. return nil, err
  45936. }
  45937. ret := &SslCertificate{
  45938. ServerResponse: googleapi.ServerResponse{
  45939. Header: res.Header,
  45940. HTTPStatusCode: res.StatusCode,
  45941. },
  45942. }
  45943. target := &ret
  45944. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  45945. return nil, err
  45946. }
  45947. return ret, nil
  45948. // {
  45949. // "description": "Returns the specified SslCertificate resource. Get a list of available SSL certificates by making a list() request.",
  45950. // "httpMethod": "GET",
  45951. // "id": "compute.sslCertificates.get",
  45952. // "parameterOrder": [
  45953. // "project",
  45954. // "sslCertificate"
  45955. // ],
  45956. // "parameters": {
  45957. // "project": {
  45958. // "description": "Project ID for this request.",
  45959. // "location": "path",
  45960. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45961. // "required": true,
  45962. // "type": "string"
  45963. // },
  45964. // "sslCertificate": {
  45965. // "description": "Name of the SslCertificate resource to return.",
  45966. // "location": "path",
  45967. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  45968. // "required": true,
  45969. // "type": "string"
  45970. // }
  45971. // },
  45972. // "path": "{project}/global/sslCertificates/{sslCertificate}",
  45973. // "response": {
  45974. // "$ref": "SslCertificate"
  45975. // },
  45976. // "scopes": [
  45977. // "https://www.googleapis.com/auth/cloud-platform",
  45978. // "https://www.googleapis.com/auth/compute",
  45979. // "https://www.googleapis.com/auth/compute.readonly"
  45980. // ]
  45981. // }
  45982. }
  45983. // method id "compute.sslCertificates.insert":
  45984. type SslCertificatesInsertCall struct {
  45985. s *Service
  45986. project string
  45987. sslcertificate *SslCertificate
  45988. urlParams_ gensupport.URLParams
  45989. ctx_ context.Context
  45990. header_ http.Header
  45991. }
  45992. // Insert: Creates a SslCertificate resource in the specified project
  45993. // using the data included in the request.
  45994. func (r *SslCertificatesService) Insert(project string, sslcertificate *SslCertificate) *SslCertificatesInsertCall {
  45995. c := &SslCertificatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45996. c.project = project
  45997. c.sslcertificate = sslcertificate
  45998. return c
  45999. }
  46000. // Fields allows partial responses to be retrieved. See
  46001. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46002. // for more information.
  46003. func (c *SslCertificatesInsertCall) Fields(s ...googleapi.Field) *SslCertificatesInsertCall {
  46004. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46005. return c
  46006. }
  46007. // Context sets the context to be used in this call's Do method. Any
  46008. // pending HTTP request will be aborted if the provided context is
  46009. // canceled.
  46010. func (c *SslCertificatesInsertCall) Context(ctx context.Context) *SslCertificatesInsertCall {
  46011. c.ctx_ = ctx
  46012. return c
  46013. }
  46014. // Header returns an http.Header that can be modified by the caller to
  46015. // add HTTP headers to the request.
  46016. func (c *SslCertificatesInsertCall) Header() http.Header {
  46017. if c.header_ == nil {
  46018. c.header_ = make(http.Header)
  46019. }
  46020. return c.header_
  46021. }
  46022. func (c *SslCertificatesInsertCall) doRequest(alt string) (*http.Response, error) {
  46023. reqHeaders := make(http.Header)
  46024. for k, v := range c.header_ {
  46025. reqHeaders[k] = v
  46026. }
  46027. reqHeaders.Set("User-Agent", c.s.userAgent())
  46028. var body io.Reader = nil
  46029. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertificate)
  46030. if err != nil {
  46031. return nil, err
  46032. }
  46033. reqHeaders.Set("Content-Type", "application/json")
  46034. c.urlParams_.Set("alt", alt)
  46035. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates")
  46036. urls += "?" + c.urlParams_.Encode()
  46037. req, _ := http.NewRequest("POST", urls, body)
  46038. req.Header = reqHeaders
  46039. googleapi.Expand(req.URL, map[string]string{
  46040. "project": c.project,
  46041. })
  46042. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46043. }
  46044. // Do executes the "compute.sslCertificates.insert" call.
  46045. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  46046. // status code is an error. Response headers are in either
  46047. // *Operation.ServerResponse.Header or (if a response was returned at
  46048. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46049. // to check whether the returned error was because
  46050. // http.StatusNotModified was returned.
  46051. func (c *SslCertificatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  46052. gensupport.SetOptions(c.urlParams_, opts...)
  46053. res, err := c.doRequest("json")
  46054. if res != nil && res.StatusCode == http.StatusNotModified {
  46055. if res.Body != nil {
  46056. res.Body.Close()
  46057. }
  46058. return nil, &googleapi.Error{
  46059. Code: res.StatusCode,
  46060. Header: res.Header,
  46061. }
  46062. }
  46063. if err != nil {
  46064. return nil, err
  46065. }
  46066. defer googleapi.CloseBody(res)
  46067. if err := googleapi.CheckResponse(res); err != nil {
  46068. return nil, err
  46069. }
  46070. ret := &Operation{
  46071. ServerResponse: googleapi.ServerResponse{
  46072. Header: res.Header,
  46073. HTTPStatusCode: res.StatusCode,
  46074. },
  46075. }
  46076. target := &ret
  46077. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  46078. return nil, err
  46079. }
  46080. return ret, nil
  46081. // {
  46082. // "description": "Creates a SslCertificate resource in the specified project using the data included in the request.",
  46083. // "httpMethod": "POST",
  46084. // "id": "compute.sslCertificates.insert",
  46085. // "parameterOrder": [
  46086. // "project"
  46087. // ],
  46088. // "parameters": {
  46089. // "project": {
  46090. // "description": "Project ID for this request.",
  46091. // "location": "path",
  46092. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46093. // "required": true,
  46094. // "type": "string"
  46095. // }
  46096. // },
  46097. // "path": "{project}/global/sslCertificates",
  46098. // "request": {
  46099. // "$ref": "SslCertificate"
  46100. // },
  46101. // "response": {
  46102. // "$ref": "Operation"
  46103. // },
  46104. // "scopes": [
  46105. // "https://www.googleapis.com/auth/cloud-platform",
  46106. // "https://www.googleapis.com/auth/compute"
  46107. // ]
  46108. // }
  46109. }
  46110. // method id "compute.sslCertificates.list":
  46111. type SslCertificatesListCall struct {
  46112. s *Service
  46113. project string
  46114. urlParams_ gensupport.URLParams
  46115. ifNoneMatch_ string
  46116. ctx_ context.Context
  46117. header_ http.Header
  46118. }
  46119. // List: Retrieves the list of SslCertificate resources available to the
  46120. // specified project.
  46121. func (r *SslCertificatesService) List(project string) *SslCertificatesListCall {
  46122. c := &SslCertificatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46123. c.project = project
  46124. return c
  46125. }
  46126. // Filter sets the optional parameter "filter": Sets a filter
  46127. // {expression} for filtering listed resources. Your {expression} must
  46128. // be in the format: field_name comparison_string literal_string.
  46129. //
  46130. // The field_name is the name of the field you want to compare. Only
  46131. // atomic field types are supported (string, number, boolean). The
  46132. // comparison_string must be either eq (equals) or ne (not equals). The
  46133. // literal_string is the string value to filter to. The literal value
  46134. // must be valid for the type of field you are filtering by (string,
  46135. // number, boolean). For string fields, the literal value is interpreted
  46136. // as a regular expression using RE2 syntax. The literal value must
  46137. // match the entire field.
  46138. //
  46139. // For example, to filter for instances that do not have a name of
  46140. // example-instance, you would use name ne example-instance.
  46141. //
  46142. // You can filter on nested fields. For example, you could filter on
  46143. // instances that have set the scheduling.automaticRestart field to
  46144. // true. Use filtering on nested fields to take advantage of labels to
  46145. // organize and search for results based on label values.
  46146. //
  46147. // To filter on multiple expressions, provide each separate expression
  46148. // within parentheses. For example, (scheduling.automaticRestart eq
  46149. // true) (zone eq us-central1-f). Multiple expressions are treated as
  46150. // AND expressions, meaning that resources must match all expressions to
  46151. // pass the filters.
  46152. func (c *SslCertificatesListCall) Filter(filter string) *SslCertificatesListCall {
  46153. c.urlParams_.Set("filter", filter)
  46154. return c
  46155. }
  46156. // MaxResults sets the optional parameter "maxResults": The maximum
  46157. // number of results per page that should be returned. If the number of
  46158. // available results is larger than maxResults, Compute Engine returns a
  46159. // nextPageToken that can be used to get the next page of results in
  46160. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  46161. // (Default: 500)
  46162. func (c *SslCertificatesListCall) MaxResults(maxResults int64) *SslCertificatesListCall {
  46163. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  46164. return c
  46165. }
  46166. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  46167. // a certain order. By default, results are returned in alphanumerical
  46168. // order based on the resource name.
  46169. //
  46170. // You can also sort results in descending order based on the creation
  46171. // timestamp using orderBy="creationTimestamp desc". This sorts results
  46172. // based on the creationTimestamp field in reverse chronological order
  46173. // (newest result first). Use this to sort resources like operations so
  46174. // that the newest operation is returned first.
  46175. //
  46176. // Currently, only sorting by name or creationTimestamp desc is
  46177. // supported.
  46178. func (c *SslCertificatesListCall) OrderBy(orderBy string) *SslCertificatesListCall {
  46179. c.urlParams_.Set("orderBy", orderBy)
  46180. return c
  46181. }
  46182. // PageToken sets the optional parameter "pageToken": Specifies a page
  46183. // token to use. Set pageToken to the nextPageToken returned by a
  46184. // previous list request to get the next page of results.
  46185. func (c *SslCertificatesListCall) PageToken(pageToken string) *SslCertificatesListCall {
  46186. c.urlParams_.Set("pageToken", pageToken)
  46187. return c
  46188. }
  46189. // Fields allows partial responses to be retrieved. See
  46190. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46191. // for more information.
  46192. func (c *SslCertificatesListCall) Fields(s ...googleapi.Field) *SslCertificatesListCall {
  46193. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46194. return c
  46195. }
  46196. // IfNoneMatch sets the optional parameter which makes the operation
  46197. // fail if the object's ETag matches the given value. This is useful for
  46198. // getting updates only after the object has changed since the last
  46199. // request. Use googleapi.IsNotModified to check whether the response
  46200. // error from Do is the result of In-None-Match.
  46201. func (c *SslCertificatesListCall) IfNoneMatch(entityTag string) *SslCertificatesListCall {
  46202. c.ifNoneMatch_ = entityTag
  46203. return c
  46204. }
  46205. // Context sets the context to be used in this call's Do method. Any
  46206. // pending HTTP request will be aborted if the provided context is
  46207. // canceled.
  46208. func (c *SslCertificatesListCall) Context(ctx context.Context) *SslCertificatesListCall {
  46209. c.ctx_ = ctx
  46210. return c
  46211. }
  46212. // Header returns an http.Header that can be modified by the caller to
  46213. // add HTTP headers to the request.
  46214. func (c *SslCertificatesListCall) Header() http.Header {
  46215. if c.header_ == nil {
  46216. c.header_ = make(http.Header)
  46217. }
  46218. return c.header_
  46219. }
  46220. func (c *SslCertificatesListCall) doRequest(alt string) (*http.Response, error) {
  46221. reqHeaders := make(http.Header)
  46222. for k, v := range c.header_ {
  46223. reqHeaders[k] = v
  46224. }
  46225. reqHeaders.Set("User-Agent", c.s.userAgent())
  46226. if c.ifNoneMatch_ != "" {
  46227. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  46228. }
  46229. var body io.Reader = nil
  46230. c.urlParams_.Set("alt", alt)
  46231. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates")
  46232. urls += "?" + c.urlParams_.Encode()
  46233. req, _ := http.NewRequest("GET", urls, body)
  46234. req.Header = reqHeaders
  46235. googleapi.Expand(req.URL, map[string]string{
  46236. "project": c.project,
  46237. })
  46238. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46239. }
  46240. // Do executes the "compute.sslCertificates.list" call.
  46241. // Exactly one of *SslCertificateList or error will be non-nil. Any
  46242. // non-2xx status code is an error. Response headers are in either
  46243. // *SslCertificateList.ServerResponse.Header or (if a response was
  46244. // returned at all) in error.(*googleapi.Error).Header. Use
  46245. // googleapi.IsNotModified to check whether the returned error was
  46246. // because http.StatusNotModified was returned.
  46247. func (c *SslCertificatesListCall) Do(opts ...googleapi.CallOption) (*SslCertificateList, error) {
  46248. gensupport.SetOptions(c.urlParams_, opts...)
  46249. res, err := c.doRequest("json")
  46250. if res != nil && res.StatusCode == http.StatusNotModified {
  46251. if res.Body != nil {
  46252. res.Body.Close()
  46253. }
  46254. return nil, &googleapi.Error{
  46255. Code: res.StatusCode,
  46256. Header: res.Header,
  46257. }
  46258. }
  46259. if err != nil {
  46260. return nil, err
  46261. }
  46262. defer googleapi.CloseBody(res)
  46263. if err := googleapi.CheckResponse(res); err != nil {
  46264. return nil, err
  46265. }
  46266. ret := &SslCertificateList{
  46267. ServerResponse: googleapi.ServerResponse{
  46268. Header: res.Header,
  46269. HTTPStatusCode: res.StatusCode,
  46270. },
  46271. }
  46272. target := &ret
  46273. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  46274. return nil, err
  46275. }
  46276. return ret, nil
  46277. // {
  46278. // "description": "Retrieves the list of SslCertificate resources available to the specified project.",
  46279. // "httpMethod": "GET",
  46280. // "id": "compute.sslCertificates.list",
  46281. // "parameterOrder": [
  46282. // "project"
  46283. // ],
  46284. // "parameters": {
  46285. // "filter": {
  46286. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  46287. // "location": "query",
  46288. // "type": "string"
  46289. // },
  46290. // "maxResults": {
  46291. // "default": "500",
  46292. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  46293. // "format": "uint32",
  46294. // "location": "query",
  46295. // "minimum": "0",
  46296. // "type": "integer"
  46297. // },
  46298. // "orderBy": {
  46299. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  46300. // "location": "query",
  46301. // "type": "string"
  46302. // },
  46303. // "pageToken": {
  46304. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  46305. // "location": "query",
  46306. // "type": "string"
  46307. // },
  46308. // "project": {
  46309. // "description": "Project ID for this request.",
  46310. // "location": "path",
  46311. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46312. // "required": true,
  46313. // "type": "string"
  46314. // }
  46315. // },
  46316. // "path": "{project}/global/sslCertificates",
  46317. // "response": {
  46318. // "$ref": "SslCertificateList"
  46319. // },
  46320. // "scopes": [
  46321. // "https://www.googleapis.com/auth/cloud-platform",
  46322. // "https://www.googleapis.com/auth/compute",
  46323. // "https://www.googleapis.com/auth/compute.readonly"
  46324. // ]
  46325. // }
  46326. }
  46327. // Pages invokes f for each page of results.
  46328. // A non-nil error returned from f will halt the iteration.
  46329. // The provided context supersedes any context provided to the Context method.
  46330. func (c *SslCertificatesListCall) Pages(ctx context.Context, f func(*SslCertificateList) error) error {
  46331. c.ctx_ = ctx
  46332. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  46333. for {
  46334. x, err := c.Do()
  46335. if err != nil {
  46336. return err
  46337. }
  46338. if err := f(x); err != nil {
  46339. return err
  46340. }
  46341. if x.NextPageToken == "" {
  46342. return nil
  46343. }
  46344. c.PageToken(x.NextPageToken)
  46345. }
  46346. }
  46347. // method id "compute.subnetworks.aggregatedList":
  46348. type SubnetworksAggregatedListCall struct {
  46349. s *Service
  46350. project string
  46351. urlParams_ gensupport.URLParams
  46352. ifNoneMatch_ string
  46353. ctx_ context.Context
  46354. header_ http.Header
  46355. }
  46356. // AggregatedList: Retrieves an aggregated list of subnetworks.
  46357. func (r *SubnetworksService) AggregatedList(project string) *SubnetworksAggregatedListCall {
  46358. c := &SubnetworksAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46359. c.project = project
  46360. return c
  46361. }
  46362. // Filter sets the optional parameter "filter": Sets a filter
  46363. // {expression} for filtering listed resources. Your {expression} must
  46364. // be in the format: field_name comparison_string literal_string.
  46365. //
  46366. // The field_name is the name of the field you want to compare. Only
  46367. // atomic field types are supported (string, number, boolean). The
  46368. // comparison_string must be either eq (equals) or ne (not equals). The
  46369. // literal_string is the string value to filter to. The literal value
  46370. // must be valid for the type of field you are filtering by (string,
  46371. // number, boolean). For string fields, the literal value is interpreted
  46372. // as a regular expression using RE2 syntax. The literal value must
  46373. // match the entire field.
  46374. //
  46375. // For example, to filter for instances that do not have a name of
  46376. // example-instance, you would use name ne example-instance.
  46377. //
  46378. // You can filter on nested fields. For example, you could filter on
  46379. // instances that have set the scheduling.automaticRestart field to
  46380. // true. Use filtering on nested fields to take advantage of labels to
  46381. // organize and search for results based on label values.
  46382. //
  46383. // To filter on multiple expressions, provide each separate expression
  46384. // within parentheses. For example, (scheduling.automaticRestart eq
  46385. // true) (zone eq us-central1-f). Multiple expressions are treated as
  46386. // AND expressions, meaning that resources must match all expressions to
  46387. // pass the filters.
  46388. func (c *SubnetworksAggregatedListCall) Filter(filter string) *SubnetworksAggregatedListCall {
  46389. c.urlParams_.Set("filter", filter)
  46390. return c
  46391. }
  46392. // MaxResults sets the optional parameter "maxResults": The maximum
  46393. // number of results per page that should be returned. If the number of
  46394. // available results is larger than maxResults, Compute Engine returns a
  46395. // nextPageToken that can be used to get the next page of results in
  46396. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  46397. // (Default: 500)
  46398. func (c *SubnetworksAggregatedListCall) MaxResults(maxResults int64) *SubnetworksAggregatedListCall {
  46399. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  46400. return c
  46401. }
  46402. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  46403. // a certain order. By default, results are returned in alphanumerical
  46404. // order based on the resource name.
  46405. //
  46406. // You can also sort results in descending order based on the creation
  46407. // timestamp using orderBy="creationTimestamp desc". This sorts results
  46408. // based on the creationTimestamp field in reverse chronological order
  46409. // (newest result first). Use this to sort resources like operations so
  46410. // that the newest operation is returned first.
  46411. //
  46412. // Currently, only sorting by name or creationTimestamp desc is
  46413. // supported.
  46414. func (c *SubnetworksAggregatedListCall) OrderBy(orderBy string) *SubnetworksAggregatedListCall {
  46415. c.urlParams_.Set("orderBy", orderBy)
  46416. return c
  46417. }
  46418. // PageToken sets the optional parameter "pageToken": Specifies a page
  46419. // token to use. Set pageToken to the nextPageToken returned by a
  46420. // previous list request to get the next page of results.
  46421. func (c *SubnetworksAggregatedListCall) PageToken(pageToken string) *SubnetworksAggregatedListCall {
  46422. c.urlParams_.Set("pageToken", pageToken)
  46423. return c
  46424. }
  46425. // Fields allows partial responses to be retrieved. See
  46426. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46427. // for more information.
  46428. func (c *SubnetworksAggregatedListCall) Fields(s ...googleapi.Field) *SubnetworksAggregatedListCall {
  46429. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46430. return c
  46431. }
  46432. // IfNoneMatch sets the optional parameter which makes the operation
  46433. // fail if the object's ETag matches the given value. This is useful for
  46434. // getting updates only after the object has changed since the last
  46435. // request. Use googleapi.IsNotModified to check whether the response
  46436. // error from Do is the result of In-None-Match.
  46437. func (c *SubnetworksAggregatedListCall) IfNoneMatch(entityTag string) *SubnetworksAggregatedListCall {
  46438. c.ifNoneMatch_ = entityTag
  46439. return c
  46440. }
  46441. // Context sets the context to be used in this call's Do method. Any
  46442. // pending HTTP request will be aborted if the provided context is
  46443. // canceled.
  46444. func (c *SubnetworksAggregatedListCall) Context(ctx context.Context) *SubnetworksAggregatedListCall {
  46445. c.ctx_ = ctx
  46446. return c
  46447. }
  46448. // Header returns an http.Header that can be modified by the caller to
  46449. // add HTTP headers to the request.
  46450. func (c *SubnetworksAggregatedListCall) Header() http.Header {
  46451. if c.header_ == nil {
  46452. c.header_ = make(http.Header)
  46453. }
  46454. return c.header_
  46455. }
  46456. func (c *SubnetworksAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  46457. reqHeaders := make(http.Header)
  46458. for k, v := range c.header_ {
  46459. reqHeaders[k] = v
  46460. }
  46461. reqHeaders.Set("User-Agent", c.s.userAgent())
  46462. if c.ifNoneMatch_ != "" {
  46463. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  46464. }
  46465. var body io.Reader = nil
  46466. c.urlParams_.Set("alt", alt)
  46467. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/subnetworks")
  46468. urls += "?" + c.urlParams_.Encode()
  46469. req, _ := http.NewRequest("GET", urls, body)
  46470. req.Header = reqHeaders
  46471. googleapi.Expand(req.URL, map[string]string{
  46472. "project": c.project,
  46473. })
  46474. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46475. }
  46476. // Do executes the "compute.subnetworks.aggregatedList" call.
  46477. // Exactly one of *SubnetworkAggregatedList or error will be non-nil.
  46478. // Any non-2xx status code is an error. Response headers are in either
  46479. // *SubnetworkAggregatedList.ServerResponse.Header or (if a response was
  46480. // returned at all) in error.(*googleapi.Error).Header. Use
  46481. // googleapi.IsNotModified to check whether the returned error was
  46482. // because http.StatusNotModified was returned.
  46483. func (c *SubnetworksAggregatedListCall) Do(opts ...googleapi.CallOption) (*SubnetworkAggregatedList, error) {
  46484. gensupport.SetOptions(c.urlParams_, opts...)
  46485. res, err := c.doRequest("json")
  46486. if res != nil && res.StatusCode == http.StatusNotModified {
  46487. if res.Body != nil {
  46488. res.Body.Close()
  46489. }
  46490. return nil, &googleapi.Error{
  46491. Code: res.StatusCode,
  46492. Header: res.Header,
  46493. }
  46494. }
  46495. if err != nil {
  46496. return nil, err
  46497. }
  46498. defer googleapi.CloseBody(res)
  46499. if err := googleapi.CheckResponse(res); err != nil {
  46500. return nil, err
  46501. }
  46502. ret := &SubnetworkAggregatedList{
  46503. ServerResponse: googleapi.ServerResponse{
  46504. Header: res.Header,
  46505. HTTPStatusCode: res.StatusCode,
  46506. },
  46507. }
  46508. target := &ret
  46509. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  46510. return nil, err
  46511. }
  46512. return ret, nil
  46513. // {
  46514. // "description": "Retrieves an aggregated list of subnetworks.",
  46515. // "httpMethod": "GET",
  46516. // "id": "compute.subnetworks.aggregatedList",
  46517. // "parameterOrder": [
  46518. // "project"
  46519. // ],
  46520. // "parameters": {
  46521. // "filter": {
  46522. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  46523. // "location": "query",
  46524. // "type": "string"
  46525. // },
  46526. // "maxResults": {
  46527. // "default": "500",
  46528. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  46529. // "format": "uint32",
  46530. // "location": "query",
  46531. // "minimum": "0",
  46532. // "type": "integer"
  46533. // },
  46534. // "orderBy": {
  46535. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  46536. // "location": "query",
  46537. // "type": "string"
  46538. // },
  46539. // "pageToken": {
  46540. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  46541. // "location": "query",
  46542. // "type": "string"
  46543. // },
  46544. // "project": {
  46545. // "description": "Project ID for this request.",
  46546. // "location": "path",
  46547. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46548. // "required": true,
  46549. // "type": "string"
  46550. // }
  46551. // },
  46552. // "path": "{project}/aggregated/subnetworks",
  46553. // "response": {
  46554. // "$ref": "SubnetworkAggregatedList"
  46555. // },
  46556. // "scopes": [
  46557. // "https://www.googleapis.com/auth/cloud-platform",
  46558. // "https://www.googleapis.com/auth/compute",
  46559. // "https://www.googleapis.com/auth/compute.readonly"
  46560. // ]
  46561. // }
  46562. }
  46563. // Pages invokes f for each page of results.
  46564. // A non-nil error returned from f will halt the iteration.
  46565. // The provided context supersedes any context provided to the Context method.
  46566. func (c *SubnetworksAggregatedListCall) Pages(ctx context.Context, f func(*SubnetworkAggregatedList) error) error {
  46567. c.ctx_ = ctx
  46568. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  46569. for {
  46570. x, err := c.Do()
  46571. if err != nil {
  46572. return err
  46573. }
  46574. if err := f(x); err != nil {
  46575. return err
  46576. }
  46577. if x.NextPageToken == "" {
  46578. return nil
  46579. }
  46580. c.PageToken(x.NextPageToken)
  46581. }
  46582. }
  46583. // method id "compute.subnetworks.delete":
  46584. type SubnetworksDeleteCall struct {
  46585. s *Service
  46586. project string
  46587. region string
  46588. subnetwork string
  46589. urlParams_ gensupport.URLParams
  46590. ctx_ context.Context
  46591. header_ http.Header
  46592. }
  46593. // Delete: Deletes the specified subnetwork.
  46594. func (r *SubnetworksService) Delete(project string, region string, subnetwork string) *SubnetworksDeleteCall {
  46595. c := &SubnetworksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46596. c.project = project
  46597. c.region = region
  46598. c.subnetwork = subnetwork
  46599. return c
  46600. }
  46601. // Fields allows partial responses to be retrieved. See
  46602. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46603. // for more information.
  46604. func (c *SubnetworksDeleteCall) Fields(s ...googleapi.Field) *SubnetworksDeleteCall {
  46605. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46606. return c
  46607. }
  46608. // Context sets the context to be used in this call's Do method. Any
  46609. // pending HTTP request will be aborted if the provided context is
  46610. // canceled.
  46611. func (c *SubnetworksDeleteCall) Context(ctx context.Context) *SubnetworksDeleteCall {
  46612. c.ctx_ = ctx
  46613. return c
  46614. }
  46615. // Header returns an http.Header that can be modified by the caller to
  46616. // add HTTP headers to the request.
  46617. func (c *SubnetworksDeleteCall) Header() http.Header {
  46618. if c.header_ == nil {
  46619. c.header_ = make(http.Header)
  46620. }
  46621. return c.header_
  46622. }
  46623. func (c *SubnetworksDeleteCall) doRequest(alt string) (*http.Response, error) {
  46624. reqHeaders := make(http.Header)
  46625. for k, v := range c.header_ {
  46626. reqHeaders[k] = v
  46627. }
  46628. reqHeaders.Set("User-Agent", c.s.userAgent())
  46629. var body io.Reader = nil
  46630. c.urlParams_.Set("alt", alt)
  46631. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}")
  46632. urls += "?" + c.urlParams_.Encode()
  46633. req, _ := http.NewRequest("DELETE", urls, body)
  46634. req.Header = reqHeaders
  46635. googleapi.Expand(req.URL, map[string]string{
  46636. "project": c.project,
  46637. "region": c.region,
  46638. "subnetwork": c.subnetwork,
  46639. })
  46640. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46641. }
  46642. // Do executes the "compute.subnetworks.delete" call.
  46643. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  46644. // status code is an error. Response headers are in either
  46645. // *Operation.ServerResponse.Header or (if a response was returned at
  46646. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46647. // to check whether the returned error was because
  46648. // http.StatusNotModified was returned.
  46649. func (c *SubnetworksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  46650. gensupport.SetOptions(c.urlParams_, opts...)
  46651. res, err := c.doRequest("json")
  46652. if res != nil && res.StatusCode == http.StatusNotModified {
  46653. if res.Body != nil {
  46654. res.Body.Close()
  46655. }
  46656. return nil, &googleapi.Error{
  46657. Code: res.StatusCode,
  46658. Header: res.Header,
  46659. }
  46660. }
  46661. if err != nil {
  46662. return nil, err
  46663. }
  46664. defer googleapi.CloseBody(res)
  46665. if err := googleapi.CheckResponse(res); err != nil {
  46666. return nil, err
  46667. }
  46668. ret := &Operation{
  46669. ServerResponse: googleapi.ServerResponse{
  46670. Header: res.Header,
  46671. HTTPStatusCode: res.StatusCode,
  46672. },
  46673. }
  46674. target := &ret
  46675. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  46676. return nil, err
  46677. }
  46678. return ret, nil
  46679. // {
  46680. // "description": "Deletes the specified subnetwork.",
  46681. // "httpMethod": "DELETE",
  46682. // "id": "compute.subnetworks.delete",
  46683. // "parameterOrder": [
  46684. // "project",
  46685. // "region",
  46686. // "subnetwork"
  46687. // ],
  46688. // "parameters": {
  46689. // "project": {
  46690. // "description": "Project ID for this request.",
  46691. // "location": "path",
  46692. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46693. // "required": true,
  46694. // "type": "string"
  46695. // },
  46696. // "region": {
  46697. // "description": "Name of the region scoping this request.",
  46698. // "location": "path",
  46699. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  46700. // "required": true,
  46701. // "type": "string"
  46702. // },
  46703. // "subnetwork": {
  46704. // "description": "Name of the Subnetwork resource to delete.",
  46705. // "location": "path",
  46706. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  46707. // "required": true,
  46708. // "type": "string"
  46709. // }
  46710. // },
  46711. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}",
  46712. // "response": {
  46713. // "$ref": "Operation"
  46714. // },
  46715. // "scopes": [
  46716. // "https://www.googleapis.com/auth/cloud-platform",
  46717. // "https://www.googleapis.com/auth/compute"
  46718. // ]
  46719. // }
  46720. }
  46721. // method id "compute.subnetworks.expandIpCidrRange":
  46722. type SubnetworksExpandIpCidrRangeCall struct {
  46723. s *Service
  46724. project string
  46725. region string
  46726. subnetwork string
  46727. subnetworksexpandipcidrrangerequest *SubnetworksExpandIpCidrRangeRequest
  46728. urlParams_ gensupport.URLParams
  46729. ctx_ context.Context
  46730. header_ http.Header
  46731. }
  46732. // ExpandIpCidrRange: Expands the IP CIDR range of the subnetwork to a
  46733. // specified value.
  46734. func (r *SubnetworksService) ExpandIpCidrRange(project string, region string, subnetwork string, subnetworksexpandipcidrrangerequest *SubnetworksExpandIpCidrRangeRequest) *SubnetworksExpandIpCidrRangeCall {
  46735. c := &SubnetworksExpandIpCidrRangeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46736. c.project = project
  46737. c.region = region
  46738. c.subnetwork = subnetwork
  46739. c.subnetworksexpandipcidrrangerequest = subnetworksexpandipcidrrangerequest
  46740. return c
  46741. }
  46742. // Fields allows partial responses to be retrieved. See
  46743. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46744. // for more information.
  46745. func (c *SubnetworksExpandIpCidrRangeCall) Fields(s ...googleapi.Field) *SubnetworksExpandIpCidrRangeCall {
  46746. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46747. return c
  46748. }
  46749. // Context sets the context to be used in this call's Do method. Any
  46750. // pending HTTP request will be aborted if the provided context is
  46751. // canceled.
  46752. func (c *SubnetworksExpandIpCidrRangeCall) Context(ctx context.Context) *SubnetworksExpandIpCidrRangeCall {
  46753. c.ctx_ = ctx
  46754. return c
  46755. }
  46756. // Header returns an http.Header that can be modified by the caller to
  46757. // add HTTP headers to the request.
  46758. func (c *SubnetworksExpandIpCidrRangeCall) Header() http.Header {
  46759. if c.header_ == nil {
  46760. c.header_ = make(http.Header)
  46761. }
  46762. return c.header_
  46763. }
  46764. func (c *SubnetworksExpandIpCidrRangeCall) doRequest(alt string) (*http.Response, error) {
  46765. reqHeaders := make(http.Header)
  46766. for k, v := range c.header_ {
  46767. reqHeaders[k] = v
  46768. }
  46769. reqHeaders.Set("User-Agent", c.s.userAgent())
  46770. var body io.Reader = nil
  46771. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetworksexpandipcidrrangerequest)
  46772. if err != nil {
  46773. return nil, err
  46774. }
  46775. reqHeaders.Set("Content-Type", "application/json")
  46776. c.urlParams_.Set("alt", alt)
  46777. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange")
  46778. urls += "?" + c.urlParams_.Encode()
  46779. req, _ := http.NewRequest("POST", urls, body)
  46780. req.Header = reqHeaders
  46781. googleapi.Expand(req.URL, map[string]string{
  46782. "project": c.project,
  46783. "region": c.region,
  46784. "subnetwork": c.subnetwork,
  46785. })
  46786. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46787. }
  46788. // Do executes the "compute.subnetworks.expandIpCidrRange" call.
  46789. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  46790. // status code is an error. Response headers are in either
  46791. // *Operation.ServerResponse.Header or (if a response was returned at
  46792. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46793. // to check whether the returned error was because
  46794. // http.StatusNotModified was returned.
  46795. func (c *SubnetworksExpandIpCidrRangeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  46796. gensupport.SetOptions(c.urlParams_, opts...)
  46797. res, err := c.doRequest("json")
  46798. if res != nil && res.StatusCode == http.StatusNotModified {
  46799. if res.Body != nil {
  46800. res.Body.Close()
  46801. }
  46802. return nil, &googleapi.Error{
  46803. Code: res.StatusCode,
  46804. Header: res.Header,
  46805. }
  46806. }
  46807. if err != nil {
  46808. return nil, err
  46809. }
  46810. defer googleapi.CloseBody(res)
  46811. if err := googleapi.CheckResponse(res); err != nil {
  46812. return nil, err
  46813. }
  46814. ret := &Operation{
  46815. ServerResponse: googleapi.ServerResponse{
  46816. Header: res.Header,
  46817. HTTPStatusCode: res.StatusCode,
  46818. },
  46819. }
  46820. target := &ret
  46821. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  46822. return nil, err
  46823. }
  46824. return ret, nil
  46825. // {
  46826. // "description": "Expands the IP CIDR range of the subnetwork to a specified value.",
  46827. // "httpMethod": "POST",
  46828. // "id": "compute.subnetworks.expandIpCidrRange",
  46829. // "parameterOrder": [
  46830. // "project",
  46831. // "region",
  46832. // "subnetwork"
  46833. // ],
  46834. // "parameters": {
  46835. // "project": {
  46836. // "description": "Project ID for this request.",
  46837. // "location": "path",
  46838. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46839. // "required": true,
  46840. // "type": "string"
  46841. // },
  46842. // "region": {
  46843. // "description": "Name of the region scoping this request.",
  46844. // "location": "path",
  46845. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  46846. // "required": true,
  46847. // "type": "string"
  46848. // },
  46849. // "subnetwork": {
  46850. // "description": "Name of the Subnetwork resource to update.",
  46851. // "location": "path",
  46852. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  46853. // "required": true,
  46854. // "type": "string"
  46855. // }
  46856. // },
  46857. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange",
  46858. // "request": {
  46859. // "$ref": "SubnetworksExpandIpCidrRangeRequest"
  46860. // },
  46861. // "response": {
  46862. // "$ref": "Operation"
  46863. // },
  46864. // "scopes": [
  46865. // "https://www.googleapis.com/auth/cloud-platform",
  46866. // "https://www.googleapis.com/auth/compute"
  46867. // ]
  46868. // }
  46869. }
  46870. // method id "compute.subnetworks.get":
  46871. type SubnetworksGetCall struct {
  46872. s *Service
  46873. project string
  46874. region string
  46875. subnetwork string
  46876. urlParams_ gensupport.URLParams
  46877. ifNoneMatch_ string
  46878. ctx_ context.Context
  46879. header_ http.Header
  46880. }
  46881. // Get: Returns the specified subnetwork. Get a list of available
  46882. // subnetworks list() request.
  46883. func (r *SubnetworksService) Get(project string, region string, subnetwork string) *SubnetworksGetCall {
  46884. c := &SubnetworksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46885. c.project = project
  46886. c.region = region
  46887. c.subnetwork = subnetwork
  46888. return c
  46889. }
  46890. // Fields allows partial responses to be retrieved. See
  46891. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46892. // for more information.
  46893. func (c *SubnetworksGetCall) Fields(s ...googleapi.Field) *SubnetworksGetCall {
  46894. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46895. return c
  46896. }
  46897. // IfNoneMatch sets the optional parameter which makes the operation
  46898. // fail if the object's ETag matches the given value. This is useful for
  46899. // getting updates only after the object has changed since the last
  46900. // request. Use googleapi.IsNotModified to check whether the response
  46901. // error from Do is the result of In-None-Match.
  46902. func (c *SubnetworksGetCall) IfNoneMatch(entityTag string) *SubnetworksGetCall {
  46903. c.ifNoneMatch_ = entityTag
  46904. return c
  46905. }
  46906. // Context sets the context to be used in this call's Do method. Any
  46907. // pending HTTP request will be aborted if the provided context is
  46908. // canceled.
  46909. func (c *SubnetworksGetCall) Context(ctx context.Context) *SubnetworksGetCall {
  46910. c.ctx_ = ctx
  46911. return c
  46912. }
  46913. // Header returns an http.Header that can be modified by the caller to
  46914. // add HTTP headers to the request.
  46915. func (c *SubnetworksGetCall) Header() http.Header {
  46916. if c.header_ == nil {
  46917. c.header_ = make(http.Header)
  46918. }
  46919. return c.header_
  46920. }
  46921. func (c *SubnetworksGetCall) doRequest(alt string) (*http.Response, error) {
  46922. reqHeaders := make(http.Header)
  46923. for k, v := range c.header_ {
  46924. reqHeaders[k] = v
  46925. }
  46926. reqHeaders.Set("User-Agent", c.s.userAgent())
  46927. if c.ifNoneMatch_ != "" {
  46928. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  46929. }
  46930. var body io.Reader = nil
  46931. c.urlParams_.Set("alt", alt)
  46932. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}")
  46933. urls += "?" + c.urlParams_.Encode()
  46934. req, _ := http.NewRequest("GET", urls, body)
  46935. req.Header = reqHeaders
  46936. googleapi.Expand(req.URL, map[string]string{
  46937. "project": c.project,
  46938. "region": c.region,
  46939. "subnetwork": c.subnetwork,
  46940. })
  46941. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46942. }
  46943. // Do executes the "compute.subnetworks.get" call.
  46944. // Exactly one of *Subnetwork or error will be non-nil. Any non-2xx
  46945. // status code is an error. Response headers are in either
  46946. // *Subnetwork.ServerResponse.Header or (if a response was returned at
  46947. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46948. // to check whether the returned error was because
  46949. // http.StatusNotModified was returned.
  46950. func (c *SubnetworksGetCall) Do(opts ...googleapi.CallOption) (*Subnetwork, error) {
  46951. gensupport.SetOptions(c.urlParams_, opts...)
  46952. res, err := c.doRequest("json")
  46953. if res != nil && res.StatusCode == http.StatusNotModified {
  46954. if res.Body != nil {
  46955. res.Body.Close()
  46956. }
  46957. return nil, &googleapi.Error{
  46958. Code: res.StatusCode,
  46959. Header: res.Header,
  46960. }
  46961. }
  46962. if err != nil {
  46963. return nil, err
  46964. }
  46965. defer googleapi.CloseBody(res)
  46966. if err := googleapi.CheckResponse(res); err != nil {
  46967. return nil, err
  46968. }
  46969. ret := &Subnetwork{
  46970. ServerResponse: googleapi.ServerResponse{
  46971. Header: res.Header,
  46972. HTTPStatusCode: res.StatusCode,
  46973. },
  46974. }
  46975. target := &ret
  46976. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  46977. return nil, err
  46978. }
  46979. return ret, nil
  46980. // {
  46981. // "description": "Returns the specified subnetwork. Get a list of available subnetworks list() request.",
  46982. // "httpMethod": "GET",
  46983. // "id": "compute.subnetworks.get",
  46984. // "parameterOrder": [
  46985. // "project",
  46986. // "region",
  46987. // "subnetwork"
  46988. // ],
  46989. // "parameters": {
  46990. // "project": {
  46991. // "description": "Project ID for this request.",
  46992. // "location": "path",
  46993. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46994. // "required": true,
  46995. // "type": "string"
  46996. // },
  46997. // "region": {
  46998. // "description": "Name of the region scoping this request.",
  46999. // "location": "path",
  47000. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  47001. // "required": true,
  47002. // "type": "string"
  47003. // },
  47004. // "subnetwork": {
  47005. // "description": "Name of the Subnetwork resource to return.",
  47006. // "location": "path",
  47007. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  47008. // "required": true,
  47009. // "type": "string"
  47010. // }
  47011. // },
  47012. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}",
  47013. // "response": {
  47014. // "$ref": "Subnetwork"
  47015. // },
  47016. // "scopes": [
  47017. // "https://www.googleapis.com/auth/cloud-platform",
  47018. // "https://www.googleapis.com/auth/compute",
  47019. // "https://www.googleapis.com/auth/compute.readonly"
  47020. // ]
  47021. // }
  47022. }
  47023. // method id "compute.subnetworks.insert":
  47024. type SubnetworksInsertCall struct {
  47025. s *Service
  47026. project string
  47027. region string
  47028. subnetwork *Subnetwork
  47029. urlParams_ gensupport.URLParams
  47030. ctx_ context.Context
  47031. header_ http.Header
  47032. }
  47033. // Insert: Creates a subnetwork in the specified project using the data
  47034. // included in the request.
  47035. func (r *SubnetworksService) Insert(project string, region string, subnetwork *Subnetwork) *SubnetworksInsertCall {
  47036. c := &SubnetworksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47037. c.project = project
  47038. c.region = region
  47039. c.subnetwork = subnetwork
  47040. return c
  47041. }
  47042. // Fields allows partial responses to be retrieved. See
  47043. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47044. // for more information.
  47045. func (c *SubnetworksInsertCall) Fields(s ...googleapi.Field) *SubnetworksInsertCall {
  47046. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47047. return c
  47048. }
  47049. // Context sets the context to be used in this call's Do method. Any
  47050. // pending HTTP request will be aborted if the provided context is
  47051. // canceled.
  47052. func (c *SubnetworksInsertCall) Context(ctx context.Context) *SubnetworksInsertCall {
  47053. c.ctx_ = ctx
  47054. return c
  47055. }
  47056. // Header returns an http.Header that can be modified by the caller to
  47057. // add HTTP headers to the request.
  47058. func (c *SubnetworksInsertCall) Header() http.Header {
  47059. if c.header_ == nil {
  47060. c.header_ = make(http.Header)
  47061. }
  47062. return c.header_
  47063. }
  47064. func (c *SubnetworksInsertCall) doRequest(alt string) (*http.Response, error) {
  47065. reqHeaders := make(http.Header)
  47066. for k, v := range c.header_ {
  47067. reqHeaders[k] = v
  47068. }
  47069. reqHeaders.Set("User-Agent", c.s.userAgent())
  47070. var body io.Reader = nil
  47071. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetwork)
  47072. if err != nil {
  47073. return nil, err
  47074. }
  47075. reqHeaders.Set("Content-Type", "application/json")
  47076. c.urlParams_.Set("alt", alt)
  47077. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks")
  47078. urls += "?" + c.urlParams_.Encode()
  47079. req, _ := http.NewRequest("POST", urls, body)
  47080. req.Header = reqHeaders
  47081. googleapi.Expand(req.URL, map[string]string{
  47082. "project": c.project,
  47083. "region": c.region,
  47084. })
  47085. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47086. }
  47087. // Do executes the "compute.subnetworks.insert" call.
  47088. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  47089. // status code is an error. Response headers are in either
  47090. // *Operation.ServerResponse.Header or (if a response was returned at
  47091. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  47092. // to check whether the returned error was because
  47093. // http.StatusNotModified was returned.
  47094. func (c *SubnetworksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  47095. gensupport.SetOptions(c.urlParams_, opts...)
  47096. res, err := c.doRequest("json")
  47097. if res != nil && res.StatusCode == http.StatusNotModified {
  47098. if res.Body != nil {
  47099. res.Body.Close()
  47100. }
  47101. return nil, &googleapi.Error{
  47102. Code: res.StatusCode,
  47103. Header: res.Header,
  47104. }
  47105. }
  47106. if err != nil {
  47107. return nil, err
  47108. }
  47109. defer googleapi.CloseBody(res)
  47110. if err := googleapi.CheckResponse(res); err != nil {
  47111. return nil, err
  47112. }
  47113. ret := &Operation{
  47114. ServerResponse: googleapi.ServerResponse{
  47115. Header: res.Header,
  47116. HTTPStatusCode: res.StatusCode,
  47117. },
  47118. }
  47119. target := &ret
  47120. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  47121. return nil, err
  47122. }
  47123. return ret, nil
  47124. // {
  47125. // "description": "Creates a subnetwork in the specified project using the data included in the request.",
  47126. // "httpMethod": "POST",
  47127. // "id": "compute.subnetworks.insert",
  47128. // "parameterOrder": [
  47129. // "project",
  47130. // "region"
  47131. // ],
  47132. // "parameters": {
  47133. // "project": {
  47134. // "description": "Project ID for this request.",
  47135. // "location": "path",
  47136. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47137. // "required": true,
  47138. // "type": "string"
  47139. // },
  47140. // "region": {
  47141. // "description": "Name of the region scoping this request.",
  47142. // "location": "path",
  47143. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  47144. // "required": true,
  47145. // "type": "string"
  47146. // }
  47147. // },
  47148. // "path": "{project}/regions/{region}/subnetworks",
  47149. // "request": {
  47150. // "$ref": "Subnetwork"
  47151. // },
  47152. // "response": {
  47153. // "$ref": "Operation"
  47154. // },
  47155. // "scopes": [
  47156. // "https://www.googleapis.com/auth/cloud-platform",
  47157. // "https://www.googleapis.com/auth/compute"
  47158. // ]
  47159. // }
  47160. }
  47161. // method id "compute.subnetworks.list":
  47162. type SubnetworksListCall struct {
  47163. s *Service
  47164. project string
  47165. region string
  47166. urlParams_ gensupport.URLParams
  47167. ifNoneMatch_ string
  47168. ctx_ context.Context
  47169. header_ http.Header
  47170. }
  47171. // List: Retrieves a list of subnetworks available to the specified
  47172. // project.
  47173. func (r *SubnetworksService) List(project string, region string) *SubnetworksListCall {
  47174. c := &SubnetworksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47175. c.project = project
  47176. c.region = region
  47177. return c
  47178. }
  47179. // Filter sets the optional parameter "filter": Sets a filter
  47180. // {expression} for filtering listed resources. Your {expression} must
  47181. // be in the format: field_name comparison_string literal_string.
  47182. //
  47183. // The field_name is the name of the field you want to compare. Only
  47184. // atomic field types are supported (string, number, boolean). The
  47185. // comparison_string must be either eq (equals) or ne (not equals). The
  47186. // literal_string is the string value to filter to. The literal value
  47187. // must be valid for the type of field you are filtering by (string,
  47188. // number, boolean). For string fields, the literal value is interpreted
  47189. // as a regular expression using RE2 syntax. The literal value must
  47190. // match the entire field.
  47191. //
  47192. // For example, to filter for instances that do not have a name of
  47193. // example-instance, you would use name ne example-instance.
  47194. //
  47195. // You can filter on nested fields. For example, you could filter on
  47196. // instances that have set the scheduling.automaticRestart field to
  47197. // true. Use filtering on nested fields to take advantage of labels to
  47198. // organize and search for results based on label values.
  47199. //
  47200. // To filter on multiple expressions, provide each separate expression
  47201. // within parentheses. For example, (scheduling.automaticRestart eq
  47202. // true) (zone eq us-central1-f). Multiple expressions are treated as
  47203. // AND expressions, meaning that resources must match all expressions to
  47204. // pass the filters.
  47205. func (c *SubnetworksListCall) Filter(filter string) *SubnetworksListCall {
  47206. c.urlParams_.Set("filter", filter)
  47207. return c
  47208. }
  47209. // MaxResults sets the optional parameter "maxResults": The maximum
  47210. // number of results per page that should be returned. If the number of
  47211. // available results is larger than maxResults, Compute Engine returns a
  47212. // nextPageToken that can be used to get the next page of results in
  47213. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  47214. // (Default: 500)
  47215. func (c *SubnetworksListCall) MaxResults(maxResults int64) *SubnetworksListCall {
  47216. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  47217. return c
  47218. }
  47219. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  47220. // a certain order. By default, results are returned in alphanumerical
  47221. // order based on the resource name.
  47222. //
  47223. // You can also sort results in descending order based on the creation
  47224. // timestamp using orderBy="creationTimestamp desc". This sorts results
  47225. // based on the creationTimestamp field in reverse chronological order
  47226. // (newest result first). Use this to sort resources like operations so
  47227. // that the newest operation is returned first.
  47228. //
  47229. // Currently, only sorting by name or creationTimestamp desc is
  47230. // supported.
  47231. func (c *SubnetworksListCall) OrderBy(orderBy string) *SubnetworksListCall {
  47232. c.urlParams_.Set("orderBy", orderBy)
  47233. return c
  47234. }
  47235. // PageToken sets the optional parameter "pageToken": Specifies a page
  47236. // token to use. Set pageToken to the nextPageToken returned by a
  47237. // previous list request to get the next page of results.
  47238. func (c *SubnetworksListCall) PageToken(pageToken string) *SubnetworksListCall {
  47239. c.urlParams_.Set("pageToken", pageToken)
  47240. return c
  47241. }
  47242. // Fields allows partial responses to be retrieved. See
  47243. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47244. // for more information.
  47245. func (c *SubnetworksListCall) Fields(s ...googleapi.Field) *SubnetworksListCall {
  47246. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47247. return c
  47248. }
  47249. // IfNoneMatch sets the optional parameter which makes the operation
  47250. // fail if the object's ETag matches the given value. This is useful for
  47251. // getting updates only after the object has changed since the last
  47252. // request. Use googleapi.IsNotModified to check whether the response
  47253. // error from Do is the result of In-None-Match.
  47254. func (c *SubnetworksListCall) IfNoneMatch(entityTag string) *SubnetworksListCall {
  47255. c.ifNoneMatch_ = entityTag
  47256. return c
  47257. }
  47258. // Context sets the context to be used in this call's Do method. Any
  47259. // pending HTTP request will be aborted if the provided context is
  47260. // canceled.
  47261. func (c *SubnetworksListCall) Context(ctx context.Context) *SubnetworksListCall {
  47262. c.ctx_ = ctx
  47263. return c
  47264. }
  47265. // Header returns an http.Header that can be modified by the caller to
  47266. // add HTTP headers to the request.
  47267. func (c *SubnetworksListCall) Header() http.Header {
  47268. if c.header_ == nil {
  47269. c.header_ = make(http.Header)
  47270. }
  47271. return c.header_
  47272. }
  47273. func (c *SubnetworksListCall) doRequest(alt string) (*http.Response, error) {
  47274. reqHeaders := make(http.Header)
  47275. for k, v := range c.header_ {
  47276. reqHeaders[k] = v
  47277. }
  47278. reqHeaders.Set("User-Agent", c.s.userAgent())
  47279. if c.ifNoneMatch_ != "" {
  47280. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  47281. }
  47282. var body io.Reader = nil
  47283. c.urlParams_.Set("alt", alt)
  47284. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks")
  47285. urls += "?" + c.urlParams_.Encode()
  47286. req, _ := http.NewRequest("GET", urls, body)
  47287. req.Header = reqHeaders
  47288. googleapi.Expand(req.URL, map[string]string{
  47289. "project": c.project,
  47290. "region": c.region,
  47291. })
  47292. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47293. }
  47294. // Do executes the "compute.subnetworks.list" call.
  47295. // Exactly one of *SubnetworkList or error will be non-nil. Any non-2xx
  47296. // status code is an error. Response headers are in either
  47297. // *SubnetworkList.ServerResponse.Header or (if a response was returned
  47298. // at all) in error.(*googleapi.Error).Header. Use
  47299. // googleapi.IsNotModified to check whether the returned error was
  47300. // because http.StatusNotModified was returned.
  47301. func (c *SubnetworksListCall) Do(opts ...googleapi.CallOption) (*SubnetworkList, error) {
  47302. gensupport.SetOptions(c.urlParams_, opts...)
  47303. res, err := c.doRequest("json")
  47304. if res != nil && res.StatusCode == http.StatusNotModified {
  47305. if res.Body != nil {
  47306. res.Body.Close()
  47307. }
  47308. return nil, &googleapi.Error{
  47309. Code: res.StatusCode,
  47310. Header: res.Header,
  47311. }
  47312. }
  47313. if err != nil {
  47314. return nil, err
  47315. }
  47316. defer googleapi.CloseBody(res)
  47317. if err := googleapi.CheckResponse(res); err != nil {
  47318. return nil, err
  47319. }
  47320. ret := &SubnetworkList{
  47321. ServerResponse: googleapi.ServerResponse{
  47322. Header: res.Header,
  47323. HTTPStatusCode: res.StatusCode,
  47324. },
  47325. }
  47326. target := &ret
  47327. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  47328. return nil, err
  47329. }
  47330. return ret, nil
  47331. // {
  47332. // "description": "Retrieves a list of subnetworks available to the specified project.",
  47333. // "httpMethod": "GET",
  47334. // "id": "compute.subnetworks.list",
  47335. // "parameterOrder": [
  47336. // "project",
  47337. // "region"
  47338. // ],
  47339. // "parameters": {
  47340. // "filter": {
  47341. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  47342. // "location": "query",
  47343. // "type": "string"
  47344. // },
  47345. // "maxResults": {
  47346. // "default": "500",
  47347. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  47348. // "format": "uint32",
  47349. // "location": "query",
  47350. // "minimum": "0",
  47351. // "type": "integer"
  47352. // },
  47353. // "orderBy": {
  47354. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  47355. // "location": "query",
  47356. // "type": "string"
  47357. // },
  47358. // "pageToken": {
  47359. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  47360. // "location": "query",
  47361. // "type": "string"
  47362. // },
  47363. // "project": {
  47364. // "description": "Project ID for this request.",
  47365. // "location": "path",
  47366. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47367. // "required": true,
  47368. // "type": "string"
  47369. // },
  47370. // "region": {
  47371. // "description": "Name of the region scoping this request.",
  47372. // "location": "path",
  47373. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  47374. // "required": true,
  47375. // "type": "string"
  47376. // }
  47377. // },
  47378. // "path": "{project}/regions/{region}/subnetworks",
  47379. // "response": {
  47380. // "$ref": "SubnetworkList"
  47381. // },
  47382. // "scopes": [
  47383. // "https://www.googleapis.com/auth/cloud-platform",
  47384. // "https://www.googleapis.com/auth/compute",
  47385. // "https://www.googleapis.com/auth/compute.readonly"
  47386. // ]
  47387. // }
  47388. }
  47389. // Pages invokes f for each page of results.
  47390. // A non-nil error returned from f will halt the iteration.
  47391. // The provided context supersedes any context provided to the Context method.
  47392. func (c *SubnetworksListCall) Pages(ctx context.Context, f func(*SubnetworkList) error) error {
  47393. c.ctx_ = ctx
  47394. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  47395. for {
  47396. x, err := c.Do()
  47397. if err != nil {
  47398. return err
  47399. }
  47400. if err := f(x); err != nil {
  47401. return err
  47402. }
  47403. if x.NextPageToken == "" {
  47404. return nil
  47405. }
  47406. c.PageToken(x.NextPageToken)
  47407. }
  47408. }
  47409. // method id "compute.subnetworks.setPrivateIpGoogleAccess":
  47410. type SubnetworksSetPrivateIpGoogleAccessCall struct {
  47411. s *Service
  47412. project string
  47413. region string
  47414. subnetwork string
  47415. subnetworkssetprivateipgoogleaccessrequest *SubnetworksSetPrivateIpGoogleAccessRequest
  47416. urlParams_ gensupport.URLParams
  47417. ctx_ context.Context
  47418. header_ http.Header
  47419. }
  47420. // SetPrivateIpGoogleAccess: Set whether VMs in this subnet can access
  47421. // Google services without assigning external IP addresses through
  47422. // Private Google Access.
  47423. func (r *SubnetworksService) SetPrivateIpGoogleAccess(project string, region string, subnetwork string, subnetworkssetprivateipgoogleaccessrequest *SubnetworksSetPrivateIpGoogleAccessRequest) *SubnetworksSetPrivateIpGoogleAccessCall {
  47424. c := &SubnetworksSetPrivateIpGoogleAccessCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47425. c.project = project
  47426. c.region = region
  47427. c.subnetwork = subnetwork
  47428. c.subnetworkssetprivateipgoogleaccessrequest = subnetworkssetprivateipgoogleaccessrequest
  47429. return c
  47430. }
  47431. // Fields allows partial responses to be retrieved. See
  47432. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47433. // for more information.
  47434. func (c *SubnetworksSetPrivateIpGoogleAccessCall) Fields(s ...googleapi.Field) *SubnetworksSetPrivateIpGoogleAccessCall {
  47435. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47436. return c
  47437. }
  47438. // Context sets the context to be used in this call's Do method. Any
  47439. // pending HTTP request will be aborted if the provided context is
  47440. // canceled.
  47441. func (c *SubnetworksSetPrivateIpGoogleAccessCall) Context(ctx context.Context) *SubnetworksSetPrivateIpGoogleAccessCall {
  47442. c.ctx_ = ctx
  47443. return c
  47444. }
  47445. // Header returns an http.Header that can be modified by the caller to
  47446. // add HTTP headers to the request.
  47447. func (c *SubnetworksSetPrivateIpGoogleAccessCall) Header() http.Header {
  47448. if c.header_ == nil {
  47449. c.header_ = make(http.Header)
  47450. }
  47451. return c.header_
  47452. }
  47453. func (c *SubnetworksSetPrivateIpGoogleAccessCall) doRequest(alt string) (*http.Response, error) {
  47454. reqHeaders := make(http.Header)
  47455. for k, v := range c.header_ {
  47456. reqHeaders[k] = v
  47457. }
  47458. reqHeaders.Set("User-Agent", c.s.userAgent())
  47459. var body io.Reader = nil
  47460. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetworkssetprivateipgoogleaccessrequest)
  47461. if err != nil {
  47462. return nil, err
  47463. }
  47464. reqHeaders.Set("Content-Type", "application/json")
  47465. c.urlParams_.Set("alt", alt)
  47466. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}/setPrivateIpGoogleAccess")
  47467. urls += "?" + c.urlParams_.Encode()
  47468. req, _ := http.NewRequest("POST", urls, body)
  47469. req.Header = reqHeaders
  47470. googleapi.Expand(req.URL, map[string]string{
  47471. "project": c.project,
  47472. "region": c.region,
  47473. "subnetwork": c.subnetwork,
  47474. })
  47475. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47476. }
  47477. // Do executes the "compute.subnetworks.setPrivateIpGoogleAccess" call.
  47478. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  47479. // status code is an error. Response headers are in either
  47480. // *Operation.ServerResponse.Header or (if a response was returned at
  47481. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  47482. // to check whether the returned error was because
  47483. // http.StatusNotModified was returned.
  47484. func (c *SubnetworksSetPrivateIpGoogleAccessCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  47485. gensupport.SetOptions(c.urlParams_, opts...)
  47486. res, err := c.doRequest("json")
  47487. if res != nil && res.StatusCode == http.StatusNotModified {
  47488. if res.Body != nil {
  47489. res.Body.Close()
  47490. }
  47491. return nil, &googleapi.Error{
  47492. Code: res.StatusCode,
  47493. Header: res.Header,
  47494. }
  47495. }
  47496. if err != nil {
  47497. return nil, err
  47498. }
  47499. defer googleapi.CloseBody(res)
  47500. if err := googleapi.CheckResponse(res); err != nil {
  47501. return nil, err
  47502. }
  47503. ret := &Operation{
  47504. ServerResponse: googleapi.ServerResponse{
  47505. Header: res.Header,
  47506. HTTPStatusCode: res.StatusCode,
  47507. },
  47508. }
  47509. target := &ret
  47510. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  47511. return nil, err
  47512. }
  47513. return ret, nil
  47514. // {
  47515. // "description": "Set whether VMs in this subnet can access Google services without assigning external IP addresses through Private Google Access.",
  47516. // "httpMethod": "POST",
  47517. // "id": "compute.subnetworks.setPrivateIpGoogleAccess",
  47518. // "parameterOrder": [
  47519. // "project",
  47520. // "region",
  47521. // "subnetwork"
  47522. // ],
  47523. // "parameters": {
  47524. // "project": {
  47525. // "description": "Project ID for this request.",
  47526. // "location": "path",
  47527. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47528. // "required": true,
  47529. // "type": "string"
  47530. // },
  47531. // "region": {
  47532. // "description": "Name of the region scoping this request.",
  47533. // "location": "path",
  47534. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  47535. // "required": true,
  47536. // "type": "string"
  47537. // },
  47538. // "subnetwork": {
  47539. // "description": "Name of the Subnetwork resource.",
  47540. // "location": "path",
  47541. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  47542. // "required": true,
  47543. // "type": "string"
  47544. // }
  47545. // },
  47546. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}/setPrivateIpGoogleAccess",
  47547. // "request": {
  47548. // "$ref": "SubnetworksSetPrivateIpGoogleAccessRequest"
  47549. // },
  47550. // "response": {
  47551. // "$ref": "Operation"
  47552. // },
  47553. // "scopes": [
  47554. // "https://www.googleapis.com/auth/cloud-platform",
  47555. // "https://www.googleapis.com/auth/compute"
  47556. // ]
  47557. // }
  47558. }
  47559. // method id "compute.targetHttpProxies.delete":
  47560. type TargetHttpProxiesDeleteCall struct {
  47561. s *Service
  47562. project string
  47563. targetHttpProxy string
  47564. urlParams_ gensupport.URLParams
  47565. ctx_ context.Context
  47566. header_ http.Header
  47567. }
  47568. // Delete: Deletes the specified TargetHttpProxy resource.
  47569. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/delete
  47570. func (r *TargetHttpProxiesService) Delete(project string, targetHttpProxy string) *TargetHttpProxiesDeleteCall {
  47571. c := &TargetHttpProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47572. c.project = project
  47573. c.targetHttpProxy = targetHttpProxy
  47574. return c
  47575. }
  47576. // Fields allows partial responses to be retrieved. See
  47577. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47578. // for more information.
  47579. func (c *TargetHttpProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetHttpProxiesDeleteCall {
  47580. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47581. return c
  47582. }
  47583. // Context sets the context to be used in this call's Do method. Any
  47584. // pending HTTP request will be aborted if the provided context is
  47585. // canceled.
  47586. func (c *TargetHttpProxiesDeleteCall) Context(ctx context.Context) *TargetHttpProxiesDeleteCall {
  47587. c.ctx_ = ctx
  47588. return c
  47589. }
  47590. // Header returns an http.Header that can be modified by the caller to
  47591. // add HTTP headers to the request.
  47592. func (c *TargetHttpProxiesDeleteCall) Header() http.Header {
  47593. if c.header_ == nil {
  47594. c.header_ = make(http.Header)
  47595. }
  47596. return c.header_
  47597. }
  47598. func (c *TargetHttpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  47599. reqHeaders := make(http.Header)
  47600. for k, v := range c.header_ {
  47601. reqHeaders[k] = v
  47602. }
  47603. reqHeaders.Set("User-Agent", c.s.userAgent())
  47604. var body io.Reader = nil
  47605. c.urlParams_.Set("alt", alt)
  47606. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies/{targetHttpProxy}")
  47607. urls += "?" + c.urlParams_.Encode()
  47608. req, _ := http.NewRequest("DELETE", urls, body)
  47609. req.Header = reqHeaders
  47610. googleapi.Expand(req.URL, map[string]string{
  47611. "project": c.project,
  47612. "targetHttpProxy": c.targetHttpProxy,
  47613. })
  47614. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47615. }
  47616. // Do executes the "compute.targetHttpProxies.delete" call.
  47617. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  47618. // status code is an error. Response headers are in either
  47619. // *Operation.ServerResponse.Header or (if a response was returned at
  47620. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  47621. // to check whether the returned error was because
  47622. // http.StatusNotModified was returned.
  47623. func (c *TargetHttpProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  47624. gensupport.SetOptions(c.urlParams_, opts...)
  47625. res, err := c.doRequest("json")
  47626. if res != nil && res.StatusCode == http.StatusNotModified {
  47627. if res.Body != nil {
  47628. res.Body.Close()
  47629. }
  47630. return nil, &googleapi.Error{
  47631. Code: res.StatusCode,
  47632. Header: res.Header,
  47633. }
  47634. }
  47635. if err != nil {
  47636. return nil, err
  47637. }
  47638. defer googleapi.CloseBody(res)
  47639. if err := googleapi.CheckResponse(res); err != nil {
  47640. return nil, err
  47641. }
  47642. ret := &Operation{
  47643. ServerResponse: googleapi.ServerResponse{
  47644. Header: res.Header,
  47645. HTTPStatusCode: res.StatusCode,
  47646. },
  47647. }
  47648. target := &ret
  47649. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  47650. return nil, err
  47651. }
  47652. return ret, nil
  47653. // {
  47654. // "description": "Deletes the specified TargetHttpProxy resource.",
  47655. // "httpMethod": "DELETE",
  47656. // "id": "compute.targetHttpProxies.delete",
  47657. // "parameterOrder": [
  47658. // "project",
  47659. // "targetHttpProxy"
  47660. // ],
  47661. // "parameters": {
  47662. // "project": {
  47663. // "description": "Project ID for this request.",
  47664. // "location": "path",
  47665. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47666. // "required": true,
  47667. // "type": "string"
  47668. // },
  47669. // "targetHttpProxy": {
  47670. // "description": "Name of the TargetHttpProxy resource to delete.",
  47671. // "location": "path",
  47672. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  47673. // "required": true,
  47674. // "type": "string"
  47675. // }
  47676. // },
  47677. // "path": "{project}/global/targetHttpProxies/{targetHttpProxy}",
  47678. // "response": {
  47679. // "$ref": "Operation"
  47680. // },
  47681. // "scopes": [
  47682. // "https://www.googleapis.com/auth/cloud-platform",
  47683. // "https://www.googleapis.com/auth/compute"
  47684. // ]
  47685. // }
  47686. }
  47687. // method id "compute.targetHttpProxies.get":
  47688. type TargetHttpProxiesGetCall struct {
  47689. s *Service
  47690. project string
  47691. targetHttpProxy string
  47692. urlParams_ gensupport.URLParams
  47693. ifNoneMatch_ string
  47694. ctx_ context.Context
  47695. header_ http.Header
  47696. }
  47697. // Get: Returns the specified TargetHttpProxy resource. Get a list of
  47698. // available target HTTP proxies by making a list() request.
  47699. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/get
  47700. func (r *TargetHttpProxiesService) Get(project string, targetHttpProxy string) *TargetHttpProxiesGetCall {
  47701. c := &TargetHttpProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47702. c.project = project
  47703. c.targetHttpProxy = targetHttpProxy
  47704. return c
  47705. }
  47706. // Fields allows partial responses to be retrieved. See
  47707. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47708. // for more information.
  47709. func (c *TargetHttpProxiesGetCall) Fields(s ...googleapi.Field) *TargetHttpProxiesGetCall {
  47710. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47711. return c
  47712. }
  47713. // IfNoneMatch sets the optional parameter which makes the operation
  47714. // fail if the object's ETag matches the given value. This is useful for
  47715. // getting updates only after the object has changed since the last
  47716. // request. Use googleapi.IsNotModified to check whether the response
  47717. // error from Do is the result of In-None-Match.
  47718. func (c *TargetHttpProxiesGetCall) IfNoneMatch(entityTag string) *TargetHttpProxiesGetCall {
  47719. c.ifNoneMatch_ = entityTag
  47720. return c
  47721. }
  47722. // Context sets the context to be used in this call's Do method. Any
  47723. // pending HTTP request will be aborted if the provided context is
  47724. // canceled.
  47725. func (c *TargetHttpProxiesGetCall) Context(ctx context.Context) *TargetHttpProxiesGetCall {
  47726. c.ctx_ = ctx
  47727. return c
  47728. }
  47729. // Header returns an http.Header that can be modified by the caller to
  47730. // add HTTP headers to the request.
  47731. func (c *TargetHttpProxiesGetCall) Header() http.Header {
  47732. if c.header_ == nil {
  47733. c.header_ = make(http.Header)
  47734. }
  47735. return c.header_
  47736. }
  47737. func (c *TargetHttpProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  47738. reqHeaders := make(http.Header)
  47739. for k, v := range c.header_ {
  47740. reqHeaders[k] = v
  47741. }
  47742. reqHeaders.Set("User-Agent", c.s.userAgent())
  47743. if c.ifNoneMatch_ != "" {
  47744. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  47745. }
  47746. var body io.Reader = nil
  47747. c.urlParams_.Set("alt", alt)
  47748. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies/{targetHttpProxy}")
  47749. urls += "?" + c.urlParams_.Encode()
  47750. req, _ := http.NewRequest("GET", urls, body)
  47751. req.Header = reqHeaders
  47752. googleapi.Expand(req.URL, map[string]string{
  47753. "project": c.project,
  47754. "targetHttpProxy": c.targetHttpProxy,
  47755. })
  47756. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47757. }
  47758. // Do executes the "compute.targetHttpProxies.get" call.
  47759. // Exactly one of *TargetHttpProxy or error will be non-nil. Any non-2xx
  47760. // status code is an error. Response headers are in either
  47761. // *TargetHttpProxy.ServerResponse.Header or (if a response was returned
  47762. // at all) in error.(*googleapi.Error).Header. Use
  47763. // googleapi.IsNotModified to check whether the returned error was
  47764. // because http.StatusNotModified was returned.
  47765. func (c *TargetHttpProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetHttpProxy, error) {
  47766. gensupport.SetOptions(c.urlParams_, opts...)
  47767. res, err := c.doRequest("json")
  47768. if res != nil && res.StatusCode == http.StatusNotModified {
  47769. if res.Body != nil {
  47770. res.Body.Close()
  47771. }
  47772. return nil, &googleapi.Error{
  47773. Code: res.StatusCode,
  47774. Header: res.Header,
  47775. }
  47776. }
  47777. if err != nil {
  47778. return nil, err
  47779. }
  47780. defer googleapi.CloseBody(res)
  47781. if err := googleapi.CheckResponse(res); err != nil {
  47782. return nil, err
  47783. }
  47784. ret := &TargetHttpProxy{
  47785. ServerResponse: googleapi.ServerResponse{
  47786. Header: res.Header,
  47787. HTTPStatusCode: res.StatusCode,
  47788. },
  47789. }
  47790. target := &ret
  47791. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  47792. return nil, err
  47793. }
  47794. return ret, nil
  47795. // {
  47796. // "description": "Returns the specified TargetHttpProxy resource. Get a list of available target HTTP proxies by making a list() request.",
  47797. // "httpMethod": "GET",
  47798. // "id": "compute.targetHttpProxies.get",
  47799. // "parameterOrder": [
  47800. // "project",
  47801. // "targetHttpProxy"
  47802. // ],
  47803. // "parameters": {
  47804. // "project": {
  47805. // "description": "Project ID for this request.",
  47806. // "location": "path",
  47807. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47808. // "required": true,
  47809. // "type": "string"
  47810. // },
  47811. // "targetHttpProxy": {
  47812. // "description": "Name of the TargetHttpProxy resource to return.",
  47813. // "location": "path",
  47814. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  47815. // "required": true,
  47816. // "type": "string"
  47817. // }
  47818. // },
  47819. // "path": "{project}/global/targetHttpProxies/{targetHttpProxy}",
  47820. // "response": {
  47821. // "$ref": "TargetHttpProxy"
  47822. // },
  47823. // "scopes": [
  47824. // "https://www.googleapis.com/auth/cloud-platform",
  47825. // "https://www.googleapis.com/auth/compute",
  47826. // "https://www.googleapis.com/auth/compute.readonly"
  47827. // ]
  47828. // }
  47829. }
  47830. // method id "compute.targetHttpProxies.insert":
  47831. type TargetHttpProxiesInsertCall struct {
  47832. s *Service
  47833. project string
  47834. targethttpproxy *TargetHttpProxy
  47835. urlParams_ gensupport.URLParams
  47836. ctx_ context.Context
  47837. header_ http.Header
  47838. }
  47839. // Insert: Creates a TargetHttpProxy resource in the specified project
  47840. // using the data included in the request.
  47841. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/insert
  47842. func (r *TargetHttpProxiesService) Insert(project string, targethttpproxy *TargetHttpProxy) *TargetHttpProxiesInsertCall {
  47843. c := &TargetHttpProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47844. c.project = project
  47845. c.targethttpproxy = targethttpproxy
  47846. return c
  47847. }
  47848. // Fields allows partial responses to be retrieved. See
  47849. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47850. // for more information.
  47851. func (c *TargetHttpProxiesInsertCall) Fields(s ...googleapi.Field) *TargetHttpProxiesInsertCall {
  47852. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47853. return c
  47854. }
  47855. // Context sets the context to be used in this call's Do method. Any
  47856. // pending HTTP request will be aborted if the provided context is
  47857. // canceled.
  47858. func (c *TargetHttpProxiesInsertCall) Context(ctx context.Context) *TargetHttpProxiesInsertCall {
  47859. c.ctx_ = ctx
  47860. return c
  47861. }
  47862. // Header returns an http.Header that can be modified by the caller to
  47863. // add HTTP headers to the request.
  47864. func (c *TargetHttpProxiesInsertCall) Header() http.Header {
  47865. if c.header_ == nil {
  47866. c.header_ = make(http.Header)
  47867. }
  47868. return c.header_
  47869. }
  47870. func (c *TargetHttpProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  47871. reqHeaders := make(http.Header)
  47872. for k, v := range c.header_ {
  47873. reqHeaders[k] = v
  47874. }
  47875. reqHeaders.Set("User-Agent", c.s.userAgent())
  47876. var body io.Reader = nil
  47877. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpproxy)
  47878. if err != nil {
  47879. return nil, err
  47880. }
  47881. reqHeaders.Set("Content-Type", "application/json")
  47882. c.urlParams_.Set("alt", alt)
  47883. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies")
  47884. urls += "?" + c.urlParams_.Encode()
  47885. req, _ := http.NewRequest("POST", urls, body)
  47886. req.Header = reqHeaders
  47887. googleapi.Expand(req.URL, map[string]string{
  47888. "project": c.project,
  47889. })
  47890. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47891. }
  47892. // Do executes the "compute.targetHttpProxies.insert" call.
  47893. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  47894. // status code is an error. Response headers are in either
  47895. // *Operation.ServerResponse.Header or (if a response was returned at
  47896. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  47897. // to check whether the returned error was because
  47898. // http.StatusNotModified was returned.
  47899. func (c *TargetHttpProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  47900. gensupport.SetOptions(c.urlParams_, opts...)
  47901. res, err := c.doRequest("json")
  47902. if res != nil && res.StatusCode == http.StatusNotModified {
  47903. if res.Body != nil {
  47904. res.Body.Close()
  47905. }
  47906. return nil, &googleapi.Error{
  47907. Code: res.StatusCode,
  47908. Header: res.Header,
  47909. }
  47910. }
  47911. if err != nil {
  47912. return nil, err
  47913. }
  47914. defer googleapi.CloseBody(res)
  47915. if err := googleapi.CheckResponse(res); err != nil {
  47916. return nil, err
  47917. }
  47918. ret := &Operation{
  47919. ServerResponse: googleapi.ServerResponse{
  47920. Header: res.Header,
  47921. HTTPStatusCode: res.StatusCode,
  47922. },
  47923. }
  47924. target := &ret
  47925. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  47926. return nil, err
  47927. }
  47928. return ret, nil
  47929. // {
  47930. // "description": "Creates a TargetHttpProxy resource in the specified project using the data included in the request.",
  47931. // "httpMethod": "POST",
  47932. // "id": "compute.targetHttpProxies.insert",
  47933. // "parameterOrder": [
  47934. // "project"
  47935. // ],
  47936. // "parameters": {
  47937. // "project": {
  47938. // "description": "Project ID for this request.",
  47939. // "location": "path",
  47940. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47941. // "required": true,
  47942. // "type": "string"
  47943. // }
  47944. // },
  47945. // "path": "{project}/global/targetHttpProxies",
  47946. // "request": {
  47947. // "$ref": "TargetHttpProxy"
  47948. // },
  47949. // "response": {
  47950. // "$ref": "Operation"
  47951. // },
  47952. // "scopes": [
  47953. // "https://www.googleapis.com/auth/cloud-platform",
  47954. // "https://www.googleapis.com/auth/compute"
  47955. // ]
  47956. // }
  47957. }
  47958. // method id "compute.targetHttpProxies.list":
  47959. type TargetHttpProxiesListCall struct {
  47960. s *Service
  47961. project string
  47962. urlParams_ gensupport.URLParams
  47963. ifNoneMatch_ string
  47964. ctx_ context.Context
  47965. header_ http.Header
  47966. }
  47967. // List: Retrieves the list of TargetHttpProxy resources available to
  47968. // the specified project.
  47969. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/list
  47970. func (r *TargetHttpProxiesService) List(project string) *TargetHttpProxiesListCall {
  47971. c := &TargetHttpProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47972. c.project = project
  47973. return c
  47974. }
  47975. // Filter sets the optional parameter "filter": Sets a filter
  47976. // {expression} for filtering listed resources. Your {expression} must
  47977. // be in the format: field_name comparison_string literal_string.
  47978. //
  47979. // The field_name is the name of the field you want to compare. Only
  47980. // atomic field types are supported (string, number, boolean). The
  47981. // comparison_string must be either eq (equals) or ne (not equals). The
  47982. // literal_string is the string value to filter to. The literal value
  47983. // must be valid for the type of field you are filtering by (string,
  47984. // number, boolean). For string fields, the literal value is interpreted
  47985. // as a regular expression using RE2 syntax. The literal value must
  47986. // match the entire field.
  47987. //
  47988. // For example, to filter for instances that do not have a name of
  47989. // example-instance, you would use name ne example-instance.
  47990. //
  47991. // You can filter on nested fields. For example, you could filter on
  47992. // instances that have set the scheduling.automaticRestart field to
  47993. // true. Use filtering on nested fields to take advantage of labels to
  47994. // organize and search for results based on label values.
  47995. //
  47996. // To filter on multiple expressions, provide each separate expression
  47997. // within parentheses. For example, (scheduling.automaticRestart eq
  47998. // true) (zone eq us-central1-f). Multiple expressions are treated as
  47999. // AND expressions, meaning that resources must match all expressions to
  48000. // pass the filters.
  48001. func (c *TargetHttpProxiesListCall) Filter(filter string) *TargetHttpProxiesListCall {
  48002. c.urlParams_.Set("filter", filter)
  48003. return c
  48004. }
  48005. // MaxResults sets the optional parameter "maxResults": The maximum
  48006. // number of results per page that should be returned. If the number of
  48007. // available results is larger than maxResults, Compute Engine returns a
  48008. // nextPageToken that can be used to get the next page of results in
  48009. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  48010. // (Default: 500)
  48011. func (c *TargetHttpProxiesListCall) MaxResults(maxResults int64) *TargetHttpProxiesListCall {
  48012. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  48013. return c
  48014. }
  48015. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  48016. // a certain order. By default, results are returned in alphanumerical
  48017. // order based on the resource name.
  48018. //
  48019. // You can also sort results in descending order based on the creation
  48020. // timestamp using orderBy="creationTimestamp desc". This sorts results
  48021. // based on the creationTimestamp field in reverse chronological order
  48022. // (newest result first). Use this to sort resources like operations so
  48023. // that the newest operation is returned first.
  48024. //
  48025. // Currently, only sorting by name or creationTimestamp desc is
  48026. // supported.
  48027. func (c *TargetHttpProxiesListCall) OrderBy(orderBy string) *TargetHttpProxiesListCall {
  48028. c.urlParams_.Set("orderBy", orderBy)
  48029. return c
  48030. }
  48031. // PageToken sets the optional parameter "pageToken": Specifies a page
  48032. // token to use. Set pageToken to the nextPageToken returned by a
  48033. // previous list request to get the next page of results.
  48034. func (c *TargetHttpProxiesListCall) PageToken(pageToken string) *TargetHttpProxiesListCall {
  48035. c.urlParams_.Set("pageToken", pageToken)
  48036. return c
  48037. }
  48038. // Fields allows partial responses to be retrieved. See
  48039. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48040. // for more information.
  48041. func (c *TargetHttpProxiesListCall) Fields(s ...googleapi.Field) *TargetHttpProxiesListCall {
  48042. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48043. return c
  48044. }
  48045. // IfNoneMatch sets the optional parameter which makes the operation
  48046. // fail if the object's ETag matches the given value. This is useful for
  48047. // getting updates only after the object has changed since the last
  48048. // request. Use googleapi.IsNotModified to check whether the response
  48049. // error from Do is the result of In-None-Match.
  48050. func (c *TargetHttpProxiesListCall) IfNoneMatch(entityTag string) *TargetHttpProxiesListCall {
  48051. c.ifNoneMatch_ = entityTag
  48052. return c
  48053. }
  48054. // Context sets the context to be used in this call's Do method. Any
  48055. // pending HTTP request will be aborted if the provided context is
  48056. // canceled.
  48057. func (c *TargetHttpProxiesListCall) Context(ctx context.Context) *TargetHttpProxiesListCall {
  48058. c.ctx_ = ctx
  48059. return c
  48060. }
  48061. // Header returns an http.Header that can be modified by the caller to
  48062. // add HTTP headers to the request.
  48063. func (c *TargetHttpProxiesListCall) Header() http.Header {
  48064. if c.header_ == nil {
  48065. c.header_ = make(http.Header)
  48066. }
  48067. return c.header_
  48068. }
  48069. func (c *TargetHttpProxiesListCall) doRequest(alt string) (*http.Response, error) {
  48070. reqHeaders := make(http.Header)
  48071. for k, v := range c.header_ {
  48072. reqHeaders[k] = v
  48073. }
  48074. reqHeaders.Set("User-Agent", c.s.userAgent())
  48075. if c.ifNoneMatch_ != "" {
  48076. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  48077. }
  48078. var body io.Reader = nil
  48079. c.urlParams_.Set("alt", alt)
  48080. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies")
  48081. urls += "?" + c.urlParams_.Encode()
  48082. req, _ := http.NewRequest("GET", urls, body)
  48083. req.Header = reqHeaders
  48084. googleapi.Expand(req.URL, map[string]string{
  48085. "project": c.project,
  48086. })
  48087. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48088. }
  48089. // Do executes the "compute.targetHttpProxies.list" call.
  48090. // Exactly one of *TargetHttpProxyList or error will be non-nil. Any
  48091. // non-2xx status code is an error. Response headers are in either
  48092. // *TargetHttpProxyList.ServerResponse.Header or (if a response was
  48093. // returned at all) in error.(*googleapi.Error).Header. Use
  48094. // googleapi.IsNotModified to check whether the returned error was
  48095. // because http.StatusNotModified was returned.
  48096. func (c *TargetHttpProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetHttpProxyList, error) {
  48097. gensupport.SetOptions(c.urlParams_, opts...)
  48098. res, err := c.doRequest("json")
  48099. if res != nil && res.StatusCode == http.StatusNotModified {
  48100. if res.Body != nil {
  48101. res.Body.Close()
  48102. }
  48103. return nil, &googleapi.Error{
  48104. Code: res.StatusCode,
  48105. Header: res.Header,
  48106. }
  48107. }
  48108. if err != nil {
  48109. return nil, err
  48110. }
  48111. defer googleapi.CloseBody(res)
  48112. if err := googleapi.CheckResponse(res); err != nil {
  48113. return nil, err
  48114. }
  48115. ret := &TargetHttpProxyList{
  48116. ServerResponse: googleapi.ServerResponse{
  48117. Header: res.Header,
  48118. HTTPStatusCode: res.StatusCode,
  48119. },
  48120. }
  48121. target := &ret
  48122. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  48123. return nil, err
  48124. }
  48125. return ret, nil
  48126. // {
  48127. // "description": "Retrieves the list of TargetHttpProxy resources available to the specified project.",
  48128. // "httpMethod": "GET",
  48129. // "id": "compute.targetHttpProxies.list",
  48130. // "parameterOrder": [
  48131. // "project"
  48132. // ],
  48133. // "parameters": {
  48134. // "filter": {
  48135. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  48136. // "location": "query",
  48137. // "type": "string"
  48138. // },
  48139. // "maxResults": {
  48140. // "default": "500",
  48141. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  48142. // "format": "uint32",
  48143. // "location": "query",
  48144. // "minimum": "0",
  48145. // "type": "integer"
  48146. // },
  48147. // "orderBy": {
  48148. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  48149. // "location": "query",
  48150. // "type": "string"
  48151. // },
  48152. // "pageToken": {
  48153. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  48154. // "location": "query",
  48155. // "type": "string"
  48156. // },
  48157. // "project": {
  48158. // "description": "Project ID for this request.",
  48159. // "location": "path",
  48160. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48161. // "required": true,
  48162. // "type": "string"
  48163. // }
  48164. // },
  48165. // "path": "{project}/global/targetHttpProxies",
  48166. // "response": {
  48167. // "$ref": "TargetHttpProxyList"
  48168. // },
  48169. // "scopes": [
  48170. // "https://www.googleapis.com/auth/cloud-platform",
  48171. // "https://www.googleapis.com/auth/compute",
  48172. // "https://www.googleapis.com/auth/compute.readonly"
  48173. // ]
  48174. // }
  48175. }
  48176. // Pages invokes f for each page of results.
  48177. // A non-nil error returned from f will halt the iteration.
  48178. // The provided context supersedes any context provided to the Context method.
  48179. func (c *TargetHttpProxiesListCall) Pages(ctx context.Context, f func(*TargetHttpProxyList) error) error {
  48180. c.ctx_ = ctx
  48181. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  48182. for {
  48183. x, err := c.Do()
  48184. if err != nil {
  48185. return err
  48186. }
  48187. if err := f(x); err != nil {
  48188. return err
  48189. }
  48190. if x.NextPageToken == "" {
  48191. return nil
  48192. }
  48193. c.PageToken(x.NextPageToken)
  48194. }
  48195. }
  48196. // method id "compute.targetHttpProxies.setUrlMap":
  48197. type TargetHttpProxiesSetUrlMapCall struct {
  48198. s *Service
  48199. project string
  48200. targetHttpProxy string
  48201. urlmapreference *UrlMapReference
  48202. urlParams_ gensupport.URLParams
  48203. ctx_ context.Context
  48204. header_ http.Header
  48205. }
  48206. // SetUrlMap: Changes the URL map for TargetHttpProxy.
  48207. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/setUrlMap
  48208. func (r *TargetHttpProxiesService) SetUrlMap(project string, targetHttpProxy string, urlmapreference *UrlMapReference) *TargetHttpProxiesSetUrlMapCall {
  48209. c := &TargetHttpProxiesSetUrlMapCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48210. c.project = project
  48211. c.targetHttpProxy = targetHttpProxy
  48212. c.urlmapreference = urlmapreference
  48213. return c
  48214. }
  48215. // Fields allows partial responses to be retrieved. See
  48216. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48217. // for more information.
  48218. func (c *TargetHttpProxiesSetUrlMapCall) Fields(s ...googleapi.Field) *TargetHttpProxiesSetUrlMapCall {
  48219. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48220. return c
  48221. }
  48222. // Context sets the context to be used in this call's Do method. Any
  48223. // pending HTTP request will be aborted if the provided context is
  48224. // canceled.
  48225. func (c *TargetHttpProxiesSetUrlMapCall) Context(ctx context.Context) *TargetHttpProxiesSetUrlMapCall {
  48226. c.ctx_ = ctx
  48227. return c
  48228. }
  48229. // Header returns an http.Header that can be modified by the caller to
  48230. // add HTTP headers to the request.
  48231. func (c *TargetHttpProxiesSetUrlMapCall) Header() http.Header {
  48232. if c.header_ == nil {
  48233. c.header_ = make(http.Header)
  48234. }
  48235. return c.header_
  48236. }
  48237. func (c *TargetHttpProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) {
  48238. reqHeaders := make(http.Header)
  48239. for k, v := range c.header_ {
  48240. reqHeaders[k] = v
  48241. }
  48242. reqHeaders.Set("User-Agent", c.s.userAgent())
  48243. var body io.Reader = nil
  48244. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference)
  48245. if err != nil {
  48246. return nil, err
  48247. }
  48248. reqHeaders.Set("Content-Type", "application/json")
  48249. c.urlParams_.Set("alt", alt)
  48250. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap")
  48251. urls += "?" + c.urlParams_.Encode()
  48252. req, _ := http.NewRequest("POST", urls, body)
  48253. req.Header = reqHeaders
  48254. googleapi.Expand(req.URL, map[string]string{
  48255. "project": c.project,
  48256. "targetHttpProxy": c.targetHttpProxy,
  48257. })
  48258. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48259. }
  48260. // Do executes the "compute.targetHttpProxies.setUrlMap" call.
  48261. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  48262. // status code is an error. Response headers are in either
  48263. // *Operation.ServerResponse.Header or (if a response was returned at
  48264. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  48265. // to check whether the returned error was because
  48266. // http.StatusNotModified was returned.
  48267. func (c *TargetHttpProxiesSetUrlMapCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  48268. gensupport.SetOptions(c.urlParams_, opts...)
  48269. res, err := c.doRequest("json")
  48270. if res != nil && res.StatusCode == http.StatusNotModified {
  48271. if res.Body != nil {
  48272. res.Body.Close()
  48273. }
  48274. return nil, &googleapi.Error{
  48275. Code: res.StatusCode,
  48276. Header: res.Header,
  48277. }
  48278. }
  48279. if err != nil {
  48280. return nil, err
  48281. }
  48282. defer googleapi.CloseBody(res)
  48283. if err := googleapi.CheckResponse(res); err != nil {
  48284. return nil, err
  48285. }
  48286. ret := &Operation{
  48287. ServerResponse: googleapi.ServerResponse{
  48288. Header: res.Header,
  48289. HTTPStatusCode: res.StatusCode,
  48290. },
  48291. }
  48292. target := &ret
  48293. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  48294. return nil, err
  48295. }
  48296. return ret, nil
  48297. // {
  48298. // "description": "Changes the URL map for TargetHttpProxy.",
  48299. // "httpMethod": "POST",
  48300. // "id": "compute.targetHttpProxies.setUrlMap",
  48301. // "parameterOrder": [
  48302. // "project",
  48303. // "targetHttpProxy"
  48304. // ],
  48305. // "parameters": {
  48306. // "project": {
  48307. // "description": "Project ID for this request.",
  48308. // "location": "path",
  48309. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48310. // "required": true,
  48311. // "type": "string"
  48312. // },
  48313. // "targetHttpProxy": {
  48314. // "description": "Name of the TargetHttpProxy to set a URL map for.",
  48315. // "location": "path",
  48316. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  48317. // "required": true,
  48318. // "type": "string"
  48319. // }
  48320. // },
  48321. // "path": "{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap",
  48322. // "request": {
  48323. // "$ref": "UrlMapReference"
  48324. // },
  48325. // "response": {
  48326. // "$ref": "Operation"
  48327. // },
  48328. // "scopes": [
  48329. // "https://www.googleapis.com/auth/cloud-platform",
  48330. // "https://www.googleapis.com/auth/compute"
  48331. // ]
  48332. // }
  48333. }
  48334. // method id "compute.targetHttpsProxies.delete":
  48335. type TargetHttpsProxiesDeleteCall struct {
  48336. s *Service
  48337. project string
  48338. targetHttpsProxy string
  48339. urlParams_ gensupport.URLParams
  48340. ctx_ context.Context
  48341. header_ http.Header
  48342. }
  48343. // Delete: Deletes the specified TargetHttpsProxy resource.
  48344. func (r *TargetHttpsProxiesService) Delete(project string, targetHttpsProxy string) *TargetHttpsProxiesDeleteCall {
  48345. c := &TargetHttpsProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48346. c.project = project
  48347. c.targetHttpsProxy = targetHttpsProxy
  48348. return c
  48349. }
  48350. // Fields allows partial responses to be retrieved. See
  48351. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48352. // for more information.
  48353. func (c *TargetHttpsProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesDeleteCall {
  48354. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48355. return c
  48356. }
  48357. // Context sets the context to be used in this call's Do method. Any
  48358. // pending HTTP request will be aborted if the provided context is
  48359. // canceled.
  48360. func (c *TargetHttpsProxiesDeleteCall) Context(ctx context.Context) *TargetHttpsProxiesDeleteCall {
  48361. c.ctx_ = ctx
  48362. return c
  48363. }
  48364. // Header returns an http.Header that can be modified by the caller to
  48365. // add HTTP headers to the request.
  48366. func (c *TargetHttpsProxiesDeleteCall) Header() http.Header {
  48367. if c.header_ == nil {
  48368. c.header_ = make(http.Header)
  48369. }
  48370. return c.header_
  48371. }
  48372. func (c *TargetHttpsProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  48373. reqHeaders := make(http.Header)
  48374. for k, v := range c.header_ {
  48375. reqHeaders[k] = v
  48376. }
  48377. reqHeaders.Set("User-Agent", c.s.userAgent())
  48378. var body io.Reader = nil
  48379. c.urlParams_.Set("alt", alt)
  48380. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}")
  48381. urls += "?" + c.urlParams_.Encode()
  48382. req, _ := http.NewRequest("DELETE", urls, body)
  48383. req.Header = reqHeaders
  48384. googleapi.Expand(req.URL, map[string]string{
  48385. "project": c.project,
  48386. "targetHttpsProxy": c.targetHttpsProxy,
  48387. })
  48388. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48389. }
  48390. // Do executes the "compute.targetHttpsProxies.delete" call.
  48391. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  48392. // status code is an error. Response headers are in either
  48393. // *Operation.ServerResponse.Header or (if a response was returned at
  48394. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  48395. // to check whether the returned error was because
  48396. // http.StatusNotModified was returned.
  48397. func (c *TargetHttpsProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  48398. gensupport.SetOptions(c.urlParams_, opts...)
  48399. res, err := c.doRequest("json")
  48400. if res != nil && res.StatusCode == http.StatusNotModified {
  48401. if res.Body != nil {
  48402. res.Body.Close()
  48403. }
  48404. return nil, &googleapi.Error{
  48405. Code: res.StatusCode,
  48406. Header: res.Header,
  48407. }
  48408. }
  48409. if err != nil {
  48410. return nil, err
  48411. }
  48412. defer googleapi.CloseBody(res)
  48413. if err := googleapi.CheckResponse(res); err != nil {
  48414. return nil, err
  48415. }
  48416. ret := &Operation{
  48417. ServerResponse: googleapi.ServerResponse{
  48418. Header: res.Header,
  48419. HTTPStatusCode: res.StatusCode,
  48420. },
  48421. }
  48422. target := &ret
  48423. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  48424. return nil, err
  48425. }
  48426. return ret, nil
  48427. // {
  48428. // "description": "Deletes the specified TargetHttpsProxy resource.",
  48429. // "httpMethod": "DELETE",
  48430. // "id": "compute.targetHttpsProxies.delete",
  48431. // "parameterOrder": [
  48432. // "project",
  48433. // "targetHttpsProxy"
  48434. // ],
  48435. // "parameters": {
  48436. // "project": {
  48437. // "description": "Project ID for this request.",
  48438. // "location": "path",
  48439. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48440. // "required": true,
  48441. // "type": "string"
  48442. // },
  48443. // "targetHttpsProxy": {
  48444. // "description": "Name of the TargetHttpsProxy resource to delete.",
  48445. // "location": "path",
  48446. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  48447. // "required": true,
  48448. // "type": "string"
  48449. // }
  48450. // },
  48451. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}",
  48452. // "response": {
  48453. // "$ref": "Operation"
  48454. // },
  48455. // "scopes": [
  48456. // "https://www.googleapis.com/auth/cloud-platform",
  48457. // "https://www.googleapis.com/auth/compute"
  48458. // ]
  48459. // }
  48460. }
  48461. // method id "compute.targetHttpsProxies.get":
  48462. type TargetHttpsProxiesGetCall struct {
  48463. s *Service
  48464. project string
  48465. targetHttpsProxy string
  48466. urlParams_ gensupport.URLParams
  48467. ifNoneMatch_ string
  48468. ctx_ context.Context
  48469. header_ http.Header
  48470. }
  48471. // Get: Returns the specified TargetHttpsProxy resource. Get a list of
  48472. // available target HTTPS proxies by making a list() request.
  48473. func (r *TargetHttpsProxiesService) Get(project string, targetHttpsProxy string) *TargetHttpsProxiesGetCall {
  48474. c := &TargetHttpsProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48475. c.project = project
  48476. c.targetHttpsProxy = targetHttpsProxy
  48477. return c
  48478. }
  48479. // Fields allows partial responses to be retrieved. See
  48480. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48481. // for more information.
  48482. func (c *TargetHttpsProxiesGetCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesGetCall {
  48483. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48484. return c
  48485. }
  48486. // IfNoneMatch sets the optional parameter which makes the operation
  48487. // fail if the object's ETag matches the given value. This is useful for
  48488. // getting updates only after the object has changed since the last
  48489. // request. Use googleapi.IsNotModified to check whether the response
  48490. // error from Do is the result of In-None-Match.
  48491. func (c *TargetHttpsProxiesGetCall) IfNoneMatch(entityTag string) *TargetHttpsProxiesGetCall {
  48492. c.ifNoneMatch_ = entityTag
  48493. return c
  48494. }
  48495. // Context sets the context to be used in this call's Do method. Any
  48496. // pending HTTP request will be aborted if the provided context is
  48497. // canceled.
  48498. func (c *TargetHttpsProxiesGetCall) Context(ctx context.Context) *TargetHttpsProxiesGetCall {
  48499. c.ctx_ = ctx
  48500. return c
  48501. }
  48502. // Header returns an http.Header that can be modified by the caller to
  48503. // add HTTP headers to the request.
  48504. func (c *TargetHttpsProxiesGetCall) Header() http.Header {
  48505. if c.header_ == nil {
  48506. c.header_ = make(http.Header)
  48507. }
  48508. return c.header_
  48509. }
  48510. func (c *TargetHttpsProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  48511. reqHeaders := make(http.Header)
  48512. for k, v := range c.header_ {
  48513. reqHeaders[k] = v
  48514. }
  48515. reqHeaders.Set("User-Agent", c.s.userAgent())
  48516. if c.ifNoneMatch_ != "" {
  48517. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  48518. }
  48519. var body io.Reader = nil
  48520. c.urlParams_.Set("alt", alt)
  48521. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}")
  48522. urls += "?" + c.urlParams_.Encode()
  48523. req, _ := http.NewRequest("GET", urls, body)
  48524. req.Header = reqHeaders
  48525. googleapi.Expand(req.URL, map[string]string{
  48526. "project": c.project,
  48527. "targetHttpsProxy": c.targetHttpsProxy,
  48528. })
  48529. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48530. }
  48531. // Do executes the "compute.targetHttpsProxies.get" call.
  48532. // Exactly one of *TargetHttpsProxy or error will be non-nil. Any
  48533. // non-2xx status code is an error. Response headers are in either
  48534. // *TargetHttpsProxy.ServerResponse.Header or (if a response was
  48535. // returned at all) in error.(*googleapi.Error).Header. Use
  48536. // googleapi.IsNotModified to check whether the returned error was
  48537. // because http.StatusNotModified was returned.
  48538. func (c *TargetHttpsProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetHttpsProxy, error) {
  48539. gensupport.SetOptions(c.urlParams_, opts...)
  48540. res, err := c.doRequest("json")
  48541. if res != nil && res.StatusCode == http.StatusNotModified {
  48542. if res.Body != nil {
  48543. res.Body.Close()
  48544. }
  48545. return nil, &googleapi.Error{
  48546. Code: res.StatusCode,
  48547. Header: res.Header,
  48548. }
  48549. }
  48550. if err != nil {
  48551. return nil, err
  48552. }
  48553. defer googleapi.CloseBody(res)
  48554. if err := googleapi.CheckResponse(res); err != nil {
  48555. return nil, err
  48556. }
  48557. ret := &TargetHttpsProxy{
  48558. ServerResponse: googleapi.ServerResponse{
  48559. Header: res.Header,
  48560. HTTPStatusCode: res.StatusCode,
  48561. },
  48562. }
  48563. target := &ret
  48564. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  48565. return nil, err
  48566. }
  48567. return ret, nil
  48568. // {
  48569. // "description": "Returns the specified TargetHttpsProxy resource. Get a list of available target HTTPS proxies by making a list() request.",
  48570. // "httpMethod": "GET",
  48571. // "id": "compute.targetHttpsProxies.get",
  48572. // "parameterOrder": [
  48573. // "project",
  48574. // "targetHttpsProxy"
  48575. // ],
  48576. // "parameters": {
  48577. // "project": {
  48578. // "description": "Project ID for this request.",
  48579. // "location": "path",
  48580. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48581. // "required": true,
  48582. // "type": "string"
  48583. // },
  48584. // "targetHttpsProxy": {
  48585. // "description": "Name of the TargetHttpsProxy resource to return.",
  48586. // "location": "path",
  48587. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  48588. // "required": true,
  48589. // "type": "string"
  48590. // }
  48591. // },
  48592. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}",
  48593. // "response": {
  48594. // "$ref": "TargetHttpsProxy"
  48595. // },
  48596. // "scopes": [
  48597. // "https://www.googleapis.com/auth/cloud-platform",
  48598. // "https://www.googleapis.com/auth/compute",
  48599. // "https://www.googleapis.com/auth/compute.readonly"
  48600. // ]
  48601. // }
  48602. }
  48603. // method id "compute.targetHttpsProxies.insert":
  48604. type TargetHttpsProxiesInsertCall struct {
  48605. s *Service
  48606. project string
  48607. targethttpsproxy *TargetHttpsProxy
  48608. urlParams_ gensupport.URLParams
  48609. ctx_ context.Context
  48610. header_ http.Header
  48611. }
  48612. // Insert: Creates a TargetHttpsProxy resource in the specified project
  48613. // using the data included in the request.
  48614. func (r *TargetHttpsProxiesService) Insert(project string, targethttpsproxy *TargetHttpsProxy) *TargetHttpsProxiesInsertCall {
  48615. c := &TargetHttpsProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48616. c.project = project
  48617. c.targethttpsproxy = targethttpsproxy
  48618. return c
  48619. }
  48620. // Fields allows partial responses to be retrieved. See
  48621. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48622. // for more information.
  48623. func (c *TargetHttpsProxiesInsertCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesInsertCall {
  48624. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48625. return c
  48626. }
  48627. // Context sets the context to be used in this call's Do method. Any
  48628. // pending HTTP request will be aborted if the provided context is
  48629. // canceled.
  48630. func (c *TargetHttpsProxiesInsertCall) Context(ctx context.Context) *TargetHttpsProxiesInsertCall {
  48631. c.ctx_ = ctx
  48632. return c
  48633. }
  48634. // Header returns an http.Header that can be modified by the caller to
  48635. // add HTTP headers to the request.
  48636. func (c *TargetHttpsProxiesInsertCall) Header() http.Header {
  48637. if c.header_ == nil {
  48638. c.header_ = make(http.Header)
  48639. }
  48640. return c.header_
  48641. }
  48642. func (c *TargetHttpsProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  48643. reqHeaders := make(http.Header)
  48644. for k, v := range c.header_ {
  48645. reqHeaders[k] = v
  48646. }
  48647. reqHeaders.Set("User-Agent", c.s.userAgent())
  48648. var body io.Reader = nil
  48649. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxy)
  48650. if err != nil {
  48651. return nil, err
  48652. }
  48653. reqHeaders.Set("Content-Type", "application/json")
  48654. c.urlParams_.Set("alt", alt)
  48655. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies")
  48656. urls += "?" + c.urlParams_.Encode()
  48657. req, _ := http.NewRequest("POST", urls, body)
  48658. req.Header = reqHeaders
  48659. googleapi.Expand(req.URL, map[string]string{
  48660. "project": c.project,
  48661. })
  48662. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48663. }
  48664. // Do executes the "compute.targetHttpsProxies.insert" call.
  48665. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  48666. // status code is an error. Response headers are in either
  48667. // *Operation.ServerResponse.Header or (if a response was returned at
  48668. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  48669. // to check whether the returned error was because
  48670. // http.StatusNotModified was returned.
  48671. func (c *TargetHttpsProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  48672. gensupport.SetOptions(c.urlParams_, opts...)
  48673. res, err := c.doRequest("json")
  48674. if res != nil && res.StatusCode == http.StatusNotModified {
  48675. if res.Body != nil {
  48676. res.Body.Close()
  48677. }
  48678. return nil, &googleapi.Error{
  48679. Code: res.StatusCode,
  48680. Header: res.Header,
  48681. }
  48682. }
  48683. if err != nil {
  48684. return nil, err
  48685. }
  48686. defer googleapi.CloseBody(res)
  48687. if err := googleapi.CheckResponse(res); err != nil {
  48688. return nil, err
  48689. }
  48690. ret := &Operation{
  48691. ServerResponse: googleapi.ServerResponse{
  48692. Header: res.Header,
  48693. HTTPStatusCode: res.StatusCode,
  48694. },
  48695. }
  48696. target := &ret
  48697. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  48698. return nil, err
  48699. }
  48700. return ret, nil
  48701. // {
  48702. // "description": "Creates a TargetHttpsProxy resource in the specified project using the data included in the request.",
  48703. // "httpMethod": "POST",
  48704. // "id": "compute.targetHttpsProxies.insert",
  48705. // "parameterOrder": [
  48706. // "project"
  48707. // ],
  48708. // "parameters": {
  48709. // "project": {
  48710. // "description": "Project ID for this request.",
  48711. // "location": "path",
  48712. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48713. // "required": true,
  48714. // "type": "string"
  48715. // }
  48716. // },
  48717. // "path": "{project}/global/targetHttpsProxies",
  48718. // "request": {
  48719. // "$ref": "TargetHttpsProxy"
  48720. // },
  48721. // "response": {
  48722. // "$ref": "Operation"
  48723. // },
  48724. // "scopes": [
  48725. // "https://www.googleapis.com/auth/cloud-platform",
  48726. // "https://www.googleapis.com/auth/compute"
  48727. // ]
  48728. // }
  48729. }
  48730. // method id "compute.targetHttpsProxies.list":
  48731. type TargetHttpsProxiesListCall struct {
  48732. s *Service
  48733. project string
  48734. urlParams_ gensupport.URLParams
  48735. ifNoneMatch_ string
  48736. ctx_ context.Context
  48737. header_ http.Header
  48738. }
  48739. // List: Retrieves the list of TargetHttpsProxy resources available to
  48740. // the specified project.
  48741. func (r *TargetHttpsProxiesService) List(project string) *TargetHttpsProxiesListCall {
  48742. c := &TargetHttpsProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48743. c.project = project
  48744. return c
  48745. }
  48746. // Filter sets the optional parameter "filter": Sets a filter
  48747. // {expression} for filtering listed resources. Your {expression} must
  48748. // be in the format: field_name comparison_string literal_string.
  48749. //
  48750. // The field_name is the name of the field you want to compare. Only
  48751. // atomic field types are supported (string, number, boolean). The
  48752. // comparison_string must be either eq (equals) or ne (not equals). The
  48753. // literal_string is the string value to filter to. The literal value
  48754. // must be valid for the type of field you are filtering by (string,
  48755. // number, boolean). For string fields, the literal value is interpreted
  48756. // as a regular expression using RE2 syntax. The literal value must
  48757. // match the entire field.
  48758. //
  48759. // For example, to filter for instances that do not have a name of
  48760. // example-instance, you would use name ne example-instance.
  48761. //
  48762. // You can filter on nested fields. For example, you could filter on
  48763. // instances that have set the scheduling.automaticRestart field to
  48764. // true. Use filtering on nested fields to take advantage of labels to
  48765. // organize and search for results based on label values.
  48766. //
  48767. // To filter on multiple expressions, provide each separate expression
  48768. // within parentheses. For example, (scheduling.automaticRestart eq
  48769. // true) (zone eq us-central1-f). Multiple expressions are treated as
  48770. // AND expressions, meaning that resources must match all expressions to
  48771. // pass the filters.
  48772. func (c *TargetHttpsProxiesListCall) Filter(filter string) *TargetHttpsProxiesListCall {
  48773. c.urlParams_.Set("filter", filter)
  48774. return c
  48775. }
  48776. // MaxResults sets the optional parameter "maxResults": The maximum
  48777. // number of results per page that should be returned. If the number of
  48778. // available results is larger than maxResults, Compute Engine returns a
  48779. // nextPageToken that can be used to get the next page of results in
  48780. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  48781. // (Default: 500)
  48782. func (c *TargetHttpsProxiesListCall) MaxResults(maxResults int64) *TargetHttpsProxiesListCall {
  48783. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  48784. return c
  48785. }
  48786. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  48787. // a certain order. By default, results are returned in alphanumerical
  48788. // order based on the resource name.
  48789. //
  48790. // You can also sort results in descending order based on the creation
  48791. // timestamp using orderBy="creationTimestamp desc". This sorts results
  48792. // based on the creationTimestamp field in reverse chronological order
  48793. // (newest result first). Use this to sort resources like operations so
  48794. // that the newest operation is returned first.
  48795. //
  48796. // Currently, only sorting by name or creationTimestamp desc is
  48797. // supported.
  48798. func (c *TargetHttpsProxiesListCall) OrderBy(orderBy string) *TargetHttpsProxiesListCall {
  48799. c.urlParams_.Set("orderBy", orderBy)
  48800. return c
  48801. }
  48802. // PageToken sets the optional parameter "pageToken": Specifies a page
  48803. // token to use. Set pageToken to the nextPageToken returned by a
  48804. // previous list request to get the next page of results.
  48805. func (c *TargetHttpsProxiesListCall) PageToken(pageToken string) *TargetHttpsProxiesListCall {
  48806. c.urlParams_.Set("pageToken", pageToken)
  48807. return c
  48808. }
  48809. // Fields allows partial responses to be retrieved. See
  48810. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48811. // for more information.
  48812. func (c *TargetHttpsProxiesListCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesListCall {
  48813. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48814. return c
  48815. }
  48816. // IfNoneMatch sets the optional parameter which makes the operation
  48817. // fail if the object's ETag matches the given value. This is useful for
  48818. // getting updates only after the object has changed since the last
  48819. // request. Use googleapi.IsNotModified to check whether the response
  48820. // error from Do is the result of In-None-Match.
  48821. func (c *TargetHttpsProxiesListCall) IfNoneMatch(entityTag string) *TargetHttpsProxiesListCall {
  48822. c.ifNoneMatch_ = entityTag
  48823. return c
  48824. }
  48825. // Context sets the context to be used in this call's Do method. Any
  48826. // pending HTTP request will be aborted if the provided context is
  48827. // canceled.
  48828. func (c *TargetHttpsProxiesListCall) Context(ctx context.Context) *TargetHttpsProxiesListCall {
  48829. c.ctx_ = ctx
  48830. return c
  48831. }
  48832. // Header returns an http.Header that can be modified by the caller to
  48833. // add HTTP headers to the request.
  48834. func (c *TargetHttpsProxiesListCall) Header() http.Header {
  48835. if c.header_ == nil {
  48836. c.header_ = make(http.Header)
  48837. }
  48838. return c.header_
  48839. }
  48840. func (c *TargetHttpsProxiesListCall) doRequest(alt string) (*http.Response, error) {
  48841. reqHeaders := make(http.Header)
  48842. for k, v := range c.header_ {
  48843. reqHeaders[k] = v
  48844. }
  48845. reqHeaders.Set("User-Agent", c.s.userAgent())
  48846. if c.ifNoneMatch_ != "" {
  48847. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  48848. }
  48849. var body io.Reader = nil
  48850. c.urlParams_.Set("alt", alt)
  48851. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies")
  48852. urls += "?" + c.urlParams_.Encode()
  48853. req, _ := http.NewRequest("GET", urls, body)
  48854. req.Header = reqHeaders
  48855. googleapi.Expand(req.URL, map[string]string{
  48856. "project": c.project,
  48857. })
  48858. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48859. }
  48860. // Do executes the "compute.targetHttpsProxies.list" call.
  48861. // Exactly one of *TargetHttpsProxyList or error will be non-nil. Any
  48862. // non-2xx status code is an error. Response headers are in either
  48863. // *TargetHttpsProxyList.ServerResponse.Header or (if a response was
  48864. // returned at all) in error.(*googleapi.Error).Header. Use
  48865. // googleapi.IsNotModified to check whether the returned error was
  48866. // because http.StatusNotModified was returned.
  48867. func (c *TargetHttpsProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetHttpsProxyList, error) {
  48868. gensupport.SetOptions(c.urlParams_, opts...)
  48869. res, err := c.doRequest("json")
  48870. if res != nil && res.StatusCode == http.StatusNotModified {
  48871. if res.Body != nil {
  48872. res.Body.Close()
  48873. }
  48874. return nil, &googleapi.Error{
  48875. Code: res.StatusCode,
  48876. Header: res.Header,
  48877. }
  48878. }
  48879. if err != nil {
  48880. return nil, err
  48881. }
  48882. defer googleapi.CloseBody(res)
  48883. if err := googleapi.CheckResponse(res); err != nil {
  48884. return nil, err
  48885. }
  48886. ret := &TargetHttpsProxyList{
  48887. ServerResponse: googleapi.ServerResponse{
  48888. Header: res.Header,
  48889. HTTPStatusCode: res.StatusCode,
  48890. },
  48891. }
  48892. target := &ret
  48893. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  48894. return nil, err
  48895. }
  48896. return ret, nil
  48897. // {
  48898. // "description": "Retrieves the list of TargetHttpsProxy resources available to the specified project.",
  48899. // "httpMethod": "GET",
  48900. // "id": "compute.targetHttpsProxies.list",
  48901. // "parameterOrder": [
  48902. // "project"
  48903. // ],
  48904. // "parameters": {
  48905. // "filter": {
  48906. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  48907. // "location": "query",
  48908. // "type": "string"
  48909. // },
  48910. // "maxResults": {
  48911. // "default": "500",
  48912. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  48913. // "format": "uint32",
  48914. // "location": "query",
  48915. // "minimum": "0",
  48916. // "type": "integer"
  48917. // },
  48918. // "orderBy": {
  48919. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  48920. // "location": "query",
  48921. // "type": "string"
  48922. // },
  48923. // "pageToken": {
  48924. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  48925. // "location": "query",
  48926. // "type": "string"
  48927. // },
  48928. // "project": {
  48929. // "description": "Project ID for this request.",
  48930. // "location": "path",
  48931. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48932. // "required": true,
  48933. // "type": "string"
  48934. // }
  48935. // },
  48936. // "path": "{project}/global/targetHttpsProxies",
  48937. // "response": {
  48938. // "$ref": "TargetHttpsProxyList"
  48939. // },
  48940. // "scopes": [
  48941. // "https://www.googleapis.com/auth/cloud-platform",
  48942. // "https://www.googleapis.com/auth/compute",
  48943. // "https://www.googleapis.com/auth/compute.readonly"
  48944. // ]
  48945. // }
  48946. }
  48947. // Pages invokes f for each page of results.
  48948. // A non-nil error returned from f will halt the iteration.
  48949. // The provided context supersedes any context provided to the Context method.
  48950. func (c *TargetHttpsProxiesListCall) Pages(ctx context.Context, f func(*TargetHttpsProxyList) error) error {
  48951. c.ctx_ = ctx
  48952. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  48953. for {
  48954. x, err := c.Do()
  48955. if err != nil {
  48956. return err
  48957. }
  48958. if err := f(x); err != nil {
  48959. return err
  48960. }
  48961. if x.NextPageToken == "" {
  48962. return nil
  48963. }
  48964. c.PageToken(x.NextPageToken)
  48965. }
  48966. }
  48967. // method id "compute.targetHttpsProxies.setSslCertificates":
  48968. type TargetHttpsProxiesSetSslCertificatesCall struct {
  48969. s *Service
  48970. project string
  48971. targetHttpsProxy string
  48972. targethttpsproxiessetsslcertificatesrequest *TargetHttpsProxiesSetSslCertificatesRequest
  48973. urlParams_ gensupport.URLParams
  48974. ctx_ context.Context
  48975. header_ http.Header
  48976. }
  48977. // SetSslCertificates: Replaces SslCertificates for TargetHttpsProxy.
  48978. func (r *TargetHttpsProxiesService) SetSslCertificates(project string, targetHttpsProxy string, targethttpsproxiessetsslcertificatesrequest *TargetHttpsProxiesSetSslCertificatesRequest) *TargetHttpsProxiesSetSslCertificatesCall {
  48979. c := &TargetHttpsProxiesSetSslCertificatesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48980. c.project = project
  48981. c.targetHttpsProxy = targetHttpsProxy
  48982. c.targethttpsproxiessetsslcertificatesrequest = targethttpsproxiessetsslcertificatesrequest
  48983. return c
  48984. }
  48985. // Fields allows partial responses to be retrieved. See
  48986. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48987. // for more information.
  48988. func (c *TargetHttpsProxiesSetSslCertificatesCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetSslCertificatesCall {
  48989. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48990. return c
  48991. }
  48992. // Context sets the context to be used in this call's Do method. Any
  48993. // pending HTTP request will be aborted if the provided context is
  48994. // canceled.
  48995. func (c *TargetHttpsProxiesSetSslCertificatesCall) Context(ctx context.Context) *TargetHttpsProxiesSetSslCertificatesCall {
  48996. c.ctx_ = ctx
  48997. return c
  48998. }
  48999. // Header returns an http.Header that can be modified by the caller to
  49000. // add HTTP headers to the request.
  49001. func (c *TargetHttpsProxiesSetSslCertificatesCall) Header() http.Header {
  49002. if c.header_ == nil {
  49003. c.header_ = make(http.Header)
  49004. }
  49005. return c.header_
  49006. }
  49007. func (c *TargetHttpsProxiesSetSslCertificatesCall) doRequest(alt string) (*http.Response, error) {
  49008. reqHeaders := make(http.Header)
  49009. for k, v := range c.header_ {
  49010. reqHeaders[k] = v
  49011. }
  49012. reqHeaders.Set("User-Agent", c.s.userAgent())
  49013. var body io.Reader = nil
  49014. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxiessetsslcertificatesrequest)
  49015. if err != nil {
  49016. return nil, err
  49017. }
  49018. reqHeaders.Set("Content-Type", "application/json")
  49019. c.urlParams_.Set("alt", alt)
  49020. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates")
  49021. urls += "?" + c.urlParams_.Encode()
  49022. req, _ := http.NewRequest("POST", urls, body)
  49023. req.Header = reqHeaders
  49024. googleapi.Expand(req.URL, map[string]string{
  49025. "project": c.project,
  49026. "targetHttpsProxy": c.targetHttpsProxy,
  49027. })
  49028. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49029. }
  49030. // Do executes the "compute.targetHttpsProxies.setSslCertificates" call.
  49031. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  49032. // status code is an error. Response headers are in either
  49033. // *Operation.ServerResponse.Header or (if a response was returned at
  49034. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  49035. // to check whether the returned error was because
  49036. // http.StatusNotModified was returned.
  49037. func (c *TargetHttpsProxiesSetSslCertificatesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  49038. gensupport.SetOptions(c.urlParams_, opts...)
  49039. res, err := c.doRequest("json")
  49040. if res != nil && res.StatusCode == http.StatusNotModified {
  49041. if res.Body != nil {
  49042. res.Body.Close()
  49043. }
  49044. return nil, &googleapi.Error{
  49045. Code: res.StatusCode,
  49046. Header: res.Header,
  49047. }
  49048. }
  49049. if err != nil {
  49050. return nil, err
  49051. }
  49052. defer googleapi.CloseBody(res)
  49053. if err := googleapi.CheckResponse(res); err != nil {
  49054. return nil, err
  49055. }
  49056. ret := &Operation{
  49057. ServerResponse: googleapi.ServerResponse{
  49058. Header: res.Header,
  49059. HTTPStatusCode: res.StatusCode,
  49060. },
  49061. }
  49062. target := &ret
  49063. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  49064. return nil, err
  49065. }
  49066. return ret, nil
  49067. // {
  49068. // "description": "Replaces SslCertificates for TargetHttpsProxy.",
  49069. // "httpMethod": "POST",
  49070. // "id": "compute.targetHttpsProxies.setSslCertificates",
  49071. // "parameterOrder": [
  49072. // "project",
  49073. // "targetHttpsProxy"
  49074. // ],
  49075. // "parameters": {
  49076. // "project": {
  49077. // "description": "Project ID for this request.",
  49078. // "location": "path",
  49079. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49080. // "required": true,
  49081. // "type": "string"
  49082. // },
  49083. // "targetHttpsProxy": {
  49084. // "description": "Name of the TargetHttpsProxy resource to set an SslCertificates resource for.",
  49085. // "location": "path",
  49086. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  49087. // "required": true,
  49088. // "type": "string"
  49089. // }
  49090. // },
  49091. // "path": "{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates",
  49092. // "request": {
  49093. // "$ref": "TargetHttpsProxiesSetSslCertificatesRequest"
  49094. // },
  49095. // "response": {
  49096. // "$ref": "Operation"
  49097. // },
  49098. // "scopes": [
  49099. // "https://www.googleapis.com/auth/cloud-platform",
  49100. // "https://www.googleapis.com/auth/compute"
  49101. // ]
  49102. // }
  49103. }
  49104. // method id "compute.targetHttpsProxies.setUrlMap":
  49105. type TargetHttpsProxiesSetUrlMapCall struct {
  49106. s *Service
  49107. project string
  49108. targetHttpsProxy string
  49109. urlmapreference *UrlMapReference
  49110. urlParams_ gensupport.URLParams
  49111. ctx_ context.Context
  49112. header_ http.Header
  49113. }
  49114. // SetUrlMap: Changes the URL map for TargetHttpsProxy.
  49115. func (r *TargetHttpsProxiesService) SetUrlMap(project string, targetHttpsProxy string, urlmapreference *UrlMapReference) *TargetHttpsProxiesSetUrlMapCall {
  49116. c := &TargetHttpsProxiesSetUrlMapCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49117. c.project = project
  49118. c.targetHttpsProxy = targetHttpsProxy
  49119. c.urlmapreference = urlmapreference
  49120. return c
  49121. }
  49122. // Fields allows partial responses to be retrieved. See
  49123. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49124. // for more information.
  49125. func (c *TargetHttpsProxiesSetUrlMapCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetUrlMapCall {
  49126. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49127. return c
  49128. }
  49129. // Context sets the context to be used in this call's Do method. Any
  49130. // pending HTTP request will be aborted if the provided context is
  49131. // canceled.
  49132. func (c *TargetHttpsProxiesSetUrlMapCall) Context(ctx context.Context) *TargetHttpsProxiesSetUrlMapCall {
  49133. c.ctx_ = ctx
  49134. return c
  49135. }
  49136. // Header returns an http.Header that can be modified by the caller to
  49137. // add HTTP headers to the request.
  49138. func (c *TargetHttpsProxiesSetUrlMapCall) Header() http.Header {
  49139. if c.header_ == nil {
  49140. c.header_ = make(http.Header)
  49141. }
  49142. return c.header_
  49143. }
  49144. func (c *TargetHttpsProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) {
  49145. reqHeaders := make(http.Header)
  49146. for k, v := range c.header_ {
  49147. reqHeaders[k] = v
  49148. }
  49149. reqHeaders.Set("User-Agent", c.s.userAgent())
  49150. var body io.Reader = nil
  49151. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference)
  49152. if err != nil {
  49153. return nil, err
  49154. }
  49155. reqHeaders.Set("Content-Type", "application/json")
  49156. c.urlParams_.Set("alt", alt)
  49157. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap")
  49158. urls += "?" + c.urlParams_.Encode()
  49159. req, _ := http.NewRequest("POST", urls, body)
  49160. req.Header = reqHeaders
  49161. googleapi.Expand(req.URL, map[string]string{
  49162. "project": c.project,
  49163. "targetHttpsProxy": c.targetHttpsProxy,
  49164. })
  49165. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49166. }
  49167. // Do executes the "compute.targetHttpsProxies.setUrlMap" call.
  49168. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  49169. // status code is an error. Response headers are in either
  49170. // *Operation.ServerResponse.Header or (if a response was returned at
  49171. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  49172. // to check whether the returned error was because
  49173. // http.StatusNotModified was returned.
  49174. func (c *TargetHttpsProxiesSetUrlMapCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  49175. gensupport.SetOptions(c.urlParams_, opts...)
  49176. res, err := c.doRequest("json")
  49177. if res != nil && res.StatusCode == http.StatusNotModified {
  49178. if res.Body != nil {
  49179. res.Body.Close()
  49180. }
  49181. return nil, &googleapi.Error{
  49182. Code: res.StatusCode,
  49183. Header: res.Header,
  49184. }
  49185. }
  49186. if err != nil {
  49187. return nil, err
  49188. }
  49189. defer googleapi.CloseBody(res)
  49190. if err := googleapi.CheckResponse(res); err != nil {
  49191. return nil, err
  49192. }
  49193. ret := &Operation{
  49194. ServerResponse: googleapi.ServerResponse{
  49195. Header: res.Header,
  49196. HTTPStatusCode: res.StatusCode,
  49197. },
  49198. }
  49199. target := &ret
  49200. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  49201. return nil, err
  49202. }
  49203. return ret, nil
  49204. // {
  49205. // "description": "Changes the URL map for TargetHttpsProxy.",
  49206. // "httpMethod": "POST",
  49207. // "id": "compute.targetHttpsProxies.setUrlMap",
  49208. // "parameterOrder": [
  49209. // "project",
  49210. // "targetHttpsProxy"
  49211. // ],
  49212. // "parameters": {
  49213. // "project": {
  49214. // "description": "Project ID for this request.",
  49215. // "location": "path",
  49216. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49217. // "required": true,
  49218. // "type": "string"
  49219. // },
  49220. // "targetHttpsProxy": {
  49221. // "description": "Name of the TargetHttpsProxy resource whose URL map is to be set.",
  49222. // "location": "path",
  49223. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  49224. // "required": true,
  49225. // "type": "string"
  49226. // }
  49227. // },
  49228. // "path": "{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap",
  49229. // "request": {
  49230. // "$ref": "UrlMapReference"
  49231. // },
  49232. // "response": {
  49233. // "$ref": "Operation"
  49234. // },
  49235. // "scopes": [
  49236. // "https://www.googleapis.com/auth/cloud-platform",
  49237. // "https://www.googleapis.com/auth/compute"
  49238. // ]
  49239. // }
  49240. }
  49241. // method id "compute.targetInstances.aggregatedList":
  49242. type TargetInstancesAggregatedListCall struct {
  49243. s *Service
  49244. project string
  49245. urlParams_ gensupport.URLParams
  49246. ifNoneMatch_ string
  49247. ctx_ context.Context
  49248. header_ http.Header
  49249. }
  49250. // AggregatedList: Retrieves an aggregated list of target instances.
  49251. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/aggregatedList
  49252. func (r *TargetInstancesService) AggregatedList(project string) *TargetInstancesAggregatedListCall {
  49253. c := &TargetInstancesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49254. c.project = project
  49255. return c
  49256. }
  49257. // Filter sets the optional parameter "filter": Sets a filter
  49258. // {expression} for filtering listed resources. Your {expression} must
  49259. // be in the format: field_name comparison_string literal_string.
  49260. //
  49261. // The field_name is the name of the field you want to compare. Only
  49262. // atomic field types are supported (string, number, boolean). The
  49263. // comparison_string must be either eq (equals) or ne (not equals). The
  49264. // literal_string is the string value to filter to. The literal value
  49265. // must be valid for the type of field you are filtering by (string,
  49266. // number, boolean). For string fields, the literal value is interpreted
  49267. // as a regular expression using RE2 syntax. The literal value must
  49268. // match the entire field.
  49269. //
  49270. // For example, to filter for instances that do not have a name of
  49271. // example-instance, you would use name ne example-instance.
  49272. //
  49273. // You can filter on nested fields. For example, you could filter on
  49274. // instances that have set the scheduling.automaticRestart field to
  49275. // true. Use filtering on nested fields to take advantage of labels to
  49276. // organize and search for results based on label values.
  49277. //
  49278. // To filter on multiple expressions, provide each separate expression
  49279. // within parentheses. For example, (scheduling.automaticRestart eq
  49280. // true) (zone eq us-central1-f). Multiple expressions are treated as
  49281. // AND expressions, meaning that resources must match all expressions to
  49282. // pass the filters.
  49283. func (c *TargetInstancesAggregatedListCall) Filter(filter string) *TargetInstancesAggregatedListCall {
  49284. c.urlParams_.Set("filter", filter)
  49285. return c
  49286. }
  49287. // MaxResults sets the optional parameter "maxResults": The maximum
  49288. // number of results per page that should be returned. If the number of
  49289. // available results is larger than maxResults, Compute Engine returns a
  49290. // nextPageToken that can be used to get the next page of results in
  49291. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  49292. // (Default: 500)
  49293. func (c *TargetInstancesAggregatedListCall) MaxResults(maxResults int64) *TargetInstancesAggregatedListCall {
  49294. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  49295. return c
  49296. }
  49297. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  49298. // a certain order. By default, results are returned in alphanumerical
  49299. // order based on the resource name.
  49300. //
  49301. // You can also sort results in descending order based on the creation
  49302. // timestamp using orderBy="creationTimestamp desc". This sorts results
  49303. // based on the creationTimestamp field in reverse chronological order
  49304. // (newest result first). Use this to sort resources like operations so
  49305. // that the newest operation is returned first.
  49306. //
  49307. // Currently, only sorting by name or creationTimestamp desc is
  49308. // supported.
  49309. func (c *TargetInstancesAggregatedListCall) OrderBy(orderBy string) *TargetInstancesAggregatedListCall {
  49310. c.urlParams_.Set("orderBy", orderBy)
  49311. return c
  49312. }
  49313. // PageToken sets the optional parameter "pageToken": Specifies a page
  49314. // token to use. Set pageToken to the nextPageToken returned by a
  49315. // previous list request to get the next page of results.
  49316. func (c *TargetInstancesAggregatedListCall) PageToken(pageToken string) *TargetInstancesAggregatedListCall {
  49317. c.urlParams_.Set("pageToken", pageToken)
  49318. return c
  49319. }
  49320. // Fields allows partial responses to be retrieved. See
  49321. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49322. // for more information.
  49323. func (c *TargetInstancesAggregatedListCall) Fields(s ...googleapi.Field) *TargetInstancesAggregatedListCall {
  49324. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49325. return c
  49326. }
  49327. // IfNoneMatch sets the optional parameter which makes the operation
  49328. // fail if the object's ETag matches the given value. This is useful for
  49329. // getting updates only after the object has changed since the last
  49330. // request. Use googleapi.IsNotModified to check whether the response
  49331. // error from Do is the result of In-None-Match.
  49332. func (c *TargetInstancesAggregatedListCall) IfNoneMatch(entityTag string) *TargetInstancesAggregatedListCall {
  49333. c.ifNoneMatch_ = entityTag
  49334. return c
  49335. }
  49336. // Context sets the context to be used in this call's Do method. Any
  49337. // pending HTTP request will be aborted if the provided context is
  49338. // canceled.
  49339. func (c *TargetInstancesAggregatedListCall) Context(ctx context.Context) *TargetInstancesAggregatedListCall {
  49340. c.ctx_ = ctx
  49341. return c
  49342. }
  49343. // Header returns an http.Header that can be modified by the caller to
  49344. // add HTTP headers to the request.
  49345. func (c *TargetInstancesAggregatedListCall) Header() http.Header {
  49346. if c.header_ == nil {
  49347. c.header_ = make(http.Header)
  49348. }
  49349. return c.header_
  49350. }
  49351. func (c *TargetInstancesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  49352. reqHeaders := make(http.Header)
  49353. for k, v := range c.header_ {
  49354. reqHeaders[k] = v
  49355. }
  49356. reqHeaders.Set("User-Agent", c.s.userAgent())
  49357. if c.ifNoneMatch_ != "" {
  49358. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  49359. }
  49360. var body io.Reader = nil
  49361. c.urlParams_.Set("alt", alt)
  49362. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetInstances")
  49363. urls += "?" + c.urlParams_.Encode()
  49364. req, _ := http.NewRequest("GET", urls, body)
  49365. req.Header = reqHeaders
  49366. googleapi.Expand(req.URL, map[string]string{
  49367. "project": c.project,
  49368. })
  49369. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49370. }
  49371. // Do executes the "compute.targetInstances.aggregatedList" call.
  49372. // Exactly one of *TargetInstanceAggregatedList or error will be
  49373. // non-nil. Any non-2xx status code is an error. Response headers are in
  49374. // either *TargetInstanceAggregatedList.ServerResponse.Header or (if a
  49375. // response was returned at all) in error.(*googleapi.Error).Header. Use
  49376. // googleapi.IsNotModified to check whether the returned error was
  49377. // because http.StatusNotModified was returned.
  49378. func (c *TargetInstancesAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetInstanceAggregatedList, error) {
  49379. gensupport.SetOptions(c.urlParams_, opts...)
  49380. res, err := c.doRequest("json")
  49381. if res != nil && res.StatusCode == http.StatusNotModified {
  49382. if res.Body != nil {
  49383. res.Body.Close()
  49384. }
  49385. return nil, &googleapi.Error{
  49386. Code: res.StatusCode,
  49387. Header: res.Header,
  49388. }
  49389. }
  49390. if err != nil {
  49391. return nil, err
  49392. }
  49393. defer googleapi.CloseBody(res)
  49394. if err := googleapi.CheckResponse(res); err != nil {
  49395. return nil, err
  49396. }
  49397. ret := &TargetInstanceAggregatedList{
  49398. ServerResponse: googleapi.ServerResponse{
  49399. Header: res.Header,
  49400. HTTPStatusCode: res.StatusCode,
  49401. },
  49402. }
  49403. target := &ret
  49404. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  49405. return nil, err
  49406. }
  49407. return ret, nil
  49408. // {
  49409. // "description": "Retrieves an aggregated list of target instances.",
  49410. // "httpMethod": "GET",
  49411. // "id": "compute.targetInstances.aggregatedList",
  49412. // "parameterOrder": [
  49413. // "project"
  49414. // ],
  49415. // "parameters": {
  49416. // "filter": {
  49417. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  49418. // "location": "query",
  49419. // "type": "string"
  49420. // },
  49421. // "maxResults": {
  49422. // "default": "500",
  49423. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  49424. // "format": "uint32",
  49425. // "location": "query",
  49426. // "minimum": "0",
  49427. // "type": "integer"
  49428. // },
  49429. // "orderBy": {
  49430. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  49431. // "location": "query",
  49432. // "type": "string"
  49433. // },
  49434. // "pageToken": {
  49435. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  49436. // "location": "query",
  49437. // "type": "string"
  49438. // },
  49439. // "project": {
  49440. // "description": "Project ID for this request.",
  49441. // "location": "path",
  49442. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49443. // "required": true,
  49444. // "type": "string"
  49445. // }
  49446. // },
  49447. // "path": "{project}/aggregated/targetInstances",
  49448. // "response": {
  49449. // "$ref": "TargetInstanceAggregatedList"
  49450. // },
  49451. // "scopes": [
  49452. // "https://www.googleapis.com/auth/cloud-platform",
  49453. // "https://www.googleapis.com/auth/compute",
  49454. // "https://www.googleapis.com/auth/compute.readonly"
  49455. // ]
  49456. // }
  49457. }
  49458. // Pages invokes f for each page of results.
  49459. // A non-nil error returned from f will halt the iteration.
  49460. // The provided context supersedes any context provided to the Context method.
  49461. func (c *TargetInstancesAggregatedListCall) Pages(ctx context.Context, f func(*TargetInstanceAggregatedList) error) error {
  49462. c.ctx_ = ctx
  49463. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  49464. for {
  49465. x, err := c.Do()
  49466. if err != nil {
  49467. return err
  49468. }
  49469. if err := f(x); err != nil {
  49470. return err
  49471. }
  49472. if x.NextPageToken == "" {
  49473. return nil
  49474. }
  49475. c.PageToken(x.NextPageToken)
  49476. }
  49477. }
  49478. // method id "compute.targetInstances.delete":
  49479. type TargetInstancesDeleteCall struct {
  49480. s *Service
  49481. project string
  49482. zone string
  49483. targetInstance string
  49484. urlParams_ gensupport.URLParams
  49485. ctx_ context.Context
  49486. header_ http.Header
  49487. }
  49488. // Delete: Deletes the specified TargetInstance resource.
  49489. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/delete
  49490. func (r *TargetInstancesService) Delete(project string, zone string, targetInstance string) *TargetInstancesDeleteCall {
  49491. c := &TargetInstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49492. c.project = project
  49493. c.zone = zone
  49494. c.targetInstance = targetInstance
  49495. return c
  49496. }
  49497. // Fields allows partial responses to be retrieved. See
  49498. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49499. // for more information.
  49500. func (c *TargetInstancesDeleteCall) Fields(s ...googleapi.Field) *TargetInstancesDeleteCall {
  49501. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49502. return c
  49503. }
  49504. // Context sets the context to be used in this call's Do method. Any
  49505. // pending HTTP request will be aborted if the provided context is
  49506. // canceled.
  49507. func (c *TargetInstancesDeleteCall) Context(ctx context.Context) *TargetInstancesDeleteCall {
  49508. c.ctx_ = ctx
  49509. return c
  49510. }
  49511. // Header returns an http.Header that can be modified by the caller to
  49512. // add HTTP headers to the request.
  49513. func (c *TargetInstancesDeleteCall) Header() http.Header {
  49514. if c.header_ == nil {
  49515. c.header_ = make(http.Header)
  49516. }
  49517. return c.header_
  49518. }
  49519. func (c *TargetInstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
  49520. reqHeaders := make(http.Header)
  49521. for k, v := range c.header_ {
  49522. reqHeaders[k] = v
  49523. }
  49524. reqHeaders.Set("User-Agent", c.s.userAgent())
  49525. var body io.Reader = nil
  49526. c.urlParams_.Set("alt", alt)
  49527. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances/{targetInstance}")
  49528. urls += "?" + c.urlParams_.Encode()
  49529. req, _ := http.NewRequest("DELETE", urls, body)
  49530. req.Header = reqHeaders
  49531. googleapi.Expand(req.URL, map[string]string{
  49532. "project": c.project,
  49533. "zone": c.zone,
  49534. "targetInstance": c.targetInstance,
  49535. })
  49536. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49537. }
  49538. // Do executes the "compute.targetInstances.delete" call.
  49539. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  49540. // status code is an error. Response headers are in either
  49541. // *Operation.ServerResponse.Header or (if a response was returned at
  49542. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  49543. // to check whether the returned error was because
  49544. // http.StatusNotModified was returned.
  49545. func (c *TargetInstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  49546. gensupport.SetOptions(c.urlParams_, opts...)
  49547. res, err := c.doRequest("json")
  49548. if res != nil && res.StatusCode == http.StatusNotModified {
  49549. if res.Body != nil {
  49550. res.Body.Close()
  49551. }
  49552. return nil, &googleapi.Error{
  49553. Code: res.StatusCode,
  49554. Header: res.Header,
  49555. }
  49556. }
  49557. if err != nil {
  49558. return nil, err
  49559. }
  49560. defer googleapi.CloseBody(res)
  49561. if err := googleapi.CheckResponse(res); err != nil {
  49562. return nil, err
  49563. }
  49564. ret := &Operation{
  49565. ServerResponse: googleapi.ServerResponse{
  49566. Header: res.Header,
  49567. HTTPStatusCode: res.StatusCode,
  49568. },
  49569. }
  49570. target := &ret
  49571. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  49572. return nil, err
  49573. }
  49574. return ret, nil
  49575. // {
  49576. // "description": "Deletes the specified TargetInstance resource.",
  49577. // "httpMethod": "DELETE",
  49578. // "id": "compute.targetInstances.delete",
  49579. // "parameterOrder": [
  49580. // "project",
  49581. // "zone",
  49582. // "targetInstance"
  49583. // ],
  49584. // "parameters": {
  49585. // "project": {
  49586. // "description": "Project ID for this request.",
  49587. // "location": "path",
  49588. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49589. // "required": true,
  49590. // "type": "string"
  49591. // },
  49592. // "targetInstance": {
  49593. // "description": "Name of the TargetInstance resource to delete.",
  49594. // "location": "path",
  49595. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  49596. // "required": true,
  49597. // "type": "string"
  49598. // },
  49599. // "zone": {
  49600. // "description": "Name of the zone scoping this request.",
  49601. // "location": "path",
  49602. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  49603. // "required": true,
  49604. // "type": "string"
  49605. // }
  49606. // },
  49607. // "path": "{project}/zones/{zone}/targetInstances/{targetInstance}",
  49608. // "response": {
  49609. // "$ref": "Operation"
  49610. // },
  49611. // "scopes": [
  49612. // "https://www.googleapis.com/auth/cloud-platform",
  49613. // "https://www.googleapis.com/auth/compute"
  49614. // ]
  49615. // }
  49616. }
  49617. // method id "compute.targetInstances.get":
  49618. type TargetInstancesGetCall struct {
  49619. s *Service
  49620. project string
  49621. zone string
  49622. targetInstance string
  49623. urlParams_ gensupport.URLParams
  49624. ifNoneMatch_ string
  49625. ctx_ context.Context
  49626. header_ http.Header
  49627. }
  49628. // Get: Returns the specified TargetInstance resource. Get a list of
  49629. // available target instances by making a list() request.
  49630. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/get
  49631. func (r *TargetInstancesService) Get(project string, zone string, targetInstance string) *TargetInstancesGetCall {
  49632. c := &TargetInstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49633. c.project = project
  49634. c.zone = zone
  49635. c.targetInstance = targetInstance
  49636. return c
  49637. }
  49638. // Fields allows partial responses to be retrieved. See
  49639. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49640. // for more information.
  49641. func (c *TargetInstancesGetCall) Fields(s ...googleapi.Field) *TargetInstancesGetCall {
  49642. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49643. return c
  49644. }
  49645. // IfNoneMatch sets the optional parameter which makes the operation
  49646. // fail if the object's ETag matches the given value. This is useful for
  49647. // getting updates only after the object has changed since the last
  49648. // request. Use googleapi.IsNotModified to check whether the response
  49649. // error from Do is the result of In-None-Match.
  49650. func (c *TargetInstancesGetCall) IfNoneMatch(entityTag string) *TargetInstancesGetCall {
  49651. c.ifNoneMatch_ = entityTag
  49652. return c
  49653. }
  49654. // Context sets the context to be used in this call's Do method. Any
  49655. // pending HTTP request will be aborted if the provided context is
  49656. // canceled.
  49657. func (c *TargetInstancesGetCall) Context(ctx context.Context) *TargetInstancesGetCall {
  49658. c.ctx_ = ctx
  49659. return c
  49660. }
  49661. // Header returns an http.Header that can be modified by the caller to
  49662. // add HTTP headers to the request.
  49663. func (c *TargetInstancesGetCall) Header() http.Header {
  49664. if c.header_ == nil {
  49665. c.header_ = make(http.Header)
  49666. }
  49667. return c.header_
  49668. }
  49669. func (c *TargetInstancesGetCall) doRequest(alt string) (*http.Response, error) {
  49670. reqHeaders := make(http.Header)
  49671. for k, v := range c.header_ {
  49672. reqHeaders[k] = v
  49673. }
  49674. reqHeaders.Set("User-Agent", c.s.userAgent())
  49675. if c.ifNoneMatch_ != "" {
  49676. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  49677. }
  49678. var body io.Reader = nil
  49679. c.urlParams_.Set("alt", alt)
  49680. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances/{targetInstance}")
  49681. urls += "?" + c.urlParams_.Encode()
  49682. req, _ := http.NewRequest("GET", urls, body)
  49683. req.Header = reqHeaders
  49684. googleapi.Expand(req.URL, map[string]string{
  49685. "project": c.project,
  49686. "zone": c.zone,
  49687. "targetInstance": c.targetInstance,
  49688. })
  49689. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49690. }
  49691. // Do executes the "compute.targetInstances.get" call.
  49692. // Exactly one of *TargetInstance or error will be non-nil. Any non-2xx
  49693. // status code is an error. Response headers are in either
  49694. // *TargetInstance.ServerResponse.Header or (if a response was returned
  49695. // at all) in error.(*googleapi.Error).Header. Use
  49696. // googleapi.IsNotModified to check whether the returned error was
  49697. // because http.StatusNotModified was returned.
  49698. func (c *TargetInstancesGetCall) Do(opts ...googleapi.CallOption) (*TargetInstance, error) {
  49699. gensupport.SetOptions(c.urlParams_, opts...)
  49700. res, err := c.doRequest("json")
  49701. if res != nil && res.StatusCode == http.StatusNotModified {
  49702. if res.Body != nil {
  49703. res.Body.Close()
  49704. }
  49705. return nil, &googleapi.Error{
  49706. Code: res.StatusCode,
  49707. Header: res.Header,
  49708. }
  49709. }
  49710. if err != nil {
  49711. return nil, err
  49712. }
  49713. defer googleapi.CloseBody(res)
  49714. if err := googleapi.CheckResponse(res); err != nil {
  49715. return nil, err
  49716. }
  49717. ret := &TargetInstance{
  49718. ServerResponse: googleapi.ServerResponse{
  49719. Header: res.Header,
  49720. HTTPStatusCode: res.StatusCode,
  49721. },
  49722. }
  49723. target := &ret
  49724. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  49725. return nil, err
  49726. }
  49727. return ret, nil
  49728. // {
  49729. // "description": "Returns the specified TargetInstance resource. Get a list of available target instances by making a list() request.",
  49730. // "httpMethod": "GET",
  49731. // "id": "compute.targetInstances.get",
  49732. // "parameterOrder": [
  49733. // "project",
  49734. // "zone",
  49735. // "targetInstance"
  49736. // ],
  49737. // "parameters": {
  49738. // "project": {
  49739. // "description": "Project ID for this request.",
  49740. // "location": "path",
  49741. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49742. // "required": true,
  49743. // "type": "string"
  49744. // },
  49745. // "targetInstance": {
  49746. // "description": "Name of the TargetInstance resource to return.",
  49747. // "location": "path",
  49748. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  49749. // "required": true,
  49750. // "type": "string"
  49751. // },
  49752. // "zone": {
  49753. // "description": "Name of the zone scoping this request.",
  49754. // "location": "path",
  49755. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  49756. // "required": true,
  49757. // "type": "string"
  49758. // }
  49759. // },
  49760. // "path": "{project}/zones/{zone}/targetInstances/{targetInstance}",
  49761. // "response": {
  49762. // "$ref": "TargetInstance"
  49763. // },
  49764. // "scopes": [
  49765. // "https://www.googleapis.com/auth/cloud-platform",
  49766. // "https://www.googleapis.com/auth/compute",
  49767. // "https://www.googleapis.com/auth/compute.readonly"
  49768. // ]
  49769. // }
  49770. }
  49771. // method id "compute.targetInstances.insert":
  49772. type TargetInstancesInsertCall struct {
  49773. s *Service
  49774. project string
  49775. zone string
  49776. targetinstance *TargetInstance
  49777. urlParams_ gensupport.URLParams
  49778. ctx_ context.Context
  49779. header_ http.Header
  49780. }
  49781. // Insert: Creates a TargetInstance resource in the specified project
  49782. // and zone using the data included in the request.
  49783. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/insert
  49784. func (r *TargetInstancesService) Insert(project string, zone string, targetinstance *TargetInstance) *TargetInstancesInsertCall {
  49785. c := &TargetInstancesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49786. c.project = project
  49787. c.zone = zone
  49788. c.targetinstance = targetinstance
  49789. return c
  49790. }
  49791. // Fields allows partial responses to be retrieved. See
  49792. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49793. // for more information.
  49794. func (c *TargetInstancesInsertCall) Fields(s ...googleapi.Field) *TargetInstancesInsertCall {
  49795. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49796. return c
  49797. }
  49798. // Context sets the context to be used in this call's Do method. Any
  49799. // pending HTTP request will be aborted if the provided context is
  49800. // canceled.
  49801. func (c *TargetInstancesInsertCall) Context(ctx context.Context) *TargetInstancesInsertCall {
  49802. c.ctx_ = ctx
  49803. return c
  49804. }
  49805. // Header returns an http.Header that can be modified by the caller to
  49806. // add HTTP headers to the request.
  49807. func (c *TargetInstancesInsertCall) Header() http.Header {
  49808. if c.header_ == nil {
  49809. c.header_ = make(http.Header)
  49810. }
  49811. return c.header_
  49812. }
  49813. func (c *TargetInstancesInsertCall) doRequest(alt string) (*http.Response, error) {
  49814. reqHeaders := make(http.Header)
  49815. for k, v := range c.header_ {
  49816. reqHeaders[k] = v
  49817. }
  49818. reqHeaders.Set("User-Agent", c.s.userAgent())
  49819. var body io.Reader = nil
  49820. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetinstance)
  49821. if err != nil {
  49822. return nil, err
  49823. }
  49824. reqHeaders.Set("Content-Type", "application/json")
  49825. c.urlParams_.Set("alt", alt)
  49826. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances")
  49827. urls += "?" + c.urlParams_.Encode()
  49828. req, _ := http.NewRequest("POST", urls, body)
  49829. req.Header = reqHeaders
  49830. googleapi.Expand(req.URL, map[string]string{
  49831. "project": c.project,
  49832. "zone": c.zone,
  49833. })
  49834. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49835. }
  49836. // Do executes the "compute.targetInstances.insert" call.
  49837. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  49838. // status code is an error. Response headers are in either
  49839. // *Operation.ServerResponse.Header or (if a response was returned at
  49840. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  49841. // to check whether the returned error was because
  49842. // http.StatusNotModified was returned.
  49843. func (c *TargetInstancesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  49844. gensupport.SetOptions(c.urlParams_, opts...)
  49845. res, err := c.doRequest("json")
  49846. if res != nil && res.StatusCode == http.StatusNotModified {
  49847. if res.Body != nil {
  49848. res.Body.Close()
  49849. }
  49850. return nil, &googleapi.Error{
  49851. Code: res.StatusCode,
  49852. Header: res.Header,
  49853. }
  49854. }
  49855. if err != nil {
  49856. return nil, err
  49857. }
  49858. defer googleapi.CloseBody(res)
  49859. if err := googleapi.CheckResponse(res); err != nil {
  49860. return nil, err
  49861. }
  49862. ret := &Operation{
  49863. ServerResponse: googleapi.ServerResponse{
  49864. Header: res.Header,
  49865. HTTPStatusCode: res.StatusCode,
  49866. },
  49867. }
  49868. target := &ret
  49869. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  49870. return nil, err
  49871. }
  49872. return ret, nil
  49873. // {
  49874. // "description": "Creates a TargetInstance resource in the specified project and zone using the data included in the request.",
  49875. // "httpMethod": "POST",
  49876. // "id": "compute.targetInstances.insert",
  49877. // "parameterOrder": [
  49878. // "project",
  49879. // "zone"
  49880. // ],
  49881. // "parameters": {
  49882. // "project": {
  49883. // "description": "Project ID for this request.",
  49884. // "location": "path",
  49885. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49886. // "required": true,
  49887. // "type": "string"
  49888. // },
  49889. // "zone": {
  49890. // "description": "Name of the zone scoping this request.",
  49891. // "location": "path",
  49892. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  49893. // "required": true,
  49894. // "type": "string"
  49895. // }
  49896. // },
  49897. // "path": "{project}/zones/{zone}/targetInstances",
  49898. // "request": {
  49899. // "$ref": "TargetInstance"
  49900. // },
  49901. // "response": {
  49902. // "$ref": "Operation"
  49903. // },
  49904. // "scopes": [
  49905. // "https://www.googleapis.com/auth/cloud-platform",
  49906. // "https://www.googleapis.com/auth/compute"
  49907. // ]
  49908. // }
  49909. }
  49910. // method id "compute.targetInstances.list":
  49911. type TargetInstancesListCall struct {
  49912. s *Service
  49913. project string
  49914. zone string
  49915. urlParams_ gensupport.URLParams
  49916. ifNoneMatch_ string
  49917. ctx_ context.Context
  49918. header_ http.Header
  49919. }
  49920. // List: Retrieves a list of TargetInstance resources available to the
  49921. // specified project and zone.
  49922. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/list
  49923. func (r *TargetInstancesService) List(project string, zone string) *TargetInstancesListCall {
  49924. c := &TargetInstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49925. c.project = project
  49926. c.zone = zone
  49927. return c
  49928. }
  49929. // Filter sets the optional parameter "filter": Sets a filter
  49930. // {expression} for filtering listed resources. Your {expression} must
  49931. // be in the format: field_name comparison_string literal_string.
  49932. //
  49933. // The field_name is the name of the field you want to compare. Only
  49934. // atomic field types are supported (string, number, boolean). The
  49935. // comparison_string must be either eq (equals) or ne (not equals). The
  49936. // literal_string is the string value to filter to. The literal value
  49937. // must be valid for the type of field you are filtering by (string,
  49938. // number, boolean). For string fields, the literal value is interpreted
  49939. // as a regular expression using RE2 syntax. The literal value must
  49940. // match the entire field.
  49941. //
  49942. // For example, to filter for instances that do not have a name of
  49943. // example-instance, you would use name ne example-instance.
  49944. //
  49945. // You can filter on nested fields. For example, you could filter on
  49946. // instances that have set the scheduling.automaticRestart field to
  49947. // true. Use filtering on nested fields to take advantage of labels to
  49948. // organize and search for results based on label values.
  49949. //
  49950. // To filter on multiple expressions, provide each separate expression
  49951. // within parentheses. For example, (scheduling.automaticRestart eq
  49952. // true) (zone eq us-central1-f). Multiple expressions are treated as
  49953. // AND expressions, meaning that resources must match all expressions to
  49954. // pass the filters.
  49955. func (c *TargetInstancesListCall) Filter(filter string) *TargetInstancesListCall {
  49956. c.urlParams_.Set("filter", filter)
  49957. return c
  49958. }
  49959. // MaxResults sets the optional parameter "maxResults": The maximum
  49960. // number of results per page that should be returned. If the number of
  49961. // available results is larger than maxResults, Compute Engine returns a
  49962. // nextPageToken that can be used to get the next page of results in
  49963. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  49964. // (Default: 500)
  49965. func (c *TargetInstancesListCall) MaxResults(maxResults int64) *TargetInstancesListCall {
  49966. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  49967. return c
  49968. }
  49969. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  49970. // a certain order. By default, results are returned in alphanumerical
  49971. // order based on the resource name.
  49972. //
  49973. // You can also sort results in descending order based on the creation
  49974. // timestamp using orderBy="creationTimestamp desc". This sorts results
  49975. // based on the creationTimestamp field in reverse chronological order
  49976. // (newest result first). Use this to sort resources like operations so
  49977. // that the newest operation is returned first.
  49978. //
  49979. // Currently, only sorting by name or creationTimestamp desc is
  49980. // supported.
  49981. func (c *TargetInstancesListCall) OrderBy(orderBy string) *TargetInstancesListCall {
  49982. c.urlParams_.Set("orderBy", orderBy)
  49983. return c
  49984. }
  49985. // PageToken sets the optional parameter "pageToken": Specifies a page
  49986. // token to use. Set pageToken to the nextPageToken returned by a
  49987. // previous list request to get the next page of results.
  49988. func (c *TargetInstancesListCall) PageToken(pageToken string) *TargetInstancesListCall {
  49989. c.urlParams_.Set("pageToken", pageToken)
  49990. return c
  49991. }
  49992. // Fields allows partial responses to be retrieved. See
  49993. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49994. // for more information.
  49995. func (c *TargetInstancesListCall) Fields(s ...googleapi.Field) *TargetInstancesListCall {
  49996. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49997. return c
  49998. }
  49999. // IfNoneMatch sets the optional parameter which makes the operation
  50000. // fail if the object's ETag matches the given value. This is useful for
  50001. // getting updates only after the object has changed since the last
  50002. // request. Use googleapi.IsNotModified to check whether the response
  50003. // error from Do is the result of In-None-Match.
  50004. func (c *TargetInstancesListCall) IfNoneMatch(entityTag string) *TargetInstancesListCall {
  50005. c.ifNoneMatch_ = entityTag
  50006. return c
  50007. }
  50008. // Context sets the context to be used in this call's Do method. Any
  50009. // pending HTTP request will be aborted if the provided context is
  50010. // canceled.
  50011. func (c *TargetInstancesListCall) Context(ctx context.Context) *TargetInstancesListCall {
  50012. c.ctx_ = ctx
  50013. return c
  50014. }
  50015. // Header returns an http.Header that can be modified by the caller to
  50016. // add HTTP headers to the request.
  50017. func (c *TargetInstancesListCall) Header() http.Header {
  50018. if c.header_ == nil {
  50019. c.header_ = make(http.Header)
  50020. }
  50021. return c.header_
  50022. }
  50023. func (c *TargetInstancesListCall) doRequest(alt string) (*http.Response, error) {
  50024. reqHeaders := make(http.Header)
  50025. for k, v := range c.header_ {
  50026. reqHeaders[k] = v
  50027. }
  50028. reqHeaders.Set("User-Agent", c.s.userAgent())
  50029. if c.ifNoneMatch_ != "" {
  50030. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  50031. }
  50032. var body io.Reader = nil
  50033. c.urlParams_.Set("alt", alt)
  50034. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances")
  50035. urls += "?" + c.urlParams_.Encode()
  50036. req, _ := http.NewRequest("GET", urls, body)
  50037. req.Header = reqHeaders
  50038. googleapi.Expand(req.URL, map[string]string{
  50039. "project": c.project,
  50040. "zone": c.zone,
  50041. })
  50042. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50043. }
  50044. // Do executes the "compute.targetInstances.list" call.
  50045. // Exactly one of *TargetInstanceList or error will be non-nil. Any
  50046. // non-2xx status code is an error. Response headers are in either
  50047. // *TargetInstanceList.ServerResponse.Header or (if a response was
  50048. // returned at all) in error.(*googleapi.Error).Header. Use
  50049. // googleapi.IsNotModified to check whether the returned error was
  50050. // because http.StatusNotModified was returned.
  50051. func (c *TargetInstancesListCall) Do(opts ...googleapi.CallOption) (*TargetInstanceList, error) {
  50052. gensupport.SetOptions(c.urlParams_, opts...)
  50053. res, err := c.doRequest("json")
  50054. if res != nil && res.StatusCode == http.StatusNotModified {
  50055. if res.Body != nil {
  50056. res.Body.Close()
  50057. }
  50058. return nil, &googleapi.Error{
  50059. Code: res.StatusCode,
  50060. Header: res.Header,
  50061. }
  50062. }
  50063. if err != nil {
  50064. return nil, err
  50065. }
  50066. defer googleapi.CloseBody(res)
  50067. if err := googleapi.CheckResponse(res); err != nil {
  50068. return nil, err
  50069. }
  50070. ret := &TargetInstanceList{
  50071. ServerResponse: googleapi.ServerResponse{
  50072. Header: res.Header,
  50073. HTTPStatusCode: res.StatusCode,
  50074. },
  50075. }
  50076. target := &ret
  50077. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  50078. return nil, err
  50079. }
  50080. return ret, nil
  50081. // {
  50082. // "description": "Retrieves a list of TargetInstance resources available to the specified project and zone.",
  50083. // "httpMethod": "GET",
  50084. // "id": "compute.targetInstances.list",
  50085. // "parameterOrder": [
  50086. // "project",
  50087. // "zone"
  50088. // ],
  50089. // "parameters": {
  50090. // "filter": {
  50091. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  50092. // "location": "query",
  50093. // "type": "string"
  50094. // },
  50095. // "maxResults": {
  50096. // "default": "500",
  50097. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  50098. // "format": "uint32",
  50099. // "location": "query",
  50100. // "minimum": "0",
  50101. // "type": "integer"
  50102. // },
  50103. // "orderBy": {
  50104. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  50105. // "location": "query",
  50106. // "type": "string"
  50107. // },
  50108. // "pageToken": {
  50109. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  50110. // "location": "query",
  50111. // "type": "string"
  50112. // },
  50113. // "project": {
  50114. // "description": "Project ID for this request.",
  50115. // "location": "path",
  50116. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50117. // "required": true,
  50118. // "type": "string"
  50119. // },
  50120. // "zone": {
  50121. // "description": "Name of the zone scoping this request.",
  50122. // "location": "path",
  50123. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  50124. // "required": true,
  50125. // "type": "string"
  50126. // }
  50127. // },
  50128. // "path": "{project}/zones/{zone}/targetInstances",
  50129. // "response": {
  50130. // "$ref": "TargetInstanceList"
  50131. // },
  50132. // "scopes": [
  50133. // "https://www.googleapis.com/auth/cloud-platform",
  50134. // "https://www.googleapis.com/auth/compute",
  50135. // "https://www.googleapis.com/auth/compute.readonly"
  50136. // ]
  50137. // }
  50138. }
  50139. // Pages invokes f for each page of results.
  50140. // A non-nil error returned from f will halt the iteration.
  50141. // The provided context supersedes any context provided to the Context method.
  50142. func (c *TargetInstancesListCall) Pages(ctx context.Context, f func(*TargetInstanceList) error) error {
  50143. c.ctx_ = ctx
  50144. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  50145. for {
  50146. x, err := c.Do()
  50147. if err != nil {
  50148. return err
  50149. }
  50150. if err := f(x); err != nil {
  50151. return err
  50152. }
  50153. if x.NextPageToken == "" {
  50154. return nil
  50155. }
  50156. c.PageToken(x.NextPageToken)
  50157. }
  50158. }
  50159. // method id "compute.targetPools.addHealthCheck":
  50160. type TargetPoolsAddHealthCheckCall struct {
  50161. s *Service
  50162. project string
  50163. region string
  50164. targetPool string
  50165. targetpoolsaddhealthcheckrequest *TargetPoolsAddHealthCheckRequest
  50166. urlParams_ gensupport.URLParams
  50167. ctx_ context.Context
  50168. header_ http.Header
  50169. }
  50170. // AddHealthCheck: Adds health check URLs to a target pool.
  50171. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/addHealthCheck
  50172. func (r *TargetPoolsService) AddHealthCheck(project string, region string, targetPool string, targetpoolsaddhealthcheckrequest *TargetPoolsAddHealthCheckRequest) *TargetPoolsAddHealthCheckCall {
  50173. c := &TargetPoolsAddHealthCheckCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50174. c.project = project
  50175. c.region = region
  50176. c.targetPool = targetPool
  50177. c.targetpoolsaddhealthcheckrequest = targetpoolsaddhealthcheckrequest
  50178. return c
  50179. }
  50180. // Fields allows partial responses to be retrieved. See
  50181. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50182. // for more information.
  50183. func (c *TargetPoolsAddHealthCheckCall) Fields(s ...googleapi.Field) *TargetPoolsAddHealthCheckCall {
  50184. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50185. return c
  50186. }
  50187. // Context sets the context to be used in this call's Do method. Any
  50188. // pending HTTP request will be aborted if the provided context is
  50189. // canceled.
  50190. func (c *TargetPoolsAddHealthCheckCall) Context(ctx context.Context) *TargetPoolsAddHealthCheckCall {
  50191. c.ctx_ = ctx
  50192. return c
  50193. }
  50194. // Header returns an http.Header that can be modified by the caller to
  50195. // add HTTP headers to the request.
  50196. func (c *TargetPoolsAddHealthCheckCall) Header() http.Header {
  50197. if c.header_ == nil {
  50198. c.header_ = make(http.Header)
  50199. }
  50200. return c.header_
  50201. }
  50202. func (c *TargetPoolsAddHealthCheckCall) doRequest(alt string) (*http.Response, error) {
  50203. reqHeaders := make(http.Header)
  50204. for k, v := range c.header_ {
  50205. reqHeaders[k] = v
  50206. }
  50207. reqHeaders.Set("User-Agent", c.s.userAgent())
  50208. var body io.Reader = nil
  50209. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsaddhealthcheckrequest)
  50210. if err != nil {
  50211. return nil, err
  50212. }
  50213. reqHeaders.Set("Content-Type", "application/json")
  50214. c.urlParams_.Set("alt", alt)
  50215. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck")
  50216. urls += "?" + c.urlParams_.Encode()
  50217. req, _ := http.NewRequest("POST", urls, body)
  50218. req.Header = reqHeaders
  50219. googleapi.Expand(req.URL, map[string]string{
  50220. "project": c.project,
  50221. "region": c.region,
  50222. "targetPool": c.targetPool,
  50223. })
  50224. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50225. }
  50226. // Do executes the "compute.targetPools.addHealthCheck" call.
  50227. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  50228. // status code is an error. Response headers are in either
  50229. // *Operation.ServerResponse.Header or (if a response was returned at
  50230. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  50231. // to check whether the returned error was because
  50232. // http.StatusNotModified was returned.
  50233. func (c *TargetPoolsAddHealthCheckCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  50234. gensupport.SetOptions(c.urlParams_, opts...)
  50235. res, err := c.doRequest("json")
  50236. if res != nil && res.StatusCode == http.StatusNotModified {
  50237. if res.Body != nil {
  50238. res.Body.Close()
  50239. }
  50240. return nil, &googleapi.Error{
  50241. Code: res.StatusCode,
  50242. Header: res.Header,
  50243. }
  50244. }
  50245. if err != nil {
  50246. return nil, err
  50247. }
  50248. defer googleapi.CloseBody(res)
  50249. if err := googleapi.CheckResponse(res); err != nil {
  50250. return nil, err
  50251. }
  50252. ret := &Operation{
  50253. ServerResponse: googleapi.ServerResponse{
  50254. Header: res.Header,
  50255. HTTPStatusCode: res.StatusCode,
  50256. },
  50257. }
  50258. target := &ret
  50259. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  50260. return nil, err
  50261. }
  50262. return ret, nil
  50263. // {
  50264. // "description": "Adds health check URLs to a target pool.",
  50265. // "httpMethod": "POST",
  50266. // "id": "compute.targetPools.addHealthCheck",
  50267. // "parameterOrder": [
  50268. // "project",
  50269. // "region",
  50270. // "targetPool"
  50271. // ],
  50272. // "parameters": {
  50273. // "project": {
  50274. // "description": "Project ID for this request.",
  50275. // "location": "path",
  50276. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50277. // "required": true,
  50278. // "type": "string"
  50279. // },
  50280. // "region": {
  50281. // "description": "Name of the region scoping this request.",
  50282. // "location": "path",
  50283. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  50284. // "required": true,
  50285. // "type": "string"
  50286. // },
  50287. // "targetPool": {
  50288. // "description": "Name of the target pool to add a health check to.",
  50289. // "location": "path",
  50290. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  50291. // "required": true,
  50292. // "type": "string"
  50293. // }
  50294. // },
  50295. // "path": "{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck",
  50296. // "request": {
  50297. // "$ref": "TargetPoolsAddHealthCheckRequest"
  50298. // },
  50299. // "response": {
  50300. // "$ref": "Operation"
  50301. // },
  50302. // "scopes": [
  50303. // "https://www.googleapis.com/auth/cloud-platform",
  50304. // "https://www.googleapis.com/auth/compute"
  50305. // ]
  50306. // }
  50307. }
  50308. // method id "compute.targetPools.addInstance":
  50309. type TargetPoolsAddInstanceCall struct {
  50310. s *Service
  50311. project string
  50312. region string
  50313. targetPool string
  50314. targetpoolsaddinstancerequest *TargetPoolsAddInstanceRequest
  50315. urlParams_ gensupport.URLParams
  50316. ctx_ context.Context
  50317. header_ http.Header
  50318. }
  50319. // AddInstance: Adds an instance to a target pool.
  50320. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/addInstance
  50321. func (r *TargetPoolsService) AddInstance(project string, region string, targetPool string, targetpoolsaddinstancerequest *TargetPoolsAddInstanceRequest) *TargetPoolsAddInstanceCall {
  50322. c := &TargetPoolsAddInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50323. c.project = project
  50324. c.region = region
  50325. c.targetPool = targetPool
  50326. c.targetpoolsaddinstancerequest = targetpoolsaddinstancerequest
  50327. return c
  50328. }
  50329. // Fields allows partial responses to be retrieved. See
  50330. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50331. // for more information.
  50332. func (c *TargetPoolsAddInstanceCall) Fields(s ...googleapi.Field) *TargetPoolsAddInstanceCall {
  50333. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50334. return c
  50335. }
  50336. // Context sets the context to be used in this call's Do method. Any
  50337. // pending HTTP request will be aborted if the provided context is
  50338. // canceled.
  50339. func (c *TargetPoolsAddInstanceCall) Context(ctx context.Context) *TargetPoolsAddInstanceCall {
  50340. c.ctx_ = ctx
  50341. return c
  50342. }
  50343. // Header returns an http.Header that can be modified by the caller to
  50344. // add HTTP headers to the request.
  50345. func (c *TargetPoolsAddInstanceCall) Header() http.Header {
  50346. if c.header_ == nil {
  50347. c.header_ = make(http.Header)
  50348. }
  50349. return c.header_
  50350. }
  50351. func (c *TargetPoolsAddInstanceCall) doRequest(alt string) (*http.Response, error) {
  50352. reqHeaders := make(http.Header)
  50353. for k, v := range c.header_ {
  50354. reqHeaders[k] = v
  50355. }
  50356. reqHeaders.Set("User-Agent", c.s.userAgent())
  50357. var body io.Reader = nil
  50358. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsaddinstancerequest)
  50359. if err != nil {
  50360. return nil, err
  50361. }
  50362. reqHeaders.Set("Content-Type", "application/json")
  50363. c.urlParams_.Set("alt", alt)
  50364. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/addInstance")
  50365. urls += "?" + c.urlParams_.Encode()
  50366. req, _ := http.NewRequest("POST", urls, body)
  50367. req.Header = reqHeaders
  50368. googleapi.Expand(req.URL, map[string]string{
  50369. "project": c.project,
  50370. "region": c.region,
  50371. "targetPool": c.targetPool,
  50372. })
  50373. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50374. }
  50375. // Do executes the "compute.targetPools.addInstance" call.
  50376. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  50377. // status code is an error. Response headers are in either
  50378. // *Operation.ServerResponse.Header or (if a response was returned at
  50379. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  50380. // to check whether the returned error was because
  50381. // http.StatusNotModified was returned.
  50382. func (c *TargetPoolsAddInstanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  50383. gensupport.SetOptions(c.urlParams_, opts...)
  50384. res, err := c.doRequest("json")
  50385. if res != nil && res.StatusCode == http.StatusNotModified {
  50386. if res.Body != nil {
  50387. res.Body.Close()
  50388. }
  50389. return nil, &googleapi.Error{
  50390. Code: res.StatusCode,
  50391. Header: res.Header,
  50392. }
  50393. }
  50394. if err != nil {
  50395. return nil, err
  50396. }
  50397. defer googleapi.CloseBody(res)
  50398. if err := googleapi.CheckResponse(res); err != nil {
  50399. return nil, err
  50400. }
  50401. ret := &Operation{
  50402. ServerResponse: googleapi.ServerResponse{
  50403. Header: res.Header,
  50404. HTTPStatusCode: res.StatusCode,
  50405. },
  50406. }
  50407. target := &ret
  50408. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  50409. return nil, err
  50410. }
  50411. return ret, nil
  50412. // {
  50413. // "description": "Adds an instance to a target pool.",
  50414. // "httpMethod": "POST",
  50415. // "id": "compute.targetPools.addInstance",
  50416. // "parameterOrder": [
  50417. // "project",
  50418. // "region",
  50419. // "targetPool"
  50420. // ],
  50421. // "parameters": {
  50422. // "project": {
  50423. // "description": "Project ID for this request.",
  50424. // "location": "path",
  50425. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50426. // "required": true,
  50427. // "type": "string"
  50428. // },
  50429. // "region": {
  50430. // "description": "Name of the region scoping this request.",
  50431. // "location": "path",
  50432. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  50433. // "required": true,
  50434. // "type": "string"
  50435. // },
  50436. // "targetPool": {
  50437. // "description": "Name of the TargetPool resource to add instances to.",
  50438. // "location": "path",
  50439. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  50440. // "required": true,
  50441. // "type": "string"
  50442. // }
  50443. // },
  50444. // "path": "{project}/regions/{region}/targetPools/{targetPool}/addInstance",
  50445. // "request": {
  50446. // "$ref": "TargetPoolsAddInstanceRequest"
  50447. // },
  50448. // "response": {
  50449. // "$ref": "Operation"
  50450. // },
  50451. // "scopes": [
  50452. // "https://www.googleapis.com/auth/cloud-platform",
  50453. // "https://www.googleapis.com/auth/compute"
  50454. // ]
  50455. // }
  50456. }
  50457. // method id "compute.targetPools.aggregatedList":
  50458. type TargetPoolsAggregatedListCall struct {
  50459. s *Service
  50460. project string
  50461. urlParams_ gensupport.URLParams
  50462. ifNoneMatch_ string
  50463. ctx_ context.Context
  50464. header_ http.Header
  50465. }
  50466. // AggregatedList: Retrieves an aggregated list of target pools.
  50467. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/aggregatedList
  50468. func (r *TargetPoolsService) AggregatedList(project string) *TargetPoolsAggregatedListCall {
  50469. c := &TargetPoolsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50470. c.project = project
  50471. return c
  50472. }
  50473. // Filter sets the optional parameter "filter": Sets a filter
  50474. // {expression} for filtering listed resources. Your {expression} must
  50475. // be in the format: field_name comparison_string literal_string.
  50476. //
  50477. // The field_name is the name of the field you want to compare. Only
  50478. // atomic field types are supported (string, number, boolean). The
  50479. // comparison_string must be either eq (equals) or ne (not equals). The
  50480. // literal_string is the string value to filter to. The literal value
  50481. // must be valid for the type of field you are filtering by (string,
  50482. // number, boolean). For string fields, the literal value is interpreted
  50483. // as a regular expression using RE2 syntax. The literal value must
  50484. // match the entire field.
  50485. //
  50486. // For example, to filter for instances that do not have a name of
  50487. // example-instance, you would use name ne example-instance.
  50488. //
  50489. // You can filter on nested fields. For example, you could filter on
  50490. // instances that have set the scheduling.automaticRestart field to
  50491. // true. Use filtering on nested fields to take advantage of labels to
  50492. // organize and search for results based on label values.
  50493. //
  50494. // To filter on multiple expressions, provide each separate expression
  50495. // within parentheses. For example, (scheduling.automaticRestart eq
  50496. // true) (zone eq us-central1-f). Multiple expressions are treated as
  50497. // AND expressions, meaning that resources must match all expressions to
  50498. // pass the filters.
  50499. func (c *TargetPoolsAggregatedListCall) Filter(filter string) *TargetPoolsAggregatedListCall {
  50500. c.urlParams_.Set("filter", filter)
  50501. return c
  50502. }
  50503. // MaxResults sets the optional parameter "maxResults": The maximum
  50504. // number of results per page that should be returned. If the number of
  50505. // available results is larger than maxResults, Compute Engine returns a
  50506. // nextPageToken that can be used to get the next page of results in
  50507. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  50508. // (Default: 500)
  50509. func (c *TargetPoolsAggregatedListCall) MaxResults(maxResults int64) *TargetPoolsAggregatedListCall {
  50510. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  50511. return c
  50512. }
  50513. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  50514. // a certain order. By default, results are returned in alphanumerical
  50515. // order based on the resource name.
  50516. //
  50517. // You can also sort results in descending order based on the creation
  50518. // timestamp using orderBy="creationTimestamp desc". This sorts results
  50519. // based on the creationTimestamp field in reverse chronological order
  50520. // (newest result first). Use this to sort resources like operations so
  50521. // that the newest operation is returned first.
  50522. //
  50523. // Currently, only sorting by name or creationTimestamp desc is
  50524. // supported.
  50525. func (c *TargetPoolsAggregatedListCall) OrderBy(orderBy string) *TargetPoolsAggregatedListCall {
  50526. c.urlParams_.Set("orderBy", orderBy)
  50527. return c
  50528. }
  50529. // PageToken sets the optional parameter "pageToken": Specifies a page
  50530. // token to use. Set pageToken to the nextPageToken returned by a
  50531. // previous list request to get the next page of results.
  50532. func (c *TargetPoolsAggregatedListCall) PageToken(pageToken string) *TargetPoolsAggregatedListCall {
  50533. c.urlParams_.Set("pageToken", pageToken)
  50534. return c
  50535. }
  50536. // Fields allows partial responses to be retrieved. See
  50537. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50538. // for more information.
  50539. func (c *TargetPoolsAggregatedListCall) Fields(s ...googleapi.Field) *TargetPoolsAggregatedListCall {
  50540. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50541. return c
  50542. }
  50543. // IfNoneMatch sets the optional parameter which makes the operation
  50544. // fail if the object's ETag matches the given value. This is useful for
  50545. // getting updates only after the object has changed since the last
  50546. // request. Use googleapi.IsNotModified to check whether the response
  50547. // error from Do is the result of In-None-Match.
  50548. func (c *TargetPoolsAggregatedListCall) IfNoneMatch(entityTag string) *TargetPoolsAggregatedListCall {
  50549. c.ifNoneMatch_ = entityTag
  50550. return c
  50551. }
  50552. // Context sets the context to be used in this call's Do method. Any
  50553. // pending HTTP request will be aborted if the provided context is
  50554. // canceled.
  50555. func (c *TargetPoolsAggregatedListCall) Context(ctx context.Context) *TargetPoolsAggregatedListCall {
  50556. c.ctx_ = ctx
  50557. return c
  50558. }
  50559. // Header returns an http.Header that can be modified by the caller to
  50560. // add HTTP headers to the request.
  50561. func (c *TargetPoolsAggregatedListCall) Header() http.Header {
  50562. if c.header_ == nil {
  50563. c.header_ = make(http.Header)
  50564. }
  50565. return c.header_
  50566. }
  50567. func (c *TargetPoolsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  50568. reqHeaders := make(http.Header)
  50569. for k, v := range c.header_ {
  50570. reqHeaders[k] = v
  50571. }
  50572. reqHeaders.Set("User-Agent", c.s.userAgent())
  50573. if c.ifNoneMatch_ != "" {
  50574. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  50575. }
  50576. var body io.Reader = nil
  50577. c.urlParams_.Set("alt", alt)
  50578. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetPools")
  50579. urls += "?" + c.urlParams_.Encode()
  50580. req, _ := http.NewRequest("GET", urls, body)
  50581. req.Header = reqHeaders
  50582. googleapi.Expand(req.URL, map[string]string{
  50583. "project": c.project,
  50584. })
  50585. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50586. }
  50587. // Do executes the "compute.targetPools.aggregatedList" call.
  50588. // Exactly one of *TargetPoolAggregatedList or error will be non-nil.
  50589. // Any non-2xx status code is an error. Response headers are in either
  50590. // *TargetPoolAggregatedList.ServerResponse.Header or (if a response was
  50591. // returned at all) in error.(*googleapi.Error).Header. Use
  50592. // googleapi.IsNotModified to check whether the returned error was
  50593. // because http.StatusNotModified was returned.
  50594. func (c *TargetPoolsAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetPoolAggregatedList, error) {
  50595. gensupport.SetOptions(c.urlParams_, opts...)
  50596. res, err := c.doRequest("json")
  50597. if res != nil && res.StatusCode == http.StatusNotModified {
  50598. if res.Body != nil {
  50599. res.Body.Close()
  50600. }
  50601. return nil, &googleapi.Error{
  50602. Code: res.StatusCode,
  50603. Header: res.Header,
  50604. }
  50605. }
  50606. if err != nil {
  50607. return nil, err
  50608. }
  50609. defer googleapi.CloseBody(res)
  50610. if err := googleapi.CheckResponse(res); err != nil {
  50611. return nil, err
  50612. }
  50613. ret := &TargetPoolAggregatedList{
  50614. ServerResponse: googleapi.ServerResponse{
  50615. Header: res.Header,
  50616. HTTPStatusCode: res.StatusCode,
  50617. },
  50618. }
  50619. target := &ret
  50620. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  50621. return nil, err
  50622. }
  50623. return ret, nil
  50624. // {
  50625. // "description": "Retrieves an aggregated list of target pools.",
  50626. // "httpMethod": "GET",
  50627. // "id": "compute.targetPools.aggregatedList",
  50628. // "parameterOrder": [
  50629. // "project"
  50630. // ],
  50631. // "parameters": {
  50632. // "filter": {
  50633. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  50634. // "location": "query",
  50635. // "type": "string"
  50636. // },
  50637. // "maxResults": {
  50638. // "default": "500",
  50639. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  50640. // "format": "uint32",
  50641. // "location": "query",
  50642. // "minimum": "0",
  50643. // "type": "integer"
  50644. // },
  50645. // "orderBy": {
  50646. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  50647. // "location": "query",
  50648. // "type": "string"
  50649. // },
  50650. // "pageToken": {
  50651. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  50652. // "location": "query",
  50653. // "type": "string"
  50654. // },
  50655. // "project": {
  50656. // "description": "Project ID for this request.",
  50657. // "location": "path",
  50658. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50659. // "required": true,
  50660. // "type": "string"
  50661. // }
  50662. // },
  50663. // "path": "{project}/aggregated/targetPools",
  50664. // "response": {
  50665. // "$ref": "TargetPoolAggregatedList"
  50666. // },
  50667. // "scopes": [
  50668. // "https://www.googleapis.com/auth/cloud-platform",
  50669. // "https://www.googleapis.com/auth/compute",
  50670. // "https://www.googleapis.com/auth/compute.readonly"
  50671. // ]
  50672. // }
  50673. }
  50674. // Pages invokes f for each page of results.
  50675. // A non-nil error returned from f will halt the iteration.
  50676. // The provided context supersedes any context provided to the Context method.
  50677. func (c *TargetPoolsAggregatedListCall) Pages(ctx context.Context, f func(*TargetPoolAggregatedList) error) error {
  50678. c.ctx_ = ctx
  50679. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  50680. for {
  50681. x, err := c.Do()
  50682. if err != nil {
  50683. return err
  50684. }
  50685. if err := f(x); err != nil {
  50686. return err
  50687. }
  50688. if x.NextPageToken == "" {
  50689. return nil
  50690. }
  50691. c.PageToken(x.NextPageToken)
  50692. }
  50693. }
  50694. // method id "compute.targetPools.delete":
  50695. type TargetPoolsDeleteCall struct {
  50696. s *Service
  50697. project string
  50698. region string
  50699. targetPool string
  50700. urlParams_ gensupport.URLParams
  50701. ctx_ context.Context
  50702. header_ http.Header
  50703. }
  50704. // Delete: Deletes the specified target pool.
  50705. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/delete
  50706. func (r *TargetPoolsService) Delete(project string, region string, targetPool string) *TargetPoolsDeleteCall {
  50707. c := &TargetPoolsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50708. c.project = project
  50709. c.region = region
  50710. c.targetPool = targetPool
  50711. return c
  50712. }
  50713. // Fields allows partial responses to be retrieved. See
  50714. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50715. // for more information.
  50716. func (c *TargetPoolsDeleteCall) Fields(s ...googleapi.Field) *TargetPoolsDeleteCall {
  50717. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50718. return c
  50719. }
  50720. // Context sets the context to be used in this call's Do method. Any
  50721. // pending HTTP request will be aborted if the provided context is
  50722. // canceled.
  50723. func (c *TargetPoolsDeleteCall) Context(ctx context.Context) *TargetPoolsDeleteCall {
  50724. c.ctx_ = ctx
  50725. return c
  50726. }
  50727. // Header returns an http.Header that can be modified by the caller to
  50728. // add HTTP headers to the request.
  50729. func (c *TargetPoolsDeleteCall) Header() http.Header {
  50730. if c.header_ == nil {
  50731. c.header_ = make(http.Header)
  50732. }
  50733. return c.header_
  50734. }
  50735. func (c *TargetPoolsDeleteCall) doRequest(alt string) (*http.Response, error) {
  50736. reqHeaders := make(http.Header)
  50737. for k, v := range c.header_ {
  50738. reqHeaders[k] = v
  50739. }
  50740. reqHeaders.Set("User-Agent", c.s.userAgent())
  50741. var body io.Reader = nil
  50742. c.urlParams_.Set("alt", alt)
  50743. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}")
  50744. urls += "?" + c.urlParams_.Encode()
  50745. req, _ := http.NewRequest("DELETE", urls, body)
  50746. req.Header = reqHeaders
  50747. googleapi.Expand(req.URL, map[string]string{
  50748. "project": c.project,
  50749. "region": c.region,
  50750. "targetPool": c.targetPool,
  50751. })
  50752. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50753. }
  50754. // Do executes the "compute.targetPools.delete" call.
  50755. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  50756. // status code is an error. Response headers are in either
  50757. // *Operation.ServerResponse.Header or (if a response was returned at
  50758. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  50759. // to check whether the returned error was because
  50760. // http.StatusNotModified was returned.
  50761. func (c *TargetPoolsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  50762. gensupport.SetOptions(c.urlParams_, opts...)
  50763. res, err := c.doRequest("json")
  50764. if res != nil && res.StatusCode == http.StatusNotModified {
  50765. if res.Body != nil {
  50766. res.Body.Close()
  50767. }
  50768. return nil, &googleapi.Error{
  50769. Code: res.StatusCode,
  50770. Header: res.Header,
  50771. }
  50772. }
  50773. if err != nil {
  50774. return nil, err
  50775. }
  50776. defer googleapi.CloseBody(res)
  50777. if err := googleapi.CheckResponse(res); err != nil {
  50778. return nil, err
  50779. }
  50780. ret := &Operation{
  50781. ServerResponse: googleapi.ServerResponse{
  50782. Header: res.Header,
  50783. HTTPStatusCode: res.StatusCode,
  50784. },
  50785. }
  50786. target := &ret
  50787. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  50788. return nil, err
  50789. }
  50790. return ret, nil
  50791. // {
  50792. // "description": "Deletes the specified target pool.",
  50793. // "httpMethod": "DELETE",
  50794. // "id": "compute.targetPools.delete",
  50795. // "parameterOrder": [
  50796. // "project",
  50797. // "region",
  50798. // "targetPool"
  50799. // ],
  50800. // "parameters": {
  50801. // "project": {
  50802. // "description": "Project ID for this request.",
  50803. // "location": "path",
  50804. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50805. // "required": true,
  50806. // "type": "string"
  50807. // },
  50808. // "region": {
  50809. // "description": "Name of the region scoping this request.",
  50810. // "location": "path",
  50811. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  50812. // "required": true,
  50813. // "type": "string"
  50814. // },
  50815. // "targetPool": {
  50816. // "description": "Name of the TargetPool resource to delete.",
  50817. // "location": "path",
  50818. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  50819. // "required": true,
  50820. // "type": "string"
  50821. // }
  50822. // },
  50823. // "path": "{project}/regions/{region}/targetPools/{targetPool}",
  50824. // "response": {
  50825. // "$ref": "Operation"
  50826. // },
  50827. // "scopes": [
  50828. // "https://www.googleapis.com/auth/cloud-platform",
  50829. // "https://www.googleapis.com/auth/compute"
  50830. // ]
  50831. // }
  50832. }
  50833. // method id "compute.targetPools.get":
  50834. type TargetPoolsGetCall struct {
  50835. s *Service
  50836. project string
  50837. region string
  50838. targetPool string
  50839. urlParams_ gensupport.URLParams
  50840. ifNoneMatch_ string
  50841. ctx_ context.Context
  50842. header_ http.Header
  50843. }
  50844. // Get: Returns the specified target pool. Get a list of available
  50845. // target pools by making a list() request.
  50846. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/get
  50847. func (r *TargetPoolsService) Get(project string, region string, targetPool string) *TargetPoolsGetCall {
  50848. c := &TargetPoolsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50849. c.project = project
  50850. c.region = region
  50851. c.targetPool = targetPool
  50852. return c
  50853. }
  50854. // Fields allows partial responses to be retrieved. See
  50855. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50856. // for more information.
  50857. func (c *TargetPoolsGetCall) Fields(s ...googleapi.Field) *TargetPoolsGetCall {
  50858. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50859. return c
  50860. }
  50861. // IfNoneMatch sets the optional parameter which makes the operation
  50862. // fail if the object's ETag matches the given value. This is useful for
  50863. // getting updates only after the object has changed since the last
  50864. // request. Use googleapi.IsNotModified to check whether the response
  50865. // error from Do is the result of In-None-Match.
  50866. func (c *TargetPoolsGetCall) IfNoneMatch(entityTag string) *TargetPoolsGetCall {
  50867. c.ifNoneMatch_ = entityTag
  50868. return c
  50869. }
  50870. // Context sets the context to be used in this call's Do method. Any
  50871. // pending HTTP request will be aborted if the provided context is
  50872. // canceled.
  50873. func (c *TargetPoolsGetCall) Context(ctx context.Context) *TargetPoolsGetCall {
  50874. c.ctx_ = ctx
  50875. return c
  50876. }
  50877. // Header returns an http.Header that can be modified by the caller to
  50878. // add HTTP headers to the request.
  50879. func (c *TargetPoolsGetCall) Header() http.Header {
  50880. if c.header_ == nil {
  50881. c.header_ = make(http.Header)
  50882. }
  50883. return c.header_
  50884. }
  50885. func (c *TargetPoolsGetCall) doRequest(alt string) (*http.Response, error) {
  50886. reqHeaders := make(http.Header)
  50887. for k, v := range c.header_ {
  50888. reqHeaders[k] = v
  50889. }
  50890. reqHeaders.Set("User-Agent", c.s.userAgent())
  50891. if c.ifNoneMatch_ != "" {
  50892. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  50893. }
  50894. var body io.Reader = nil
  50895. c.urlParams_.Set("alt", alt)
  50896. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}")
  50897. urls += "?" + c.urlParams_.Encode()
  50898. req, _ := http.NewRequest("GET", urls, body)
  50899. req.Header = reqHeaders
  50900. googleapi.Expand(req.URL, map[string]string{
  50901. "project": c.project,
  50902. "region": c.region,
  50903. "targetPool": c.targetPool,
  50904. })
  50905. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50906. }
  50907. // Do executes the "compute.targetPools.get" call.
  50908. // Exactly one of *TargetPool or error will be non-nil. Any non-2xx
  50909. // status code is an error. Response headers are in either
  50910. // *TargetPool.ServerResponse.Header or (if a response was returned at
  50911. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  50912. // to check whether the returned error was because
  50913. // http.StatusNotModified was returned.
  50914. func (c *TargetPoolsGetCall) Do(opts ...googleapi.CallOption) (*TargetPool, error) {
  50915. gensupport.SetOptions(c.urlParams_, opts...)
  50916. res, err := c.doRequest("json")
  50917. if res != nil && res.StatusCode == http.StatusNotModified {
  50918. if res.Body != nil {
  50919. res.Body.Close()
  50920. }
  50921. return nil, &googleapi.Error{
  50922. Code: res.StatusCode,
  50923. Header: res.Header,
  50924. }
  50925. }
  50926. if err != nil {
  50927. return nil, err
  50928. }
  50929. defer googleapi.CloseBody(res)
  50930. if err := googleapi.CheckResponse(res); err != nil {
  50931. return nil, err
  50932. }
  50933. ret := &TargetPool{
  50934. ServerResponse: googleapi.ServerResponse{
  50935. Header: res.Header,
  50936. HTTPStatusCode: res.StatusCode,
  50937. },
  50938. }
  50939. target := &ret
  50940. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  50941. return nil, err
  50942. }
  50943. return ret, nil
  50944. // {
  50945. // "description": "Returns the specified target pool. Get a list of available target pools by making a list() request.",
  50946. // "httpMethod": "GET",
  50947. // "id": "compute.targetPools.get",
  50948. // "parameterOrder": [
  50949. // "project",
  50950. // "region",
  50951. // "targetPool"
  50952. // ],
  50953. // "parameters": {
  50954. // "project": {
  50955. // "description": "Project ID for this request.",
  50956. // "location": "path",
  50957. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50958. // "required": true,
  50959. // "type": "string"
  50960. // },
  50961. // "region": {
  50962. // "description": "Name of the region scoping this request.",
  50963. // "location": "path",
  50964. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  50965. // "required": true,
  50966. // "type": "string"
  50967. // },
  50968. // "targetPool": {
  50969. // "description": "Name of the TargetPool resource to return.",
  50970. // "location": "path",
  50971. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  50972. // "required": true,
  50973. // "type": "string"
  50974. // }
  50975. // },
  50976. // "path": "{project}/regions/{region}/targetPools/{targetPool}",
  50977. // "response": {
  50978. // "$ref": "TargetPool"
  50979. // },
  50980. // "scopes": [
  50981. // "https://www.googleapis.com/auth/cloud-platform",
  50982. // "https://www.googleapis.com/auth/compute",
  50983. // "https://www.googleapis.com/auth/compute.readonly"
  50984. // ]
  50985. // }
  50986. }
  50987. // method id "compute.targetPools.getHealth":
  50988. type TargetPoolsGetHealthCall struct {
  50989. s *Service
  50990. project string
  50991. region string
  50992. targetPool string
  50993. instancereference *InstanceReference
  50994. urlParams_ gensupport.URLParams
  50995. ctx_ context.Context
  50996. header_ http.Header
  50997. }
  50998. // GetHealth: Gets the most recent health check results for each IP for
  50999. // the instance that is referenced by the given target pool.
  51000. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/getHealth
  51001. func (r *TargetPoolsService) GetHealth(project string, region string, targetPool string, instancereference *InstanceReference) *TargetPoolsGetHealthCall {
  51002. c := &TargetPoolsGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51003. c.project = project
  51004. c.region = region
  51005. c.targetPool = targetPool
  51006. c.instancereference = instancereference
  51007. return c
  51008. }
  51009. // Fields allows partial responses to be retrieved. See
  51010. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51011. // for more information.
  51012. func (c *TargetPoolsGetHealthCall) Fields(s ...googleapi.Field) *TargetPoolsGetHealthCall {
  51013. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51014. return c
  51015. }
  51016. // Context sets the context to be used in this call's Do method. Any
  51017. // pending HTTP request will be aborted if the provided context is
  51018. // canceled.
  51019. func (c *TargetPoolsGetHealthCall) Context(ctx context.Context) *TargetPoolsGetHealthCall {
  51020. c.ctx_ = ctx
  51021. return c
  51022. }
  51023. // Header returns an http.Header that can be modified by the caller to
  51024. // add HTTP headers to the request.
  51025. func (c *TargetPoolsGetHealthCall) Header() http.Header {
  51026. if c.header_ == nil {
  51027. c.header_ = make(http.Header)
  51028. }
  51029. return c.header_
  51030. }
  51031. func (c *TargetPoolsGetHealthCall) doRequest(alt string) (*http.Response, error) {
  51032. reqHeaders := make(http.Header)
  51033. for k, v := range c.header_ {
  51034. reqHeaders[k] = v
  51035. }
  51036. reqHeaders.Set("User-Agent", c.s.userAgent())
  51037. var body io.Reader = nil
  51038. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancereference)
  51039. if err != nil {
  51040. return nil, err
  51041. }
  51042. reqHeaders.Set("Content-Type", "application/json")
  51043. c.urlParams_.Set("alt", alt)
  51044. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/getHealth")
  51045. urls += "?" + c.urlParams_.Encode()
  51046. req, _ := http.NewRequest("POST", urls, body)
  51047. req.Header = reqHeaders
  51048. googleapi.Expand(req.URL, map[string]string{
  51049. "project": c.project,
  51050. "region": c.region,
  51051. "targetPool": c.targetPool,
  51052. })
  51053. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51054. }
  51055. // Do executes the "compute.targetPools.getHealth" call.
  51056. // Exactly one of *TargetPoolInstanceHealth or error will be non-nil.
  51057. // Any non-2xx status code is an error. Response headers are in either
  51058. // *TargetPoolInstanceHealth.ServerResponse.Header or (if a response was
  51059. // returned at all) in error.(*googleapi.Error).Header. Use
  51060. // googleapi.IsNotModified to check whether the returned error was
  51061. // because http.StatusNotModified was returned.
  51062. func (c *TargetPoolsGetHealthCall) Do(opts ...googleapi.CallOption) (*TargetPoolInstanceHealth, error) {
  51063. gensupport.SetOptions(c.urlParams_, opts...)
  51064. res, err := c.doRequest("json")
  51065. if res != nil && res.StatusCode == http.StatusNotModified {
  51066. if res.Body != nil {
  51067. res.Body.Close()
  51068. }
  51069. return nil, &googleapi.Error{
  51070. Code: res.StatusCode,
  51071. Header: res.Header,
  51072. }
  51073. }
  51074. if err != nil {
  51075. return nil, err
  51076. }
  51077. defer googleapi.CloseBody(res)
  51078. if err := googleapi.CheckResponse(res); err != nil {
  51079. return nil, err
  51080. }
  51081. ret := &TargetPoolInstanceHealth{
  51082. ServerResponse: googleapi.ServerResponse{
  51083. Header: res.Header,
  51084. HTTPStatusCode: res.StatusCode,
  51085. },
  51086. }
  51087. target := &ret
  51088. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  51089. return nil, err
  51090. }
  51091. return ret, nil
  51092. // {
  51093. // "description": "Gets the most recent health check results for each IP for the instance that is referenced by the given target pool.",
  51094. // "httpMethod": "POST",
  51095. // "id": "compute.targetPools.getHealth",
  51096. // "parameterOrder": [
  51097. // "project",
  51098. // "region",
  51099. // "targetPool"
  51100. // ],
  51101. // "parameters": {
  51102. // "project": {
  51103. // "description": "Project ID for this request.",
  51104. // "location": "path",
  51105. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51106. // "required": true,
  51107. // "type": "string"
  51108. // },
  51109. // "region": {
  51110. // "description": "Name of the region scoping this request.",
  51111. // "location": "path",
  51112. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51113. // "required": true,
  51114. // "type": "string"
  51115. // },
  51116. // "targetPool": {
  51117. // "description": "Name of the TargetPool resource to which the queried instance belongs.",
  51118. // "location": "path",
  51119. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51120. // "required": true,
  51121. // "type": "string"
  51122. // }
  51123. // },
  51124. // "path": "{project}/regions/{region}/targetPools/{targetPool}/getHealth",
  51125. // "request": {
  51126. // "$ref": "InstanceReference"
  51127. // },
  51128. // "response": {
  51129. // "$ref": "TargetPoolInstanceHealth"
  51130. // },
  51131. // "scopes": [
  51132. // "https://www.googleapis.com/auth/cloud-platform",
  51133. // "https://www.googleapis.com/auth/compute",
  51134. // "https://www.googleapis.com/auth/compute.readonly"
  51135. // ]
  51136. // }
  51137. }
  51138. // method id "compute.targetPools.insert":
  51139. type TargetPoolsInsertCall struct {
  51140. s *Service
  51141. project string
  51142. region string
  51143. targetpool *TargetPool
  51144. urlParams_ gensupport.URLParams
  51145. ctx_ context.Context
  51146. header_ http.Header
  51147. }
  51148. // Insert: Creates a target pool in the specified project and region
  51149. // using the data included in the request.
  51150. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/insert
  51151. func (r *TargetPoolsService) Insert(project string, region string, targetpool *TargetPool) *TargetPoolsInsertCall {
  51152. c := &TargetPoolsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51153. c.project = project
  51154. c.region = region
  51155. c.targetpool = targetpool
  51156. return c
  51157. }
  51158. // Fields allows partial responses to be retrieved. See
  51159. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51160. // for more information.
  51161. func (c *TargetPoolsInsertCall) Fields(s ...googleapi.Field) *TargetPoolsInsertCall {
  51162. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51163. return c
  51164. }
  51165. // Context sets the context to be used in this call's Do method. Any
  51166. // pending HTTP request will be aborted if the provided context is
  51167. // canceled.
  51168. func (c *TargetPoolsInsertCall) Context(ctx context.Context) *TargetPoolsInsertCall {
  51169. c.ctx_ = ctx
  51170. return c
  51171. }
  51172. // Header returns an http.Header that can be modified by the caller to
  51173. // add HTTP headers to the request.
  51174. func (c *TargetPoolsInsertCall) Header() http.Header {
  51175. if c.header_ == nil {
  51176. c.header_ = make(http.Header)
  51177. }
  51178. return c.header_
  51179. }
  51180. func (c *TargetPoolsInsertCall) doRequest(alt string) (*http.Response, error) {
  51181. reqHeaders := make(http.Header)
  51182. for k, v := range c.header_ {
  51183. reqHeaders[k] = v
  51184. }
  51185. reqHeaders.Set("User-Agent", c.s.userAgent())
  51186. var body io.Reader = nil
  51187. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpool)
  51188. if err != nil {
  51189. return nil, err
  51190. }
  51191. reqHeaders.Set("Content-Type", "application/json")
  51192. c.urlParams_.Set("alt", alt)
  51193. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools")
  51194. urls += "?" + c.urlParams_.Encode()
  51195. req, _ := http.NewRequest("POST", urls, body)
  51196. req.Header = reqHeaders
  51197. googleapi.Expand(req.URL, map[string]string{
  51198. "project": c.project,
  51199. "region": c.region,
  51200. })
  51201. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51202. }
  51203. // Do executes the "compute.targetPools.insert" call.
  51204. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  51205. // status code is an error. Response headers are in either
  51206. // *Operation.ServerResponse.Header or (if a response was returned at
  51207. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  51208. // to check whether the returned error was because
  51209. // http.StatusNotModified was returned.
  51210. func (c *TargetPoolsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  51211. gensupport.SetOptions(c.urlParams_, opts...)
  51212. res, err := c.doRequest("json")
  51213. if res != nil && res.StatusCode == http.StatusNotModified {
  51214. if res.Body != nil {
  51215. res.Body.Close()
  51216. }
  51217. return nil, &googleapi.Error{
  51218. Code: res.StatusCode,
  51219. Header: res.Header,
  51220. }
  51221. }
  51222. if err != nil {
  51223. return nil, err
  51224. }
  51225. defer googleapi.CloseBody(res)
  51226. if err := googleapi.CheckResponse(res); err != nil {
  51227. return nil, err
  51228. }
  51229. ret := &Operation{
  51230. ServerResponse: googleapi.ServerResponse{
  51231. Header: res.Header,
  51232. HTTPStatusCode: res.StatusCode,
  51233. },
  51234. }
  51235. target := &ret
  51236. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  51237. return nil, err
  51238. }
  51239. return ret, nil
  51240. // {
  51241. // "description": "Creates a target pool in the specified project and region using the data included in the request.",
  51242. // "httpMethod": "POST",
  51243. // "id": "compute.targetPools.insert",
  51244. // "parameterOrder": [
  51245. // "project",
  51246. // "region"
  51247. // ],
  51248. // "parameters": {
  51249. // "project": {
  51250. // "description": "Project ID for this request.",
  51251. // "location": "path",
  51252. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51253. // "required": true,
  51254. // "type": "string"
  51255. // },
  51256. // "region": {
  51257. // "description": "Name of the region scoping this request.",
  51258. // "location": "path",
  51259. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51260. // "required": true,
  51261. // "type": "string"
  51262. // }
  51263. // },
  51264. // "path": "{project}/regions/{region}/targetPools",
  51265. // "request": {
  51266. // "$ref": "TargetPool"
  51267. // },
  51268. // "response": {
  51269. // "$ref": "Operation"
  51270. // },
  51271. // "scopes": [
  51272. // "https://www.googleapis.com/auth/cloud-platform",
  51273. // "https://www.googleapis.com/auth/compute"
  51274. // ]
  51275. // }
  51276. }
  51277. // method id "compute.targetPools.list":
  51278. type TargetPoolsListCall struct {
  51279. s *Service
  51280. project string
  51281. region string
  51282. urlParams_ gensupport.URLParams
  51283. ifNoneMatch_ string
  51284. ctx_ context.Context
  51285. header_ http.Header
  51286. }
  51287. // List: Retrieves a list of target pools available to the specified
  51288. // project and region.
  51289. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/list
  51290. func (r *TargetPoolsService) List(project string, region string) *TargetPoolsListCall {
  51291. c := &TargetPoolsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51292. c.project = project
  51293. c.region = region
  51294. return c
  51295. }
  51296. // Filter sets the optional parameter "filter": Sets a filter
  51297. // {expression} for filtering listed resources. Your {expression} must
  51298. // be in the format: field_name comparison_string literal_string.
  51299. //
  51300. // The field_name is the name of the field you want to compare. Only
  51301. // atomic field types are supported (string, number, boolean). The
  51302. // comparison_string must be either eq (equals) or ne (not equals). The
  51303. // literal_string is the string value to filter to. The literal value
  51304. // must be valid for the type of field you are filtering by (string,
  51305. // number, boolean). For string fields, the literal value is interpreted
  51306. // as a regular expression using RE2 syntax. The literal value must
  51307. // match the entire field.
  51308. //
  51309. // For example, to filter for instances that do not have a name of
  51310. // example-instance, you would use name ne example-instance.
  51311. //
  51312. // You can filter on nested fields. For example, you could filter on
  51313. // instances that have set the scheduling.automaticRestart field to
  51314. // true. Use filtering on nested fields to take advantage of labels to
  51315. // organize and search for results based on label values.
  51316. //
  51317. // To filter on multiple expressions, provide each separate expression
  51318. // within parentheses. For example, (scheduling.automaticRestart eq
  51319. // true) (zone eq us-central1-f). Multiple expressions are treated as
  51320. // AND expressions, meaning that resources must match all expressions to
  51321. // pass the filters.
  51322. func (c *TargetPoolsListCall) Filter(filter string) *TargetPoolsListCall {
  51323. c.urlParams_.Set("filter", filter)
  51324. return c
  51325. }
  51326. // MaxResults sets the optional parameter "maxResults": The maximum
  51327. // number of results per page that should be returned. If the number of
  51328. // available results is larger than maxResults, Compute Engine returns a
  51329. // nextPageToken that can be used to get the next page of results in
  51330. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  51331. // (Default: 500)
  51332. func (c *TargetPoolsListCall) MaxResults(maxResults int64) *TargetPoolsListCall {
  51333. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  51334. return c
  51335. }
  51336. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  51337. // a certain order. By default, results are returned in alphanumerical
  51338. // order based on the resource name.
  51339. //
  51340. // You can also sort results in descending order based on the creation
  51341. // timestamp using orderBy="creationTimestamp desc". This sorts results
  51342. // based on the creationTimestamp field in reverse chronological order
  51343. // (newest result first). Use this to sort resources like operations so
  51344. // that the newest operation is returned first.
  51345. //
  51346. // Currently, only sorting by name or creationTimestamp desc is
  51347. // supported.
  51348. func (c *TargetPoolsListCall) OrderBy(orderBy string) *TargetPoolsListCall {
  51349. c.urlParams_.Set("orderBy", orderBy)
  51350. return c
  51351. }
  51352. // PageToken sets the optional parameter "pageToken": Specifies a page
  51353. // token to use. Set pageToken to the nextPageToken returned by a
  51354. // previous list request to get the next page of results.
  51355. func (c *TargetPoolsListCall) PageToken(pageToken string) *TargetPoolsListCall {
  51356. c.urlParams_.Set("pageToken", pageToken)
  51357. return c
  51358. }
  51359. // Fields allows partial responses to be retrieved. See
  51360. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51361. // for more information.
  51362. func (c *TargetPoolsListCall) Fields(s ...googleapi.Field) *TargetPoolsListCall {
  51363. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51364. return c
  51365. }
  51366. // IfNoneMatch sets the optional parameter which makes the operation
  51367. // fail if the object's ETag matches the given value. This is useful for
  51368. // getting updates only after the object has changed since the last
  51369. // request. Use googleapi.IsNotModified to check whether the response
  51370. // error from Do is the result of In-None-Match.
  51371. func (c *TargetPoolsListCall) IfNoneMatch(entityTag string) *TargetPoolsListCall {
  51372. c.ifNoneMatch_ = entityTag
  51373. return c
  51374. }
  51375. // Context sets the context to be used in this call's Do method. Any
  51376. // pending HTTP request will be aborted if the provided context is
  51377. // canceled.
  51378. func (c *TargetPoolsListCall) Context(ctx context.Context) *TargetPoolsListCall {
  51379. c.ctx_ = ctx
  51380. return c
  51381. }
  51382. // Header returns an http.Header that can be modified by the caller to
  51383. // add HTTP headers to the request.
  51384. func (c *TargetPoolsListCall) Header() http.Header {
  51385. if c.header_ == nil {
  51386. c.header_ = make(http.Header)
  51387. }
  51388. return c.header_
  51389. }
  51390. func (c *TargetPoolsListCall) doRequest(alt string) (*http.Response, error) {
  51391. reqHeaders := make(http.Header)
  51392. for k, v := range c.header_ {
  51393. reqHeaders[k] = v
  51394. }
  51395. reqHeaders.Set("User-Agent", c.s.userAgent())
  51396. if c.ifNoneMatch_ != "" {
  51397. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  51398. }
  51399. var body io.Reader = nil
  51400. c.urlParams_.Set("alt", alt)
  51401. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools")
  51402. urls += "?" + c.urlParams_.Encode()
  51403. req, _ := http.NewRequest("GET", urls, body)
  51404. req.Header = reqHeaders
  51405. googleapi.Expand(req.URL, map[string]string{
  51406. "project": c.project,
  51407. "region": c.region,
  51408. })
  51409. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51410. }
  51411. // Do executes the "compute.targetPools.list" call.
  51412. // Exactly one of *TargetPoolList or error will be non-nil. Any non-2xx
  51413. // status code is an error. Response headers are in either
  51414. // *TargetPoolList.ServerResponse.Header or (if a response was returned
  51415. // at all) in error.(*googleapi.Error).Header. Use
  51416. // googleapi.IsNotModified to check whether the returned error was
  51417. // because http.StatusNotModified was returned.
  51418. func (c *TargetPoolsListCall) Do(opts ...googleapi.CallOption) (*TargetPoolList, error) {
  51419. gensupport.SetOptions(c.urlParams_, opts...)
  51420. res, err := c.doRequest("json")
  51421. if res != nil && res.StatusCode == http.StatusNotModified {
  51422. if res.Body != nil {
  51423. res.Body.Close()
  51424. }
  51425. return nil, &googleapi.Error{
  51426. Code: res.StatusCode,
  51427. Header: res.Header,
  51428. }
  51429. }
  51430. if err != nil {
  51431. return nil, err
  51432. }
  51433. defer googleapi.CloseBody(res)
  51434. if err := googleapi.CheckResponse(res); err != nil {
  51435. return nil, err
  51436. }
  51437. ret := &TargetPoolList{
  51438. ServerResponse: googleapi.ServerResponse{
  51439. Header: res.Header,
  51440. HTTPStatusCode: res.StatusCode,
  51441. },
  51442. }
  51443. target := &ret
  51444. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  51445. return nil, err
  51446. }
  51447. return ret, nil
  51448. // {
  51449. // "description": "Retrieves a list of target pools available to the specified project and region.",
  51450. // "httpMethod": "GET",
  51451. // "id": "compute.targetPools.list",
  51452. // "parameterOrder": [
  51453. // "project",
  51454. // "region"
  51455. // ],
  51456. // "parameters": {
  51457. // "filter": {
  51458. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  51459. // "location": "query",
  51460. // "type": "string"
  51461. // },
  51462. // "maxResults": {
  51463. // "default": "500",
  51464. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  51465. // "format": "uint32",
  51466. // "location": "query",
  51467. // "minimum": "0",
  51468. // "type": "integer"
  51469. // },
  51470. // "orderBy": {
  51471. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  51472. // "location": "query",
  51473. // "type": "string"
  51474. // },
  51475. // "pageToken": {
  51476. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  51477. // "location": "query",
  51478. // "type": "string"
  51479. // },
  51480. // "project": {
  51481. // "description": "Project ID for this request.",
  51482. // "location": "path",
  51483. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51484. // "required": true,
  51485. // "type": "string"
  51486. // },
  51487. // "region": {
  51488. // "description": "Name of the region scoping this request.",
  51489. // "location": "path",
  51490. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51491. // "required": true,
  51492. // "type": "string"
  51493. // }
  51494. // },
  51495. // "path": "{project}/regions/{region}/targetPools",
  51496. // "response": {
  51497. // "$ref": "TargetPoolList"
  51498. // },
  51499. // "scopes": [
  51500. // "https://www.googleapis.com/auth/cloud-platform",
  51501. // "https://www.googleapis.com/auth/compute",
  51502. // "https://www.googleapis.com/auth/compute.readonly"
  51503. // ]
  51504. // }
  51505. }
  51506. // Pages invokes f for each page of results.
  51507. // A non-nil error returned from f will halt the iteration.
  51508. // The provided context supersedes any context provided to the Context method.
  51509. func (c *TargetPoolsListCall) Pages(ctx context.Context, f func(*TargetPoolList) error) error {
  51510. c.ctx_ = ctx
  51511. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  51512. for {
  51513. x, err := c.Do()
  51514. if err != nil {
  51515. return err
  51516. }
  51517. if err := f(x); err != nil {
  51518. return err
  51519. }
  51520. if x.NextPageToken == "" {
  51521. return nil
  51522. }
  51523. c.PageToken(x.NextPageToken)
  51524. }
  51525. }
  51526. // method id "compute.targetPools.removeHealthCheck":
  51527. type TargetPoolsRemoveHealthCheckCall struct {
  51528. s *Service
  51529. project string
  51530. region string
  51531. targetPool string
  51532. targetpoolsremovehealthcheckrequest *TargetPoolsRemoveHealthCheckRequest
  51533. urlParams_ gensupport.URLParams
  51534. ctx_ context.Context
  51535. header_ http.Header
  51536. }
  51537. // RemoveHealthCheck: Removes health check URL from a target pool.
  51538. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/removeHealthCheck
  51539. func (r *TargetPoolsService) RemoveHealthCheck(project string, region string, targetPool string, targetpoolsremovehealthcheckrequest *TargetPoolsRemoveHealthCheckRequest) *TargetPoolsRemoveHealthCheckCall {
  51540. c := &TargetPoolsRemoveHealthCheckCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51541. c.project = project
  51542. c.region = region
  51543. c.targetPool = targetPool
  51544. c.targetpoolsremovehealthcheckrequest = targetpoolsremovehealthcheckrequest
  51545. return c
  51546. }
  51547. // Fields allows partial responses to be retrieved. See
  51548. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51549. // for more information.
  51550. func (c *TargetPoolsRemoveHealthCheckCall) Fields(s ...googleapi.Field) *TargetPoolsRemoveHealthCheckCall {
  51551. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51552. return c
  51553. }
  51554. // Context sets the context to be used in this call's Do method. Any
  51555. // pending HTTP request will be aborted if the provided context is
  51556. // canceled.
  51557. func (c *TargetPoolsRemoveHealthCheckCall) Context(ctx context.Context) *TargetPoolsRemoveHealthCheckCall {
  51558. c.ctx_ = ctx
  51559. return c
  51560. }
  51561. // Header returns an http.Header that can be modified by the caller to
  51562. // add HTTP headers to the request.
  51563. func (c *TargetPoolsRemoveHealthCheckCall) Header() http.Header {
  51564. if c.header_ == nil {
  51565. c.header_ = make(http.Header)
  51566. }
  51567. return c.header_
  51568. }
  51569. func (c *TargetPoolsRemoveHealthCheckCall) doRequest(alt string) (*http.Response, error) {
  51570. reqHeaders := make(http.Header)
  51571. for k, v := range c.header_ {
  51572. reqHeaders[k] = v
  51573. }
  51574. reqHeaders.Set("User-Agent", c.s.userAgent())
  51575. var body io.Reader = nil
  51576. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsremovehealthcheckrequest)
  51577. if err != nil {
  51578. return nil, err
  51579. }
  51580. reqHeaders.Set("Content-Type", "application/json")
  51581. c.urlParams_.Set("alt", alt)
  51582. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck")
  51583. urls += "?" + c.urlParams_.Encode()
  51584. req, _ := http.NewRequest("POST", urls, body)
  51585. req.Header = reqHeaders
  51586. googleapi.Expand(req.URL, map[string]string{
  51587. "project": c.project,
  51588. "region": c.region,
  51589. "targetPool": c.targetPool,
  51590. })
  51591. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51592. }
  51593. // Do executes the "compute.targetPools.removeHealthCheck" call.
  51594. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  51595. // status code is an error. Response headers are in either
  51596. // *Operation.ServerResponse.Header or (if a response was returned at
  51597. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  51598. // to check whether the returned error was because
  51599. // http.StatusNotModified was returned.
  51600. func (c *TargetPoolsRemoveHealthCheckCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  51601. gensupport.SetOptions(c.urlParams_, opts...)
  51602. res, err := c.doRequest("json")
  51603. if res != nil && res.StatusCode == http.StatusNotModified {
  51604. if res.Body != nil {
  51605. res.Body.Close()
  51606. }
  51607. return nil, &googleapi.Error{
  51608. Code: res.StatusCode,
  51609. Header: res.Header,
  51610. }
  51611. }
  51612. if err != nil {
  51613. return nil, err
  51614. }
  51615. defer googleapi.CloseBody(res)
  51616. if err := googleapi.CheckResponse(res); err != nil {
  51617. return nil, err
  51618. }
  51619. ret := &Operation{
  51620. ServerResponse: googleapi.ServerResponse{
  51621. Header: res.Header,
  51622. HTTPStatusCode: res.StatusCode,
  51623. },
  51624. }
  51625. target := &ret
  51626. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  51627. return nil, err
  51628. }
  51629. return ret, nil
  51630. // {
  51631. // "description": "Removes health check URL from a target pool.",
  51632. // "httpMethod": "POST",
  51633. // "id": "compute.targetPools.removeHealthCheck",
  51634. // "parameterOrder": [
  51635. // "project",
  51636. // "region",
  51637. // "targetPool"
  51638. // ],
  51639. // "parameters": {
  51640. // "project": {
  51641. // "description": "Project ID for this request.",
  51642. // "location": "path",
  51643. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51644. // "required": true,
  51645. // "type": "string"
  51646. // },
  51647. // "region": {
  51648. // "description": "Name of the region for this request.",
  51649. // "location": "path",
  51650. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51651. // "required": true,
  51652. // "type": "string"
  51653. // },
  51654. // "targetPool": {
  51655. // "description": "Name of the target pool to remove health checks from.",
  51656. // "location": "path",
  51657. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51658. // "required": true,
  51659. // "type": "string"
  51660. // }
  51661. // },
  51662. // "path": "{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck",
  51663. // "request": {
  51664. // "$ref": "TargetPoolsRemoveHealthCheckRequest"
  51665. // },
  51666. // "response": {
  51667. // "$ref": "Operation"
  51668. // },
  51669. // "scopes": [
  51670. // "https://www.googleapis.com/auth/cloud-platform",
  51671. // "https://www.googleapis.com/auth/compute"
  51672. // ]
  51673. // }
  51674. }
  51675. // method id "compute.targetPools.removeInstance":
  51676. type TargetPoolsRemoveInstanceCall struct {
  51677. s *Service
  51678. project string
  51679. region string
  51680. targetPool string
  51681. targetpoolsremoveinstancerequest *TargetPoolsRemoveInstanceRequest
  51682. urlParams_ gensupport.URLParams
  51683. ctx_ context.Context
  51684. header_ http.Header
  51685. }
  51686. // RemoveInstance: Removes instance URL from a target pool.
  51687. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/removeInstance
  51688. func (r *TargetPoolsService) RemoveInstance(project string, region string, targetPool string, targetpoolsremoveinstancerequest *TargetPoolsRemoveInstanceRequest) *TargetPoolsRemoveInstanceCall {
  51689. c := &TargetPoolsRemoveInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51690. c.project = project
  51691. c.region = region
  51692. c.targetPool = targetPool
  51693. c.targetpoolsremoveinstancerequest = targetpoolsremoveinstancerequest
  51694. return c
  51695. }
  51696. // Fields allows partial responses to be retrieved. See
  51697. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51698. // for more information.
  51699. func (c *TargetPoolsRemoveInstanceCall) Fields(s ...googleapi.Field) *TargetPoolsRemoveInstanceCall {
  51700. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51701. return c
  51702. }
  51703. // Context sets the context to be used in this call's Do method. Any
  51704. // pending HTTP request will be aborted if the provided context is
  51705. // canceled.
  51706. func (c *TargetPoolsRemoveInstanceCall) Context(ctx context.Context) *TargetPoolsRemoveInstanceCall {
  51707. c.ctx_ = ctx
  51708. return c
  51709. }
  51710. // Header returns an http.Header that can be modified by the caller to
  51711. // add HTTP headers to the request.
  51712. func (c *TargetPoolsRemoveInstanceCall) Header() http.Header {
  51713. if c.header_ == nil {
  51714. c.header_ = make(http.Header)
  51715. }
  51716. return c.header_
  51717. }
  51718. func (c *TargetPoolsRemoveInstanceCall) doRequest(alt string) (*http.Response, error) {
  51719. reqHeaders := make(http.Header)
  51720. for k, v := range c.header_ {
  51721. reqHeaders[k] = v
  51722. }
  51723. reqHeaders.Set("User-Agent", c.s.userAgent())
  51724. var body io.Reader = nil
  51725. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsremoveinstancerequest)
  51726. if err != nil {
  51727. return nil, err
  51728. }
  51729. reqHeaders.Set("Content-Type", "application/json")
  51730. c.urlParams_.Set("alt", alt)
  51731. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/removeInstance")
  51732. urls += "?" + c.urlParams_.Encode()
  51733. req, _ := http.NewRequest("POST", urls, body)
  51734. req.Header = reqHeaders
  51735. googleapi.Expand(req.URL, map[string]string{
  51736. "project": c.project,
  51737. "region": c.region,
  51738. "targetPool": c.targetPool,
  51739. })
  51740. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51741. }
  51742. // Do executes the "compute.targetPools.removeInstance" call.
  51743. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  51744. // status code is an error. Response headers are in either
  51745. // *Operation.ServerResponse.Header or (if a response was returned at
  51746. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  51747. // to check whether the returned error was because
  51748. // http.StatusNotModified was returned.
  51749. func (c *TargetPoolsRemoveInstanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  51750. gensupport.SetOptions(c.urlParams_, opts...)
  51751. res, err := c.doRequest("json")
  51752. if res != nil && res.StatusCode == http.StatusNotModified {
  51753. if res.Body != nil {
  51754. res.Body.Close()
  51755. }
  51756. return nil, &googleapi.Error{
  51757. Code: res.StatusCode,
  51758. Header: res.Header,
  51759. }
  51760. }
  51761. if err != nil {
  51762. return nil, err
  51763. }
  51764. defer googleapi.CloseBody(res)
  51765. if err := googleapi.CheckResponse(res); err != nil {
  51766. return nil, err
  51767. }
  51768. ret := &Operation{
  51769. ServerResponse: googleapi.ServerResponse{
  51770. Header: res.Header,
  51771. HTTPStatusCode: res.StatusCode,
  51772. },
  51773. }
  51774. target := &ret
  51775. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  51776. return nil, err
  51777. }
  51778. return ret, nil
  51779. // {
  51780. // "description": "Removes instance URL from a target pool.",
  51781. // "httpMethod": "POST",
  51782. // "id": "compute.targetPools.removeInstance",
  51783. // "parameterOrder": [
  51784. // "project",
  51785. // "region",
  51786. // "targetPool"
  51787. // ],
  51788. // "parameters": {
  51789. // "project": {
  51790. // "description": "Project ID for this request.",
  51791. // "location": "path",
  51792. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51793. // "required": true,
  51794. // "type": "string"
  51795. // },
  51796. // "region": {
  51797. // "description": "Name of the region scoping this request.",
  51798. // "location": "path",
  51799. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51800. // "required": true,
  51801. // "type": "string"
  51802. // },
  51803. // "targetPool": {
  51804. // "description": "Name of the TargetPool resource to remove instances from.",
  51805. // "location": "path",
  51806. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51807. // "required": true,
  51808. // "type": "string"
  51809. // }
  51810. // },
  51811. // "path": "{project}/regions/{region}/targetPools/{targetPool}/removeInstance",
  51812. // "request": {
  51813. // "$ref": "TargetPoolsRemoveInstanceRequest"
  51814. // },
  51815. // "response": {
  51816. // "$ref": "Operation"
  51817. // },
  51818. // "scopes": [
  51819. // "https://www.googleapis.com/auth/cloud-platform",
  51820. // "https://www.googleapis.com/auth/compute"
  51821. // ]
  51822. // }
  51823. }
  51824. // method id "compute.targetPools.setBackup":
  51825. type TargetPoolsSetBackupCall struct {
  51826. s *Service
  51827. project string
  51828. region string
  51829. targetPool string
  51830. targetreference *TargetReference
  51831. urlParams_ gensupport.URLParams
  51832. ctx_ context.Context
  51833. header_ http.Header
  51834. }
  51835. // SetBackup: Changes a backup target pool's configurations.
  51836. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/setBackup
  51837. func (r *TargetPoolsService) SetBackup(project string, region string, targetPool string, targetreference *TargetReference) *TargetPoolsSetBackupCall {
  51838. c := &TargetPoolsSetBackupCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51839. c.project = project
  51840. c.region = region
  51841. c.targetPool = targetPool
  51842. c.targetreference = targetreference
  51843. return c
  51844. }
  51845. // FailoverRatio sets the optional parameter "failoverRatio": New
  51846. // failoverRatio value for the target pool.
  51847. func (c *TargetPoolsSetBackupCall) FailoverRatio(failoverRatio float64) *TargetPoolsSetBackupCall {
  51848. c.urlParams_.Set("failoverRatio", fmt.Sprint(failoverRatio))
  51849. return c
  51850. }
  51851. // Fields allows partial responses to be retrieved. See
  51852. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51853. // for more information.
  51854. func (c *TargetPoolsSetBackupCall) Fields(s ...googleapi.Field) *TargetPoolsSetBackupCall {
  51855. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51856. return c
  51857. }
  51858. // Context sets the context to be used in this call's Do method. Any
  51859. // pending HTTP request will be aborted if the provided context is
  51860. // canceled.
  51861. func (c *TargetPoolsSetBackupCall) Context(ctx context.Context) *TargetPoolsSetBackupCall {
  51862. c.ctx_ = ctx
  51863. return c
  51864. }
  51865. // Header returns an http.Header that can be modified by the caller to
  51866. // add HTTP headers to the request.
  51867. func (c *TargetPoolsSetBackupCall) Header() http.Header {
  51868. if c.header_ == nil {
  51869. c.header_ = make(http.Header)
  51870. }
  51871. return c.header_
  51872. }
  51873. func (c *TargetPoolsSetBackupCall) doRequest(alt string) (*http.Response, error) {
  51874. reqHeaders := make(http.Header)
  51875. for k, v := range c.header_ {
  51876. reqHeaders[k] = v
  51877. }
  51878. reqHeaders.Set("User-Agent", c.s.userAgent())
  51879. var body io.Reader = nil
  51880. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference)
  51881. if err != nil {
  51882. return nil, err
  51883. }
  51884. reqHeaders.Set("Content-Type", "application/json")
  51885. c.urlParams_.Set("alt", alt)
  51886. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/setBackup")
  51887. urls += "?" + c.urlParams_.Encode()
  51888. req, _ := http.NewRequest("POST", urls, body)
  51889. req.Header = reqHeaders
  51890. googleapi.Expand(req.URL, map[string]string{
  51891. "project": c.project,
  51892. "region": c.region,
  51893. "targetPool": c.targetPool,
  51894. })
  51895. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51896. }
  51897. // Do executes the "compute.targetPools.setBackup" call.
  51898. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  51899. // status code is an error. Response headers are in either
  51900. // *Operation.ServerResponse.Header or (if a response was returned at
  51901. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  51902. // to check whether the returned error was because
  51903. // http.StatusNotModified was returned.
  51904. func (c *TargetPoolsSetBackupCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  51905. gensupport.SetOptions(c.urlParams_, opts...)
  51906. res, err := c.doRequest("json")
  51907. if res != nil && res.StatusCode == http.StatusNotModified {
  51908. if res.Body != nil {
  51909. res.Body.Close()
  51910. }
  51911. return nil, &googleapi.Error{
  51912. Code: res.StatusCode,
  51913. Header: res.Header,
  51914. }
  51915. }
  51916. if err != nil {
  51917. return nil, err
  51918. }
  51919. defer googleapi.CloseBody(res)
  51920. if err := googleapi.CheckResponse(res); err != nil {
  51921. return nil, err
  51922. }
  51923. ret := &Operation{
  51924. ServerResponse: googleapi.ServerResponse{
  51925. Header: res.Header,
  51926. HTTPStatusCode: res.StatusCode,
  51927. },
  51928. }
  51929. target := &ret
  51930. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  51931. return nil, err
  51932. }
  51933. return ret, nil
  51934. // {
  51935. // "description": "Changes a backup target pool's configurations.",
  51936. // "httpMethod": "POST",
  51937. // "id": "compute.targetPools.setBackup",
  51938. // "parameterOrder": [
  51939. // "project",
  51940. // "region",
  51941. // "targetPool"
  51942. // ],
  51943. // "parameters": {
  51944. // "failoverRatio": {
  51945. // "description": "New failoverRatio value for the target pool.",
  51946. // "format": "float",
  51947. // "location": "query",
  51948. // "type": "number"
  51949. // },
  51950. // "project": {
  51951. // "description": "Project ID for this request.",
  51952. // "location": "path",
  51953. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51954. // "required": true,
  51955. // "type": "string"
  51956. // },
  51957. // "region": {
  51958. // "description": "Name of the region scoping this request.",
  51959. // "location": "path",
  51960. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51961. // "required": true,
  51962. // "type": "string"
  51963. // },
  51964. // "targetPool": {
  51965. // "description": "Name of the TargetPool resource to set a backup pool for.",
  51966. // "location": "path",
  51967. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51968. // "required": true,
  51969. // "type": "string"
  51970. // }
  51971. // },
  51972. // "path": "{project}/regions/{region}/targetPools/{targetPool}/setBackup",
  51973. // "request": {
  51974. // "$ref": "TargetReference"
  51975. // },
  51976. // "response": {
  51977. // "$ref": "Operation"
  51978. // },
  51979. // "scopes": [
  51980. // "https://www.googleapis.com/auth/cloud-platform",
  51981. // "https://www.googleapis.com/auth/compute"
  51982. // ]
  51983. // }
  51984. }
  51985. // method id "compute.targetSslProxies.delete":
  51986. type TargetSslProxiesDeleteCall struct {
  51987. s *Service
  51988. project string
  51989. targetSslProxy string
  51990. urlParams_ gensupport.URLParams
  51991. ctx_ context.Context
  51992. header_ http.Header
  51993. }
  51994. // Delete: Deletes the specified TargetSslProxy resource.
  51995. func (r *TargetSslProxiesService) Delete(project string, targetSslProxy string) *TargetSslProxiesDeleteCall {
  51996. c := &TargetSslProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51997. c.project = project
  51998. c.targetSslProxy = targetSslProxy
  51999. return c
  52000. }
  52001. // Fields allows partial responses to be retrieved. See
  52002. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52003. // for more information.
  52004. func (c *TargetSslProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetSslProxiesDeleteCall {
  52005. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52006. return c
  52007. }
  52008. // Context sets the context to be used in this call's Do method. Any
  52009. // pending HTTP request will be aborted if the provided context is
  52010. // canceled.
  52011. func (c *TargetSslProxiesDeleteCall) Context(ctx context.Context) *TargetSslProxiesDeleteCall {
  52012. c.ctx_ = ctx
  52013. return c
  52014. }
  52015. // Header returns an http.Header that can be modified by the caller to
  52016. // add HTTP headers to the request.
  52017. func (c *TargetSslProxiesDeleteCall) Header() http.Header {
  52018. if c.header_ == nil {
  52019. c.header_ = make(http.Header)
  52020. }
  52021. return c.header_
  52022. }
  52023. func (c *TargetSslProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  52024. reqHeaders := make(http.Header)
  52025. for k, v := range c.header_ {
  52026. reqHeaders[k] = v
  52027. }
  52028. reqHeaders.Set("User-Agent", c.s.userAgent())
  52029. var body io.Reader = nil
  52030. c.urlParams_.Set("alt", alt)
  52031. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}")
  52032. urls += "?" + c.urlParams_.Encode()
  52033. req, _ := http.NewRequest("DELETE", urls, body)
  52034. req.Header = reqHeaders
  52035. googleapi.Expand(req.URL, map[string]string{
  52036. "project": c.project,
  52037. "targetSslProxy": c.targetSslProxy,
  52038. })
  52039. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52040. }
  52041. // Do executes the "compute.targetSslProxies.delete" call.
  52042. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  52043. // status code is an error. Response headers are in either
  52044. // *Operation.ServerResponse.Header or (if a response was returned at
  52045. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52046. // to check whether the returned error was because
  52047. // http.StatusNotModified was returned.
  52048. func (c *TargetSslProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  52049. gensupport.SetOptions(c.urlParams_, opts...)
  52050. res, err := c.doRequest("json")
  52051. if res != nil && res.StatusCode == http.StatusNotModified {
  52052. if res.Body != nil {
  52053. res.Body.Close()
  52054. }
  52055. return nil, &googleapi.Error{
  52056. Code: res.StatusCode,
  52057. Header: res.Header,
  52058. }
  52059. }
  52060. if err != nil {
  52061. return nil, err
  52062. }
  52063. defer googleapi.CloseBody(res)
  52064. if err := googleapi.CheckResponse(res); err != nil {
  52065. return nil, err
  52066. }
  52067. ret := &Operation{
  52068. ServerResponse: googleapi.ServerResponse{
  52069. Header: res.Header,
  52070. HTTPStatusCode: res.StatusCode,
  52071. },
  52072. }
  52073. target := &ret
  52074. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  52075. return nil, err
  52076. }
  52077. return ret, nil
  52078. // {
  52079. // "description": "Deletes the specified TargetSslProxy resource.",
  52080. // "httpMethod": "DELETE",
  52081. // "id": "compute.targetSslProxies.delete",
  52082. // "parameterOrder": [
  52083. // "project",
  52084. // "targetSslProxy"
  52085. // ],
  52086. // "parameters": {
  52087. // "project": {
  52088. // "description": "Project ID for this request.",
  52089. // "location": "path",
  52090. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52091. // "required": true,
  52092. // "type": "string"
  52093. // },
  52094. // "targetSslProxy": {
  52095. // "description": "Name of the TargetSslProxy resource to delete.",
  52096. // "location": "path",
  52097. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52098. // "required": true,
  52099. // "type": "string"
  52100. // }
  52101. // },
  52102. // "path": "{project}/global/targetSslProxies/{targetSslProxy}",
  52103. // "response": {
  52104. // "$ref": "Operation"
  52105. // },
  52106. // "scopes": [
  52107. // "https://www.googleapis.com/auth/cloud-platform",
  52108. // "https://www.googleapis.com/auth/compute"
  52109. // ]
  52110. // }
  52111. }
  52112. // method id "compute.targetSslProxies.get":
  52113. type TargetSslProxiesGetCall struct {
  52114. s *Service
  52115. project string
  52116. targetSslProxy string
  52117. urlParams_ gensupport.URLParams
  52118. ifNoneMatch_ string
  52119. ctx_ context.Context
  52120. header_ http.Header
  52121. }
  52122. // Get: Returns the specified TargetSslProxy resource. Get a list of
  52123. // available target SSL proxies by making a list() request.
  52124. func (r *TargetSslProxiesService) Get(project string, targetSslProxy string) *TargetSslProxiesGetCall {
  52125. c := &TargetSslProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52126. c.project = project
  52127. c.targetSslProxy = targetSslProxy
  52128. return c
  52129. }
  52130. // Fields allows partial responses to be retrieved. See
  52131. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52132. // for more information.
  52133. func (c *TargetSslProxiesGetCall) Fields(s ...googleapi.Field) *TargetSslProxiesGetCall {
  52134. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52135. return c
  52136. }
  52137. // IfNoneMatch sets the optional parameter which makes the operation
  52138. // fail if the object's ETag matches the given value. This is useful for
  52139. // getting updates only after the object has changed since the last
  52140. // request. Use googleapi.IsNotModified to check whether the response
  52141. // error from Do is the result of In-None-Match.
  52142. func (c *TargetSslProxiesGetCall) IfNoneMatch(entityTag string) *TargetSslProxiesGetCall {
  52143. c.ifNoneMatch_ = entityTag
  52144. return c
  52145. }
  52146. // Context sets the context to be used in this call's Do method. Any
  52147. // pending HTTP request will be aborted if the provided context is
  52148. // canceled.
  52149. func (c *TargetSslProxiesGetCall) Context(ctx context.Context) *TargetSslProxiesGetCall {
  52150. c.ctx_ = ctx
  52151. return c
  52152. }
  52153. // Header returns an http.Header that can be modified by the caller to
  52154. // add HTTP headers to the request.
  52155. func (c *TargetSslProxiesGetCall) Header() http.Header {
  52156. if c.header_ == nil {
  52157. c.header_ = make(http.Header)
  52158. }
  52159. return c.header_
  52160. }
  52161. func (c *TargetSslProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  52162. reqHeaders := make(http.Header)
  52163. for k, v := range c.header_ {
  52164. reqHeaders[k] = v
  52165. }
  52166. reqHeaders.Set("User-Agent", c.s.userAgent())
  52167. if c.ifNoneMatch_ != "" {
  52168. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  52169. }
  52170. var body io.Reader = nil
  52171. c.urlParams_.Set("alt", alt)
  52172. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}")
  52173. urls += "?" + c.urlParams_.Encode()
  52174. req, _ := http.NewRequest("GET", urls, body)
  52175. req.Header = reqHeaders
  52176. googleapi.Expand(req.URL, map[string]string{
  52177. "project": c.project,
  52178. "targetSslProxy": c.targetSslProxy,
  52179. })
  52180. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52181. }
  52182. // Do executes the "compute.targetSslProxies.get" call.
  52183. // Exactly one of *TargetSslProxy or error will be non-nil. Any non-2xx
  52184. // status code is an error. Response headers are in either
  52185. // *TargetSslProxy.ServerResponse.Header or (if a response was returned
  52186. // at all) in error.(*googleapi.Error).Header. Use
  52187. // googleapi.IsNotModified to check whether the returned error was
  52188. // because http.StatusNotModified was returned.
  52189. func (c *TargetSslProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetSslProxy, error) {
  52190. gensupport.SetOptions(c.urlParams_, opts...)
  52191. res, err := c.doRequest("json")
  52192. if res != nil && res.StatusCode == http.StatusNotModified {
  52193. if res.Body != nil {
  52194. res.Body.Close()
  52195. }
  52196. return nil, &googleapi.Error{
  52197. Code: res.StatusCode,
  52198. Header: res.Header,
  52199. }
  52200. }
  52201. if err != nil {
  52202. return nil, err
  52203. }
  52204. defer googleapi.CloseBody(res)
  52205. if err := googleapi.CheckResponse(res); err != nil {
  52206. return nil, err
  52207. }
  52208. ret := &TargetSslProxy{
  52209. ServerResponse: googleapi.ServerResponse{
  52210. Header: res.Header,
  52211. HTTPStatusCode: res.StatusCode,
  52212. },
  52213. }
  52214. target := &ret
  52215. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  52216. return nil, err
  52217. }
  52218. return ret, nil
  52219. // {
  52220. // "description": "Returns the specified TargetSslProxy resource. Get a list of available target SSL proxies by making a list() request.",
  52221. // "httpMethod": "GET",
  52222. // "id": "compute.targetSslProxies.get",
  52223. // "parameterOrder": [
  52224. // "project",
  52225. // "targetSslProxy"
  52226. // ],
  52227. // "parameters": {
  52228. // "project": {
  52229. // "description": "Project ID for this request.",
  52230. // "location": "path",
  52231. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52232. // "required": true,
  52233. // "type": "string"
  52234. // },
  52235. // "targetSslProxy": {
  52236. // "description": "Name of the TargetSslProxy resource to return.",
  52237. // "location": "path",
  52238. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52239. // "required": true,
  52240. // "type": "string"
  52241. // }
  52242. // },
  52243. // "path": "{project}/global/targetSslProxies/{targetSslProxy}",
  52244. // "response": {
  52245. // "$ref": "TargetSslProxy"
  52246. // },
  52247. // "scopes": [
  52248. // "https://www.googleapis.com/auth/cloud-platform",
  52249. // "https://www.googleapis.com/auth/compute",
  52250. // "https://www.googleapis.com/auth/compute.readonly"
  52251. // ]
  52252. // }
  52253. }
  52254. // method id "compute.targetSslProxies.insert":
  52255. type TargetSslProxiesInsertCall struct {
  52256. s *Service
  52257. project string
  52258. targetsslproxy *TargetSslProxy
  52259. urlParams_ gensupport.URLParams
  52260. ctx_ context.Context
  52261. header_ http.Header
  52262. }
  52263. // Insert: Creates a TargetSslProxy resource in the specified project
  52264. // using the data included in the request.
  52265. func (r *TargetSslProxiesService) Insert(project string, targetsslproxy *TargetSslProxy) *TargetSslProxiesInsertCall {
  52266. c := &TargetSslProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52267. c.project = project
  52268. c.targetsslproxy = targetsslproxy
  52269. return c
  52270. }
  52271. // Fields allows partial responses to be retrieved. See
  52272. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52273. // for more information.
  52274. func (c *TargetSslProxiesInsertCall) Fields(s ...googleapi.Field) *TargetSslProxiesInsertCall {
  52275. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52276. return c
  52277. }
  52278. // Context sets the context to be used in this call's Do method. Any
  52279. // pending HTTP request will be aborted if the provided context is
  52280. // canceled.
  52281. func (c *TargetSslProxiesInsertCall) Context(ctx context.Context) *TargetSslProxiesInsertCall {
  52282. c.ctx_ = ctx
  52283. return c
  52284. }
  52285. // Header returns an http.Header that can be modified by the caller to
  52286. // add HTTP headers to the request.
  52287. func (c *TargetSslProxiesInsertCall) Header() http.Header {
  52288. if c.header_ == nil {
  52289. c.header_ = make(http.Header)
  52290. }
  52291. return c.header_
  52292. }
  52293. func (c *TargetSslProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  52294. reqHeaders := make(http.Header)
  52295. for k, v := range c.header_ {
  52296. reqHeaders[k] = v
  52297. }
  52298. reqHeaders.Set("User-Agent", c.s.userAgent())
  52299. var body io.Reader = nil
  52300. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxy)
  52301. if err != nil {
  52302. return nil, err
  52303. }
  52304. reqHeaders.Set("Content-Type", "application/json")
  52305. c.urlParams_.Set("alt", alt)
  52306. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies")
  52307. urls += "?" + c.urlParams_.Encode()
  52308. req, _ := http.NewRequest("POST", urls, body)
  52309. req.Header = reqHeaders
  52310. googleapi.Expand(req.URL, map[string]string{
  52311. "project": c.project,
  52312. })
  52313. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52314. }
  52315. // Do executes the "compute.targetSslProxies.insert" call.
  52316. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  52317. // status code is an error. Response headers are in either
  52318. // *Operation.ServerResponse.Header or (if a response was returned at
  52319. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52320. // to check whether the returned error was because
  52321. // http.StatusNotModified was returned.
  52322. func (c *TargetSslProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  52323. gensupport.SetOptions(c.urlParams_, opts...)
  52324. res, err := c.doRequest("json")
  52325. if res != nil && res.StatusCode == http.StatusNotModified {
  52326. if res.Body != nil {
  52327. res.Body.Close()
  52328. }
  52329. return nil, &googleapi.Error{
  52330. Code: res.StatusCode,
  52331. Header: res.Header,
  52332. }
  52333. }
  52334. if err != nil {
  52335. return nil, err
  52336. }
  52337. defer googleapi.CloseBody(res)
  52338. if err := googleapi.CheckResponse(res); err != nil {
  52339. return nil, err
  52340. }
  52341. ret := &Operation{
  52342. ServerResponse: googleapi.ServerResponse{
  52343. Header: res.Header,
  52344. HTTPStatusCode: res.StatusCode,
  52345. },
  52346. }
  52347. target := &ret
  52348. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  52349. return nil, err
  52350. }
  52351. return ret, nil
  52352. // {
  52353. // "description": "Creates a TargetSslProxy resource in the specified project using the data included in the request.",
  52354. // "httpMethod": "POST",
  52355. // "id": "compute.targetSslProxies.insert",
  52356. // "parameterOrder": [
  52357. // "project"
  52358. // ],
  52359. // "parameters": {
  52360. // "project": {
  52361. // "description": "Project ID for this request.",
  52362. // "location": "path",
  52363. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52364. // "required": true,
  52365. // "type": "string"
  52366. // }
  52367. // },
  52368. // "path": "{project}/global/targetSslProxies",
  52369. // "request": {
  52370. // "$ref": "TargetSslProxy"
  52371. // },
  52372. // "response": {
  52373. // "$ref": "Operation"
  52374. // },
  52375. // "scopes": [
  52376. // "https://www.googleapis.com/auth/cloud-platform",
  52377. // "https://www.googleapis.com/auth/compute"
  52378. // ]
  52379. // }
  52380. }
  52381. // method id "compute.targetSslProxies.list":
  52382. type TargetSslProxiesListCall struct {
  52383. s *Service
  52384. project string
  52385. urlParams_ gensupport.URLParams
  52386. ifNoneMatch_ string
  52387. ctx_ context.Context
  52388. header_ http.Header
  52389. }
  52390. // List: Retrieves the list of TargetSslProxy resources available to the
  52391. // specified project.
  52392. func (r *TargetSslProxiesService) List(project string) *TargetSslProxiesListCall {
  52393. c := &TargetSslProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52394. c.project = project
  52395. return c
  52396. }
  52397. // Filter sets the optional parameter "filter": Sets a filter
  52398. // {expression} for filtering listed resources. Your {expression} must
  52399. // be in the format: field_name comparison_string literal_string.
  52400. //
  52401. // The field_name is the name of the field you want to compare. Only
  52402. // atomic field types are supported (string, number, boolean). The
  52403. // comparison_string must be either eq (equals) or ne (not equals). The
  52404. // literal_string is the string value to filter to. The literal value
  52405. // must be valid for the type of field you are filtering by (string,
  52406. // number, boolean). For string fields, the literal value is interpreted
  52407. // as a regular expression using RE2 syntax. The literal value must
  52408. // match the entire field.
  52409. //
  52410. // For example, to filter for instances that do not have a name of
  52411. // example-instance, you would use name ne example-instance.
  52412. //
  52413. // You can filter on nested fields. For example, you could filter on
  52414. // instances that have set the scheduling.automaticRestart field to
  52415. // true. Use filtering on nested fields to take advantage of labels to
  52416. // organize and search for results based on label values.
  52417. //
  52418. // To filter on multiple expressions, provide each separate expression
  52419. // within parentheses. For example, (scheduling.automaticRestart eq
  52420. // true) (zone eq us-central1-f). Multiple expressions are treated as
  52421. // AND expressions, meaning that resources must match all expressions to
  52422. // pass the filters.
  52423. func (c *TargetSslProxiesListCall) Filter(filter string) *TargetSslProxiesListCall {
  52424. c.urlParams_.Set("filter", filter)
  52425. return c
  52426. }
  52427. // MaxResults sets the optional parameter "maxResults": The maximum
  52428. // number of results per page that should be returned. If the number of
  52429. // available results is larger than maxResults, Compute Engine returns a
  52430. // nextPageToken that can be used to get the next page of results in
  52431. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  52432. // (Default: 500)
  52433. func (c *TargetSslProxiesListCall) MaxResults(maxResults int64) *TargetSslProxiesListCall {
  52434. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  52435. return c
  52436. }
  52437. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  52438. // a certain order. By default, results are returned in alphanumerical
  52439. // order based on the resource name.
  52440. //
  52441. // You can also sort results in descending order based on the creation
  52442. // timestamp using orderBy="creationTimestamp desc". This sorts results
  52443. // based on the creationTimestamp field in reverse chronological order
  52444. // (newest result first). Use this to sort resources like operations so
  52445. // that the newest operation is returned first.
  52446. //
  52447. // Currently, only sorting by name or creationTimestamp desc is
  52448. // supported.
  52449. func (c *TargetSslProxiesListCall) OrderBy(orderBy string) *TargetSslProxiesListCall {
  52450. c.urlParams_.Set("orderBy", orderBy)
  52451. return c
  52452. }
  52453. // PageToken sets the optional parameter "pageToken": Specifies a page
  52454. // token to use. Set pageToken to the nextPageToken returned by a
  52455. // previous list request to get the next page of results.
  52456. func (c *TargetSslProxiesListCall) PageToken(pageToken string) *TargetSslProxiesListCall {
  52457. c.urlParams_.Set("pageToken", pageToken)
  52458. return c
  52459. }
  52460. // Fields allows partial responses to be retrieved. See
  52461. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52462. // for more information.
  52463. func (c *TargetSslProxiesListCall) Fields(s ...googleapi.Field) *TargetSslProxiesListCall {
  52464. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52465. return c
  52466. }
  52467. // IfNoneMatch sets the optional parameter which makes the operation
  52468. // fail if the object's ETag matches the given value. This is useful for
  52469. // getting updates only after the object has changed since the last
  52470. // request. Use googleapi.IsNotModified to check whether the response
  52471. // error from Do is the result of In-None-Match.
  52472. func (c *TargetSslProxiesListCall) IfNoneMatch(entityTag string) *TargetSslProxiesListCall {
  52473. c.ifNoneMatch_ = entityTag
  52474. return c
  52475. }
  52476. // Context sets the context to be used in this call's Do method. Any
  52477. // pending HTTP request will be aborted if the provided context is
  52478. // canceled.
  52479. func (c *TargetSslProxiesListCall) Context(ctx context.Context) *TargetSslProxiesListCall {
  52480. c.ctx_ = ctx
  52481. return c
  52482. }
  52483. // Header returns an http.Header that can be modified by the caller to
  52484. // add HTTP headers to the request.
  52485. func (c *TargetSslProxiesListCall) Header() http.Header {
  52486. if c.header_ == nil {
  52487. c.header_ = make(http.Header)
  52488. }
  52489. return c.header_
  52490. }
  52491. func (c *TargetSslProxiesListCall) doRequest(alt string) (*http.Response, error) {
  52492. reqHeaders := make(http.Header)
  52493. for k, v := range c.header_ {
  52494. reqHeaders[k] = v
  52495. }
  52496. reqHeaders.Set("User-Agent", c.s.userAgent())
  52497. if c.ifNoneMatch_ != "" {
  52498. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  52499. }
  52500. var body io.Reader = nil
  52501. c.urlParams_.Set("alt", alt)
  52502. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies")
  52503. urls += "?" + c.urlParams_.Encode()
  52504. req, _ := http.NewRequest("GET", urls, body)
  52505. req.Header = reqHeaders
  52506. googleapi.Expand(req.URL, map[string]string{
  52507. "project": c.project,
  52508. })
  52509. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52510. }
  52511. // Do executes the "compute.targetSslProxies.list" call.
  52512. // Exactly one of *TargetSslProxyList or error will be non-nil. Any
  52513. // non-2xx status code is an error. Response headers are in either
  52514. // *TargetSslProxyList.ServerResponse.Header or (if a response was
  52515. // returned at all) in error.(*googleapi.Error).Header. Use
  52516. // googleapi.IsNotModified to check whether the returned error was
  52517. // because http.StatusNotModified was returned.
  52518. func (c *TargetSslProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetSslProxyList, error) {
  52519. gensupport.SetOptions(c.urlParams_, opts...)
  52520. res, err := c.doRequest("json")
  52521. if res != nil && res.StatusCode == http.StatusNotModified {
  52522. if res.Body != nil {
  52523. res.Body.Close()
  52524. }
  52525. return nil, &googleapi.Error{
  52526. Code: res.StatusCode,
  52527. Header: res.Header,
  52528. }
  52529. }
  52530. if err != nil {
  52531. return nil, err
  52532. }
  52533. defer googleapi.CloseBody(res)
  52534. if err := googleapi.CheckResponse(res); err != nil {
  52535. return nil, err
  52536. }
  52537. ret := &TargetSslProxyList{
  52538. ServerResponse: googleapi.ServerResponse{
  52539. Header: res.Header,
  52540. HTTPStatusCode: res.StatusCode,
  52541. },
  52542. }
  52543. target := &ret
  52544. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  52545. return nil, err
  52546. }
  52547. return ret, nil
  52548. // {
  52549. // "description": "Retrieves the list of TargetSslProxy resources available to the specified project.",
  52550. // "httpMethod": "GET",
  52551. // "id": "compute.targetSslProxies.list",
  52552. // "parameterOrder": [
  52553. // "project"
  52554. // ],
  52555. // "parameters": {
  52556. // "filter": {
  52557. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  52558. // "location": "query",
  52559. // "type": "string"
  52560. // },
  52561. // "maxResults": {
  52562. // "default": "500",
  52563. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  52564. // "format": "uint32",
  52565. // "location": "query",
  52566. // "minimum": "0",
  52567. // "type": "integer"
  52568. // },
  52569. // "orderBy": {
  52570. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  52571. // "location": "query",
  52572. // "type": "string"
  52573. // },
  52574. // "pageToken": {
  52575. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  52576. // "location": "query",
  52577. // "type": "string"
  52578. // },
  52579. // "project": {
  52580. // "description": "Project ID for this request.",
  52581. // "location": "path",
  52582. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52583. // "required": true,
  52584. // "type": "string"
  52585. // }
  52586. // },
  52587. // "path": "{project}/global/targetSslProxies",
  52588. // "response": {
  52589. // "$ref": "TargetSslProxyList"
  52590. // },
  52591. // "scopes": [
  52592. // "https://www.googleapis.com/auth/cloud-platform",
  52593. // "https://www.googleapis.com/auth/compute",
  52594. // "https://www.googleapis.com/auth/compute.readonly"
  52595. // ]
  52596. // }
  52597. }
  52598. // Pages invokes f for each page of results.
  52599. // A non-nil error returned from f will halt the iteration.
  52600. // The provided context supersedes any context provided to the Context method.
  52601. func (c *TargetSslProxiesListCall) Pages(ctx context.Context, f func(*TargetSslProxyList) error) error {
  52602. c.ctx_ = ctx
  52603. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  52604. for {
  52605. x, err := c.Do()
  52606. if err != nil {
  52607. return err
  52608. }
  52609. if err := f(x); err != nil {
  52610. return err
  52611. }
  52612. if x.NextPageToken == "" {
  52613. return nil
  52614. }
  52615. c.PageToken(x.NextPageToken)
  52616. }
  52617. }
  52618. // method id "compute.targetSslProxies.setBackendService":
  52619. type TargetSslProxiesSetBackendServiceCall struct {
  52620. s *Service
  52621. project string
  52622. targetSslProxy string
  52623. targetsslproxiessetbackendservicerequest *TargetSslProxiesSetBackendServiceRequest
  52624. urlParams_ gensupport.URLParams
  52625. ctx_ context.Context
  52626. header_ http.Header
  52627. }
  52628. // SetBackendService: Changes the BackendService for TargetSslProxy.
  52629. func (r *TargetSslProxiesService) SetBackendService(project string, targetSslProxy string, targetsslproxiessetbackendservicerequest *TargetSslProxiesSetBackendServiceRequest) *TargetSslProxiesSetBackendServiceCall {
  52630. c := &TargetSslProxiesSetBackendServiceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52631. c.project = project
  52632. c.targetSslProxy = targetSslProxy
  52633. c.targetsslproxiessetbackendservicerequest = targetsslproxiessetbackendservicerequest
  52634. return c
  52635. }
  52636. // Fields allows partial responses to be retrieved. See
  52637. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52638. // for more information.
  52639. func (c *TargetSslProxiesSetBackendServiceCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetBackendServiceCall {
  52640. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52641. return c
  52642. }
  52643. // Context sets the context to be used in this call's Do method. Any
  52644. // pending HTTP request will be aborted if the provided context is
  52645. // canceled.
  52646. func (c *TargetSslProxiesSetBackendServiceCall) Context(ctx context.Context) *TargetSslProxiesSetBackendServiceCall {
  52647. c.ctx_ = ctx
  52648. return c
  52649. }
  52650. // Header returns an http.Header that can be modified by the caller to
  52651. // add HTTP headers to the request.
  52652. func (c *TargetSslProxiesSetBackendServiceCall) Header() http.Header {
  52653. if c.header_ == nil {
  52654. c.header_ = make(http.Header)
  52655. }
  52656. return c.header_
  52657. }
  52658. func (c *TargetSslProxiesSetBackendServiceCall) doRequest(alt string) (*http.Response, error) {
  52659. reqHeaders := make(http.Header)
  52660. for k, v := range c.header_ {
  52661. reqHeaders[k] = v
  52662. }
  52663. reqHeaders.Set("User-Agent", c.s.userAgent())
  52664. var body io.Reader = nil
  52665. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetbackendservicerequest)
  52666. if err != nil {
  52667. return nil, err
  52668. }
  52669. reqHeaders.Set("Content-Type", "application/json")
  52670. c.urlParams_.Set("alt", alt)
  52671. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}/setBackendService")
  52672. urls += "?" + c.urlParams_.Encode()
  52673. req, _ := http.NewRequest("POST", urls, body)
  52674. req.Header = reqHeaders
  52675. googleapi.Expand(req.URL, map[string]string{
  52676. "project": c.project,
  52677. "targetSslProxy": c.targetSslProxy,
  52678. })
  52679. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52680. }
  52681. // Do executes the "compute.targetSslProxies.setBackendService" call.
  52682. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  52683. // status code is an error. Response headers are in either
  52684. // *Operation.ServerResponse.Header or (if a response was returned at
  52685. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52686. // to check whether the returned error was because
  52687. // http.StatusNotModified was returned.
  52688. func (c *TargetSslProxiesSetBackendServiceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  52689. gensupport.SetOptions(c.urlParams_, opts...)
  52690. res, err := c.doRequest("json")
  52691. if res != nil && res.StatusCode == http.StatusNotModified {
  52692. if res.Body != nil {
  52693. res.Body.Close()
  52694. }
  52695. return nil, &googleapi.Error{
  52696. Code: res.StatusCode,
  52697. Header: res.Header,
  52698. }
  52699. }
  52700. if err != nil {
  52701. return nil, err
  52702. }
  52703. defer googleapi.CloseBody(res)
  52704. if err := googleapi.CheckResponse(res); err != nil {
  52705. return nil, err
  52706. }
  52707. ret := &Operation{
  52708. ServerResponse: googleapi.ServerResponse{
  52709. Header: res.Header,
  52710. HTTPStatusCode: res.StatusCode,
  52711. },
  52712. }
  52713. target := &ret
  52714. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  52715. return nil, err
  52716. }
  52717. return ret, nil
  52718. // {
  52719. // "description": "Changes the BackendService for TargetSslProxy.",
  52720. // "httpMethod": "POST",
  52721. // "id": "compute.targetSslProxies.setBackendService",
  52722. // "parameterOrder": [
  52723. // "project",
  52724. // "targetSslProxy"
  52725. // ],
  52726. // "parameters": {
  52727. // "project": {
  52728. // "description": "Project ID for this request.",
  52729. // "location": "path",
  52730. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52731. // "required": true,
  52732. // "type": "string"
  52733. // },
  52734. // "targetSslProxy": {
  52735. // "description": "Name of the TargetSslProxy resource whose BackendService resource is to be set.",
  52736. // "location": "path",
  52737. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52738. // "required": true,
  52739. // "type": "string"
  52740. // }
  52741. // },
  52742. // "path": "{project}/global/targetSslProxies/{targetSslProxy}/setBackendService",
  52743. // "request": {
  52744. // "$ref": "TargetSslProxiesSetBackendServiceRequest"
  52745. // },
  52746. // "response": {
  52747. // "$ref": "Operation"
  52748. // },
  52749. // "scopes": [
  52750. // "https://www.googleapis.com/auth/cloud-platform",
  52751. // "https://www.googleapis.com/auth/compute"
  52752. // ]
  52753. // }
  52754. }
  52755. // method id "compute.targetSslProxies.setProxyHeader":
  52756. type TargetSslProxiesSetProxyHeaderCall struct {
  52757. s *Service
  52758. project string
  52759. targetSslProxy string
  52760. targetsslproxiessetproxyheaderrequest *TargetSslProxiesSetProxyHeaderRequest
  52761. urlParams_ gensupport.URLParams
  52762. ctx_ context.Context
  52763. header_ http.Header
  52764. }
  52765. // SetProxyHeader: Changes the ProxyHeaderType for TargetSslProxy.
  52766. func (r *TargetSslProxiesService) SetProxyHeader(project string, targetSslProxy string, targetsslproxiessetproxyheaderrequest *TargetSslProxiesSetProxyHeaderRequest) *TargetSslProxiesSetProxyHeaderCall {
  52767. c := &TargetSslProxiesSetProxyHeaderCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52768. c.project = project
  52769. c.targetSslProxy = targetSslProxy
  52770. c.targetsslproxiessetproxyheaderrequest = targetsslproxiessetproxyheaderrequest
  52771. return c
  52772. }
  52773. // Fields allows partial responses to be retrieved. See
  52774. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52775. // for more information.
  52776. func (c *TargetSslProxiesSetProxyHeaderCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetProxyHeaderCall {
  52777. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52778. return c
  52779. }
  52780. // Context sets the context to be used in this call's Do method. Any
  52781. // pending HTTP request will be aborted if the provided context is
  52782. // canceled.
  52783. func (c *TargetSslProxiesSetProxyHeaderCall) Context(ctx context.Context) *TargetSslProxiesSetProxyHeaderCall {
  52784. c.ctx_ = ctx
  52785. return c
  52786. }
  52787. // Header returns an http.Header that can be modified by the caller to
  52788. // add HTTP headers to the request.
  52789. func (c *TargetSslProxiesSetProxyHeaderCall) Header() http.Header {
  52790. if c.header_ == nil {
  52791. c.header_ = make(http.Header)
  52792. }
  52793. return c.header_
  52794. }
  52795. func (c *TargetSslProxiesSetProxyHeaderCall) doRequest(alt string) (*http.Response, error) {
  52796. reqHeaders := make(http.Header)
  52797. for k, v := range c.header_ {
  52798. reqHeaders[k] = v
  52799. }
  52800. reqHeaders.Set("User-Agent", c.s.userAgent())
  52801. var body io.Reader = nil
  52802. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetproxyheaderrequest)
  52803. if err != nil {
  52804. return nil, err
  52805. }
  52806. reqHeaders.Set("Content-Type", "application/json")
  52807. c.urlParams_.Set("alt", alt)
  52808. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}/setProxyHeader")
  52809. urls += "?" + c.urlParams_.Encode()
  52810. req, _ := http.NewRequest("POST", urls, body)
  52811. req.Header = reqHeaders
  52812. googleapi.Expand(req.URL, map[string]string{
  52813. "project": c.project,
  52814. "targetSslProxy": c.targetSslProxy,
  52815. })
  52816. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52817. }
  52818. // Do executes the "compute.targetSslProxies.setProxyHeader" call.
  52819. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  52820. // status code is an error. Response headers are in either
  52821. // *Operation.ServerResponse.Header or (if a response was returned at
  52822. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52823. // to check whether the returned error was because
  52824. // http.StatusNotModified was returned.
  52825. func (c *TargetSslProxiesSetProxyHeaderCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  52826. gensupport.SetOptions(c.urlParams_, opts...)
  52827. res, err := c.doRequest("json")
  52828. if res != nil && res.StatusCode == http.StatusNotModified {
  52829. if res.Body != nil {
  52830. res.Body.Close()
  52831. }
  52832. return nil, &googleapi.Error{
  52833. Code: res.StatusCode,
  52834. Header: res.Header,
  52835. }
  52836. }
  52837. if err != nil {
  52838. return nil, err
  52839. }
  52840. defer googleapi.CloseBody(res)
  52841. if err := googleapi.CheckResponse(res); err != nil {
  52842. return nil, err
  52843. }
  52844. ret := &Operation{
  52845. ServerResponse: googleapi.ServerResponse{
  52846. Header: res.Header,
  52847. HTTPStatusCode: res.StatusCode,
  52848. },
  52849. }
  52850. target := &ret
  52851. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  52852. return nil, err
  52853. }
  52854. return ret, nil
  52855. // {
  52856. // "description": "Changes the ProxyHeaderType for TargetSslProxy.",
  52857. // "httpMethod": "POST",
  52858. // "id": "compute.targetSslProxies.setProxyHeader",
  52859. // "parameterOrder": [
  52860. // "project",
  52861. // "targetSslProxy"
  52862. // ],
  52863. // "parameters": {
  52864. // "project": {
  52865. // "description": "Project ID for this request.",
  52866. // "location": "path",
  52867. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52868. // "required": true,
  52869. // "type": "string"
  52870. // },
  52871. // "targetSslProxy": {
  52872. // "description": "Name of the TargetSslProxy resource whose ProxyHeader is to be set.",
  52873. // "location": "path",
  52874. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52875. // "required": true,
  52876. // "type": "string"
  52877. // }
  52878. // },
  52879. // "path": "{project}/global/targetSslProxies/{targetSslProxy}/setProxyHeader",
  52880. // "request": {
  52881. // "$ref": "TargetSslProxiesSetProxyHeaderRequest"
  52882. // },
  52883. // "response": {
  52884. // "$ref": "Operation"
  52885. // },
  52886. // "scopes": [
  52887. // "https://www.googleapis.com/auth/cloud-platform",
  52888. // "https://www.googleapis.com/auth/compute"
  52889. // ]
  52890. // }
  52891. }
  52892. // method id "compute.targetSslProxies.setSslCertificates":
  52893. type TargetSslProxiesSetSslCertificatesCall struct {
  52894. s *Service
  52895. project string
  52896. targetSslProxy string
  52897. targetsslproxiessetsslcertificatesrequest *TargetSslProxiesSetSslCertificatesRequest
  52898. urlParams_ gensupport.URLParams
  52899. ctx_ context.Context
  52900. header_ http.Header
  52901. }
  52902. // SetSslCertificates: Changes SslCertificates for TargetSslProxy.
  52903. func (r *TargetSslProxiesService) SetSslCertificates(project string, targetSslProxy string, targetsslproxiessetsslcertificatesrequest *TargetSslProxiesSetSslCertificatesRequest) *TargetSslProxiesSetSslCertificatesCall {
  52904. c := &TargetSslProxiesSetSslCertificatesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52905. c.project = project
  52906. c.targetSslProxy = targetSslProxy
  52907. c.targetsslproxiessetsslcertificatesrequest = targetsslproxiessetsslcertificatesrequest
  52908. return c
  52909. }
  52910. // Fields allows partial responses to be retrieved. See
  52911. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52912. // for more information.
  52913. func (c *TargetSslProxiesSetSslCertificatesCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetSslCertificatesCall {
  52914. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52915. return c
  52916. }
  52917. // Context sets the context to be used in this call's Do method. Any
  52918. // pending HTTP request will be aborted if the provided context is
  52919. // canceled.
  52920. func (c *TargetSslProxiesSetSslCertificatesCall) Context(ctx context.Context) *TargetSslProxiesSetSslCertificatesCall {
  52921. c.ctx_ = ctx
  52922. return c
  52923. }
  52924. // Header returns an http.Header that can be modified by the caller to
  52925. // add HTTP headers to the request.
  52926. func (c *TargetSslProxiesSetSslCertificatesCall) Header() http.Header {
  52927. if c.header_ == nil {
  52928. c.header_ = make(http.Header)
  52929. }
  52930. return c.header_
  52931. }
  52932. func (c *TargetSslProxiesSetSslCertificatesCall) doRequest(alt string) (*http.Response, error) {
  52933. reqHeaders := make(http.Header)
  52934. for k, v := range c.header_ {
  52935. reqHeaders[k] = v
  52936. }
  52937. reqHeaders.Set("User-Agent", c.s.userAgent())
  52938. var body io.Reader = nil
  52939. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetsslcertificatesrequest)
  52940. if err != nil {
  52941. return nil, err
  52942. }
  52943. reqHeaders.Set("Content-Type", "application/json")
  52944. c.urlParams_.Set("alt", alt)
  52945. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}/setSslCertificates")
  52946. urls += "?" + c.urlParams_.Encode()
  52947. req, _ := http.NewRequest("POST", urls, body)
  52948. req.Header = reqHeaders
  52949. googleapi.Expand(req.URL, map[string]string{
  52950. "project": c.project,
  52951. "targetSslProxy": c.targetSslProxy,
  52952. })
  52953. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52954. }
  52955. // Do executes the "compute.targetSslProxies.setSslCertificates" call.
  52956. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  52957. // status code is an error. Response headers are in either
  52958. // *Operation.ServerResponse.Header or (if a response was returned at
  52959. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52960. // to check whether the returned error was because
  52961. // http.StatusNotModified was returned.
  52962. func (c *TargetSslProxiesSetSslCertificatesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  52963. gensupport.SetOptions(c.urlParams_, opts...)
  52964. res, err := c.doRequest("json")
  52965. if res != nil && res.StatusCode == http.StatusNotModified {
  52966. if res.Body != nil {
  52967. res.Body.Close()
  52968. }
  52969. return nil, &googleapi.Error{
  52970. Code: res.StatusCode,
  52971. Header: res.Header,
  52972. }
  52973. }
  52974. if err != nil {
  52975. return nil, err
  52976. }
  52977. defer googleapi.CloseBody(res)
  52978. if err := googleapi.CheckResponse(res); err != nil {
  52979. return nil, err
  52980. }
  52981. ret := &Operation{
  52982. ServerResponse: googleapi.ServerResponse{
  52983. Header: res.Header,
  52984. HTTPStatusCode: res.StatusCode,
  52985. },
  52986. }
  52987. target := &ret
  52988. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  52989. return nil, err
  52990. }
  52991. return ret, nil
  52992. // {
  52993. // "description": "Changes SslCertificates for TargetSslProxy.",
  52994. // "httpMethod": "POST",
  52995. // "id": "compute.targetSslProxies.setSslCertificates",
  52996. // "parameterOrder": [
  52997. // "project",
  52998. // "targetSslProxy"
  52999. // ],
  53000. // "parameters": {
  53001. // "project": {
  53002. // "description": "Project ID for this request.",
  53003. // "location": "path",
  53004. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53005. // "required": true,
  53006. // "type": "string"
  53007. // },
  53008. // "targetSslProxy": {
  53009. // "description": "Name of the TargetSslProxy resource whose SslCertificate resource is to be set.",
  53010. // "location": "path",
  53011. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  53012. // "required": true,
  53013. // "type": "string"
  53014. // }
  53015. // },
  53016. // "path": "{project}/global/targetSslProxies/{targetSslProxy}/setSslCertificates",
  53017. // "request": {
  53018. // "$ref": "TargetSslProxiesSetSslCertificatesRequest"
  53019. // },
  53020. // "response": {
  53021. // "$ref": "Operation"
  53022. // },
  53023. // "scopes": [
  53024. // "https://www.googleapis.com/auth/cloud-platform",
  53025. // "https://www.googleapis.com/auth/compute"
  53026. // ]
  53027. // }
  53028. }
  53029. // method id "compute.targetTcpProxies.delete":
  53030. type TargetTcpProxiesDeleteCall struct {
  53031. s *Service
  53032. project string
  53033. targetTcpProxy string
  53034. urlParams_ gensupport.URLParams
  53035. ctx_ context.Context
  53036. header_ http.Header
  53037. }
  53038. // Delete: Deletes the specified TargetTcpProxy resource.
  53039. func (r *TargetTcpProxiesService) Delete(project string, targetTcpProxy string) *TargetTcpProxiesDeleteCall {
  53040. c := &TargetTcpProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53041. c.project = project
  53042. c.targetTcpProxy = targetTcpProxy
  53043. return c
  53044. }
  53045. // Fields allows partial responses to be retrieved. See
  53046. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53047. // for more information.
  53048. func (c *TargetTcpProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetTcpProxiesDeleteCall {
  53049. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53050. return c
  53051. }
  53052. // Context sets the context to be used in this call's Do method. Any
  53053. // pending HTTP request will be aborted if the provided context is
  53054. // canceled.
  53055. func (c *TargetTcpProxiesDeleteCall) Context(ctx context.Context) *TargetTcpProxiesDeleteCall {
  53056. c.ctx_ = ctx
  53057. return c
  53058. }
  53059. // Header returns an http.Header that can be modified by the caller to
  53060. // add HTTP headers to the request.
  53061. func (c *TargetTcpProxiesDeleteCall) Header() http.Header {
  53062. if c.header_ == nil {
  53063. c.header_ = make(http.Header)
  53064. }
  53065. return c.header_
  53066. }
  53067. func (c *TargetTcpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  53068. reqHeaders := make(http.Header)
  53069. for k, v := range c.header_ {
  53070. reqHeaders[k] = v
  53071. }
  53072. reqHeaders.Set("User-Agent", c.s.userAgent())
  53073. var body io.Reader = nil
  53074. c.urlParams_.Set("alt", alt)
  53075. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{targetTcpProxy}")
  53076. urls += "?" + c.urlParams_.Encode()
  53077. req, _ := http.NewRequest("DELETE", urls, body)
  53078. req.Header = reqHeaders
  53079. googleapi.Expand(req.URL, map[string]string{
  53080. "project": c.project,
  53081. "targetTcpProxy": c.targetTcpProxy,
  53082. })
  53083. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53084. }
  53085. // Do executes the "compute.targetTcpProxies.delete" call.
  53086. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  53087. // status code is an error. Response headers are in either
  53088. // *Operation.ServerResponse.Header or (if a response was returned at
  53089. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53090. // to check whether the returned error was because
  53091. // http.StatusNotModified was returned.
  53092. func (c *TargetTcpProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  53093. gensupport.SetOptions(c.urlParams_, opts...)
  53094. res, err := c.doRequest("json")
  53095. if res != nil && res.StatusCode == http.StatusNotModified {
  53096. if res.Body != nil {
  53097. res.Body.Close()
  53098. }
  53099. return nil, &googleapi.Error{
  53100. Code: res.StatusCode,
  53101. Header: res.Header,
  53102. }
  53103. }
  53104. if err != nil {
  53105. return nil, err
  53106. }
  53107. defer googleapi.CloseBody(res)
  53108. if err := googleapi.CheckResponse(res); err != nil {
  53109. return nil, err
  53110. }
  53111. ret := &Operation{
  53112. ServerResponse: googleapi.ServerResponse{
  53113. Header: res.Header,
  53114. HTTPStatusCode: res.StatusCode,
  53115. },
  53116. }
  53117. target := &ret
  53118. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  53119. return nil, err
  53120. }
  53121. return ret, nil
  53122. // {
  53123. // "description": "Deletes the specified TargetTcpProxy resource.",
  53124. // "httpMethod": "DELETE",
  53125. // "id": "compute.targetTcpProxies.delete",
  53126. // "parameterOrder": [
  53127. // "project",
  53128. // "targetTcpProxy"
  53129. // ],
  53130. // "parameters": {
  53131. // "project": {
  53132. // "description": "Project ID for this request.",
  53133. // "location": "path",
  53134. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53135. // "required": true,
  53136. // "type": "string"
  53137. // },
  53138. // "targetTcpProxy": {
  53139. // "description": "Name of the TargetTcpProxy resource to delete.",
  53140. // "location": "path",
  53141. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  53142. // "required": true,
  53143. // "type": "string"
  53144. // }
  53145. // },
  53146. // "path": "{project}/global/targetTcpProxies/{targetTcpProxy}",
  53147. // "response": {
  53148. // "$ref": "Operation"
  53149. // },
  53150. // "scopes": [
  53151. // "https://www.googleapis.com/auth/cloud-platform",
  53152. // "https://www.googleapis.com/auth/compute"
  53153. // ]
  53154. // }
  53155. }
  53156. // method id "compute.targetTcpProxies.get":
  53157. type TargetTcpProxiesGetCall struct {
  53158. s *Service
  53159. project string
  53160. targetTcpProxy string
  53161. urlParams_ gensupport.URLParams
  53162. ifNoneMatch_ string
  53163. ctx_ context.Context
  53164. header_ http.Header
  53165. }
  53166. // Get: Returns the specified TargetTcpProxy resource. Get a list of
  53167. // available target TCP proxies by making a list() request.
  53168. func (r *TargetTcpProxiesService) Get(project string, targetTcpProxy string) *TargetTcpProxiesGetCall {
  53169. c := &TargetTcpProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53170. c.project = project
  53171. c.targetTcpProxy = targetTcpProxy
  53172. return c
  53173. }
  53174. // Fields allows partial responses to be retrieved. See
  53175. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53176. // for more information.
  53177. func (c *TargetTcpProxiesGetCall) Fields(s ...googleapi.Field) *TargetTcpProxiesGetCall {
  53178. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53179. return c
  53180. }
  53181. // IfNoneMatch sets the optional parameter which makes the operation
  53182. // fail if the object's ETag matches the given value. This is useful for
  53183. // getting updates only after the object has changed since the last
  53184. // request. Use googleapi.IsNotModified to check whether the response
  53185. // error from Do is the result of In-None-Match.
  53186. func (c *TargetTcpProxiesGetCall) IfNoneMatch(entityTag string) *TargetTcpProxiesGetCall {
  53187. c.ifNoneMatch_ = entityTag
  53188. return c
  53189. }
  53190. // Context sets the context to be used in this call's Do method. Any
  53191. // pending HTTP request will be aborted if the provided context is
  53192. // canceled.
  53193. func (c *TargetTcpProxiesGetCall) Context(ctx context.Context) *TargetTcpProxiesGetCall {
  53194. c.ctx_ = ctx
  53195. return c
  53196. }
  53197. // Header returns an http.Header that can be modified by the caller to
  53198. // add HTTP headers to the request.
  53199. func (c *TargetTcpProxiesGetCall) Header() http.Header {
  53200. if c.header_ == nil {
  53201. c.header_ = make(http.Header)
  53202. }
  53203. return c.header_
  53204. }
  53205. func (c *TargetTcpProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  53206. reqHeaders := make(http.Header)
  53207. for k, v := range c.header_ {
  53208. reqHeaders[k] = v
  53209. }
  53210. reqHeaders.Set("User-Agent", c.s.userAgent())
  53211. if c.ifNoneMatch_ != "" {
  53212. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  53213. }
  53214. var body io.Reader = nil
  53215. c.urlParams_.Set("alt", alt)
  53216. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{targetTcpProxy}")
  53217. urls += "?" + c.urlParams_.Encode()
  53218. req, _ := http.NewRequest("GET", urls, body)
  53219. req.Header = reqHeaders
  53220. googleapi.Expand(req.URL, map[string]string{
  53221. "project": c.project,
  53222. "targetTcpProxy": c.targetTcpProxy,
  53223. })
  53224. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53225. }
  53226. // Do executes the "compute.targetTcpProxies.get" call.
  53227. // Exactly one of *TargetTcpProxy or error will be non-nil. Any non-2xx
  53228. // status code is an error. Response headers are in either
  53229. // *TargetTcpProxy.ServerResponse.Header or (if a response was returned
  53230. // at all) in error.(*googleapi.Error).Header. Use
  53231. // googleapi.IsNotModified to check whether the returned error was
  53232. // because http.StatusNotModified was returned.
  53233. func (c *TargetTcpProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetTcpProxy, error) {
  53234. gensupport.SetOptions(c.urlParams_, opts...)
  53235. res, err := c.doRequest("json")
  53236. if res != nil && res.StatusCode == http.StatusNotModified {
  53237. if res.Body != nil {
  53238. res.Body.Close()
  53239. }
  53240. return nil, &googleapi.Error{
  53241. Code: res.StatusCode,
  53242. Header: res.Header,
  53243. }
  53244. }
  53245. if err != nil {
  53246. return nil, err
  53247. }
  53248. defer googleapi.CloseBody(res)
  53249. if err := googleapi.CheckResponse(res); err != nil {
  53250. return nil, err
  53251. }
  53252. ret := &TargetTcpProxy{
  53253. ServerResponse: googleapi.ServerResponse{
  53254. Header: res.Header,
  53255. HTTPStatusCode: res.StatusCode,
  53256. },
  53257. }
  53258. target := &ret
  53259. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  53260. return nil, err
  53261. }
  53262. return ret, nil
  53263. // {
  53264. // "description": "Returns the specified TargetTcpProxy resource. Get a list of available target TCP proxies by making a list() request.",
  53265. // "httpMethod": "GET",
  53266. // "id": "compute.targetTcpProxies.get",
  53267. // "parameterOrder": [
  53268. // "project",
  53269. // "targetTcpProxy"
  53270. // ],
  53271. // "parameters": {
  53272. // "project": {
  53273. // "description": "Project ID for this request.",
  53274. // "location": "path",
  53275. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53276. // "required": true,
  53277. // "type": "string"
  53278. // },
  53279. // "targetTcpProxy": {
  53280. // "description": "Name of the TargetTcpProxy resource to return.",
  53281. // "location": "path",
  53282. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  53283. // "required": true,
  53284. // "type": "string"
  53285. // }
  53286. // },
  53287. // "path": "{project}/global/targetTcpProxies/{targetTcpProxy}",
  53288. // "response": {
  53289. // "$ref": "TargetTcpProxy"
  53290. // },
  53291. // "scopes": [
  53292. // "https://www.googleapis.com/auth/cloud-platform",
  53293. // "https://www.googleapis.com/auth/compute",
  53294. // "https://www.googleapis.com/auth/compute.readonly"
  53295. // ]
  53296. // }
  53297. }
  53298. // method id "compute.targetTcpProxies.insert":
  53299. type TargetTcpProxiesInsertCall struct {
  53300. s *Service
  53301. project string
  53302. targettcpproxy *TargetTcpProxy
  53303. urlParams_ gensupport.URLParams
  53304. ctx_ context.Context
  53305. header_ http.Header
  53306. }
  53307. // Insert: Creates a TargetTcpProxy resource in the specified project
  53308. // using the data included in the request.
  53309. func (r *TargetTcpProxiesService) Insert(project string, targettcpproxy *TargetTcpProxy) *TargetTcpProxiesInsertCall {
  53310. c := &TargetTcpProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53311. c.project = project
  53312. c.targettcpproxy = targettcpproxy
  53313. return c
  53314. }
  53315. // Fields allows partial responses to be retrieved. See
  53316. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53317. // for more information.
  53318. func (c *TargetTcpProxiesInsertCall) Fields(s ...googleapi.Field) *TargetTcpProxiesInsertCall {
  53319. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53320. return c
  53321. }
  53322. // Context sets the context to be used in this call's Do method. Any
  53323. // pending HTTP request will be aborted if the provided context is
  53324. // canceled.
  53325. func (c *TargetTcpProxiesInsertCall) Context(ctx context.Context) *TargetTcpProxiesInsertCall {
  53326. c.ctx_ = ctx
  53327. return c
  53328. }
  53329. // Header returns an http.Header that can be modified by the caller to
  53330. // add HTTP headers to the request.
  53331. func (c *TargetTcpProxiesInsertCall) Header() http.Header {
  53332. if c.header_ == nil {
  53333. c.header_ = make(http.Header)
  53334. }
  53335. return c.header_
  53336. }
  53337. func (c *TargetTcpProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  53338. reqHeaders := make(http.Header)
  53339. for k, v := range c.header_ {
  53340. reqHeaders[k] = v
  53341. }
  53342. reqHeaders.Set("User-Agent", c.s.userAgent())
  53343. var body io.Reader = nil
  53344. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxy)
  53345. if err != nil {
  53346. return nil, err
  53347. }
  53348. reqHeaders.Set("Content-Type", "application/json")
  53349. c.urlParams_.Set("alt", alt)
  53350. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies")
  53351. urls += "?" + c.urlParams_.Encode()
  53352. req, _ := http.NewRequest("POST", urls, body)
  53353. req.Header = reqHeaders
  53354. googleapi.Expand(req.URL, map[string]string{
  53355. "project": c.project,
  53356. })
  53357. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53358. }
  53359. // Do executes the "compute.targetTcpProxies.insert" call.
  53360. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  53361. // status code is an error. Response headers are in either
  53362. // *Operation.ServerResponse.Header or (if a response was returned at
  53363. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53364. // to check whether the returned error was because
  53365. // http.StatusNotModified was returned.
  53366. func (c *TargetTcpProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  53367. gensupport.SetOptions(c.urlParams_, opts...)
  53368. res, err := c.doRequest("json")
  53369. if res != nil && res.StatusCode == http.StatusNotModified {
  53370. if res.Body != nil {
  53371. res.Body.Close()
  53372. }
  53373. return nil, &googleapi.Error{
  53374. Code: res.StatusCode,
  53375. Header: res.Header,
  53376. }
  53377. }
  53378. if err != nil {
  53379. return nil, err
  53380. }
  53381. defer googleapi.CloseBody(res)
  53382. if err := googleapi.CheckResponse(res); err != nil {
  53383. return nil, err
  53384. }
  53385. ret := &Operation{
  53386. ServerResponse: googleapi.ServerResponse{
  53387. Header: res.Header,
  53388. HTTPStatusCode: res.StatusCode,
  53389. },
  53390. }
  53391. target := &ret
  53392. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  53393. return nil, err
  53394. }
  53395. return ret, nil
  53396. // {
  53397. // "description": "Creates a TargetTcpProxy resource in the specified project using the data included in the request.",
  53398. // "httpMethod": "POST",
  53399. // "id": "compute.targetTcpProxies.insert",
  53400. // "parameterOrder": [
  53401. // "project"
  53402. // ],
  53403. // "parameters": {
  53404. // "project": {
  53405. // "description": "Project ID for this request.",
  53406. // "location": "path",
  53407. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53408. // "required": true,
  53409. // "type": "string"
  53410. // }
  53411. // },
  53412. // "path": "{project}/global/targetTcpProxies",
  53413. // "request": {
  53414. // "$ref": "TargetTcpProxy"
  53415. // },
  53416. // "response": {
  53417. // "$ref": "Operation"
  53418. // },
  53419. // "scopes": [
  53420. // "https://www.googleapis.com/auth/cloud-platform",
  53421. // "https://www.googleapis.com/auth/compute"
  53422. // ]
  53423. // }
  53424. }
  53425. // method id "compute.targetTcpProxies.list":
  53426. type TargetTcpProxiesListCall struct {
  53427. s *Service
  53428. project string
  53429. urlParams_ gensupport.URLParams
  53430. ifNoneMatch_ string
  53431. ctx_ context.Context
  53432. header_ http.Header
  53433. }
  53434. // List: Retrieves the list of TargetTcpProxy resources available to the
  53435. // specified project.
  53436. func (r *TargetTcpProxiesService) List(project string) *TargetTcpProxiesListCall {
  53437. c := &TargetTcpProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53438. c.project = project
  53439. return c
  53440. }
  53441. // Filter sets the optional parameter "filter": Sets a filter
  53442. // {expression} for filtering listed resources. Your {expression} must
  53443. // be in the format: field_name comparison_string literal_string.
  53444. //
  53445. // The field_name is the name of the field you want to compare. Only
  53446. // atomic field types are supported (string, number, boolean). The
  53447. // comparison_string must be either eq (equals) or ne (not equals). The
  53448. // literal_string is the string value to filter to. The literal value
  53449. // must be valid for the type of field you are filtering by (string,
  53450. // number, boolean). For string fields, the literal value is interpreted
  53451. // as a regular expression using RE2 syntax. The literal value must
  53452. // match the entire field.
  53453. //
  53454. // For example, to filter for instances that do not have a name of
  53455. // example-instance, you would use name ne example-instance.
  53456. //
  53457. // You can filter on nested fields. For example, you could filter on
  53458. // instances that have set the scheduling.automaticRestart field to
  53459. // true. Use filtering on nested fields to take advantage of labels to
  53460. // organize and search for results based on label values.
  53461. //
  53462. // To filter on multiple expressions, provide each separate expression
  53463. // within parentheses. For example, (scheduling.automaticRestart eq
  53464. // true) (zone eq us-central1-f). Multiple expressions are treated as
  53465. // AND expressions, meaning that resources must match all expressions to
  53466. // pass the filters.
  53467. func (c *TargetTcpProxiesListCall) Filter(filter string) *TargetTcpProxiesListCall {
  53468. c.urlParams_.Set("filter", filter)
  53469. return c
  53470. }
  53471. // MaxResults sets the optional parameter "maxResults": The maximum
  53472. // number of results per page that should be returned. If the number of
  53473. // available results is larger than maxResults, Compute Engine returns a
  53474. // nextPageToken that can be used to get the next page of results in
  53475. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  53476. // (Default: 500)
  53477. func (c *TargetTcpProxiesListCall) MaxResults(maxResults int64) *TargetTcpProxiesListCall {
  53478. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  53479. return c
  53480. }
  53481. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  53482. // a certain order. By default, results are returned in alphanumerical
  53483. // order based on the resource name.
  53484. //
  53485. // You can also sort results in descending order based on the creation
  53486. // timestamp using orderBy="creationTimestamp desc". This sorts results
  53487. // based on the creationTimestamp field in reverse chronological order
  53488. // (newest result first). Use this to sort resources like operations so
  53489. // that the newest operation is returned first.
  53490. //
  53491. // Currently, only sorting by name or creationTimestamp desc is
  53492. // supported.
  53493. func (c *TargetTcpProxiesListCall) OrderBy(orderBy string) *TargetTcpProxiesListCall {
  53494. c.urlParams_.Set("orderBy", orderBy)
  53495. return c
  53496. }
  53497. // PageToken sets the optional parameter "pageToken": Specifies a page
  53498. // token to use. Set pageToken to the nextPageToken returned by a
  53499. // previous list request to get the next page of results.
  53500. func (c *TargetTcpProxiesListCall) PageToken(pageToken string) *TargetTcpProxiesListCall {
  53501. c.urlParams_.Set("pageToken", pageToken)
  53502. return c
  53503. }
  53504. // Fields allows partial responses to be retrieved. See
  53505. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53506. // for more information.
  53507. func (c *TargetTcpProxiesListCall) Fields(s ...googleapi.Field) *TargetTcpProxiesListCall {
  53508. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53509. return c
  53510. }
  53511. // IfNoneMatch sets the optional parameter which makes the operation
  53512. // fail if the object's ETag matches the given value. This is useful for
  53513. // getting updates only after the object has changed since the last
  53514. // request. Use googleapi.IsNotModified to check whether the response
  53515. // error from Do is the result of In-None-Match.
  53516. func (c *TargetTcpProxiesListCall) IfNoneMatch(entityTag string) *TargetTcpProxiesListCall {
  53517. c.ifNoneMatch_ = entityTag
  53518. return c
  53519. }
  53520. // Context sets the context to be used in this call's Do method. Any
  53521. // pending HTTP request will be aborted if the provided context is
  53522. // canceled.
  53523. func (c *TargetTcpProxiesListCall) Context(ctx context.Context) *TargetTcpProxiesListCall {
  53524. c.ctx_ = ctx
  53525. return c
  53526. }
  53527. // Header returns an http.Header that can be modified by the caller to
  53528. // add HTTP headers to the request.
  53529. func (c *TargetTcpProxiesListCall) Header() http.Header {
  53530. if c.header_ == nil {
  53531. c.header_ = make(http.Header)
  53532. }
  53533. return c.header_
  53534. }
  53535. func (c *TargetTcpProxiesListCall) doRequest(alt string) (*http.Response, error) {
  53536. reqHeaders := make(http.Header)
  53537. for k, v := range c.header_ {
  53538. reqHeaders[k] = v
  53539. }
  53540. reqHeaders.Set("User-Agent", c.s.userAgent())
  53541. if c.ifNoneMatch_ != "" {
  53542. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  53543. }
  53544. var body io.Reader = nil
  53545. c.urlParams_.Set("alt", alt)
  53546. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies")
  53547. urls += "?" + c.urlParams_.Encode()
  53548. req, _ := http.NewRequest("GET", urls, body)
  53549. req.Header = reqHeaders
  53550. googleapi.Expand(req.URL, map[string]string{
  53551. "project": c.project,
  53552. })
  53553. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53554. }
  53555. // Do executes the "compute.targetTcpProxies.list" call.
  53556. // Exactly one of *TargetTcpProxyList or error will be non-nil. Any
  53557. // non-2xx status code is an error. Response headers are in either
  53558. // *TargetTcpProxyList.ServerResponse.Header or (if a response was
  53559. // returned at all) in error.(*googleapi.Error).Header. Use
  53560. // googleapi.IsNotModified to check whether the returned error was
  53561. // because http.StatusNotModified was returned.
  53562. func (c *TargetTcpProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetTcpProxyList, error) {
  53563. gensupport.SetOptions(c.urlParams_, opts...)
  53564. res, err := c.doRequest("json")
  53565. if res != nil && res.StatusCode == http.StatusNotModified {
  53566. if res.Body != nil {
  53567. res.Body.Close()
  53568. }
  53569. return nil, &googleapi.Error{
  53570. Code: res.StatusCode,
  53571. Header: res.Header,
  53572. }
  53573. }
  53574. if err != nil {
  53575. return nil, err
  53576. }
  53577. defer googleapi.CloseBody(res)
  53578. if err := googleapi.CheckResponse(res); err != nil {
  53579. return nil, err
  53580. }
  53581. ret := &TargetTcpProxyList{
  53582. ServerResponse: googleapi.ServerResponse{
  53583. Header: res.Header,
  53584. HTTPStatusCode: res.StatusCode,
  53585. },
  53586. }
  53587. target := &ret
  53588. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  53589. return nil, err
  53590. }
  53591. return ret, nil
  53592. // {
  53593. // "description": "Retrieves the list of TargetTcpProxy resources available to the specified project.",
  53594. // "httpMethod": "GET",
  53595. // "id": "compute.targetTcpProxies.list",
  53596. // "parameterOrder": [
  53597. // "project"
  53598. // ],
  53599. // "parameters": {
  53600. // "filter": {
  53601. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  53602. // "location": "query",
  53603. // "type": "string"
  53604. // },
  53605. // "maxResults": {
  53606. // "default": "500",
  53607. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  53608. // "format": "uint32",
  53609. // "location": "query",
  53610. // "minimum": "0",
  53611. // "type": "integer"
  53612. // },
  53613. // "orderBy": {
  53614. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  53615. // "location": "query",
  53616. // "type": "string"
  53617. // },
  53618. // "pageToken": {
  53619. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  53620. // "location": "query",
  53621. // "type": "string"
  53622. // },
  53623. // "project": {
  53624. // "description": "Project ID for this request.",
  53625. // "location": "path",
  53626. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53627. // "required": true,
  53628. // "type": "string"
  53629. // }
  53630. // },
  53631. // "path": "{project}/global/targetTcpProxies",
  53632. // "response": {
  53633. // "$ref": "TargetTcpProxyList"
  53634. // },
  53635. // "scopes": [
  53636. // "https://www.googleapis.com/auth/cloud-platform",
  53637. // "https://www.googleapis.com/auth/compute",
  53638. // "https://www.googleapis.com/auth/compute.readonly"
  53639. // ]
  53640. // }
  53641. }
  53642. // Pages invokes f for each page of results.
  53643. // A non-nil error returned from f will halt the iteration.
  53644. // The provided context supersedes any context provided to the Context method.
  53645. func (c *TargetTcpProxiesListCall) Pages(ctx context.Context, f func(*TargetTcpProxyList) error) error {
  53646. c.ctx_ = ctx
  53647. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  53648. for {
  53649. x, err := c.Do()
  53650. if err != nil {
  53651. return err
  53652. }
  53653. if err := f(x); err != nil {
  53654. return err
  53655. }
  53656. if x.NextPageToken == "" {
  53657. return nil
  53658. }
  53659. c.PageToken(x.NextPageToken)
  53660. }
  53661. }
  53662. // method id "compute.targetTcpProxies.setBackendService":
  53663. type TargetTcpProxiesSetBackendServiceCall struct {
  53664. s *Service
  53665. project string
  53666. targetTcpProxy string
  53667. targettcpproxiessetbackendservicerequest *TargetTcpProxiesSetBackendServiceRequest
  53668. urlParams_ gensupport.URLParams
  53669. ctx_ context.Context
  53670. header_ http.Header
  53671. }
  53672. // SetBackendService: Changes the BackendService for TargetTcpProxy.
  53673. func (r *TargetTcpProxiesService) SetBackendService(project string, targetTcpProxy string, targettcpproxiessetbackendservicerequest *TargetTcpProxiesSetBackendServiceRequest) *TargetTcpProxiesSetBackendServiceCall {
  53674. c := &TargetTcpProxiesSetBackendServiceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53675. c.project = project
  53676. c.targetTcpProxy = targetTcpProxy
  53677. c.targettcpproxiessetbackendservicerequest = targettcpproxiessetbackendservicerequest
  53678. return c
  53679. }
  53680. // Fields allows partial responses to be retrieved. See
  53681. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53682. // for more information.
  53683. func (c *TargetTcpProxiesSetBackendServiceCall) Fields(s ...googleapi.Field) *TargetTcpProxiesSetBackendServiceCall {
  53684. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53685. return c
  53686. }
  53687. // Context sets the context to be used in this call's Do method. Any
  53688. // pending HTTP request will be aborted if the provided context is
  53689. // canceled.
  53690. func (c *TargetTcpProxiesSetBackendServiceCall) Context(ctx context.Context) *TargetTcpProxiesSetBackendServiceCall {
  53691. c.ctx_ = ctx
  53692. return c
  53693. }
  53694. // Header returns an http.Header that can be modified by the caller to
  53695. // add HTTP headers to the request.
  53696. func (c *TargetTcpProxiesSetBackendServiceCall) Header() http.Header {
  53697. if c.header_ == nil {
  53698. c.header_ = make(http.Header)
  53699. }
  53700. return c.header_
  53701. }
  53702. func (c *TargetTcpProxiesSetBackendServiceCall) doRequest(alt string) (*http.Response, error) {
  53703. reqHeaders := make(http.Header)
  53704. for k, v := range c.header_ {
  53705. reqHeaders[k] = v
  53706. }
  53707. reqHeaders.Set("User-Agent", c.s.userAgent())
  53708. var body io.Reader = nil
  53709. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxiessetbackendservicerequest)
  53710. if err != nil {
  53711. return nil, err
  53712. }
  53713. reqHeaders.Set("Content-Type", "application/json")
  53714. c.urlParams_.Set("alt", alt)
  53715. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{targetTcpProxy}/setBackendService")
  53716. urls += "?" + c.urlParams_.Encode()
  53717. req, _ := http.NewRequest("POST", urls, body)
  53718. req.Header = reqHeaders
  53719. googleapi.Expand(req.URL, map[string]string{
  53720. "project": c.project,
  53721. "targetTcpProxy": c.targetTcpProxy,
  53722. })
  53723. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53724. }
  53725. // Do executes the "compute.targetTcpProxies.setBackendService" call.
  53726. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  53727. // status code is an error. Response headers are in either
  53728. // *Operation.ServerResponse.Header or (if a response was returned at
  53729. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53730. // to check whether the returned error was because
  53731. // http.StatusNotModified was returned.
  53732. func (c *TargetTcpProxiesSetBackendServiceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  53733. gensupport.SetOptions(c.urlParams_, opts...)
  53734. res, err := c.doRequest("json")
  53735. if res != nil && res.StatusCode == http.StatusNotModified {
  53736. if res.Body != nil {
  53737. res.Body.Close()
  53738. }
  53739. return nil, &googleapi.Error{
  53740. Code: res.StatusCode,
  53741. Header: res.Header,
  53742. }
  53743. }
  53744. if err != nil {
  53745. return nil, err
  53746. }
  53747. defer googleapi.CloseBody(res)
  53748. if err := googleapi.CheckResponse(res); err != nil {
  53749. return nil, err
  53750. }
  53751. ret := &Operation{
  53752. ServerResponse: googleapi.ServerResponse{
  53753. Header: res.Header,
  53754. HTTPStatusCode: res.StatusCode,
  53755. },
  53756. }
  53757. target := &ret
  53758. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  53759. return nil, err
  53760. }
  53761. return ret, nil
  53762. // {
  53763. // "description": "Changes the BackendService for TargetTcpProxy.",
  53764. // "httpMethod": "POST",
  53765. // "id": "compute.targetTcpProxies.setBackendService",
  53766. // "parameterOrder": [
  53767. // "project",
  53768. // "targetTcpProxy"
  53769. // ],
  53770. // "parameters": {
  53771. // "project": {
  53772. // "description": "Project ID for this request.",
  53773. // "location": "path",
  53774. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53775. // "required": true,
  53776. // "type": "string"
  53777. // },
  53778. // "targetTcpProxy": {
  53779. // "description": "Name of the TargetTcpProxy resource whose BackendService resource is to be set.",
  53780. // "location": "path",
  53781. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  53782. // "required": true,
  53783. // "type": "string"
  53784. // }
  53785. // },
  53786. // "path": "{project}/global/targetTcpProxies/{targetTcpProxy}/setBackendService",
  53787. // "request": {
  53788. // "$ref": "TargetTcpProxiesSetBackendServiceRequest"
  53789. // },
  53790. // "response": {
  53791. // "$ref": "Operation"
  53792. // },
  53793. // "scopes": [
  53794. // "https://www.googleapis.com/auth/cloud-platform",
  53795. // "https://www.googleapis.com/auth/compute"
  53796. // ]
  53797. // }
  53798. }
  53799. // method id "compute.targetTcpProxies.setProxyHeader":
  53800. type TargetTcpProxiesSetProxyHeaderCall struct {
  53801. s *Service
  53802. project string
  53803. targetTcpProxy string
  53804. targettcpproxiessetproxyheaderrequest *TargetTcpProxiesSetProxyHeaderRequest
  53805. urlParams_ gensupport.URLParams
  53806. ctx_ context.Context
  53807. header_ http.Header
  53808. }
  53809. // SetProxyHeader: Changes the ProxyHeaderType for TargetTcpProxy.
  53810. func (r *TargetTcpProxiesService) SetProxyHeader(project string, targetTcpProxy string, targettcpproxiessetproxyheaderrequest *TargetTcpProxiesSetProxyHeaderRequest) *TargetTcpProxiesSetProxyHeaderCall {
  53811. c := &TargetTcpProxiesSetProxyHeaderCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53812. c.project = project
  53813. c.targetTcpProxy = targetTcpProxy
  53814. c.targettcpproxiessetproxyheaderrequest = targettcpproxiessetproxyheaderrequest
  53815. return c
  53816. }
  53817. // Fields allows partial responses to be retrieved. See
  53818. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53819. // for more information.
  53820. func (c *TargetTcpProxiesSetProxyHeaderCall) Fields(s ...googleapi.Field) *TargetTcpProxiesSetProxyHeaderCall {
  53821. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53822. return c
  53823. }
  53824. // Context sets the context to be used in this call's Do method. Any
  53825. // pending HTTP request will be aborted if the provided context is
  53826. // canceled.
  53827. func (c *TargetTcpProxiesSetProxyHeaderCall) Context(ctx context.Context) *TargetTcpProxiesSetProxyHeaderCall {
  53828. c.ctx_ = ctx
  53829. return c
  53830. }
  53831. // Header returns an http.Header that can be modified by the caller to
  53832. // add HTTP headers to the request.
  53833. func (c *TargetTcpProxiesSetProxyHeaderCall) Header() http.Header {
  53834. if c.header_ == nil {
  53835. c.header_ = make(http.Header)
  53836. }
  53837. return c.header_
  53838. }
  53839. func (c *TargetTcpProxiesSetProxyHeaderCall) doRequest(alt string) (*http.Response, error) {
  53840. reqHeaders := make(http.Header)
  53841. for k, v := range c.header_ {
  53842. reqHeaders[k] = v
  53843. }
  53844. reqHeaders.Set("User-Agent", c.s.userAgent())
  53845. var body io.Reader = nil
  53846. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxiessetproxyheaderrequest)
  53847. if err != nil {
  53848. return nil, err
  53849. }
  53850. reqHeaders.Set("Content-Type", "application/json")
  53851. c.urlParams_.Set("alt", alt)
  53852. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{targetTcpProxy}/setProxyHeader")
  53853. urls += "?" + c.urlParams_.Encode()
  53854. req, _ := http.NewRequest("POST", urls, body)
  53855. req.Header = reqHeaders
  53856. googleapi.Expand(req.URL, map[string]string{
  53857. "project": c.project,
  53858. "targetTcpProxy": c.targetTcpProxy,
  53859. })
  53860. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53861. }
  53862. // Do executes the "compute.targetTcpProxies.setProxyHeader" call.
  53863. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  53864. // status code is an error. Response headers are in either
  53865. // *Operation.ServerResponse.Header or (if a response was returned at
  53866. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53867. // to check whether the returned error was because
  53868. // http.StatusNotModified was returned.
  53869. func (c *TargetTcpProxiesSetProxyHeaderCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  53870. gensupport.SetOptions(c.urlParams_, opts...)
  53871. res, err := c.doRequest("json")
  53872. if res != nil && res.StatusCode == http.StatusNotModified {
  53873. if res.Body != nil {
  53874. res.Body.Close()
  53875. }
  53876. return nil, &googleapi.Error{
  53877. Code: res.StatusCode,
  53878. Header: res.Header,
  53879. }
  53880. }
  53881. if err != nil {
  53882. return nil, err
  53883. }
  53884. defer googleapi.CloseBody(res)
  53885. if err := googleapi.CheckResponse(res); err != nil {
  53886. return nil, err
  53887. }
  53888. ret := &Operation{
  53889. ServerResponse: googleapi.ServerResponse{
  53890. Header: res.Header,
  53891. HTTPStatusCode: res.StatusCode,
  53892. },
  53893. }
  53894. target := &ret
  53895. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  53896. return nil, err
  53897. }
  53898. return ret, nil
  53899. // {
  53900. // "description": "Changes the ProxyHeaderType for TargetTcpProxy.",
  53901. // "httpMethod": "POST",
  53902. // "id": "compute.targetTcpProxies.setProxyHeader",
  53903. // "parameterOrder": [
  53904. // "project",
  53905. // "targetTcpProxy"
  53906. // ],
  53907. // "parameters": {
  53908. // "project": {
  53909. // "description": "Project ID for this request.",
  53910. // "location": "path",
  53911. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53912. // "required": true,
  53913. // "type": "string"
  53914. // },
  53915. // "targetTcpProxy": {
  53916. // "description": "Name of the TargetTcpProxy resource whose ProxyHeader is to be set.",
  53917. // "location": "path",
  53918. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  53919. // "required": true,
  53920. // "type": "string"
  53921. // }
  53922. // },
  53923. // "path": "{project}/global/targetTcpProxies/{targetTcpProxy}/setProxyHeader",
  53924. // "request": {
  53925. // "$ref": "TargetTcpProxiesSetProxyHeaderRequest"
  53926. // },
  53927. // "response": {
  53928. // "$ref": "Operation"
  53929. // },
  53930. // "scopes": [
  53931. // "https://www.googleapis.com/auth/cloud-platform",
  53932. // "https://www.googleapis.com/auth/compute"
  53933. // ]
  53934. // }
  53935. }
  53936. // method id "compute.targetVpnGateways.aggregatedList":
  53937. type TargetVpnGatewaysAggregatedListCall struct {
  53938. s *Service
  53939. project string
  53940. urlParams_ gensupport.URLParams
  53941. ifNoneMatch_ string
  53942. ctx_ context.Context
  53943. header_ http.Header
  53944. }
  53945. // AggregatedList: Retrieves an aggregated list of target VPN gateways.
  53946. func (r *TargetVpnGatewaysService) AggregatedList(project string) *TargetVpnGatewaysAggregatedListCall {
  53947. c := &TargetVpnGatewaysAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53948. c.project = project
  53949. return c
  53950. }
  53951. // Filter sets the optional parameter "filter": Sets a filter
  53952. // {expression} for filtering listed resources. Your {expression} must
  53953. // be in the format: field_name comparison_string literal_string.
  53954. //
  53955. // The field_name is the name of the field you want to compare. Only
  53956. // atomic field types are supported (string, number, boolean). The
  53957. // comparison_string must be either eq (equals) or ne (not equals). The
  53958. // literal_string is the string value to filter to. The literal value
  53959. // must be valid for the type of field you are filtering by (string,
  53960. // number, boolean). For string fields, the literal value is interpreted
  53961. // as a regular expression using RE2 syntax. The literal value must
  53962. // match the entire field.
  53963. //
  53964. // For example, to filter for instances that do not have a name of
  53965. // example-instance, you would use name ne example-instance.
  53966. //
  53967. // You can filter on nested fields. For example, you could filter on
  53968. // instances that have set the scheduling.automaticRestart field to
  53969. // true. Use filtering on nested fields to take advantage of labels to
  53970. // organize and search for results based on label values.
  53971. //
  53972. // To filter on multiple expressions, provide each separate expression
  53973. // within parentheses. For example, (scheduling.automaticRestart eq
  53974. // true) (zone eq us-central1-f). Multiple expressions are treated as
  53975. // AND expressions, meaning that resources must match all expressions to
  53976. // pass the filters.
  53977. func (c *TargetVpnGatewaysAggregatedListCall) Filter(filter string) *TargetVpnGatewaysAggregatedListCall {
  53978. c.urlParams_.Set("filter", filter)
  53979. return c
  53980. }
  53981. // MaxResults sets the optional parameter "maxResults": The maximum
  53982. // number of results per page that should be returned. If the number of
  53983. // available results is larger than maxResults, Compute Engine returns a
  53984. // nextPageToken that can be used to get the next page of results in
  53985. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  53986. // (Default: 500)
  53987. func (c *TargetVpnGatewaysAggregatedListCall) MaxResults(maxResults int64) *TargetVpnGatewaysAggregatedListCall {
  53988. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  53989. return c
  53990. }
  53991. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  53992. // a certain order. By default, results are returned in alphanumerical
  53993. // order based on the resource name.
  53994. //
  53995. // You can also sort results in descending order based on the creation
  53996. // timestamp using orderBy="creationTimestamp desc". This sorts results
  53997. // based on the creationTimestamp field in reverse chronological order
  53998. // (newest result first). Use this to sort resources like operations so
  53999. // that the newest operation is returned first.
  54000. //
  54001. // Currently, only sorting by name or creationTimestamp desc is
  54002. // supported.
  54003. func (c *TargetVpnGatewaysAggregatedListCall) OrderBy(orderBy string) *TargetVpnGatewaysAggregatedListCall {
  54004. c.urlParams_.Set("orderBy", orderBy)
  54005. return c
  54006. }
  54007. // PageToken sets the optional parameter "pageToken": Specifies a page
  54008. // token to use. Set pageToken to the nextPageToken returned by a
  54009. // previous list request to get the next page of results.
  54010. func (c *TargetVpnGatewaysAggregatedListCall) PageToken(pageToken string) *TargetVpnGatewaysAggregatedListCall {
  54011. c.urlParams_.Set("pageToken", pageToken)
  54012. return c
  54013. }
  54014. // Fields allows partial responses to be retrieved. See
  54015. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54016. // for more information.
  54017. func (c *TargetVpnGatewaysAggregatedListCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysAggregatedListCall {
  54018. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54019. return c
  54020. }
  54021. // IfNoneMatch sets the optional parameter which makes the operation
  54022. // fail if the object's ETag matches the given value. This is useful for
  54023. // getting updates only after the object has changed since the last
  54024. // request. Use googleapi.IsNotModified to check whether the response
  54025. // error from Do is the result of In-None-Match.
  54026. func (c *TargetVpnGatewaysAggregatedListCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysAggregatedListCall {
  54027. c.ifNoneMatch_ = entityTag
  54028. return c
  54029. }
  54030. // Context sets the context to be used in this call's Do method. Any
  54031. // pending HTTP request will be aborted if the provided context is
  54032. // canceled.
  54033. func (c *TargetVpnGatewaysAggregatedListCall) Context(ctx context.Context) *TargetVpnGatewaysAggregatedListCall {
  54034. c.ctx_ = ctx
  54035. return c
  54036. }
  54037. // Header returns an http.Header that can be modified by the caller to
  54038. // add HTTP headers to the request.
  54039. func (c *TargetVpnGatewaysAggregatedListCall) Header() http.Header {
  54040. if c.header_ == nil {
  54041. c.header_ = make(http.Header)
  54042. }
  54043. return c.header_
  54044. }
  54045. func (c *TargetVpnGatewaysAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  54046. reqHeaders := make(http.Header)
  54047. for k, v := range c.header_ {
  54048. reqHeaders[k] = v
  54049. }
  54050. reqHeaders.Set("User-Agent", c.s.userAgent())
  54051. if c.ifNoneMatch_ != "" {
  54052. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  54053. }
  54054. var body io.Reader = nil
  54055. c.urlParams_.Set("alt", alt)
  54056. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetVpnGateways")
  54057. urls += "?" + c.urlParams_.Encode()
  54058. req, _ := http.NewRequest("GET", urls, body)
  54059. req.Header = reqHeaders
  54060. googleapi.Expand(req.URL, map[string]string{
  54061. "project": c.project,
  54062. })
  54063. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54064. }
  54065. // Do executes the "compute.targetVpnGateways.aggregatedList" call.
  54066. // Exactly one of *TargetVpnGatewayAggregatedList or error will be
  54067. // non-nil. Any non-2xx status code is an error. Response headers are in
  54068. // either *TargetVpnGatewayAggregatedList.ServerResponse.Header or (if a
  54069. // response was returned at all) in error.(*googleapi.Error).Header. Use
  54070. // googleapi.IsNotModified to check whether the returned error was
  54071. // because http.StatusNotModified was returned.
  54072. func (c *TargetVpnGatewaysAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetVpnGatewayAggregatedList, error) {
  54073. gensupport.SetOptions(c.urlParams_, opts...)
  54074. res, err := c.doRequest("json")
  54075. if res != nil && res.StatusCode == http.StatusNotModified {
  54076. if res.Body != nil {
  54077. res.Body.Close()
  54078. }
  54079. return nil, &googleapi.Error{
  54080. Code: res.StatusCode,
  54081. Header: res.Header,
  54082. }
  54083. }
  54084. if err != nil {
  54085. return nil, err
  54086. }
  54087. defer googleapi.CloseBody(res)
  54088. if err := googleapi.CheckResponse(res); err != nil {
  54089. return nil, err
  54090. }
  54091. ret := &TargetVpnGatewayAggregatedList{
  54092. ServerResponse: googleapi.ServerResponse{
  54093. Header: res.Header,
  54094. HTTPStatusCode: res.StatusCode,
  54095. },
  54096. }
  54097. target := &ret
  54098. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  54099. return nil, err
  54100. }
  54101. return ret, nil
  54102. // {
  54103. // "description": "Retrieves an aggregated list of target VPN gateways.",
  54104. // "httpMethod": "GET",
  54105. // "id": "compute.targetVpnGateways.aggregatedList",
  54106. // "parameterOrder": [
  54107. // "project"
  54108. // ],
  54109. // "parameters": {
  54110. // "filter": {
  54111. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  54112. // "location": "query",
  54113. // "type": "string"
  54114. // },
  54115. // "maxResults": {
  54116. // "default": "500",
  54117. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  54118. // "format": "uint32",
  54119. // "location": "query",
  54120. // "minimum": "0",
  54121. // "type": "integer"
  54122. // },
  54123. // "orderBy": {
  54124. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  54125. // "location": "query",
  54126. // "type": "string"
  54127. // },
  54128. // "pageToken": {
  54129. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  54130. // "location": "query",
  54131. // "type": "string"
  54132. // },
  54133. // "project": {
  54134. // "description": "Project ID for this request.",
  54135. // "location": "path",
  54136. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54137. // "required": true,
  54138. // "type": "string"
  54139. // }
  54140. // },
  54141. // "path": "{project}/aggregated/targetVpnGateways",
  54142. // "response": {
  54143. // "$ref": "TargetVpnGatewayAggregatedList"
  54144. // },
  54145. // "scopes": [
  54146. // "https://www.googleapis.com/auth/cloud-platform",
  54147. // "https://www.googleapis.com/auth/compute",
  54148. // "https://www.googleapis.com/auth/compute.readonly"
  54149. // ]
  54150. // }
  54151. }
  54152. // Pages invokes f for each page of results.
  54153. // A non-nil error returned from f will halt the iteration.
  54154. // The provided context supersedes any context provided to the Context method.
  54155. func (c *TargetVpnGatewaysAggregatedListCall) Pages(ctx context.Context, f func(*TargetVpnGatewayAggregatedList) error) error {
  54156. c.ctx_ = ctx
  54157. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  54158. for {
  54159. x, err := c.Do()
  54160. if err != nil {
  54161. return err
  54162. }
  54163. if err := f(x); err != nil {
  54164. return err
  54165. }
  54166. if x.NextPageToken == "" {
  54167. return nil
  54168. }
  54169. c.PageToken(x.NextPageToken)
  54170. }
  54171. }
  54172. // method id "compute.targetVpnGateways.delete":
  54173. type TargetVpnGatewaysDeleteCall struct {
  54174. s *Service
  54175. project string
  54176. region string
  54177. targetVpnGateway string
  54178. urlParams_ gensupport.URLParams
  54179. ctx_ context.Context
  54180. header_ http.Header
  54181. }
  54182. // Delete: Deletes the specified target VPN gateway.
  54183. func (r *TargetVpnGatewaysService) Delete(project string, region string, targetVpnGateway string) *TargetVpnGatewaysDeleteCall {
  54184. c := &TargetVpnGatewaysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54185. c.project = project
  54186. c.region = region
  54187. c.targetVpnGateway = targetVpnGateway
  54188. return c
  54189. }
  54190. // Fields allows partial responses to be retrieved. See
  54191. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54192. // for more information.
  54193. func (c *TargetVpnGatewaysDeleteCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysDeleteCall {
  54194. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54195. return c
  54196. }
  54197. // Context sets the context to be used in this call's Do method. Any
  54198. // pending HTTP request will be aborted if the provided context is
  54199. // canceled.
  54200. func (c *TargetVpnGatewaysDeleteCall) Context(ctx context.Context) *TargetVpnGatewaysDeleteCall {
  54201. c.ctx_ = ctx
  54202. return c
  54203. }
  54204. // Header returns an http.Header that can be modified by the caller to
  54205. // add HTTP headers to the request.
  54206. func (c *TargetVpnGatewaysDeleteCall) Header() http.Header {
  54207. if c.header_ == nil {
  54208. c.header_ = make(http.Header)
  54209. }
  54210. return c.header_
  54211. }
  54212. func (c *TargetVpnGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) {
  54213. reqHeaders := make(http.Header)
  54214. for k, v := range c.header_ {
  54215. reqHeaders[k] = v
  54216. }
  54217. reqHeaders.Set("User-Agent", c.s.userAgent())
  54218. var body io.Reader = nil
  54219. c.urlParams_.Set("alt", alt)
  54220. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}")
  54221. urls += "?" + c.urlParams_.Encode()
  54222. req, _ := http.NewRequest("DELETE", urls, body)
  54223. req.Header = reqHeaders
  54224. googleapi.Expand(req.URL, map[string]string{
  54225. "project": c.project,
  54226. "region": c.region,
  54227. "targetVpnGateway": c.targetVpnGateway,
  54228. })
  54229. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54230. }
  54231. // Do executes the "compute.targetVpnGateways.delete" call.
  54232. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  54233. // status code is an error. Response headers are in either
  54234. // *Operation.ServerResponse.Header or (if a response was returned at
  54235. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54236. // to check whether the returned error was because
  54237. // http.StatusNotModified was returned.
  54238. func (c *TargetVpnGatewaysDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  54239. gensupport.SetOptions(c.urlParams_, opts...)
  54240. res, err := c.doRequest("json")
  54241. if res != nil && res.StatusCode == http.StatusNotModified {
  54242. if res.Body != nil {
  54243. res.Body.Close()
  54244. }
  54245. return nil, &googleapi.Error{
  54246. Code: res.StatusCode,
  54247. Header: res.Header,
  54248. }
  54249. }
  54250. if err != nil {
  54251. return nil, err
  54252. }
  54253. defer googleapi.CloseBody(res)
  54254. if err := googleapi.CheckResponse(res); err != nil {
  54255. return nil, err
  54256. }
  54257. ret := &Operation{
  54258. ServerResponse: googleapi.ServerResponse{
  54259. Header: res.Header,
  54260. HTTPStatusCode: res.StatusCode,
  54261. },
  54262. }
  54263. target := &ret
  54264. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  54265. return nil, err
  54266. }
  54267. return ret, nil
  54268. // {
  54269. // "description": "Deletes the specified target VPN gateway.",
  54270. // "httpMethod": "DELETE",
  54271. // "id": "compute.targetVpnGateways.delete",
  54272. // "parameterOrder": [
  54273. // "project",
  54274. // "region",
  54275. // "targetVpnGateway"
  54276. // ],
  54277. // "parameters": {
  54278. // "project": {
  54279. // "description": "Project ID for this request.",
  54280. // "location": "path",
  54281. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54282. // "required": true,
  54283. // "type": "string"
  54284. // },
  54285. // "region": {
  54286. // "description": "Name of the region for this request.",
  54287. // "location": "path",
  54288. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  54289. // "required": true,
  54290. // "type": "string"
  54291. // },
  54292. // "targetVpnGateway": {
  54293. // "description": "Name of the target VPN gateway to delete.",
  54294. // "location": "path",
  54295. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  54296. // "required": true,
  54297. // "type": "string"
  54298. // }
  54299. // },
  54300. // "path": "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}",
  54301. // "response": {
  54302. // "$ref": "Operation"
  54303. // },
  54304. // "scopes": [
  54305. // "https://www.googleapis.com/auth/cloud-platform",
  54306. // "https://www.googleapis.com/auth/compute"
  54307. // ]
  54308. // }
  54309. }
  54310. // method id "compute.targetVpnGateways.get":
  54311. type TargetVpnGatewaysGetCall struct {
  54312. s *Service
  54313. project string
  54314. region string
  54315. targetVpnGateway string
  54316. urlParams_ gensupport.URLParams
  54317. ifNoneMatch_ string
  54318. ctx_ context.Context
  54319. header_ http.Header
  54320. }
  54321. // Get: Returns the specified target VPN gateway. Get a list of
  54322. // available target VPN gateways by making a list() request.
  54323. func (r *TargetVpnGatewaysService) Get(project string, region string, targetVpnGateway string) *TargetVpnGatewaysGetCall {
  54324. c := &TargetVpnGatewaysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54325. c.project = project
  54326. c.region = region
  54327. c.targetVpnGateway = targetVpnGateway
  54328. return c
  54329. }
  54330. // Fields allows partial responses to be retrieved. See
  54331. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54332. // for more information.
  54333. func (c *TargetVpnGatewaysGetCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysGetCall {
  54334. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54335. return c
  54336. }
  54337. // IfNoneMatch sets the optional parameter which makes the operation
  54338. // fail if the object's ETag matches the given value. This is useful for
  54339. // getting updates only after the object has changed since the last
  54340. // request. Use googleapi.IsNotModified to check whether the response
  54341. // error from Do is the result of In-None-Match.
  54342. func (c *TargetVpnGatewaysGetCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysGetCall {
  54343. c.ifNoneMatch_ = entityTag
  54344. return c
  54345. }
  54346. // Context sets the context to be used in this call's Do method. Any
  54347. // pending HTTP request will be aborted if the provided context is
  54348. // canceled.
  54349. func (c *TargetVpnGatewaysGetCall) Context(ctx context.Context) *TargetVpnGatewaysGetCall {
  54350. c.ctx_ = ctx
  54351. return c
  54352. }
  54353. // Header returns an http.Header that can be modified by the caller to
  54354. // add HTTP headers to the request.
  54355. func (c *TargetVpnGatewaysGetCall) Header() http.Header {
  54356. if c.header_ == nil {
  54357. c.header_ = make(http.Header)
  54358. }
  54359. return c.header_
  54360. }
  54361. func (c *TargetVpnGatewaysGetCall) doRequest(alt string) (*http.Response, error) {
  54362. reqHeaders := make(http.Header)
  54363. for k, v := range c.header_ {
  54364. reqHeaders[k] = v
  54365. }
  54366. reqHeaders.Set("User-Agent", c.s.userAgent())
  54367. if c.ifNoneMatch_ != "" {
  54368. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  54369. }
  54370. var body io.Reader = nil
  54371. c.urlParams_.Set("alt", alt)
  54372. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}")
  54373. urls += "?" + c.urlParams_.Encode()
  54374. req, _ := http.NewRequest("GET", urls, body)
  54375. req.Header = reqHeaders
  54376. googleapi.Expand(req.URL, map[string]string{
  54377. "project": c.project,
  54378. "region": c.region,
  54379. "targetVpnGateway": c.targetVpnGateway,
  54380. })
  54381. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54382. }
  54383. // Do executes the "compute.targetVpnGateways.get" call.
  54384. // Exactly one of *TargetVpnGateway or error will be non-nil. Any
  54385. // non-2xx status code is an error. Response headers are in either
  54386. // *TargetVpnGateway.ServerResponse.Header or (if a response was
  54387. // returned at all) in error.(*googleapi.Error).Header. Use
  54388. // googleapi.IsNotModified to check whether the returned error was
  54389. // because http.StatusNotModified was returned.
  54390. func (c *TargetVpnGatewaysGetCall) Do(opts ...googleapi.CallOption) (*TargetVpnGateway, error) {
  54391. gensupport.SetOptions(c.urlParams_, opts...)
  54392. res, err := c.doRequest("json")
  54393. if res != nil && res.StatusCode == http.StatusNotModified {
  54394. if res.Body != nil {
  54395. res.Body.Close()
  54396. }
  54397. return nil, &googleapi.Error{
  54398. Code: res.StatusCode,
  54399. Header: res.Header,
  54400. }
  54401. }
  54402. if err != nil {
  54403. return nil, err
  54404. }
  54405. defer googleapi.CloseBody(res)
  54406. if err := googleapi.CheckResponse(res); err != nil {
  54407. return nil, err
  54408. }
  54409. ret := &TargetVpnGateway{
  54410. ServerResponse: googleapi.ServerResponse{
  54411. Header: res.Header,
  54412. HTTPStatusCode: res.StatusCode,
  54413. },
  54414. }
  54415. target := &ret
  54416. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  54417. return nil, err
  54418. }
  54419. return ret, nil
  54420. // {
  54421. // "description": "Returns the specified target VPN gateway. Get a list of available target VPN gateways by making a list() request.",
  54422. // "httpMethod": "GET",
  54423. // "id": "compute.targetVpnGateways.get",
  54424. // "parameterOrder": [
  54425. // "project",
  54426. // "region",
  54427. // "targetVpnGateway"
  54428. // ],
  54429. // "parameters": {
  54430. // "project": {
  54431. // "description": "Project ID for this request.",
  54432. // "location": "path",
  54433. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54434. // "required": true,
  54435. // "type": "string"
  54436. // },
  54437. // "region": {
  54438. // "description": "Name of the region for this request.",
  54439. // "location": "path",
  54440. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  54441. // "required": true,
  54442. // "type": "string"
  54443. // },
  54444. // "targetVpnGateway": {
  54445. // "description": "Name of the target VPN gateway to return.",
  54446. // "location": "path",
  54447. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  54448. // "required": true,
  54449. // "type": "string"
  54450. // }
  54451. // },
  54452. // "path": "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}",
  54453. // "response": {
  54454. // "$ref": "TargetVpnGateway"
  54455. // },
  54456. // "scopes": [
  54457. // "https://www.googleapis.com/auth/cloud-platform",
  54458. // "https://www.googleapis.com/auth/compute",
  54459. // "https://www.googleapis.com/auth/compute.readonly"
  54460. // ]
  54461. // }
  54462. }
  54463. // method id "compute.targetVpnGateways.insert":
  54464. type TargetVpnGatewaysInsertCall struct {
  54465. s *Service
  54466. project string
  54467. region string
  54468. targetvpngateway *TargetVpnGateway
  54469. urlParams_ gensupport.URLParams
  54470. ctx_ context.Context
  54471. header_ http.Header
  54472. }
  54473. // Insert: Creates a target VPN gateway in the specified project and
  54474. // region using the data included in the request.
  54475. func (r *TargetVpnGatewaysService) Insert(project string, region string, targetvpngateway *TargetVpnGateway) *TargetVpnGatewaysInsertCall {
  54476. c := &TargetVpnGatewaysInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54477. c.project = project
  54478. c.region = region
  54479. c.targetvpngateway = targetvpngateway
  54480. return c
  54481. }
  54482. // Fields allows partial responses to be retrieved. See
  54483. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54484. // for more information.
  54485. func (c *TargetVpnGatewaysInsertCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysInsertCall {
  54486. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54487. return c
  54488. }
  54489. // Context sets the context to be used in this call's Do method. Any
  54490. // pending HTTP request will be aborted if the provided context is
  54491. // canceled.
  54492. func (c *TargetVpnGatewaysInsertCall) Context(ctx context.Context) *TargetVpnGatewaysInsertCall {
  54493. c.ctx_ = ctx
  54494. return c
  54495. }
  54496. // Header returns an http.Header that can be modified by the caller to
  54497. // add HTTP headers to the request.
  54498. func (c *TargetVpnGatewaysInsertCall) Header() http.Header {
  54499. if c.header_ == nil {
  54500. c.header_ = make(http.Header)
  54501. }
  54502. return c.header_
  54503. }
  54504. func (c *TargetVpnGatewaysInsertCall) doRequest(alt string) (*http.Response, error) {
  54505. reqHeaders := make(http.Header)
  54506. for k, v := range c.header_ {
  54507. reqHeaders[k] = v
  54508. }
  54509. reqHeaders.Set("User-Agent", c.s.userAgent())
  54510. var body io.Reader = nil
  54511. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetvpngateway)
  54512. if err != nil {
  54513. return nil, err
  54514. }
  54515. reqHeaders.Set("Content-Type", "application/json")
  54516. c.urlParams_.Set("alt", alt)
  54517. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways")
  54518. urls += "?" + c.urlParams_.Encode()
  54519. req, _ := http.NewRequest("POST", urls, body)
  54520. req.Header = reqHeaders
  54521. googleapi.Expand(req.URL, map[string]string{
  54522. "project": c.project,
  54523. "region": c.region,
  54524. })
  54525. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54526. }
  54527. // Do executes the "compute.targetVpnGateways.insert" call.
  54528. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  54529. // status code is an error. Response headers are in either
  54530. // *Operation.ServerResponse.Header or (if a response was returned at
  54531. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54532. // to check whether the returned error was because
  54533. // http.StatusNotModified was returned.
  54534. func (c *TargetVpnGatewaysInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  54535. gensupport.SetOptions(c.urlParams_, opts...)
  54536. res, err := c.doRequest("json")
  54537. if res != nil && res.StatusCode == http.StatusNotModified {
  54538. if res.Body != nil {
  54539. res.Body.Close()
  54540. }
  54541. return nil, &googleapi.Error{
  54542. Code: res.StatusCode,
  54543. Header: res.Header,
  54544. }
  54545. }
  54546. if err != nil {
  54547. return nil, err
  54548. }
  54549. defer googleapi.CloseBody(res)
  54550. if err := googleapi.CheckResponse(res); err != nil {
  54551. return nil, err
  54552. }
  54553. ret := &Operation{
  54554. ServerResponse: googleapi.ServerResponse{
  54555. Header: res.Header,
  54556. HTTPStatusCode: res.StatusCode,
  54557. },
  54558. }
  54559. target := &ret
  54560. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  54561. return nil, err
  54562. }
  54563. return ret, nil
  54564. // {
  54565. // "description": "Creates a target VPN gateway in the specified project and region using the data included in the request.",
  54566. // "httpMethod": "POST",
  54567. // "id": "compute.targetVpnGateways.insert",
  54568. // "parameterOrder": [
  54569. // "project",
  54570. // "region"
  54571. // ],
  54572. // "parameters": {
  54573. // "project": {
  54574. // "description": "Project ID for this request.",
  54575. // "location": "path",
  54576. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54577. // "required": true,
  54578. // "type": "string"
  54579. // },
  54580. // "region": {
  54581. // "description": "Name of the region for this request.",
  54582. // "location": "path",
  54583. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  54584. // "required": true,
  54585. // "type": "string"
  54586. // }
  54587. // },
  54588. // "path": "{project}/regions/{region}/targetVpnGateways",
  54589. // "request": {
  54590. // "$ref": "TargetVpnGateway"
  54591. // },
  54592. // "response": {
  54593. // "$ref": "Operation"
  54594. // },
  54595. // "scopes": [
  54596. // "https://www.googleapis.com/auth/cloud-platform",
  54597. // "https://www.googleapis.com/auth/compute"
  54598. // ]
  54599. // }
  54600. }
  54601. // method id "compute.targetVpnGateways.list":
  54602. type TargetVpnGatewaysListCall struct {
  54603. s *Service
  54604. project string
  54605. region string
  54606. urlParams_ gensupport.URLParams
  54607. ifNoneMatch_ string
  54608. ctx_ context.Context
  54609. header_ http.Header
  54610. }
  54611. // List: Retrieves a list of target VPN gateways available to the
  54612. // specified project and region.
  54613. func (r *TargetVpnGatewaysService) List(project string, region string) *TargetVpnGatewaysListCall {
  54614. c := &TargetVpnGatewaysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54615. c.project = project
  54616. c.region = region
  54617. return c
  54618. }
  54619. // Filter sets the optional parameter "filter": Sets a filter
  54620. // {expression} for filtering listed resources. Your {expression} must
  54621. // be in the format: field_name comparison_string literal_string.
  54622. //
  54623. // The field_name is the name of the field you want to compare. Only
  54624. // atomic field types are supported (string, number, boolean). The
  54625. // comparison_string must be either eq (equals) or ne (not equals). The
  54626. // literal_string is the string value to filter to. The literal value
  54627. // must be valid for the type of field you are filtering by (string,
  54628. // number, boolean). For string fields, the literal value is interpreted
  54629. // as a regular expression using RE2 syntax. The literal value must
  54630. // match the entire field.
  54631. //
  54632. // For example, to filter for instances that do not have a name of
  54633. // example-instance, you would use name ne example-instance.
  54634. //
  54635. // You can filter on nested fields. For example, you could filter on
  54636. // instances that have set the scheduling.automaticRestart field to
  54637. // true. Use filtering on nested fields to take advantage of labels to
  54638. // organize and search for results based on label values.
  54639. //
  54640. // To filter on multiple expressions, provide each separate expression
  54641. // within parentheses. For example, (scheduling.automaticRestart eq
  54642. // true) (zone eq us-central1-f). Multiple expressions are treated as
  54643. // AND expressions, meaning that resources must match all expressions to
  54644. // pass the filters.
  54645. func (c *TargetVpnGatewaysListCall) Filter(filter string) *TargetVpnGatewaysListCall {
  54646. c.urlParams_.Set("filter", filter)
  54647. return c
  54648. }
  54649. // MaxResults sets the optional parameter "maxResults": The maximum
  54650. // number of results per page that should be returned. If the number of
  54651. // available results is larger than maxResults, Compute Engine returns a
  54652. // nextPageToken that can be used to get the next page of results in
  54653. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  54654. // (Default: 500)
  54655. func (c *TargetVpnGatewaysListCall) MaxResults(maxResults int64) *TargetVpnGatewaysListCall {
  54656. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  54657. return c
  54658. }
  54659. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  54660. // a certain order. By default, results are returned in alphanumerical
  54661. // order based on the resource name.
  54662. //
  54663. // You can also sort results in descending order based on the creation
  54664. // timestamp using orderBy="creationTimestamp desc". This sorts results
  54665. // based on the creationTimestamp field in reverse chronological order
  54666. // (newest result first). Use this to sort resources like operations so
  54667. // that the newest operation is returned first.
  54668. //
  54669. // Currently, only sorting by name or creationTimestamp desc is
  54670. // supported.
  54671. func (c *TargetVpnGatewaysListCall) OrderBy(orderBy string) *TargetVpnGatewaysListCall {
  54672. c.urlParams_.Set("orderBy", orderBy)
  54673. return c
  54674. }
  54675. // PageToken sets the optional parameter "pageToken": Specifies a page
  54676. // token to use. Set pageToken to the nextPageToken returned by a
  54677. // previous list request to get the next page of results.
  54678. func (c *TargetVpnGatewaysListCall) PageToken(pageToken string) *TargetVpnGatewaysListCall {
  54679. c.urlParams_.Set("pageToken", pageToken)
  54680. return c
  54681. }
  54682. // Fields allows partial responses to be retrieved. See
  54683. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54684. // for more information.
  54685. func (c *TargetVpnGatewaysListCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysListCall {
  54686. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54687. return c
  54688. }
  54689. // IfNoneMatch sets the optional parameter which makes the operation
  54690. // fail if the object's ETag matches the given value. This is useful for
  54691. // getting updates only after the object has changed since the last
  54692. // request. Use googleapi.IsNotModified to check whether the response
  54693. // error from Do is the result of In-None-Match.
  54694. func (c *TargetVpnGatewaysListCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysListCall {
  54695. c.ifNoneMatch_ = entityTag
  54696. return c
  54697. }
  54698. // Context sets the context to be used in this call's Do method. Any
  54699. // pending HTTP request will be aborted if the provided context is
  54700. // canceled.
  54701. func (c *TargetVpnGatewaysListCall) Context(ctx context.Context) *TargetVpnGatewaysListCall {
  54702. c.ctx_ = ctx
  54703. return c
  54704. }
  54705. // Header returns an http.Header that can be modified by the caller to
  54706. // add HTTP headers to the request.
  54707. func (c *TargetVpnGatewaysListCall) Header() http.Header {
  54708. if c.header_ == nil {
  54709. c.header_ = make(http.Header)
  54710. }
  54711. return c.header_
  54712. }
  54713. func (c *TargetVpnGatewaysListCall) doRequest(alt string) (*http.Response, error) {
  54714. reqHeaders := make(http.Header)
  54715. for k, v := range c.header_ {
  54716. reqHeaders[k] = v
  54717. }
  54718. reqHeaders.Set("User-Agent", c.s.userAgent())
  54719. if c.ifNoneMatch_ != "" {
  54720. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  54721. }
  54722. var body io.Reader = nil
  54723. c.urlParams_.Set("alt", alt)
  54724. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways")
  54725. urls += "?" + c.urlParams_.Encode()
  54726. req, _ := http.NewRequest("GET", urls, body)
  54727. req.Header = reqHeaders
  54728. googleapi.Expand(req.URL, map[string]string{
  54729. "project": c.project,
  54730. "region": c.region,
  54731. })
  54732. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54733. }
  54734. // Do executes the "compute.targetVpnGateways.list" call.
  54735. // Exactly one of *TargetVpnGatewayList or error will be non-nil. Any
  54736. // non-2xx status code is an error. Response headers are in either
  54737. // *TargetVpnGatewayList.ServerResponse.Header or (if a response was
  54738. // returned at all) in error.(*googleapi.Error).Header. Use
  54739. // googleapi.IsNotModified to check whether the returned error was
  54740. // because http.StatusNotModified was returned.
  54741. func (c *TargetVpnGatewaysListCall) Do(opts ...googleapi.CallOption) (*TargetVpnGatewayList, error) {
  54742. gensupport.SetOptions(c.urlParams_, opts...)
  54743. res, err := c.doRequest("json")
  54744. if res != nil && res.StatusCode == http.StatusNotModified {
  54745. if res.Body != nil {
  54746. res.Body.Close()
  54747. }
  54748. return nil, &googleapi.Error{
  54749. Code: res.StatusCode,
  54750. Header: res.Header,
  54751. }
  54752. }
  54753. if err != nil {
  54754. return nil, err
  54755. }
  54756. defer googleapi.CloseBody(res)
  54757. if err := googleapi.CheckResponse(res); err != nil {
  54758. return nil, err
  54759. }
  54760. ret := &TargetVpnGatewayList{
  54761. ServerResponse: googleapi.ServerResponse{
  54762. Header: res.Header,
  54763. HTTPStatusCode: res.StatusCode,
  54764. },
  54765. }
  54766. target := &ret
  54767. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  54768. return nil, err
  54769. }
  54770. return ret, nil
  54771. // {
  54772. // "description": "Retrieves a list of target VPN gateways available to the specified project and region.",
  54773. // "httpMethod": "GET",
  54774. // "id": "compute.targetVpnGateways.list",
  54775. // "parameterOrder": [
  54776. // "project",
  54777. // "region"
  54778. // ],
  54779. // "parameters": {
  54780. // "filter": {
  54781. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  54782. // "location": "query",
  54783. // "type": "string"
  54784. // },
  54785. // "maxResults": {
  54786. // "default": "500",
  54787. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  54788. // "format": "uint32",
  54789. // "location": "query",
  54790. // "minimum": "0",
  54791. // "type": "integer"
  54792. // },
  54793. // "orderBy": {
  54794. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  54795. // "location": "query",
  54796. // "type": "string"
  54797. // },
  54798. // "pageToken": {
  54799. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  54800. // "location": "query",
  54801. // "type": "string"
  54802. // },
  54803. // "project": {
  54804. // "description": "Project ID for this request.",
  54805. // "location": "path",
  54806. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54807. // "required": true,
  54808. // "type": "string"
  54809. // },
  54810. // "region": {
  54811. // "description": "Name of the region for this request.",
  54812. // "location": "path",
  54813. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  54814. // "required": true,
  54815. // "type": "string"
  54816. // }
  54817. // },
  54818. // "path": "{project}/regions/{region}/targetVpnGateways",
  54819. // "response": {
  54820. // "$ref": "TargetVpnGatewayList"
  54821. // },
  54822. // "scopes": [
  54823. // "https://www.googleapis.com/auth/cloud-platform",
  54824. // "https://www.googleapis.com/auth/compute",
  54825. // "https://www.googleapis.com/auth/compute.readonly"
  54826. // ]
  54827. // }
  54828. }
  54829. // Pages invokes f for each page of results.
  54830. // A non-nil error returned from f will halt the iteration.
  54831. // The provided context supersedes any context provided to the Context method.
  54832. func (c *TargetVpnGatewaysListCall) Pages(ctx context.Context, f func(*TargetVpnGatewayList) error) error {
  54833. c.ctx_ = ctx
  54834. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  54835. for {
  54836. x, err := c.Do()
  54837. if err != nil {
  54838. return err
  54839. }
  54840. if err := f(x); err != nil {
  54841. return err
  54842. }
  54843. if x.NextPageToken == "" {
  54844. return nil
  54845. }
  54846. c.PageToken(x.NextPageToken)
  54847. }
  54848. }
  54849. // method id "compute.urlMaps.delete":
  54850. type UrlMapsDeleteCall struct {
  54851. s *Service
  54852. project string
  54853. urlMap string
  54854. urlParams_ gensupport.URLParams
  54855. ctx_ context.Context
  54856. header_ http.Header
  54857. }
  54858. // Delete: Deletes the specified UrlMap resource.
  54859. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/delete
  54860. func (r *UrlMapsService) Delete(project string, urlMap string) *UrlMapsDeleteCall {
  54861. c := &UrlMapsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54862. c.project = project
  54863. c.urlMap = urlMap
  54864. return c
  54865. }
  54866. // Fields allows partial responses to be retrieved. See
  54867. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54868. // for more information.
  54869. func (c *UrlMapsDeleteCall) Fields(s ...googleapi.Field) *UrlMapsDeleteCall {
  54870. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54871. return c
  54872. }
  54873. // Context sets the context to be used in this call's Do method. Any
  54874. // pending HTTP request will be aborted if the provided context is
  54875. // canceled.
  54876. func (c *UrlMapsDeleteCall) Context(ctx context.Context) *UrlMapsDeleteCall {
  54877. c.ctx_ = ctx
  54878. return c
  54879. }
  54880. // Header returns an http.Header that can be modified by the caller to
  54881. // add HTTP headers to the request.
  54882. func (c *UrlMapsDeleteCall) Header() http.Header {
  54883. if c.header_ == nil {
  54884. c.header_ = make(http.Header)
  54885. }
  54886. return c.header_
  54887. }
  54888. func (c *UrlMapsDeleteCall) doRequest(alt string) (*http.Response, error) {
  54889. reqHeaders := make(http.Header)
  54890. for k, v := range c.header_ {
  54891. reqHeaders[k] = v
  54892. }
  54893. reqHeaders.Set("User-Agent", c.s.userAgent())
  54894. var body io.Reader = nil
  54895. c.urlParams_.Set("alt", alt)
  54896. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  54897. urls += "?" + c.urlParams_.Encode()
  54898. req, _ := http.NewRequest("DELETE", urls, body)
  54899. req.Header = reqHeaders
  54900. googleapi.Expand(req.URL, map[string]string{
  54901. "project": c.project,
  54902. "urlMap": c.urlMap,
  54903. })
  54904. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54905. }
  54906. // Do executes the "compute.urlMaps.delete" call.
  54907. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  54908. // status code is an error. Response headers are in either
  54909. // *Operation.ServerResponse.Header or (if a response was returned at
  54910. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54911. // to check whether the returned error was because
  54912. // http.StatusNotModified was returned.
  54913. func (c *UrlMapsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  54914. gensupport.SetOptions(c.urlParams_, opts...)
  54915. res, err := c.doRequest("json")
  54916. if res != nil && res.StatusCode == http.StatusNotModified {
  54917. if res.Body != nil {
  54918. res.Body.Close()
  54919. }
  54920. return nil, &googleapi.Error{
  54921. Code: res.StatusCode,
  54922. Header: res.Header,
  54923. }
  54924. }
  54925. if err != nil {
  54926. return nil, err
  54927. }
  54928. defer googleapi.CloseBody(res)
  54929. if err := googleapi.CheckResponse(res); err != nil {
  54930. return nil, err
  54931. }
  54932. ret := &Operation{
  54933. ServerResponse: googleapi.ServerResponse{
  54934. Header: res.Header,
  54935. HTTPStatusCode: res.StatusCode,
  54936. },
  54937. }
  54938. target := &ret
  54939. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  54940. return nil, err
  54941. }
  54942. return ret, nil
  54943. // {
  54944. // "description": "Deletes the specified UrlMap resource.",
  54945. // "httpMethod": "DELETE",
  54946. // "id": "compute.urlMaps.delete",
  54947. // "parameterOrder": [
  54948. // "project",
  54949. // "urlMap"
  54950. // ],
  54951. // "parameters": {
  54952. // "project": {
  54953. // "description": "Project ID for this request.",
  54954. // "location": "path",
  54955. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54956. // "required": true,
  54957. // "type": "string"
  54958. // },
  54959. // "urlMap": {
  54960. // "description": "Name of the UrlMap resource to delete.",
  54961. // "location": "path",
  54962. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  54963. // "required": true,
  54964. // "type": "string"
  54965. // }
  54966. // },
  54967. // "path": "{project}/global/urlMaps/{urlMap}",
  54968. // "response": {
  54969. // "$ref": "Operation"
  54970. // },
  54971. // "scopes": [
  54972. // "https://www.googleapis.com/auth/cloud-platform",
  54973. // "https://www.googleapis.com/auth/compute"
  54974. // ]
  54975. // }
  54976. }
  54977. // method id "compute.urlMaps.get":
  54978. type UrlMapsGetCall struct {
  54979. s *Service
  54980. project string
  54981. urlMap string
  54982. urlParams_ gensupport.URLParams
  54983. ifNoneMatch_ string
  54984. ctx_ context.Context
  54985. header_ http.Header
  54986. }
  54987. // Get: Returns the specified UrlMap resource. Get a list of available
  54988. // URL maps by making a list() request.
  54989. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/get
  54990. func (r *UrlMapsService) Get(project string, urlMap string) *UrlMapsGetCall {
  54991. c := &UrlMapsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54992. c.project = project
  54993. c.urlMap = urlMap
  54994. return c
  54995. }
  54996. // Fields allows partial responses to be retrieved. See
  54997. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54998. // for more information.
  54999. func (c *UrlMapsGetCall) Fields(s ...googleapi.Field) *UrlMapsGetCall {
  55000. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55001. return c
  55002. }
  55003. // IfNoneMatch sets the optional parameter which makes the operation
  55004. // fail if the object's ETag matches the given value. This is useful for
  55005. // getting updates only after the object has changed since the last
  55006. // request. Use googleapi.IsNotModified to check whether the response
  55007. // error from Do is the result of In-None-Match.
  55008. func (c *UrlMapsGetCall) IfNoneMatch(entityTag string) *UrlMapsGetCall {
  55009. c.ifNoneMatch_ = entityTag
  55010. return c
  55011. }
  55012. // Context sets the context to be used in this call's Do method. Any
  55013. // pending HTTP request will be aborted if the provided context is
  55014. // canceled.
  55015. func (c *UrlMapsGetCall) Context(ctx context.Context) *UrlMapsGetCall {
  55016. c.ctx_ = ctx
  55017. return c
  55018. }
  55019. // Header returns an http.Header that can be modified by the caller to
  55020. // add HTTP headers to the request.
  55021. func (c *UrlMapsGetCall) Header() http.Header {
  55022. if c.header_ == nil {
  55023. c.header_ = make(http.Header)
  55024. }
  55025. return c.header_
  55026. }
  55027. func (c *UrlMapsGetCall) doRequest(alt string) (*http.Response, error) {
  55028. reqHeaders := make(http.Header)
  55029. for k, v := range c.header_ {
  55030. reqHeaders[k] = v
  55031. }
  55032. reqHeaders.Set("User-Agent", c.s.userAgent())
  55033. if c.ifNoneMatch_ != "" {
  55034. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  55035. }
  55036. var body io.Reader = nil
  55037. c.urlParams_.Set("alt", alt)
  55038. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  55039. urls += "?" + c.urlParams_.Encode()
  55040. req, _ := http.NewRequest("GET", urls, body)
  55041. req.Header = reqHeaders
  55042. googleapi.Expand(req.URL, map[string]string{
  55043. "project": c.project,
  55044. "urlMap": c.urlMap,
  55045. })
  55046. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55047. }
  55048. // Do executes the "compute.urlMaps.get" call.
  55049. // Exactly one of *UrlMap or error will be non-nil. Any non-2xx status
  55050. // code is an error. Response headers are in either
  55051. // *UrlMap.ServerResponse.Header or (if a response was returned at all)
  55052. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  55053. // check whether the returned error was because http.StatusNotModified
  55054. // was returned.
  55055. func (c *UrlMapsGetCall) Do(opts ...googleapi.CallOption) (*UrlMap, error) {
  55056. gensupport.SetOptions(c.urlParams_, opts...)
  55057. res, err := c.doRequest("json")
  55058. if res != nil && res.StatusCode == http.StatusNotModified {
  55059. if res.Body != nil {
  55060. res.Body.Close()
  55061. }
  55062. return nil, &googleapi.Error{
  55063. Code: res.StatusCode,
  55064. Header: res.Header,
  55065. }
  55066. }
  55067. if err != nil {
  55068. return nil, err
  55069. }
  55070. defer googleapi.CloseBody(res)
  55071. if err := googleapi.CheckResponse(res); err != nil {
  55072. return nil, err
  55073. }
  55074. ret := &UrlMap{
  55075. ServerResponse: googleapi.ServerResponse{
  55076. Header: res.Header,
  55077. HTTPStatusCode: res.StatusCode,
  55078. },
  55079. }
  55080. target := &ret
  55081. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  55082. return nil, err
  55083. }
  55084. return ret, nil
  55085. // {
  55086. // "description": "Returns the specified UrlMap resource. Get a list of available URL maps by making a list() request.",
  55087. // "httpMethod": "GET",
  55088. // "id": "compute.urlMaps.get",
  55089. // "parameterOrder": [
  55090. // "project",
  55091. // "urlMap"
  55092. // ],
  55093. // "parameters": {
  55094. // "project": {
  55095. // "description": "Project ID for this request.",
  55096. // "location": "path",
  55097. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55098. // "required": true,
  55099. // "type": "string"
  55100. // },
  55101. // "urlMap": {
  55102. // "description": "Name of the UrlMap resource to return.",
  55103. // "location": "path",
  55104. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  55105. // "required": true,
  55106. // "type": "string"
  55107. // }
  55108. // },
  55109. // "path": "{project}/global/urlMaps/{urlMap}",
  55110. // "response": {
  55111. // "$ref": "UrlMap"
  55112. // },
  55113. // "scopes": [
  55114. // "https://www.googleapis.com/auth/cloud-platform",
  55115. // "https://www.googleapis.com/auth/compute",
  55116. // "https://www.googleapis.com/auth/compute.readonly"
  55117. // ]
  55118. // }
  55119. }
  55120. // method id "compute.urlMaps.insert":
  55121. type UrlMapsInsertCall struct {
  55122. s *Service
  55123. project string
  55124. urlmap *UrlMap
  55125. urlParams_ gensupport.URLParams
  55126. ctx_ context.Context
  55127. header_ http.Header
  55128. }
  55129. // Insert: Creates a UrlMap resource in the specified project using the
  55130. // data included in the request.
  55131. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/insert
  55132. func (r *UrlMapsService) Insert(project string, urlmap *UrlMap) *UrlMapsInsertCall {
  55133. c := &UrlMapsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55134. c.project = project
  55135. c.urlmap = urlmap
  55136. return c
  55137. }
  55138. // Fields allows partial responses to be retrieved. See
  55139. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55140. // for more information.
  55141. func (c *UrlMapsInsertCall) Fields(s ...googleapi.Field) *UrlMapsInsertCall {
  55142. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55143. return c
  55144. }
  55145. // Context sets the context to be used in this call's Do method. Any
  55146. // pending HTTP request will be aborted if the provided context is
  55147. // canceled.
  55148. func (c *UrlMapsInsertCall) Context(ctx context.Context) *UrlMapsInsertCall {
  55149. c.ctx_ = ctx
  55150. return c
  55151. }
  55152. // Header returns an http.Header that can be modified by the caller to
  55153. // add HTTP headers to the request.
  55154. func (c *UrlMapsInsertCall) Header() http.Header {
  55155. if c.header_ == nil {
  55156. c.header_ = make(http.Header)
  55157. }
  55158. return c.header_
  55159. }
  55160. func (c *UrlMapsInsertCall) doRequest(alt string) (*http.Response, error) {
  55161. reqHeaders := make(http.Header)
  55162. for k, v := range c.header_ {
  55163. reqHeaders[k] = v
  55164. }
  55165. reqHeaders.Set("User-Agent", c.s.userAgent())
  55166. var body io.Reader = nil
  55167. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  55168. if err != nil {
  55169. return nil, err
  55170. }
  55171. reqHeaders.Set("Content-Type", "application/json")
  55172. c.urlParams_.Set("alt", alt)
  55173. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps")
  55174. urls += "?" + c.urlParams_.Encode()
  55175. req, _ := http.NewRequest("POST", urls, body)
  55176. req.Header = reqHeaders
  55177. googleapi.Expand(req.URL, map[string]string{
  55178. "project": c.project,
  55179. })
  55180. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55181. }
  55182. // Do executes the "compute.urlMaps.insert" call.
  55183. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  55184. // status code is an error. Response headers are in either
  55185. // *Operation.ServerResponse.Header or (if a response was returned at
  55186. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  55187. // to check whether the returned error was because
  55188. // http.StatusNotModified was returned.
  55189. func (c *UrlMapsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  55190. gensupport.SetOptions(c.urlParams_, opts...)
  55191. res, err := c.doRequest("json")
  55192. if res != nil && res.StatusCode == http.StatusNotModified {
  55193. if res.Body != nil {
  55194. res.Body.Close()
  55195. }
  55196. return nil, &googleapi.Error{
  55197. Code: res.StatusCode,
  55198. Header: res.Header,
  55199. }
  55200. }
  55201. if err != nil {
  55202. return nil, err
  55203. }
  55204. defer googleapi.CloseBody(res)
  55205. if err := googleapi.CheckResponse(res); err != nil {
  55206. return nil, err
  55207. }
  55208. ret := &Operation{
  55209. ServerResponse: googleapi.ServerResponse{
  55210. Header: res.Header,
  55211. HTTPStatusCode: res.StatusCode,
  55212. },
  55213. }
  55214. target := &ret
  55215. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  55216. return nil, err
  55217. }
  55218. return ret, nil
  55219. // {
  55220. // "description": "Creates a UrlMap resource in the specified project using the data included in the request.",
  55221. // "httpMethod": "POST",
  55222. // "id": "compute.urlMaps.insert",
  55223. // "parameterOrder": [
  55224. // "project"
  55225. // ],
  55226. // "parameters": {
  55227. // "project": {
  55228. // "description": "Project ID for this request.",
  55229. // "location": "path",
  55230. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55231. // "required": true,
  55232. // "type": "string"
  55233. // }
  55234. // },
  55235. // "path": "{project}/global/urlMaps",
  55236. // "request": {
  55237. // "$ref": "UrlMap"
  55238. // },
  55239. // "response": {
  55240. // "$ref": "Operation"
  55241. // },
  55242. // "scopes": [
  55243. // "https://www.googleapis.com/auth/cloud-platform",
  55244. // "https://www.googleapis.com/auth/compute"
  55245. // ]
  55246. // }
  55247. }
  55248. // method id "compute.urlMaps.invalidateCache":
  55249. type UrlMapsInvalidateCacheCall struct {
  55250. s *Service
  55251. project string
  55252. urlMap string
  55253. cacheinvalidationrule *CacheInvalidationRule
  55254. urlParams_ gensupport.URLParams
  55255. ctx_ context.Context
  55256. header_ http.Header
  55257. }
  55258. // InvalidateCache: Initiates a cache invalidation operation,
  55259. // invalidating the specified path, scoped to the specified UrlMap.
  55260. func (r *UrlMapsService) InvalidateCache(project string, urlMap string, cacheinvalidationrule *CacheInvalidationRule) *UrlMapsInvalidateCacheCall {
  55261. c := &UrlMapsInvalidateCacheCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55262. c.project = project
  55263. c.urlMap = urlMap
  55264. c.cacheinvalidationrule = cacheinvalidationrule
  55265. return c
  55266. }
  55267. // Fields allows partial responses to be retrieved. See
  55268. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55269. // for more information.
  55270. func (c *UrlMapsInvalidateCacheCall) Fields(s ...googleapi.Field) *UrlMapsInvalidateCacheCall {
  55271. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55272. return c
  55273. }
  55274. // Context sets the context to be used in this call's Do method. Any
  55275. // pending HTTP request will be aborted if the provided context is
  55276. // canceled.
  55277. func (c *UrlMapsInvalidateCacheCall) Context(ctx context.Context) *UrlMapsInvalidateCacheCall {
  55278. c.ctx_ = ctx
  55279. return c
  55280. }
  55281. // Header returns an http.Header that can be modified by the caller to
  55282. // add HTTP headers to the request.
  55283. func (c *UrlMapsInvalidateCacheCall) Header() http.Header {
  55284. if c.header_ == nil {
  55285. c.header_ = make(http.Header)
  55286. }
  55287. return c.header_
  55288. }
  55289. func (c *UrlMapsInvalidateCacheCall) doRequest(alt string) (*http.Response, error) {
  55290. reqHeaders := make(http.Header)
  55291. for k, v := range c.header_ {
  55292. reqHeaders[k] = v
  55293. }
  55294. reqHeaders.Set("User-Agent", c.s.userAgent())
  55295. var body io.Reader = nil
  55296. body, err := googleapi.WithoutDataWrapper.JSONReader(c.cacheinvalidationrule)
  55297. if err != nil {
  55298. return nil, err
  55299. }
  55300. reqHeaders.Set("Content-Type", "application/json")
  55301. c.urlParams_.Set("alt", alt)
  55302. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}/invalidateCache")
  55303. urls += "?" + c.urlParams_.Encode()
  55304. req, _ := http.NewRequest("POST", urls, body)
  55305. req.Header = reqHeaders
  55306. googleapi.Expand(req.URL, map[string]string{
  55307. "project": c.project,
  55308. "urlMap": c.urlMap,
  55309. })
  55310. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55311. }
  55312. // Do executes the "compute.urlMaps.invalidateCache" call.
  55313. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  55314. // status code is an error. Response headers are in either
  55315. // *Operation.ServerResponse.Header or (if a response was returned at
  55316. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  55317. // to check whether the returned error was because
  55318. // http.StatusNotModified was returned.
  55319. func (c *UrlMapsInvalidateCacheCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  55320. gensupport.SetOptions(c.urlParams_, opts...)
  55321. res, err := c.doRequest("json")
  55322. if res != nil && res.StatusCode == http.StatusNotModified {
  55323. if res.Body != nil {
  55324. res.Body.Close()
  55325. }
  55326. return nil, &googleapi.Error{
  55327. Code: res.StatusCode,
  55328. Header: res.Header,
  55329. }
  55330. }
  55331. if err != nil {
  55332. return nil, err
  55333. }
  55334. defer googleapi.CloseBody(res)
  55335. if err := googleapi.CheckResponse(res); err != nil {
  55336. return nil, err
  55337. }
  55338. ret := &Operation{
  55339. ServerResponse: googleapi.ServerResponse{
  55340. Header: res.Header,
  55341. HTTPStatusCode: res.StatusCode,
  55342. },
  55343. }
  55344. target := &ret
  55345. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  55346. return nil, err
  55347. }
  55348. return ret, nil
  55349. // {
  55350. // "description": "Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap.",
  55351. // "httpMethod": "POST",
  55352. // "id": "compute.urlMaps.invalidateCache",
  55353. // "parameterOrder": [
  55354. // "project",
  55355. // "urlMap"
  55356. // ],
  55357. // "parameters": {
  55358. // "project": {
  55359. // "description": "Project ID for this request.",
  55360. // "location": "path",
  55361. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55362. // "required": true,
  55363. // "type": "string"
  55364. // },
  55365. // "urlMap": {
  55366. // "description": "Name of the UrlMap scoping this request.",
  55367. // "location": "path",
  55368. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  55369. // "required": true,
  55370. // "type": "string"
  55371. // }
  55372. // },
  55373. // "path": "{project}/global/urlMaps/{urlMap}/invalidateCache",
  55374. // "request": {
  55375. // "$ref": "CacheInvalidationRule"
  55376. // },
  55377. // "response": {
  55378. // "$ref": "Operation"
  55379. // },
  55380. // "scopes": [
  55381. // "https://www.googleapis.com/auth/cloud-platform",
  55382. // "https://www.googleapis.com/auth/compute"
  55383. // ]
  55384. // }
  55385. }
  55386. // method id "compute.urlMaps.list":
  55387. type UrlMapsListCall struct {
  55388. s *Service
  55389. project string
  55390. urlParams_ gensupport.URLParams
  55391. ifNoneMatch_ string
  55392. ctx_ context.Context
  55393. header_ http.Header
  55394. }
  55395. // List: Retrieves the list of UrlMap resources available to the
  55396. // specified project.
  55397. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/list
  55398. func (r *UrlMapsService) List(project string) *UrlMapsListCall {
  55399. c := &UrlMapsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55400. c.project = project
  55401. return c
  55402. }
  55403. // Filter sets the optional parameter "filter": Sets a filter
  55404. // {expression} for filtering listed resources. Your {expression} must
  55405. // be in the format: field_name comparison_string literal_string.
  55406. //
  55407. // The field_name is the name of the field you want to compare. Only
  55408. // atomic field types are supported (string, number, boolean). The
  55409. // comparison_string must be either eq (equals) or ne (not equals). The
  55410. // literal_string is the string value to filter to. The literal value
  55411. // must be valid for the type of field you are filtering by (string,
  55412. // number, boolean). For string fields, the literal value is interpreted
  55413. // as a regular expression using RE2 syntax. The literal value must
  55414. // match the entire field.
  55415. //
  55416. // For example, to filter for instances that do not have a name of
  55417. // example-instance, you would use name ne example-instance.
  55418. //
  55419. // You can filter on nested fields. For example, you could filter on
  55420. // instances that have set the scheduling.automaticRestart field to
  55421. // true. Use filtering on nested fields to take advantage of labels to
  55422. // organize and search for results based on label values.
  55423. //
  55424. // To filter on multiple expressions, provide each separate expression
  55425. // within parentheses. For example, (scheduling.automaticRestart eq
  55426. // true) (zone eq us-central1-f). Multiple expressions are treated as
  55427. // AND expressions, meaning that resources must match all expressions to
  55428. // pass the filters.
  55429. func (c *UrlMapsListCall) Filter(filter string) *UrlMapsListCall {
  55430. c.urlParams_.Set("filter", filter)
  55431. return c
  55432. }
  55433. // MaxResults sets the optional parameter "maxResults": The maximum
  55434. // number of results per page that should be returned. If the number of
  55435. // available results is larger than maxResults, Compute Engine returns a
  55436. // nextPageToken that can be used to get the next page of results in
  55437. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  55438. // (Default: 500)
  55439. func (c *UrlMapsListCall) MaxResults(maxResults int64) *UrlMapsListCall {
  55440. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  55441. return c
  55442. }
  55443. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  55444. // a certain order. By default, results are returned in alphanumerical
  55445. // order based on the resource name.
  55446. //
  55447. // You can also sort results in descending order based on the creation
  55448. // timestamp using orderBy="creationTimestamp desc". This sorts results
  55449. // based on the creationTimestamp field in reverse chronological order
  55450. // (newest result first). Use this to sort resources like operations so
  55451. // that the newest operation is returned first.
  55452. //
  55453. // Currently, only sorting by name or creationTimestamp desc is
  55454. // supported.
  55455. func (c *UrlMapsListCall) OrderBy(orderBy string) *UrlMapsListCall {
  55456. c.urlParams_.Set("orderBy", orderBy)
  55457. return c
  55458. }
  55459. // PageToken sets the optional parameter "pageToken": Specifies a page
  55460. // token to use. Set pageToken to the nextPageToken returned by a
  55461. // previous list request to get the next page of results.
  55462. func (c *UrlMapsListCall) PageToken(pageToken string) *UrlMapsListCall {
  55463. c.urlParams_.Set("pageToken", pageToken)
  55464. return c
  55465. }
  55466. // Fields allows partial responses to be retrieved. See
  55467. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55468. // for more information.
  55469. func (c *UrlMapsListCall) Fields(s ...googleapi.Field) *UrlMapsListCall {
  55470. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55471. return c
  55472. }
  55473. // IfNoneMatch sets the optional parameter which makes the operation
  55474. // fail if the object's ETag matches the given value. This is useful for
  55475. // getting updates only after the object has changed since the last
  55476. // request. Use googleapi.IsNotModified to check whether the response
  55477. // error from Do is the result of In-None-Match.
  55478. func (c *UrlMapsListCall) IfNoneMatch(entityTag string) *UrlMapsListCall {
  55479. c.ifNoneMatch_ = entityTag
  55480. return c
  55481. }
  55482. // Context sets the context to be used in this call's Do method. Any
  55483. // pending HTTP request will be aborted if the provided context is
  55484. // canceled.
  55485. func (c *UrlMapsListCall) Context(ctx context.Context) *UrlMapsListCall {
  55486. c.ctx_ = ctx
  55487. return c
  55488. }
  55489. // Header returns an http.Header that can be modified by the caller to
  55490. // add HTTP headers to the request.
  55491. func (c *UrlMapsListCall) Header() http.Header {
  55492. if c.header_ == nil {
  55493. c.header_ = make(http.Header)
  55494. }
  55495. return c.header_
  55496. }
  55497. func (c *UrlMapsListCall) doRequest(alt string) (*http.Response, error) {
  55498. reqHeaders := make(http.Header)
  55499. for k, v := range c.header_ {
  55500. reqHeaders[k] = v
  55501. }
  55502. reqHeaders.Set("User-Agent", c.s.userAgent())
  55503. if c.ifNoneMatch_ != "" {
  55504. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  55505. }
  55506. var body io.Reader = nil
  55507. c.urlParams_.Set("alt", alt)
  55508. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps")
  55509. urls += "?" + c.urlParams_.Encode()
  55510. req, _ := http.NewRequest("GET", urls, body)
  55511. req.Header = reqHeaders
  55512. googleapi.Expand(req.URL, map[string]string{
  55513. "project": c.project,
  55514. })
  55515. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55516. }
  55517. // Do executes the "compute.urlMaps.list" call.
  55518. // Exactly one of *UrlMapList or error will be non-nil. Any non-2xx
  55519. // status code is an error. Response headers are in either
  55520. // *UrlMapList.ServerResponse.Header or (if a response was returned at
  55521. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  55522. // to check whether the returned error was because
  55523. // http.StatusNotModified was returned.
  55524. func (c *UrlMapsListCall) Do(opts ...googleapi.CallOption) (*UrlMapList, error) {
  55525. gensupport.SetOptions(c.urlParams_, opts...)
  55526. res, err := c.doRequest("json")
  55527. if res != nil && res.StatusCode == http.StatusNotModified {
  55528. if res.Body != nil {
  55529. res.Body.Close()
  55530. }
  55531. return nil, &googleapi.Error{
  55532. Code: res.StatusCode,
  55533. Header: res.Header,
  55534. }
  55535. }
  55536. if err != nil {
  55537. return nil, err
  55538. }
  55539. defer googleapi.CloseBody(res)
  55540. if err := googleapi.CheckResponse(res); err != nil {
  55541. return nil, err
  55542. }
  55543. ret := &UrlMapList{
  55544. ServerResponse: googleapi.ServerResponse{
  55545. Header: res.Header,
  55546. HTTPStatusCode: res.StatusCode,
  55547. },
  55548. }
  55549. target := &ret
  55550. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  55551. return nil, err
  55552. }
  55553. return ret, nil
  55554. // {
  55555. // "description": "Retrieves the list of UrlMap resources available to the specified project.",
  55556. // "httpMethod": "GET",
  55557. // "id": "compute.urlMaps.list",
  55558. // "parameterOrder": [
  55559. // "project"
  55560. // ],
  55561. // "parameters": {
  55562. // "filter": {
  55563. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  55564. // "location": "query",
  55565. // "type": "string"
  55566. // },
  55567. // "maxResults": {
  55568. // "default": "500",
  55569. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  55570. // "format": "uint32",
  55571. // "location": "query",
  55572. // "minimum": "0",
  55573. // "type": "integer"
  55574. // },
  55575. // "orderBy": {
  55576. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  55577. // "location": "query",
  55578. // "type": "string"
  55579. // },
  55580. // "pageToken": {
  55581. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  55582. // "location": "query",
  55583. // "type": "string"
  55584. // },
  55585. // "project": {
  55586. // "description": "Project ID for this request.",
  55587. // "location": "path",
  55588. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55589. // "required": true,
  55590. // "type": "string"
  55591. // }
  55592. // },
  55593. // "path": "{project}/global/urlMaps",
  55594. // "response": {
  55595. // "$ref": "UrlMapList"
  55596. // },
  55597. // "scopes": [
  55598. // "https://www.googleapis.com/auth/cloud-platform",
  55599. // "https://www.googleapis.com/auth/compute",
  55600. // "https://www.googleapis.com/auth/compute.readonly"
  55601. // ]
  55602. // }
  55603. }
  55604. // Pages invokes f for each page of results.
  55605. // A non-nil error returned from f will halt the iteration.
  55606. // The provided context supersedes any context provided to the Context method.
  55607. func (c *UrlMapsListCall) Pages(ctx context.Context, f func(*UrlMapList) error) error {
  55608. c.ctx_ = ctx
  55609. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  55610. for {
  55611. x, err := c.Do()
  55612. if err != nil {
  55613. return err
  55614. }
  55615. if err := f(x); err != nil {
  55616. return err
  55617. }
  55618. if x.NextPageToken == "" {
  55619. return nil
  55620. }
  55621. c.PageToken(x.NextPageToken)
  55622. }
  55623. }
  55624. // method id "compute.urlMaps.patch":
  55625. type UrlMapsPatchCall struct {
  55626. s *Service
  55627. project string
  55628. urlMap string
  55629. urlmap *UrlMap
  55630. urlParams_ gensupport.URLParams
  55631. ctx_ context.Context
  55632. header_ http.Header
  55633. }
  55634. // Patch: Patches the specified UrlMap resource with the data included
  55635. // in the request. This method supports patch semantics.
  55636. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/patch
  55637. func (r *UrlMapsService) Patch(project string, urlMap string, urlmap *UrlMap) *UrlMapsPatchCall {
  55638. c := &UrlMapsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55639. c.project = project
  55640. c.urlMap = urlMap
  55641. c.urlmap = urlmap
  55642. return c
  55643. }
  55644. // Fields allows partial responses to be retrieved. See
  55645. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55646. // for more information.
  55647. func (c *UrlMapsPatchCall) Fields(s ...googleapi.Field) *UrlMapsPatchCall {
  55648. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55649. return c
  55650. }
  55651. // Context sets the context to be used in this call's Do method. Any
  55652. // pending HTTP request will be aborted if the provided context is
  55653. // canceled.
  55654. func (c *UrlMapsPatchCall) Context(ctx context.Context) *UrlMapsPatchCall {
  55655. c.ctx_ = ctx
  55656. return c
  55657. }
  55658. // Header returns an http.Header that can be modified by the caller to
  55659. // add HTTP headers to the request.
  55660. func (c *UrlMapsPatchCall) Header() http.Header {
  55661. if c.header_ == nil {
  55662. c.header_ = make(http.Header)
  55663. }
  55664. return c.header_
  55665. }
  55666. func (c *UrlMapsPatchCall) doRequest(alt string) (*http.Response, error) {
  55667. reqHeaders := make(http.Header)
  55668. for k, v := range c.header_ {
  55669. reqHeaders[k] = v
  55670. }
  55671. reqHeaders.Set("User-Agent", c.s.userAgent())
  55672. var body io.Reader = nil
  55673. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  55674. if err != nil {
  55675. return nil, err
  55676. }
  55677. reqHeaders.Set("Content-Type", "application/json")
  55678. c.urlParams_.Set("alt", alt)
  55679. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  55680. urls += "?" + c.urlParams_.Encode()
  55681. req, _ := http.NewRequest("PATCH", urls, body)
  55682. req.Header = reqHeaders
  55683. googleapi.Expand(req.URL, map[string]string{
  55684. "project": c.project,
  55685. "urlMap": c.urlMap,
  55686. })
  55687. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55688. }
  55689. // Do executes the "compute.urlMaps.patch" call.
  55690. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  55691. // status code is an error. Response headers are in either
  55692. // *Operation.ServerResponse.Header or (if a response was returned at
  55693. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  55694. // to check whether the returned error was because
  55695. // http.StatusNotModified was returned.
  55696. func (c *UrlMapsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  55697. gensupport.SetOptions(c.urlParams_, opts...)
  55698. res, err := c.doRequest("json")
  55699. if res != nil && res.StatusCode == http.StatusNotModified {
  55700. if res.Body != nil {
  55701. res.Body.Close()
  55702. }
  55703. return nil, &googleapi.Error{
  55704. Code: res.StatusCode,
  55705. Header: res.Header,
  55706. }
  55707. }
  55708. if err != nil {
  55709. return nil, err
  55710. }
  55711. defer googleapi.CloseBody(res)
  55712. if err := googleapi.CheckResponse(res); err != nil {
  55713. return nil, err
  55714. }
  55715. ret := &Operation{
  55716. ServerResponse: googleapi.ServerResponse{
  55717. Header: res.Header,
  55718. HTTPStatusCode: res.StatusCode,
  55719. },
  55720. }
  55721. target := &ret
  55722. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  55723. return nil, err
  55724. }
  55725. return ret, nil
  55726. // {
  55727. // "description": "Patches the specified UrlMap resource with the data included in the request. This method supports patch semantics.",
  55728. // "httpMethod": "PATCH",
  55729. // "id": "compute.urlMaps.patch",
  55730. // "parameterOrder": [
  55731. // "project",
  55732. // "urlMap"
  55733. // ],
  55734. // "parameters": {
  55735. // "project": {
  55736. // "description": "Project ID for this request.",
  55737. // "location": "path",
  55738. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55739. // "required": true,
  55740. // "type": "string"
  55741. // },
  55742. // "urlMap": {
  55743. // "description": "Name of the UrlMap resource to patch.",
  55744. // "location": "path",
  55745. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  55746. // "required": true,
  55747. // "type": "string"
  55748. // }
  55749. // },
  55750. // "path": "{project}/global/urlMaps/{urlMap}",
  55751. // "request": {
  55752. // "$ref": "UrlMap"
  55753. // },
  55754. // "response": {
  55755. // "$ref": "Operation"
  55756. // },
  55757. // "scopes": [
  55758. // "https://www.googleapis.com/auth/cloud-platform",
  55759. // "https://www.googleapis.com/auth/compute",
  55760. // "https://www.googleapis.com/auth/compute.readonly"
  55761. // ]
  55762. // }
  55763. }
  55764. // method id "compute.urlMaps.update":
  55765. type UrlMapsUpdateCall struct {
  55766. s *Service
  55767. project string
  55768. urlMap string
  55769. urlmap *UrlMap
  55770. urlParams_ gensupport.URLParams
  55771. ctx_ context.Context
  55772. header_ http.Header
  55773. }
  55774. // Update: Updates the specified UrlMap resource with the data included
  55775. // in the request.
  55776. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/update
  55777. func (r *UrlMapsService) Update(project string, urlMap string, urlmap *UrlMap) *UrlMapsUpdateCall {
  55778. c := &UrlMapsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55779. c.project = project
  55780. c.urlMap = urlMap
  55781. c.urlmap = urlmap
  55782. return c
  55783. }
  55784. // Fields allows partial responses to be retrieved. See
  55785. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55786. // for more information.
  55787. func (c *UrlMapsUpdateCall) Fields(s ...googleapi.Field) *UrlMapsUpdateCall {
  55788. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55789. return c
  55790. }
  55791. // Context sets the context to be used in this call's Do method. Any
  55792. // pending HTTP request will be aborted if the provided context is
  55793. // canceled.
  55794. func (c *UrlMapsUpdateCall) Context(ctx context.Context) *UrlMapsUpdateCall {
  55795. c.ctx_ = ctx
  55796. return c
  55797. }
  55798. // Header returns an http.Header that can be modified by the caller to
  55799. // add HTTP headers to the request.
  55800. func (c *UrlMapsUpdateCall) Header() http.Header {
  55801. if c.header_ == nil {
  55802. c.header_ = make(http.Header)
  55803. }
  55804. return c.header_
  55805. }
  55806. func (c *UrlMapsUpdateCall) doRequest(alt string) (*http.Response, error) {
  55807. reqHeaders := make(http.Header)
  55808. for k, v := range c.header_ {
  55809. reqHeaders[k] = v
  55810. }
  55811. reqHeaders.Set("User-Agent", c.s.userAgent())
  55812. var body io.Reader = nil
  55813. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  55814. if err != nil {
  55815. return nil, err
  55816. }
  55817. reqHeaders.Set("Content-Type", "application/json")
  55818. c.urlParams_.Set("alt", alt)
  55819. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  55820. urls += "?" + c.urlParams_.Encode()
  55821. req, _ := http.NewRequest("PUT", urls, body)
  55822. req.Header = reqHeaders
  55823. googleapi.Expand(req.URL, map[string]string{
  55824. "project": c.project,
  55825. "urlMap": c.urlMap,
  55826. })
  55827. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55828. }
  55829. // Do executes the "compute.urlMaps.update" call.
  55830. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  55831. // status code is an error. Response headers are in either
  55832. // *Operation.ServerResponse.Header or (if a response was returned at
  55833. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  55834. // to check whether the returned error was because
  55835. // http.StatusNotModified was returned.
  55836. func (c *UrlMapsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  55837. gensupport.SetOptions(c.urlParams_, opts...)
  55838. res, err := c.doRequest("json")
  55839. if res != nil && res.StatusCode == http.StatusNotModified {
  55840. if res.Body != nil {
  55841. res.Body.Close()
  55842. }
  55843. return nil, &googleapi.Error{
  55844. Code: res.StatusCode,
  55845. Header: res.Header,
  55846. }
  55847. }
  55848. if err != nil {
  55849. return nil, err
  55850. }
  55851. defer googleapi.CloseBody(res)
  55852. if err := googleapi.CheckResponse(res); err != nil {
  55853. return nil, err
  55854. }
  55855. ret := &Operation{
  55856. ServerResponse: googleapi.ServerResponse{
  55857. Header: res.Header,
  55858. HTTPStatusCode: res.StatusCode,
  55859. },
  55860. }
  55861. target := &ret
  55862. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  55863. return nil, err
  55864. }
  55865. return ret, nil
  55866. // {
  55867. // "description": "Updates the specified UrlMap resource with the data included in the request.",
  55868. // "httpMethod": "PUT",
  55869. // "id": "compute.urlMaps.update",
  55870. // "parameterOrder": [
  55871. // "project",
  55872. // "urlMap"
  55873. // ],
  55874. // "parameters": {
  55875. // "project": {
  55876. // "description": "Project ID for this request.",
  55877. // "location": "path",
  55878. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55879. // "required": true,
  55880. // "type": "string"
  55881. // },
  55882. // "urlMap": {
  55883. // "description": "Name of the UrlMap resource to update.",
  55884. // "location": "path",
  55885. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  55886. // "required": true,
  55887. // "type": "string"
  55888. // }
  55889. // },
  55890. // "path": "{project}/global/urlMaps/{urlMap}",
  55891. // "request": {
  55892. // "$ref": "UrlMap"
  55893. // },
  55894. // "response": {
  55895. // "$ref": "Operation"
  55896. // },
  55897. // "scopes": [
  55898. // "https://www.googleapis.com/auth/cloud-platform",
  55899. // "https://www.googleapis.com/auth/compute"
  55900. // ]
  55901. // }
  55902. }
  55903. // method id "compute.urlMaps.validate":
  55904. type UrlMapsValidateCall struct {
  55905. s *Service
  55906. project string
  55907. urlMap string
  55908. urlmapsvalidaterequest *UrlMapsValidateRequest
  55909. urlParams_ gensupport.URLParams
  55910. ctx_ context.Context
  55911. header_ http.Header
  55912. }
  55913. // Validate: Runs static validation for the UrlMap. In particular, the
  55914. // tests of the provided UrlMap will be run. Calling this method does
  55915. // NOT create the UrlMap.
  55916. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/validate
  55917. func (r *UrlMapsService) Validate(project string, urlMap string, urlmapsvalidaterequest *UrlMapsValidateRequest) *UrlMapsValidateCall {
  55918. c := &UrlMapsValidateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55919. c.project = project
  55920. c.urlMap = urlMap
  55921. c.urlmapsvalidaterequest = urlmapsvalidaterequest
  55922. return c
  55923. }
  55924. // Fields allows partial responses to be retrieved. See
  55925. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55926. // for more information.
  55927. func (c *UrlMapsValidateCall) Fields(s ...googleapi.Field) *UrlMapsValidateCall {
  55928. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55929. return c
  55930. }
  55931. // Context sets the context to be used in this call's Do method. Any
  55932. // pending HTTP request will be aborted if the provided context is
  55933. // canceled.
  55934. func (c *UrlMapsValidateCall) Context(ctx context.Context) *UrlMapsValidateCall {
  55935. c.ctx_ = ctx
  55936. return c
  55937. }
  55938. // Header returns an http.Header that can be modified by the caller to
  55939. // add HTTP headers to the request.
  55940. func (c *UrlMapsValidateCall) Header() http.Header {
  55941. if c.header_ == nil {
  55942. c.header_ = make(http.Header)
  55943. }
  55944. return c.header_
  55945. }
  55946. func (c *UrlMapsValidateCall) doRequest(alt string) (*http.Response, error) {
  55947. reqHeaders := make(http.Header)
  55948. for k, v := range c.header_ {
  55949. reqHeaders[k] = v
  55950. }
  55951. reqHeaders.Set("User-Agent", c.s.userAgent())
  55952. var body io.Reader = nil
  55953. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapsvalidaterequest)
  55954. if err != nil {
  55955. return nil, err
  55956. }
  55957. reqHeaders.Set("Content-Type", "application/json")
  55958. c.urlParams_.Set("alt", alt)
  55959. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}/validate")
  55960. urls += "?" + c.urlParams_.Encode()
  55961. req, _ := http.NewRequest("POST", urls, body)
  55962. req.Header = reqHeaders
  55963. googleapi.Expand(req.URL, map[string]string{
  55964. "project": c.project,
  55965. "urlMap": c.urlMap,
  55966. })
  55967. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55968. }
  55969. // Do executes the "compute.urlMaps.validate" call.
  55970. // Exactly one of *UrlMapsValidateResponse or error will be non-nil. Any
  55971. // non-2xx status code is an error. Response headers are in either
  55972. // *UrlMapsValidateResponse.ServerResponse.Header or (if a response was
  55973. // returned at all) in error.(*googleapi.Error).Header. Use
  55974. // googleapi.IsNotModified to check whether the returned error was
  55975. // because http.StatusNotModified was returned.
  55976. func (c *UrlMapsValidateCall) Do(opts ...googleapi.CallOption) (*UrlMapsValidateResponse, error) {
  55977. gensupport.SetOptions(c.urlParams_, opts...)
  55978. res, err := c.doRequest("json")
  55979. if res != nil && res.StatusCode == http.StatusNotModified {
  55980. if res.Body != nil {
  55981. res.Body.Close()
  55982. }
  55983. return nil, &googleapi.Error{
  55984. Code: res.StatusCode,
  55985. Header: res.Header,
  55986. }
  55987. }
  55988. if err != nil {
  55989. return nil, err
  55990. }
  55991. defer googleapi.CloseBody(res)
  55992. if err := googleapi.CheckResponse(res); err != nil {
  55993. return nil, err
  55994. }
  55995. ret := &UrlMapsValidateResponse{
  55996. ServerResponse: googleapi.ServerResponse{
  55997. Header: res.Header,
  55998. HTTPStatusCode: res.StatusCode,
  55999. },
  56000. }
  56001. target := &ret
  56002. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  56003. return nil, err
  56004. }
  56005. return ret, nil
  56006. // {
  56007. // "description": "Runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap.",
  56008. // "httpMethod": "POST",
  56009. // "id": "compute.urlMaps.validate",
  56010. // "parameterOrder": [
  56011. // "project",
  56012. // "urlMap"
  56013. // ],
  56014. // "parameters": {
  56015. // "project": {
  56016. // "description": "Project ID for this request.",
  56017. // "location": "path",
  56018. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56019. // "required": true,
  56020. // "type": "string"
  56021. // },
  56022. // "urlMap": {
  56023. // "description": "Name of the UrlMap resource to be validated as.",
  56024. // "location": "path",
  56025. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  56026. // "required": true,
  56027. // "type": "string"
  56028. // }
  56029. // },
  56030. // "path": "{project}/global/urlMaps/{urlMap}/validate",
  56031. // "request": {
  56032. // "$ref": "UrlMapsValidateRequest"
  56033. // },
  56034. // "response": {
  56035. // "$ref": "UrlMapsValidateResponse"
  56036. // },
  56037. // "scopes": [
  56038. // "https://www.googleapis.com/auth/cloud-platform",
  56039. // "https://www.googleapis.com/auth/compute"
  56040. // ]
  56041. // }
  56042. }
  56043. // method id "compute.vpnTunnels.aggregatedList":
  56044. type VpnTunnelsAggregatedListCall struct {
  56045. s *Service
  56046. project string
  56047. urlParams_ gensupport.URLParams
  56048. ifNoneMatch_ string
  56049. ctx_ context.Context
  56050. header_ http.Header
  56051. }
  56052. // AggregatedList: Retrieves an aggregated list of VPN tunnels.
  56053. func (r *VpnTunnelsService) AggregatedList(project string) *VpnTunnelsAggregatedListCall {
  56054. c := &VpnTunnelsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56055. c.project = project
  56056. return c
  56057. }
  56058. // Filter sets the optional parameter "filter": Sets a filter
  56059. // {expression} for filtering listed resources. Your {expression} must
  56060. // be in the format: field_name comparison_string literal_string.
  56061. //
  56062. // The field_name is the name of the field you want to compare. Only
  56063. // atomic field types are supported (string, number, boolean). The
  56064. // comparison_string must be either eq (equals) or ne (not equals). The
  56065. // literal_string is the string value to filter to. The literal value
  56066. // must be valid for the type of field you are filtering by (string,
  56067. // number, boolean). For string fields, the literal value is interpreted
  56068. // as a regular expression using RE2 syntax. The literal value must
  56069. // match the entire field.
  56070. //
  56071. // For example, to filter for instances that do not have a name of
  56072. // example-instance, you would use name ne example-instance.
  56073. //
  56074. // You can filter on nested fields. For example, you could filter on
  56075. // instances that have set the scheduling.automaticRestart field to
  56076. // true. Use filtering on nested fields to take advantage of labels to
  56077. // organize and search for results based on label values.
  56078. //
  56079. // To filter on multiple expressions, provide each separate expression
  56080. // within parentheses. For example, (scheduling.automaticRestart eq
  56081. // true) (zone eq us-central1-f). Multiple expressions are treated as
  56082. // AND expressions, meaning that resources must match all expressions to
  56083. // pass the filters.
  56084. func (c *VpnTunnelsAggregatedListCall) Filter(filter string) *VpnTunnelsAggregatedListCall {
  56085. c.urlParams_.Set("filter", filter)
  56086. return c
  56087. }
  56088. // MaxResults sets the optional parameter "maxResults": The maximum
  56089. // number of results per page that should be returned. If the number of
  56090. // available results is larger than maxResults, Compute Engine returns a
  56091. // nextPageToken that can be used to get the next page of results in
  56092. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  56093. // (Default: 500)
  56094. func (c *VpnTunnelsAggregatedListCall) MaxResults(maxResults int64) *VpnTunnelsAggregatedListCall {
  56095. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  56096. return c
  56097. }
  56098. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  56099. // a certain order. By default, results are returned in alphanumerical
  56100. // order based on the resource name.
  56101. //
  56102. // You can also sort results in descending order based on the creation
  56103. // timestamp using orderBy="creationTimestamp desc". This sorts results
  56104. // based on the creationTimestamp field in reverse chronological order
  56105. // (newest result first). Use this to sort resources like operations so
  56106. // that the newest operation is returned first.
  56107. //
  56108. // Currently, only sorting by name or creationTimestamp desc is
  56109. // supported.
  56110. func (c *VpnTunnelsAggregatedListCall) OrderBy(orderBy string) *VpnTunnelsAggregatedListCall {
  56111. c.urlParams_.Set("orderBy", orderBy)
  56112. return c
  56113. }
  56114. // PageToken sets the optional parameter "pageToken": Specifies a page
  56115. // token to use. Set pageToken to the nextPageToken returned by a
  56116. // previous list request to get the next page of results.
  56117. func (c *VpnTunnelsAggregatedListCall) PageToken(pageToken string) *VpnTunnelsAggregatedListCall {
  56118. c.urlParams_.Set("pageToken", pageToken)
  56119. return c
  56120. }
  56121. // Fields allows partial responses to be retrieved. See
  56122. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56123. // for more information.
  56124. func (c *VpnTunnelsAggregatedListCall) Fields(s ...googleapi.Field) *VpnTunnelsAggregatedListCall {
  56125. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56126. return c
  56127. }
  56128. // IfNoneMatch sets the optional parameter which makes the operation
  56129. // fail if the object's ETag matches the given value. This is useful for
  56130. // getting updates only after the object has changed since the last
  56131. // request. Use googleapi.IsNotModified to check whether the response
  56132. // error from Do is the result of In-None-Match.
  56133. func (c *VpnTunnelsAggregatedListCall) IfNoneMatch(entityTag string) *VpnTunnelsAggregatedListCall {
  56134. c.ifNoneMatch_ = entityTag
  56135. return c
  56136. }
  56137. // Context sets the context to be used in this call's Do method. Any
  56138. // pending HTTP request will be aborted if the provided context is
  56139. // canceled.
  56140. func (c *VpnTunnelsAggregatedListCall) Context(ctx context.Context) *VpnTunnelsAggregatedListCall {
  56141. c.ctx_ = ctx
  56142. return c
  56143. }
  56144. // Header returns an http.Header that can be modified by the caller to
  56145. // add HTTP headers to the request.
  56146. func (c *VpnTunnelsAggregatedListCall) Header() http.Header {
  56147. if c.header_ == nil {
  56148. c.header_ = make(http.Header)
  56149. }
  56150. return c.header_
  56151. }
  56152. func (c *VpnTunnelsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  56153. reqHeaders := make(http.Header)
  56154. for k, v := range c.header_ {
  56155. reqHeaders[k] = v
  56156. }
  56157. reqHeaders.Set("User-Agent", c.s.userAgent())
  56158. if c.ifNoneMatch_ != "" {
  56159. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  56160. }
  56161. var body io.Reader = nil
  56162. c.urlParams_.Set("alt", alt)
  56163. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/vpnTunnels")
  56164. urls += "?" + c.urlParams_.Encode()
  56165. req, _ := http.NewRequest("GET", urls, body)
  56166. req.Header = reqHeaders
  56167. googleapi.Expand(req.URL, map[string]string{
  56168. "project": c.project,
  56169. })
  56170. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56171. }
  56172. // Do executes the "compute.vpnTunnels.aggregatedList" call.
  56173. // Exactly one of *VpnTunnelAggregatedList or error will be non-nil. Any
  56174. // non-2xx status code is an error. Response headers are in either
  56175. // *VpnTunnelAggregatedList.ServerResponse.Header or (if a response was
  56176. // returned at all) in error.(*googleapi.Error).Header. Use
  56177. // googleapi.IsNotModified to check whether the returned error was
  56178. // because http.StatusNotModified was returned.
  56179. func (c *VpnTunnelsAggregatedListCall) Do(opts ...googleapi.CallOption) (*VpnTunnelAggregatedList, error) {
  56180. gensupport.SetOptions(c.urlParams_, opts...)
  56181. res, err := c.doRequest("json")
  56182. if res != nil && res.StatusCode == http.StatusNotModified {
  56183. if res.Body != nil {
  56184. res.Body.Close()
  56185. }
  56186. return nil, &googleapi.Error{
  56187. Code: res.StatusCode,
  56188. Header: res.Header,
  56189. }
  56190. }
  56191. if err != nil {
  56192. return nil, err
  56193. }
  56194. defer googleapi.CloseBody(res)
  56195. if err := googleapi.CheckResponse(res); err != nil {
  56196. return nil, err
  56197. }
  56198. ret := &VpnTunnelAggregatedList{
  56199. ServerResponse: googleapi.ServerResponse{
  56200. Header: res.Header,
  56201. HTTPStatusCode: res.StatusCode,
  56202. },
  56203. }
  56204. target := &ret
  56205. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  56206. return nil, err
  56207. }
  56208. return ret, nil
  56209. // {
  56210. // "description": "Retrieves an aggregated list of VPN tunnels.",
  56211. // "httpMethod": "GET",
  56212. // "id": "compute.vpnTunnels.aggregatedList",
  56213. // "parameterOrder": [
  56214. // "project"
  56215. // ],
  56216. // "parameters": {
  56217. // "filter": {
  56218. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  56219. // "location": "query",
  56220. // "type": "string"
  56221. // },
  56222. // "maxResults": {
  56223. // "default": "500",
  56224. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  56225. // "format": "uint32",
  56226. // "location": "query",
  56227. // "minimum": "0",
  56228. // "type": "integer"
  56229. // },
  56230. // "orderBy": {
  56231. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  56232. // "location": "query",
  56233. // "type": "string"
  56234. // },
  56235. // "pageToken": {
  56236. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  56237. // "location": "query",
  56238. // "type": "string"
  56239. // },
  56240. // "project": {
  56241. // "description": "Project ID for this request.",
  56242. // "location": "path",
  56243. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56244. // "required": true,
  56245. // "type": "string"
  56246. // }
  56247. // },
  56248. // "path": "{project}/aggregated/vpnTunnels",
  56249. // "response": {
  56250. // "$ref": "VpnTunnelAggregatedList"
  56251. // },
  56252. // "scopes": [
  56253. // "https://www.googleapis.com/auth/cloud-platform",
  56254. // "https://www.googleapis.com/auth/compute",
  56255. // "https://www.googleapis.com/auth/compute.readonly"
  56256. // ]
  56257. // }
  56258. }
  56259. // Pages invokes f for each page of results.
  56260. // A non-nil error returned from f will halt the iteration.
  56261. // The provided context supersedes any context provided to the Context method.
  56262. func (c *VpnTunnelsAggregatedListCall) Pages(ctx context.Context, f func(*VpnTunnelAggregatedList) error) error {
  56263. c.ctx_ = ctx
  56264. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  56265. for {
  56266. x, err := c.Do()
  56267. if err != nil {
  56268. return err
  56269. }
  56270. if err := f(x); err != nil {
  56271. return err
  56272. }
  56273. if x.NextPageToken == "" {
  56274. return nil
  56275. }
  56276. c.PageToken(x.NextPageToken)
  56277. }
  56278. }
  56279. // method id "compute.vpnTunnels.delete":
  56280. type VpnTunnelsDeleteCall struct {
  56281. s *Service
  56282. project string
  56283. region string
  56284. vpnTunnel string
  56285. urlParams_ gensupport.URLParams
  56286. ctx_ context.Context
  56287. header_ http.Header
  56288. }
  56289. // Delete: Deletes the specified VpnTunnel resource.
  56290. func (r *VpnTunnelsService) Delete(project string, region string, vpnTunnel string) *VpnTunnelsDeleteCall {
  56291. c := &VpnTunnelsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56292. c.project = project
  56293. c.region = region
  56294. c.vpnTunnel = vpnTunnel
  56295. return c
  56296. }
  56297. // Fields allows partial responses to be retrieved. See
  56298. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56299. // for more information.
  56300. func (c *VpnTunnelsDeleteCall) Fields(s ...googleapi.Field) *VpnTunnelsDeleteCall {
  56301. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56302. return c
  56303. }
  56304. // Context sets the context to be used in this call's Do method. Any
  56305. // pending HTTP request will be aborted if the provided context is
  56306. // canceled.
  56307. func (c *VpnTunnelsDeleteCall) Context(ctx context.Context) *VpnTunnelsDeleteCall {
  56308. c.ctx_ = ctx
  56309. return c
  56310. }
  56311. // Header returns an http.Header that can be modified by the caller to
  56312. // add HTTP headers to the request.
  56313. func (c *VpnTunnelsDeleteCall) Header() http.Header {
  56314. if c.header_ == nil {
  56315. c.header_ = make(http.Header)
  56316. }
  56317. return c.header_
  56318. }
  56319. func (c *VpnTunnelsDeleteCall) doRequest(alt string) (*http.Response, error) {
  56320. reqHeaders := make(http.Header)
  56321. for k, v := range c.header_ {
  56322. reqHeaders[k] = v
  56323. }
  56324. reqHeaders.Set("User-Agent", c.s.userAgent())
  56325. var body io.Reader = nil
  56326. c.urlParams_.Set("alt", alt)
  56327. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels/{vpnTunnel}")
  56328. urls += "?" + c.urlParams_.Encode()
  56329. req, _ := http.NewRequest("DELETE", urls, body)
  56330. req.Header = reqHeaders
  56331. googleapi.Expand(req.URL, map[string]string{
  56332. "project": c.project,
  56333. "region": c.region,
  56334. "vpnTunnel": c.vpnTunnel,
  56335. })
  56336. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56337. }
  56338. // Do executes the "compute.vpnTunnels.delete" call.
  56339. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  56340. // status code is an error. Response headers are in either
  56341. // *Operation.ServerResponse.Header or (if a response was returned at
  56342. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  56343. // to check whether the returned error was because
  56344. // http.StatusNotModified was returned.
  56345. func (c *VpnTunnelsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  56346. gensupport.SetOptions(c.urlParams_, opts...)
  56347. res, err := c.doRequest("json")
  56348. if res != nil && res.StatusCode == http.StatusNotModified {
  56349. if res.Body != nil {
  56350. res.Body.Close()
  56351. }
  56352. return nil, &googleapi.Error{
  56353. Code: res.StatusCode,
  56354. Header: res.Header,
  56355. }
  56356. }
  56357. if err != nil {
  56358. return nil, err
  56359. }
  56360. defer googleapi.CloseBody(res)
  56361. if err := googleapi.CheckResponse(res); err != nil {
  56362. return nil, err
  56363. }
  56364. ret := &Operation{
  56365. ServerResponse: googleapi.ServerResponse{
  56366. Header: res.Header,
  56367. HTTPStatusCode: res.StatusCode,
  56368. },
  56369. }
  56370. target := &ret
  56371. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  56372. return nil, err
  56373. }
  56374. return ret, nil
  56375. // {
  56376. // "description": "Deletes the specified VpnTunnel resource.",
  56377. // "httpMethod": "DELETE",
  56378. // "id": "compute.vpnTunnels.delete",
  56379. // "parameterOrder": [
  56380. // "project",
  56381. // "region",
  56382. // "vpnTunnel"
  56383. // ],
  56384. // "parameters": {
  56385. // "project": {
  56386. // "description": "Project ID for this request.",
  56387. // "location": "path",
  56388. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56389. // "required": true,
  56390. // "type": "string"
  56391. // },
  56392. // "region": {
  56393. // "description": "Name of the region for this request.",
  56394. // "location": "path",
  56395. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  56396. // "required": true,
  56397. // "type": "string"
  56398. // },
  56399. // "vpnTunnel": {
  56400. // "description": "Name of the VpnTunnel resource to delete.",
  56401. // "location": "path",
  56402. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  56403. // "required": true,
  56404. // "type": "string"
  56405. // }
  56406. // },
  56407. // "path": "{project}/regions/{region}/vpnTunnels/{vpnTunnel}",
  56408. // "response": {
  56409. // "$ref": "Operation"
  56410. // },
  56411. // "scopes": [
  56412. // "https://www.googleapis.com/auth/cloud-platform",
  56413. // "https://www.googleapis.com/auth/compute"
  56414. // ]
  56415. // }
  56416. }
  56417. // method id "compute.vpnTunnels.get":
  56418. type VpnTunnelsGetCall struct {
  56419. s *Service
  56420. project string
  56421. region string
  56422. vpnTunnel string
  56423. urlParams_ gensupport.URLParams
  56424. ifNoneMatch_ string
  56425. ctx_ context.Context
  56426. header_ http.Header
  56427. }
  56428. // Get: Returns the specified VpnTunnel resource. Get a list of
  56429. // available VPN tunnels by making a list() request.
  56430. func (r *VpnTunnelsService) Get(project string, region string, vpnTunnel string) *VpnTunnelsGetCall {
  56431. c := &VpnTunnelsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56432. c.project = project
  56433. c.region = region
  56434. c.vpnTunnel = vpnTunnel
  56435. return c
  56436. }
  56437. // Fields allows partial responses to be retrieved. See
  56438. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56439. // for more information.
  56440. func (c *VpnTunnelsGetCall) Fields(s ...googleapi.Field) *VpnTunnelsGetCall {
  56441. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56442. return c
  56443. }
  56444. // IfNoneMatch sets the optional parameter which makes the operation
  56445. // fail if the object's ETag matches the given value. This is useful for
  56446. // getting updates only after the object has changed since the last
  56447. // request. Use googleapi.IsNotModified to check whether the response
  56448. // error from Do is the result of In-None-Match.
  56449. func (c *VpnTunnelsGetCall) IfNoneMatch(entityTag string) *VpnTunnelsGetCall {
  56450. c.ifNoneMatch_ = entityTag
  56451. return c
  56452. }
  56453. // Context sets the context to be used in this call's Do method. Any
  56454. // pending HTTP request will be aborted if the provided context is
  56455. // canceled.
  56456. func (c *VpnTunnelsGetCall) Context(ctx context.Context) *VpnTunnelsGetCall {
  56457. c.ctx_ = ctx
  56458. return c
  56459. }
  56460. // Header returns an http.Header that can be modified by the caller to
  56461. // add HTTP headers to the request.
  56462. func (c *VpnTunnelsGetCall) Header() http.Header {
  56463. if c.header_ == nil {
  56464. c.header_ = make(http.Header)
  56465. }
  56466. return c.header_
  56467. }
  56468. func (c *VpnTunnelsGetCall) doRequest(alt string) (*http.Response, error) {
  56469. reqHeaders := make(http.Header)
  56470. for k, v := range c.header_ {
  56471. reqHeaders[k] = v
  56472. }
  56473. reqHeaders.Set("User-Agent", c.s.userAgent())
  56474. if c.ifNoneMatch_ != "" {
  56475. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  56476. }
  56477. var body io.Reader = nil
  56478. c.urlParams_.Set("alt", alt)
  56479. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels/{vpnTunnel}")
  56480. urls += "?" + c.urlParams_.Encode()
  56481. req, _ := http.NewRequest("GET", urls, body)
  56482. req.Header = reqHeaders
  56483. googleapi.Expand(req.URL, map[string]string{
  56484. "project": c.project,
  56485. "region": c.region,
  56486. "vpnTunnel": c.vpnTunnel,
  56487. })
  56488. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56489. }
  56490. // Do executes the "compute.vpnTunnels.get" call.
  56491. // Exactly one of *VpnTunnel or error will be non-nil. Any non-2xx
  56492. // status code is an error. Response headers are in either
  56493. // *VpnTunnel.ServerResponse.Header or (if a response was returned at
  56494. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  56495. // to check whether the returned error was because
  56496. // http.StatusNotModified was returned.
  56497. func (c *VpnTunnelsGetCall) Do(opts ...googleapi.CallOption) (*VpnTunnel, error) {
  56498. gensupport.SetOptions(c.urlParams_, opts...)
  56499. res, err := c.doRequest("json")
  56500. if res != nil && res.StatusCode == http.StatusNotModified {
  56501. if res.Body != nil {
  56502. res.Body.Close()
  56503. }
  56504. return nil, &googleapi.Error{
  56505. Code: res.StatusCode,
  56506. Header: res.Header,
  56507. }
  56508. }
  56509. if err != nil {
  56510. return nil, err
  56511. }
  56512. defer googleapi.CloseBody(res)
  56513. if err := googleapi.CheckResponse(res); err != nil {
  56514. return nil, err
  56515. }
  56516. ret := &VpnTunnel{
  56517. ServerResponse: googleapi.ServerResponse{
  56518. Header: res.Header,
  56519. HTTPStatusCode: res.StatusCode,
  56520. },
  56521. }
  56522. target := &ret
  56523. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  56524. return nil, err
  56525. }
  56526. return ret, nil
  56527. // {
  56528. // "description": "Returns the specified VpnTunnel resource. Get a list of available VPN tunnels by making a list() request.",
  56529. // "httpMethod": "GET",
  56530. // "id": "compute.vpnTunnels.get",
  56531. // "parameterOrder": [
  56532. // "project",
  56533. // "region",
  56534. // "vpnTunnel"
  56535. // ],
  56536. // "parameters": {
  56537. // "project": {
  56538. // "description": "Project ID for this request.",
  56539. // "location": "path",
  56540. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56541. // "required": true,
  56542. // "type": "string"
  56543. // },
  56544. // "region": {
  56545. // "description": "Name of the region for this request.",
  56546. // "location": "path",
  56547. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  56548. // "required": true,
  56549. // "type": "string"
  56550. // },
  56551. // "vpnTunnel": {
  56552. // "description": "Name of the VpnTunnel resource to return.",
  56553. // "location": "path",
  56554. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  56555. // "required": true,
  56556. // "type": "string"
  56557. // }
  56558. // },
  56559. // "path": "{project}/regions/{region}/vpnTunnels/{vpnTunnel}",
  56560. // "response": {
  56561. // "$ref": "VpnTunnel"
  56562. // },
  56563. // "scopes": [
  56564. // "https://www.googleapis.com/auth/cloud-platform",
  56565. // "https://www.googleapis.com/auth/compute",
  56566. // "https://www.googleapis.com/auth/compute.readonly"
  56567. // ]
  56568. // }
  56569. }
  56570. // method id "compute.vpnTunnels.insert":
  56571. type VpnTunnelsInsertCall struct {
  56572. s *Service
  56573. project string
  56574. region string
  56575. vpntunnel *VpnTunnel
  56576. urlParams_ gensupport.URLParams
  56577. ctx_ context.Context
  56578. header_ http.Header
  56579. }
  56580. // Insert: Creates a VpnTunnel resource in the specified project and
  56581. // region using the data included in the request.
  56582. func (r *VpnTunnelsService) Insert(project string, region string, vpntunnel *VpnTunnel) *VpnTunnelsInsertCall {
  56583. c := &VpnTunnelsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56584. c.project = project
  56585. c.region = region
  56586. c.vpntunnel = vpntunnel
  56587. return c
  56588. }
  56589. // Fields allows partial responses to be retrieved. See
  56590. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56591. // for more information.
  56592. func (c *VpnTunnelsInsertCall) Fields(s ...googleapi.Field) *VpnTunnelsInsertCall {
  56593. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56594. return c
  56595. }
  56596. // Context sets the context to be used in this call's Do method. Any
  56597. // pending HTTP request will be aborted if the provided context is
  56598. // canceled.
  56599. func (c *VpnTunnelsInsertCall) Context(ctx context.Context) *VpnTunnelsInsertCall {
  56600. c.ctx_ = ctx
  56601. return c
  56602. }
  56603. // Header returns an http.Header that can be modified by the caller to
  56604. // add HTTP headers to the request.
  56605. func (c *VpnTunnelsInsertCall) Header() http.Header {
  56606. if c.header_ == nil {
  56607. c.header_ = make(http.Header)
  56608. }
  56609. return c.header_
  56610. }
  56611. func (c *VpnTunnelsInsertCall) doRequest(alt string) (*http.Response, error) {
  56612. reqHeaders := make(http.Header)
  56613. for k, v := range c.header_ {
  56614. reqHeaders[k] = v
  56615. }
  56616. reqHeaders.Set("User-Agent", c.s.userAgent())
  56617. var body io.Reader = nil
  56618. body, err := googleapi.WithoutDataWrapper.JSONReader(c.vpntunnel)
  56619. if err != nil {
  56620. return nil, err
  56621. }
  56622. reqHeaders.Set("Content-Type", "application/json")
  56623. c.urlParams_.Set("alt", alt)
  56624. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels")
  56625. urls += "?" + c.urlParams_.Encode()
  56626. req, _ := http.NewRequest("POST", urls, body)
  56627. req.Header = reqHeaders
  56628. googleapi.Expand(req.URL, map[string]string{
  56629. "project": c.project,
  56630. "region": c.region,
  56631. })
  56632. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56633. }
  56634. // Do executes the "compute.vpnTunnels.insert" call.
  56635. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  56636. // status code is an error. Response headers are in either
  56637. // *Operation.ServerResponse.Header or (if a response was returned at
  56638. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  56639. // to check whether the returned error was because
  56640. // http.StatusNotModified was returned.
  56641. func (c *VpnTunnelsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  56642. gensupport.SetOptions(c.urlParams_, opts...)
  56643. res, err := c.doRequest("json")
  56644. if res != nil && res.StatusCode == http.StatusNotModified {
  56645. if res.Body != nil {
  56646. res.Body.Close()
  56647. }
  56648. return nil, &googleapi.Error{
  56649. Code: res.StatusCode,
  56650. Header: res.Header,
  56651. }
  56652. }
  56653. if err != nil {
  56654. return nil, err
  56655. }
  56656. defer googleapi.CloseBody(res)
  56657. if err := googleapi.CheckResponse(res); err != nil {
  56658. return nil, err
  56659. }
  56660. ret := &Operation{
  56661. ServerResponse: googleapi.ServerResponse{
  56662. Header: res.Header,
  56663. HTTPStatusCode: res.StatusCode,
  56664. },
  56665. }
  56666. target := &ret
  56667. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  56668. return nil, err
  56669. }
  56670. return ret, nil
  56671. // {
  56672. // "description": "Creates a VpnTunnel resource in the specified project and region using the data included in the request.",
  56673. // "httpMethod": "POST",
  56674. // "id": "compute.vpnTunnels.insert",
  56675. // "parameterOrder": [
  56676. // "project",
  56677. // "region"
  56678. // ],
  56679. // "parameters": {
  56680. // "project": {
  56681. // "description": "Project ID for this request.",
  56682. // "location": "path",
  56683. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56684. // "required": true,
  56685. // "type": "string"
  56686. // },
  56687. // "region": {
  56688. // "description": "Name of the region for this request.",
  56689. // "location": "path",
  56690. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  56691. // "required": true,
  56692. // "type": "string"
  56693. // }
  56694. // },
  56695. // "path": "{project}/regions/{region}/vpnTunnels",
  56696. // "request": {
  56697. // "$ref": "VpnTunnel"
  56698. // },
  56699. // "response": {
  56700. // "$ref": "Operation"
  56701. // },
  56702. // "scopes": [
  56703. // "https://www.googleapis.com/auth/cloud-platform",
  56704. // "https://www.googleapis.com/auth/compute"
  56705. // ]
  56706. // }
  56707. }
  56708. // method id "compute.vpnTunnels.list":
  56709. type VpnTunnelsListCall struct {
  56710. s *Service
  56711. project string
  56712. region string
  56713. urlParams_ gensupport.URLParams
  56714. ifNoneMatch_ string
  56715. ctx_ context.Context
  56716. header_ http.Header
  56717. }
  56718. // List: Retrieves a list of VpnTunnel resources contained in the
  56719. // specified project and region.
  56720. func (r *VpnTunnelsService) List(project string, region string) *VpnTunnelsListCall {
  56721. c := &VpnTunnelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56722. c.project = project
  56723. c.region = region
  56724. return c
  56725. }
  56726. // Filter sets the optional parameter "filter": Sets a filter
  56727. // {expression} for filtering listed resources. Your {expression} must
  56728. // be in the format: field_name comparison_string literal_string.
  56729. //
  56730. // The field_name is the name of the field you want to compare. Only
  56731. // atomic field types are supported (string, number, boolean). The
  56732. // comparison_string must be either eq (equals) or ne (not equals). The
  56733. // literal_string is the string value to filter to. The literal value
  56734. // must be valid for the type of field you are filtering by (string,
  56735. // number, boolean). For string fields, the literal value is interpreted
  56736. // as a regular expression using RE2 syntax. The literal value must
  56737. // match the entire field.
  56738. //
  56739. // For example, to filter for instances that do not have a name of
  56740. // example-instance, you would use name ne example-instance.
  56741. //
  56742. // You can filter on nested fields. For example, you could filter on
  56743. // instances that have set the scheduling.automaticRestart field to
  56744. // true. Use filtering on nested fields to take advantage of labels to
  56745. // organize and search for results based on label values.
  56746. //
  56747. // To filter on multiple expressions, provide each separate expression
  56748. // within parentheses. For example, (scheduling.automaticRestart eq
  56749. // true) (zone eq us-central1-f). Multiple expressions are treated as
  56750. // AND expressions, meaning that resources must match all expressions to
  56751. // pass the filters.
  56752. func (c *VpnTunnelsListCall) Filter(filter string) *VpnTunnelsListCall {
  56753. c.urlParams_.Set("filter", filter)
  56754. return c
  56755. }
  56756. // MaxResults sets the optional parameter "maxResults": The maximum
  56757. // number of results per page that should be returned. If the number of
  56758. // available results is larger than maxResults, Compute Engine returns a
  56759. // nextPageToken that can be used to get the next page of results in
  56760. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  56761. // (Default: 500)
  56762. func (c *VpnTunnelsListCall) MaxResults(maxResults int64) *VpnTunnelsListCall {
  56763. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  56764. return c
  56765. }
  56766. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  56767. // a certain order. By default, results are returned in alphanumerical
  56768. // order based on the resource name.
  56769. //
  56770. // You can also sort results in descending order based on the creation
  56771. // timestamp using orderBy="creationTimestamp desc". This sorts results
  56772. // based on the creationTimestamp field in reverse chronological order
  56773. // (newest result first). Use this to sort resources like operations so
  56774. // that the newest operation is returned first.
  56775. //
  56776. // Currently, only sorting by name or creationTimestamp desc is
  56777. // supported.
  56778. func (c *VpnTunnelsListCall) OrderBy(orderBy string) *VpnTunnelsListCall {
  56779. c.urlParams_.Set("orderBy", orderBy)
  56780. return c
  56781. }
  56782. // PageToken sets the optional parameter "pageToken": Specifies a page
  56783. // token to use. Set pageToken to the nextPageToken returned by a
  56784. // previous list request to get the next page of results.
  56785. func (c *VpnTunnelsListCall) PageToken(pageToken string) *VpnTunnelsListCall {
  56786. c.urlParams_.Set("pageToken", pageToken)
  56787. return c
  56788. }
  56789. // Fields allows partial responses to be retrieved. See
  56790. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56791. // for more information.
  56792. func (c *VpnTunnelsListCall) Fields(s ...googleapi.Field) *VpnTunnelsListCall {
  56793. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56794. return c
  56795. }
  56796. // IfNoneMatch sets the optional parameter which makes the operation
  56797. // fail if the object's ETag matches the given value. This is useful for
  56798. // getting updates only after the object has changed since the last
  56799. // request. Use googleapi.IsNotModified to check whether the response
  56800. // error from Do is the result of In-None-Match.
  56801. func (c *VpnTunnelsListCall) IfNoneMatch(entityTag string) *VpnTunnelsListCall {
  56802. c.ifNoneMatch_ = entityTag
  56803. return c
  56804. }
  56805. // Context sets the context to be used in this call's Do method. Any
  56806. // pending HTTP request will be aborted if the provided context is
  56807. // canceled.
  56808. func (c *VpnTunnelsListCall) Context(ctx context.Context) *VpnTunnelsListCall {
  56809. c.ctx_ = ctx
  56810. return c
  56811. }
  56812. // Header returns an http.Header that can be modified by the caller to
  56813. // add HTTP headers to the request.
  56814. func (c *VpnTunnelsListCall) Header() http.Header {
  56815. if c.header_ == nil {
  56816. c.header_ = make(http.Header)
  56817. }
  56818. return c.header_
  56819. }
  56820. func (c *VpnTunnelsListCall) doRequest(alt string) (*http.Response, error) {
  56821. reqHeaders := make(http.Header)
  56822. for k, v := range c.header_ {
  56823. reqHeaders[k] = v
  56824. }
  56825. reqHeaders.Set("User-Agent", c.s.userAgent())
  56826. if c.ifNoneMatch_ != "" {
  56827. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  56828. }
  56829. var body io.Reader = nil
  56830. c.urlParams_.Set("alt", alt)
  56831. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels")
  56832. urls += "?" + c.urlParams_.Encode()
  56833. req, _ := http.NewRequest("GET", urls, body)
  56834. req.Header = reqHeaders
  56835. googleapi.Expand(req.URL, map[string]string{
  56836. "project": c.project,
  56837. "region": c.region,
  56838. })
  56839. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56840. }
  56841. // Do executes the "compute.vpnTunnels.list" call.
  56842. // Exactly one of *VpnTunnelList or error will be non-nil. Any non-2xx
  56843. // status code is an error. Response headers are in either
  56844. // *VpnTunnelList.ServerResponse.Header or (if a response was returned
  56845. // at all) in error.(*googleapi.Error).Header. Use
  56846. // googleapi.IsNotModified to check whether the returned error was
  56847. // because http.StatusNotModified was returned.
  56848. func (c *VpnTunnelsListCall) Do(opts ...googleapi.CallOption) (*VpnTunnelList, error) {
  56849. gensupport.SetOptions(c.urlParams_, opts...)
  56850. res, err := c.doRequest("json")
  56851. if res != nil && res.StatusCode == http.StatusNotModified {
  56852. if res.Body != nil {
  56853. res.Body.Close()
  56854. }
  56855. return nil, &googleapi.Error{
  56856. Code: res.StatusCode,
  56857. Header: res.Header,
  56858. }
  56859. }
  56860. if err != nil {
  56861. return nil, err
  56862. }
  56863. defer googleapi.CloseBody(res)
  56864. if err := googleapi.CheckResponse(res); err != nil {
  56865. return nil, err
  56866. }
  56867. ret := &VpnTunnelList{
  56868. ServerResponse: googleapi.ServerResponse{
  56869. Header: res.Header,
  56870. HTTPStatusCode: res.StatusCode,
  56871. },
  56872. }
  56873. target := &ret
  56874. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  56875. return nil, err
  56876. }
  56877. return ret, nil
  56878. // {
  56879. // "description": "Retrieves a list of VpnTunnel resources contained in the specified project and region.",
  56880. // "httpMethod": "GET",
  56881. // "id": "compute.vpnTunnels.list",
  56882. // "parameterOrder": [
  56883. // "project",
  56884. // "region"
  56885. // ],
  56886. // "parameters": {
  56887. // "filter": {
  56888. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  56889. // "location": "query",
  56890. // "type": "string"
  56891. // },
  56892. // "maxResults": {
  56893. // "default": "500",
  56894. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  56895. // "format": "uint32",
  56896. // "location": "query",
  56897. // "minimum": "0",
  56898. // "type": "integer"
  56899. // },
  56900. // "orderBy": {
  56901. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  56902. // "location": "query",
  56903. // "type": "string"
  56904. // },
  56905. // "pageToken": {
  56906. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  56907. // "location": "query",
  56908. // "type": "string"
  56909. // },
  56910. // "project": {
  56911. // "description": "Project ID for this request.",
  56912. // "location": "path",
  56913. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56914. // "required": true,
  56915. // "type": "string"
  56916. // },
  56917. // "region": {
  56918. // "description": "Name of the region for this request.",
  56919. // "location": "path",
  56920. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  56921. // "required": true,
  56922. // "type": "string"
  56923. // }
  56924. // },
  56925. // "path": "{project}/regions/{region}/vpnTunnels",
  56926. // "response": {
  56927. // "$ref": "VpnTunnelList"
  56928. // },
  56929. // "scopes": [
  56930. // "https://www.googleapis.com/auth/cloud-platform",
  56931. // "https://www.googleapis.com/auth/compute",
  56932. // "https://www.googleapis.com/auth/compute.readonly"
  56933. // ]
  56934. // }
  56935. }
  56936. // Pages invokes f for each page of results.
  56937. // A non-nil error returned from f will halt the iteration.
  56938. // The provided context supersedes any context provided to the Context method.
  56939. func (c *VpnTunnelsListCall) Pages(ctx context.Context, f func(*VpnTunnelList) error) error {
  56940. c.ctx_ = ctx
  56941. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  56942. for {
  56943. x, err := c.Do()
  56944. if err != nil {
  56945. return err
  56946. }
  56947. if err := f(x); err != nil {
  56948. return err
  56949. }
  56950. if x.NextPageToken == "" {
  56951. return nil
  56952. }
  56953. c.PageToken(x.NextPageToken)
  56954. }
  56955. }
  56956. // method id "compute.zoneOperations.delete":
  56957. type ZoneOperationsDeleteCall struct {
  56958. s *Service
  56959. project string
  56960. zone string
  56961. operation string
  56962. urlParams_ gensupport.URLParams
  56963. ctx_ context.Context
  56964. header_ http.Header
  56965. }
  56966. // Delete: Deletes the specified zone-specific Operations resource.
  56967. // For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/delete
  56968. func (r *ZoneOperationsService) Delete(project string, zone string, operation string) *ZoneOperationsDeleteCall {
  56969. c := &ZoneOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56970. c.project = project
  56971. c.zone = zone
  56972. c.operation = operation
  56973. return c
  56974. }
  56975. // Fields allows partial responses to be retrieved. See
  56976. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56977. // for more information.
  56978. func (c *ZoneOperationsDeleteCall) Fields(s ...googleapi.Field) *ZoneOperationsDeleteCall {
  56979. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56980. return c
  56981. }
  56982. // Context sets the context to be used in this call's Do method. Any
  56983. // pending HTTP request will be aborted if the provided context is
  56984. // canceled.
  56985. func (c *ZoneOperationsDeleteCall) Context(ctx context.Context) *ZoneOperationsDeleteCall {
  56986. c.ctx_ = ctx
  56987. return c
  56988. }
  56989. // Header returns an http.Header that can be modified by the caller to
  56990. // add HTTP headers to the request.
  56991. func (c *ZoneOperationsDeleteCall) Header() http.Header {
  56992. if c.header_ == nil {
  56993. c.header_ = make(http.Header)
  56994. }
  56995. return c.header_
  56996. }
  56997. func (c *ZoneOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  56998. reqHeaders := make(http.Header)
  56999. for k, v := range c.header_ {
  57000. reqHeaders[k] = v
  57001. }
  57002. reqHeaders.Set("User-Agent", c.s.userAgent())
  57003. var body io.Reader = nil
  57004. c.urlParams_.Set("alt", alt)
  57005. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations/{operation}")
  57006. urls += "?" + c.urlParams_.Encode()
  57007. req, _ := http.NewRequest("DELETE", urls, body)
  57008. req.Header = reqHeaders
  57009. googleapi.Expand(req.URL, map[string]string{
  57010. "project": c.project,
  57011. "zone": c.zone,
  57012. "operation": c.operation,
  57013. })
  57014. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57015. }
  57016. // Do executes the "compute.zoneOperations.delete" call.
  57017. func (c *ZoneOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  57018. gensupport.SetOptions(c.urlParams_, opts...)
  57019. res, err := c.doRequest("json")
  57020. if err != nil {
  57021. return err
  57022. }
  57023. defer googleapi.CloseBody(res)
  57024. if err := googleapi.CheckResponse(res); err != nil {
  57025. return err
  57026. }
  57027. return nil
  57028. // {
  57029. // "description": "Deletes the specified zone-specific Operations resource.",
  57030. // "httpMethod": "DELETE",
  57031. // "id": "compute.zoneOperations.delete",
  57032. // "parameterOrder": [
  57033. // "project",
  57034. // "zone",
  57035. // "operation"
  57036. // ],
  57037. // "parameters": {
  57038. // "operation": {
  57039. // "description": "Name of the Operations resource to delete.",
  57040. // "location": "path",
  57041. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  57042. // "required": true,
  57043. // "type": "string"
  57044. // },
  57045. // "project": {
  57046. // "description": "Project ID for this request.",
  57047. // "location": "path",
  57048. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57049. // "required": true,
  57050. // "type": "string"
  57051. // },
  57052. // "zone": {
  57053. // "description": "Name of the zone for this request.",
  57054. // "location": "path",
  57055. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  57056. // "required": true,
  57057. // "type": "string"
  57058. // }
  57059. // },
  57060. // "path": "{project}/zones/{zone}/operations/{operation}",
  57061. // "scopes": [
  57062. // "https://www.googleapis.com/auth/cloud-platform",
  57063. // "https://www.googleapis.com/auth/compute"
  57064. // ]
  57065. // }
  57066. }
  57067. // method id "compute.zoneOperations.get":
  57068. type ZoneOperationsGetCall struct {
  57069. s *Service
  57070. project string
  57071. zone string
  57072. operation string
  57073. urlParams_ gensupport.URLParams
  57074. ifNoneMatch_ string
  57075. ctx_ context.Context
  57076. header_ http.Header
  57077. }
  57078. // Get: Retrieves the specified zone-specific Operations resource.
  57079. // For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/get
  57080. func (r *ZoneOperationsService) Get(project string, zone string, operation string) *ZoneOperationsGetCall {
  57081. c := &ZoneOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57082. c.project = project
  57083. c.zone = zone
  57084. c.operation = operation
  57085. return c
  57086. }
  57087. // Fields allows partial responses to be retrieved. See
  57088. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57089. // for more information.
  57090. func (c *ZoneOperationsGetCall) Fields(s ...googleapi.Field) *ZoneOperationsGetCall {
  57091. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57092. return c
  57093. }
  57094. // IfNoneMatch sets the optional parameter which makes the operation
  57095. // fail if the object's ETag matches the given value. This is useful for
  57096. // getting updates only after the object has changed since the last
  57097. // request. Use googleapi.IsNotModified to check whether the response
  57098. // error from Do is the result of In-None-Match.
  57099. func (c *ZoneOperationsGetCall) IfNoneMatch(entityTag string) *ZoneOperationsGetCall {
  57100. c.ifNoneMatch_ = entityTag
  57101. return c
  57102. }
  57103. // Context sets the context to be used in this call's Do method. Any
  57104. // pending HTTP request will be aborted if the provided context is
  57105. // canceled.
  57106. func (c *ZoneOperationsGetCall) Context(ctx context.Context) *ZoneOperationsGetCall {
  57107. c.ctx_ = ctx
  57108. return c
  57109. }
  57110. // Header returns an http.Header that can be modified by the caller to
  57111. // add HTTP headers to the request.
  57112. func (c *ZoneOperationsGetCall) Header() http.Header {
  57113. if c.header_ == nil {
  57114. c.header_ = make(http.Header)
  57115. }
  57116. return c.header_
  57117. }
  57118. func (c *ZoneOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  57119. reqHeaders := make(http.Header)
  57120. for k, v := range c.header_ {
  57121. reqHeaders[k] = v
  57122. }
  57123. reqHeaders.Set("User-Agent", c.s.userAgent())
  57124. if c.ifNoneMatch_ != "" {
  57125. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  57126. }
  57127. var body io.Reader = nil
  57128. c.urlParams_.Set("alt", alt)
  57129. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations/{operation}")
  57130. urls += "?" + c.urlParams_.Encode()
  57131. req, _ := http.NewRequest("GET", urls, body)
  57132. req.Header = reqHeaders
  57133. googleapi.Expand(req.URL, map[string]string{
  57134. "project": c.project,
  57135. "zone": c.zone,
  57136. "operation": c.operation,
  57137. })
  57138. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57139. }
  57140. // Do executes the "compute.zoneOperations.get" call.
  57141. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  57142. // status code is an error. Response headers are in either
  57143. // *Operation.ServerResponse.Header or (if a response was returned at
  57144. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  57145. // to check whether the returned error was because
  57146. // http.StatusNotModified was returned.
  57147. func (c *ZoneOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  57148. gensupport.SetOptions(c.urlParams_, opts...)
  57149. res, err := c.doRequest("json")
  57150. if res != nil && res.StatusCode == http.StatusNotModified {
  57151. if res.Body != nil {
  57152. res.Body.Close()
  57153. }
  57154. return nil, &googleapi.Error{
  57155. Code: res.StatusCode,
  57156. Header: res.Header,
  57157. }
  57158. }
  57159. if err != nil {
  57160. return nil, err
  57161. }
  57162. defer googleapi.CloseBody(res)
  57163. if err := googleapi.CheckResponse(res); err != nil {
  57164. return nil, err
  57165. }
  57166. ret := &Operation{
  57167. ServerResponse: googleapi.ServerResponse{
  57168. Header: res.Header,
  57169. HTTPStatusCode: res.StatusCode,
  57170. },
  57171. }
  57172. target := &ret
  57173. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  57174. return nil, err
  57175. }
  57176. return ret, nil
  57177. // {
  57178. // "description": "Retrieves the specified zone-specific Operations resource.",
  57179. // "httpMethod": "GET",
  57180. // "id": "compute.zoneOperations.get",
  57181. // "parameterOrder": [
  57182. // "project",
  57183. // "zone",
  57184. // "operation"
  57185. // ],
  57186. // "parameters": {
  57187. // "operation": {
  57188. // "description": "Name of the Operations resource to return.",
  57189. // "location": "path",
  57190. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  57191. // "required": true,
  57192. // "type": "string"
  57193. // },
  57194. // "project": {
  57195. // "description": "Project ID for this request.",
  57196. // "location": "path",
  57197. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57198. // "required": true,
  57199. // "type": "string"
  57200. // },
  57201. // "zone": {
  57202. // "description": "Name of the zone for this request.",
  57203. // "location": "path",
  57204. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  57205. // "required": true,
  57206. // "type": "string"
  57207. // }
  57208. // },
  57209. // "path": "{project}/zones/{zone}/operations/{operation}",
  57210. // "response": {
  57211. // "$ref": "Operation"
  57212. // },
  57213. // "scopes": [
  57214. // "https://www.googleapis.com/auth/cloud-platform",
  57215. // "https://www.googleapis.com/auth/compute",
  57216. // "https://www.googleapis.com/auth/compute.readonly"
  57217. // ]
  57218. // }
  57219. }
  57220. // method id "compute.zoneOperations.list":
  57221. type ZoneOperationsListCall struct {
  57222. s *Service
  57223. project string
  57224. zone string
  57225. urlParams_ gensupport.URLParams
  57226. ifNoneMatch_ string
  57227. ctx_ context.Context
  57228. header_ http.Header
  57229. }
  57230. // List: Retrieves a list of Operation resources contained within the
  57231. // specified zone.
  57232. // For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/list
  57233. func (r *ZoneOperationsService) List(project string, zone string) *ZoneOperationsListCall {
  57234. c := &ZoneOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57235. c.project = project
  57236. c.zone = zone
  57237. return c
  57238. }
  57239. // Filter sets the optional parameter "filter": Sets a filter
  57240. // {expression} for filtering listed resources. Your {expression} must
  57241. // be in the format: field_name comparison_string literal_string.
  57242. //
  57243. // The field_name is the name of the field you want to compare. Only
  57244. // atomic field types are supported (string, number, boolean). The
  57245. // comparison_string must be either eq (equals) or ne (not equals). The
  57246. // literal_string is the string value to filter to. The literal value
  57247. // must be valid for the type of field you are filtering by (string,
  57248. // number, boolean). For string fields, the literal value is interpreted
  57249. // as a regular expression using RE2 syntax. The literal value must
  57250. // match the entire field.
  57251. //
  57252. // For example, to filter for instances that do not have a name of
  57253. // example-instance, you would use name ne example-instance.
  57254. //
  57255. // You can filter on nested fields. For example, you could filter on
  57256. // instances that have set the scheduling.automaticRestart field to
  57257. // true. Use filtering on nested fields to take advantage of labels to
  57258. // organize and search for results based on label values.
  57259. //
  57260. // To filter on multiple expressions, provide each separate expression
  57261. // within parentheses. For example, (scheduling.automaticRestart eq
  57262. // true) (zone eq us-central1-f). Multiple expressions are treated as
  57263. // AND expressions, meaning that resources must match all expressions to
  57264. // pass the filters.
  57265. func (c *ZoneOperationsListCall) Filter(filter string) *ZoneOperationsListCall {
  57266. c.urlParams_.Set("filter", filter)
  57267. return c
  57268. }
  57269. // MaxResults sets the optional parameter "maxResults": The maximum
  57270. // number of results per page that should be returned. If the number of
  57271. // available results is larger than maxResults, Compute Engine returns a
  57272. // nextPageToken that can be used to get the next page of results in
  57273. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  57274. // (Default: 500)
  57275. func (c *ZoneOperationsListCall) MaxResults(maxResults int64) *ZoneOperationsListCall {
  57276. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  57277. return c
  57278. }
  57279. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  57280. // a certain order. By default, results are returned in alphanumerical
  57281. // order based on the resource name.
  57282. //
  57283. // You can also sort results in descending order based on the creation
  57284. // timestamp using orderBy="creationTimestamp desc". This sorts results
  57285. // based on the creationTimestamp field in reverse chronological order
  57286. // (newest result first). Use this to sort resources like operations so
  57287. // that the newest operation is returned first.
  57288. //
  57289. // Currently, only sorting by name or creationTimestamp desc is
  57290. // supported.
  57291. func (c *ZoneOperationsListCall) OrderBy(orderBy string) *ZoneOperationsListCall {
  57292. c.urlParams_.Set("orderBy", orderBy)
  57293. return c
  57294. }
  57295. // PageToken sets the optional parameter "pageToken": Specifies a page
  57296. // token to use. Set pageToken to the nextPageToken returned by a
  57297. // previous list request to get the next page of results.
  57298. func (c *ZoneOperationsListCall) PageToken(pageToken string) *ZoneOperationsListCall {
  57299. c.urlParams_.Set("pageToken", pageToken)
  57300. return c
  57301. }
  57302. // Fields allows partial responses to be retrieved. See
  57303. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57304. // for more information.
  57305. func (c *ZoneOperationsListCall) Fields(s ...googleapi.Field) *ZoneOperationsListCall {
  57306. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57307. return c
  57308. }
  57309. // IfNoneMatch sets the optional parameter which makes the operation
  57310. // fail if the object's ETag matches the given value. This is useful for
  57311. // getting updates only after the object has changed since the last
  57312. // request. Use googleapi.IsNotModified to check whether the response
  57313. // error from Do is the result of In-None-Match.
  57314. func (c *ZoneOperationsListCall) IfNoneMatch(entityTag string) *ZoneOperationsListCall {
  57315. c.ifNoneMatch_ = entityTag
  57316. return c
  57317. }
  57318. // Context sets the context to be used in this call's Do method. Any
  57319. // pending HTTP request will be aborted if the provided context is
  57320. // canceled.
  57321. func (c *ZoneOperationsListCall) Context(ctx context.Context) *ZoneOperationsListCall {
  57322. c.ctx_ = ctx
  57323. return c
  57324. }
  57325. // Header returns an http.Header that can be modified by the caller to
  57326. // add HTTP headers to the request.
  57327. func (c *ZoneOperationsListCall) Header() http.Header {
  57328. if c.header_ == nil {
  57329. c.header_ = make(http.Header)
  57330. }
  57331. return c.header_
  57332. }
  57333. func (c *ZoneOperationsListCall) doRequest(alt string) (*http.Response, error) {
  57334. reqHeaders := make(http.Header)
  57335. for k, v := range c.header_ {
  57336. reqHeaders[k] = v
  57337. }
  57338. reqHeaders.Set("User-Agent", c.s.userAgent())
  57339. if c.ifNoneMatch_ != "" {
  57340. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  57341. }
  57342. var body io.Reader = nil
  57343. c.urlParams_.Set("alt", alt)
  57344. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations")
  57345. urls += "?" + c.urlParams_.Encode()
  57346. req, _ := http.NewRequest("GET", urls, body)
  57347. req.Header = reqHeaders
  57348. googleapi.Expand(req.URL, map[string]string{
  57349. "project": c.project,
  57350. "zone": c.zone,
  57351. })
  57352. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57353. }
  57354. // Do executes the "compute.zoneOperations.list" call.
  57355. // Exactly one of *OperationList or error will be non-nil. Any non-2xx
  57356. // status code is an error. Response headers are in either
  57357. // *OperationList.ServerResponse.Header or (if a response was returned
  57358. // at all) in error.(*googleapi.Error).Header. Use
  57359. // googleapi.IsNotModified to check whether the returned error was
  57360. // because http.StatusNotModified was returned.
  57361. func (c *ZoneOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, error) {
  57362. gensupport.SetOptions(c.urlParams_, opts...)
  57363. res, err := c.doRequest("json")
  57364. if res != nil && res.StatusCode == http.StatusNotModified {
  57365. if res.Body != nil {
  57366. res.Body.Close()
  57367. }
  57368. return nil, &googleapi.Error{
  57369. Code: res.StatusCode,
  57370. Header: res.Header,
  57371. }
  57372. }
  57373. if err != nil {
  57374. return nil, err
  57375. }
  57376. defer googleapi.CloseBody(res)
  57377. if err := googleapi.CheckResponse(res); err != nil {
  57378. return nil, err
  57379. }
  57380. ret := &OperationList{
  57381. ServerResponse: googleapi.ServerResponse{
  57382. Header: res.Header,
  57383. HTTPStatusCode: res.StatusCode,
  57384. },
  57385. }
  57386. target := &ret
  57387. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  57388. return nil, err
  57389. }
  57390. return ret, nil
  57391. // {
  57392. // "description": "Retrieves a list of Operation resources contained within the specified zone.",
  57393. // "httpMethod": "GET",
  57394. // "id": "compute.zoneOperations.list",
  57395. // "parameterOrder": [
  57396. // "project",
  57397. // "zone"
  57398. // ],
  57399. // "parameters": {
  57400. // "filter": {
  57401. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  57402. // "location": "query",
  57403. // "type": "string"
  57404. // },
  57405. // "maxResults": {
  57406. // "default": "500",
  57407. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  57408. // "format": "uint32",
  57409. // "location": "query",
  57410. // "minimum": "0",
  57411. // "type": "integer"
  57412. // },
  57413. // "orderBy": {
  57414. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  57415. // "location": "query",
  57416. // "type": "string"
  57417. // },
  57418. // "pageToken": {
  57419. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  57420. // "location": "query",
  57421. // "type": "string"
  57422. // },
  57423. // "project": {
  57424. // "description": "Project ID for this request.",
  57425. // "location": "path",
  57426. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57427. // "required": true,
  57428. // "type": "string"
  57429. // },
  57430. // "zone": {
  57431. // "description": "Name of the zone for request.",
  57432. // "location": "path",
  57433. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  57434. // "required": true,
  57435. // "type": "string"
  57436. // }
  57437. // },
  57438. // "path": "{project}/zones/{zone}/operations",
  57439. // "response": {
  57440. // "$ref": "OperationList"
  57441. // },
  57442. // "scopes": [
  57443. // "https://www.googleapis.com/auth/cloud-platform",
  57444. // "https://www.googleapis.com/auth/compute",
  57445. // "https://www.googleapis.com/auth/compute.readonly"
  57446. // ]
  57447. // }
  57448. }
  57449. // Pages invokes f for each page of results.
  57450. // A non-nil error returned from f will halt the iteration.
  57451. // The provided context supersedes any context provided to the Context method.
  57452. func (c *ZoneOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
  57453. c.ctx_ = ctx
  57454. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  57455. for {
  57456. x, err := c.Do()
  57457. if err != nil {
  57458. return err
  57459. }
  57460. if err := f(x); err != nil {
  57461. return err
  57462. }
  57463. if x.NextPageToken == "" {
  57464. return nil
  57465. }
  57466. c.PageToken(x.NextPageToken)
  57467. }
  57468. }
  57469. // method id "compute.zones.get":
  57470. type ZonesGetCall struct {
  57471. s *Service
  57472. project string
  57473. zone string
  57474. urlParams_ gensupport.URLParams
  57475. ifNoneMatch_ string
  57476. ctx_ context.Context
  57477. header_ http.Header
  57478. }
  57479. // Get: Returns the specified Zone resource. Get a list of available
  57480. // zones by making a list() request.
  57481. // For details, see https://cloud.google.com/compute/docs/reference/latest/zones/get
  57482. func (r *ZonesService) Get(project string, zone string) *ZonesGetCall {
  57483. c := &ZonesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57484. c.project = project
  57485. c.zone = zone
  57486. return c
  57487. }
  57488. // Fields allows partial responses to be retrieved. See
  57489. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57490. // for more information.
  57491. func (c *ZonesGetCall) Fields(s ...googleapi.Field) *ZonesGetCall {
  57492. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57493. return c
  57494. }
  57495. // IfNoneMatch sets the optional parameter which makes the operation
  57496. // fail if the object's ETag matches the given value. This is useful for
  57497. // getting updates only after the object has changed since the last
  57498. // request. Use googleapi.IsNotModified to check whether the response
  57499. // error from Do is the result of In-None-Match.
  57500. func (c *ZonesGetCall) IfNoneMatch(entityTag string) *ZonesGetCall {
  57501. c.ifNoneMatch_ = entityTag
  57502. return c
  57503. }
  57504. // Context sets the context to be used in this call's Do method. Any
  57505. // pending HTTP request will be aborted if the provided context is
  57506. // canceled.
  57507. func (c *ZonesGetCall) Context(ctx context.Context) *ZonesGetCall {
  57508. c.ctx_ = ctx
  57509. return c
  57510. }
  57511. // Header returns an http.Header that can be modified by the caller to
  57512. // add HTTP headers to the request.
  57513. func (c *ZonesGetCall) Header() http.Header {
  57514. if c.header_ == nil {
  57515. c.header_ = make(http.Header)
  57516. }
  57517. return c.header_
  57518. }
  57519. func (c *ZonesGetCall) doRequest(alt string) (*http.Response, error) {
  57520. reqHeaders := make(http.Header)
  57521. for k, v := range c.header_ {
  57522. reqHeaders[k] = v
  57523. }
  57524. reqHeaders.Set("User-Agent", c.s.userAgent())
  57525. if c.ifNoneMatch_ != "" {
  57526. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  57527. }
  57528. var body io.Reader = nil
  57529. c.urlParams_.Set("alt", alt)
  57530. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}")
  57531. urls += "?" + c.urlParams_.Encode()
  57532. req, _ := http.NewRequest("GET", urls, body)
  57533. req.Header = reqHeaders
  57534. googleapi.Expand(req.URL, map[string]string{
  57535. "project": c.project,
  57536. "zone": c.zone,
  57537. })
  57538. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57539. }
  57540. // Do executes the "compute.zones.get" call.
  57541. // Exactly one of *Zone or error will be non-nil. Any non-2xx status
  57542. // code is an error. Response headers are in either
  57543. // *Zone.ServerResponse.Header or (if a response was returned at all) in
  57544. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  57545. // whether the returned error was because http.StatusNotModified was
  57546. // returned.
  57547. func (c *ZonesGetCall) Do(opts ...googleapi.CallOption) (*Zone, error) {
  57548. gensupport.SetOptions(c.urlParams_, opts...)
  57549. res, err := c.doRequest("json")
  57550. if res != nil && res.StatusCode == http.StatusNotModified {
  57551. if res.Body != nil {
  57552. res.Body.Close()
  57553. }
  57554. return nil, &googleapi.Error{
  57555. Code: res.StatusCode,
  57556. Header: res.Header,
  57557. }
  57558. }
  57559. if err != nil {
  57560. return nil, err
  57561. }
  57562. defer googleapi.CloseBody(res)
  57563. if err := googleapi.CheckResponse(res); err != nil {
  57564. return nil, err
  57565. }
  57566. ret := &Zone{
  57567. ServerResponse: googleapi.ServerResponse{
  57568. Header: res.Header,
  57569. HTTPStatusCode: res.StatusCode,
  57570. },
  57571. }
  57572. target := &ret
  57573. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  57574. return nil, err
  57575. }
  57576. return ret, nil
  57577. // {
  57578. // "description": "Returns the specified Zone resource. Get a list of available zones by making a list() request.",
  57579. // "httpMethod": "GET",
  57580. // "id": "compute.zones.get",
  57581. // "parameterOrder": [
  57582. // "project",
  57583. // "zone"
  57584. // ],
  57585. // "parameters": {
  57586. // "project": {
  57587. // "description": "Project ID for this request.",
  57588. // "location": "path",
  57589. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57590. // "required": true,
  57591. // "type": "string"
  57592. // },
  57593. // "zone": {
  57594. // "description": "Name of the zone resource to return.",
  57595. // "location": "path",
  57596. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  57597. // "required": true,
  57598. // "type": "string"
  57599. // }
  57600. // },
  57601. // "path": "{project}/zones/{zone}",
  57602. // "response": {
  57603. // "$ref": "Zone"
  57604. // },
  57605. // "scopes": [
  57606. // "https://www.googleapis.com/auth/cloud-platform",
  57607. // "https://www.googleapis.com/auth/compute",
  57608. // "https://www.googleapis.com/auth/compute.readonly"
  57609. // ]
  57610. // }
  57611. }
  57612. // method id "compute.zones.list":
  57613. type ZonesListCall struct {
  57614. s *Service
  57615. project string
  57616. urlParams_ gensupport.URLParams
  57617. ifNoneMatch_ string
  57618. ctx_ context.Context
  57619. header_ http.Header
  57620. }
  57621. // List: Retrieves the list of Zone resources available to the specified
  57622. // project.
  57623. // For details, see https://cloud.google.com/compute/docs/reference/latest/zones/list
  57624. func (r *ZonesService) List(project string) *ZonesListCall {
  57625. c := &ZonesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57626. c.project = project
  57627. return c
  57628. }
  57629. // Filter sets the optional parameter "filter": Sets a filter
  57630. // {expression} for filtering listed resources. Your {expression} must
  57631. // be in the format: field_name comparison_string literal_string.
  57632. //
  57633. // The field_name is the name of the field you want to compare. Only
  57634. // atomic field types are supported (string, number, boolean). The
  57635. // comparison_string must be either eq (equals) or ne (not equals). The
  57636. // literal_string is the string value to filter to. The literal value
  57637. // must be valid for the type of field you are filtering by (string,
  57638. // number, boolean). For string fields, the literal value is interpreted
  57639. // as a regular expression using RE2 syntax. The literal value must
  57640. // match the entire field.
  57641. //
  57642. // For example, to filter for instances that do not have a name of
  57643. // example-instance, you would use name ne example-instance.
  57644. //
  57645. // You can filter on nested fields. For example, you could filter on
  57646. // instances that have set the scheduling.automaticRestart field to
  57647. // true. Use filtering on nested fields to take advantage of labels to
  57648. // organize and search for results based on label values.
  57649. //
  57650. // To filter on multiple expressions, provide each separate expression
  57651. // within parentheses. For example, (scheduling.automaticRestart eq
  57652. // true) (zone eq us-central1-f). Multiple expressions are treated as
  57653. // AND expressions, meaning that resources must match all expressions to
  57654. // pass the filters.
  57655. func (c *ZonesListCall) Filter(filter string) *ZonesListCall {
  57656. c.urlParams_.Set("filter", filter)
  57657. return c
  57658. }
  57659. // MaxResults sets the optional parameter "maxResults": The maximum
  57660. // number of results per page that should be returned. If the number of
  57661. // available results is larger than maxResults, Compute Engine returns a
  57662. // nextPageToken that can be used to get the next page of results in
  57663. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  57664. // (Default: 500)
  57665. func (c *ZonesListCall) MaxResults(maxResults int64) *ZonesListCall {
  57666. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  57667. return c
  57668. }
  57669. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  57670. // a certain order. By default, results are returned in alphanumerical
  57671. // order based on the resource name.
  57672. //
  57673. // You can also sort results in descending order based on the creation
  57674. // timestamp using orderBy="creationTimestamp desc". This sorts results
  57675. // based on the creationTimestamp field in reverse chronological order
  57676. // (newest result first). Use this to sort resources like operations so
  57677. // that the newest operation is returned first.
  57678. //
  57679. // Currently, only sorting by name or creationTimestamp desc is
  57680. // supported.
  57681. func (c *ZonesListCall) OrderBy(orderBy string) *ZonesListCall {
  57682. c.urlParams_.Set("orderBy", orderBy)
  57683. return c
  57684. }
  57685. // PageToken sets the optional parameter "pageToken": Specifies a page
  57686. // token to use. Set pageToken to the nextPageToken returned by a
  57687. // previous list request to get the next page of results.
  57688. func (c *ZonesListCall) PageToken(pageToken string) *ZonesListCall {
  57689. c.urlParams_.Set("pageToken", pageToken)
  57690. return c
  57691. }
  57692. // Fields allows partial responses to be retrieved. See
  57693. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57694. // for more information.
  57695. func (c *ZonesListCall) Fields(s ...googleapi.Field) *ZonesListCall {
  57696. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57697. return c
  57698. }
  57699. // IfNoneMatch sets the optional parameter which makes the operation
  57700. // fail if the object's ETag matches the given value. This is useful for
  57701. // getting updates only after the object has changed since the last
  57702. // request. Use googleapi.IsNotModified to check whether the response
  57703. // error from Do is the result of In-None-Match.
  57704. func (c *ZonesListCall) IfNoneMatch(entityTag string) *ZonesListCall {
  57705. c.ifNoneMatch_ = entityTag
  57706. return c
  57707. }
  57708. // Context sets the context to be used in this call's Do method. Any
  57709. // pending HTTP request will be aborted if the provided context is
  57710. // canceled.
  57711. func (c *ZonesListCall) Context(ctx context.Context) *ZonesListCall {
  57712. c.ctx_ = ctx
  57713. return c
  57714. }
  57715. // Header returns an http.Header that can be modified by the caller to
  57716. // add HTTP headers to the request.
  57717. func (c *ZonesListCall) Header() http.Header {
  57718. if c.header_ == nil {
  57719. c.header_ = make(http.Header)
  57720. }
  57721. return c.header_
  57722. }
  57723. func (c *ZonesListCall) doRequest(alt string) (*http.Response, error) {
  57724. reqHeaders := make(http.Header)
  57725. for k, v := range c.header_ {
  57726. reqHeaders[k] = v
  57727. }
  57728. reqHeaders.Set("User-Agent", c.s.userAgent())
  57729. if c.ifNoneMatch_ != "" {
  57730. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  57731. }
  57732. var body io.Reader = nil
  57733. c.urlParams_.Set("alt", alt)
  57734. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones")
  57735. urls += "?" + c.urlParams_.Encode()
  57736. req, _ := http.NewRequest("GET", urls, body)
  57737. req.Header = reqHeaders
  57738. googleapi.Expand(req.URL, map[string]string{
  57739. "project": c.project,
  57740. })
  57741. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57742. }
  57743. // Do executes the "compute.zones.list" call.
  57744. // Exactly one of *ZoneList or error will be non-nil. Any non-2xx status
  57745. // code is an error. Response headers are in either
  57746. // *ZoneList.ServerResponse.Header or (if a response was returned at
  57747. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  57748. // to check whether the returned error was because
  57749. // http.StatusNotModified was returned.
  57750. func (c *ZonesListCall) Do(opts ...googleapi.CallOption) (*ZoneList, error) {
  57751. gensupport.SetOptions(c.urlParams_, opts...)
  57752. res, err := c.doRequest("json")
  57753. if res != nil && res.StatusCode == http.StatusNotModified {
  57754. if res.Body != nil {
  57755. res.Body.Close()
  57756. }
  57757. return nil, &googleapi.Error{
  57758. Code: res.StatusCode,
  57759. Header: res.Header,
  57760. }
  57761. }
  57762. if err != nil {
  57763. return nil, err
  57764. }
  57765. defer googleapi.CloseBody(res)
  57766. if err := googleapi.CheckResponse(res); err != nil {
  57767. return nil, err
  57768. }
  57769. ret := &ZoneList{
  57770. ServerResponse: googleapi.ServerResponse{
  57771. Header: res.Header,
  57772. HTTPStatusCode: res.StatusCode,
  57773. },
  57774. }
  57775. target := &ret
  57776. if err := json.NewDecoder(res.Body).Decode(target); err != nil {
  57777. return nil, err
  57778. }
  57779. return ret, nil
  57780. // {
  57781. // "description": "Retrieves the list of Zone resources available to the specified project.",
  57782. // "httpMethod": "GET",
  57783. // "id": "compute.zones.list",
  57784. // "parameterOrder": [
  57785. // "project"
  57786. // ],
  57787. // "parameters": {
  57788. // "filter": {
  57789. // "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  57790. // "location": "query",
  57791. // "type": "string"
  57792. // },
  57793. // "maxResults": {
  57794. // "default": "500",
  57795. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  57796. // "format": "uint32",
  57797. // "location": "query",
  57798. // "minimum": "0",
  57799. // "type": "integer"
  57800. // },
  57801. // "orderBy": {
  57802. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  57803. // "location": "query",
  57804. // "type": "string"
  57805. // },
  57806. // "pageToken": {
  57807. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  57808. // "location": "query",
  57809. // "type": "string"
  57810. // },
  57811. // "project": {
  57812. // "description": "Project ID for this request.",
  57813. // "location": "path",
  57814. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57815. // "required": true,
  57816. // "type": "string"
  57817. // }
  57818. // },
  57819. // "path": "{project}/zones",
  57820. // "response": {
  57821. // "$ref": "ZoneList"
  57822. // },
  57823. // "scopes": [
  57824. // "https://www.googleapis.com/auth/cloud-platform",
  57825. // "https://www.googleapis.com/auth/compute",
  57826. // "https://www.googleapis.com/auth/compute.readonly"
  57827. // ]
  57828. // }
  57829. }
  57830. // Pages invokes f for each page of results.
  57831. // A non-nil error returned from f will halt the iteration.
  57832. // The provided context supersedes any context provided to the Context method.
  57833. func (c *ZonesListCall) Pages(ctx context.Context, f func(*ZoneList) error) error {
  57834. c.ctx_ = ctx
  57835. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  57836. for {
  57837. x, err := c.Do()
  57838. if err != nil {
  57839. return err
  57840. }
  57841. if err := f(x); err != nil {
  57842. return err
  57843. }
  57844. if x.NextPageToken == "" {
  57845. return nil
  57846. }
  57847. c.PageToken(x.NextPageToken)
  57848. }
  57849. }