compute-gen.go 1.5 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005350063500735008350093501035011350123501335014350153501635017350183501935020350213502235023350243502535026350273502835029350303503135032350333503435035350363503735038350393504035041350423504335044350453504635047350483504935050350513505235053350543505535056350573505835059350603506135062350633506435065350663506735068350693507035071350723507335074350753507635077350783507935080350813508235083350843508535086350873508835089350903509135092350933509435095350963509735098350993510035101351023510335104351053510635107351083510935110351113511235113351143511535116351173511835119351203512135122351233512435125351263512735128351293513035131351323513335134351353513635137351383513935140351413514235143351443514535146351473514835149351503515135152351533515435155351563515735158351593516035161351623516335164351653516635167351683516935170351713517235173351743517535176351773517835179351803518135182351833518435185351863518735188351893519035191351923519335194351953519635197351983519935200352013520235203352043520535206352073520835209352103521135212352133521435215352163521735218352193522035221352223522335224352253522635227352283522935230352313523235233352343523535236352373523835239352403524135242352433524435245352463524735248352493525035251352523525335254352553525635257352583525935260352613526235263352643526535266352673526835269352703527135272352733527435275352763527735278352793528035281352823528335284352853528635287352883528935290352913529235293352943529535296352973529835299353003530135302353033530435305353063530735308353093531035311353123531335314353153531635317353183531935320353213532235323353243532535326353273532835329353303533135332353333533435335353363533735338353393534035341353423534335344353453534635347353483534935350353513535235353353543535535356353573535835359353603536135362353633536435365353663536735368353693537035371353723537335374353753537635377353783537935380353813538235383353843538535386353873538835389353903539135392353933539435395353963539735398353993540035401354023540335404354053540635407354083540935410354113541235413354143541535416354173541835419354203542135422354233542435425354263542735428354293543035431354323543335434354353543635437354383543935440354413544235443354443544535446354473544835449354503545135452354533545435455354563545735458354593546035461354623546335464354653546635467354683546935470354713547235473354743547535476354773547835479354803548135482354833548435485354863548735488354893549035491354923549335494354953549635497354983549935500355013550235503355043550535506355073550835509355103551135512355133551435515355163551735518355193552035521355223552335524355253552635527355283552935530355313553235533355343553535536355373553835539355403554135542355433554435545355463554735548355493555035551355523555335554355553555635557355583555935560355613556235563355643556535566355673556835569355703557135572355733557435575355763557735578355793558035581355823558335584355853558635587355883558935590355913559235593355943559535596355973559835599356003560135602356033560435605356063560735608356093561035611356123561335614356153561635617356183561935620356213562235623356243562535626356273562835629356303563135632356333563435635356363563735638356393564035641356423564335644356453564635647356483564935650356513565235653356543565535656356573565835659356603566135662356633566435665356663566735668356693567035671356723567335674356753567635677356783567935680356813568235683356843568535686356873568835689356903569135692356933569435695356963569735698356993570035701357023570335704357053570635707357083570935710357113571235713357143571535716357173571835719357203572135722357233572435725357263572735728357293573035731357323573335734357353573635737357383573935740357413574235743357443574535746357473574835749357503575135752357533575435755357563575735758357593576035761357623576335764357653576635767357683576935770357713577235773357743577535776357773577835779357803578135782357833578435785357863578735788357893579035791357923579335794357953579635797357983579935800358013580235803358043580535806358073580835809358103581135812358133581435815358163581735818358193582035821358223582335824358253582635827358283582935830358313583235833358343583535836358373583835839358403584135842358433584435845358463584735848358493585035851358523585335854358553585635857358583585935860358613586235863358643586535866358673586835869358703587135872358733587435875358763587735878358793588035881358823588335884358853588635887358883588935890358913589235893358943589535896358973589835899359003590135902359033590435905359063590735908359093591035911359123591335914359153591635917359183591935920359213592235923359243592535926359273592835929359303593135932359333593435935359363593735938359393594035941359423594335944359453594635947359483594935950359513595235953359543595535956359573595835959359603596135962359633596435965359663596735968359693597035971359723597335974359753597635977359783597935980359813598235983359843598535986359873598835989359903599135992359933599435995359963599735998359993600036001360023600336004360053600636007360083600936010360113601236013360143601536016360173601836019360203602136022360233602436025360263602736028360293603036031360323603336034360353603636037360383603936040360413604236043360443604536046360473604836049360503605136052360533605436055360563605736058360593606036061360623606336064360653606636067360683606936070360713607236073360743607536076360773607836079360803608136082360833608436085360863608736088360893609036091360923609336094360953609636097360983609936100361013610236103361043610536106361073610836109361103611136112361133611436115361163611736118361193612036121361223612336124361253612636127361283612936130361313613236133361343613536136361373613836139361403614136142361433614436145361463614736148361493615036151361523615336154361553615636157361583615936160361613616236163361643616536166361673616836169361703617136172361733617436175361763617736178361793618036181361823618336184361853618636187361883618936190361913619236193361943619536196361973619836199362003620136202362033620436205362063620736208362093621036211362123621336214362153621636217362183621936220362213622236223362243622536226362273622836229362303623136232362333623436235362363623736238362393624036241362423624336244362453624636247362483624936250362513625236253362543625536256362573625836259362603626136262362633626436265362663626736268362693627036271362723627336274362753627636277362783627936280362813628236283362843628536286362873628836289362903629136292362933629436295362963629736298362993630036301363023630336304363053630636307363083630936310363113631236313363143631536316363173631836319363203632136322363233632436325363263632736328363293633036331363323633336334363353633636337363383633936340363413634236343363443634536346363473634836349363503635136352363533635436355363563635736358363593636036361363623636336364363653636636367363683636936370363713637236373363743637536376363773637836379363803638136382363833638436385363863638736388363893639036391363923639336394363953639636397363983639936400364013640236403364043640536406364073640836409364103641136412364133641436415364163641736418364193642036421364223642336424364253642636427364283642936430364313643236433364343643536436364373643836439364403644136442364433644436445364463644736448364493645036451364523645336454364553645636457364583645936460364613646236463364643646536466364673646836469364703647136472364733647436475364763647736478364793648036481364823648336484364853648636487364883648936490364913649236493364943649536496364973649836499365003650136502365033650436505365063650736508365093651036511365123651336514365153651636517365183651936520365213652236523365243652536526365273652836529365303653136532365333653436535365363653736538365393654036541365423654336544365453654636547365483654936550365513655236553365543655536556365573655836559365603656136562365633656436565365663656736568365693657036571365723657336574365753657636577365783657936580365813658236583365843658536586365873658836589365903659136592365933659436595365963659736598365993660036601366023660336604366053660636607366083660936610366113661236613366143661536616366173661836619366203662136622366233662436625366263662736628366293663036631366323663336634366353663636637366383663936640366413664236643366443664536646366473664836649366503665136652366533665436655366563665736658366593666036661366623666336664366653666636667366683666936670366713667236673366743667536676366773667836679366803668136682366833668436685366863668736688366893669036691366923669336694366953669636697366983669936700367013670236703367043670536706367073670836709367103671136712367133671436715367163671736718367193672036721367223672336724367253672636727367283672936730367313673236733367343673536736367373673836739367403674136742367433674436745367463674736748367493675036751367523675336754367553675636757367583675936760367613676236763367643676536766367673676836769367703677136772367733677436775367763677736778367793678036781367823678336784367853678636787367883678936790367913679236793367943679536796367973679836799368003680136802368033680436805368063680736808368093681036811368123681336814368153681636817368183681936820368213682236823368243682536826368273682836829368303683136832368333683436835368363683736838368393684036841368423684336844368453684636847368483684936850368513685236853368543685536856368573685836859368603686136862368633686436865368663686736868368693687036871368723687336874368753687636877368783687936880368813688236883368843688536886368873688836889368903689136892368933689436895368963689736898368993690036901369023690336904369053690636907369083690936910369113691236913369143691536916369173691836919369203692136922369233692436925369263692736928369293693036931369323693336934369353693636937369383693936940369413694236943369443694536946369473694836949369503695136952369533695436955369563695736958369593696036961369623696336964369653696636967369683696936970369713697236973369743697536976369773697836979369803698136982369833698436985369863698736988369893699036991369923699336994369953699636997369983699937000370013700237003370043700537006370073700837009370103701137012370133701437015370163701737018370193702037021370223702337024370253702637027370283702937030370313703237033370343703537036370373703837039370403704137042370433704437045370463704737048370493705037051370523705337054370553705637057370583705937060370613706237063370643706537066370673706837069370703707137072370733707437075370763707737078370793708037081370823708337084370853708637087370883708937090370913709237093370943709537096370973709837099371003710137102371033710437105371063710737108371093711037111371123711337114371153711637117371183711937120371213712237123371243712537126371273712837129371303713137132371333713437135371363713737138371393714037141371423714337144371453714637147371483714937150371513715237153371543715537156371573715837159371603716137162371633716437165371663716737168371693717037171371723717337174371753717637177371783717937180371813718237183371843718537186371873718837189371903719137192371933719437195371963719737198371993720037201372023720337204372053720637207372083720937210372113721237213372143721537216372173721837219372203722137222372233722437225372263722737228372293723037231372323723337234372353723637237372383723937240372413724237243372443724537246372473724837249372503725137252372533725437255372563725737258372593726037261372623726337264372653726637267372683726937270372713727237273372743727537276372773727837279372803728137282372833728437285372863728737288372893729037291372923729337294372953729637297372983729937300373013730237303373043730537306373073730837309373103731137312373133731437315373163731737318373193732037321373223732337324373253732637327373283732937330373313733237333373343733537336373373733837339373403734137342373433734437345373463734737348373493735037351373523735337354373553735637357373583735937360373613736237363373643736537366373673736837369373703737137372373733737437375373763737737378373793738037381373823738337384373853738637387373883738937390373913739237393373943739537396373973739837399374003740137402374033740437405374063740737408374093741037411374123741337414374153741637417374183741937420374213742237423374243742537426374273742837429374303743137432374333743437435374363743737438374393744037441374423744337444374453744637447374483744937450374513745237453374543745537456374573745837459374603746137462374633746437465374663746737468374693747037471374723747337474374753747637477374783747937480374813748237483374843748537486374873748837489374903749137492374933749437495374963749737498374993750037501375023750337504375053750637507375083750937510375113751237513375143751537516375173751837519375203752137522375233752437525375263752737528375293753037531375323753337534375353753637537375383753937540375413754237543375443754537546375473754837549375503755137552375533755437555375563755737558375593756037561375623756337564375653756637567375683756937570375713757237573375743757537576375773757837579375803758137582375833758437585375863758737588375893759037591375923759337594375953759637597375983759937600376013760237603376043760537606376073760837609376103761137612376133761437615376163761737618376193762037621376223762337624376253762637627376283762937630376313763237633376343763537636376373763837639376403764137642376433764437645376463764737648376493765037651376523765337654376553765637657376583765937660376613766237663376643766537666376673766837669376703767137672376733767437675376763767737678376793768037681376823768337684376853768637687376883768937690376913769237693376943769537696376973769837699377003770137702377033770437705377063770737708377093771037711377123771337714377153771637717377183771937720377213772237723377243772537726377273772837729377303773137732377333773437735377363773737738377393774037741377423774337744377453774637747377483774937750377513775237753377543775537756377573775837759377603776137762377633776437765377663776737768377693777037771377723777337774377753777637777377783777937780377813778237783377843778537786377873778837789377903779137792377933779437795377963779737798377993780037801378023780337804378053780637807378083780937810378113781237813378143781537816378173781837819378203782137822378233782437825378263782737828378293783037831378323783337834378353783637837378383783937840378413784237843378443784537846378473784837849378503785137852378533785437855378563785737858378593786037861378623786337864378653786637867378683786937870378713787237873378743787537876378773787837879378803788137882378833788437885378863788737888378893789037891378923789337894378953789637897378983789937900379013790237903379043790537906379073790837909379103791137912379133791437915379163791737918379193792037921379223792337924379253792637927379283792937930379313793237933379343793537936379373793837939379403794137942379433794437945379463794737948379493795037951379523795337954379553795637957379583795937960379613796237963379643796537966379673796837969379703797137972379733797437975379763797737978379793798037981379823798337984379853798637987379883798937990379913799237993379943799537996379973799837999380003800138002380033800438005380063800738008380093801038011380123801338014380153801638017380183801938020380213802238023380243802538026380273802838029380303803138032380333803438035380363803738038380393804038041380423804338044380453804638047380483804938050380513805238053380543805538056380573805838059380603806138062380633806438065380663806738068380693807038071380723807338074380753807638077380783807938080380813808238083380843808538086380873808838089380903809138092380933809438095380963809738098380993810038101381023810338104381053810638107381083810938110381113811238113381143811538116381173811838119381203812138122381233812438125381263812738128381293813038131381323813338134381353813638137381383813938140381413814238143381443814538146381473814838149381503815138152381533815438155381563815738158381593816038161381623816338164381653816638167381683816938170381713817238173381743817538176381773817838179381803818138182381833818438185381863818738188381893819038191381923819338194381953819638197381983819938200382013820238203382043820538206382073820838209382103821138212382133821438215382163821738218382193822038221382223822338224382253822638227382283822938230382313823238233382343823538236382373823838239382403824138242382433824438245382463824738248382493825038251382523825338254382553825638257382583825938260382613826238263382643826538266382673826838269382703827138272382733827438275382763827738278382793828038281382823828338284382853828638287382883828938290382913829238293382943829538296382973829838299383003830138302383033830438305383063830738308383093831038311383123831338314383153831638317383183831938320383213832238323383243832538326383273832838329383303833138332383333833438335383363833738338383393834038341383423834338344383453834638347383483834938350383513835238353383543835538356383573835838359383603836138362383633836438365383663836738368383693837038371383723837338374383753837638377383783837938380383813838238383383843838538386383873838838389383903839138392383933839438395383963839738398383993840038401384023840338404384053840638407384083840938410384113841238413384143841538416384173841838419384203842138422384233842438425384263842738428384293843038431384323843338434384353843638437384383843938440384413844238443384443844538446384473844838449384503845138452384533845438455384563845738458384593846038461384623846338464384653846638467384683846938470384713847238473384743847538476384773847838479384803848138482384833848438485384863848738488384893849038491384923849338494384953849638497384983849938500385013850238503385043850538506385073850838509385103851138512385133851438515385163851738518385193852038521385223852338524385253852638527385283852938530385313853238533385343853538536385373853838539385403854138542385433854438545385463854738548385493855038551385523855338554385553855638557385583855938560385613856238563385643856538566385673856838569385703857138572385733857438575385763857738578385793858038581385823858338584385853858638587385883858938590385913859238593385943859538596385973859838599386003860138602386033860438605386063860738608386093861038611386123861338614386153861638617386183861938620386213862238623386243862538626386273862838629386303863138632386333863438635386363863738638386393864038641386423864338644386453864638647386483864938650386513865238653386543865538656386573865838659386603866138662386633866438665386663866738668386693867038671386723867338674386753867638677386783867938680386813868238683386843868538686386873868838689386903869138692386933869438695386963869738698386993870038701387023870338704387053870638707387083870938710387113871238713387143871538716387173871838719387203872138722387233872438725387263872738728387293873038731387323873338734387353873638737387383873938740387413874238743387443874538746387473874838749387503875138752387533875438755387563875738758387593876038761387623876338764387653876638767387683876938770387713877238773387743877538776387773877838779387803878138782387833878438785387863878738788387893879038791387923879338794387953879638797387983879938800388013880238803388043880538806388073880838809388103881138812388133881438815388163881738818388193882038821388223882338824388253882638827388283882938830388313883238833388343883538836388373883838839388403884138842388433884438845388463884738848388493885038851388523885338854388553885638857388583885938860388613886238863388643886538866388673886838869388703887138872388733887438875388763887738878388793888038881388823888338884388853888638887388883888938890388913889238893388943889538896388973889838899389003890138902389033890438905389063890738908389093891038911389123891338914389153891638917389183891938920389213892238923389243892538926389273892838929389303893138932389333893438935389363893738938389393894038941389423894338944389453894638947389483894938950389513895238953389543895538956389573895838959389603896138962389633896438965389663896738968389693897038971389723897338974389753897638977389783897938980389813898238983389843898538986389873898838989389903899138992389933899438995389963899738998389993900039001390023900339004390053900639007390083900939010390113901239013390143901539016390173901839019390203902139022390233902439025390263902739028390293903039031390323903339034390353903639037390383903939040390413904239043390443904539046390473904839049390503905139052390533905439055390563905739058390593906039061390623906339064390653906639067390683906939070390713907239073390743907539076390773907839079390803908139082390833908439085390863908739088390893909039091390923909339094390953909639097390983909939100391013910239103391043910539106391073910839109391103911139112391133911439115391163911739118391193912039121391223912339124391253912639127391283912939130391313913239133391343913539136391373913839139391403914139142391433914439145391463914739148391493915039151391523915339154391553915639157391583915939160391613916239163391643916539166391673916839169391703917139172391733917439175391763917739178391793918039181391823918339184391853918639187391883918939190391913919239193391943919539196391973919839199392003920139202392033920439205392063920739208392093921039211392123921339214392153921639217392183921939220392213922239223392243922539226392273922839229392303923139232392333923439235392363923739238392393924039241392423924339244392453924639247392483924939250392513925239253392543925539256392573925839259392603926139262392633926439265392663926739268392693927039271392723927339274392753927639277392783927939280392813928239283392843928539286392873928839289392903929139292392933929439295392963929739298392993930039301393023930339304393053930639307393083930939310393113931239313393143931539316393173931839319393203932139322393233932439325393263932739328393293933039331393323933339334393353933639337393383933939340393413934239343393443934539346393473934839349393503935139352393533935439355393563935739358393593936039361393623936339364393653936639367393683936939370393713937239373393743937539376393773937839379393803938139382393833938439385393863938739388393893939039391393923939339394393953939639397393983939939400394013940239403394043940539406394073940839409394103941139412394133941439415394163941739418394193942039421394223942339424394253942639427394283942939430394313943239433394343943539436394373943839439394403944139442394433944439445394463944739448394493945039451394523945339454394553945639457394583945939460394613946239463394643946539466394673946839469394703947139472394733947439475394763947739478394793948039481394823948339484394853948639487394883948939490394913949239493394943949539496394973949839499395003950139502395033950439505395063950739508395093951039511395123951339514395153951639517395183951939520395213952239523395243952539526395273952839529395303953139532395333953439535395363953739538395393954039541395423954339544395453954639547395483954939550395513955239553395543955539556395573955839559395603956139562395633956439565395663956739568395693957039571395723957339574395753957639577395783957939580395813958239583395843958539586395873958839589395903959139592395933959439595395963959739598395993960039601396023960339604396053960639607396083960939610396113961239613396143961539616396173961839619396203962139622396233962439625396263962739628396293963039631396323963339634396353963639637396383963939640396413964239643396443964539646396473964839649396503965139652396533965439655396563965739658396593966039661396623966339664396653966639667396683966939670396713967239673396743967539676396773967839679396803968139682396833968439685396863968739688396893969039691396923969339694396953969639697396983969939700397013970239703397043970539706397073970839709397103971139712397133971439715397163971739718397193972039721397223972339724397253972639727397283972939730397313973239733397343973539736397373973839739397403974139742397433974439745397463974739748397493975039751397523975339754397553975639757397583975939760397613976239763397643976539766397673976839769397703977139772397733977439775397763977739778397793978039781397823978339784397853978639787397883978939790397913979239793397943979539796397973979839799398003980139802398033980439805398063980739808398093981039811398123981339814398153981639817398183981939820398213982239823398243982539826398273982839829398303983139832398333983439835398363983739838398393984039841398423984339844398453984639847398483984939850398513985239853398543985539856398573985839859398603986139862398633986439865398663986739868398693987039871398723987339874398753987639877398783987939880398813988239883398843988539886398873988839889398903989139892398933989439895398963989739898398993990039901399023990339904399053990639907399083990939910399113991239913399143991539916399173991839919399203992139922399233992439925399263992739928399293993039931399323993339934399353993639937399383993939940399413994239943399443994539946399473994839949399503995139952399533995439955399563995739958399593996039961399623996339964399653996639967399683996939970399713997239973399743997539976399773997839979399803998139982399833998439985399863998739988399893999039991399923999339994399953999639997399983999940000400014000240003400044000540006400074000840009400104001140012400134001440015400164001740018400194002040021400224002340024400254002640027400284002940030400314003240033400344003540036400374003840039400404004140042400434004440045400464004740048400494005040051400524005340054400554005640057400584005940060400614006240063400644006540066400674006840069400704007140072400734007440075400764007740078400794008040081400824008340084400854008640087400884008940090400914009240093400944009540096400974009840099401004010140102401034010440105401064010740108401094011040111401124011340114401154011640117401184011940120401214012240123401244012540126401274012840129401304013140132401334013440135401364013740138401394014040141401424014340144401454014640147401484014940150401514015240153401544015540156401574015840159401604016140162401634016440165401664016740168401694017040171401724017340174401754017640177401784017940180401814018240183401844018540186401874018840189401904019140192401934019440195401964019740198401994020040201402024020340204402054020640207402084020940210402114021240213402144021540216402174021840219402204022140222402234022440225402264022740228402294023040231402324023340234402354023640237402384023940240402414024240243402444024540246402474024840249402504025140252402534025440255402564025740258402594026040261402624026340264402654026640267402684026940270402714027240273402744027540276402774027840279402804028140282402834028440285402864028740288402894029040291402924029340294402954029640297402984029940300403014030240303403044030540306403074030840309403104031140312403134031440315403164031740318403194032040321403224032340324403254032640327403284032940330403314033240333403344033540336403374033840339403404034140342403434034440345403464034740348403494035040351403524035340354403554035640357403584035940360403614036240363403644036540366403674036840369403704037140372403734037440375403764037740378403794038040381403824038340384403854038640387403884038940390403914039240393403944039540396403974039840399404004040140402404034040440405404064040740408404094041040411404124041340414404154041640417404184041940420404214042240423404244042540426404274042840429404304043140432404334043440435404364043740438404394044040441404424044340444404454044640447404484044940450404514045240453404544045540456404574045840459404604046140462404634046440465404664046740468404694047040471404724047340474404754047640477404784047940480404814048240483404844048540486404874048840489404904049140492404934049440495404964049740498404994050040501405024050340504405054050640507405084050940510405114051240513405144051540516405174051840519405204052140522405234052440525405264052740528405294053040531405324053340534405354053640537405384053940540405414054240543405444054540546405474054840549405504055140552405534055440555405564055740558405594056040561405624056340564405654056640567405684056940570405714057240573405744057540576405774057840579405804058140582405834058440585405864058740588405894059040591405924059340594405954059640597405984059940600406014060240603406044060540606406074060840609406104061140612406134061440615406164061740618406194062040621406224062340624406254062640627406284062940630406314063240633406344063540636406374063840639406404064140642406434064440645406464064740648406494065040651406524065340654406554065640657406584065940660406614066240663406644066540666406674066840669406704067140672406734067440675406764067740678406794068040681406824068340684406854068640687406884068940690406914069240693406944069540696406974069840699407004070140702407034070440705407064070740708407094071040711407124071340714407154071640717407184071940720407214072240723407244072540726407274072840729407304073140732407334073440735407364073740738407394074040741407424074340744407454074640747407484074940750407514075240753407544075540756407574075840759407604076140762407634076440765407664076740768407694077040771407724077340774407754077640777407784077940780407814078240783407844078540786407874078840789407904079140792407934079440795407964079740798407994080040801408024080340804408054080640807408084080940810408114081240813408144081540816408174081840819408204082140822408234082440825408264082740828408294083040831408324083340834408354083640837408384083940840408414084240843408444084540846408474084840849408504085140852408534085440855408564085740858408594086040861408624086340864408654086640867408684086940870408714087240873408744087540876408774087840879408804088140882408834088440885408864088740888408894089040891408924089340894408954089640897408984089940900409014090240903409044090540906409074090840909409104091140912409134091440915409164091740918409194092040921409224092340924409254092640927409284092940930409314093240933409344093540936409374093840939409404094140942409434094440945409464094740948409494095040951409524095340954409554095640957409584095940960409614096240963409644096540966409674096840969409704097140972409734097440975409764097740978409794098040981409824098340984409854098640987409884098940990409914099240993409944099540996409974099840999410004100141002410034100441005410064100741008410094101041011410124101341014410154101641017410184101941020410214102241023410244102541026410274102841029410304103141032410334103441035410364103741038410394104041041410424104341044410454104641047410484104941050410514105241053410544105541056410574105841059410604106141062410634106441065410664106741068410694107041071410724107341074410754107641077410784107941080410814108241083410844108541086410874108841089410904109141092410934109441095410964109741098410994110041101411024110341104411054110641107411084110941110411114111241113411144111541116411174111841119411204112141122411234112441125411264112741128411294113041131411324113341134411354113641137411384113941140411414114241143411444114541146411474114841149411504115141152411534115441155411564115741158411594116041161411624116341164411654116641167411684116941170411714117241173411744117541176411774117841179411804118141182411834118441185411864118741188411894119041191411924119341194411954119641197411984119941200412014120241203412044120541206412074120841209412104121141212412134121441215412164121741218412194122041221412224122341224412254122641227412284122941230412314123241233412344123541236412374123841239412404124141242412434124441245412464124741248412494125041251412524125341254412554125641257412584125941260412614126241263412644126541266412674126841269412704127141272412734127441275412764127741278412794128041281412824128341284412854128641287412884128941290412914129241293412944129541296412974129841299413004130141302413034130441305413064130741308413094131041311413124131341314413154131641317413184131941320413214132241323413244132541326413274132841329413304133141332413334133441335413364133741338413394134041341413424134341344413454134641347413484134941350413514135241353413544135541356413574135841359413604136141362413634136441365413664136741368413694137041371413724137341374413754137641377413784137941380413814138241383413844138541386413874138841389413904139141392413934139441395413964139741398
  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/v0.beta"
  8. // ...
  9. // computeService, err := compute.New(oauthHttpClient)
  10. package compute // import "google.golang.org/api/compute/v0.beta"
  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:beta"
  41. const apiName = "compute"
  42. const apiVersion = "beta"
  43. const basePath = "https://www.googleapis.com/compute/beta/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.BackendServices = NewBackendServicesService(s)
  67. s.DiskTypes = NewDiskTypesService(s)
  68. s.Disks = NewDisksService(s)
  69. s.Firewalls = NewFirewallsService(s)
  70. s.ForwardingRules = NewForwardingRulesService(s)
  71. s.GlobalAddresses = NewGlobalAddressesService(s)
  72. s.GlobalForwardingRules = NewGlobalForwardingRulesService(s)
  73. s.GlobalOperations = NewGlobalOperationsService(s)
  74. s.HttpHealthChecks = NewHttpHealthChecksService(s)
  75. s.HttpsHealthChecks = NewHttpsHealthChecksService(s)
  76. s.Images = NewImagesService(s)
  77. s.InstanceGroupManagers = NewInstanceGroupManagersService(s)
  78. s.InstanceGroups = NewInstanceGroupsService(s)
  79. s.InstanceTemplates = NewInstanceTemplatesService(s)
  80. s.Instances = NewInstancesService(s)
  81. s.Licenses = NewLicensesService(s)
  82. s.MachineTypes = NewMachineTypesService(s)
  83. s.Networks = NewNetworksService(s)
  84. s.Projects = NewProjectsService(s)
  85. s.RegionOperations = NewRegionOperationsService(s)
  86. s.Regions = NewRegionsService(s)
  87. s.Routes = NewRoutesService(s)
  88. s.Snapshots = NewSnapshotsService(s)
  89. s.SslCertificates = NewSslCertificatesService(s)
  90. s.Subnetworks = NewSubnetworksService(s)
  91. s.TargetHttpProxies = NewTargetHttpProxiesService(s)
  92. s.TargetHttpsProxies = NewTargetHttpsProxiesService(s)
  93. s.TargetInstances = NewTargetInstancesService(s)
  94. s.TargetPools = NewTargetPoolsService(s)
  95. s.TargetVpnGateways = NewTargetVpnGatewaysService(s)
  96. s.UrlMaps = NewUrlMapsService(s)
  97. s.VpnTunnels = NewVpnTunnelsService(s)
  98. s.ZoneOperations = NewZoneOperationsService(s)
  99. s.Zones = NewZonesService(s)
  100. return s, nil
  101. }
  102. type Service struct {
  103. client *http.Client
  104. BasePath string // API endpoint base URL
  105. UserAgent string // optional additional User-Agent fragment
  106. Addresses *AddressesService
  107. Autoscalers *AutoscalersService
  108. BackendServices *BackendServicesService
  109. DiskTypes *DiskTypesService
  110. Disks *DisksService
  111. Firewalls *FirewallsService
  112. ForwardingRules *ForwardingRulesService
  113. GlobalAddresses *GlobalAddressesService
  114. GlobalForwardingRules *GlobalForwardingRulesService
  115. GlobalOperations *GlobalOperationsService
  116. HttpHealthChecks *HttpHealthChecksService
  117. HttpsHealthChecks *HttpsHealthChecksService
  118. Images *ImagesService
  119. InstanceGroupManagers *InstanceGroupManagersService
  120. InstanceGroups *InstanceGroupsService
  121. InstanceTemplates *InstanceTemplatesService
  122. Instances *InstancesService
  123. Licenses *LicensesService
  124. MachineTypes *MachineTypesService
  125. Networks *NetworksService
  126. Projects *ProjectsService
  127. RegionOperations *RegionOperationsService
  128. Regions *RegionsService
  129. Routes *RoutesService
  130. Snapshots *SnapshotsService
  131. SslCertificates *SslCertificatesService
  132. Subnetworks *SubnetworksService
  133. TargetHttpProxies *TargetHttpProxiesService
  134. TargetHttpsProxies *TargetHttpsProxiesService
  135. TargetInstances *TargetInstancesService
  136. TargetPools *TargetPoolsService
  137. TargetVpnGateways *TargetVpnGatewaysService
  138. UrlMaps *UrlMapsService
  139. VpnTunnels *VpnTunnelsService
  140. ZoneOperations *ZoneOperationsService
  141. Zones *ZonesService
  142. }
  143. func (s *Service) userAgent() string {
  144. if s.UserAgent == "" {
  145. return googleapi.UserAgent
  146. }
  147. return googleapi.UserAgent + " " + s.UserAgent
  148. }
  149. func NewAddressesService(s *Service) *AddressesService {
  150. rs := &AddressesService{s: s}
  151. return rs
  152. }
  153. type AddressesService struct {
  154. s *Service
  155. }
  156. func NewAutoscalersService(s *Service) *AutoscalersService {
  157. rs := &AutoscalersService{s: s}
  158. return rs
  159. }
  160. type AutoscalersService struct {
  161. s *Service
  162. }
  163. func NewBackendServicesService(s *Service) *BackendServicesService {
  164. rs := &BackendServicesService{s: s}
  165. return rs
  166. }
  167. type BackendServicesService struct {
  168. s *Service
  169. }
  170. func NewDiskTypesService(s *Service) *DiskTypesService {
  171. rs := &DiskTypesService{s: s}
  172. return rs
  173. }
  174. type DiskTypesService struct {
  175. s *Service
  176. }
  177. func NewDisksService(s *Service) *DisksService {
  178. rs := &DisksService{s: s}
  179. return rs
  180. }
  181. type DisksService struct {
  182. s *Service
  183. }
  184. func NewFirewallsService(s *Service) *FirewallsService {
  185. rs := &FirewallsService{s: s}
  186. return rs
  187. }
  188. type FirewallsService struct {
  189. s *Service
  190. }
  191. func NewForwardingRulesService(s *Service) *ForwardingRulesService {
  192. rs := &ForwardingRulesService{s: s}
  193. return rs
  194. }
  195. type ForwardingRulesService struct {
  196. s *Service
  197. }
  198. func NewGlobalAddressesService(s *Service) *GlobalAddressesService {
  199. rs := &GlobalAddressesService{s: s}
  200. return rs
  201. }
  202. type GlobalAddressesService struct {
  203. s *Service
  204. }
  205. func NewGlobalForwardingRulesService(s *Service) *GlobalForwardingRulesService {
  206. rs := &GlobalForwardingRulesService{s: s}
  207. return rs
  208. }
  209. type GlobalForwardingRulesService struct {
  210. s *Service
  211. }
  212. func NewGlobalOperationsService(s *Service) *GlobalOperationsService {
  213. rs := &GlobalOperationsService{s: s}
  214. return rs
  215. }
  216. type GlobalOperationsService struct {
  217. s *Service
  218. }
  219. func NewHttpHealthChecksService(s *Service) *HttpHealthChecksService {
  220. rs := &HttpHealthChecksService{s: s}
  221. return rs
  222. }
  223. type HttpHealthChecksService struct {
  224. s *Service
  225. }
  226. func NewHttpsHealthChecksService(s *Service) *HttpsHealthChecksService {
  227. rs := &HttpsHealthChecksService{s: s}
  228. return rs
  229. }
  230. type HttpsHealthChecksService struct {
  231. s *Service
  232. }
  233. func NewImagesService(s *Service) *ImagesService {
  234. rs := &ImagesService{s: s}
  235. return rs
  236. }
  237. type ImagesService struct {
  238. s *Service
  239. }
  240. func NewInstanceGroupManagersService(s *Service) *InstanceGroupManagersService {
  241. rs := &InstanceGroupManagersService{s: s}
  242. return rs
  243. }
  244. type InstanceGroupManagersService struct {
  245. s *Service
  246. }
  247. func NewInstanceGroupsService(s *Service) *InstanceGroupsService {
  248. rs := &InstanceGroupsService{s: s}
  249. return rs
  250. }
  251. type InstanceGroupsService struct {
  252. s *Service
  253. }
  254. func NewInstanceTemplatesService(s *Service) *InstanceTemplatesService {
  255. rs := &InstanceTemplatesService{s: s}
  256. return rs
  257. }
  258. type InstanceTemplatesService struct {
  259. s *Service
  260. }
  261. func NewInstancesService(s *Service) *InstancesService {
  262. rs := &InstancesService{s: s}
  263. return rs
  264. }
  265. type InstancesService struct {
  266. s *Service
  267. }
  268. func NewLicensesService(s *Service) *LicensesService {
  269. rs := &LicensesService{s: s}
  270. return rs
  271. }
  272. type LicensesService struct {
  273. s *Service
  274. }
  275. func NewMachineTypesService(s *Service) *MachineTypesService {
  276. rs := &MachineTypesService{s: s}
  277. return rs
  278. }
  279. type MachineTypesService struct {
  280. s *Service
  281. }
  282. func NewNetworksService(s *Service) *NetworksService {
  283. rs := &NetworksService{s: s}
  284. return rs
  285. }
  286. type NetworksService struct {
  287. s *Service
  288. }
  289. func NewProjectsService(s *Service) *ProjectsService {
  290. rs := &ProjectsService{s: s}
  291. return rs
  292. }
  293. type ProjectsService struct {
  294. s *Service
  295. }
  296. func NewRegionOperationsService(s *Service) *RegionOperationsService {
  297. rs := &RegionOperationsService{s: s}
  298. return rs
  299. }
  300. type RegionOperationsService struct {
  301. s *Service
  302. }
  303. func NewRegionsService(s *Service) *RegionsService {
  304. rs := &RegionsService{s: s}
  305. return rs
  306. }
  307. type RegionsService struct {
  308. s *Service
  309. }
  310. func NewRoutesService(s *Service) *RoutesService {
  311. rs := &RoutesService{s: s}
  312. return rs
  313. }
  314. type RoutesService struct {
  315. s *Service
  316. }
  317. func NewSnapshotsService(s *Service) *SnapshotsService {
  318. rs := &SnapshotsService{s: s}
  319. return rs
  320. }
  321. type SnapshotsService struct {
  322. s *Service
  323. }
  324. func NewSslCertificatesService(s *Service) *SslCertificatesService {
  325. rs := &SslCertificatesService{s: s}
  326. return rs
  327. }
  328. type SslCertificatesService struct {
  329. s *Service
  330. }
  331. func NewSubnetworksService(s *Service) *SubnetworksService {
  332. rs := &SubnetworksService{s: s}
  333. return rs
  334. }
  335. type SubnetworksService struct {
  336. s *Service
  337. }
  338. func NewTargetHttpProxiesService(s *Service) *TargetHttpProxiesService {
  339. rs := &TargetHttpProxiesService{s: s}
  340. return rs
  341. }
  342. type TargetHttpProxiesService struct {
  343. s *Service
  344. }
  345. func NewTargetHttpsProxiesService(s *Service) *TargetHttpsProxiesService {
  346. rs := &TargetHttpsProxiesService{s: s}
  347. return rs
  348. }
  349. type TargetHttpsProxiesService struct {
  350. s *Service
  351. }
  352. func NewTargetInstancesService(s *Service) *TargetInstancesService {
  353. rs := &TargetInstancesService{s: s}
  354. return rs
  355. }
  356. type TargetInstancesService struct {
  357. s *Service
  358. }
  359. func NewTargetPoolsService(s *Service) *TargetPoolsService {
  360. rs := &TargetPoolsService{s: s}
  361. return rs
  362. }
  363. type TargetPoolsService struct {
  364. s *Service
  365. }
  366. func NewTargetVpnGatewaysService(s *Service) *TargetVpnGatewaysService {
  367. rs := &TargetVpnGatewaysService{s: s}
  368. return rs
  369. }
  370. type TargetVpnGatewaysService struct {
  371. s *Service
  372. }
  373. func NewUrlMapsService(s *Service) *UrlMapsService {
  374. rs := &UrlMapsService{s: s}
  375. return rs
  376. }
  377. type UrlMapsService struct {
  378. s *Service
  379. }
  380. func NewVpnTunnelsService(s *Service) *VpnTunnelsService {
  381. rs := &VpnTunnelsService{s: s}
  382. return rs
  383. }
  384. type VpnTunnelsService struct {
  385. s *Service
  386. }
  387. func NewZoneOperationsService(s *Service) *ZoneOperationsService {
  388. rs := &ZoneOperationsService{s: s}
  389. return rs
  390. }
  391. type ZoneOperationsService struct {
  392. s *Service
  393. }
  394. func NewZonesService(s *Service) *ZonesService {
  395. rs := &ZonesService{s: s}
  396. return rs
  397. }
  398. type ZonesService struct {
  399. s *Service
  400. }
  401. // AccessConfig: An access configuration attached to an instance's
  402. // network interface.
  403. type AccessConfig struct {
  404. // Kind: [Output Only] Type of the resource. Always compute#accessConfig
  405. // for access configs.
  406. Kind string `json:"kind,omitempty"`
  407. // Name: Name of this access configuration.
  408. Name string `json:"name,omitempty"`
  409. // NatIP: An external IP address associated with this instance. Specify
  410. // an unused static external IP address available to the project or
  411. // leave this field undefined to use an IP from a shared ephemeral IP
  412. // address pool. If you specify a static external IP address, it must
  413. // live in the same region as the zone of the instance.
  414. NatIP string `json:"natIP,omitempty"`
  415. // Type: The type of configuration. The default and only option is
  416. // ONE_TO_ONE_NAT.
  417. //
  418. // Possible values:
  419. // "ONE_TO_ONE_NAT" (default)
  420. Type string `json:"type,omitempty"`
  421. // ForceSendFields is a list of field names (e.g. "Kind") to
  422. // unconditionally include in API requests. By default, fields with
  423. // empty values are omitted from API requests. However, any non-pointer,
  424. // non-interface field appearing in ForceSendFields will be sent to the
  425. // server regardless of whether the field is empty or not. This may be
  426. // used to include empty fields in Patch requests.
  427. ForceSendFields []string `json:"-"`
  428. }
  429. func (s *AccessConfig) MarshalJSON() ([]byte, error) {
  430. type noMethod AccessConfig
  431. raw := noMethod(*s)
  432. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  433. }
  434. // Address: A reserved address resource.
  435. type Address struct {
  436. // Address: The static external IP address represented by this resource.
  437. Address string `json:"address,omitempty"`
  438. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  439. // format.
  440. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  441. // Description: An optional description of this resource. Provide this
  442. // property when you create the resource.
  443. Description string `json:"description,omitempty"`
  444. // Id: [Output Only] The unique identifier for the resource. This
  445. // identifier is defined by the server.
  446. Id uint64 `json:"id,omitempty,string"`
  447. // Kind: [Output Only] Type of the resource. Always compute#address for
  448. // addresses.
  449. Kind string `json:"kind,omitempty"`
  450. // Name: Name of the resource; provided by the client when the resource
  451. // is created. The name must be 1-63 characters long, and comply with
  452. // RFC1035. Specifically, the name must be 1-63 characters long and
  453. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  454. // the first character must be a lowercase letter, and all following
  455. // characters must be a dash, lowercase letter, or digit, except the
  456. // last character, which cannot be a dash.
  457. Name string `json:"name,omitempty"`
  458. // Region: [Output Only] URL of the region where the regional address
  459. // resides. This field is not applicable to global addresses.
  460. Region string `json:"region,omitempty"`
  461. // SelfLink: [Output Only] Server-defined URL for the resource.
  462. SelfLink string `json:"selfLink,omitempty"`
  463. // Status: [Output Only] The status of the address, which can be either
  464. // IN_USE or RESERVED. An address that is RESERVED is currently reserved
  465. // and available to use. An IN_USE address is currently being used by
  466. // another resource and is not available.
  467. //
  468. // Possible values:
  469. // "IN_USE"
  470. // "RESERVED"
  471. Status string `json:"status,omitempty"`
  472. // Users: [Output Only] The URLs of the resources that are using this
  473. // address.
  474. Users []string `json:"users,omitempty"`
  475. // ServerResponse contains the HTTP response code and headers from the
  476. // server.
  477. googleapi.ServerResponse `json:"-"`
  478. // ForceSendFields is a list of field names (e.g. "Address") to
  479. // unconditionally include in API requests. By default, fields with
  480. // empty values are omitted from API requests. However, any non-pointer,
  481. // non-interface field appearing in ForceSendFields will be sent to the
  482. // server regardless of whether the field is empty or not. This may be
  483. // used to include empty fields in Patch requests.
  484. ForceSendFields []string `json:"-"`
  485. }
  486. func (s *Address) MarshalJSON() ([]byte, error) {
  487. type noMethod Address
  488. raw := noMethod(*s)
  489. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  490. }
  491. type AddressAggregatedList struct {
  492. // Id: [Output Only] Unique identifier for the resource; defined by the
  493. // server.
  494. Id string `json:"id,omitempty"`
  495. // Items: [Output Only] A map of scoped address lists.
  496. Items map[string]AddressesScopedList `json:"items,omitempty"`
  497. // Kind: [Output Only] Type of resource. Always
  498. // compute#addressAggregatedList for aggregated lists of addresses.
  499. Kind string `json:"kind,omitempty"`
  500. // NextPageToken: [Output Only] This token allows you to get the next
  501. // page of results for list requests. If the number of results is larger
  502. // than maxResults, use the nextPageToken as a value for the query
  503. // parameter pageToken in the next list request. Subsequent list
  504. // requests will have their own nextPageToken to continue paging through
  505. // the results.
  506. NextPageToken string `json:"nextPageToken,omitempty"`
  507. // SelfLink: [Output Only] Server-defined URL for this resource.
  508. SelfLink string `json:"selfLink,omitempty"`
  509. // ServerResponse contains the HTTP response code and headers from the
  510. // server.
  511. googleapi.ServerResponse `json:"-"`
  512. // ForceSendFields is a list of field names (e.g. "Id") to
  513. // unconditionally include in API requests. By default, fields with
  514. // empty values are omitted from API requests. However, any non-pointer,
  515. // non-interface field appearing in ForceSendFields will be sent to the
  516. // server regardless of whether the field is empty or not. This may be
  517. // used to include empty fields in Patch requests.
  518. ForceSendFields []string `json:"-"`
  519. }
  520. func (s *AddressAggregatedList) MarshalJSON() ([]byte, error) {
  521. type noMethod AddressAggregatedList
  522. raw := noMethod(*s)
  523. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  524. }
  525. // AddressList: Contains a list of address resources.
  526. type AddressList struct {
  527. // Id: [Output Only] The unique identifier for the resource. This
  528. // identifier is defined by the server.
  529. Id string `json:"id,omitempty"`
  530. // Items: [Output Only] A list of Address resources.
  531. Items []*Address `json:"items,omitempty"`
  532. // Kind: [Output Only] Type of resource. Always compute#addressList for
  533. // lists of addresses.
  534. Kind string `json:"kind,omitempty"`
  535. // NextPageToken: [Output Only] This token allows you to get the next
  536. // page of results for list requests. If the number of results is larger
  537. // than maxResults, use the nextPageToken as a value for the query
  538. // parameter pageToken in the next list request. Subsequent list
  539. // requests will have their own nextPageToken to continue paging through
  540. // the results.
  541. NextPageToken string `json:"nextPageToken,omitempty"`
  542. // SelfLink: [Output Only] Server-defined URL for the resource.
  543. SelfLink string `json:"selfLink,omitempty"`
  544. // ServerResponse contains the HTTP response code and headers from the
  545. // server.
  546. googleapi.ServerResponse `json:"-"`
  547. // ForceSendFields is a list of field names (e.g. "Id") to
  548. // unconditionally include in API requests. By default, fields with
  549. // empty values are omitted from API requests. However, any non-pointer,
  550. // non-interface field appearing in ForceSendFields will be sent to the
  551. // server regardless of whether the field is empty or not. This may be
  552. // used to include empty fields in Patch requests.
  553. ForceSendFields []string `json:"-"`
  554. }
  555. func (s *AddressList) MarshalJSON() ([]byte, error) {
  556. type noMethod AddressList
  557. raw := noMethod(*s)
  558. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  559. }
  560. type AddressesScopedList struct {
  561. // Addresses: [Output Only] List of addresses contained in this scope.
  562. Addresses []*Address `json:"addresses,omitempty"`
  563. // Warning: [Output Only] Informational warning which replaces the list
  564. // of addresses when the list is empty.
  565. Warning *AddressesScopedListWarning `json:"warning,omitempty"`
  566. // ForceSendFields is a list of field names (e.g. "Addresses") to
  567. // unconditionally include in API requests. By default, fields with
  568. // empty values are omitted from API requests. However, any non-pointer,
  569. // non-interface field appearing in ForceSendFields will be sent to the
  570. // server regardless of whether the field is empty or not. This may be
  571. // used to include empty fields in Patch requests.
  572. ForceSendFields []string `json:"-"`
  573. }
  574. func (s *AddressesScopedList) MarshalJSON() ([]byte, error) {
  575. type noMethod AddressesScopedList
  576. raw := noMethod(*s)
  577. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  578. }
  579. // AddressesScopedListWarning: [Output Only] Informational warning which
  580. // replaces the list of addresses when the list is empty.
  581. type AddressesScopedListWarning struct {
  582. // Code: [Output Only] A warning code, if applicable. For example,
  583. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  584. // the response.
  585. //
  586. // Possible values:
  587. // "DEPRECATED_RESOURCE_USED"
  588. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  589. // "INJECTED_KERNELS_DEPRECATED"
  590. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  591. // "NEXT_HOP_CANNOT_IP_FORWARD"
  592. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  593. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  594. // "NEXT_HOP_NOT_RUNNING"
  595. // "NOT_CRITICAL_ERROR"
  596. // "NO_RESULTS_ON_PAGE"
  597. // "REQUIRED_TOS_AGREEMENT"
  598. // "RESOURCE_NOT_DELETED"
  599. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  600. // "UNREACHABLE"
  601. Code string `json:"code,omitempty"`
  602. // Data: [Output Only] Metadata about this warning in key: value format.
  603. // For example:
  604. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  605. Data []*AddressesScopedListWarningData `json:"data,omitempty"`
  606. // Message: [Output Only] A human-readable description of the warning
  607. // code.
  608. Message string `json:"message,omitempty"`
  609. // ForceSendFields is a list of field names (e.g. "Code") to
  610. // unconditionally include in API requests. By default, fields with
  611. // empty values are omitted from API requests. However, any non-pointer,
  612. // non-interface field appearing in ForceSendFields will be sent to the
  613. // server regardless of whether the field is empty or not. This may be
  614. // used to include empty fields in Patch requests.
  615. ForceSendFields []string `json:"-"`
  616. }
  617. func (s *AddressesScopedListWarning) MarshalJSON() ([]byte, error) {
  618. type noMethod AddressesScopedListWarning
  619. raw := noMethod(*s)
  620. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  621. }
  622. type AddressesScopedListWarningData struct {
  623. // Key: [Output Only] A key that provides more detail on the warning
  624. // being returned. For example, for warnings where there are no results
  625. // in a list request for a particular zone, this key might be scope and
  626. // the key value might be the zone name. Other examples might be a key
  627. // indicating a deprecated resource, and a suggested replacement, or a
  628. // warning about invalid network settings (for example, if an instance
  629. // attempts to perform IP forwarding but is not enabled for IP
  630. // forwarding).
  631. Key string `json:"key,omitempty"`
  632. // Value: [Output Only] A warning data value corresponding to the key.
  633. Value string `json:"value,omitempty"`
  634. // ForceSendFields is a list of field names (e.g. "Key") to
  635. // unconditionally include in API requests. By default, fields with
  636. // empty values are omitted from API requests. However, any non-pointer,
  637. // non-interface field appearing in ForceSendFields will be sent to the
  638. // server regardless of whether the field is empty or not. This may be
  639. // used to include empty fields in Patch requests.
  640. ForceSendFields []string `json:"-"`
  641. }
  642. func (s *AddressesScopedListWarningData) MarshalJSON() ([]byte, error) {
  643. type noMethod AddressesScopedListWarningData
  644. raw := noMethod(*s)
  645. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  646. }
  647. // AttachedDisk: An instance-attached disk resource.
  648. type AttachedDisk struct {
  649. // AutoDelete: Specifies whether the disk will be auto-deleted when the
  650. // instance is deleted (but not when the disk is detached from the
  651. // instance).
  652. AutoDelete bool `json:"autoDelete,omitempty"`
  653. // Boot: Indicates that this is a boot disk. The virtual machine will
  654. // use the first partition of the disk for its root filesystem.
  655. Boot bool `json:"boot,omitempty"`
  656. // DeviceName: Specifies a unique device name of your choice that is
  657. // reflected into the /dev/disk/by-id/google-* tree of a Linux operating
  658. // system running within the instance. This name can be used to
  659. // reference the device for mounting, resizing, and so on, from within
  660. // the instance.
  661. //
  662. // If not specified, the server chooses a default device name to apply
  663. // to this disk, in the form persistent-disks-x, where x is a number
  664. // assigned by Google Compute Engine. This field is only applicable for
  665. // persistent disks.
  666. DeviceName string `json:"deviceName,omitempty"`
  667. // DiskEncryptionKey: Encrypts or decrypts a disk using a
  668. // customer-supplied encryption key.
  669. //
  670. // If you are creating a new disk, this field encrypts the disk using a
  671. // customer-supplied encryption key. If you are attaching an existing
  672. // disk that is already encrypted, this field decrypts the disk using
  673. // the customer-supplied encryption key.
  674. //
  675. // If you encrypt a new disk using a customer-supplied encryption key,
  676. // you must provide the same key again when you attempt to use this
  677. // resource at a later time. For example, you must provide the key when
  678. // you create a snapshot or an image from the disk or when you attach
  679. // the disk to a virtual machine instance.
  680. //
  681. // If no customer-supplied encryption key is provided at creation, then
  682. // the disk will be encrypted using an automatically generated key and
  683. // you do not need to provide a key to use the disk later.
  684. DiskEncryptionKey *CustomerEncryptionKey `json:"diskEncryptionKey,omitempty"`
  685. // Index: Assigns a zero-based index to this disk, where 0 is reserved
  686. // for the boot disk. For example, if you have many disks attached to an
  687. // instance, each disk would have a unique index number. If not
  688. // specified, the server will choose an appropriate value.
  689. Index int64 `json:"index,omitempty"`
  690. // InitializeParams: [Input Only] Specifies the parameters for a new
  691. // disk that will be created alongside the new instance. Use
  692. // initialization parameters to create boot disks or local SSDs attached
  693. // to the new instance.
  694. //
  695. // This property is mutually exclusive with the source property; you can
  696. // only define one or the other, but not both.
  697. InitializeParams *AttachedDiskInitializeParams `json:"initializeParams,omitempty"`
  698. // Interface: Specifies the disk interface to use for attaching this
  699. // disk, either SCSI or NVME. The default is SCSI. For performance
  700. // characteristics of SCSI over NVMe, see Local SSD performance.
  701. //
  702. // Possible values:
  703. // "NVME"
  704. // "SCSI"
  705. Interface string `json:"interface,omitempty"`
  706. // Kind: [Output Only] Type of the resource. Always compute#attachedDisk
  707. // for attached disks.
  708. Kind string `json:"kind,omitempty"`
  709. // Licenses: [Output Only] Any valid publicly visible licenses.
  710. Licenses []string `json:"licenses,omitempty"`
  711. // Mode: The mode in which to attach this disk, either READ_WRITE or
  712. // READ_ONLY. If not specified, the default is to attach the disk in
  713. // READ_WRITE mode.
  714. //
  715. // Possible values:
  716. // "READ_ONLY"
  717. // "READ_WRITE"
  718. Mode string `json:"mode,omitempty"`
  719. // Source: Specifies a valid partial or full URL to an existing
  720. // Persistent Disk resource. This field is only applicable for
  721. // persistent disks.
  722. Source string `json:"source,omitempty"`
  723. // Type: Specifies the type of the disk, either SCRATCH or PERSISTENT.
  724. // If not specified, the default is PERSISTENT.
  725. //
  726. // Possible values:
  727. // "PERSISTENT"
  728. // "SCRATCH"
  729. Type string `json:"type,omitempty"`
  730. // ForceSendFields is a list of field names (e.g. "AutoDelete") to
  731. // unconditionally include in API requests. By default, fields with
  732. // empty values are omitted from API requests. However, any non-pointer,
  733. // non-interface field appearing in ForceSendFields will be sent to the
  734. // server regardless of whether the field is empty or not. This may be
  735. // used to include empty fields in Patch requests.
  736. ForceSendFields []string `json:"-"`
  737. }
  738. func (s *AttachedDisk) MarshalJSON() ([]byte, error) {
  739. type noMethod AttachedDisk
  740. raw := noMethod(*s)
  741. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  742. }
  743. // AttachedDiskInitializeParams: [Input Only] Specifies the parameters
  744. // for a new disk that will be created alongside the new instance. Use
  745. // initialization parameters to create boot disks or local SSDs attached
  746. // to the new instance.
  747. //
  748. // This property is mutually exclusive with the source property; you can
  749. // only define one or the other, but not both.
  750. type AttachedDiskInitializeParams struct {
  751. // DiskName: Specifies the disk name. If not specified, the default is
  752. // to use the name of the instance.
  753. DiskName string `json:"diskName,omitempty"`
  754. // DiskSizeGb: Specifies the size of the disk in base-2 GB.
  755. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  756. // DiskStorageType: Storage type of the disk.
  757. //
  758. // Possible values:
  759. // "HDD"
  760. // "SSD"
  761. DiskStorageType string `json:"diskStorageType,omitempty"`
  762. // DiskType: Specifies the disk type to use to create the instance. If
  763. // not specified, the default is pd-standard, specified using the full
  764. // URL. For
  765. // example:
  766. //
  767. // https://www.googleapis.com/compute/v1/projects/project/zones
  768. // /zone/diskTypes/pd-standard
  769. //
  770. // Other values include pd-ssd and local-ssd. If you define this field,
  771. // you can provide either the full or partial URL. For example, the
  772. // following are valid values:
  773. // -
  774. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
  775. // - projects/project/zones/zone/diskTypes/diskType
  776. // - zones/zone/diskTypes/diskType
  777. DiskType string `json:"diskType,omitempty"`
  778. // SourceImage: A source image used to create the disk. You can provide
  779. // a private (custom) image, and Compute Engine will use the
  780. // corresponding image from your project. For
  781. // example:
  782. //
  783. // global/images/my-private-image
  784. //
  785. // Or you can provide an image from a publicly-available project. For
  786. // example, to use a Debian image from the debian-cloud project, make
  787. // sure to include the project in the
  788. // URL:
  789. //
  790. // projects/debian-cloud/global/images/debian-7-wheezy-vYYYYMMDD
  791. //
  792. // where vYYYYMMDD is the image version. The fully-qualified URL will
  793. // also work in both cases.
  794. SourceImage string `json:"sourceImage,omitempty"`
  795. // SourceImageEncryptionKey: The customer-supplied encryption key of the
  796. // source image. This key is required if the source image is protected
  797. // by a customer-supplied encryption key.
  798. //
  799. // If the incorrect key is provided, the operation will fail.
  800. SourceImageEncryptionKey *CustomerEncryptionKey `json:"sourceImageEncryptionKey,omitempty"`
  801. // ForceSendFields is a list of field names (e.g. "DiskName") to
  802. // unconditionally include in API requests. By default, fields with
  803. // empty values are omitted from API requests. However, any non-pointer,
  804. // non-interface field appearing in ForceSendFields will be sent to the
  805. // server regardless of whether the field is empty or not. This may be
  806. // used to include empty fields in Patch requests.
  807. ForceSendFields []string `json:"-"`
  808. }
  809. func (s *AttachedDiskInitializeParams) MarshalJSON() ([]byte, error) {
  810. type noMethod AttachedDiskInitializeParams
  811. raw := noMethod(*s)
  812. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  813. }
  814. type Autoscaler struct {
  815. // AutoscalingPolicy: Autoscaling configuration.
  816. AutoscalingPolicy *AutoscalingPolicy `json:"autoscalingPolicy,omitempty"`
  817. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  818. // format.
  819. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  820. // Description: An optional description of this resource. Provide this
  821. // property when you create the resource.
  822. Description string `json:"description,omitempty"`
  823. // Id: [Output Only] The unique identifier for the resource. This
  824. // identifier is defined by the server.
  825. Id uint64 `json:"id,omitempty,string"`
  826. // Kind: Type of the resource.
  827. Kind string `json:"kind,omitempty"`
  828. // Name: Name of the resource. Provided by the client when the resource
  829. // is created. The name must be 1-63 characters long, and comply with
  830. // RFC1035. Specifically, the name must be 1-63 characters long and
  831. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  832. // the first character must be a lowercase letter, and all following
  833. // characters must be a dash, lowercase letter, or digit, except the
  834. // last character, which cannot be a dash.
  835. Name string `json:"name,omitempty"`
  836. // SelfLink: [Output Only] Server-defined URL for the resource.
  837. SelfLink string `json:"selfLink,omitempty"`
  838. // Target: URL of Instance Group Manager or Replica Pool which will be
  839. // controlled by Autoscaler.
  840. Target string `json:"target,omitempty"`
  841. // Zone: [Output Only] URL of the zone where the instance group resides.
  842. Zone string `json:"zone,omitempty"`
  843. // ServerResponse contains the HTTP response code and headers from the
  844. // server.
  845. googleapi.ServerResponse `json:"-"`
  846. // ForceSendFields is a list of field names (e.g. "AutoscalingPolicy")
  847. // to unconditionally include in API requests. By default, fields with
  848. // empty values are omitted from API requests. However, any non-pointer,
  849. // non-interface field appearing in ForceSendFields will be sent to the
  850. // server regardless of whether the field is empty or not. This may be
  851. // used to include empty fields in Patch requests.
  852. ForceSendFields []string `json:"-"`
  853. }
  854. func (s *Autoscaler) MarshalJSON() ([]byte, error) {
  855. type noMethod Autoscaler
  856. raw := noMethod(*s)
  857. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  858. }
  859. type AutoscalerAggregatedList struct {
  860. // Id: [Output Only] The unique identifier for the resource. This
  861. // identifier is defined by the server.
  862. Id string `json:"id,omitempty"`
  863. // Items: A map of scoped autoscaler lists.
  864. Items map[string]AutoscalersScopedList `json:"items,omitempty"`
  865. // Kind: Type of resource.
  866. Kind string `json:"kind,omitempty"`
  867. // NextPageToken: [Output Only] This token allows you to get the next
  868. // page of results for list requests. If the number of results is larger
  869. // than maxResults, use the nextPageToken as a value for the query
  870. // parameter pageToken in the next list request. Subsequent list
  871. // requests will have their own nextPageToken to continue paging through
  872. // the results.
  873. NextPageToken string `json:"nextPageToken,omitempty"`
  874. // SelfLink: [Output Only] Server-defined URL for this resource.
  875. SelfLink string `json:"selfLink,omitempty"`
  876. // ServerResponse contains the HTTP response code and headers from the
  877. // server.
  878. googleapi.ServerResponse `json:"-"`
  879. // ForceSendFields is a list of field names (e.g. "Id") to
  880. // unconditionally include in API requests. By default, fields with
  881. // empty values are omitted from API requests. However, any non-pointer,
  882. // non-interface field appearing in ForceSendFields will be sent to the
  883. // server regardless of whether the field is empty or not. This may be
  884. // used to include empty fields in Patch requests.
  885. ForceSendFields []string `json:"-"`
  886. }
  887. func (s *AutoscalerAggregatedList) MarshalJSON() ([]byte, error) {
  888. type noMethod AutoscalerAggregatedList
  889. raw := noMethod(*s)
  890. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  891. }
  892. // AutoscalerList: Contains a list of persistent autoscaler resources.
  893. type AutoscalerList struct {
  894. // Id: [Output Only] The unique identifier for the resource. This
  895. // identifier is defined by the server.
  896. Id string `json:"id,omitempty"`
  897. // Items: A list of Autoscaler resources.
  898. Items []*Autoscaler `json:"items,omitempty"`
  899. // Kind: Type of resource.
  900. Kind string `json:"kind,omitempty"`
  901. // NextPageToken: [Output Only] This token allows you to get the next
  902. // page of results for list requests. If the number of results is larger
  903. // than maxResults, use the nextPageToken as a value for the query
  904. // parameter pageToken in the next list request. Subsequent list
  905. // requests will have their own nextPageToken to continue paging through
  906. // the results.
  907. NextPageToken string `json:"nextPageToken,omitempty"`
  908. // SelfLink: [Output Only] Server-defined URL for this resource.
  909. SelfLink string `json:"selfLink,omitempty"`
  910. // ServerResponse contains the HTTP response code and headers from the
  911. // server.
  912. googleapi.ServerResponse `json:"-"`
  913. // ForceSendFields is a list of field names (e.g. "Id") to
  914. // unconditionally include in API requests. By default, fields with
  915. // empty values are omitted from API requests. However, any non-pointer,
  916. // non-interface field appearing in ForceSendFields will be sent to the
  917. // server regardless of whether the field is empty or not. This may be
  918. // used to include empty fields in Patch requests.
  919. ForceSendFields []string `json:"-"`
  920. }
  921. func (s *AutoscalerList) MarshalJSON() ([]byte, error) {
  922. type noMethod AutoscalerList
  923. raw := noMethod(*s)
  924. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  925. }
  926. type AutoscalersScopedList struct {
  927. // Autoscalers: List of autoscalers contained in this scope.
  928. Autoscalers []*Autoscaler `json:"autoscalers,omitempty"`
  929. // Warning: Informational warning which replaces the list of autoscalers
  930. // when the list is empty.
  931. Warning *AutoscalersScopedListWarning `json:"warning,omitempty"`
  932. // ForceSendFields is a list of field names (e.g. "Autoscalers") to
  933. // unconditionally include in API requests. By default, fields with
  934. // empty values are omitted from API requests. However, any non-pointer,
  935. // non-interface field appearing in ForceSendFields will be sent to the
  936. // server regardless of whether the field is empty or not. This may be
  937. // used to include empty fields in Patch requests.
  938. ForceSendFields []string `json:"-"`
  939. }
  940. func (s *AutoscalersScopedList) MarshalJSON() ([]byte, error) {
  941. type noMethod AutoscalersScopedList
  942. raw := noMethod(*s)
  943. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  944. }
  945. // AutoscalersScopedListWarning: Informational warning which replaces
  946. // the list of autoscalers when the list is empty.
  947. type AutoscalersScopedListWarning struct {
  948. // Code: [Output Only] A warning code, if applicable. For example,
  949. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  950. // the response.
  951. //
  952. // Possible values:
  953. // "DEPRECATED_RESOURCE_USED"
  954. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  955. // "INJECTED_KERNELS_DEPRECATED"
  956. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  957. // "NEXT_HOP_CANNOT_IP_FORWARD"
  958. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  959. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  960. // "NEXT_HOP_NOT_RUNNING"
  961. // "NOT_CRITICAL_ERROR"
  962. // "NO_RESULTS_ON_PAGE"
  963. // "REQUIRED_TOS_AGREEMENT"
  964. // "RESOURCE_NOT_DELETED"
  965. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  966. // "UNREACHABLE"
  967. Code string `json:"code,omitempty"`
  968. // Data: [Output Only] Metadata about this warning in key: value format.
  969. // For example:
  970. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  971. Data []*AutoscalersScopedListWarningData `json:"data,omitempty"`
  972. // Message: [Output Only] A human-readable description of the warning
  973. // code.
  974. Message string `json:"message,omitempty"`
  975. // ForceSendFields is a list of field names (e.g. "Code") to
  976. // unconditionally include in API requests. By default, fields with
  977. // empty values are omitted from API requests. However, any non-pointer,
  978. // non-interface field appearing in ForceSendFields will be sent to the
  979. // server regardless of whether the field is empty or not. This may be
  980. // used to include empty fields in Patch requests.
  981. ForceSendFields []string `json:"-"`
  982. }
  983. func (s *AutoscalersScopedListWarning) MarshalJSON() ([]byte, error) {
  984. type noMethod AutoscalersScopedListWarning
  985. raw := noMethod(*s)
  986. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  987. }
  988. type AutoscalersScopedListWarningData struct {
  989. // Key: [Output Only] A key that provides more detail on the warning
  990. // being returned. For example, for warnings where there are no results
  991. // in a list request for a particular zone, this key might be scope and
  992. // the key value might be the zone name. Other examples might be a key
  993. // indicating a deprecated resource, and a suggested replacement, or a
  994. // warning about invalid network settings (for example, if an instance
  995. // attempts to perform IP forwarding but is not enabled for IP
  996. // forwarding).
  997. Key string `json:"key,omitempty"`
  998. // Value: [Output Only] A warning data value corresponding to the key.
  999. Value string `json:"value,omitempty"`
  1000. // ForceSendFields is a list of field names (e.g. "Key") to
  1001. // unconditionally include in API requests. By default, fields with
  1002. // empty values are omitted from API requests. However, any non-pointer,
  1003. // non-interface field appearing in ForceSendFields will be sent to the
  1004. // server regardless of whether the field is empty or not. This may be
  1005. // used to include empty fields in Patch requests.
  1006. ForceSendFields []string `json:"-"`
  1007. }
  1008. func (s *AutoscalersScopedListWarningData) MarshalJSON() ([]byte, error) {
  1009. type noMethod AutoscalersScopedListWarningData
  1010. raw := noMethod(*s)
  1011. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1012. }
  1013. // AutoscalingPolicy: Cloud Autoscaler policy.
  1014. type AutoscalingPolicy struct {
  1015. // CoolDownPeriodSec: The number of seconds that the Autoscaler should
  1016. // wait between two succeeding changes to the number of virtual
  1017. // machines. You should define an interval that is at least as long as
  1018. // the initialization time of a virtual machine and the time it may take
  1019. // for replica pool to create the virtual machine. The default is 60
  1020. // seconds.
  1021. CoolDownPeriodSec int64 `json:"coolDownPeriodSec,omitempty"`
  1022. // CpuUtilization: TODO(jbartosik): Add support for scaling based on
  1023. // muliple utilization metrics (take max recommendation). Exactly one
  1024. // utilization policy should be provided. Configuration parameters of
  1025. // CPU based autoscaling policy.
  1026. CpuUtilization *AutoscalingPolicyCpuUtilization `json:"cpuUtilization,omitempty"`
  1027. // CustomMetricUtilizations: Configuration parameters of autoscaling
  1028. // based on custom metric.
  1029. CustomMetricUtilizations []*AutoscalingPolicyCustomMetricUtilization `json:"customMetricUtilizations,omitempty"`
  1030. // LoadBalancingUtilization: Configuration parameters of autoscaling
  1031. // based on load balancer.
  1032. LoadBalancingUtilization *AutoscalingPolicyLoadBalancingUtilization `json:"loadBalancingUtilization,omitempty"`
  1033. // MaxNumReplicas: The maximum number of replicas that the Autoscaler
  1034. // can scale up to. This field is required for config to be effective.
  1035. // Maximum number of replicas should be not lower than minimal number of
  1036. // replicas. Absolute limit for this value is defined in Autoscaler
  1037. // backend.
  1038. MaxNumReplicas int64 `json:"maxNumReplicas,omitempty"`
  1039. // MinNumReplicas: The minimum number of replicas that the Autoscaler
  1040. // can scale down to. Can't be less than 0. If not provided Autoscaler
  1041. // will choose default value depending on maximal number of replicas.
  1042. MinNumReplicas int64 `json:"minNumReplicas,omitempty"`
  1043. // ForceSendFields is a list of field names (e.g. "CoolDownPeriodSec")
  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. }
  1051. func (s *AutoscalingPolicy) MarshalJSON() ([]byte, error) {
  1052. type noMethod AutoscalingPolicy
  1053. raw := noMethod(*s)
  1054. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1055. }
  1056. // AutoscalingPolicyCpuUtilization: CPU utilization policy.
  1057. type AutoscalingPolicyCpuUtilization struct {
  1058. // UtilizationTarget: The target utilization that the Autoscaler should
  1059. // maintain. It is represented as a fraction of used cores. For example:
  1060. // 6 cores used in 8-core VM are represented here as 0.75. Must be a
  1061. // float value between (0, 1]. If not defined, the default is 0.8.
  1062. UtilizationTarget float64 `json:"utilizationTarget,omitempty"`
  1063. // ForceSendFields is a list of field names (e.g. "UtilizationTarget")
  1064. // to unconditionally include in API requests. By default, fields with
  1065. // empty values are omitted from API requests. However, any non-pointer,
  1066. // non-interface field appearing in ForceSendFields will be sent to the
  1067. // server regardless of whether the field is empty or not. This may be
  1068. // used to include empty fields in Patch requests.
  1069. ForceSendFields []string `json:"-"`
  1070. }
  1071. func (s *AutoscalingPolicyCpuUtilization) MarshalJSON() ([]byte, error) {
  1072. type noMethod AutoscalingPolicyCpuUtilization
  1073. raw := noMethod(*s)
  1074. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1075. }
  1076. // AutoscalingPolicyCustomMetricUtilization: Custom utilization metric
  1077. // policy.
  1078. type AutoscalingPolicyCustomMetricUtilization struct {
  1079. // Metric: Identifier of the metric. It should be a Cloud Monitoring
  1080. // metric. The metric can not have negative values. The metric should be
  1081. // an utilization metric (increasing number of VMs handling requests x
  1082. // times should reduce average value of the metric roughly x times). For
  1083. // example you could use:
  1084. // compute.googleapis.com/instance/network/received_bytes_count.
  1085. Metric string `json:"metric,omitempty"`
  1086. // UtilizationTarget: Target value of the metric which Autoscaler should
  1087. // maintain. Must be a positive value.
  1088. UtilizationTarget float64 `json:"utilizationTarget,omitempty"`
  1089. // UtilizationTargetType: Defines type in which utilization_target is
  1090. // expressed.
  1091. //
  1092. // Possible values:
  1093. // "DELTA_PER_MINUTE"
  1094. // "DELTA_PER_SECOND"
  1095. // "GAUGE"
  1096. UtilizationTargetType string `json:"utilizationTargetType,omitempty"`
  1097. // ForceSendFields is a list of field names (e.g. "Metric") to
  1098. // unconditionally include in API requests. By default, fields with
  1099. // empty values are omitted from API requests. However, any non-pointer,
  1100. // non-interface field appearing in ForceSendFields will be sent to the
  1101. // server regardless of whether the field is empty or not. This may be
  1102. // used to include empty fields in Patch requests.
  1103. ForceSendFields []string `json:"-"`
  1104. }
  1105. func (s *AutoscalingPolicyCustomMetricUtilization) MarshalJSON() ([]byte, error) {
  1106. type noMethod AutoscalingPolicyCustomMetricUtilization
  1107. raw := noMethod(*s)
  1108. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1109. }
  1110. // AutoscalingPolicyLoadBalancingUtilization: Load balancing utilization
  1111. // policy.
  1112. type AutoscalingPolicyLoadBalancingUtilization struct {
  1113. // UtilizationTarget: Fraction of backend capacity utilization (set in
  1114. // HTTP load balancing configuration) that Autoscaler should maintain.
  1115. // Must be a positive float value. If not defined, the default is 0.8.
  1116. // For example if your maxRatePerInstance capacity (in HTTP Load
  1117. // Balancing configuration) is set at 10 and you would like to keep
  1118. // number of instances such that each instance receives 7 QPS on
  1119. // average, set this to 0.7.
  1120. UtilizationTarget float64 `json:"utilizationTarget,omitempty"`
  1121. // ForceSendFields is a list of field names (e.g. "UtilizationTarget")
  1122. // to unconditionally include in API requests. By default, fields with
  1123. // empty values are omitted from API requests. However, any non-pointer,
  1124. // non-interface field appearing in ForceSendFields will be sent to the
  1125. // server regardless of whether the field is empty or not. This may be
  1126. // used to include empty fields in Patch requests.
  1127. ForceSendFields []string `json:"-"`
  1128. }
  1129. func (s *AutoscalingPolicyLoadBalancingUtilization) MarshalJSON() ([]byte, error) {
  1130. type noMethod AutoscalingPolicyLoadBalancingUtilization
  1131. raw := noMethod(*s)
  1132. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1133. }
  1134. // Backend: Message containing information of one individual backend.
  1135. type Backend struct {
  1136. // BalancingMode: Specifies the balancing mode for this backend. The
  1137. // default is UTILIZATION but available values are UTILIZATION and RATE.
  1138. //
  1139. // Possible values:
  1140. // "RATE"
  1141. // "UTILIZATION"
  1142. BalancingMode string `json:"balancingMode,omitempty"`
  1143. // CapacityScaler: A multiplier applied to the group's maximum servicing
  1144. // capacity (either UTILIZATION or RATE). Default value is 1, which
  1145. // means the group will serve up to 100% of its configured CPU or RPS
  1146. // (depending on balancingMode). A setting of 0 means the group is
  1147. // completely drained, offering 0% of its available CPU or RPS. Valid
  1148. // range is [0.0,1.0].
  1149. CapacityScaler float64 `json:"capacityScaler,omitempty"`
  1150. // Description: An optional description of this resource. Provide this
  1151. // property when you create the resource.
  1152. Description string `json:"description,omitempty"`
  1153. // Group: The fully-qualified URL of a zonal Instance Group resource.
  1154. // This instance group defines the list of instances that serve traffic.
  1155. // Member virtual machine instances from each instance group must live
  1156. // in the same zone as the instance group itself. No two backends in a
  1157. // backend service are allowed to use same Instance Group
  1158. // resource.
  1159. //
  1160. // Note that you must specify an Instance Group resource using the
  1161. // fully-qualified URL, rather than a partial URL.
  1162. Group string `json:"group,omitempty"`
  1163. // MaxRate: The max requests per second (RPS) of the group. Can be used
  1164. // with either balancing mode, but required if RATE mode. For RATE mode,
  1165. // either maxRate or maxRatePerInstance must be set.
  1166. MaxRate int64 `json:"maxRate,omitempty"`
  1167. // MaxRatePerInstance: The max requests per second (RPS) that a single
  1168. // backed instance can handle. This is used to calculate the capacity of
  1169. // the group. Can be used in either balancing mode. For RATE mode,
  1170. // either maxRate or maxRatePerInstance must be set.
  1171. MaxRatePerInstance float64 `json:"maxRatePerInstance,omitempty"`
  1172. // MaxUtilization: Used when balancingMode is UTILIZATION. This ratio
  1173. // defines the CPU utilization target for the group. The default is 0.8.
  1174. // Valid range is [0.0, 1.0].
  1175. MaxUtilization float64 `json:"maxUtilization,omitempty"`
  1176. // ForceSendFields is a list of field names (e.g. "BalancingMode") to
  1177. // unconditionally include in API requests. By default, fields with
  1178. // empty values are omitted from API requests. However, any non-pointer,
  1179. // non-interface field appearing in ForceSendFields will be sent to the
  1180. // server regardless of whether the field is empty or not. This may be
  1181. // used to include empty fields in Patch requests.
  1182. ForceSendFields []string `json:"-"`
  1183. }
  1184. func (s *Backend) MarshalJSON() ([]byte, error) {
  1185. type noMethod Backend
  1186. raw := noMethod(*s)
  1187. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1188. }
  1189. // BackendService: A BackendService resource. This resource defines a
  1190. // group of backend virtual machines and their serving capacity.
  1191. type BackendService struct {
  1192. // Backends: The list of backends that serve this BackendService.
  1193. Backends []*Backend `json:"backends,omitempty"`
  1194. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  1195. // format.
  1196. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  1197. // Description: An optional description of this resource. Provide this
  1198. // property when you create the resource.
  1199. Description string `json:"description,omitempty"`
  1200. // Fingerprint: Fingerprint of this resource. A hash of the contents
  1201. // stored in this object. This field is used in optimistic locking. This
  1202. // field will be ignored when inserting a BackendService. An up-to-date
  1203. // fingerprint must be provided in order to update the BackendService.
  1204. Fingerprint string `json:"fingerprint,omitempty"`
  1205. // HealthChecks: The list of URLs to the HttpHealthCheck or
  1206. // HttpsHealthCheck resource for health checking this BackendService.
  1207. // Currently at most one health check can be specified, and a health
  1208. // check is required.
  1209. HealthChecks []string `json:"healthChecks,omitempty"`
  1210. // Id: [Output Only] The unique identifier for the resource. This
  1211. // identifier is defined by the server.
  1212. Id uint64 `json:"id,omitempty,string"`
  1213. // Kind: [Output Only] Type of resource. Always compute#backendService
  1214. // for backend services.
  1215. Kind string `json:"kind,omitempty"`
  1216. // Name: Name of the resource. Provided by the client when the resource
  1217. // is created. The name must be 1-63 characters long, and comply with
  1218. // RFC1035. Specifically, the name must be 1-63 characters long and
  1219. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  1220. // the first character must be a lowercase letter, and all following
  1221. // characters must be a dash, lowercase letter, or digit, except the
  1222. // last character, which cannot be a dash.
  1223. Name string `json:"name,omitempty"`
  1224. // Port: Deprecated in favor of portName. The TCP port to connect on the
  1225. // backend. The default value is 80.
  1226. Port int64 `json:"port,omitempty"`
  1227. // PortName: Name of backend port. The same name should appear in the
  1228. // resource views referenced by this service. Required.
  1229. PortName string `json:"portName,omitempty"`
  1230. // Possible values:
  1231. // "HTTP"
  1232. // "HTTPS"
  1233. Protocol string `json:"protocol,omitempty"`
  1234. // SelfLink: [Output Only] Server-defined URL for the resource.
  1235. SelfLink string `json:"selfLink,omitempty"`
  1236. // TimeoutSec: How many seconds to wait for the backend before
  1237. // considering it a failed request. Default is 30 seconds. Valid range
  1238. // is [1, 86400].
  1239. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  1240. // ServerResponse contains the HTTP response code and headers from the
  1241. // server.
  1242. googleapi.ServerResponse `json:"-"`
  1243. // ForceSendFields is a list of field names (e.g. "Backends") to
  1244. // unconditionally include in API requests. By default, fields with
  1245. // empty values are omitted from API requests. However, any non-pointer,
  1246. // non-interface field appearing in ForceSendFields will be sent to the
  1247. // server regardless of whether the field is empty or not. This may be
  1248. // used to include empty fields in Patch requests.
  1249. ForceSendFields []string `json:"-"`
  1250. }
  1251. func (s *BackendService) MarshalJSON() ([]byte, error) {
  1252. type noMethod BackendService
  1253. raw := noMethod(*s)
  1254. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1255. }
  1256. type BackendServiceGroupHealth struct {
  1257. HealthStatus []*HealthStatus `json:"healthStatus,omitempty"`
  1258. // Kind: [Output Only] Type of resource. Always
  1259. // compute#backendServiceGroupHealth for the health of backend services.
  1260. Kind string `json:"kind,omitempty"`
  1261. // ServerResponse contains the HTTP response code and headers from the
  1262. // server.
  1263. googleapi.ServerResponse `json:"-"`
  1264. // ForceSendFields is a list of field names (e.g. "HealthStatus") to
  1265. // unconditionally include in API requests. By default, fields with
  1266. // empty values are omitted from API requests. However, any non-pointer,
  1267. // non-interface field appearing in ForceSendFields will be sent to the
  1268. // server regardless of whether the field is empty or not. This may be
  1269. // used to include empty fields in Patch requests.
  1270. ForceSendFields []string `json:"-"`
  1271. }
  1272. func (s *BackendServiceGroupHealth) MarshalJSON() ([]byte, error) {
  1273. type noMethod BackendServiceGroupHealth
  1274. raw := noMethod(*s)
  1275. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1276. }
  1277. // BackendServiceList: Contains a list of BackendService resources.
  1278. type BackendServiceList struct {
  1279. // Id: [Output Only] The unique identifier for the resource. This
  1280. // identifier is defined by the server.
  1281. Id string `json:"id,omitempty"`
  1282. // Items: A list of BackendService resources.
  1283. Items []*BackendService `json:"items,omitempty"`
  1284. // Kind: [Output Only] Type of resource. Always
  1285. // compute#backendServiceList for lists of backend services.
  1286. Kind string `json:"kind,omitempty"`
  1287. // NextPageToken: [Output Only] This token allows you to get the next
  1288. // page of results for list requests. If the number of results is larger
  1289. // than maxResults, use the nextPageToken as a value for the query
  1290. // parameter pageToken in the next list request. Subsequent list
  1291. // requests will have their own nextPageToken to continue paging through
  1292. // the results.
  1293. NextPageToken string `json:"nextPageToken,omitempty"`
  1294. // SelfLink: [Output Only] Server-defined URL for this resource.
  1295. SelfLink string `json:"selfLink,omitempty"`
  1296. // ServerResponse contains the HTTP response code and headers from the
  1297. // server.
  1298. googleapi.ServerResponse `json:"-"`
  1299. // ForceSendFields is a list of field names (e.g. "Id") to
  1300. // unconditionally include in API requests. By default, fields with
  1301. // empty values are omitted from API requests. However, any non-pointer,
  1302. // non-interface field appearing in ForceSendFields will be sent to the
  1303. // server regardless of whether the field is empty or not. This may be
  1304. // used to include empty fields in Patch requests.
  1305. ForceSendFields []string `json:"-"`
  1306. }
  1307. func (s *BackendServiceList) MarshalJSON() ([]byte, error) {
  1308. type noMethod BackendServiceList
  1309. raw := noMethod(*s)
  1310. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1311. }
  1312. // CustomerEncryptionKey: Represents a customer-supplied encryption key
  1313. type CustomerEncryptionKey struct {
  1314. // RawKey: Specifies a 256-bit customer-supplied encryption key, encoded
  1315. // in base64 to either encrypt or decrypt this resource.
  1316. RawKey string `json:"rawKey,omitempty"`
  1317. // RsaEncryptedKey: Specifies a base64 encoded, RSA-wrapped 2048-bit
  1318. // customer-supplied encryption key to either encrypt or decrypt this
  1319. // resource.
  1320. //
  1321. // The key must meet the following requirements before you can provide
  1322. // it to Compute Engine:
  1323. // - The key is wrapped using a RSA public key certificate provided by
  1324. // Google.
  1325. // - After being wrapped, the key must be encoded in base64 encoding.
  1326. // Get the RSA public key certificate provided by Google
  1327. // at:
  1328. // https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingre
  1329. // ss.pem
  1330. RsaEncryptedKey string `json:"rsaEncryptedKey,omitempty"`
  1331. // Sha256: [Output only] The base64 encoded SHA-256 hash of the
  1332. // customer-supplied encryption key that protects this resource.
  1333. Sha256 string `json:"sha256,omitempty"`
  1334. // ForceSendFields is a list of field names (e.g. "RawKey") to
  1335. // unconditionally include in API requests. By default, fields with
  1336. // empty values are omitted from API requests. However, any non-pointer,
  1337. // non-interface field appearing in ForceSendFields will be sent to the
  1338. // server regardless of whether the field is empty or not. This may be
  1339. // used to include empty fields in Patch requests.
  1340. ForceSendFields []string `json:"-"`
  1341. }
  1342. func (s *CustomerEncryptionKey) MarshalJSON() ([]byte, error) {
  1343. type noMethod CustomerEncryptionKey
  1344. raw := noMethod(*s)
  1345. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1346. }
  1347. // DeprecationStatus: Deprecation status for a public resource.
  1348. type DeprecationStatus struct {
  1349. // Deleted: An optional RFC3339 timestamp on or after which the
  1350. // deprecation state of this resource will be changed to DELETED.
  1351. Deleted string `json:"deleted,omitempty"`
  1352. // Deprecated: An optional RFC3339 timestamp on or after which the
  1353. // deprecation state of this resource will be changed to DEPRECATED.
  1354. Deprecated string `json:"deprecated,omitempty"`
  1355. // Obsolete: An optional RFC3339 timestamp on or after which the
  1356. // deprecation state of this resource will be changed to OBSOLETE.
  1357. Obsolete string `json:"obsolete,omitempty"`
  1358. // Replacement: The URL of the suggested replacement for a deprecated
  1359. // resource. The suggested replacement resource must be the same kind of
  1360. // resource as the deprecated resource.
  1361. Replacement string `json:"replacement,omitempty"`
  1362. // State: The deprecation state of this resource. This can be
  1363. // DEPRECATED, OBSOLETE, or DELETED. Operations which create a new
  1364. // resource using a DEPRECATED resource will return successfully, but
  1365. // with a warning indicating the deprecated resource and recommending
  1366. // its replacement. Operations which use OBSOLETE or DELETED resources
  1367. // will be rejected and result in an error.
  1368. //
  1369. // Possible values:
  1370. // "DELETED"
  1371. // "DEPRECATED"
  1372. // "OBSOLETE"
  1373. State string `json:"state,omitempty"`
  1374. // ForceSendFields is a list of field names (e.g. "Deleted") to
  1375. // unconditionally include in API requests. By default, fields with
  1376. // empty values are omitted from API requests. However, any non-pointer,
  1377. // non-interface field appearing in ForceSendFields will be sent to the
  1378. // server regardless of whether the field is empty or not. This may be
  1379. // used to include empty fields in Patch requests.
  1380. ForceSendFields []string `json:"-"`
  1381. }
  1382. func (s *DeprecationStatus) MarshalJSON() ([]byte, error) {
  1383. type noMethod DeprecationStatus
  1384. raw := noMethod(*s)
  1385. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1386. }
  1387. // Disk: A Disk resource.
  1388. type Disk struct {
  1389. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  1390. // format.
  1391. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  1392. // Description: An optional description of this resource. Provide this
  1393. // property when you create the resource.
  1394. Description string `json:"description,omitempty"`
  1395. // DiskEncryptionKey: Encrypts the disk using a customer-supplied
  1396. // encryption key.
  1397. //
  1398. // If you encrypt the disk using a customer-supplied encryption key, and
  1399. // you want to use the disk later (e.g. to create a disk snapshot or an
  1400. // image, or to attach the disk to a virtual machine), you must provide
  1401. // the same key in your request. If you provide an incorrect key, or no
  1402. // key, the operation will fail.
  1403. //
  1404. // Customer-supplied encryption keys do not protect access to metadata
  1405. // of the disk.
  1406. //
  1407. // If no customer-supplied encryption key is provided at creation, then
  1408. // the disk will be encrypted using an automatically generated key and
  1409. // you do not need to provide a key to use the disk later.
  1410. DiskEncryptionKey *CustomerEncryptionKey `json:"diskEncryptionKey,omitempty"`
  1411. // Id: [Output Only] The unique identifier for the resource. This
  1412. // identifier is defined by the server.
  1413. Id uint64 `json:"id,omitempty,string"`
  1414. // Kind: [Output Only] Type of the resource. Always compute#disk for
  1415. // disks.
  1416. Kind string `json:"kind,omitempty"`
  1417. // LastAttachTimestamp: [Output Only] Last attach timestamp in RFC3339
  1418. // text format.
  1419. LastAttachTimestamp string `json:"lastAttachTimestamp,omitempty"`
  1420. // LastDetachTimestamp: [Output Only] Last detach timestamp in RFC3339
  1421. // text format.
  1422. LastDetachTimestamp string `json:"lastDetachTimestamp,omitempty"`
  1423. // Licenses: Any applicable publicly visible licenses.
  1424. Licenses []string `json:"licenses,omitempty"`
  1425. // Name: Name of the resource; provided by the client when the resource
  1426. // is created. The name must be 1-63 characters long, and comply with
  1427. // RFC1035. Specifically, the name must be 1-63 characters long and
  1428. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  1429. // the first character must be a lowercase letter, and all following
  1430. // characters must be a dash, lowercase letter, or digit, except the
  1431. // last character, which cannot be a dash.
  1432. Name string `json:"name,omitempty"`
  1433. // Options: Internal use only.
  1434. Options string `json:"options,omitempty"`
  1435. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  1436. // resource.
  1437. SelfLink string `json:"selfLink,omitempty"`
  1438. // SizeGb: Size of the persistent disk, specified in GB. You can specify
  1439. // this field when creating a persistent disk using the sourceImage or
  1440. // sourceSnapshot parameter, or specify it alone to create an empty
  1441. // persistent disk.
  1442. //
  1443. // If you specify this field along with sourceImage or sourceSnapshot,
  1444. // the value of sizeGb must not be less than the size of the sourceImage
  1445. // or the size of the snapshot.
  1446. SizeGb int64 `json:"sizeGb,omitempty,string"`
  1447. // SourceImage: The source image used to create this disk. If the source
  1448. // image is deleted from the system, this field will not be set, even if
  1449. // an image with the same name has been re-created.
  1450. //
  1451. // When creating a disk, you can provide a private (custom) image using
  1452. // the following input, and Compute Engine will use the corresponding
  1453. // image from your project. For example:
  1454. //
  1455. // global/images/my-private-image
  1456. //
  1457. // Or you can provide an image from a publicly-available project. For
  1458. // example, to use a Debian image from the debian-cloud project, make
  1459. // sure to include the project in the
  1460. // URL:
  1461. //
  1462. // projects/debian-cloud/global/images/debian-7-wheezy-vYYYYMMDD
  1463. //
  1464. // where vYYYYMMDD is the image version. The fully-qualified URL will
  1465. // also work in both cases.
  1466. SourceImage string `json:"sourceImage,omitempty"`
  1467. // SourceImageEncryptionKey: The customer-supplied encryption key of the
  1468. // source image. This key is required if the source image is protected
  1469. // by a customer-supplied encryption key.
  1470. //
  1471. // If the incorrect key is provided, the operation will fail.
  1472. SourceImageEncryptionKey *CustomerEncryptionKey `json:"sourceImageEncryptionKey,omitempty"`
  1473. // SourceImageId: The ID value of the image used to create this disk.
  1474. // This value identifies the exact image that was used to create this
  1475. // persistent disk. For example, if you created the persistent disk from
  1476. // an image that was later deleted and recreated under the same name,
  1477. // the source image ID would identify the exact version of the image
  1478. // that was used.
  1479. SourceImageId string `json:"sourceImageId,omitempty"`
  1480. // SourceSnapshot: The source snapshot used to create this disk. You can
  1481. // provide this as a partial or full URL to the resource. For example,
  1482. // the following are valid values:
  1483. // -
  1484. // https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
  1485. // - projects/project/global/snapshots/snapshot
  1486. // - global/snapshots/snapshot
  1487. SourceSnapshot string `json:"sourceSnapshot,omitempty"`
  1488. // SourceSnapshotEncryptionKey: The customer-supplied encryption key of
  1489. // the source snapshot. This key is required if the source snapshot is
  1490. // protected by a customer-supplied encryption key.
  1491. //
  1492. // If the incorrect key is provided, the operation will fail.
  1493. SourceSnapshotEncryptionKey *CustomerEncryptionKey `json:"sourceSnapshotEncryptionKey,omitempty"`
  1494. // SourceSnapshotId: [Output Only] The unique ID of the snapshot used to
  1495. // create this disk. This value identifies the exact snapshot that was
  1496. // used to create this persistent disk. For example, if you created the
  1497. // persistent disk from a snapshot that was later deleted and recreated
  1498. // under the same name, the source snapshot ID would identify the exact
  1499. // version of the snapshot that was used.
  1500. SourceSnapshotId string `json:"sourceSnapshotId,omitempty"`
  1501. // Status: [Output Only] The status of disk creation. Applicable
  1502. // statuses includes: CREATING, FAILED, READY, RESTORING.
  1503. //
  1504. // Possible values:
  1505. // "CREATING"
  1506. // "FAILED"
  1507. // "READY"
  1508. // "RESTORING"
  1509. Status string `json:"status,omitempty"`
  1510. // StorageType: [Deprecated] Storage type of the persistent disk.
  1511. //
  1512. // Possible values:
  1513. // "HDD"
  1514. // "SSD"
  1515. StorageType string `json:"storageType,omitempty"`
  1516. // Type: URL of the disk type resource describing which disk type to use
  1517. // to create the disk; provided by the client when the disk is created.
  1518. Type string `json:"type,omitempty"`
  1519. // Users: Links to the users of the disk (attached instances) in form:
  1520. // project/zones/zone/instances/instance
  1521. Users []string `json:"users,omitempty"`
  1522. // Zone: [Output Only] URL of the zone where the disk resides.
  1523. Zone string `json:"zone,omitempty"`
  1524. // ServerResponse contains the HTTP response code and headers from the
  1525. // server.
  1526. googleapi.ServerResponse `json:"-"`
  1527. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  1528. // to unconditionally include in API requests. By default, fields with
  1529. // empty values are omitted from API requests. However, any non-pointer,
  1530. // non-interface field appearing in ForceSendFields will be sent to the
  1531. // server regardless of whether the field is empty or not. This may be
  1532. // used to include empty fields in Patch requests.
  1533. ForceSendFields []string `json:"-"`
  1534. }
  1535. func (s *Disk) MarshalJSON() ([]byte, error) {
  1536. type noMethod Disk
  1537. raw := noMethod(*s)
  1538. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1539. }
  1540. type DiskAggregatedList struct {
  1541. // Id: [Output Only] The unique identifier for the resource. This
  1542. // identifier is defined by the server.
  1543. Id string `json:"id,omitempty"`
  1544. // Items: [Output Only] A map of scoped disk lists.
  1545. Items map[string]DisksScopedList `json:"items,omitempty"`
  1546. // Kind: [Output Only] Type of resource. Always
  1547. // compute#diskAggregatedList for aggregated lists of persistent disks.
  1548. Kind string `json:"kind,omitempty"`
  1549. // NextPageToken: [Output Only] This token allows you to get the next
  1550. // page of results for list requests. If the number of results is larger
  1551. // than maxResults, use the nextPageToken as a value for the query
  1552. // parameter pageToken in the next list request. Subsequent list
  1553. // requests will have their own nextPageToken to continue paging through
  1554. // the results.
  1555. NextPageToken string `json:"nextPageToken,omitempty"`
  1556. // SelfLink: [Output Only] Server-defined URL for this resource.
  1557. SelfLink string `json:"selfLink,omitempty"`
  1558. // ServerResponse contains the HTTP response code and headers from the
  1559. // server.
  1560. googleapi.ServerResponse `json:"-"`
  1561. // ForceSendFields is a list of field names (e.g. "Id") to
  1562. // unconditionally include in API requests. By default, fields with
  1563. // empty values are omitted from API requests. However, any non-pointer,
  1564. // non-interface field appearing in ForceSendFields will be sent to the
  1565. // server regardless of whether the field is empty or not. This may be
  1566. // used to include empty fields in Patch requests.
  1567. ForceSendFields []string `json:"-"`
  1568. }
  1569. func (s *DiskAggregatedList) MarshalJSON() ([]byte, error) {
  1570. type noMethod DiskAggregatedList
  1571. raw := noMethod(*s)
  1572. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1573. }
  1574. // DiskList: A list of Disk resources.
  1575. type DiskList struct {
  1576. // Id: [Output Only] The unique identifier for the resource. This
  1577. // identifier is defined by the server.
  1578. Id string `json:"id,omitempty"`
  1579. // Items: [Output Only] A list of persistent disks.
  1580. Items []*Disk `json:"items,omitempty"`
  1581. // Kind: [Output Only] Type of resource. Always compute#diskList for
  1582. // lists of disks.
  1583. Kind string `json:"kind,omitempty"`
  1584. // NextPageToken: [Output Only] This token allows you to get the next
  1585. // page of results for list requests. If the number of results is larger
  1586. // than maxResults, use the nextPageToken as a value for the query
  1587. // parameter pageToken in the next list request. Subsequent list
  1588. // requests will have their own nextPageToken to continue paging through
  1589. // the results.
  1590. NextPageToken string `json:"nextPageToken,omitempty"`
  1591. // SelfLink: [Output Only] Server-defined URL for this resource.
  1592. SelfLink string `json:"selfLink,omitempty"`
  1593. // ServerResponse contains the HTTP response code and headers from the
  1594. // server.
  1595. googleapi.ServerResponse `json:"-"`
  1596. // ForceSendFields is a list of field names (e.g. "Id") to
  1597. // unconditionally include in API requests. By default, fields with
  1598. // empty values are omitted from API requests. However, any non-pointer,
  1599. // non-interface field appearing in ForceSendFields will be sent to the
  1600. // server regardless of whether the field is empty or not. This may be
  1601. // used to include empty fields in Patch requests.
  1602. ForceSendFields []string `json:"-"`
  1603. }
  1604. func (s *DiskList) MarshalJSON() ([]byte, error) {
  1605. type noMethod DiskList
  1606. raw := noMethod(*s)
  1607. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1608. }
  1609. // DiskType: A disk type resource.
  1610. type DiskType struct {
  1611. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  1612. // format.
  1613. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  1614. // DefaultDiskSizeGb: [Output Only] Server-defined default disk size in
  1615. // GB.
  1616. DefaultDiskSizeGb int64 `json:"defaultDiskSizeGb,omitempty,string"`
  1617. // Deprecated: [Output Only] The deprecation status associated with this
  1618. // disk type.
  1619. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  1620. // Description: [Output Only] An optional description of this resource.
  1621. Description string `json:"description,omitempty"`
  1622. // Id: [Output Only] The unique identifier for the resource. This
  1623. // identifier is defined by the server.
  1624. Id uint64 `json:"id,omitempty,string"`
  1625. // Kind: [Output Only] Type of the resource. Always compute#diskType for
  1626. // disk types.
  1627. Kind string `json:"kind,omitempty"`
  1628. // Name: [Output Only] Name of the resource.
  1629. Name string `json:"name,omitempty"`
  1630. // SelfLink: [Output Only] Server-defined URL for the resource.
  1631. SelfLink string `json:"selfLink,omitempty"`
  1632. // ValidDiskSize: [Output Only] An optional textual description of the
  1633. // valid disk size, such as "10GB-10TB".
  1634. ValidDiskSize string `json:"validDiskSize,omitempty"`
  1635. // Zone: [Output Only] URL of the zone where the disk type resides.
  1636. Zone string `json:"zone,omitempty"`
  1637. // ServerResponse contains the HTTP response code and headers from the
  1638. // server.
  1639. googleapi.ServerResponse `json:"-"`
  1640. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  1641. // to unconditionally include in API requests. By default, fields with
  1642. // empty values are omitted from API requests. However, any non-pointer,
  1643. // non-interface field appearing in ForceSendFields will be sent to the
  1644. // server regardless of whether the field is empty or not. This may be
  1645. // used to include empty fields in Patch requests.
  1646. ForceSendFields []string `json:"-"`
  1647. }
  1648. func (s *DiskType) MarshalJSON() ([]byte, error) {
  1649. type noMethod DiskType
  1650. raw := noMethod(*s)
  1651. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1652. }
  1653. type DiskTypeAggregatedList struct {
  1654. // Id: [Output Only] The unique identifier for the resource. This
  1655. // identifier is defined by the server.
  1656. Id string `json:"id,omitempty"`
  1657. // Items: [Output Only] A map of scoped disk type lists.
  1658. Items map[string]DiskTypesScopedList `json:"items,omitempty"`
  1659. // Kind: [Output Only] Type of resource. Always
  1660. // compute#diskTypeAggregatedList.
  1661. Kind string `json:"kind,omitempty"`
  1662. // NextPageToken: [Output Only] This token allows you to get the next
  1663. // page of results for list requests. If the number of results is larger
  1664. // than maxResults, use the nextPageToken as a value for the query
  1665. // parameter pageToken in the next list request. Subsequent list
  1666. // requests will have their own nextPageToken to continue paging through
  1667. // the results.
  1668. NextPageToken string `json:"nextPageToken,omitempty"`
  1669. // SelfLink: [Output Only] Server-defined URL for this resource.
  1670. SelfLink string `json:"selfLink,omitempty"`
  1671. // ServerResponse contains the HTTP response code and headers from the
  1672. // server.
  1673. googleapi.ServerResponse `json:"-"`
  1674. // ForceSendFields is a list of field names (e.g. "Id") to
  1675. // unconditionally include in API requests. By default, fields with
  1676. // empty values are omitted from API requests. However, any non-pointer,
  1677. // non-interface field appearing in ForceSendFields will be sent to the
  1678. // server regardless of whether the field is empty or not. This may be
  1679. // used to include empty fields in Patch requests.
  1680. ForceSendFields []string `json:"-"`
  1681. }
  1682. func (s *DiskTypeAggregatedList) MarshalJSON() ([]byte, error) {
  1683. type noMethod DiskTypeAggregatedList
  1684. raw := noMethod(*s)
  1685. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1686. }
  1687. // DiskTypeList: Contains a list of disk type resources.
  1688. type DiskTypeList struct {
  1689. // Id: [Output Only] The unique identifier for the resource. This
  1690. // identifier is defined by the server.
  1691. Id string `json:"id,omitempty"`
  1692. // Items: [Output Only] A list of Disk Type resources.
  1693. Items []*DiskType `json:"items,omitempty"`
  1694. // Kind: [Output Only] Type of resource. Always compute#diskTypeList for
  1695. // disk types.
  1696. Kind string `json:"kind,omitempty"`
  1697. // NextPageToken: [Output Only] This token allows you to get the next
  1698. // page of results for list requests. If the number of results is larger
  1699. // than maxResults, use the nextPageToken as a value for the query
  1700. // parameter pageToken in the next list request. Subsequent list
  1701. // requests will have their own nextPageToken to continue paging through
  1702. // the results.
  1703. NextPageToken string `json:"nextPageToken,omitempty"`
  1704. // SelfLink: [Output Only] Server-defined URL for this resource.
  1705. SelfLink string `json:"selfLink,omitempty"`
  1706. // ServerResponse contains the HTTP response code and headers from the
  1707. // server.
  1708. googleapi.ServerResponse `json:"-"`
  1709. // ForceSendFields is a list of field names (e.g. "Id") to
  1710. // unconditionally include in API requests. By default, fields with
  1711. // empty values are omitted from API requests. However, any non-pointer,
  1712. // non-interface field appearing in ForceSendFields will be sent to the
  1713. // server regardless of whether the field is empty or not. This may be
  1714. // used to include empty fields in Patch requests.
  1715. ForceSendFields []string `json:"-"`
  1716. }
  1717. func (s *DiskTypeList) MarshalJSON() ([]byte, error) {
  1718. type noMethod DiskTypeList
  1719. raw := noMethod(*s)
  1720. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1721. }
  1722. type DiskTypesScopedList struct {
  1723. // DiskTypes: [Output Only] List of disk types contained in this scope.
  1724. DiskTypes []*DiskType `json:"diskTypes,omitempty"`
  1725. // Warning: [Output Only] Informational warning which replaces the list
  1726. // of disk types when the list is empty.
  1727. Warning *DiskTypesScopedListWarning `json:"warning,omitempty"`
  1728. // ForceSendFields is a list of field names (e.g. "DiskTypes") to
  1729. // unconditionally include in API requests. By default, fields with
  1730. // empty values are omitted from API requests. However, any non-pointer,
  1731. // non-interface field appearing in ForceSendFields will be sent to the
  1732. // server regardless of whether the field is empty or not. This may be
  1733. // used to include empty fields in Patch requests.
  1734. ForceSendFields []string `json:"-"`
  1735. }
  1736. func (s *DiskTypesScopedList) MarshalJSON() ([]byte, error) {
  1737. type noMethod DiskTypesScopedList
  1738. raw := noMethod(*s)
  1739. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1740. }
  1741. // DiskTypesScopedListWarning: [Output Only] Informational warning which
  1742. // replaces the list of disk types when the list is empty.
  1743. type DiskTypesScopedListWarning struct {
  1744. // Code: [Output Only] A warning code, if applicable. For example,
  1745. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1746. // the response.
  1747. //
  1748. // Possible values:
  1749. // "DEPRECATED_RESOURCE_USED"
  1750. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1751. // "INJECTED_KERNELS_DEPRECATED"
  1752. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1753. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1754. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1755. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1756. // "NEXT_HOP_NOT_RUNNING"
  1757. // "NOT_CRITICAL_ERROR"
  1758. // "NO_RESULTS_ON_PAGE"
  1759. // "REQUIRED_TOS_AGREEMENT"
  1760. // "RESOURCE_NOT_DELETED"
  1761. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1762. // "UNREACHABLE"
  1763. Code string `json:"code,omitempty"`
  1764. // Data: [Output Only] Metadata about this warning in key: value format.
  1765. // For example:
  1766. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1767. Data []*DiskTypesScopedListWarningData `json:"data,omitempty"`
  1768. // Message: [Output Only] A human-readable description of the warning
  1769. // code.
  1770. Message string `json:"message,omitempty"`
  1771. // ForceSendFields is a list of field names (e.g. "Code") to
  1772. // unconditionally include in API requests. By default, fields with
  1773. // empty values are omitted from API requests. However, any non-pointer,
  1774. // non-interface field appearing in ForceSendFields will be sent to the
  1775. // server regardless of whether the field is empty or not. This may be
  1776. // used to include empty fields in Patch requests.
  1777. ForceSendFields []string `json:"-"`
  1778. }
  1779. func (s *DiskTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  1780. type noMethod DiskTypesScopedListWarning
  1781. raw := noMethod(*s)
  1782. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1783. }
  1784. type DiskTypesScopedListWarningData struct {
  1785. // Key: [Output Only] A key that provides more detail on the warning
  1786. // being returned. For example, for warnings where there are no results
  1787. // in a list request for a particular zone, this key might be scope and
  1788. // the key value might be the zone name. Other examples might be a key
  1789. // indicating a deprecated resource, and a suggested replacement, or a
  1790. // warning about invalid network settings (for example, if an instance
  1791. // attempts to perform IP forwarding but is not enabled for IP
  1792. // forwarding).
  1793. Key string `json:"key,omitempty"`
  1794. // Value: [Output Only] A warning data value corresponding to the key.
  1795. Value string `json:"value,omitempty"`
  1796. // ForceSendFields is a list of field names (e.g. "Key") to
  1797. // unconditionally include in API requests. By default, fields with
  1798. // empty values are omitted from API requests. However, any non-pointer,
  1799. // non-interface field appearing in ForceSendFields will be sent to the
  1800. // server regardless of whether the field is empty or not. This may be
  1801. // used to include empty fields in Patch requests.
  1802. ForceSendFields []string `json:"-"`
  1803. }
  1804. func (s *DiskTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  1805. type noMethod DiskTypesScopedListWarningData
  1806. raw := noMethod(*s)
  1807. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1808. }
  1809. type DisksResizeRequest struct {
  1810. // SizeGb: The new size of the persistent disk, which is specified in
  1811. // GB.
  1812. SizeGb int64 `json:"sizeGb,omitempty,string"`
  1813. // ForceSendFields is a list of field names (e.g. "SizeGb") to
  1814. // unconditionally include in API requests. By default, fields with
  1815. // empty values are omitted from API requests. However, any non-pointer,
  1816. // non-interface field appearing in ForceSendFields will be sent to the
  1817. // server regardless of whether the field is empty or not. This may be
  1818. // used to include empty fields in Patch requests.
  1819. ForceSendFields []string `json:"-"`
  1820. }
  1821. func (s *DisksResizeRequest) MarshalJSON() ([]byte, error) {
  1822. type noMethod DisksResizeRequest
  1823. raw := noMethod(*s)
  1824. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1825. }
  1826. type DisksScopedList struct {
  1827. // Disks: [Output Only] List of disks contained in this scope.
  1828. Disks []*Disk `json:"disks,omitempty"`
  1829. // Warning: [Output Only] Informational warning which replaces the list
  1830. // of disks when the list is empty.
  1831. Warning *DisksScopedListWarning `json:"warning,omitempty"`
  1832. // ForceSendFields is a list of field names (e.g. "Disks") to
  1833. // unconditionally include in API requests. By default, fields with
  1834. // empty values are omitted from API requests. However, any non-pointer,
  1835. // non-interface field appearing in ForceSendFields will be sent to the
  1836. // server regardless of whether the field is empty or not. This may be
  1837. // used to include empty fields in Patch requests.
  1838. ForceSendFields []string `json:"-"`
  1839. }
  1840. func (s *DisksScopedList) MarshalJSON() ([]byte, error) {
  1841. type noMethod DisksScopedList
  1842. raw := noMethod(*s)
  1843. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1844. }
  1845. // DisksScopedListWarning: [Output Only] Informational warning which
  1846. // replaces the list of disks when the list is empty.
  1847. type DisksScopedListWarning struct {
  1848. // Code: [Output Only] A warning code, if applicable. For example,
  1849. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1850. // the response.
  1851. //
  1852. // Possible values:
  1853. // "DEPRECATED_RESOURCE_USED"
  1854. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1855. // "INJECTED_KERNELS_DEPRECATED"
  1856. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1857. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1858. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1859. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1860. // "NEXT_HOP_NOT_RUNNING"
  1861. // "NOT_CRITICAL_ERROR"
  1862. // "NO_RESULTS_ON_PAGE"
  1863. // "REQUIRED_TOS_AGREEMENT"
  1864. // "RESOURCE_NOT_DELETED"
  1865. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1866. // "UNREACHABLE"
  1867. Code string `json:"code,omitempty"`
  1868. // Data: [Output Only] Metadata about this warning in key: value format.
  1869. // For example:
  1870. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1871. Data []*DisksScopedListWarningData `json:"data,omitempty"`
  1872. // Message: [Output Only] A human-readable description of the warning
  1873. // code.
  1874. Message string `json:"message,omitempty"`
  1875. // ForceSendFields is a list of field names (e.g. "Code") to
  1876. // unconditionally include in API requests. By default, fields with
  1877. // empty values are omitted from API requests. However, any non-pointer,
  1878. // non-interface field appearing in ForceSendFields will be sent to the
  1879. // server regardless of whether the field is empty or not. This may be
  1880. // used to include empty fields in Patch requests.
  1881. ForceSendFields []string `json:"-"`
  1882. }
  1883. func (s *DisksScopedListWarning) MarshalJSON() ([]byte, error) {
  1884. type noMethod DisksScopedListWarning
  1885. raw := noMethod(*s)
  1886. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1887. }
  1888. type DisksScopedListWarningData struct {
  1889. // Key: [Output Only] A key that provides more detail on the warning
  1890. // being returned. For example, for warnings where there are no results
  1891. // in a list request for a particular zone, this key might be scope and
  1892. // the key value might be the zone name. Other examples might be a key
  1893. // indicating a deprecated resource, and a suggested replacement, or a
  1894. // warning about invalid network settings (for example, if an instance
  1895. // attempts to perform IP forwarding but is not enabled for IP
  1896. // forwarding).
  1897. Key string `json:"key,omitempty"`
  1898. // Value: [Output Only] A warning data value corresponding to the key.
  1899. Value string `json:"value,omitempty"`
  1900. // ForceSendFields is a list of field names (e.g. "Key") to
  1901. // unconditionally include in API requests. By default, fields with
  1902. // empty values are omitted from API requests. However, any non-pointer,
  1903. // non-interface field appearing in ForceSendFields will be sent to the
  1904. // server regardless of whether the field is empty or not. This may be
  1905. // used to include empty fields in Patch requests.
  1906. ForceSendFields []string `json:"-"`
  1907. }
  1908. func (s *DisksScopedListWarningData) MarshalJSON() ([]byte, error) {
  1909. type noMethod DisksScopedListWarningData
  1910. raw := noMethod(*s)
  1911. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1912. }
  1913. // Firewall: A Firewall resource.
  1914. type Firewall struct {
  1915. // Allowed: The list of rules specified by this firewall. Each rule
  1916. // specifies a protocol and port-range tuple that describes a permitted
  1917. // connection.
  1918. Allowed []*FirewallAllowed `json:"allowed,omitempty"`
  1919. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  1920. // format.
  1921. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  1922. // Description: An optional description of this resource. Provide this
  1923. // property when you create the resource.
  1924. Description string `json:"description,omitempty"`
  1925. // Id: [Output Only] The unique identifier for the resource. This
  1926. // identifier is defined by the server.
  1927. Id uint64 `json:"id,omitempty,string"`
  1928. // Kind: [Output Ony] Type of the resource. Always compute#firewall for
  1929. // firewall rules.
  1930. Kind string `json:"kind,omitempty"`
  1931. // Name: Name of the resource; provided by the client when the resource
  1932. // is created. The name must be 1-63 characters long, and comply with
  1933. // RFC1035. Specifically, the name must be 1-63 characters long and
  1934. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  1935. // the first character must be a lowercase letter, and all following
  1936. // characters must be a dash, lowercase letter, or digit, except the
  1937. // last character, which cannot be a dash.
  1938. Name string `json:"name,omitempty"`
  1939. // Network: URL of the network resource for this firewall rule. If not
  1940. // specified when creating a firewall rule, the default network is
  1941. // used:
  1942. // global/networks/default
  1943. // If you choose to specify this property, you can specify the network
  1944. // as a full or partial URL. For example, the following are all valid
  1945. // URLs:
  1946. // -
  1947. // https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network
  1948. // - projects/myproject/global/networks/my-network
  1949. // - global/networks/default
  1950. Network string `json:"network,omitempty"`
  1951. // SelfLink: [Output Only] Server-defined URL for the resource.
  1952. SelfLink string `json:"selfLink,omitempty"`
  1953. // SourceRanges: The IP address blocks that this rule applies to,
  1954. // expressed in CIDR format. One or both of sourceRanges and sourceTags
  1955. // may be set.
  1956. //
  1957. // If both properties are set, an inbound connection is allowed if the
  1958. // range matches the sourceRanges OR the tag of the source matches the
  1959. // sourceTags property. The connection does not need to match both
  1960. // properties.
  1961. SourceRanges []string `json:"sourceRanges,omitempty"`
  1962. // SourceTags: A list of instance tags which this rule applies to. One
  1963. // or both of sourceRanges and sourceTags may be set.
  1964. //
  1965. // If both properties are set, an inbound connection is allowed if the
  1966. // range matches the sourceRanges OR the tag of the source matches the
  1967. // sourceTags property. The connection does not need to match both
  1968. // properties.
  1969. SourceTags []string `json:"sourceTags,omitempty"`
  1970. // TargetTags: A list of instance tags indicating sets of instances
  1971. // located in the network that may make network connections as specified
  1972. // in allowed[]. If no targetTags are specified, the firewall rule
  1973. // applies to all instances on the specified network.
  1974. TargetTags []string `json:"targetTags,omitempty"`
  1975. // ServerResponse contains the HTTP response code and headers from the
  1976. // server.
  1977. googleapi.ServerResponse `json:"-"`
  1978. // ForceSendFields is a list of field names (e.g. "Allowed") to
  1979. // unconditionally include in API requests. By default, fields with
  1980. // empty values are omitted from API requests. However, any non-pointer,
  1981. // non-interface field appearing in ForceSendFields will be sent to the
  1982. // server regardless of whether the field is empty or not. This may be
  1983. // used to include empty fields in Patch requests.
  1984. ForceSendFields []string `json:"-"`
  1985. }
  1986. func (s *Firewall) MarshalJSON() ([]byte, error) {
  1987. type noMethod Firewall
  1988. raw := noMethod(*s)
  1989. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1990. }
  1991. type FirewallAllowed struct {
  1992. // IPProtocol: The IP protocol that is allowed for this rule. The
  1993. // protocol type is required when creating a firewall. This value can
  1994. // either be one of the following well known protocol strings (tcp, udp,
  1995. // icmp, esp, ah, sctp), or the IP protocol number.
  1996. IPProtocol string `json:"IPProtocol,omitempty"`
  1997. // Ports: An optional list of ports which are allowed. This field is
  1998. // only applicable for UDP or TCP protocol. Each entry must be either an
  1999. // integer or a range. If not specified, connections through any port
  2000. // are allowed
  2001. //
  2002. // Example inputs include: ["22"], ["80","443"], and ["12345-12349"].
  2003. Ports []string `json:"ports,omitempty"`
  2004. // ForceSendFields is a list of field names (e.g. "IPProtocol") to
  2005. // unconditionally include in API requests. By default, fields with
  2006. // empty values are omitted from API requests. However, any non-pointer,
  2007. // non-interface field appearing in ForceSendFields will be sent to the
  2008. // server regardless of whether the field is empty or not. This may be
  2009. // used to include empty fields in Patch requests.
  2010. ForceSendFields []string `json:"-"`
  2011. }
  2012. func (s *FirewallAllowed) MarshalJSON() ([]byte, error) {
  2013. type noMethod FirewallAllowed
  2014. raw := noMethod(*s)
  2015. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2016. }
  2017. // FirewallList: Contains a list of Firewall resources.
  2018. type FirewallList struct {
  2019. // Id: [Output Only] The unique identifier for the resource. This
  2020. // identifier is defined by the server.
  2021. Id string `json:"id,omitempty"`
  2022. // Items: [Output Only] A list of Firewall resources.
  2023. Items []*Firewall `json:"items,omitempty"`
  2024. // Kind: [Output Only] Type of resource. Always compute#firewallList for
  2025. // lists of firewalls.
  2026. Kind string `json:"kind,omitempty"`
  2027. // NextPageToken: [Output Only] This token allows you to get the next
  2028. // page of results for list requests. If the number of results is larger
  2029. // than maxResults, use the nextPageToken as a value for the query
  2030. // parameter pageToken in the next list request. Subsequent list
  2031. // requests will have their own nextPageToken to continue paging through
  2032. // the results.
  2033. NextPageToken string `json:"nextPageToken,omitempty"`
  2034. // SelfLink: [Output Only] Server-defined URL for this resource.
  2035. SelfLink string `json:"selfLink,omitempty"`
  2036. // ServerResponse contains the HTTP response code and headers from the
  2037. // server.
  2038. googleapi.ServerResponse `json:"-"`
  2039. // ForceSendFields is a list of field names (e.g. "Id") to
  2040. // unconditionally include in API requests. By default, fields with
  2041. // empty values are omitted from API requests. However, any non-pointer,
  2042. // non-interface field appearing in ForceSendFields will be sent to the
  2043. // server regardless of whether the field is empty or not. This may be
  2044. // used to include empty fields in Patch requests.
  2045. ForceSendFields []string `json:"-"`
  2046. }
  2047. func (s *FirewallList) MarshalJSON() ([]byte, error) {
  2048. type noMethod FirewallList
  2049. raw := noMethod(*s)
  2050. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2051. }
  2052. // ForwardingRule: A ForwardingRule resource. A ForwardingRule resource
  2053. // specifies which pool of target virtual machines to forward a packet
  2054. // to if it matches the given [IPAddress, IPProtocol, portRange] tuple.
  2055. type ForwardingRule struct {
  2056. // IPAddress: Value of the reserved IP address that this forwarding rule
  2057. // is serving on behalf of. For global forwarding rules, the address
  2058. // must be a global IP; for regional forwarding rules, the address must
  2059. // live in the same region as the forwarding rule. If left empty
  2060. // (default value), an ephemeral IP from the same scope (global or
  2061. // regional) will be assigned.
  2062. IPAddress string `json:"IPAddress,omitempty"`
  2063. // IPProtocol: The IP protocol to which this rule applies. Valid options
  2064. // are TCP, UDP, ESP, AH or SCTP.
  2065. //
  2066. // Possible values:
  2067. // "AH"
  2068. // "ESP"
  2069. // "SCTP"
  2070. // "TCP"
  2071. // "UDP"
  2072. IPProtocol string `json:"IPProtocol,omitempty"`
  2073. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  2074. // format.
  2075. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  2076. // Description: An optional description of this resource. Provide this
  2077. // property when you create the resource.
  2078. Description string `json:"description,omitempty"`
  2079. // Id: [Output Only] The unique identifier for the resource. This
  2080. // identifier is defined by the server.
  2081. Id uint64 `json:"id,omitempty,string"`
  2082. // Kind: [Output Only] Type of the resource. Always
  2083. // compute#forwardingRule for Forwarding Rule resources.
  2084. Kind string `json:"kind,omitempty"`
  2085. // Name: Name of the resource; provided by the client when the resource
  2086. // is created. The name must be 1-63 characters long, and comply with
  2087. // RFC1035. Specifically, the name must be 1-63 characters long and
  2088. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  2089. // the first character must be a lowercase letter, and all following
  2090. // characters must be a dash, lowercase letter, or digit, except the
  2091. // last character, which cannot be a dash.
  2092. Name string `json:"name,omitempty"`
  2093. // PortRange: Applicable only when IPProtocol is TCP, UDP, or SCTP, only
  2094. // packets addressed to ports in the specified range will be forwarded
  2095. // to target. Forwarding rules with the same [IPAddress, IPProtocol]
  2096. // pair must have disjoint port ranges.
  2097. PortRange string `json:"portRange,omitempty"`
  2098. // Region: [Output Only] URL of the region where the regional forwarding
  2099. // rule resides. This field is not applicable to global forwarding
  2100. // rules.
  2101. Region string `json:"region,omitempty"`
  2102. // SelfLink: [Output Only] Server-defined URL for the resource.
  2103. SelfLink string `json:"selfLink,omitempty"`
  2104. // Target: The URL of the target resource to receive the matched
  2105. // traffic. For regional forwarding rules, this target must live in the
  2106. // same region as the forwarding rule. For global forwarding rules, this
  2107. // target must be a global TargetHttpProxy or TargetHttpsProxy resource.
  2108. // The forwarded traffic must be of a type appropriate to the target
  2109. // object. For example, TargetHttpProxy requires HTTP traffic, and
  2110. // TargetHttpsProxy requires HTTPS traffic.
  2111. Target string `json:"target,omitempty"`
  2112. // ServerResponse contains the HTTP response code and headers from the
  2113. // server.
  2114. googleapi.ServerResponse `json:"-"`
  2115. // ForceSendFields is a list of field names (e.g. "IPAddress") to
  2116. // unconditionally include in API requests. By default, fields with
  2117. // empty values are omitted from API requests. However, any non-pointer,
  2118. // non-interface field appearing in ForceSendFields will be sent to the
  2119. // server regardless of whether the field is empty or not. This may be
  2120. // used to include empty fields in Patch requests.
  2121. ForceSendFields []string `json:"-"`
  2122. }
  2123. func (s *ForwardingRule) MarshalJSON() ([]byte, error) {
  2124. type noMethod ForwardingRule
  2125. raw := noMethod(*s)
  2126. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2127. }
  2128. type ForwardingRuleAggregatedList struct {
  2129. // Id: [Output Only] The unique identifier for the resource. This
  2130. // identifier is defined by the server.
  2131. Id string `json:"id,omitempty"`
  2132. // Items: A map of scoped forwarding rule lists.
  2133. Items map[string]ForwardingRulesScopedList `json:"items,omitempty"`
  2134. // Kind: Type of resource.
  2135. Kind string `json:"kind,omitempty"`
  2136. // NextPageToken: [Output Only] This token allows you to get the next
  2137. // page of results for list requests. If the number of results is larger
  2138. // than maxResults, use the nextPageToken as a value for the query
  2139. // parameter pageToken in the next list request. Subsequent list
  2140. // requests will have their own nextPageToken to continue paging through
  2141. // the results.
  2142. NextPageToken string `json:"nextPageToken,omitempty"`
  2143. // SelfLink: [Output Only] Server-defined URL for this resource.
  2144. SelfLink string `json:"selfLink,omitempty"`
  2145. // ServerResponse contains the HTTP response code and headers from the
  2146. // server.
  2147. googleapi.ServerResponse `json:"-"`
  2148. // ForceSendFields is a list of field names (e.g. "Id") to
  2149. // unconditionally include in API requests. By default, fields with
  2150. // empty values are omitted from API requests. However, any non-pointer,
  2151. // non-interface field appearing in ForceSendFields will be sent to the
  2152. // server regardless of whether the field is empty or not. This may be
  2153. // used to include empty fields in Patch requests.
  2154. ForceSendFields []string `json:"-"`
  2155. }
  2156. func (s *ForwardingRuleAggregatedList) MarshalJSON() ([]byte, error) {
  2157. type noMethod ForwardingRuleAggregatedList
  2158. raw := noMethod(*s)
  2159. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2160. }
  2161. // ForwardingRuleList: Contains a list of ForwardingRule resources.
  2162. type ForwardingRuleList struct {
  2163. // Id: [Output Only] Unique identifier for the resource. Set by the
  2164. // server.
  2165. Id string `json:"id,omitempty"`
  2166. // Items: A list of ForwardingRule resources.
  2167. Items []*ForwardingRule `json:"items,omitempty"`
  2168. // Kind: Type of resource.
  2169. Kind string `json:"kind,omitempty"`
  2170. // NextPageToken: [Output Only] This token allows you to get the next
  2171. // page of results for list requests. If the number of results is larger
  2172. // than maxResults, use the nextPageToken as a value for the query
  2173. // parameter pageToken in the next list request. Subsequent list
  2174. // requests will have their own nextPageToken to continue paging through
  2175. // the results.
  2176. NextPageToken string `json:"nextPageToken,omitempty"`
  2177. // SelfLink: [Output Only] Server-defined URL for this resource.
  2178. SelfLink string `json:"selfLink,omitempty"`
  2179. // ServerResponse contains the HTTP response code and headers from the
  2180. // server.
  2181. googleapi.ServerResponse `json:"-"`
  2182. // ForceSendFields is a list of field names (e.g. "Id") to
  2183. // unconditionally include in API requests. By default, fields with
  2184. // empty values are omitted from API requests. However, any non-pointer,
  2185. // non-interface field appearing in ForceSendFields will be sent to the
  2186. // server regardless of whether the field is empty or not. This may be
  2187. // used to include empty fields in Patch requests.
  2188. ForceSendFields []string `json:"-"`
  2189. }
  2190. func (s *ForwardingRuleList) MarshalJSON() ([]byte, error) {
  2191. type noMethod ForwardingRuleList
  2192. raw := noMethod(*s)
  2193. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2194. }
  2195. type ForwardingRulesScopedList struct {
  2196. // ForwardingRules: List of forwarding rules contained in this scope.
  2197. ForwardingRules []*ForwardingRule `json:"forwardingRules,omitempty"`
  2198. // Warning: Informational warning which replaces the list of forwarding
  2199. // rules when the list is empty.
  2200. Warning *ForwardingRulesScopedListWarning `json:"warning,omitempty"`
  2201. // ForceSendFields is a list of field names (e.g. "ForwardingRules") to
  2202. // unconditionally include in API requests. By default, fields with
  2203. // empty values are omitted from API requests. However, any non-pointer,
  2204. // non-interface field appearing in ForceSendFields will be sent to the
  2205. // server regardless of whether the field is empty or not. This may be
  2206. // used to include empty fields in Patch requests.
  2207. ForceSendFields []string `json:"-"`
  2208. }
  2209. func (s *ForwardingRulesScopedList) MarshalJSON() ([]byte, error) {
  2210. type noMethod ForwardingRulesScopedList
  2211. raw := noMethod(*s)
  2212. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2213. }
  2214. // ForwardingRulesScopedListWarning: Informational warning which
  2215. // replaces the list of forwarding rules when the list is empty.
  2216. type ForwardingRulesScopedListWarning struct {
  2217. // Code: [Output Only] A warning code, if applicable. For example,
  2218. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  2219. // the response.
  2220. //
  2221. // Possible values:
  2222. // "DEPRECATED_RESOURCE_USED"
  2223. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  2224. // "INJECTED_KERNELS_DEPRECATED"
  2225. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  2226. // "NEXT_HOP_CANNOT_IP_FORWARD"
  2227. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  2228. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  2229. // "NEXT_HOP_NOT_RUNNING"
  2230. // "NOT_CRITICAL_ERROR"
  2231. // "NO_RESULTS_ON_PAGE"
  2232. // "REQUIRED_TOS_AGREEMENT"
  2233. // "RESOURCE_NOT_DELETED"
  2234. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  2235. // "UNREACHABLE"
  2236. Code string `json:"code,omitempty"`
  2237. // Data: [Output Only] Metadata about this warning in key: value format.
  2238. // For example:
  2239. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  2240. Data []*ForwardingRulesScopedListWarningData `json:"data,omitempty"`
  2241. // Message: [Output Only] A human-readable description of the warning
  2242. // code.
  2243. Message string `json:"message,omitempty"`
  2244. // ForceSendFields is a list of field names (e.g. "Code") to
  2245. // unconditionally include in API requests. By default, fields with
  2246. // empty values are omitted from API requests. However, any non-pointer,
  2247. // non-interface field appearing in ForceSendFields will be sent to the
  2248. // server regardless of whether the field is empty or not. This may be
  2249. // used to include empty fields in Patch requests.
  2250. ForceSendFields []string `json:"-"`
  2251. }
  2252. func (s *ForwardingRulesScopedListWarning) MarshalJSON() ([]byte, error) {
  2253. type noMethod ForwardingRulesScopedListWarning
  2254. raw := noMethod(*s)
  2255. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2256. }
  2257. type ForwardingRulesScopedListWarningData struct {
  2258. // Key: [Output Only] A key that provides more detail on the warning
  2259. // being returned. For example, for warnings where there are no results
  2260. // in a list request for a particular zone, this key might be scope and
  2261. // the key value might be the zone name. Other examples might be a key
  2262. // indicating a deprecated resource, and a suggested replacement, or a
  2263. // warning about invalid network settings (for example, if an instance
  2264. // attempts to perform IP forwarding but is not enabled for IP
  2265. // forwarding).
  2266. Key string `json:"key,omitempty"`
  2267. // Value: [Output Only] A warning data value corresponding to the key.
  2268. Value string `json:"value,omitempty"`
  2269. // ForceSendFields is a list of field names (e.g. "Key") to
  2270. // unconditionally include in API requests. By default, fields with
  2271. // empty values are omitted from API requests. However, any non-pointer,
  2272. // non-interface field appearing in ForceSendFields will be sent to the
  2273. // server regardless of whether the field is empty or not. This may be
  2274. // used to include empty fields in Patch requests.
  2275. ForceSendFields []string `json:"-"`
  2276. }
  2277. func (s *ForwardingRulesScopedListWarningData) MarshalJSON() ([]byte, error) {
  2278. type noMethod ForwardingRulesScopedListWarningData
  2279. raw := noMethod(*s)
  2280. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2281. }
  2282. type HealthCheckReference struct {
  2283. HealthCheck string `json:"healthCheck,omitempty"`
  2284. // ForceSendFields is a list of field names (e.g. "HealthCheck") to
  2285. // unconditionally include in API requests. By default, fields with
  2286. // empty values are omitted from API requests. However, any non-pointer,
  2287. // non-interface field appearing in ForceSendFields will be sent to the
  2288. // server regardless of whether the field is empty or not. This may be
  2289. // used to include empty fields in Patch requests.
  2290. ForceSendFields []string `json:"-"`
  2291. }
  2292. func (s *HealthCheckReference) MarshalJSON() ([]byte, error) {
  2293. type noMethod HealthCheckReference
  2294. raw := noMethod(*s)
  2295. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2296. }
  2297. type HealthStatus struct {
  2298. // HealthState: Health state of the instance.
  2299. //
  2300. // Possible values:
  2301. // "HEALTHY"
  2302. // "UNHEALTHY"
  2303. HealthState string `json:"healthState,omitempty"`
  2304. // Instance: URL of the instance resource.
  2305. Instance string `json:"instance,omitempty"`
  2306. // IpAddress: The IP address represented by this resource.
  2307. IpAddress string `json:"ipAddress,omitempty"`
  2308. // Port: The port on the instance.
  2309. Port int64 `json:"port,omitempty"`
  2310. // ForceSendFields is a list of field names (e.g. "HealthState") to
  2311. // unconditionally include in API requests. By default, fields with
  2312. // empty values are omitted from API requests. However, any non-pointer,
  2313. // non-interface field appearing in ForceSendFields will be sent to the
  2314. // server regardless of whether the field is empty or not. This may be
  2315. // used to include empty fields in Patch requests.
  2316. ForceSendFields []string `json:"-"`
  2317. }
  2318. func (s *HealthStatus) MarshalJSON() ([]byte, error) {
  2319. type noMethod HealthStatus
  2320. raw := noMethod(*s)
  2321. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2322. }
  2323. // HostRule: UrlMaps A host-matching rule for a URL. If matched, will
  2324. // use the named PathMatcher to select the BackendService.
  2325. type HostRule struct {
  2326. // Description: An optional description of this resource. Provide this
  2327. // property when you create the resource.
  2328. Description string `json:"description,omitempty"`
  2329. // Hosts: The list of host patterns to match. They must be valid
  2330. // hostnames, except * will match any string of ([a-z0-9-.]*). In that
  2331. // case, * must be the first character and must be followed in the
  2332. // pattern by either - or ..
  2333. Hosts []string `json:"hosts,omitempty"`
  2334. // PathMatcher: The name of the PathMatcher to use to match the path
  2335. // portion of the URL if the hostRule matches the URL's host portion.
  2336. PathMatcher string `json:"pathMatcher,omitempty"`
  2337. // ForceSendFields is a list of field names (e.g. "Description") to
  2338. // unconditionally include in API requests. By default, fields with
  2339. // empty values are omitted from API requests. However, any non-pointer,
  2340. // non-interface field appearing in ForceSendFields will be sent to the
  2341. // server regardless of whether the field is empty or not. This may be
  2342. // used to include empty fields in Patch requests.
  2343. ForceSendFields []string `json:"-"`
  2344. }
  2345. func (s *HostRule) MarshalJSON() ([]byte, error) {
  2346. type noMethod HostRule
  2347. raw := noMethod(*s)
  2348. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2349. }
  2350. // HttpHealthCheck: An HttpHealthCheck resource. This resource defines a
  2351. // template for how individual instances should be checked for health,
  2352. // via HTTP.
  2353. type HttpHealthCheck struct {
  2354. // CheckIntervalSec: How often (in seconds) to send a health check. The
  2355. // default value is 5 seconds.
  2356. CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"`
  2357. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  2358. // format.
  2359. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  2360. // Description: An optional description of this resource. Provide this
  2361. // property when you create the resource.
  2362. Description string `json:"description,omitempty"`
  2363. // HealthyThreshold: A so-far unhealthy instance will be marked healthy
  2364. // after this many consecutive successes. The default value is 2.
  2365. HealthyThreshold int64 `json:"healthyThreshold,omitempty"`
  2366. // Host: The value of the host header in the HTTP health check request.
  2367. // If left empty (default value), the public IP on behalf of which this
  2368. // health check is performed will be used.
  2369. Host string `json:"host,omitempty"`
  2370. // Id: [Output Only] The unique identifier for the resource. This
  2371. // identifier is defined by the server.
  2372. Id uint64 `json:"id,omitempty,string"`
  2373. // Kind: Type of the resource.
  2374. Kind string `json:"kind,omitempty"`
  2375. // Name: Name of the resource. Provided by the client when the resource
  2376. // is created. The name must be 1-63 characters long, and comply with
  2377. // RFC1035. Specifically, the name must be 1-63 characters long and
  2378. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  2379. // the first character must be a lowercase letter, and all following
  2380. // characters must be a dash, lowercase letter, or digit, except the
  2381. // last character, which cannot be a dash.
  2382. Name string `json:"name,omitempty"`
  2383. // Port: The TCP port number for the HTTP health check request. The
  2384. // default value is 80.
  2385. Port int64 `json:"port,omitempty"`
  2386. // RequestPath: The request path of the HTTP health check request. The
  2387. // default value is "/".
  2388. RequestPath string `json:"requestPath,omitempty"`
  2389. // SelfLink: [Output Only] Server-defined URL for the resource.
  2390. SelfLink string `json:"selfLink,omitempty"`
  2391. // TimeoutSec: How long (in seconds) to wait before claiming failure.
  2392. // The default value is 5 seconds. It is invalid for timeoutSec to have
  2393. // greater value than checkIntervalSec.
  2394. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  2395. // UnhealthyThreshold: A so-far healthy instance will be marked
  2396. // unhealthy after this many consecutive failures. The default value is
  2397. // 2.
  2398. UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"`
  2399. // ServerResponse contains the HTTP response code and headers from the
  2400. // server.
  2401. googleapi.ServerResponse `json:"-"`
  2402. // ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to
  2403. // unconditionally include in API requests. By default, fields with
  2404. // empty values are omitted from API requests. However, any non-pointer,
  2405. // non-interface field appearing in ForceSendFields will be sent to the
  2406. // server regardless of whether the field is empty or not. This may be
  2407. // used to include empty fields in Patch requests.
  2408. ForceSendFields []string `json:"-"`
  2409. }
  2410. func (s *HttpHealthCheck) MarshalJSON() ([]byte, error) {
  2411. type noMethod HttpHealthCheck
  2412. raw := noMethod(*s)
  2413. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2414. }
  2415. // HttpHealthCheckList: Contains a list of HttpHealthCheck resources.
  2416. type HttpHealthCheckList struct {
  2417. // Id: [Output Only] Unique identifier for the resource. Defined by the
  2418. // server.
  2419. Id string `json:"id,omitempty"`
  2420. // Items: A list of HttpHealthCheck resources.
  2421. Items []*HttpHealthCheck `json:"items,omitempty"`
  2422. // Kind: Type of resource.
  2423. Kind string `json:"kind,omitempty"`
  2424. // NextPageToken: [Output Only] This token allows you to get the next
  2425. // page of results for list requests. If the number of results is larger
  2426. // than maxResults, use the nextPageToken as a value for the query
  2427. // parameter pageToken in the next list request. Subsequent list
  2428. // requests will have their own nextPageToken to continue paging through
  2429. // the results.
  2430. NextPageToken string `json:"nextPageToken,omitempty"`
  2431. // SelfLink: [Output Only] Server-defined URL for this resource.
  2432. SelfLink string `json:"selfLink,omitempty"`
  2433. // ServerResponse contains the HTTP response code and headers from the
  2434. // server.
  2435. googleapi.ServerResponse `json:"-"`
  2436. // ForceSendFields is a list of field names (e.g. "Id") to
  2437. // unconditionally include in API requests. By default, fields with
  2438. // empty values are omitted from API requests. However, any non-pointer,
  2439. // non-interface field appearing in ForceSendFields will be sent to the
  2440. // server regardless of whether the field is empty or not. This may be
  2441. // used to include empty fields in Patch requests.
  2442. ForceSendFields []string `json:"-"`
  2443. }
  2444. func (s *HttpHealthCheckList) MarshalJSON() ([]byte, error) {
  2445. type noMethod HttpHealthCheckList
  2446. raw := noMethod(*s)
  2447. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2448. }
  2449. // HttpsHealthCheck: An HttpsHealthCheck resource. This resource defines
  2450. // a template for how individual instances should be checked for health,
  2451. // via HTTPS.
  2452. type HttpsHealthCheck struct {
  2453. // CheckIntervalSec: How often (in seconds) to send a health check. The
  2454. // default value is 5 seconds.
  2455. CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"`
  2456. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  2457. // format.
  2458. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  2459. // Description: An optional description of this resource. Provide this
  2460. // property when you create the resource.
  2461. Description string `json:"description,omitempty"`
  2462. // HealthyThreshold: A so-far unhealthy instance will be marked healthy
  2463. // after this many consecutive successes. The default value is 2.
  2464. HealthyThreshold int64 `json:"healthyThreshold,omitempty"`
  2465. // Host: The value of the host header in the HTTPS health check request.
  2466. // If left empty (default value), the public IP on behalf of which this
  2467. // health check is performed will be used.
  2468. Host string `json:"host,omitempty"`
  2469. // Id: [Output Only] The unique identifier for the resource. This
  2470. // identifier is defined by the server.
  2471. Id uint64 `json:"id,omitempty,string"`
  2472. // Kind: Type of the resource.
  2473. Kind string `json:"kind,omitempty"`
  2474. // Name: Name of the resource. Provided by the client when the resource
  2475. // is created. The name must be 1-63 characters long, and comply with
  2476. // RFC1035. Specifically, the name must be 1-63 characters long and
  2477. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  2478. // the first character must be a lowercase letter, and all following
  2479. // characters must be a dash, lowercase letter, or digit, except the
  2480. // last character, which cannot be a dash.
  2481. Name string `json:"name,omitempty"`
  2482. // Port: The TCP port number for the HTTPS health check request. The
  2483. // default value is 443.
  2484. Port int64 `json:"port,omitempty"`
  2485. // RequestPath: The request path of the HTTPS health check request. The
  2486. // default value is "/".
  2487. RequestPath string `json:"requestPath,omitempty"`
  2488. // SelfLink: [Output Only] Server-defined URL for the resource.
  2489. SelfLink string `json:"selfLink,omitempty"`
  2490. // TimeoutSec: How long (in seconds) to wait before claiming failure.
  2491. // The default value is 5 seconds. It is invalid for timeoutSec to have
  2492. // a greater value than checkIntervalSec.
  2493. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  2494. // UnhealthyThreshold: A so-far healthy instance will be marked
  2495. // unhealthy after this many consecutive failures. The default value is
  2496. // 2.
  2497. UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"`
  2498. // ServerResponse contains the HTTP response code and headers from the
  2499. // server.
  2500. googleapi.ServerResponse `json:"-"`
  2501. // ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to
  2502. // unconditionally include in API requests. By default, fields with
  2503. // empty values are omitted from API requests. However, any non-pointer,
  2504. // non-interface field appearing in ForceSendFields will be sent to the
  2505. // server regardless of whether the field is empty or not. This may be
  2506. // used to include empty fields in Patch requests.
  2507. ForceSendFields []string `json:"-"`
  2508. }
  2509. func (s *HttpsHealthCheck) MarshalJSON() ([]byte, error) {
  2510. type noMethod HttpsHealthCheck
  2511. raw := noMethod(*s)
  2512. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2513. }
  2514. // HttpsHealthCheckList: Contains a list of HttpsHealthCheck resources.
  2515. type HttpsHealthCheckList struct {
  2516. // Id: [Output Only] Unique identifier for the resource; defined by the
  2517. // server.
  2518. Id string `json:"id,omitempty"`
  2519. // Items: A list of HttpsHealthCheck resources.
  2520. Items []*HttpsHealthCheck `json:"items,omitempty"`
  2521. // Kind: Type of resource.
  2522. Kind string `json:"kind,omitempty"`
  2523. // NextPageToken: [Output Only] This token allows you to get the next
  2524. // page of results for list requests. If the number of results is larger
  2525. // than maxResults, use the nextPageToken as a value for the query
  2526. // parameter pageToken in the next list request. Subsequent list
  2527. // requests will have their own nextPageToken to continue paging through
  2528. // the results.
  2529. NextPageToken string `json:"nextPageToken,omitempty"`
  2530. // SelfLink: [Output Only] Server-defined URL for this resource.
  2531. SelfLink string `json:"selfLink,omitempty"`
  2532. // ServerResponse contains the HTTP response code and headers from the
  2533. // server.
  2534. googleapi.ServerResponse `json:"-"`
  2535. // ForceSendFields is a list of field names (e.g. "Id") to
  2536. // unconditionally include in API requests. By default, fields with
  2537. // empty values are omitted from API requests. However, any non-pointer,
  2538. // non-interface field appearing in ForceSendFields will be sent to the
  2539. // server regardless of whether the field is empty or not. This may be
  2540. // used to include empty fields in Patch requests.
  2541. ForceSendFields []string `json:"-"`
  2542. }
  2543. func (s *HttpsHealthCheckList) MarshalJSON() ([]byte, error) {
  2544. type noMethod HttpsHealthCheckList
  2545. raw := noMethod(*s)
  2546. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2547. }
  2548. // Image: An Image resource.
  2549. type Image struct {
  2550. // ArchiveSizeBytes: Size of the image tar.gz archive stored in Google
  2551. // Cloud Storage (in bytes).
  2552. ArchiveSizeBytes int64 `json:"archiveSizeBytes,omitempty,string"`
  2553. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  2554. // format.
  2555. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  2556. // Deprecated: The deprecation status associated with this image.
  2557. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  2558. // Description: An optional description of this resource. Provide this
  2559. // property when you create the resource.
  2560. Description string `json:"description,omitempty"`
  2561. // DiskSizeGb: Size of the image when restored onto a persistent disk
  2562. // (in GB).
  2563. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  2564. // Id: [Output Only] The unique identifier for the resource. This
  2565. // identifier is defined by the server.
  2566. Id uint64 `json:"id,omitempty,string"`
  2567. // ImageEncryptionKey: Encrypts the image using a customer-supplied
  2568. // encryption key.
  2569. //
  2570. // If you encrypt an image using a customer-supplied encryption key, and
  2571. // you want to use the image later (e.g. to create a disk from the
  2572. // image), you must provide the same key used encrypt the image in your
  2573. // future request. If you provide an incorrect key, or no key, the
  2574. // operation will fail.
  2575. //
  2576. // Customer-supplied encryption keys do not protect access to metadata
  2577. // of the disk.
  2578. //
  2579. // If no customer-supplied encryption key is provided at creation, then
  2580. // the disk will be encrypted using an automatically generated key and
  2581. // you do not need to provide a key to use the image later.
  2582. ImageEncryptionKey *CustomerEncryptionKey `json:"imageEncryptionKey,omitempty"`
  2583. // Kind: [Output Only] Type of the resource. Always compute#image for
  2584. // images.
  2585. Kind string `json:"kind,omitempty"`
  2586. // Licenses: Any applicable publicly visible licenses.
  2587. Licenses []string `json:"licenses,omitempty"`
  2588. // Name: Name of the resource; provided by the client when the resource
  2589. // is created. The name must be 1-63 characters long, and comply with
  2590. // RFC1035. Specifically, the name must be 1-63 characters long and
  2591. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  2592. // the first character must be a lowercase letter, and all following
  2593. // characters must be a dash, lowercase letter, or digit, except the
  2594. // last character, which cannot be a dash.
  2595. Name string `json:"name,omitempty"`
  2596. // RawDisk: The parameters of the raw disk image.
  2597. RawDisk *ImageRawDisk `json:"rawDisk,omitempty"`
  2598. // SelfLink: [Output Only] Server-defined URL for the resource.
  2599. SelfLink string `json:"selfLink,omitempty"`
  2600. // SourceDisk: URL of the The source disk used to create this image.
  2601. // This can be a full or valid partial URL. You must provide either this
  2602. // property or the rawDisk.source property but not both to create an
  2603. // image. For example, the following are valid values:
  2604. // -
  2605. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/disk/disk
  2606. // - projects/project/zones/zone/disk/disk
  2607. // - zones/zone/disks/disk
  2608. SourceDisk string `json:"sourceDisk,omitempty"`
  2609. // SourceDiskEncryptionKey: Specifies the customer-supplied encryption
  2610. // key of the source disk. This key is required if the source disk is
  2611. // protected by a customer-supplied encryption key.
  2612. //
  2613. // If the incorrect key is provided the operation will fail.
  2614. SourceDiskEncryptionKey *CustomerEncryptionKey `json:"sourceDiskEncryptionKey,omitempty"`
  2615. // SourceDiskId: The ID value of the disk used to create this image.
  2616. // This value may be used to determine whether the image was taken from
  2617. // the current or a previous instance of a given disk name.
  2618. SourceDiskId string `json:"sourceDiskId,omitempty"`
  2619. // SourceType: The type of the image used to create this disk. The
  2620. // default and only value is RAW
  2621. //
  2622. // Possible values:
  2623. // "RAW" (default)
  2624. SourceType string `json:"sourceType,omitempty"`
  2625. // Status: [Output Only] The status of the image. An image can be used
  2626. // to create other resources, such as instances, only after the image
  2627. // has been successfully created and the status is set to READY.
  2628. // Possible values are FAILED, PENDING, or READY.
  2629. //
  2630. // Possible values:
  2631. // "FAILED"
  2632. // "PENDING"
  2633. // "READY"
  2634. Status string `json:"status,omitempty"`
  2635. // ServerResponse contains the HTTP response code and headers from the
  2636. // server.
  2637. googleapi.ServerResponse `json:"-"`
  2638. // ForceSendFields is a list of field names (e.g. "ArchiveSizeBytes") to
  2639. // unconditionally include in API requests. By default, fields with
  2640. // empty values are omitted from API requests. However, any non-pointer,
  2641. // non-interface field appearing in ForceSendFields will be sent to the
  2642. // server regardless of whether the field is empty or not. This may be
  2643. // used to include empty fields in Patch requests.
  2644. ForceSendFields []string `json:"-"`
  2645. }
  2646. func (s *Image) MarshalJSON() ([]byte, error) {
  2647. type noMethod Image
  2648. raw := noMethod(*s)
  2649. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2650. }
  2651. // ImageRawDisk: The parameters of the raw disk image.
  2652. type ImageRawDisk struct {
  2653. // ContainerType: The format used to encode and transmit the block
  2654. // device, which should be TAR. This is just a container and
  2655. // transmission format and not a runtime format. Provided by the client
  2656. // when the disk image is created.
  2657. //
  2658. // Possible values:
  2659. // "TAR"
  2660. ContainerType string `json:"containerType,omitempty"`
  2661. // Sha1Checksum: An optional SHA1 checksum of the disk image before
  2662. // unpackaging; provided by the client when the disk image is created.
  2663. Sha1Checksum string `json:"sha1Checksum,omitempty"`
  2664. // Source: The full Google Cloud Storage URL where the disk image is
  2665. // stored. You must provide either this property or the sourceDisk
  2666. // property but not both.
  2667. Source string `json:"source,omitempty"`
  2668. // ForceSendFields is a list of field names (e.g. "ContainerType") to
  2669. // unconditionally include in API requests. By default, fields with
  2670. // empty values are omitted from API requests. However, any non-pointer,
  2671. // non-interface field appearing in ForceSendFields will be sent to the
  2672. // server regardless of whether the field is empty or not. This may be
  2673. // used to include empty fields in Patch requests.
  2674. ForceSendFields []string `json:"-"`
  2675. }
  2676. func (s *ImageRawDisk) MarshalJSON() ([]byte, error) {
  2677. type noMethod ImageRawDisk
  2678. raw := noMethod(*s)
  2679. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2680. }
  2681. // ImageList: Contains a list of Image resources.
  2682. type ImageList struct {
  2683. // Id: [Output Only] The unique identifier for the resource. This
  2684. // identifier is defined by the server.
  2685. Id string `json:"id,omitempty"`
  2686. // Items: [Output Only] A list of Image resources.
  2687. Items []*Image `json:"items,omitempty"`
  2688. // Kind: Type of resource.
  2689. Kind string `json:"kind,omitempty"`
  2690. // NextPageToken: [Output Only] This token allows you to get the next
  2691. // page of results for list requests. If the number of results is larger
  2692. // than maxResults, use the nextPageToken as a value for the query
  2693. // parameter pageToken in the next list request. Subsequent list
  2694. // requests will have their own nextPageToken to continue paging through
  2695. // the results.
  2696. NextPageToken string `json:"nextPageToken,omitempty"`
  2697. // SelfLink: [Output Only] Server-defined URL for this resource.
  2698. SelfLink string `json:"selfLink,omitempty"`
  2699. // ServerResponse contains the HTTP response code and headers from the
  2700. // server.
  2701. googleapi.ServerResponse `json:"-"`
  2702. // ForceSendFields is a list of field names (e.g. "Id") to
  2703. // unconditionally include in API requests. By default, fields with
  2704. // empty values are omitted from API requests. However, any non-pointer,
  2705. // non-interface field appearing in ForceSendFields will be sent to the
  2706. // server regardless of whether the field is empty or not. This may be
  2707. // used to include empty fields in Patch requests.
  2708. ForceSendFields []string `json:"-"`
  2709. }
  2710. func (s *ImageList) MarshalJSON() ([]byte, error) {
  2711. type noMethod ImageList
  2712. raw := noMethod(*s)
  2713. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2714. }
  2715. // Instance: An Instance resource.
  2716. type Instance struct {
  2717. // CanIpForward: Allows this instance to send and receive packets with
  2718. // non-matching destination or source IPs. This is required if you plan
  2719. // to use this instance to forward routes. For more information, see
  2720. // Enabling IP Forwarding.
  2721. CanIpForward bool `json:"canIpForward,omitempty"`
  2722. // CpuPlatform: [Output Only] The CPU platform used by this instance.
  2723. CpuPlatform string `json:"cpuPlatform,omitempty"`
  2724. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  2725. // format.
  2726. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  2727. // Description: An optional description of this resource. Provide this
  2728. // property when you create the resource.
  2729. Description string `json:"description,omitempty"`
  2730. // Disks: Array of disks associated with this instance. Persistent disks
  2731. // must be created before you can assign them.
  2732. Disks []*AttachedDisk `json:"disks,omitempty"`
  2733. // Id: [Output Only] The unique identifier for the resource. This
  2734. // identifier is defined by the server.
  2735. Id uint64 `json:"id,omitempty,string"`
  2736. // Kind: [Output Only] Type of the resource. Always compute#instance for
  2737. // instances.
  2738. Kind string `json:"kind,omitempty"`
  2739. // LabelFingerprint: A fingerprint for this request, which is
  2740. // essentially a hash of the metadata's contents and used for optimistic
  2741. // locking. The fingerprint is initially generated by Compute Engine and
  2742. // changes after every request to modify or update metadata. You must
  2743. // always provide an up-to-date fingerprint hash in order to update or
  2744. // change metadata.
  2745. //
  2746. // To see the latest fingerprint, make get() request to the instance.
  2747. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  2748. // Labels: Labels to apply to this instance. These can be later modified
  2749. // by the setLabels method. Each label key/value pair must comply with
  2750. // RFC1035. Label values may be empty.
  2751. Labels map[string]string `json:"labels,omitempty"`
  2752. // MachineType: Full or partial URL of the machine type resource to use
  2753. // for this instance, in the format: zones/zone/machineTypes/
  2754. // machine-type. This is provided by the client when the instance is
  2755. // created. For example, the following is a valid partial url to a
  2756. // predefined machine
  2757. // type:
  2758. //
  2759. // zones/us-central1-f/machineTypes/n1-standard-1
  2760. //
  2761. // To create a custom machine type, provide a URL to a machine type in
  2762. // the following format, where CPUS is 1 or an even number up to 32 (2,
  2763. // 4, 6, ... 24, etc), and MEMORY is the total memory for this instance.
  2764. // Memory must be a multiple of 256 MB and must be supplied in MB (e.g.
  2765. // 5 GB of memory is 5120
  2766. // MB):
  2767. //
  2768. // zones/zone/machineTypes/custom-CPUS-MEMORY
  2769. //
  2770. // For example: zones/us-central1-f/machineTypes/custom-4-5120
  2771. //
  2772. // For a full list of restrictions, read the Specifications for custom
  2773. // machine types.
  2774. MachineType string `json:"machineType,omitempty"`
  2775. // Metadata: The metadata key/value pairs assigned to this instance.
  2776. // This includes custom metadata and predefined keys.
  2777. Metadata *Metadata `json:"metadata,omitempty"`
  2778. // Name: The name of the resource, provided by the client when initially
  2779. // creating the resource. The resource name must be 1-63 characters
  2780. // long, and comply with RFC1035. Specifically, the name must be 1-63
  2781. // characters long and match the regular expression
  2782. // [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a
  2783. // lowercase letter, and all following characters must be a dash,
  2784. // lowercase letter, or digit, except the last character, which cannot
  2785. // be a dash.
  2786. Name string `json:"name,omitempty"`
  2787. // NetworkInterfaces: An array of configurations for this interface.
  2788. // This specifies how this interface is configured to interact with
  2789. // other network services, such as connecting to the internet.
  2790. NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"`
  2791. // Scheduling: Scheduling options for this instance.
  2792. Scheduling *Scheduling `json:"scheduling,omitempty"`
  2793. // SelfLink: [Output Only] Server-defined URL for this resource.
  2794. SelfLink string `json:"selfLink,omitempty"`
  2795. // ServiceAccounts: A list of service accounts, with their specified
  2796. // scopes, authorized for this instance. Service accounts generate
  2797. // access tokens that can be accessed through the metadata server and
  2798. // used to authenticate applications on the instance. See Authenticating
  2799. // from Google Compute Engine for more information.
  2800. ServiceAccounts []*ServiceAccount `json:"serviceAccounts,omitempty"`
  2801. // Status: [Output Only] The status of the instance. One of the
  2802. // following values: PROVISIONING, STAGING, RUNNING, STOPPING, and
  2803. // TERMINATED.
  2804. //
  2805. // Possible values:
  2806. // "PROVISIONING"
  2807. // "RUNNING"
  2808. // "STAGING"
  2809. // "STOPPED"
  2810. // "STOPPING"
  2811. // "SUSPENDED"
  2812. // "SUSPENDING"
  2813. // "TERMINATED"
  2814. Status string `json:"status,omitempty"`
  2815. // StatusMessage: [Output Only] An optional, human-readable explanation
  2816. // of the status.
  2817. StatusMessage string `json:"statusMessage,omitempty"`
  2818. // Tags: A list of tags to appy to this instance. Tags are used to
  2819. // identify valid sources or targets for network firewalls and are
  2820. // specified by the client during instance creation. The tags can be
  2821. // later modified by the setTags method. Each tag within the list must
  2822. // comply with RFC1035.
  2823. Tags *Tags `json:"tags,omitempty"`
  2824. // Zone: [Output Only] URL of the zone where the instance resides.
  2825. Zone string `json:"zone,omitempty"`
  2826. // ServerResponse contains the HTTP response code and headers from the
  2827. // server.
  2828. googleapi.ServerResponse `json:"-"`
  2829. // ForceSendFields is a list of field names (e.g. "CanIpForward") to
  2830. // unconditionally include in API requests. By default, fields with
  2831. // empty values are omitted from API requests. However, any non-pointer,
  2832. // non-interface field appearing in ForceSendFields will be sent to the
  2833. // server regardless of whether the field is empty or not. This may be
  2834. // used to include empty fields in Patch requests.
  2835. ForceSendFields []string `json:"-"`
  2836. }
  2837. func (s *Instance) MarshalJSON() ([]byte, error) {
  2838. type noMethod Instance
  2839. raw := noMethod(*s)
  2840. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2841. }
  2842. type InstanceAggregatedList struct {
  2843. // Id: [Output Only] The unique identifier for the resource. This
  2844. // identifier is defined by the server.
  2845. Id string `json:"id,omitempty"`
  2846. // Items: [Output Only] A map of scoped instance lists.
  2847. Items map[string]InstancesScopedList `json:"items,omitempty"`
  2848. // Kind: [Output Only] Type of resource. Always
  2849. // compute#instanceAggregatedList for aggregated lists of Instance
  2850. // resources.
  2851. Kind string `json:"kind,omitempty"`
  2852. // NextPageToken: [Output Only] This token allows you to get the next
  2853. // page of results for list requests. If the number of results is larger
  2854. // than maxResults, use the nextPageToken as a value for the query
  2855. // parameter pageToken in the next list request. Subsequent list
  2856. // requests will have their own nextPageToken to continue paging through
  2857. // the results.
  2858. NextPageToken string `json:"nextPageToken,omitempty"`
  2859. // SelfLink: [Output Only] Server-defined URL for this resource.
  2860. SelfLink string `json:"selfLink,omitempty"`
  2861. // ServerResponse contains the HTTP response code and headers from the
  2862. // server.
  2863. googleapi.ServerResponse `json:"-"`
  2864. // ForceSendFields is a list of field names (e.g. "Id") to
  2865. // unconditionally include in API requests. By default, fields with
  2866. // empty values are omitted from API requests. However, any non-pointer,
  2867. // non-interface field appearing in ForceSendFields will be sent to the
  2868. // server regardless of whether the field is empty or not. This may be
  2869. // used to include empty fields in Patch requests.
  2870. ForceSendFields []string `json:"-"`
  2871. }
  2872. func (s *InstanceAggregatedList) MarshalJSON() ([]byte, error) {
  2873. type noMethod InstanceAggregatedList
  2874. raw := noMethod(*s)
  2875. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2876. }
  2877. type InstanceGroup struct {
  2878. // CreationTimestamp: [Output Only] The creation timestamp for this
  2879. // instance group in RFC3339 text format.
  2880. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  2881. // Description: An optional description of this resource. Provide this
  2882. // property when you create the resource.
  2883. Description string `json:"description,omitempty"`
  2884. // Fingerprint: [Output Only] The fingerprint of the named ports. The
  2885. // system uses this fingerprint to detect conflicts when multiple users
  2886. // change the named ports concurrently.
  2887. Fingerprint string `json:"fingerprint,omitempty"`
  2888. // Id: [Output Only] A unique identifier for this resource type. The
  2889. // server generates this identifier.
  2890. Id uint64 `json:"id,omitempty,string"`
  2891. // Kind: [Output Only] The resource type, which is always
  2892. // compute#instanceGroup for instance groups.
  2893. Kind string `json:"kind,omitempty"`
  2894. // Name: The name of the instance group. The name must be 1-63
  2895. // characters long, and comply with RFC1035.
  2896. Name string `json:"name,omitempty"`
  2897. // NamedPorts: Assigns a name to a port number. For example: {name:
  2898. // "http", port: 80}
  2899. //
  2900. // This allows the system to reference ports by the assigned name
  2901. // instead of a port number. Named ports can also contain multiple
  2902. // ports. For example: [{name: "http", port: 80},{name: "http", port:
  2903. // 8080}]
  2904. //
  2905. // Named ports apply to all instances in this instance group.
  2906. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  2907. // Network: [Output Only] The URL of the network to which all instances
  2908. // in the instance group belong.
  2909. Network string `json:"network,omitempty"`
  2910. // SelfLink: [Output Only] The URL for this instance group. The server
  2911. // generates this URL.
  2912. SelfLink string `json:"selfLink,omitempty"`
  2913. // Size: [Output Only] The total number of instances in the instance
  2914. // group.
  2915. Size int64 `json:"size,omitempty"`
  2916. // Subnetwork: [Output Only] The URL of the subnetwork to which all
  2917. // instances in the instance group belong.
  2918. Subnetwork string `json:"subnetwork,omitempty"`
  2919. // Zone: [Output Only] The URL of the zone where the instance group is
  2920. // located.
  2921. Zone string `json:"zone,omitempty"`
  2922. // ServerResponse contains the HTTP response code and headers from the
  2923. // server.
  2924. googleapi.ServerResponse `json:"-"`
  2925. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  2926. // to unconditionally include in API requests. By default, fields with
  2927. // empty values are omitted from API requests. However, any non-pointer,
  2928. // non-interface field appearing in ForceSendFields will be sent to the
  2929. // server regardless of whether the field is empty or not. This may be
  2930. // used to include empty fields in Patch requests.
  2931. ForceSendFields []string `json:"-"`
  2932. }
  2933. func (s *InstanceGroup) MarshalJSON() ([]byte, error) {
  2934. type noMethod InstanceGroup
  2935. raw := noMethod(*s)
  2936. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2937. }
  2938. type InstanceGroupAggregatedList struct {
  2939. // Id: [Output Only] A unique identifier for this aggregated list of
  2940. // instance groups. The server generates this identifier.
  2941. Id string `json:"id,omitempty"`
  2942. // Items: A map of scoped instance group lists.
  2943. Items map[string]InstanceGroupsScopedList `json:"items,omitempty"`
  2944. // Kind: [Output Only] The resource type, which is always
  2945. // compute#instanceGroupAggregatedList for aggregated lists of instance
  2946. // groups.
  2947. Kind string `json:"kind,omitempty"`
  2948. // NextPageToken: [Output Only] This token allows you to get the next
  2949. // page of results for list requests. If the number of results is larger
  2950. // than maxResults, use the nextPageToken as a value for the query
  2951. // parameter pageToken in the next list request. Subsequent list
  2952. // requests will have their own nextPageToken to continue paging through
  2953. // the results.
  2954. NextPageToken string `json:"nextPageToken,omitempty"`
  2955. // SelfLink: [Output Only] The URL for this resource type. The server
  2956. // generates this URL.
  2957. SelfLink string `json:"selfLink,omitempty"`
  2958. // ServerResponse contains the HTTP response code and headers from the
  2959. // server.
  2960. googleapi.ServerResponse `json:"-"`
  2961. // ForceSendFields is a list of field names (e.g. "Id") to
  2962. // unconditionally include in API requests. By default, fields with
  2963. // empty values are omitted from API requests. However, any non-pointer,
  2964. // non-interface field appearing in ForceSendFields will be sent to the
  2965. // server regardless of whether the field is empty or not. This may be
  2966. // used to include empty fields in Patch requests.
  2967. ForceSendFields []string `json:"-"`
  2968. }
  2969. func (s *InstanceGroupAggregatedList) MarshalJSON() ([]byte, error) {
  2970. type noMethod InstanceGroupAggregatedList
  2971. raw := noMethod(*s)
  2972. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2973. }
  2974. // InstanceGroupList: A list of InstanceGroup resources.
  2975. type InstanceGroupList struct {
  2976. // Id: [Output Only] A unique identifier for this list of instance
  2977. // groups. The server generates this identifier.
  2978. Id string `json:"id,omitempty"`
  2979. // Items: A list of instance groups.
  2980. Items []*InstanceGroup `json:"items,omitempty"`
  2981. // Kind: [Output Only] The resource type, which is always
  2982. // compute#instanceGroupList for instance group lists.
  2983. Kind string `json:"kind,omitempty"`
  2984. // NextPageToken: [Output Only] This token allows you to get the next
  2985. // page of results for list requests. If the number of results is larger
  2986. // than maxResults, use the nextPageToken as a value for the query
  2987. // parameter pageToken in the next list request. Subsequent list
  2988. // requests will have their own nextPageToken to continue paging through
  2989. // the results.
  2990. NextPageToken string `json:"nextPageToken,omitempty"`
  2991. // SelfLink: [Output Only] The URL for this resource type. The server
  2992. // generates this URL.
  2993. SelfLink string `json:"selfLink,omitempty"`
  2994. // ServerResponse contains the HTTP response code and headers from the
  2995. // server.
  2996. googleapi.ServerResponse `json:"-"`
  2997. // ForceSendFields is a list of field names (e.g. "Id") to
  2998. // unconditionally include in API requests. By default, fields with
  2999. // empty values are omitted from API requests. However, any non-pointer,
  3000. // non-interface field appearing in ForceSendFields will be sent to the
  3001. // server regardless of whether the field is empty or not. This may be
  3002. // used to include empty fields in Patch requests.
  3003. ForceSendFields []string `json:"-"`
  3004. }
  3005. func (s *InstanceGroupList) MarshalJSON() ([]byte, error) {
  3006. type noMethod InstanceGroupList
  3007. raw := noMethod(*s)
  3008. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3009. }
  3010. // InstanceGroupManager: InstanceGroupManagers
  3011. //
  3012. // Next available tag: 20
  3013. type InstanceGroupManager struct {
  3014. // AutoHealingPolicies: The autohealing policy for this managed instance
  3015. // group. You can specify only one value.
  3016. AutoHealingPolicies []*InstanceGroupManagerAutoHealingPolicy `json:"autoHealingPolicies,omitempty"`
  3017. // BaseInstanceName: The base instance name to use for instances in this
  3018. // group. The value must be 1-58 characters long. Instances are named by
  3019. // appending a hyphen and a random four-character string to the base
  3020. // instance name. The base instance name must comply with RFC1035.
  3021. BaseInstanceName string `json:"baseInstanceName,omitempty"`
  3022. // CreationTimestamp: [Output Only] The creation timestamp for this
  3023. // managed instance group in RFC3339 text format.
  3024. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  3025. // CurrentActions: [Output Only] The list of instance actions and the
  3026. // number of instances in this managed instance group that are scheduled
  3027. // for each of those actions.
  3028. CurrentActions *InstanceGroupManagerActionsSummary `json:"currentActions,omitempty"`
  3029. // Description: An optional description of this resource. Provide this
  3030. // property when you create the resource.
  3031. Description string `json:"description,omitempty"`
  3032. // Fingerprint: [Output Only] The fingerprint of the target pools
  3033. // information. You can use this optional field for optimistic locking
  3034. // when you update the target pool entries.
  3035. Fingerprint string `json:"fingerprint,omitempty"`
  3036. // Id: [Output Only] A unique identifier for this resource type. The
  3037. // server generates this identifier.
  3038. Id uint64 `json:"id,omitempty,string"`
  3039. // InstanceGroup: [Output Only] The URL of the Instance Group resource.
  3040. InstanceGroup string `json:"instanceGroup,omitempty"`
  3041. // InstanceTemplate: The URL of the instance template that is specified
  3042. // for this managed instance group. The group uses this template to
  3043. // create all new instances in the managed instance group.
  3044. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  3045. // Kind: [Output Only] The resource type, which is always
  3046. // compute#instanceGroupManager for managed instance groups.
  3047. Kind string `json:"kind,omitempty"`
  3048. // Name: The name of the managed instance group. The name must be 1-63
  3049. // characters long, and comply with RFC1035.
  3050. Name string `json:"name,omitempty"`
  3051. // NamedPorts: Named ports configured for the Instance Groups
  3052. // complementary to this Instance Group Manager.
  3053. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  3054. // SelfLink: [Output Only] The URL for this managed instance group. The
  3055. // server defines this URL.
  3056. SelfLink string `json:"selfLink,omitempty"`
  3057. // TargetPools: The URLs for all TargetPool resources to which instances
  3058. // in the instanceGroup field are added. The target pools automatically
  3059. // apply to all of the instances in the managed instance group.
  3060. TargetPools []string `json:"targetPools,omitempty"`
  3061. // TargetSize: The target number of running instances for this managed
  3062. // instance group. Deleting or abandoning instances reduces this number.
  3063. // Resizing the group changes this number.
  3064. TargetSize int64 `json:"targetSize,omitempty"`
  3065. // Zone: The name of the zone where the managed instance group is
  3066. // located.
  3067. Zone string `json:"zone,omitempty"`
  3068. // ServerResponse contains the HTTP response code and headers from the
  3069. // server.
  3070. googleapi.ServerResponse `json:"-"`
  3071. // ForceSendFields is a list of field names (e.g. "AutoHealingPolicies")
  3072. // to unconditionally include in API requests. By default, fields with
  3073. // empty values are omitted from API requests. However, any non-pointer,
  3074. // non-interface field appearing in ForceSendFields will be sent to the
  3075. // server regardless of whether the field is empty or not. This may be
  3076. // used to include empty fields in Patch requests.
  3077. ForceSendFields []string `json:"-"`
  3078. }
  3079. func (s *InstanceGroupManager) MarshalJSON() ([]byte, error) {
  3080. type noMethod InstanceGroupManager
  3081. raw := noMethod(*s)
  3082. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3083. }
  3084. type InstanceGroupManagerActionsSummary struct {
  3085. // Abandoning: [Output Only] The total number of instances in the
  3086. // managed instance group that are scheduled to be abandoned. Abandoning
  3087. // an instance removes it from the managed instance group without
  3088. // deleting it.
  3089. Abandoning int64 `json:"abandoning,omitempty"`
  3090. // Creating: [Output Only] The number of instances in the managed
  3091. // instance group that are scheduled to be created or are currently
  3092. // being created. If the group fails to create one of these instances,
  3093. // it tries again until it creates the instance successfully.
  3094. Creating int64 `json:"creating,omitempty"`
  3095. // Deleting: [Output Only] The number of instances in the managed
  3096. // instance group that are scheduled to be deleted or are currently
  3097. // being deleted.
  3098. Deleting int64 `json:"deleting,omitempty"`
  3099. // None: [Output Only] The number of instances in the managed instance
  3100. // group that are running and have no scheduled actions.
  3101. None int64 `json:"none,omitempty"`
  3102. // Recreating: [Output Only] The number of instances in the managed
  3103. // instance group that are scheduled to be recreated or are currently
  3104. // being being recreated. Recreating an instance deletes the existing
  3105. // root persistent disk and creates a new disk from the image that is
  3106. // defined in the instance template.
  3107. Recreating int64 `json:"recreating,omitempty"`
  3108. // Refreshing: [Output Only] The number of instances in the managed
  3109. // instance group that are being reconfigured with properties that do
  3110. // not require a restart or a recreate action. For example, setting or
  3111. // removing target pools for the instance.
  3112. Refreshing int64 `json:"refreshing,omitempty"`
  3113. // Restarting: [Output Only] The number of instances in the managed
  3114. // instance group that are scheduled to be restarted or are currently
  3115. // being restarted.
  3116. Restarting int64 `json:"restarting,omitempty"`
  3117. // ForceSendFields is a list of field names (e.g. "Abandoning") to
  3118. // unconditionally include in API requests. By default, fields with
  3119. // empty values are omitted from API requests. However, any non-pointer,
  3120. // non-interface field appearing in ForceSendFields will be sent to the
  3121. // server regardless of whether the field is empty or not. This may be
  3122. // used to include empty fields in Patch requests.
  3123. ForceSendFields []string `json:"-"`
  3124. }
  3125. func (s *InstanceGroupManagerActionsSummary) MarshalJSON() ([]byte, error) {
  3126. type noMethod InstanceGroupManagerActionsSummary
  3127. raw := noMethod(*s)
  3128. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3129. }
  3130. type InstanceGroupManagerAggregatedList struct {
  3131. // Id: [Output Only] A unique identifier for this aggregated list of
  3132. // managed instance groups. The server generates this identifier.
  3133. Id string `json:"id,omitempty"`
  3134. // Items: [Output Only] A map of filtered managed instance group lists.
  3135. Items map[string]InstanceGroupManagersScopedList `json:"items,omitempty"`
  3136. // Kind: [Output Only] The resource type, which is always
  3137. // compute#instanceGroupManagerAggregatedList for an aggregated list of
  3138. // managed instance groups.
  3139. Kind string `json:"kind,omitempty"`
  3140. // NextPageToken: [Output Only] This token allows you to get the next
  3141. // page of results for list requests. If the number of results is larger
  3142. // than maxResults, use the nextPageToken as a value for the query
  3143. // parameter pageToken in the next list request. Subsequent list
  3144. // requests will have their own nextPageToken to continue paging through
  3145. // the results.
  3146. NextPageToken string `json:"nextPageToken,omitempty"`
  3147. // SelfLink: [Output Only] The URL for this resource type. The server
  3148. // generates this URL.
  3149. SelfLink string `json:"selfLink,omitempty"`
  3150. // ServerResponse contains the HTTP response code and headers from the
  3151. // server.
  3152. googleapi.ServerResponse `json:"-"`
  3153. // ForceSendFields is a list of field names (e.g. "Id") to
  3154. // unconditionally include in API requests. By default, fields with
  3155. // empty values are omitted from API requests. However, any non-pointer,
  3156. // non-interface field appearing in ForceSendFields will be sent to the
  3157. // server regardless of whether the field is empty or not. This may be
  3158. // used to include empty fields in Patch requests.
  3159. ForceSendFields []string `json:"-"`
  3160. }
  3161. func (s *InstanceGroupManagerAggregatedList) MarshalJSON() ([]byte, error) {
  3162. type noMethod InstanceGroupManagerAggregatedList
  3163. raw := noMethod(*s)
  3164. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3165. }
  3166. type InstanceGroupManagerAutoHealingPolicy struct {
  3167. // HealthCheck: The URL for the HealthCheck that signals autohealing.
  3168. HealthCheck string `json:"healthCheck,omitempty"`
  3169. // InitialDelaySec: The number of seconds that the managed instance
  3170. // group waits before it applies autohealing policies to new instances
  3171. // or recently recreated instances. This initial delay allows instances
  3172. // to initialize and run their startup scripts before the instance group
  3173. // determines that they are UNHEALTHY. This prevents the managed
  3174. // instance group from recreating its instances prematurely.
  3175. InitialDelaySec int64 `json:"initialDelaySec,omitempty"`
  3176. // ForceSendFields is a list of field names (e.g. "HealthCheck") to
  3177. // unconditionally include in API requests. By default, fields with
  3178. // empty values are omitted from API requests. However, any non-pointer,
  3179. // non-interface field appearing in ForceSendFields will be sent to the
  3180. // server regardless of whether the field is empty or not. This may be
  3181. // used to include empty fields in Patch requests.
  3182. ForceSendFields []string `json:"-"`
  3183. }
  3184. func (s *InstanceGroupManagerAutoHealingPolicy) MarshalJSON() ([]byte, error) {
  3185. type noMethod InstanceGroupManagerAutoHealingPolicy
  3186. raw := noMethod(*s)
  3187. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3188. }
  3189. // InstanceGroupManagerList: [Output Only] A list of managed instance
  3190. // groups.
  3191. type InstanceGroupManagerList struct {
  3192. // Id: [Output Only] A unique identifier for this resource type. The
  3193. // server generates this identifier.
  3194. Id string `json:"id,omitempty"`
  3195. // Items: [Output Only] A list of managed instance groups.
  3196. Items []*InstanceGroupManager `json:"items,omitempty"`
  3197. // Kind: [Output Only] The resource type, which is always
  3198. // compute#instanceGroupManagerList for a list of managed instance
  3199. // groups.
  3200. Kind string `json:"kind,omitempty"`
  3201. // NextPageToken: [Output Only] This token allows you to get the next
  3202. // page of results for list requests. If the number of results is larger
  3203. // than maxResults, use the nextPageToken as a value for the query
  3204. // parameter pageToken in the next list request. Subsequent list
  3205. // requests will have their own nextPageToken to continue paging through
  3206. // the results.
  3207. NextPageToken string `json:"nextPageToken,omitempty"`
  3208. // SelfLink: [Output Only] The URL for this resource type. The server
  3209. // generates this URL.
  3210. SelfLink string `json:"selfLink,omitempty"`
  3211. // ServerResponse contains the HTTP response code and headers from the
  3212. // server.
  3213. googleapi.ServerResponse `json:"-"`
  3214. // ForceSendFields is a list of field names (e.g. "Id") to
  3215. // unconditionally include in API requests. By default, fields with
  3216. // empty values are omitted from API requests. However, any non-pointer,
  3217. // non-interface field appearing in ForceSendFields will be sent to the
  3218. // server regardless of whether the field is empty or not. This may be
  3219. // used to include empty fields in Patch requests.
  3220. ForceSendFields []string `json:"-"`
  3221. }
  3222. func (s *InstanceGroupManagerList) MarshalJSON() ([]byte, error) {
  3223. type noMethod InstanceGroupManagerList
  3224. raw := noMethod(*s)
  3225. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3226. }
  3227. type InstanceGroupManagersAbandonInstancesRequest struct {
  3228. // Instances: The URL for one or more instances to abandon from the
  3229. // managed instance group.
  3230. Instances []string `json:"instances,omitempty"`
  3231. // ForceSendFields is a list of field names (e.g. "Instances") to
  3232. // unconditionally include in API requests. By default, fields with
  3233. // empty values are omitted from API requests. However, any non-pointer,
  3234. // non-interface field appearing in ForceSendFields will be sent to the
  3235. // server regardless of whether the field is empty or not. This may be
  3236. // used to include empty fields in Patch requests.
  3237. ForceSendFields []string `json:"-"`
  3238. }
  3239. func (s *InstanceGroupManagersAbandonInstancesRequest) MarshalJSON() ([]byte, error) {
  3240. type noMethod InstanceGroupManagersAbandonInstancesRequest
  3241. raw := noMethod(*s)
  3242. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3243. }
  3244. type InstanceGroupManagersDeleteInstancesRequest struct {
  3245. // Instances: The list of instances to delete from this managed instance
  3246. // group. Specify one or more instance URLs.
  3247. Instances []string `json:"instances,omitempty"`
  3248. // ForceSendFields is a list of field names (e.g. "Instances") to
  3249. // unconditionally include in API requests. By default, fields with
  3250. // empty values are omitted from API requests. However, any non-pointer,
  3251. // non-interface field appearing in ForceSendFields will be sent to the
  3252. // server regardless of whether the field is empty or not. This may be
  3253. // used to include empty fields in Patch requests.
  3254. ForceSendFields []string `json:"-"`
  3255. }
  3256. func (s *InstanceGroupManagersDeleteInstancesRequest) MarshalJSON() ([]byte, error) {
  3257. type noMethod InstanceGroupManagersDeleteInstancesRequest
  3258. raw := noMethod(*s)
  3259. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3260. }
  3261. type InstanceGroupManagersListManagedInstancesResponse struct {
  3262. // ManagedInstances: [Output Only] The list of instances in the managed
  3263. // instance group.
  3264. ManagedInstances []*ManagedInstance `json:"managedInstances,omitempty"`
  3265. // ServerResponse contains the HTTP response code and headers from the
  3266. // server.
  3267. googleapi.ServerResponse `json:"-"`
  3268. // ForceSendFields is a list of field names (e.g. "ManagedInstances") to
  3269. // unconditionally include in API requests. By default, fields with
  3270. // empty values are omitted from API requests. However, any non-pointer,
  3271. // non-interface field appearing in ForceSendFields will be sent to the
  3272. // server regardless of whether the field is empty or not. This may be
  3273. // used to include empty fields in Patch requests.
  3274. ForceSendFields []string `json:"-"`
  3275. }
  3276. func (s *InstanceGroupManagersListManagedInstancesResponse) MarshalJSON() ([]byte, error) {
  3277. type noMethod InstanceGroupManagersListManagedInstancesResponse
  3278. raw := noMethod(*s)
  3279. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3280. }
  3281. type InstanceGroupManagersRecreateInstancesRequest struct {
  3282. // Instances: The URL for one or more instances to recreate.
  3283. Instances []string `json:"instances,omitempty"`
  3284. // ForceSendFields is a list of field names (e.g. "Instances") to
  3285. // unconditionally include in API requests. By default, fields with
  3286. // empty values are omitted from API requests. However, any non-pointer,
  3287. // non-interface field appearing in ForceSendFields will be sent to the
  3288. // server regardless of whether the field is empty or not. This may be
  3289. // used to include empty fields in Patch requests.
  3290. ForceSendFields []string `json:"-"`
  3291. }
  3292. func (s *InstanceGroupManagersRecreateInstancesRequest) MarshalJSON() ([]byte, error) {
  3293. type noMethod InstanceGroupManagersRecreateInstancesRequest
  3294. raw := noMethod(*s)
  3295. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3296. }
  3297. type InstanceGroupManagersScopedList struct {
  3298. // InstanceGroupManagers: [Output Only] The list of managed instance
  3299. // groups that are contained in the specified project and zone.
  3300. InstanceGroupManagers []*InstanceGroupManager `json:"instanceGroupManagers,omitempty"`
  3301. // Warning: [Output Only] The warning that replaces the list of managed
  3302. // instance groups when the list is empty.
  3303. Warning *InstanceGroupManagersScopedListWarning `json:"warning,omitempty"`
  3304. // ForceSendFields is a list of field names (e.g.
  3305. // "InstanceGroupManagers") to unconditionally include in API requests.
  3306. // By default, fields with empty values are omitted from API requests.
  3307. // However, any non-pointer, non-interface field appearing in
  3308. // ForceSendFields will be sent to the server regardless of whether the
  3309. // field is empty or not. This may be used to include empty fields in
  3310. // Patch requests.
  3311. ForceSendFields []string `json:"-"`
  3312. }
  3313. func (s *InstanceGroupManagersScopedList) MarshalJSON() ([]byte, error) {
  3314. type noMethod InstanceGroupManagersScopedList
  3315. raw := noMethod(*s)
  3316. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3317. }
  3318. // InstanceGroupManagersScopedListWarning: [Output Only] The warning
  3319. // that replaces the list of managed instance groups when the list is
  3320. // empty.
  3321. type InstanceGroupManagersScopedListWarning struct {
  3322. // Code: [Output Only] A warning code, if applicable. For example,
  3323. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  3324. // the response.
  3325. //
  3326. // Possible values:
  3327. // "DEPRECATED_RESOURCE_USED"
  3328. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  3329. // "INJECTED_KERNELS_DEPRECATED"
  3330. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  3331. // "NEXT_HOP_CANNOT_IP_FORWARD"
  3332. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  3333. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  3334. // "NEXT_HOP_NOT_RUNNING"
  3335. // "NOT_CRITICAL_ERROR"
  3336. // "NO_RESULTS_ON_PAGE"
  3337. // "REQUIRED_TOS_AGREEMENT"
  3338. // "RESOURCE_NOT_DELETED"
  3339. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  3340. // "UNREACHABLE"
  3341. Code string `json:"code,omitempty"`
  3342. // Data: [Output Only] Metadata about this warning in key: value format.
  3343. // For example:
  3344. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  3345. Data []*InstanceGroupManagersScopedListWarningData `json:"data,omitempty"`
  3346. // Message: [Output Only] A human-readable description of the warning
  3347. // code.
  3348. Message string `json:"message,omitempty"`
  3349. // ForceSendFields is a list of field names (e.g. "Code") to
  3350. // unconditionally include in API requests. By default, fields with
  3351. // empty values are omitted from API requests. However, any non-pointer,
  3352. // non-interface field appearing in ForceSendFields will be sent to the
  3353. // server regardless of whether the field is empty or not. This may be
  3354. // used to include empty fields in Patch requests.
  3355. ForceSendFields []string `json:"-"`
  3356. }
  3357. func (s *InstanceGroupManagersScopedListWarning) MarshalJSON() ([]byte, error) {
  3358. type noMethod InstanceGroupManagersScopedListWarning
  3359. raw := noMethod(*s)
  3360. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3361. }
  3362. type InstanceGroupManagersScopedListWarningData struct {
  3363. // Key: [Output Only] A key that provides more detail on the warning
  3364. // being returned. For example, for warnings where there are no results
  3365. // in a list request for a particular zone, this key might be scope and
  3366. // the key value might be the zone name. Other examples might be a key
  3367. // indicating a deprecated resource, and a suggested replacement, or a
  3368. // warning about invalid network settings (for example, if an instance
  3369. // attempts to perform IP forwarding but is not enabled for IP
  3370. // forwarding).
  3371. Key string `json:"key,omitempty"`
  3372. // Value: [Output Only] A warning data value corresponding to the key.
  3373. Value string `json:"value,omitempty"`
  3374. // ForceSendFields is a list of field names (e.g. "Key") to
  3375. // unconditionally include in API requests. By default, fields with
  3376. // empty values are omitted from API requests. However, any non-pointer,
  3377. // non-interface field appearing in ForceSendFields will be sent to the
  3378. // server regardless of whether the field is empty or not. This may be
  3379. // used to include empty fields in Patch requests.
  3380. ForceSendFields []string `json:"-"`
  3381. }
  3382. func (s *InstanceGroupManagersScopedListWarningData) MarshalJSON() ([]byte, error) {
  3383. type noMethod InstanceGroupManagersScopedListWarningData
  3384. raw := noMethod(*s)
  3385. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3386. }
  3387. type InstanceGroupManagersSetAutoHealingRequest struct {
  3388. AutoHealingPolicies []*InstanceGroupManagerAutoHealingPolicy `json:"autoHealingPolicies,omitempty"`
  3389. // ForceSendFields is a list of field names (e.g. "AutoHealingPolicies")
  3390. // to unconditionally include in API requests. By default, fields with
  3391. // empty values are omitted from API requests. However, any non-pointer,
  3392. // non-interface field appearing in ForceSendFields will be sent to the
  3393. // server regardless of whether the field is empty or not. This may be
  3394. // used to include empty fields in Patch requests.
  3395. ForceSendFields []string `json:"-"`
  3396. }
  3397. func (s *InstanceGroupManagersSetAutoHealingRequest) MarshalJSON() ([]byte, error) {
  3398. type noMethod InstanceGroupManagersSetAutoHealingRequest
  3399. raw := noMethod(*s)
  3400. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3401. }
  3402. type InstanceGroupManagersSetInstanceTemplateRequest struct {
  3403. // InstanceTemplate: The URL of the instance template that is specified
  3404. // for this managed instance group. The group uses this template to
  3405. // create all new instances in the managed instance group.
  3406. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  3407. // ForceSendFields is a list of field names (e.g. "InstanceTemplate") to
  3408. // unconditionally include in API requests. By default, fields with
  3409. // empty values are omitted from API requests. However, any non-pointer,
  3410. // non-interface field appearing in ForceSendFields will be sent to the
  3411. // server regardless of whether the field is empty or not. This may be
  3412. // used to include empty fields in Patch requests.
  3413. ForceSendFields []string `json:"-"`
  3414. }
  3415. func (s *InstanceGroupManagersSetInstanceTemplateRequest) MarshalJSON() ([]byte, error) {
  3416. type noMethod InstanceGroupManagersSetInstanceTemplateRequest
  3417. raw := noMethod(*s)
  3418. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3419. }
  3420. type InstanceGroupManagersSetTargetPoolsRequest struct {
  3421. // Fingerprint: The fingerprint of the target pools information. Use
  3422. // this optional property to prevent conflicts when multiple users
  3423. // change the target pools settings concurrently. Obtain the fingerprint
  3424. // with the instanceGroupManagers.get method. Then, include the
  3425. // fingerprint in your request to ensure that you do not overwrite
  3426. // changes that were applied from another concurrent request.
  3427. Fingerprint string `json:"fingerprint,omitempty"`
  3428. // TargetPools: The list of target pool URLs that instances in this
  3429. // managed instance group belong to. The managed instance group applies
  3430. // these target pools to all of the instances in the group. Existing
  3431. // instances and new instances in the group all receive these target
  3432. // pool settings.
  3433. TargetPools []string `json:"targetPools,omitempty"`
  3434. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  3435. // unconditionally include in API requests. By default, fields with
  3436. // empty values are omitted from API requests. However, any non-pointer,
  3437. // non-interface field appearing in ForceSendFields will be sent to the
  3438. // server regardless of whether the field is empty or not. This may be
  3439. // used to include empty fields in Patch requests.
  3440. ForceSendFields []string `json:"-"`
  3441. }
  3442. func (s *InstanceGroupManagersSetTargetPoolsRequest) MarshalJSON() ([]byte, error) {
  3443. type noMethod InstanceGroupManagersSetTargetPoolsRequest
  3444. raw := noMethod(*s)
  3445. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3446. }
  3447. type InstanceGroupsAddInstancesRequest struct {
  3448. // Instances: The list of instances to add to the instance group.
  3449. Instances []*InstanceReference `json:"instances,omitempty"`
  3450. // ForceSendFields is a list of field names (e.g. "Instances") to
  3451. // unconditionally include in API requests. By default, fields with
  3452. // empty values are omitted from API requests. However, any non-pointer,
  3453. // non-interface field appearing in ForceSendFields will be sent to the
  3454. // server regardless of whether the field is empty or not. This may be
  3455. // used to include empty fields in Patch requests.
  3456. ForceSendFields []string `json:"-"`
  3457. }
  3458. func (s *InstanceGroupsAddInstancesRequest) MarshalJSON() ([]byte, error) {
  3459. type noMethod InstanceGroupsAddInstancesRequest
  3460. raw := noMethod(*s)
  3461. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3462. }
  3463. type InstanceGroupsListInstances struct {
  3464. // Id: [Output Only] A unique identifier for this list of instance
  3465. // groups. The server generates this identifier.
  3466. Id string `json:"id,omitempty"`
  3467. // Items: [Output Only] A list of instances and any named ports that are
  3468. // assigned to those instances.
  3469. Items []*InstanceWithNamedPorts `json:"items,omitempty"`
  3470. // Kind: [Output Only] The resource type, which is always
  3471. // compute#instanceGroupsListInstances for lists of instance groups.
  3472. Kind string `json:"kind,omitempty"`
  3473. // NextPageToken: [Output Only] This token allows you to get the next
  3474. // page of results for list requests. If the number of results is larger
  3475. // than maxResults, use the nextPageToken as a value for the query
  3476. // parameter pageToken in the next list request. Subsequent list
  3477. // requests will have their own nextPageToken to continue paging through
  3478. // the results.
  3479. NextPageToken string `json:"nextPageToken,omitempty"`
  3480. // SelfLink: [Output Only] The URL for this list of instance groups. The
  3481. // server generates this URL.
  3482. SelfLink string `json:"selfLink,omitempty"`
  3483. // ServerResponse contains the HTTP response code and headers from the
  3484. // server.
  3485. googleapi.ServerResponse `json:"-"`
  3486. // ForceSendFields is a list of field names (e.g. "Id") to
  3487. // unconditionally include in API requests. By default, fields with
  3488. // empty values are omitted from API requests. However, any non-pointer,
  3489. // non-interface field appearing in ForceSendFields will be sent to the
  3490. // server regardless of whether the field is empty or not. This may be
  3491. // used to include empty fields in Patch requests.
  3492. ForceSendFields []string `json:"-"`
  3493. }
  3494. func (s *InstanceGroupsListInstances) MarshalJSON() ([]byte, error) {
  3495. type noMethod InstanceGroupsListInstances
  3496. raw := noMethod(*s)
  3497. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3498. }
  3499. type InstanceGroupsListInstancesRequest struct {
  3500. // InstanceState: A filter for the state of the instances in the
  3501. // instance group. Valid options are ALL or RUNNING. If you do not
  3502. // specify this parameter the list includes all instances regardless of
  3503. // their state.
  3504. //
  3505. // Possible values:
  3506. // "ALL"
  3507. // "RUNNING"
  3508. InstanceState string `json:"instanceState,omitempty"`
  3509. // ForceSendFields is a list of field names (e.g. "InstanceState") to
  3510. // unconditionally include in API requests. By default, fields with
  3511. // empty values are omitted from API requests. However, any non-pointer,
  3512. // non-interface field appearing in ForceSendFields will be sent to the
  3513. // server regardless of whether the field is empty or not. This may be
  3514. // used to include empty fields in Patch requests.
  3515. ForceSendFields []string `json:"-"`
  3516. }
  3517. func (s *InstanceGroupsListInstancesRequest) MarshalJSON() ([]byte, error) {
  3518. type noMethod InstanceGroupsListInstancesRequest
  3519. raw := noMethod(*s)
  3520. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3521. }
  3522. type InstanceGroupsRemoveInstancesRequest struct {
  3523. // Instances: The list of instances to remove from the instance group.
  3524. Instances []*InstanceReference `json:"instances,omitempty"`
  3525. // ForceSendFields is a list of field names (e.g. "Instances") to
  3526. // unconditionally include in API requests. By default, fields with
  3527. // empty values are omitted from API requests. However, any non-pointer,
  3528. // non-interface field appearing in ForceSendFields will be sent to the
  3529. // server regardless of whether the field is empty or not. This may be
  3530. // used to include empty fields in Patch requests.
  3531. ForceSendFields []string `json:"-"`
  3532. }
  3533. func (s *InstanceGroupsRemoveInstancesRequest) MarshalJSON() ([]byte, error) {
  3534. type noMethod InstanceGroupsRemoveInstancesRequest
  3535. raw := noMethod(*s)
  3536. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3537. }
  3538. type InstanceGroupsScopedList struct {
  3539. // InstanceGroups: [Output Only] The list of instance groups that are
  3540. // contained in this scope.
  3541. InstanceGroups []*InstanceGroup `json:"instanceGroups,omitempty"`
  3542. // Warning: [Output Only] An informational warning that replaces the
  3543. // list of instance groups when the list is empty.
  3544. Warning *InstanceGroupsScopedListWarning `json:"warning,omitempty"`
  3545. // ForceSendFields is a list of field names (e.g. "InstanceGroups") to
  3546. // unconditionally include in API requests. By default, fields with
  3547. // empty values are omitted from API requests. However, any non-pointer,
  3548. // non-interface field appearing in ForceSendFields will be sent to the
  3549. // server regardless of whether the field is empty or not. This may be
  3550. // used to include empty fields in Patch requests.
  3551. ForceSendFields []string `json:"-"`
  3552. }
  3553. func (s *InstanceGroupsScopedList) MarshalJSON() ([]byte, error) {
  3554. type noMethod InstanceGroupsScopedList
  3555. raw := noMethod(*s)
  3556. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3557. }
  3558. // InstanceGroupsScopedListWarning: [Output Only] An informational
  3559. // warning that replaces the list of instance groups when the list is
  3560. // empty.
  3561. type InstanceGroupsScopedListWarning struct {
  3562. // Code: [Output Only] A warning code, if applicable. For example,
  3563. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  3564. // the response.
  3565. //
  3566. // Possible values:
  3567. // "DEPRECATED_RESOURCE_USED"
  3568. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  3569. // "INJECTED_KERNELS_DEPRECATED"
  3570. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  3571. // "NEXT_HOP_CANNOT_IP_FORWARD"
  3572. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  3573. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  3574. // "NEXT_HOP_NOT_RUNNING"
  3575. // "NOT_CRITICAL_ERROR"
  3576. // "NO_RESULTS_ON_PAGE"
  3577. // "REQUIRED_TOS_AGREEMENT"
  3578. // "RESOURCE_NOT_DELETED"
  3579. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  3580. // "UNREACHABLE"
  3581. Code string `json:"code,omitempty"`
  3582. // Data: [Output Only] Metadata about this warning in key: value format.
  3583. // For example:
  3584. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  3585. Data []*InstanceGroupsScopedListWarningData `json:"data,omitempty"`
  3586. // Message: [Output Only] A human-readable description of the warning
  3587. // code.
  3588. Message string `json:"message,omitempty"`
  3589. // ForceSendFields is a list of field names (e.g. "Code") to
  3590. // unconditionally include in API requests. By default, fields with
  3591. // empty values are omitted from API requests. However, any non-pointer,
  3592. // non-interface field appearing in ForceSendFields will be sent to the
  3593. // server regardless of whether the field is empty or not. This may be
  3594. // used to include empty fields in Patch requests.
  3595. ForceSendFields []string `json:"-"`
  3596. }
  3597. func (s *InstanceGroupsScopedListWarning) MarshalJSON() ([]byte, error) {
  3598. type noMethod InstanceGroupsScopedListWarning
  3599. raw := noMethod(*s)
  3600. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3601. }
  3602. type InstanceGroupsScopedListWarningData struct {
  3603. // Key: [Output Only] A key that provides more detail on the warning
  3604. // being returned. For example, for warnings where there are no results
  3605. // in a list request for a particular zone, this key might be scope and
  3606. // the key value might be the zone name. Other examples might be a key
  3607. // indicating a deprecated resource, and a suggested replacement, or a
  3608. // warning about invalid network settings (for example, if an instance
  3609. // attempts to perform IP forwarding but is not enabled for IP
  3610. // forwarding).
  3611. Key string `json:"key,omitempty"`
  3612. // Value: [Output Only] A warning data value corresponding to the key.
  3613. Value string `json:"value,omitempty"`
  3614. // ForceSendFields is a list of field names (e.g. "Key") to
  3615. // unconditionally include in API requests. By default, fields with
  3616. // empty values are omitted from API requests. However, any non-pointer,
  3617. // non-interface field appearing in ForceSendFields will be sent to the
  3618. // server regardless of whether the field is empty or not. This may be
  3619. // used to include empty fields in Patch requests.
  3620. ForceSendFields []string `json:"-"`
  3621. }
  3622. func (s *InstanceGroupsScopedListWarningData) MarshalJSON() ([]byte, error) {
  3623. type noMethod InstanceGroupsScopedListWarningData
  3624. raw := noMethod(*s)
  3625. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3626. }
  3627. type InstanceGroupsSetNamedPortsRequest struct {
  3628. // Fingerprint: The fingerprint of the named ports information for this
  3629. // instance group. Use this optional property to prevent conflicts when
  3630. // multiple users change the named ports settings concurrently. Obtain
  3631. // the fingerprint with the instanceGroups.get method. Then, include the
  3632. // fingerprint in your request to ensure that you do not overwrite
  3633. // changes that were applied from another concurrent request.
  3634. Fingerprint string `json:"fingerprint,omitempty"`
  3635. // NamedPorts: The list of named ports to set for this instance group.
  3636. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  3637. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  3638. // unconditionally include in API requests. By default, fields with
  3639. // empty values are omitted from API requests. However, any non-pointer,
  3640. // non-interface field appearing in ForceSendFields will be sent to the
  3641. // server regardless of whether the field is empty or not. This may be
  3642. // used to include empty fields in Patch requests.
  3643. ForceSendFields []string `json:"-"`
  3644. }
  3645. func (s *InstanceGroupsSetNamedPortsRequest) MarshalJSON() ([]byte, error) {
  3646. type noMethod InstanceGroupsSetNamedPortsRequest
  3647. raw := noMethod(*s)
  3648. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3649. }
  3650. // InstanceList: Contains a list of instance resources.
  3651. type InstanceList struct {
  3652. // Id: [Output Only] The unique identifier for the resource. This
  3653. // identifier is defined by the server.
  3654. Id string `json:"id,omitempty"`
  3655. // Items: [Output Only] A list of Instance resources.
  3656. Items []*Instance `json:"items,omitempty"`
  3657. // Kind: [Output Only] Type of resource. Always compute#instanceList for
  3658. // lists of Instance resources.
  3659. Kind string `json:"kind,omitempty"`
  3660. // NextPageToken: [Output Only] This token allows you to get the next
  3661. // page of results for list requests. If the number of results is larger
  3662. // than maxResults, use the nextPageToken as a value for the query
  3663. // parameter pageToken in the next list request. Subsequent list
  3664. // requests will have their own nextPageToken to continue paging through
  3665. // the results.
  3666. NextPageToken string `json:"nextPageToken,omitempty"`
  3667. // SelfLink: [Output Only] Server-defined URL for this resource.
  3668. SelfLink string `json:"selfLink,omitempty"`
  3669. // ServerResponse contains the HTTP response code and headers from the
  3670. // server.
  3671. googleapi.ServerResponse `json:"-"`
  3672. // ForceSendFields is a list of field names (e.g. "Id") to
  3673. // unconditionally include in API requests. By default, fields with
  3674. // empty values are omitted from API requests. However, any non-pointer,
  3675. // non-interface field appearing in ForceSendFields will be sent to the
  3676. // server regardless of whether the field is empty or not. This may be
  3677. // used to include empty fields in Patch requests.
  3678. ForceSendFields []string `json:"-"`
  3679. }
  3680. func (s *InstanceList) MarshalJSON() ([]byte, error) {
  3681. type noMethod InstanceList
  3682. raw := noMethod(*s)
  3683. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3684. }
  3685. type InstanceProperties struct {
  3686. // CanIpForward: Enables instances created based on this template to
  3687. // send packets with source IP addresses other than their own and
  3688. // receive packets with destination IP addresses other than their own.
  3689. // If these instances will be used as an IP gateway or it will be set as
  3690. // the next-hop in a Route resource, specify true. If unsure, leave this
  3691. // set to false. See the canIpForward documentation for more
  3692. // information.
  3693. CanIpForward bool `json:"canIpForward,omitempty"`
  3694. // Description: An optional text description for the instances that are
  3695. // created from this instance template.
  3696. Description string `json:"description,omitempty"`
  3697. // Disks: An array of disks that are associated with the instances that
  3698. // are created from this template.
  3699. Disks []*AttachedDisk `json:"disks,omitempty"`
  3700. // MachineType: The machine type to use for instances that are created
  3701. // from this template.
  3702. MachineType string `json:"machineType,omitempty"`
  3703. // Metadata: The metadata key/value pairs to assign to instances that
  3704. // are created from this template. These pairs can consist of custom
  3705. // metadata or predefined keys. See Project and instance metadata for
  3706. // more information.
  3707. Metadata *Metadata `json:"metadata,omitempty"`
  3708. // NetworkInterfaces: An array of network access configurations for this
  3709. // interface.
  3710. NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"`
  3711. // Scheduling: Specifies the scheduling options for the instances that
  3712. // are created from this template.
  3713. Scheduling *Scheduling `json:"scheduling,omitempty"`
  3714. // ServiceAccounts: A list of service accounts with specified scopes.
  3715. // Access tokens for these service accounts are available to the
  3716. // instances that are created from this template. Use metadata queries
  3717. // to obtain the access tokens for these instances.
  3718. ServiceAccounts []*ServiceAccount `json:"serviceAccounts,omitempty"`
  3719. // Tags: A list of tags to apply to the instances that are created from
  3720. // this template. The tags identify valid sources or targets for network
  3721. // firewalls. The setTags method can modify this list of tags. Each tag
  3722. // within the list must comply with RFC1035.
  3723. Tags *Tags `json:"tags,omitempty"`
  3724. // ForceSendFields is a list of field names (e.g. "CanIpForward") to
  3725. // unconditionally include in API requests. By default, fields with
  3726. // empty values are omitted from API requests. However, any non-pointer,
  3727. // non-interface field appearing in ForceSendFields will be sent to the
  3728. // server regardless of whether the field is empty or not. This may be
  3729. // used to include empty fields in Patch requests.
  3730. ForceSendFields []string `json:"-"`
  3731. }
  3732. func (s *InstanceProperties) MarshalJSON() ([]byte, error) {
  3733. type noMethod InstanceProperties
  3734. raw := noMethod(*s)
  3735. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3736. }
  3737. type InstanceReference struct {
  3738. // Instance: The URL for a specific instance.
  3739. Instance string `json:"instance,omitempty"`
  3740. // ForceSendFields is a list of field names (e.g. "Instance") to
  3741. // unconditionally include in API requests. By default, fields with
  3742. // empty values are omitted from API requests. However, any non-pointer,
  3743. // non-interface field appearing in ForceSendFields will be sent to the
  3744. // server regardless of whether the field is empty or not. This may be
  3745. // used to include empty fields in Patch requests.
  3746. ForceSendFields []string `json:"-"`
  3747. }
  3748. func (s *InstanceReference) MarshalJSON() ([]byte, error) {
  3749. type noMethod InstanceReference
  3750. raw := noMethod(*s)
  3751. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3752. }
  3753. // InstanceTemplate: An Instance Template resource.
  3754. type InstanceTemplate struct {
  3755. // CreationTimestamp: [Output Only] The creation timestamp for this
  3756. // instance template in RFC3339 text format.
  3757. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  3758. // Description: An optional description of this resource. Provide this
  3759. // property when you create the resource.
  3760. Description string `json:"description,omitempty"`
  3761. // Id: [Output Only] A unique identifier for this instance template. The
  3762. // server defines this identifier.
  3763. Id uint64 `json:"id,omitempty,string"`
  3764. // Kind: [Output Only] The resource type, which is always
  3765. // compute#instanceTemplate for instance templates.
  3766. Kind string `json:"kind,omitempty"`
  3767. // Name: Name of the resource; provided by the client when the resource
  3768. // is created. The name must be 1-63 characters long, and comply with
  3769. // RFC1035. Specifically, the name must be 1-63 characters long and
  3770. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  3771. // the first character must be a lowercase letter, and all following
  3772. // characters must be a dash, lowercase letter, or digit, except the
  3773. // last character, which cannot be a dash.
  3774. Name string `json:"name,omitempty"`
  3775. // Properties: The instance properties for this instance template.
  3776. Properties *InstanceProperties `json:"properties,omitempty"`
  3777. // SelfLink: [Output Only] The URL for this instance template. The
  3778. // server defines this URL.
  3779. SelfLink string `json:"selfLink,omitempty"`
  3780. // ServerResponse contains the HTTP response code and headers from the
  3781. // server.
  3782. googleapi.ServerResponse `json:"-"`
  3783. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  3784. // to unconditionally include in API requests. By default, fields with
  3785. // empty values are omitted from API requests. However, any non-pointer,
  3786. // non-interface field appearing in ForceSendFields will be sent to the
  3787. // server regardless of whether the field is empty or not. This may be
  3788. // used to include empty fields in Patch requests.
  3789. ForceSendFields []string `json:"-"`
  3790. }
  3791. func (s *InstanceTemplate) MarshalJSON() ([]byte, error) {
  3792. type noMethod InstanceTemplate
  3793. raw := noMethod(*s)
  3794. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3795. }
  3796. // InstanceTemplateList: A list of instance templates.
  3797. type InstanceTemplateList struct {
  3798. // Id: [Output Only] A unique identifier for this instance template. The
  3799. // server defines this identifier.
  3800. Id string `json:"id,omitempty"`
  3801. // Items: [Output Only] list of InstanceTemplate resources.
  3802. Items []*InstanceTemplate `json:"items,omitempty"`
  3803. // Kind: [Output Only] The resource type, which is always
  3804. // compute#instanceTemplatesListResponse for instance template lists.
  3805. Kind string `json:"kind,omitempty"`
  3806. // NextPageToken: [Output Only] This token allows you to get the next
  3807. // page of results for list requests. If the number of results is larger
  3808. // than maxResults, use the nextPageToken as a value for the query
  3809. // parameter pageToken in the next list request. Subsequent list
  3810. // requests will have their own nextPageToken to continue paging through
  3811. // the results.
  3812. NextPageToken string `json:"nextPageToken,omitempty"`
  3813. // SelfLink: [Output Only] The URL for this instance template list. The
  3814. // server defines this URL.
  3815. SelfLink string `json:"selfLink,omitempty"`
  3816. // ServerResponse contains the HTTP response code and headers from the
  3817. // server.
  3818. googleapi.ServerResponse `json:"-"`
  3819. // ForceSendFields is a list of field names (e.g. "Id") to
  3820. // unconditionally include in API requests. By default, fields with
  3821. // empty values are omitted from API requests. However, any non-pointer,
  3822. // non-interface field appearing in ForceSendFields will be sent to the
  3823. // server regardless of whether the field is empty or not. This may be
  3824. // used to include empty fields in Patch requests.
  3825. ForceSendFields []string `json:"-"`
  3826. }
  3827. func (s *InstanceTemplateList) MarshalJSON() ([]byte, error) {
  3828. type noMethod InstanceTemplateList
  3829. raw := noMethod(*s)
  3830. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3831. }
  3832. type InstanceWithNamedPorts struct {
  3833. // Instance: [Output Only] The URL of the instance.
  3834. Instance string `json:"instance,omitempty"`
  3835. // NamedPorts: [Output Only] The named ports that belong to this
  3836. // instance group.
  3837. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  3838. // Status: [Output Only] The status of the instance.
  3839. //
  3840. // Possible values:
  3841. // "PROVISIONING"
  3842. // "RUNNING"
  3843. // "STAGING"
  3844. // "STOPPED"
  3845. // "STOPPING"
  3846. // "SUSPENDED"
  3847. // "SUSPENDING"
  3848. // "TERMINATED"
  3849. Status string `json:"status,omitempty"`
  3850. // ForceSendFields is a list of field names (e.g. "Instance") to
  3851. // unconditionally include in API requests. By default, fields with
  3852. // empty values are omitted from API requests. However, any non-pointer,
  3853. // non-interface field appearing in ForceSendFields will be sent to the
  3854. // server regardless of whether the field is empty or not. This may be
  3855. // used to include empty fields in Patch requests.
  3856. ForceSendFields []string `json:"-"`
  3857. }
  3858. func (s *InstanceWithNamedPorts) MarshalJSON() ([]byte, error) {
  3859. type noMethod InstanceWithNamedPorts
  3860. raw := noMethod(*s)
  3861. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3862. }
  3863. type InstancesScopedList struct {
  3864. // Instances: [Output Only] List of instances contained in this scope.
  3865. Instances []*Instance `json:"instances,omitempty"`
  3866. // Warning: [Output Only] Informational warning which replaces the list
  3867. // of instances when the list is empty.
  3868. Warning *InstancesScopedListWarning `json:"warning,omitempty"`
  3869. // ForceSendFields is a list of field names (e.g. "Instances") to
  3870. // unconditionally include in API requests. By default, fields with
  3871. // empty values are omitted from API requests. However, any non-pointer,
  3872. // non-interface field appearing in ForceSendFields will be sent to the
  3873. // server regardless of whether the field is empty or not. This may be
  3874. // used to include empty fields in Patch requests.
  3875. ForceSendFields []string `json:"-"`
  3876. }
  3877. func (s *InstancesScopedList) MarshalJSON() ([]byte, error) {
  3878. type noMethod InstancesScopedList
  3879. raw := noMethod(*s)
  3880. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3881. }
  3882. // InstancesScopedListWarning: [Output Only] Informational warning which
  3883. // replaces the list of instances when the list is empty.
  3884. type InstancesScopedListWarning struct {
  3885. // Code: [Output Only] A warning code, if applicable. For example,
  3886. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  3887. // the response.
  3888. //
  3889. // Possible values:
  3890. // "DEPRECATED_RESOURCE_USED"
  3891. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  3892. // "INJECTED_KERNELS_DEPRECATED"
  3893. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  3894. // "NEXT_HOP_CANNOT_IP_FORWARD"
  3895. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  3896. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  3897. // "NEXT_HOP_NOT_RUNNING"
  3898. // "NOT_CRITICAL_ERROR"
  3899. // "NO_RESULTS_ON_PAGE"
  3900. // "REQUIRED_TOS_AGREEMENT"
  3901. // "RESOURCE_NOT_DELETED"
  3902. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  3903. // "UNREACHABLE"
  3904. Code string `json:"code,omitempty"`
  3905. // Data: [Output Only] Metadata about this warning in key: value format.
  3906. // For example:
  3907. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  3908. Data []*InstancesScopedListWarningData `json:"data,omitempty"`
  3909. // Message: [Output Only] A human-readable description of the warning
  3910. // code.
  3911. Message string `json:"message,omitempty"`
  3912. // ForceSendFields is a list of field names (e.g. "Code") to
  3913. // unconditionally include in API requests. By default, fields with
  3914. // empty values are omitted from API requests. However, any non-pointer,
  3915. // non-interface field appearing in ForceSendFields will be sent to the
  3916. // server regardless of whether the field is empty or not. This may be
  3917. // used to include empty fields in Patch requests.
  3918. ForceSendFields []string `json:"-"`
  3919. }
  3920. func (s *InstancesScopedListWarning) MarshalJSON() ([]byte, error) {
  3921. type noMethod InstancesScopedListWarning
  3922. raw := noMethod(*s)
  3923. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3924. }
  3925. type InstancesScopedListWarningData struct {
  3926. // Key: [Output Only] A key that provides more detail on the warning
  3927. // being returned. For example, for warnings where there are no results
  3928. // in a list request for a particular zone, this key might be scope and
  3929. // the key value might be the zone name. Other examples might be a key
  3930. // indicating a deprecated resource, and a suggested replacement, or a
  3931. // warning about invalid network settings (for example, if an instance
  3932. // attempts to perform IP forwarding but is not enabled for IP
  3933. // forwarding).
  3934. Key string `json:"key,omitempty"`
  3935. // Value: [Output Only] A warning data value corresponding to the key.
  3936. Value string `json:"value,omitempty"`
  3937. // ForceSendFields is a list of field names (e.g. "Key") to
  3938. // unconditionally include in API requests. By default, fields with
  3939. // empty values are omitted from API requests. However, any non-pointer,
  3940. // non-interface field appearing in ForceSendFields will be sent to the
  3941. // server regardless of whether the field is empty or not. This may be
  3942. // used to include empty fields in Patch requests.
  3943. ForceSendFields []string `json:"-"`
  3944. }
  3945. func (s *InstancesScopedListWarningData) MarshalJSON() ([]byte, error) {
  3946. type noMethod InstancesScopedListWarningData
  3947. raw := noMethod(*s)
  3948. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3949. }
  3950. type InstancesSetLabelsRequest struct {
  3951. // LabelFingerprint: Fingerprint of the previous set of labels for this
  3952. // resource, used to prevent conflicts. Provide the latest fingerprint
  3953. // value when making a request to add or change labels.
  3954. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  3955. // Labels: The new labels for the resource, in the form of key/value
  3956. // pairs.
  3957. Labels map[string]string `json:"labels,omitempty"`
  3958. // ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
  3959. // unconditionally include in API requests. By default, fields with
  3960. // empty values are omitted from API requests. However, any non-pointer,
  3961. // non-interface field appearing in ForceSendFields will be sent to the
  3962. // server regardless of whether the field is empty or not. This may be
  3963. // used to include empty fields in Patch requests.
  3964. ForceSendFields []string `json:"-"`
  3965. }
  3966. func (s *InstancesSetLabelsRequest) MarshalJSON() ([]byte, error) {
  3967. type noMethod InstancesSetLabelsRequest
  3968. raw := noMethod(*s)
  3969. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3970. }
  3971. type InstancesSetMachineTypeRequest struct {
  3972. // MachineType: Full or partial URL of the machine type resource. See
  3973. // Machine Types for a full list of machine types. For example:
  3974. // zones/us-central1-f/machineTypes/n1-standard-1
  3975. MachineType string `json:"machineType,omitempty"`
  3976. // ForceSendFields is a list of field names (e.g. "MachineType") to
  3977. // unconditionally include in API requests. By default, fields with
  3978. // empty values are omitted from API requests. However, any non-pointer,
  3979. // non-interface field appearing in ForceSendFields will be sent to the
  3980. // server regardless of whether the field is empty or not. This may be
  3981. // used to include empty fields in Patch requests.
  3982. ForceSendFields []string `json:"-"`
  3983. }
  3984. func (s *InstancesSetMachineTypeRequest) MarshalJSON() ([]byte, error) {
  3985. type noMethod InstancesSetMachineTypeRequest
  3986. raw := noMethod(*s)
  3987. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3988. }
  3989. // License: A license resource.
  3990. type License struct {
  3991. // ChargesUseFee: [Output Only] If true, the customer will be charged
  3992. // license fee for running software that contains this license on an
  3993. // instance.
  3994. ChargesUseFee bool `json:"chargesUseFee,omitempty"`
  3995. // Kind: [Output Only] Type of resource. Always compute#license for
  3996. // licenses.
  3997. Kind string `json:"kind,omitempty"`
  3998. // Name: [Output Only] Name of the resource. The name is 1-63 characters
  3999. // long and complies with RFC1035.
  4000. Name string `json:"name,omitempty"`
  4001. // SelfLink: [Output Only] Server-defined URL for the resource.
  4002. SelfLink string `json:"selfLink,omitempty"`
  4003. // ServerResponse contains the HTTP response code and headers from the
  4004. // server.
  4005. googleapi.ServerResponse `json:"-"`
  4006. // ForceSendFields is a list of field names (e.g. "ChargesUseFee") to
  4007. // unconditionally include in API requests. By default, fields with
  4008. // empty values are omitted from API requests. However, any non-pointer,
  4009. // non-interface field appearing in ForceSendFields will be sent to the
  4010. // server regardless of whether the field is empty or not. This may be
  4011. // used to include empty fields in Patch requests.
  4012. ForceSendFields []string `json:"-"`
  4013. }
  4014. func (s *License) MarshalJSON() ([]byte, error) {
  4015. type noMethod License
  4016. raw := noMethod(*s)
  4017. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4018. }
  4019. // MachineType: A Machine Type resource.
  4020. type MachineType struct {
  4021. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  4022. // format.
  4023. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  4024. // Deprecated: [Output Only] The deprecation status associated with this
  4025. // machine type.
  4026. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  4027. // Description: [Output Only] An optional textual description of the
  4028. // resource.
  4029. Description string `json:"description,omitempty"`
  4030. // GuestCpus: [Output Only] The number of virtual CPUs that are
  4031. // available to the instance.
  4032. GuestCpus int64 `json:"guestCpus,omitempty"`
  4033. // Id: [Output Only] The unique identifier for the resource. This
  4034. // identifier is defined by the server.
  4035. Id uint64 `json:"id,omitempty,string"`
  4036. // Kind: [Output Only] The type of the resource. Always
  4037. // compute#machineType for machine types.
  4038. Kind string `json:"kind,omitempty"`
  4039. // MaximumPersistentDisks: [Output Only] Maximum persistent disks
  4040. // allowed.
  4041. MaximumPersistentDisks int64 `json:"maximumPersistentDisks,omitempty"`
  4042. // MaximumPersistentDisksSizeGb: [Output Only] Maximum total persistent
  4043. // disks size (GB) allowed.
  4044. MaximumPersistentDisksSizeGb int64 `json:"maximumPersistentDisksSizeGb,omitempty,string"`
  4045. // MemoryMb: [Output Only] The amount of physical memory available to
  4046. // the instance, defined in MB.
  4047. MemoryMb int64 `json:"memoryMb,omitempty"`
  4048. // Name: [Output Only] Name of the resource.
  4049. Name string `json:"name,omitempty"`
  4050. // SelfLink: [Output Only] Server-defined URL for the resource.
  4051. SelfLink string `json:"selfLink,omitempty"`
  4052. // Zone: [Output Only] The name of the zone where the machine type
  4053. // resides, such as us-central1-a.
  4054. Zone string `json:"zone,omitempty"`
  4055. // ServerResponse contains the HTTP response code and headers from the
  4056. // server.
  4057. googleapi.ServerResponse `json:"-"`
  4058. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  4059. // to unconditionally include in API requests. By default, fields with
  4060. // empty values are omitted from API requests. However, any non-pointer,
  4061. // non-interface field appearing in ForceSendFields will be sent to the
  4062. // server regardless of whether the field is empty or not. This may be
  4063. // used to include empty fields in Patch requests.
  4064. ForceSendFields []string `json:"-"`
  4065. }
  4066. func (s *MachineType) MarshalJSON() ([]byte, error) {
  4067. type noMethod MachineType
  4068. raw := noMethod(*s)
  4069. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4070. }
  4071. type MachineTypeAggregatedList struct {
  4072. // Id: [Output Only] The unique identifier for the resource. This
  4073. // identifier is defined by the server.
  4074. Id string `json:"id,omitempty"`
  4075. // Items: [Output Only] A map of scoped machine type lists.
  4076. Items map[string]MachineTypesScopedList `json:"items,omitempty"`
  4077. // Kind: [Output Only] Type of resource. Always
  4078. // compute#machineTypeAggregatedList for aggregated lists of machine
  4079. // types.
  4080. Kind string `json:"kind,omitempty"`
  4081. // NextPageToken: [Output Only] This token allows you to get the next
  4082. // page of results for list requests. If the number of results is larger
  4083. // than maxResults, use the nextPageToken as a value for the query
  4084. // parameter pageToken in the next list request. Subsequent list
  4085. // requests will have their own nextPageToken to continue paging through
  4086. // the results.
  4087. NextPageToken string `json:"nextPageToken,omitempty"`
  4088. // SelfLink: [Output Only] Server-defined URL for this resource.
  4089. SelfLink string `json:"selfLink,omitempty"`
  4090. // ServerResponse contains the HTTP response code and headers from the
  4091. // server.
  4092. googleapi.ServerResponse `json:"-"`
  4093. // ForceSendFields is a list of field names (e.g. "Id") to
  4094. // unconditionally include in API requests. By default, fields with
  4095. // empty values are omitted from API requests. However, any non-pointer,
  4096. // non-interface field appearing in ForceSendFields will be sent to the
  4097. // server regardless of whether the field is empty or not. This may be
  4098. // used to include empty fields in Patch requests.
  4099. ForceSendFields []string `json:"-"`
  4100. }
  4101. func (s *MachineTypeAggregatedList) MarshalJSON() ([]byte, error) {
  4102. type noMethod MachineTypeAggregatedList
  4103. raw := noMethod(*s)
  4104. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4105. }
  4106. // MachineTypeList: Contains a list of Machine Type resources.
  4107. type MachineTypeList struct {
  4108. // Id: [Output Only] The unique identifier for the resource. This
  4109. // identifier is defined by the server.
  4110. Id string `json:"id,omitempty"`
  4111. // Items: [Output Only] A list of Machine Type resources.
  4112. Items []*MachineType `json:"items,omitempty"`
  4113. // Kind: [Output Only] Type of resource. Always compute#machineTypeList
  4114. // for lists of machine types.
  4115. Kind string `json:"kind,omitempty"`
  4116. // NextPageToken: [Output Only] This token allows you to get the next
  4117. // page of results for list requests. If the number of results is larger
  4118. // than maxResults, use the nextPageToken as a value for the query
  4119. // parameter pageToken in the next list request. Subsequent list
  4120. // requests will have their own nextPageToken to continue paging through
  4121. // the results.
  4122. NextPageToken string `json:"nextPageToken,omitempty"`
  4123. // SelfLink: [Output Only] Server-defined URL for this resource.
  4124. SelfLink string `json:"selfLink,omitempty"`
  4125. // ServerResponse contains the HTTP response code and headers from the
  4126. // server.
  4127. googleapi.ServerResponse `json:"-"`
  4128. // ForceSendFields is a list of field names (e.g. "Id") to
  4129. // unconditionally include in API requests. By default, fields with
  4130. // empty values are omitted from API requests. However, any non-pointer,
  4131. // non-interface field appearing in ForceSendFields will be sent to the
  4132. // server regardless of whether the field is empty or not. This may be
  4133. // used to include empty fields in Patch requests.
  4134. ForceSendFields []string `json:"-"`
  4135. }
  4136. func (s *MachineTypeList) MarshalJSON() ([]byte, error) {
  4137. type noMethod MachineTypeList
  4138. raw := noMethod(*s)
  4139. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4140. }
  4141. type MachineTypesScopedList struct {
  4142. // MachineTypes: [Output Only] List of machine types contained in this
  4143. // scope.
  4144. MachineTypes []*MachineType `json:"machineTypes,omitempty"`
  4145. // Warning: [Output Only] An informational warning that appears when the
  4146. // machine types list is empty.
  4147. Warning *MachineTypesScopedListWarning `json:"warning,omitempty"`
  4148. // ForceSendFields is a list of field names (e.g. "MachineTypes") to
  4149. // unconditionally include in API requests. By default, fields with
  4150. // empty values are omitted from API requests. However, any non-pointer,
  4151. // non-interface field appearing in ForceSendFields will be sent to the
  4152. // server regardless of whether the field is empty or not. This may be
  4153. // used to include empty fields in Patch requests.
  4154. ForceSendFields []string `json:"-"`
  4155. }
  4156. func (s *MachineTypesScopedList) MarshalJSON() ([]byte, error) {
  4157. type noMethod MachineTypesScopedList
  4158. raw := noMethod(*s)
  4159. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4160. }
  4161. // MachineTypesScopedListWarning: [Output Only] An informational warning
  4162. // that appears when the machine types list is empty.
  4163. type MachineTypesScopedListWarning struct {
  4164. // Code: [Output Only] A warning code, if applicable. For example,
  4165. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  4166. // the response.
  4167. //
  4168. // Possible values:
  4169. // "DEPRECATED_RESOURCE_USED"
  4170. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4171. // "INJECTED_KERNELS_DEPRECATED"
  4172. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4173. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4174. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4175. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4176. // "NEXT_HOP_NOT_RUNNING"
  4177. // "NOT_CRITICAL_ERROR"
  4178. // "NO_RESULTS_ON_PAGE"
  4179. // "REQUIRED_TOS_AGREEMENT"
  4180. // "RESOURCE_NOT_DELETED"
  4181. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4182. // "UNREACHABLE"
  4183. Code string `json:"code,omitempty"`
  4184. // Data: [Output Only] Metadata about this warning in key: value format.
  4185. // For example:
  4186. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4187. Data []*MachineTypesScopedListWarningData `json:"data,omitempty"`
  4188. // Message: [Output Only] A human-readable description of the warning
  4189. // code.
  4190. Message string `json:"message,omitempty"`
  4191. // ForceSendFields is a list of field names (e.g. "Code") to
  4192. // unconditionally include in API requests. By default, fields with
  4193. // empty values are omitted from API requests. However, any non-pointer,
  4194. // non-interface field appearing in ForceSendFields will be sent to the
  4195. // server regardless of whether the field is empty or not. This may be
  4196. // used to include empty fields in Patch requests.
  4197. ForceSendFields []string `json:"-"`
  4198. }
  4199. func (s *MachineTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  4200. type noMethod MachineTypesScopedListWarning
  4201. raw := noMethod(*s)
  4202. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4203. }
  4204. type MachineTypesScopedListWarningData struct {
  4205. // Key: [Output Only] A key that provides more detail on the warning
  4206. // being returned. For example, for warnings where there are no results
  4207. // in a list request for a particular zone, this key might be scope and
  4208. // the key value might be the zone name. Other examples might be a key
  4209. // indicating a deprecated resource, and a suggested replacement, or a
  4210. // warning about invalid network settings (for example, if an instance
  4211. // attempts to perform IP forwarding but is not enabled for IP
  4212. // forwarding).
  4213. Key string `json:"key,omitempty"`
  4214. // Value: [Output Only] A warning data value corresponding to the key.
  4215. Value string `json:"value,omitempty"`
  4216. // ForceSendFields is a list of field names (e.g. "Key") to
  4217. // unconditionally include in API requests. By default, fields with
  4218. // empty values are omitted from API requests. However, any non-pointer,
  4219. // non-interface field appearing in ForceSendFields will be sent to the
  4220. // server regardless of whether the field is empty or not. This may be
  4221. // used to include empty fields in Patch requests.
  4222. ForceSendFields []string `json:"-"`
  4223. }
  4224. func (s *MachineTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  4225. type noMethod MachineTypesScopedListWarningData
  4226. raw := noMethod(*s)
  4227. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4228. }
  4229. type ManagedInstance struct {
  4230. // CurrentAction: [Output Only] The current action that the managed
  4231. // instance group has scheduled for the instance. Possible values:
  4232. // - NONE The instance is running, and the managed instance group does
  4233. // not have any scheduled actions for this instance.
  4234. // - CREATING The managed instance group is creating this instance. If
  4235. // the group fails to create this instance, it will try again until it
  4236. // is successful.
  4237. // - CREATING_WITHOUT_RETRIES The managed instance group is attempting
  4238. // to create this instance only once. If the group fails to create this
  4239. // instance, it does not try again and the group's target_size value is
  4240. // decreased.
  4241. // - RECREATING The managed instance group is recreating this instance.
  4242. //
  4243. // - DELETING The managed instance group is permanently deleting this
  4244. // instance.
  4245. // - ABANDONING The managed instance group is abandoning this instance.
  4246. // The instance will be removed from the instance group and from any
  4247. // target pools that are associated with this group.
  4248. // - RESTARTING The managed instance group is restarting the instance.
  4249. //
  4250. // - REFRESHING The managed instance group is applying configuration
  4251. // changes to the instance without stopping it. For example, the group
  4252. // can update the target pool list for an instance without stopping that
  4253. // instance.
  4254. //
  4255. // Possible values:
  4256. // "ABANDONING"
  4257. // "CREATING"
  4258. // "DELETING"
  4259. // "NONE"
  4260. // "RECREATING"
  4261. // "REFRESHING"
  4262. // "RESTARTING"
  4263. CurrentAction string `json:"currentAction,omitempty"`
  4264. // Id: [Output only] The unique identifier for this resource. This field
  4265. // is empty when instance does not exist.
  4266. Id uint64 `json:"id,omitempty,string"`
  4267. // Instance: [Output Only] The URL of the instance. The URL can exist
  4268. // even if the instance has not yet been created.
  4269. Instance string `json:"instance,omitempty"`
  4270. // InstanceStatus: [Output Only] The status of the instance. This field
  4271. // is empty when the instance does not exist.
  4272. //
  4273. // Possible values:
  4274. // "PROVISIONING"
  4275. // "RUNNING"
  4276. // "STAGING"
  4277. // "STOPPED"
  4278. // "STOPPING"
  4279. // "SUSPENDED"
  4280. // "SUSPENDING"
  4281. // "TERMINATED"
  4282. InstanceStatus string `json:"instanceStatus,omitempty"`
  4283. // LastAttempt: [Output Only] Information about the last attempt to
  4284. // create or delete the instance.
  4285. LastAttempt *ManagedInstanceLastAttempt `json:"lastAttempt,omitempty"`
  4286. // ForceSendFields is a list of field names (e.g. "CurrentAction") to
  4287. // unconditionally include in API requests. By default, fields with
  4288. // empty values are omitted from API requests. However, any non-pointer,
  4289. // non-interface field appearing in ForceSendFields will be sent to the
  4290. // server regardless of whether the field is empty or not. This may be
  4291. // used to include empty fields in Patch requests.
  4292. ForceSendFields []string `json:"-"`
  4293. }
  4294. func (s *ManagedInstance) MarshalJSON() ([]byte, error) {
  4295. type noMethod ManagedInstance
  4296. raw := noMethod(*s)
  4297. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4298. }
  4299. type ManagedInstanceLastAttempt struct {
  4300. // Errors: [Output Only] Encountered errors during the last attempt to
  4301. // create or delete the instance.
  4302. Errors *ManagedInstanceLastAttemptErrors `json:"errors,omitempty"`
  4303. // ForceSendFields is a list of field names (e.g. "Errors") to
  4304. // unconditionally include in API requests. By default, fields with
  4305. // empty values are omitted from API requests. However, any non-pointer,
  4306. // non-interface field appearing in ForceSendFields will be sent to the
  4307. // server regardless of whether the field is empty or not. This may be
  4308. // used to include empty fields in Patch requests.
  4309. ForceSendFields []string `json:"-"`
  4310. }
  4311. func (s *ManagedInstanceLastAttempt) MarshalJSON() ([]byte, error) {
  4312. type noMethod ManagedInstanceLastAttempt
  4313. raw := noMethod(*s)
  4314. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4315. }
  4316. // ManagedInstanceLastAttemptErrors: [Output Only] Encountered errors
  4317. // during the last attempt to create or delete the instance.
  4318. type ManagedInstanceLastAttemptErrors struct {
  4319. // Errors: [Output Only] The array of errors encountered while
  4320. // processing this operation.
  4321. Errors []*ManagedInstanceLastAttemptErrorsErrors `json:"errors,omitempty"`
  4322. // ForceSendFields is a list of field names (e.g. "Errors") to
  4323. // unconditionally include in API requests. By default, fields with
  4324. // empty values are omitted from API requests. However, any non-pointer,
  4325. // non-interface field appearing in ForceSendFields will be sent to the
  4326. // server regardless of whether the field is empty or not. This may be
  4327. // used to include empty fields in Patch requests.
  4328. ForceSendFields []string `json:"-"`
  4329. }
  4330. func (s *ManagedInstanceLastAttemptErrors) MarshalJSON() ([]byte, error) {
  4331. type noMethod ManagedInstanceLastAttemptErrors
  4332. raw := noMethod(*s)
  4333. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4334. }
  4335. type ManagedInstanceLastAttemptErrorsErrors struct {
  4336. // Code: [Output Only] The error type identifier for this error.
  4337. Code string `json:"code,omitempty"`
  4338. // Location: [Output Only] Indicates the field in the request which
  4339. // caused the error. This property is optional.
  4340. Location string `json:"location,omitempty"`
  4341. // Message: [Output Only] An optional, human-readable error message.
  4342. Message string `json:"message,omitempty"`
  4343. // ForceSendFields is a list of field names (e.g. "Code") to
  4344. // unconditionally include in API requests. By default, fields with
  4345. // empty values are omitted from API requests. However, any non-pointer,
  4346. // non-interface field appearing in ForceSendFields will be sent to the
  4347. // server regardless of whether the field is empty or not. This may be
  4348. // used to include empty fields in Patch requests.
  4349. ForceSendFields []string `json:"-"`
  4350. }
  4351. func (s *ManagedInstanceLastAttemptErrorsErrors) MarshalJSON() ([]byte, error) {
  4352. type noMethod ManagedInstanceLastAttemptErrorsErrors
  4353. raw := noMethod(*s)
  4354. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4355. }
  4356. // Metadata: A metadata key/value entry.
  4357. type Metadata struct {
  4358. // Fingerprint: Specifies a fingerprint for this request, which is
  4359. // essentially a hash of the metadata's contents and used for optimistic
  4360. // locking. The fingerprint is initially generated by Compute Engine and
  4361. // changes after every request to modify or update metadata. You must
  4362. // always provide an up-to-date fingerprint hash in order to update or
  4363. // change metadata.
  4364. Fingerprint string `json:"fingerprint,omitempty"`
  4365. // Items: Array of key/value pairs. The total size of all keys and
  4366. // values must be less than 512 KB.
  4367. Items []*MetadataItems `json:"items,omitempty"`
  4368. // Kind: [Output Only] Type of the resource. Always compute#metadata for
  4369. // metadata.
  4370. Kind string `json:"kind,omitempty"`
  4371. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  4372. // unconditionally include in API requests. By default, fields with
  4373. // empty values are omitted from API requests. However, any non-pointer,
  4374. // non-interface field appearing in ForceSendFields will be sent to the
  4375. // server regardless of whether the field is empty or not. This may be
  4376. // used to include empty fields in Patch requests.
  4377. ForceSendFields []string `json:"-"`
  4378. }
  4379. func (s *Metadata) MarshalJSON() ([]byte, error) {
  4380. type noMethod Metadata
  4381. raw := noMethod(*s)
  4382. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4383. }
  4384. type MetadataItems struct {
  4385. // Key: Key for the metadata entry. Keys must conform to the following
  4386. // regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is
  4387. // reflected as part of a URL in the metadata server. Additionally, to
  4388. // avoid ambiguity, keys must not conflict with any other metadata keys
  4389. // for the project.
  4390. Key string `json:"key,omitempty"`
  4391. // Value: Value for the metadata entry. These are free-form strings, and
  4392. // only have meaning as interpreted by the image running in the
  4393. // instance. The only restriction placed on values is that their size
  4394. // must be less than or equal to 32768 bytes.
  4395. Value string `json:"value,omitempty"`
  4396. // ForceSendFields is a list of field names (e.g. "Key") to
  4397. // unconditionally include in API requests. By default, fields with
  4398. // empty values are omitted from API requests. However, any non-pointer,
  4399. // non-interface field appearing in ForceSendFields will be sent to the
  4400. // server regardless of whether the field is empty or not. This may be
  4401. // used to include empty fields in Patch requests.
  4402. ForceSendFields []string `json:"-"`
  4403. }
  4404. func (s *MetadataItems) MarshalJSON() ([]byte, error) {
  4405. type noMethod MetadataItems
  4406. raw := noMethod(*s)
  4407. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4408. }
  4409. // NamedPort: The named port. For example: .
  4410. type NamedPort struct {
  4411. // Name: The name for this named port. The name must be 1-63 characters
  4412. // long, and comply with RFC1035.
  4413. Name string `json:"name,omitempty"`
  4414. // Port: The port number, which can be a value between 1 and 65535.
  4415. Port int64 `json:"port,omitempty"`
  4416. // ForceSendFields is a list of field names (e.g. "Name") to
  4417. // unconditionally include in API requests. By default, fields with
  4418. // empty values are omitted from API requests. However, any non-pointer,
  4419. // non-interface field appearing in ForceSendFields will be sent to the
  4420. // server regardless of whether the field is empty or not. This may be
  4421. // used to include empty fields in Patch requests.
  4422. ForceSendFields []string `json:"-"`
  4423. }
  4424. func (s *NamedPort) MarshalJSON() ([]byte, error) {
  4425. type noMethod NamedPort
  4426. raw := noMethod(*s)
  4427. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4428. }
  4429. // Network: A network resource.
  4430. type Network struct {
  4431. // IPv4Range: The range of internal addresses that are legal on this
  4432. // network. This range is a CIDR specification, for example:
  4433. // 192.168.0.0/16. Provided by the client when the network is created.
  4434. IPv4Range string `json:"IPv4Range,omitempty"`
  4435. // AutoCreateSubnetworks: When set to true, the network is created in
  4436. // "auto subnet mode". When set to false, the network is in "custom
  4437. // subnet mode".
  4438. //
  4439. // In "auto subnet mode", a newly created network is assigned the
  4440. // default CIDR of 10.128.0.0/9 and it automatically creates one
  4441. // subnetwork per region.
  4442. AutoCreateSubnetworks bool `json:"autoCreateSubnetworks,omitempty"`
  4443. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  4444. // format.
  4445. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  4446. // Description: An optional description of this resource. Provide this
  4447. // property when you create the resource.
  4448. Description string `json:"description,omitempty"`
  4449. // GatewayIPv4: A gateway address for default routing to other networks.
  4450. // This value is read only and is selected by the Google Compute Engine,
  4451. // typically as the first usable address in the IPv4Range.
  4452. GatewayIPv4 string `json:"gatewayIPv4,omitempty"`
  4453. // Id: [Output Only] The unique identifier for the resource. This
  4454. // identifier is defined by the server.
  4455. Id uint64 `json:"id,omitempty,string"`
  4456. // Kind: [Output Only] Type of the resource. Always compute#network for
  4457. // networks.
  4458. Kind string `json:"kind,omitempty"`
  4459. // Name: Name of the resource. Provided by the client when the resource
  4460. // is created. The name must be 1-63 characters long, and comply with
  4461. // RFC1035. Specifically, the name must be 1-63 characters long and
  4462. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  4463. // the first character must be a lowercase letter, and all following
  4464. // characters must be a dash, lowercase letter, or digit, except the
  4465. // last character, which cannot be a dash.
  4466. Name string `json:"name,omitempty"`
  4467. // SelfLink: [Output Only] Server-defined URL for the resource.
  4468. SelfLink string `json:"selfLink,omitempty"`
  4469. // Subnetworks: [Output Only] Server-defined fully-qualified URLs for
  4470. // all subnetworks in this network.
  4471. Subnetworks []string `json:"subnetworks,omitempty"`
  4472. // ServerResponse contains the HTTP response code and headers from the
  4473. // server.
  4474. googleapi.ServerResponse `json:"-"`
  4475. // ForceSendFields is a list of field names (e.g. "IPv4Range") to
  4476. // unconditionally include in API requests. By default, fields with
  4477. // empty values are omitted from API requests. However, any non-pointer,
  4478. // non-interface field appearing in ForceSendFields will be sent to the
  4479. // server regardless of whether the field is empty or not. This may be
  4480. // used to include empty fields in Patch requests.
  4481. ForceSendFields []string `json:"-"`
  4482. }
  4483. func (s *Network) MarshalJSON() ([]byte, error) {
  4484. type noMethod Network
  4485. raw := noMethod(*s)
  4486. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4487. }
  4488. // NetworkInterface: A network interface resource attached to an
  4489. // instance.
  4490. type NetworkInterface struct {
  4491. // AccessConfigs: An array of configurations for this interface.
  4492. // Currently, ONE_TO_ONE_NAT is the only access config supported. If
  4493. // there are no accessConfigs specified, then this instance will have no
  4494. // external internet access.
  4495. AccessConfigs []*AccessConfig `json:"accessConfigs,omitempty"`
  4496. // Name: [Output Only] The name of the network interface, generated by
  4497. // the server. For network devices, these are eth0, eth1, etc.
  4498. Name string `json:"name,omitempty"`
  4499. // Network: URL of the network resource for this instance. This is
  4500. // required for creating an instance but optional when creating a
  4501. // firewall rule. If not specified when creating a firewall rule, the
  4502. // default network is used:
  4503. //
  4504. // global/networks/default
  4505. //
  4506. // If you specify this property, you can specify the network as a full
  4507. // or partial URL. For example, the following are all valid URLs:
  4508. // -
  4509. // https://www.googleapis.com/compute/v1/projects/project/global/networks/network
  4510. // - projects/project/global/networks/network
  4511. // - global/networks/default
  4512. Network string `json:"network,omitempty"`
  4513. // NetworkIP: [Output Only] An optional IPV4 internal network address
  4514. // assigned to the instance for this network interface.
  4515. NetworkIP string `json:"networkIP,omitempty"`
  4516. // Subnetwork: The URL of the Subnetwork resource for this instance. If
  4517. // the network resource is in legacy mode, do not provide this property.
  4518. // If the network is in auto subnet mode, providing the subnetwork is
  4519. // optional. If the network is in custom subnet mode, then this field
  4520. // should be specified. If you specify this property, you can specify
  4521. // the subnetwork as a full or partial URL. For example, the following
  4522. // are all valid URLs:
  4523. // -
  4524. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/subnetworks/subnetwork
  4525. // - zones/zone/subnetworks/subnetwork
  4526. Subnetwork string `json:"subnetwork,omitempty"`
  4527. // ForceSendFields is a list of field names (e.g. "AccessConfigs") to
  4528. // unconditionally include in API requests. By default, fields with
  4529. // empty values are omitted from API requests. However, any non-pointer,
  4530. // non-interface field appearing in ForceSendFields will be sent to the
  4531. // server regardless of whether the field is empty or not. This may be
  4532. // used to include empty fields in Patch requests.
  4533. ForceSendFields []string `json:"-"`
  4534. }
  4535. func (s *NetworkInterface) MarshalJSON() ([]byte, error) {
  4536. type noMethod NetworkInterface
  4537. raw := noMethod(*s)
  4538. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4539. }
  4540. // NetworkList: Contains a list of Network resources.
  4541. type NetworkList struct {
  4542. // Id: [Output Only] The unique identifier for the resource. This
  4543. // identifier is defined by the server.
  4544. Id string `json:"id,omitempty"`
  4545. // Items: [Output Only] A list of Network resources.
  4546. Items []*Network `json:"items,omitempty"`
  4547. // Kind: [Output Only] Type of resource. Always compute#networkList for
  4548. // lists of networks.
  4549. Kind string `json:"kind,omitempty"`
  4550. // NextPageToken: [Output Only] This token allows you to get the next
  4551. // page of results for list requests. If the number of results is larger
  4552. // than maxResults, use the nextPageToken as a value for the query
  4553. // parameter pageToken in the next list request. Subsequent list
  4554. // requests will have their own nextPageToken to continue paging through
  4555. // the results.
  4556. NextPageToken string `json:"nextPageToken,omitempty"`
  4557. // SelfLink: [Output Only] Server-defined URL for this resource .
  4558. SelfLink string `json:"selfLink,omitempty"`
  4559. // ServerResponse contains the HTTP response code and headers from the
  4560. // server.
  4561. googleapi.ServerResponse `json:"-"`
  4562. // ForceSendFields is a list of field names (e.g. "Id") to
  4563. // unconditionally include in API requests. By default, fields with
  4564. // empty values are omitted from API requests. However, any non-pointer,
  4565. // non-interface field appearing in ForceSendFields will be sent to the
  4566. // server regardless of whether the field is empty or not. This may be
  4567. // used to include empty fields in Patch requests.
  4568. ForceSendFields []string `json:"-"`
  4569. }
  4570. func (s *NetworkList) MarshalJSON() ([]byte, error) {
  4571. type noMethod NetworkList
  4572. raw := noMethod(*s)
  4573. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4574. }
  4575. // Operation: An Operation resource, used to manage asynchronous API
  4576. // requests.
  4577. type Operation struct {
  4578. // ClientOperationId: [Output Only] A unique client ID generated by the
  4579. // server.
  4580. ClientOperationId string `json:"clientOperationId,omitempty"`
  4581. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  4582. // format.
  4583. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  4584. // Description: [Output Only] A textual description of the operation,
  4585. // which is set when the operation is created.
  4586. Description string `json:"description,omitempty"`
  4587. // EndTime: [Output Only] The time that this operation was completed.
  4588. // This value is in RFC3339 text format.
  4589. EndTime string `json:"endTime,omitempty"`
  4590. // Error: [Output Only] If errors are generated during processing of the
  4591. // operation, this field will be populated.
  4592. Error *OperationError `json:"error,omitempty"`
  4593. // HttpErrorMessage: [Output Only] If the operation fails, this field
  4594. // contains the HTTP error message that was returned, such as NOT FOUND.
  4595. HttpErrorMessage string `json:"httpErrorMessage,omitempty"`
  4596. // HttpErrorStatusCode: [Output Only] If the operation fails, this field
  4597. // contains the HTTP error status code that was returned. For example, a
  4598. // 404 means the resource was not found.
  4599. HttpErrorStatusCode int64 `json:"httpErrorStatusCode,omitempty"`
  4600. // Id: [Output Only] The unique identifier for the resource. This
  4601. // identifier is defined by the server.
  4602. Id uint64 `json:"id,omitempty,string"`
  4603. // InsertTime: [Output Only] The time that this operation was requested.
  4604. // This value is in RFC3339 text format.
  4605. InsertTime string `json:"insertTime,omitempty"`
  4606. // Kind: [Output Only] Type of the resource. Always compute#operation
  4607. // for Operation resources.
  4608. Kind string `json:"kind,omitempty"`
  4609. // Name: [Output Only] Name of the resource.
  4610. Name string `json:"name,omitempty"`
  4611. // OperationType: [Output Only] The type of operation, which can be
  4612. // insert, update, or delete.
  4613. OperationType string `json:"operationType,omitempty"`
  4614. // Progress: [Output Only] An optional progress indicator that ranges
  4615. // from 0 to 100. There is no requirement that this be linear or support
  4616. // any granularity of operations. This should not be used to guess when
  4617. // the operation will be complete. This number should monotonically
  4618. // increase as the operation progresses.
  4619. Progress int64 `json:"progress,omitempty"`
  4620. // Region: [Output Only] URL of the region where the operation resides.
  4621. // Only available when performing regional operations.
  4622. Region string `json:"region,omitempty"`
  4623. // SelfLink: [Output Only] Server-defined URL for the resource.
  4624. SelfLink string `json:"selfLink,omitempty"`
  4625. // StartTime: [Output Only] The time that this operation was started by
  4626. // the server. This value is in RFC3339 text format.
  4627. StartTime string `json:"startTime,omitempty"`
  4628. // Status: [Output Only] The status of the operation, which can be one
  4629. // of the following: PENDING, RUNNING, or DONE.
  4630. //
  4631. // Possible values:
  4632. // "DONE"
  4633. // "PENDING"
  4634. // "RUNNING"
  4635. Status string `json:"status,omitempty"`
  4636. // StatusMessage: [Output Only] An optional textual description of the
  4637. // current status of the operation.
  4638. StatusMessage string `json:"statusMessage,omitempty"`
  4639. // TargetId: [Output Only] The unique target ID, which identifies a
  4640. // specific incarnation of the target resource.
  4641. TargetId uint64 `json:"targetId,omitempty,string"`
  4642. // TargetLink: [Output Only] The URL of the resource that the operation
  4643. // is modifying.
  4644. TargetLink string `json:"targetLink,omitempty"`
  4645. // User: [Output Only] User who requested the operation, for example:
  4646. // user@example.com.
  4647. User string `json:"user,omitempty"`
  4648. // Warnings: [Output Only] If warning messages are generated during
  4649. // processing of the operation, this field will be populated.
  4650. Warnings []*OperationWarnings `json:"warnings,omitempty"`
  4651. // Zone: [Output Only] URL of the zone where the operation resides. Only
  4652. // available when performing per-zone operations.
  4653. Zone string `json:"zone,omitempty"`
  4654. // ServerResponse contains the HTTP response code and headers from the
  4655. // server.
  4656. googleapi.ServerResponse `json:"-"`
  4657. // ForceSendFields is a list of field names (e.g. "ClientOperationId")
  4658. // to unconditionally include in API requests. By default, fields with
  4659. // empty values are omitted from API requests. However, any non-pointer,
  4660. // non-interface field appearing in ForceSendFields will be sent to the
  4661. // server regardless of whether the field is empty or not. This may be
  4662. // used to include empty fields in Patch requests.
  4663. ForceSendFields []string `json:"-"`
  4664. }
  4665. func (s *Operation) MarshalJSON() ([]byte, error) {
  4666. type noMethod Operation
  4667. raw := noMethod(*s)
  4668. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4669. }
  4670. // OperationError: [Output Only] If errors are generated during
  4671. // processing of the operation, this field will be populated.
  4672. type OperationError struct {
  4673. // Errors: [Output Only] The array of errors encountered while
  4674. // processing this operation.
  4675. Errors []*OperationErrorErrors `json:"errors,omitempty"`
  4676. // ForceSendFields is a list of field names (e.g. "Errors") to
  4677. // unconditionally include in API requests. By default, fields with
  4678. // empty values are omitted from API requests. However, any non-pointer,
  4679. // non-interface field appearing in ForceSendFields will be sent to the
  4680. // server regardless of whether the field is empty or not. This may be
  4681. // used to include empty fields in Patch requests.
  4682. ForceSendFields []string `json:"-"`
  4683. }
  4684. func (s *OperationError) MarshalJSON() ([]byte, error) {
  4685. type noMethod OperationError
  4686. raw := noMethod(*s)
  4687. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4688. }
  4689. type OperationErrorErrors struct {
  4690. // Code: [Output Only] The error type identifier for this error.
  4691. Code string `json:"code,omitempty"`
  4692. // Location: [Output Only] Indicates the field in the request which
  4693. // caused the error. This property is optional.
  4694. Location string `json:"location,omitempty"`
  4695. // Message: [Output Only] An optional, human-readable error message.
  4696. Message string `json:"message,omitempty"`
  4697. // ForceSendFields is a list of field names (e.g. "Code") to
  4698. // unconditionally include in API requests. By default, fields with
  4699. // empty values are omitted from API requests. However, any non-pointer,
  4700. // non-interface field appearing in ForceSendFields will be sent to the
  4701. // server regardless of whether the field is empty or not. This may be
  4702. // used to include empty fields in Patch requests.
  4703. ForceSendFields []string `json:"-"`
  4704. }
  4705. func (s *OperationErrorErrors) MarshalJSON() ([]byte, error) {
  4706. type noMethod OperationErrorErrors
  4707. raw := noMethod(*s)
  4708. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4709. }
  4710. type OperationWarnings struct {
  4711. // Code: [Output Only] A warning code, if applicable. For example,
  4712. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  4713. // the response.
  4714. //
  4715. // Possible values:
  4716. // "DEPRECATED_RESOURCE_USED"
  4717. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4718. // "INJECTED_KERNELS_DEPRECATED"
  4719. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4720. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4721. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4722. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4723. // "NEXT_HOP_NOT_RUNNING"
  4724. // "NOT_CRITICAL_ERROR"
  4725. // "NO_RESULTS_ON_PAGE"
  4726. // "REQUIRED_TOS_AGREEMENT"
  4727. // "RESOURCE_NOT_DELETED"
  4728. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4729. // "UNREACHABLE"
  4730. Code string `json:"code,omitempty"`
  4731. // Data: [Output Only] Metadata about this warning in key: value format.
  4732. // For example:
  4733. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4734. Data []*OperationWarningsData `json:"data,omitempty"`
  4735. // Message: [Output Only] A human-readable description of the warning
  4736. // code.
  4737. Message string `json:"message,omitempty"`
  4738. // ForceSendFields is a list of field names (e.g. "Code") to
  4739. // unconditionally include in API requests. By default, fields with
  4740. // empty values are omitted from API requests. However, any non-pointer,
  4741. // non-interface field appearing in ForceSendFields will be sent to the
  4742. // server regardless of whether the field is empty or not. This may be
  4743. // used to include empty fields in Patch requests.
  4744. ForceSendFields []string `json:"-"`
  4745. }
  4746. func (s *OperationWarnings) MarshalJSON() ([]byte, error) {
  4747. type noMethod OperationWarnings
  4748. raw := noMethod(*s)
  4749. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4750. }
  4751. type OperationWarningsData struct {
  4752. // Key: [Output Only] A key that provides more detail on the warning
  4753. // being returned. For example, for warnings where there are no results
  4754. // in a list request for a particular zone, this key might be scope and
  4755. // the key value might be the zone name. Other examples might be a key
  4756. // indicating a deprecated resource, and a suggested replacement, or a
  4757. // warning about invalid network settings (for example, if an instance
  4758. // attempts to perform IP forwarding but is not enabled for IP
  4759. // forwarding).
  4760. Key string `json:"key,omitempty"`
  4761. // Value: [Output Only] A warning data value corresponding to the key.
  4762. Value string `json:"value,omitempty"`
  4763. // ForceSendFields is a list of field names (e.g. "Key") to
  4764. // unconditionally include in API requests. By default, fields with
  4765. // empty values are omitted from API requests. However, any non-pointer,
  4766. // non-interface field appearing in ForceSendFields will be sent to the
  4767. // server regardless of whether the field is empty or not. This may be
  4768. // used to include empty fields in Patch requests.
  4769. ForceSendFields []string `json:"-"`
  4770. }
  4771. func (s *OperationWarningsData) MarshalJSON() ([]byte, error) {
  4772. type noMethod OperationWarningsData
  4773. raw := noMethod(*s)
  4774. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4775. }
  4776. type OperationAggregatedList struct {
  4777. // Id: [Output Only] The unique identifier for the resource. This
  4778. // identifier is defined by the server.
  4779. Id string `json:"id,omitempty"`
  4780. // Items: [Output Only] A map of scoped operation lists.
  4781. Items map[string]OperationsScopedList `json:"items,omitempty"`
  4782. // Kind: [Output Only] Type of resource. Always
  4783. // compute#operationAggregatedList for aggregated lists of operations.
  4784. Kind string `json:"kind,omitempty"`
  4785. // NextPageToken: [Output Only] This token allows you to get the next
  4786. // page of results for list requests. If the number of results is larger
  4787. // than maxResults, use the nextPageToken as a value for the query
  4788. // parameter pageToken in the next list request. Subsequent list
  4789. // requests will have their own nextPageToken to continue paging through
  4790. // the results.
  4791. NextPageToken string `json:"nextPageToken,omitempty"`
  4792. // SelfLink: [Output Only] Server-defined URL for this resource.
  4793. SelfLink string `json:"selfLink,omitempty"`
  4794. // ServerResponse contains the HTTP response code and headers from the
  4795. // server.
  4796. googleapi.ServerResponse `json:"-"`
  4797. // ForceSendFields is a list of field names (e.g. "Id") to
  4798. // unconditionally include in API requests. By default, fields with
  4799. // empty values are omitted from API requests. However, any non-pointer,
  4800. // non-interface field appearing in ForceSendFields will be sent to the
  4801. // server regardless of whether the field is empty or not. This may be
  4802. // used to include empty fields in Patch requests.
  4803. ForceSendFields []string `json:"-"`
  4804. }
  4805. func (s *OperationAggregatedList) MarshalJSON() ([]byte, error) {
  4806. type noMethod OperationAggregatedList
  4807. raw := noMethod(*s)
  4808. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4809. }
  4810. // OperationList: Contains a list of Operation resources.
  4811. type OperationList struct {
  4812. // Id: [Output Only] The unique identifier for the resource. This
  4813. // identifier is defined by the server.
  4814. Id string `json:"id,omitempty"`
  4815. // Items: [Output Only] The Operation resources.
  4816. Items []*Operation `json:"items,omitempty"`
  4817. // Kind: [Output Only] Type of resource. Always compute#operations for
  4818. // Operations resource.
  4819. Kind string `json:"kind,omitempty"`
  4820. // NextPageToken: [Output Only] This token allows you to get the next
  4821. // page of results for list requests. If the number of results is larger
  4822. // than maxResults, use the nextPageToken as a value for the query
  4823. // parameter pageToken in the next list request. Subsequent list
  4824. // requests will have their own nextPageToken to continue paging through
  4825. // the results.
  4826. NextPageToken string `json:"nextPageToken,omitempty"`
  4827. // SelfLink: [Output Only] Server-defined URL for this resource.
  4828. SelfLink string `json:"selfLink,omitempty"`
  4829. // ServerResponse contains the HTTP response code and headers from the
  4830. // server.
  4831. googleapi.ServerResponse `json:"-"`
  4832. // ForceSendFields is a list of field names (e.g. "Id") to
  4833. // unconditionally include in API requests. By default, fields with
  4834. // empty values are omitted from API requests. However, any non-pointer,
  4835. // non-interface field appearing in ForceSendFields will be sent to the
  4836. // server regardless of whether the field is empty or not. This may be
  4837. // used to include empty fields in Patch requests.
  4838. ForceSendFields []string `json:"-"`
  4839. }
  4840. func (s *OperationList) MarshalJSON() ([]byte, error) {
  4841. type noMethod OperationList
  4842. raw := noMethod(*s)
  4843. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4844. }
  4845. type OperationsScopedList struct {
  4846. // Operations: [Output Only] List of operations contained in this scope.
  4847. Operations []*Operation `json:"operations,omitempty"`
  4848. // Warning: [Output Only] Informational warning which replaces the list
  4849. // of operations when the list is empty.
  4850. Warning *OperationsScopedListWarning `json:"warning,omitempty"`
  4851. // ForceSendFields is a list of field names (e.g. "Operations") to
  4852. // unconditionally include in API requests. By default, fields with
  4853. // empty values are omitted from API requests. However, any non-pointer,
  4854. // non-interface field appearing in ForceSendFields will be sent to the
  4855. // server regardless of whether the field is empty or not. This may be
  4856. // used to include empty fields in Patch requests.
  4857. ForceSendFields []string `json:"-"`
  4858. }
  4859. func (s *OperationsScopedList) MarshalJSON() ([]byte, error) {
  4860. type noMethod OperationsScopedList
  4861. raw := noMethod(*s)
  4862. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4863. }
  4864. // OperationsScopedListWarning: [Output Only] Informational warning
  4865. // which replaces the list of operations when the list is empty.
  4866. type OperationsScopedListWarning struct {
  4867. // Code: [Output Only] A warning code, if applicable. For example,
  4868. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  4869. // the response.
  4870. //
  4871. // Possible values:
  4872. // "DEPRECATED_RESOURCE_USED"
  4873. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4874. // "INJECTED_KERNELS_DEPRECATED"
  4875. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4876. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4877. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4878. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4879. // "NEXT_HOP_NOT_RUNNING"
  4880. // "NOT_CRITICAL_ERROR"
  4881. // "NO_RESULTS_ON_PAGE"
  4882. // "REQUIRED_TOS_AGREEMENT"
  4883. // "RESOURCE_NOT_DELETED"
  4884. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4885. // "UNREACHABLE"
  4886. Code string `json:"code,omitempty"`
  4887. // Data: [Output Only] Metadata about this warning in key: value format.
  4888. // For example:
  4889. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4890. Data []*OperationsScopedListWarningData `json:"data,omitempty"`
  4891. // Message: [Output Only] A human-readable description of the warning
  4892. // code.
  4893. Message string `json:"message,omitempty"`
  4894. // ForceSendFields is a list of field names (e.g. "Code") to
  4895. // unconditionally include in API requests. By default, fields with
  4896. // empty values are omitted from API requests. However, any non-pointer,
  4897. // non-interface field appearing in ForceSendFields will be sent to the
  4898. // server regardless of whether the field is empty or not. This may be
  4899. // used to include empty fields in Patch requests.
  4900. ForceSendFields []string `json:"-"`
  4901. }
  4902. func (s *OperationsScopedListWarning) MarshalJSON() ([]byte, error) {
  4903. type noMethod OperationsScopedListWarning
  4904. raw := noMethod(*s)
  4905. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4906. }
  4907. type OperationsScopedListWarningData struct {
  4908. // Key: [Output Only] A key that provides more detail on the warning
  4909. // being returned. For example, for warnings where there are no results
  4910. // in a list request for a particular zone, this key might be scope and
  4911. // the key value might be the zone name. Other examples might be a key
  4912. // indicating a deprecated resource, and a suggested replacement, or a
  4913. // warning about invalid network settings (for example, if an instance
  4914. // attempts to perform IP forwarding but is not enabled for IP
  4915. // forwarding).
  4916. Key string `json:"key,omitempty"`
  4917. // Value: [Output Only] A warning data value corresponding to the key.
  4918. Value string `json:"value,omitempty"`
  4919. // ForceSendFields is a list of field names (e.g. "Key") to
  4920. // unconditionally include in API requests. By default, fields with
  4921. // empty values are omitted from API requests. However, any non-pointer,
  4922. // non-interface field appearing in ForceSendFields will be sent to the
  4923. // server regardless of whether the field is empty or not. This may be
  4924. // used to include empty fields in Patch requests.
  4925. ForceSendFields []string `json:"-"`
  4926. }
  4927. func (s *OperationsScopedListWarningData) MarshalJSON() ([]byte, error) {
  4928. type noMethod OperationsScopedListWarningData
  4929. raw := noMethod(*s)
  4930. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4931. }
  4932. // PathMatcher: A matcher for the path portion of the URL. The
  4933. // BackendService from the longest-matched rule will serve the URL. If
  4934. // no rule was matched, the default service will be used.
  4935. type PathMatcher struct {
  4936. // DefaultService: The full or partial URL to the BackendService
  4937. // resource. This will be used if none of the pathRules defined by this
  4938. // PathMatcher is matched by the URL's path portion. For example, the
  4939. // following are all valid URLs to a BackendService resource:
  4940. // -
  4941. // https://www.googleapis.com/compute/v1/projects/project/global/backendServices/backendService
  4942. // - compute/v1/projects/project/global/backendServices/backendService
  4943. //
  4944. // - global/backendServices/backendService
  4945. DefaultService string `json:"defaultService,omitempty"`
  4946. // Description: An optional description of this resource. Provide this
  4947. // property when you create the resource.
  4948. Description string `json:"description,omitempty"`
  4949. // Name: The name to which this PathMatcher is referred by the HostRule.
  4950. Name string `json:"name,omitempty"`
  4951. // PathRules: The list of path rules.
  4952. PathRules []*PathRule `json:"pathRules,omitempty"`
  4953. // ForceSendFields is a list of field names (e.g. "DefaultService") to
  4954. // unconditionally include in API requests. By default, fields with
  4955. // empty values are omitted from API requests. However, any non-pointer,
  4956. // non-interface field appearing in ForceSendFields will be sent to the
  4957. // server regardless of whether the field is empty or not. This may be
  4958. // used to include empty fields in Patch requests.
  4959. ForceSendFields []string `json:"-"`
  4960. }
  4961. func (s *PathMatcher) MarshalJSON() ([]byte, error) {
  4962. type noMethod PathMatcher
  4963. raw := noMethod(*s)
  4964. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4965. }
  4966. // PathRule: A path-matching rule for a URL. If matched, will use the
  4967. // specified BackendService to handle the traffic arriving at this URL.
  4968. type PathRule struct {
  4969. // Paths: The list of path patterns to match. Each must start with / and
  4970. // the only place a * is allowed is at the end following a /. The string
  4971. // fed to the path matcher does not include any text after the first ?
  4972. // or #, and those chars are not allowed here.
  4973. Paths []string `json:"paths,omitempty"`
  4974. // Service: The URL of the BackendService resource if this rule is
  4975. // matched.
  4976. Service string `json:"service,omitempty"`
  4977. // ForceSendFields is a list of field names (e.g. "Paths") to
  4978. // unconditionally include in API requests. By default, fields with
  4979. // empty values are omitted from API requests. However, any non-pointer,
  4980. // non-interface field appearing in ForceSendFields will be sent to the
  4981. // server regardless of whether the field is empty or not. This may be
  4982. // used to include empty fields in Patch requests.
  4983. ForceSendFields []string `json:"-"`
  4984. }
  4985. func (s *PathRule) MarshalJSON() ([]byte, error) {
  4986. type noMethod PathRule
  4987. raw := noMethod(*s)
  4988. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4989. }
  4990. // Project: A Project resource. Projects can only be created in the
  4991. // Google Developers Console. Unless marked otherwise, values can only
  4992. // be modified in the console.
  4993. type Project struct {
  4994. // CommonInstanceMetadata: Metadata key/value pairs available to all
  4995. // instances contained in this project. See Custom metadata for more
  4996. // information.
  4997. CommonInstanceMetadata *Metadata `json:"commonInstanceMetadata,omitempty"`
  4998. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  4999. // format.
  5000. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  5001. // Description: An optional textual description of the resource.
  5002. Description string `json:"description,omitempty"`
  5003. // EnabledFeatures: Restricted features enabled for use on this project.
  5004. EnabledFeatures []string `json:"enabledFeatures,omitempty"`
  5005. // Id: [Output Only] The unique identifier for the resource. This
  5006. // identifier is defined by the server. This is not the project ID, and
  5007. // is just a unique ID used by Compute Engine to identify resources.
  5008. Id uint64 `json:"id,omitempty,string"`
  5009. // Kind: [Output Only] Type of the resource. Always compute#project for
  5010. // projects.
  5011. Kind string `json:"kind,omitempty"`
  5012. // Name: The project ID. For example: my-example-project. Use the
  5013. // project ID to make requests to Compute Engine.
  5014. Name string `json:"name,omitempty"`
  5015. // Quotas: [Output Only] Quotas assigned to this project.
  5016. Quotas []*Quota `json:"quotas,omitempty"`
  5017. // SelfLink: [Output Only] Server-defined URL for the resource.
  5018. SelfLink string `json:"selfLink,omitempty"`
  5019. // UsageExportLocation: The naming prefix for daily usage reports and
  5020. // the Google Cloud Storage bucket where they are stored.
  5021. UsageExportLocation *UsageExportLocation `json:"usageExportLocation,omitempty"`
  5022. // ServerResponse contains the HTTP response code and headers from the
  5023. // server.
  5024. googleapi.ServerResponse `json:"-"`
  5025. // ForceSendFields is a list of field names (e.g.
  5026. // "CommonInstanceMetadata") to unconditionally include in API requests.
  5027. // By default, fields with empty values are omitted from API requests.
  5028. // However, any non-pointer, non-interface field appearing in
  5029. // ForceSendFields will be sent to the server regardless of whether the
  5030. // field is empty or not. This may be used to include empty fields in
  5031. // Patch requests.
  5032. ForceSendFields []string `json:"-"`
  5033. }
  5034. func (s *Project) MarshalJSON() ([]byte, error) {
  5035. type noMethod Project
  5036. raw := noMethod(*s)
  5037. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5038. }
  5039. // Quota: A quotas entry.
  5040. type Quota struct {
  5041. // Limit: [Output Only] Quota limit for this metric.
  5042. Limit float64 `json:"limit,omitempty"`
  5043. // Metric: [Output Only] Name of the quota metric.
  5044. //
  5045. // Possible values:
  5046. // "AUTOSCALERS"
  5047. // "BACKEND_SERVICES"
  5048. // "CPUS"
  5049. // "DISKS_TOTAL_GB"
  5050. // "FIREWALLS"
  5051. // "FORWARDING_RULES"
  5052. // "HEALTH_CHECKS"
  5053. // "IMAGES"
  5054. // "INSTANCES"
  5055. // "INSTANCE_GROUPS"
  5056. // "INSTANCE_GROUP_MANAGERS"
  5057. // "INSTANCE_TEMPLATES"
  5058. // "IN_USE_ADDRESSES"
  5059. // "LOCAL_SSD_TOTAL_GB"
  5060. // "NETWORKS"
  5061. // "ROUTES"
  5062. // "SNAPSHOTS"
  5063. // "SSD_TOTAL_GB"
  5064. // "SSL_CERTIFICATES"
  5065. // "STATIC_ADDRESSES"
  5066. // "SUBNETWORKS"
  5067. // "TARGET_HTTPS_PROXIES"
  5068. // "TARGET_HTTP_PROXIES"
  5069. // "TARGET_INSTANCES"
  5070. // "TARGET_POOLS"
  5071. // "TARGET_VPN_GATEWAYS"
  5072. // "URL_MAPS"
  5073. // "VPN_TUNNELS"
  5074. Metric string `json:"metric,omitempty"`
  5075. // Usage: [Output Only] Current usage of this metric.
  5076. Usage float64 `json:"usage,omitempty"`
  5077. // ForceSendFields is a list of field names (e.g. "Limit") to
  5078. // unconditionally include in API requests. By default, fields with
  5079. // empty values are omitted from API requests. However, any non-pointer,
  5080. // non-interface field appearing in ForceSendFields will be sent to the
  5081. // server regardless of whether the field is empty or not. This may be
  5082. // used to include empty fields in Patch requests.
  5083. ForceSendFields []string `json:"-"`
  5084. }
  5085. func (s *Quota) MarshalJSON() ([]byte, error) {
  5086. type noMethod Quota
  5087. raw := noMethod(*s)
  5088. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5089. }
  5090. // Region: Region resource.
  5091. type Region struct {
  5092. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  5093. // format.
  5094. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  5095. // Deprecated: [Output Only] The deprecation status associated with this
  5096. // region.
  5097. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  5098. // Description: [Output Only] Textual description of the resource.
  5099. Description string `json:"description,omitempty"`
  5100. // Id: [Output Only] The unique identifier for the resource. This
  5101. // identifier is defined by the server.
  5102. Id uint64 `json:"id,omitempty,string"`
  5103. // Kind: [Output Only] Type of the resource. Always compute#region for
  5104. // regions.
  5105. Kind string `json:"kind,omitempty"`
  5106. // Name: [Output Only] Name of the resource.
  5107. Name string `json:"name,omitempty"`
  5108. // Quotas: [Output Only] Quotas assigned to this region.
  5109. Quotas []*Quota `json:"quotas,omitempty"`
  5110. // SelfLink: [Output Only] Server-defined URL for the resource.
  5111. SelfLink string `json:"selfLink,omitempty"`
  5112. // Status: [Output Only] Status of the region, either UP or DOWN.
  5113. //
  5114. // Possible values:
  5115. // "DOWN"
  5116. // "UP"
  5117. Status string `json:"status,omitempty"`
  5118. // Zones: [Output Only] A list of zones available in this region, in the
  5119. // form of resource URLs.
  5120. Zones []string `json:"zones,omitempty"`
  5121. // ServerResponse contains the HTTP response code and headers from the
  5122. // server.
  5123. googleapi.ServerResponse `json:"-"`
  5124. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  5125. // to unconditionally include in API requests. By default, fields with
  5126. // empty values are omitted from API requests. However, any non-pointer,
  5127. // non-interface field appearing in ForceSendFields will be sent to the
  5128. // server regardless of whether the field is empty or not. This may be
  5129. // used to include empty fields in Patch requests.
  5130. ForceSendFields []string `json:"-"`
  5131. }
  5132. func (s *Region) MarshalJSON() ([]byte, error) {
  5133. type noMethod Region
  5134. raw := noMethod(*s)
  5135. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5136. }
  5137. // RegionList: Contains a list of region resources.
  5138. type RegionList struct {
  5139. // Id: [Output Only] The unique identifier for the resource. This
  5140. // identifier is defined by the server.
  5141. Id string `json:"id,omitempty"`
  5142. // Items: [Output Only] A list of Region resources.
  5143. Items []*Region `json:"items,omitempty"`
  5144. // Kind: [Output Only] Type of resource. Always compute#regionList for
  5145. // lists of regions.
  5146. Kind string `json:"kind,omitempty"`
  5147. // NextPageToken: [Output Only] This token allows you to get the next
  5148. // page of results for list requests. If the number of results is larger
  5149. // than maxResults, use the nextPageToken as a value for the query
  5150. // parameter pageToken in the next list request. Subsequent list
  5151. // requests will have their own nextPageToken to continue paging through
  5152. // the results.
  5153. NextPageToken string `json:"nextPageToken,omitempty"`
  5154. // SelfLink: [Output Only] Server-defined URL for this resource.
  5155. SelfLink string `json:"selfLink,omitempty"`
  5156. // ServerResponse contains the HTTP response code and headers from the
  5157. // server.
  5158. googleapi.ServerResponse `json:"-"`
  5159. // ForceSendFields is a list of field names (e.g. "Id") to
  5160. // unconditionally include in API requests. By default, fields with
  5161. // empty values are omitted from API requests. However, any non-pointer,
  5162. // non-interface field appearing in ForceSendFields will be sent to the
  5163. // server regardless of whether the field is empty or not. This may be
  5164. // used to include empty fields in Patch requests.
  5165. ForceSendFields []string `json:"-"`
  5166. }
  5167. func (s *RegionList) MarshalJSON() ([]byte, error) {
  5168. type noMethod RegionList
  5169. raw := noMethod(*s)
  5170. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5171. }
  5172. type ResourceGroupReference struct {
  5173. // Group: A URI referencing one of the resource views listed in the
  5174. // backend service.
  5175. Group string `json:"group,omitempty"`
  5176. // ForceSendFields is a list of field names (e.g. "Group") to
  5177. // unconditionally include in API requests. By default, fields with
  5178. // empty values are omitted from API requests. However, any non-pointer,
  5179. // non-interface field appearing in ForceSendFields will be sent to the
  5180. // server regardless of whether the field is empty or not. This may be
  5181. // used to include empty fields in Patch requests.
  5182. ForceSendFields []string `json:"-"`
  5183. }
  5184. func (s *ResourceGroupReference) MarshalJSON() ([]byte, error) {
  5185. type noMethod ResourceGroupReference
  5186. raw := noMethod(*s)
  5187. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5188. }
  5189. // Route: The route resource. A Route is a rule that specifies how
  5190. // certain packets should be handled by the virtual network. Routes are
  5191. // associated with instances by tags and the set of Routes for a
  5192. // particular instance is called its routing table. For each packet
  5193. // leaving a instance, the system searches that instance's routing table
  5194. // for a single best matching Route. Routes match packets by destination
  5195. // IP address, preferring smaller or more specific ranges over larger
  5196. // ones. If there is a tie, the system selects the Route with the
  5197. // smallest priority value. If there is still a tie, it uses the layer
  5198. // three and four packet headers to select just one of the remaining
  5199. // matching Routes. The packet is then forwarded as specified by the
  5200. // nextHop field of the winning Route -- either to another instance
  5201. // destination, a instance gateway or a Google Compute Engien-operated
  5202. // gateway. Packets that do not match any Route in the sending
  5203. // instance's routing table are dropped.
  5204. type Route struct {
  5205. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  5206. // format.
  5207. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  5208. // Description: An optional description of this resource. Provide this
  5209. // property when you create the resource.
  5210. Description string `json:"description,omitempty"`
  5211. // DestRange: The destination range of outgoing packets that this route
  5212. // applies to.
  5213. DestRange string `json:"destRange,omitempty"`
  5214. // Id: [Output Only] The unique identifier for the resource. This
  5215. // identifier is defined by the server.
  5216. Id uint64 `json:"id,omitempty,string"`
  5217. // Kind: [Output Only] Type of this resource. Always compute#routes for
  5218. // Route resources.
  5219. Kind string `json:"kind,omitempty"`
  5220. // Name: Name of the resource; provided by the client when the resource
  5221. // is created. The name must be 1-63 characters long, and comply with
  5222. // RFC1035. Specifically, the name must be 1-63 characters long and
  5223. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  5224. // the first character must be a lowercase letter, and all following
  5225. // characters must be a dash, lowercase letter, or digit, except the
  5226. // last character, which cannot be a dash.
  5227. Name string `json:"name,omitempty"`
  5228. // Network: Fully-qualified URL of the network that this route applies
  5229. // to.
  5230. Network string `json:"network,omitempty"`
  5231. // NextHopGateway: The URL to a gateway that should handle matching
  5232. // packets. You can only specify the internet gateway using a full or
  5233. // partial valid URL:
  5234. // projects/<project-id>/global/gateways/default-internet-gateway
  5235. NextHopGateway string `json:"nextHopGateway,omitempty"`
  5236. // NextHopInstance: The URL to an instance that should handle matching
  5237. // packets. You can specify this as a full or partial URL. For
  5238. // example:
  5239. // https://www.googleapis.com/compute/v1/projects/project/zones/
  5240. // zone/instances/
  5241. NextHopInstance string `json:"nextHopInstance,omitempty"`
  5242. // NextHopIp: The network IP address of an instance that should handle
  5243. // matching packets.
  5244. NextHopIp string `json:"nextHopIp,omitempty"`
  5245. // NextHopNetwork: The URL of the local network if it should handle
  5246. // matching packets.
  5247. NextHopNetwork string `json:"nextHopNetwork,omitempty"`
  5248. // NextHopVpnTunnel: The URL to a VpnTunnel that should handle matching
  5249. // packets.
  5250. NextHopVpnTunnel string `json:"nextHopVpnTunnel,omitempty"`
  5251. // Priority: The priority of this route. Priority is used to break ties
  5252. // in cases where there is more than one matching route of equal prefix
  5253. // length. In the case of two routes with equal prefix length, the one
  5254. // with the lowest-numbered priority value wins. Default value is 1000.
  5255. // Valid range is 0 through 65535.
  5256. Priority int64 `json:"priority,omitempty"`
  5257. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  5258. // resource.
  5259. SelfLink string `json:"selfLink,omitempty"`
  5260. // Tags: A list of instance tags to which this route applies.
  5261. Tags []string `json:"tags,omitempty"`
  5262. // Warnings: [Output Only] If potential misconfigurations are detected
  5263. // for this route, this field will be populated with warning messages.
  5264. Warnings []*RouteWarnings `json:"warnings,omitempty"`
  5265. // ServerResponse contains the HTTP response code and headers from the
  5266. // server.
  5267. googleapi.ServerResponse `json:"-"`
  5268. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  5269. // to 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. }
  5276. func (s *Route) MarshalJSON() ([]byte, error) {
  5277. type noMethod Route
  5278. raw := noMethod(*s)
  5279. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5280. }
  5281. type RouteWarnings struct {
  5282. // Code: [Output Only] A warning code, if applicable. For example,
  5283. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5284. // the response.
  5285. //
  5286. // Possible values:
  5287. // "DEPRECATED_RESOURCE_USED"
  5288. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5289. // "INJECTED_KERNELS_DEPRECATED"
  5290. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5291. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5292. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5293. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5294. // "NEXT_HOP_NOT_RUNNING"
  5295. // "NOT_CRITICAL_ERROR"
  5296. // "NO_RESULTS_ON_PAGE"
  5297. // "REQUIRED_TOS_AGREEMENT"
  5298. // "RESOURCE_NOT_DELETED"
  5299. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5300. // "UNREACHABLE"
  5301. Code string `json:"code,omitempty"`
  5302. // Data: [Output Only] Metadata about this warning in key: value format.
  5303. // For example:
  5304. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5305. Data []*RouteWarningsData `json:"data,omitempty"`
  5306. // Message: [Output Only] A human-readable description of the warning
  5307. // code.
  5308. Message string `json:"message,omitempty"`
  5309. // ForceSendFields is a list of field names (e.g. "Code") to
  5310. // unconditionally include in API requests. By default, fields with
  5311. // empty values are omitted from API requests. However, any non-pointer,
  5312. // non-interface field appearing in ForceSendFields will be sent to the
  5313. // server regardless of whether the field is empty or not. This may be
  5314. // used to include empty fields in Patch requests.
  5315. ForceSendFields []string `json:"-"`
  5316. }
  5317. func (s *RouteWarnings) MarshalJSON() ([]byte, error) {
  5318. type noMethod RouteWarnings
  5319. raw := noMethod(*s)
  5320. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5321. }
  5322. type RouteWarningsData struct {
  5323. // Key: [Output Only] A key that provides more detail on the warning
  5324. // being returned. For example, for warnings where there are no results
  5325. // in a list request for a particular zone, this key might be scope and
  5326. // the key value might be the zone name. Other examples might be a key
  5327. // indicating a deprecated resource, and a suggested replacement, or a
  5328. // warning about invalid network settings (for example, if an instance
  5329. // attempts to perform IP forwarding but is not enabled for IP
  5330. // forwarding).
  5331. Key string `json:"key,omitempty"`
  5332. // Value: [Output Only] A warning data value corresponding to the key.
  5333. Value string `json:"value,omitempty"`
  5334. // ForceSendFields is a list of field names (e.g. "Key") to
  5335. // unconditionally include in API requests. By default, fields with
  5336. // empty values are omitted from API requests. However, any non-pointer,
  5337. // non-interface field appearing in ForceSendFields will be sent to the
  5338. // server regardless of whether the field is empty or not. This may be
  5339. // used to include empty fields in Patch requests.
  5340. ForceSendFields []string `json:"-"`
  5341. }
  5342. func (s *RouteWarningsData) MarshalJSON() ([]byte, error) {
  5343. type noMethod RouteWarningsData
  5344. raw := noMethod(*s)
  5345. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5346. }
  5347. // RouteList: Contains a list of route resources.
  5348. type RouteList struct {
  5349. // Id: [Output Only] Unique identifier for the resource. Defined by the
  5350. // server.
  5351. Id string `json:"id,omitempty"`
  5352. // Items: [Output Only] A list of Route resources.
  5353. Items []*Route `json:"items,omitempty"`
  5354. // Kind: Type of resource.
  5355. Kind string `json:"kind,omitempty"`
  5356. // NextPageToken: [Output Only] This token allows you to get the next
  5357. // page of results for list requests. If the number of results is larger
  5358. // than maxResults, use the nextPageToken as a value for the query
  5359. // parameter pageToken in the next list request. Subsequent list
  5360. // requests will have their own nextPageToken to continue paging through
  5361. // the results.
  5362. NextPageToken string `json:"nextPageToken,omitempty"`
  5363. // SelfLink: [Output Only] Server-defined URL for this resource.
  5364. SelfLink string `json:"selfLink,omitempty"`
  5365. // ServerResponse contains the HTTP response code and headers from the
  5366. // server.
  5367. googleapi.ServerResponse `json:"-"`
  5368. // ForceSendFields is a list of field names (e.g. "Id") to
  5369. // unconditionally include in API requests. By default, fields with
  5370. // empty values are omitted from API requests. However, any non-pointer,
  5371. // non-interface field appearing in ForceSendFields will be sent to the
  5372. // server regardless of whether the field is empty or not. This may be
  5373. // used to include empty fields in Patch requests.
  5374. ForceSendFields []string `json:"-"`
  5375. }
  5376. func (s *RouteList) MarshalJSON() ([]byte, error) {
  5377. type noMethod RouteList
  5378. raw := noMethod(*s)
  5379. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5380. }
  5381. // Scheduling: Sets the scheduling options for an Instance.
  5382. type Scheduling struct {
  5383. // AutomaticRestart: Specifies whether the instance should be
  5384. // automatically restarted if it is terminated by Compute Engine (not
  5385. // terminated by a user). You can only set the automatic restart option
  5386. // for standard instances. Preemptible instances cannot be automatically
  5387. // restarted.
  5388. AutomaticRestart bool `json:"automaticRestart,omitempty"`
  5389. // OnHostMaintenance: Defines the maintenance behavior for this
  5390. // instance. For standard instances, the default behavior is MIGRATE.
  5391. // For preemptible instances, the default and only possible behavior is
  5392. // TERMINATE. For more information, see Setting maintenance behavior.
  5393. //
  5394. // Possible values:
  5395. // "MIGRATE"
  5396. // "TERMINATE"
  5397. OnHostMaintenance string `json:"onHostMaintenance,omitempty"`
  5398. // Preemptible: Whether the instance is preemptible.
  5399. Preemptible bool `json:"preemptible,omitempty"`
  5400. // ForceSendFields is a list of field names (e.g. "AutomaticRestart") to
  5401. // unconditionally include in API requests. By default, fields with
  5402. // empty values are omitted from API requests. However, any non-pointer,
  5403. // non-interface field appearing in ForceSendFields will be sent to the
  5404. // server regardless of whether the field is empty or not. This may be
  5405. // used to include empty fields in Patch requests.
  5406. ForceSendFields []string `json:"-"`
  5407. }
  5408. func (s *Scheduling) MarshalJSON() ([]byte, error) {
  5409. type noMethod Scheduling
  5410. raw := noMethod(*s)
  5411. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5412. }
  5413. // SerialPortOutput: An instance's serial console output.
  5414. type SerialPortOutput struct {
  5415. // Contents: [Output Only] The contents of the console output.
  5416. Contents string `json:"contents,omitempty"`
  5417. // Kind: [Output Only] Type of the resource. Always
  5418. // compute#serialPortOutput for serial port output.
  5419. Kind string `json:"kind,omitempty"`
  5420. // SelfLink: [Output Only] Server-defined URL for the resource.
  5421. SelfLink string `json:"selfLink,omitempty"`
  5422. // ServerResponse contains the HTTP response code and headers from the
  5423. // server.
  5424. googleapi.ServerResponse `json:"-"`
  5425. // ForceSendFields is a list of field names (e.g. "Contents") to
  5426. // unconditionally include in API requests. By default, fields with
  5427. // empty values are omitted from API requests. However, any non-pointer,
  5428. // non-interface field appearing in ForceSendFields will be sent to the
  5429. // server regardless of whether the field is empty or not. This may be
  5430. // used to include empty fields in Patch requests.
  5431. ForceSendFields []string `json:"-"`
  5432. }
  5433. func (s *SerialPortOutput) MarshalJSON() ([]byte, error) {
  5434. type noMethod SerialPortOutput
  5435. raw := noMethod(*s)
  5436. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5437. }
  5438. // ServiceAccount: A service account.
  5439. type ServiceAccount struct {
  5440. // Email: Email address of the service account.
  5441. Email string `json:"email,omitempty"`
  5442. // Scopes: The list of scopes to be made available for this service
  5443. // account.
  5444. Scopes []string `json:"scopes,omitempty"`
  5445. // ForceSendFields is a list of field names (e.g. "Email") to
  5446. // unconditionally include in API requests. By default, fields with
  5447. // empty values are omitted from API requests. However, any non-pointer,
  5448. // non-interface field appearing in ForceSendFields will be sent to the
  5449. // server regardless of whether the field is empty or not. This may be
  5450. // used to include empty fields in Patch requests.
  5451. ForceSendFields []string `json:"-"`
  5452. }
  5453. func (s *ServiceAccount) MarshalJSON() ([]byte, error) {
  5454. type noMethod ServiceAccount
  5455. raw := noMethod(*s)
  5456. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5457. }
  5458. // Snapshot: A persistent disk snapshot resource.
  5459. type Snapshot struct {
  5460. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  5461. // format.
  5462. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  5463. // Description: An optional description of this resource. Provide this
  5464. // property when you create the resource.
  5465. Description string `json:"description,omitempty"`
  5466. // DiskSizeGb: [Output Only] Size of the snapshot, specified in GB.
  5467. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  5468. // Id: [Output Only] The unique identifier for the resource. This
  5469. // identifier is defined by the server.
  5470. Id uint64 `json:"id,omitempty,string"`
  5471. // Kind: [Output Only] Type of the resource. Always compute#snapshot for
  5472. // Snapshot resources.
  5473. Kind string `json:"kind,omitempty"`
  5474. // Licenses: Public visible licenses.
  5475. Licenses []string `json:"licenses,omitempty"`
  5476. // Name: Name of the resource; provided by the client when the resource
  5477. // is created. The name must be 1-63 characters long, and comply with
  5478. // RFC1035. Specifically, the name must be 1-63 characters long and
  5479. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  5480. // the first character must be a lowercase letter, and all following
  5481. // characters must be a dash, lowercase letter, or digit, except the
  5482. // last character, which cannot be a dash.
  5483. Name string `json:"name,omitempty"`
  5484. // SelfLink: [Output Only] Server-defined URL for the resource.
  5485. SelfLink string `json:"selfLink,omitempty"`
  5486. // SnapshotEncryptionKey: Encrypts the snapshot using a
  5487. // customer-supplied encryption key.
  5488. //
  5489. // If you encrypt a snapshot using a customer-supplied encryption key
  5490. // and you want to use the snapshot later, you must provide the same key
  5491. // that you used to encrypt the snapshot. For example, you must provide
  5492. // the encryption key when you create a disk from the encrypted snapshot
  5493. // in a future request. If you provide an incorrect key, or no key, the
  5494. // request will fail.
  5495. //
  5496. // Customer-supplied encryption keys do not protect access to metadata
  5497. // of the disk.
  5498. //
  5499. // If no customer-supplied encryption key is provided at creation, then
  5500. // the disk will be encrypted using an automatically generated key and
  5501. // you do not need to provide a key to use the snapshot later.
  5502. SnapshotEncryptionKey *CustomerEncryptionKey `json:"snapshotEncryptionKey,omitempty"`
  5503. // SourceDisk: [Output Only] The source disk used to create this
  5504. // snapshot.
  5505. SourceDisk string `json:"sourceDisk,omitempty"`
  5506. // SourceDiskEncryptionKey: Specifies the customer-supplied encryption
  5507. // key of the source disk. This key is required if the source disk is
  5508. // protected by a customer-supplied encryption key.
  5509. //
  5510. // If the incorrect key is provided, the request will fail.
  5511. SourceDiskEncryptionKey *CustomerEncryptionKey `json:"sourceDiskEncryptionKey,omitempty"`
  5512. // SourceDiskId: [Output Only] The ID value of the disk used to create
  5513. // this snapshot. This value may be used to determine whether the
  5514. // snapshot was taken from the current or a previous instance of a given
  5515. // disk name.
  5516. SourceDiskId string `json:"sourceDiskId,omitempty"`
  5517. // Status: [Output Only] The status of the snapshot.
  5518. //
  5519. // Possible values:
  5520. // "CREATING"
  5521. // "DELETING"
  5522. // "FAILED"
  5523. // "READY"
  5524. // "UPLOADING"
  5525. Status string `json:"status,omitempty"`
  5526. // StorageBytes: [Output Only] A size of the the storage used by the
  5527. // snapshot. As snapshots share storage, this number is expected to
  5528. // change with snapshot creation/deletion.
  5529. StorageBytes int64 `json:"storageBytes,omitempty,string"`
  5530. // StorageBytesStatus: [Output Only] An indicator whether storageBytes
  5531. // is in a stable state or it is being adjusted as a result of shared
  5532. // storage reallocation.
  5533. //
  5534. // Possible values:
  5535. // "UPDATING"
  5536. // "UP_TO_DATE"
  5537. StorageBytesStatus string `json:"storageBytesStatus,omitempty"`
  5538. // ServerResponse contains the HTTP response code and headers from the
  5539. // server.
  5540. googleapi.ServerResponse `json:"-"`
  5541. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  5542. // to unconditionally include in API requests. By default, fields with
  5543. // empty values are omitted from API requests. However, any non-pointer,
  5544. // non-interface field appearing in ForceSendFields will be sent to the
  5545. // server regardless of whether the field is empty or not. This may be
  5546. // used to include empty fields in Patch requests.
  5547. ForceSendFields []string `json:"-"`
  5548. }
  5549. func (s *Snapshot) MarshalJSON() ([]byte, error) {
  5550. type noMethod Snapshot
  5551. raw := noMethod(*s)
  5552. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5553. }
  5554. // SnapshotList: Contains a list of Snapshot resources.
  5555. type SnapshotList struct {
  5556. // Id: [Output Only] The unique identifier for the resource. This
  5557. // identifier is defined by the server.
  5558. Id string `json:"id,omitempty"`
  5559. // Items: [Output Only] A list of Snapshot resources.
  5560. Items []*Snapshot `json:"items,omitempty"`
  5561. // Kind: Type of resource.
  5562. Kind string `json:"kind,omitempty"`
  5563. // NextPageToken: [Output Only] This token allows you to get the next
  5564. // page of results for list requests. If the number of results is larger
  5565. // than maxResults, use the nextPageToken as a value for the query
  5566. // parameter pageToken in the next list request. Subsequent list
  5567. // requests will have their own nextPageToken to continue paging through
  5568. // the results.
  5569. NextPageToken string `json:"nextPageToken,omitempty"`
  5570. // SelfLink: [Output Only] Server-defined URL for this resource.
  5571. SelfLink string `json:"selfLink,omitempty"`
  5572. // ServerResponse contains the HTTP response code and headers from the
  5573. // server.
  5574. googleapi.ServerResponse `json:"-"`
  5575. // ForceSendFields is a list of field names (e.g. "Id") to
  5576. // unconditionally include in API requests. By default, fields with
  5577. // empty values are omitted from API requests. However, any non-pointer,
  5578. // non-interface field appearing in ForceSendFields will be sent to the
  5579. // server regardless of whether the field is empty or not. This may be
  5580. // used to include empty fields in Patch requests.
  5581. ForceSendFields []string `json:"-"`
  5582. }
  5583. func (s *SnapshotList) MarshalJSON() ([]byte, error) {
  5584. type noMethod SnapshotList
  5585. raw := noMethod(*s)
  5586. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5587. }
  5588. // SslCertificate: An SslCertificate resource. This resource provides a
  5589. // mechanism to upload an SSL key and certificate to the load balancer
  5590. // to serve secure connections from the user.
  5591. type SslCertificate struct {
  5592. // Certificate: A local certificate file. The certificate must be in PEM
  5593. // format. The certificate chain must be no greater than 5 certs long.
  5594. // The chain must include at least one intermediate cert.
  5595. Certificate string `json:"certificate,omitempty"`
  5596. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  5597. // format.
  5598. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  5599. // Description: An optional description of this resource. Provide this
  5600. // property when you create the resource.
  5601. Description string `json:"description,omitempty"`
  5602. // Id: [Output Only] The unique identifier for the resource. This
  5603. // identifier is defined by the server.
  5604. Id uint64 `json:"id,omitempty,string"`
  5605. // Kind: [Output Only] Type of the resource. Always
  5606. // compute#sslCertificate for SSL certificates.
  5607. Kind string `json:"kind,omitempty"`
  5608. // Name: Name of the resource. Provided by the client when the resource
  5609. // is created. The name must be 1-63 characters long, and comply with
  5610. // RFC1035. Specifically, the name must be 1-63 characters long and
  5611. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  5612. // the first character must be a lowercase letter, and all following
  5613. // characters must be a dash, lowercase letter, or digit, except the
  5614. // last character, which cannot be a dash.
  5615. Name string `json:"name,omitempty"`
  5616. // PrivateKey: A write-only private key in PEM format. Only insert RPCs
  5617. // will include this field.
  5618. PrivateKey string `json:"privateKey,omitempty"`
  5619. // SelfLink: [Output only] Server-defined URL for the resource.
  5620. SelfLink string `json:"selfLink,omitempty"`
  5621. // ServerResponse contains the HTTP response code and headers from the
  5622. // server.
  5623. googleapi.ServerResponse `json:"-"`
  5624. // ForceSendFields is a list of field names (e.g. "Certificate") to
  5625. // unconditionally include in API requests. By default, fields with
  5626. // empty values are omitted from API requests. However, any non-pointer,
  5627. // non-interface field appearing in ForceSendFields will be sent to the
  5628. // server regardless of whether the field is empty or not. This may be
  5629. // used to include empty fields in Patch requests.
  5630. ForceSendFields []string `json:"-"`
  5631. }
  5632. func (s *SslCertificate) MarshalJSON() ([]byte, error) {
  5633. type noMethod SslCertificate
  5634. raw := noMethod(*s)
  5635. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5636. }
  5637. // SslCertificateList: Contains a list of SslCertificate resources.
  5638. type SslCertificateList struct {
  5639. // Id: [Output Only] Unique identifier for the resource. Defined by the
  5640. // server.
  5641. Id string `json:"id,omitempty"`
  5642. // Items: A list of SslCertificate resources.
  5643. Items []*SslCertificate `json:"items,omitempty"`
  5644. // Kind: Type of resource.
  5645. Kind string `json:"kind,omitempty"`
  5646. // NextPageToken: [Output Only] This token allows you to get the next
  5647. // page of results for list requests. If the number of results is larger
  5648. // than maxResults, use the nextPageToken as a value for the query
  5649. // parameter pageToken in the next list request. Subsequent list
  5650. // requests will have their own nextPageToken to continue paging through
  5651. // the results.
  5652. NextPageToken string `json:"nextPageToken,omitempty"`
  5653. // SelfLink: [Output Only] Server-defined URL for this resource.
  5654. SelfLink string `json:"selfLink,omitempty"`
  5655. // ServerResponse contains the HTTP response code and headers from the
  5656. // server.
  5657. googleapi.ServerResponse `json:"-"`
  5658. // ForceSendFields is a list of field names (e.g. "Id") to
  5659. // unconditionally include in API requests. By default, fields with
  5660. // empty values are omitted from API requests. However, any non-pointer,
  5661. // non-interface field appearing in ForceSendFields will be sent to the
  5662. // server regardless of whether the field is empty or not. This may be
  5663. // used to include empty fields in Patch requests.
  5664. ForceSendFields []string `json:"-"`
  5665. }
  5666. func (s *SslCertificateList) MarshalJSON() ([]byte, error) {
  5667. type noMethod SslCertificateList
  5668. raw := noMethod(*s)
  5669. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5670. }
  5671. // Subnetwork: A Subnetwork resource.
  5672. type Subnetwork struct {
  5673. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  5674. // format.
  5675. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  5676. // Description: An optional description of this resource. Provide this
  5677. // property when you create the resource.
  5678. Description string `json:"description,omitempty"`
  5679. // GatewayAddress: [Output Only] The gateway address for default routes
  5680. // to reach destination addresses outside this subnetwork.
  5681. GatewayAddress string `json:"gatewayAddress,omitempty"`
  5682. // Id: [Output Only] The unique identifier for the resource. This
  5683. // identifier is defined by the server.
  5684. Id uint64 `json:"id,omitempty,string"`
  5685. // IpCidrRange: The range of internal addresses that are owned by this
  5686. // subnetwork. Provide this property when you create the subnetwork. For
  5687. // example, 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and
  5688. // non-overlapping within a network.
  5689. IpCidrRange string `json:"ipCidrRange,omitempty"`
  5690. // Kind: [Output Only] Type of the resource. Always compute#subnetwork
  5691. // for Subnetwork resources.
  5692. Kind string `json:"kind,omitempty"`
  5693. // Name: The name of the resource, provided by the client when initially
  5694. // creating the resource. The name must be 1-63 characters long, and
  5695. // comply with RFC1035. Specifically, the name must be 1-63 characters
  5696. // long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])?
  5697. // which means the first character must be a lowercase letter, and all
  5698. // following characters must be a dash, lowercase letter, or digit,
  5699. // except the last character, which cannot be a dash.
  5700. Name string `json:"name,omitempty"`
  5701. // Network: The URL of the network to which this subnetwork belongs,
  5702. // provided by the client when initially creating the subnetwork. Only
  5703. // networks that are in the distributed mode can have subnetworks.
  5704. Network string `json:"network,omitempty"`
  5705. // Region: [Output Only] URL of the region where the Subnetwork resides.
  5706. Region string `json:"region,omitempty"`
  5707. // SelfLink: [Output Only] Server-defined URL for the resource.
  5708. SelfLink string `json:"selfLink,omitempty"`
  5709. // ServerResponse contains the HTTP response code and headers from the
  5710. // server.
  5711. googleapi.ServerResponse `json:"-"`
  5712. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  5713. // to unconditionally include in API requests. By default, fields with
  5714. // empty values are omitted from API requests. However, any non-pointer,
  5715. // non-interface field appearing in ForceSendFields will be sent to the
  5716. // server regardless of whether the field is empty or not. This may be
  5717. // used to include empty fields in Patch requests.
  5718. ForceSendFields []string `json:"-"`
  5719. }
  5720. func (s *Subnetwork) MarshalJSON() ([]byte, error) {
  5721. type noMethod Subnetwork
  5722. raw := noMethod(*s)
  5723. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5724. }
  5725. type SubnetworkAggregatedList struct {
  5726. // Id: [Output Only] The unique identifier for the resource. This
  5727. // identifier is defined by the server.
  5728. Id string `json:"id,omitempty"`
  5729. // Items: [Output] A map of scoped Subnetwork lists.
  5730. Items map[string]SubnetworksScopedList `json:"items,omitempty"`
  5731. // Kind: [Output Only] Type of resource. Always
  5732. // compute#subnetworkAggregatedList for aggregated lists of subnetworks.
  5733. Kind string `json:"kind,omitempty"`
  5734. // NextPageToken: [Output Only] This token allows you to get the next
  5735. // page of results for list requests. If the number of results is larger
  5736. // than maxResults, use the nextPageToken as a value for the query
  5737. // parameter pageToken in the next list request. Subsequent list
  5738. // requests will have their own nextPageToken to continue paging through
  5739. // the results.
  5740. NextPageToken string `json:"nextPageToken,omitempty"`
  5741. // SelfLink: [Output Only] Server-defined URL for this resource.
  5742. SelfLink string `json:"selfLink,omitempty"`
  5743. // ServerResponse contains the HTTP response code and headers from the
  5744. // server.
  5745. googleapi.ServerResponse `json:"-"`
  5746. // ForceSendFields is a list of field names (e.g. "Id") to
  5747. // unconditionally include in API requests. By default, fields with
  5748. // empty values are omitted from API requests. However, any non-pointer,
  5749. // non-interface field appearing in ForceSendFields will be sent to the
  5750. // server regardless of whether the field is empty or not. This may be
  5751. // used to include empty fields in Patch requests.
  5752. ForceSendFields []string `json:"-"`
  5753. }
  5754. func (s *SubnetworkAggregatedList) MarshalJSON() ([]byte, error) {
  5755. type noMethod SubnetworkAggregatedList
  5756. raw := noMethod(*s)
  5757. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5758. }
  5759. // SubnetworkList: Contains a list of Subnetwork resources.
  5760. type SubnetworkList struct {
  5761. // Id: [Output Only] The unique identifier for the resource. This
  5762. // identifier is defined by the server.
  5763. Id string `json:"id,omitempty"`
  5764. // Items: The Subnetwork resources.
  5765. Items []*Subnetwork `json:"items,omitempty"`
  5766. // Kind: [Output Only] Type of resource. Always compute#subnetworkList
  5767. // for lists of subnetworks.
  5768. Kind string `json:"kind,omitempty"`
  5769. // NextPageToken: [Output Only] This token allows you to get the next
  5770. // page of results for list requests. If the number of results is larger
  5771. // than maxResults, use the nextPageToken as a value for the query
  5772. // parameter pageToken in the next list request. Subsequent list
  5773. // requests will have their own nextPageToken to continue paging through
  5774. // the results.
  5775. NextPageToken string `json:"nextPageToken,omitempty"`
  5776. // SelfLink: [Output Only] Server-defined URL for this resource.
  5777. SelfLink string `json:"selfLink,omitempty"`
  5778. // ServerResponse contains the HTTP response code and headers from the
  5779. // server.
  5780. googleapi.ServerResponse `json:"-"`
  5781. // ForceSendFields is a list of field names (e.g. "Id") to
  5782. // unconditionally include in API requests. By default, fields with
  5783. // empty values are omitted from API requests. However, any non-pointer,
  5784. // non-interface field appearing in ForceSendFields will be sent to the
  5785. // server regardless of whether the field is empty or not. This may be
  5786. // used to include empty fields in Patch requests.
  5787. ForceSendFields []string `json:"-"`
  5788. }
  5789. func (s *SubnetworkList) MarshalJSON() ([]byte, error) {
  5790. type noMethod SubnetworkList
  5791. raw := noMethod(*s)
  5792. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5793. }
  5794. type SubnetworksScopedList struct {
  5795. // Subnetworks: List of subnetworks contained in this scope.
  5796. Subnetworks []*Subnetwork `json:"subnetworks,omitempty"`
  5797. // Warning: An informational warning that appears when the list of
  5798. // addresses is empty.
  5799. Warning *SubnetworksScopedListWarning `json:"warning,omitempty"`
  5800. // ForceSendFields is a list of field names (e.g. "Subnetworks") to
  5801. // unconditionally include in API requests. By default, fields with
  5802. // empty values are omitted from API requests. However, any non-pointer,
  5803. // non-interface field appearing in ForceSendFields will be sent to the
  5804. // server regardless of whether the field is empty or not. This may be
  5805. // used to include empty fields in Patch requests.
  5806. ForceSendFields []string `json:"-"`
  5807. }
  5808. func (s *SubnetworksScopedList) MarshalJSON() ([]byte, error) {
  5809. type noMethod SubnetworksScopedList
  5810. raw := noMethod(*s)
  5811. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5812. }
  5813. // SubnetworksScopedListWarning: An informational warning that appears
  5814. // when the list of addresses is empty.
  5815. type SubnetworksScopedListWarning struct {
  5816. // Code: [Output Only] A warning code, if applicable. For example,
  5817. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5818. // the response.
  5819. //
  5820. // Possible values:
  5821. // "DEPRECATED_RESOURCE_USED"
  5822. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5823. // "INJECTED_KERNELS_DEPRECATED"
  5824. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5825. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5826. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5827. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5828. // "NEXT_HOP_NOT_RUNNING"
  5829. // "NOT_CRITICAL_ERROR"
  5830. // "NO_RESULTS_ON_PAGE"
  5831. // "REQUIRED_TOS_AGREEMENT"
  5832. // "RESOURCE_NOT_DELETED"
  5833. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5834. // "UNREACHABLE"
  5835. Code string `json:"code,omitempty"`
  5836. // Data: [Output Only] Metadata about this warning in key: value format.
  5837. // For example:
  5838. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5839. Data []*SubnetworksScopedListWarningData `json:"data,omitempty"`
  5840. // Message: [Output Only] A human-readable description of the warning
  5841. // code.
  5842. Message string `json:"message,omitempty"`
  5843. // ForceSendFields is a list of field names (e.g. "Code") to
  5844. // unconditionally include in API requests. By default, fields with
  5845. // empty values are omitted from API requests. However, any non-pointer,
  5846. // non-interface field appearing in ForceSendFields will be sent to the
  5847. // server regardless of whether the field is empty or not. This may be
  5848. // used to include empty fields in Patch requests.
  5849. ForceSendFields []string `json:"-"`
  5850. }
  5851. func (s *SubnetworksScopedListWarning) MarshalJSON() ([]byte, error) {
  5852. type noMethod SubnetworksScopedListWarning
  5853. raw := noMethod(*s)
  5854. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5855. }
  5856. type SubnetworksScopedListWarningData struct {
  5857. // Key: [Output Only] A key that provides more detail on the warning
  5858. // being returned. For example, for warnings where there are no results
  5859. // in a list request for a particular zone, this key might be scope and
  5860. // the key value might be the zone name. Other examples might be a key
  5861. // indicating a deprecated resource, and a suggested replacement, or a
  5862. // warning about invalid network settings (for example, if an instance
  5863. // attempts to perform IP forwarding but is not enabled for IP
  5864. // forwarding).
  5865. Key string `json:"key,omitempty"`
  5866. // Value: [Output Only] A warning data value corresponding to the key.
  5867. Value string `json:"value,omitempty"`
  5868. // ForceSendFields is a list of field names (e.g. "Key") to
  5869. // unconditionally include in API requests. By default, fields with
  5870. // empty values are omitted from API requests. However, any non-pointer,
  5871. // non-interface field appearing in ForceSendFields will be sent to the
  5872. // server regardless of whether the field is empty or not. This may be
  5873. // used to include empty fields in Patch requests.
  5874. ForceSendFields []string `json:"-"`
  5875. }
  5876. func (s *SubnetworksScopedListWarningData) MarshalJSON() ([]byte, error) {
  5877. type noMethod SubnetworksScopedListWarningData
  5878. raw := noMethod(*s)
  5879. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5880. }
  5881. // Tags: A set of instance tags.
  5882. type Tags struct {
  5883. // Fingerprint: Specifies a fingerprint for this request, which is
  5884. // essentially a hash of the metadata's contents and used for optimistic
  5885. // locking. The fingerprint is initially generated by Compute Engine and
  5886. // changes after every request to modify or update metadata. You must
  5887. // always provide an up-to-date fingerprint hash in order to update or
  5888. // change metadata.
  5889. //
  5890. // To see the latest fingerprint, make get() request to the instance.
  5891. Fingerprint string `json:"fingerprint,omitempty"`
  5892. // Items: An array of tags. Each tag must be 1-63 characters long, and
  5893. // comply with RFC1035.
  5894. Items []string `json:"items,omitempty"`
  5895. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  5896. // unconditionally include in API requests. By default, fields with
  5897. // empty values are omitted from API requests. However, any non-pointer,
  5898. // non-interface field appearing in ForceSendFields will be sent to the
  5899. // server regardless of whether the field is empty or not. This may be
  5900. // used to include empty fields in Patch requests.
  5901. ForceSendFields []string `json:"-"`
  5902. }
  5903. func (s *Tags) MarshalJSON() ([]byte, error) {
  5904. type noMethod Tags
  5905. raw := noMethod(*s)
  5906. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5907. }
  5908. // TargetHttpProxy: A TargetHttpProxy resource. This resource defines an
  5909. // HTTP proxy.
  5910. type TargetHttpProxy struct {
  5911. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  5912. // format.
  5913. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  5914. // Description: An optional description of this resource. Provide this
  5915. // property when you create the resource.
  5916. Description string `json:"description,omitempty"`
  5917. // Id: [Output Only] The unique identifier for the resource. This
  5918. // identifier is defined by the server.
  5919. Id uint64 `json:"id,omitempty,string"`
  5920. // Kind: [Output Only] Type of resource. Always compute#targetHttpProxy
  5921. // for target HTTP proxies.
  5922. Kind string `json:"kind,omitempty"`
  5923. // Name: Name of the resource; provided by the client when the resource
  5924. // is created. The name must be 1-63 characters long, and comply with
  5925. // RFC1035. Specifically, the name must be 1-63 characters long and
  5926. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  5927. // the first character must be a lowercase letter, and all following
  5928. // characters must be a dash, lowercase letter, or digit, except the
  5929. // last character, which cannot be a dash.
  5930. Name string `json:"name,omitempty"`
  5931. // SelfLink: [Output Only] Server-defined URL for the resource.
  5932. SelfLink string `json:"selfLink,omitempty"`
  5933. // UrlMap: URL to the UrlMap resource that defines the mapping from URL
  5934. // to the BackendService.
  5935. UrlMap string `json:"urlMap,omitempty"`
  5936. // ServerResponse contains the HTTP response code and headers from the
  5937. // server.
  5938. googleapi.ServerResponse `json:"-"`
  5939. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  5940. // to unconditionally include in API requests. By default, fields with
  5941. // empty values are omitted from API requests. However, any non-pointer,
  5942. // non-interface field appearing in ForceSendFields will be sent to the
  5943. // server regardless of whether the field is empty or not. This may be
  5944. // used to include empty fields in Patch requests.
  5945. ForceSendFields []string `json:"-"`
  5946. }
  5947. func (s *TargetHttpProxy) MarshalJSON() ([]byte, error) {
  5948. type noMethod TargetHttpProxy
  5949. raw := noMethod(*s)
  5950. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5951. }
  5952. // TargetHttpProxyList: A list of TargetHttpProxy resources.
  5953. type TargetHttpProxyList struct {
  5954. // Id: [Output Only] The unique identifier for the resource. This
  5955. // identifier is defined by the server.
  5956. Id string `json:"id,omitempty"`
  5957. // Items: A list of TargetHttpProxy resources.
  5958. Items []*TargetHttpProxy `json:"items,omitempty"`
  5959. // Kind: Type of resource. Always compute#targetHttpProxyList for lists
  5960. // of Target HTTP proxies.
  5961. Kind string `json:"kind,omitempty"`
  5962. // NextPageToken: [Output Only] This token allows you to get the next
  5963. // page of results for list requests. If the number of results is larger
  5964. // than maxResults, use the nextPageToken as a value for the query
  5965. // parameter pageToken in the next list request. Subsequent list
  5966. // requests will have their own nextPageToken to continue paging through
  5967. // the results.
  5968. NextPageToken string `json:"nextPageToken,omitempty"`
  5969. // SelfLink: [Output Only] Server-defined URL for this resource.
  5970. SelfLink string `json:"selfLink,omitempty"`
  5971. // ServerResponse contains the HTTP response code and headers from the
  5972. // server.
  5973. googleapi.ServerResponse `json:"-"`
  5974. // ForceSendFields is a list of field names (e.g. "Id") to
  5975. // unconditionally include in API requests. By default, fields with
  5976. // empty values are omitted from API requests. However, any non-pointer,
  5977. // non-interface field appearing in ForceSendFields will be sent to the
  5978. // server regardless of whether the field is empty or not. This may be
  5979. // used to include empty fields in Patch requests.
  5980. ForceSendFields []string `json:"-"`
  5981. }
  5982. func (s *TargetHttpProxyList) MarshalJSON() ([]byte, error) {
  5983. type noMethod TargetHttpProxyList
  5984. raw := noMethod(*s)
  5985. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5986. }
  5987. type TargetHttpsProxiesSetSslCertificatesRequest struct {
  5988. // SslCertificates: New set of URLs to SslCertificate resources to
  5989. // associate with this TargetHttpProxy. Currently exactly one ssl
  5990. // certificate must be specified.
  5991. SslCertificates []string `json:"sslCertificates,omitempty"`
  5992. // ForceSendFields is a list of field names (e.g. "SslCertificates") to
  5993. // unconditionally include in API requests. By default, fields with
  5994. // empty values are omitted from API requests. However, any non-pointer,
  5995. // non-interface field appearing in ForceSendFields will be sent to the
  5996. // server regardless of whether the field is empty or not. This may be
  5997. // used to include empty fields in Patch requests.
  5998. ForceSendFields []string `json:"-"`
  5999. }
  6000. func (s *TargetHttpsProxiesSetSslCertificatesRequest) MarshalJSON() ([]byte, error) {
  6001. type noMethod TargetHttpsProxiesSetSslCertificatesRequest
  6002. raw := noMethod(*s)
  6003. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6004. }
  6005. // TargetHttpsProxy: A TargetHttpsProxy resource. This resource defines
  6006. // an HTTPS proxy.
  6007. type TargetHttpsProxy struct {
  6008. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  6009. // format.
  6010. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  6011. // Description: An optional description of this resource. Provide this
  6012. // property when you create the resource.
  6013. Description string `json:"description,omitempty"`
  6014. // Id: [Output Only] The unique identifier for the resource. This
  6015. // identifier is defined by the server.
  6016. Id uint64 `json:"id,omitempty,string"`
  6017. // Kind: [Output Only] Type of the resource. Always
  6018. // compute#targetHttpsProxy for target HTTPS proxies.
  6019. Kind string `json:"kind,omitempty"`
  6020. // Name: Name of the resource. Provided by the client when the resource
  6021. // is created. The name must be 1-63 characters long, and comply with
  6022. // RFC1035. Specifically, the name must be 1-63 characters long and
  6023. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  6024. // the first character must be a lowercase letter, and all following
  6025. // characters must be a dash, lowercase letter, or digit, except the
  6026. // last character, which cannot be a dash.
  6027. Name string `json:"name,omitempty"`
  6028. // SelfLink: [Output Only] Server-defined URL for the resource.
  6029. SelfLink string `json:"selfLink,omitempty"`
  6030. // SslCertificates: URLs to SslCertificate resources that are used to
  6031. // authenticate connections between users and the load balancer.
  6032. // Currently exactly one SSL certificate must be specified.
  6033. SslCertificates []string `json:"sslCertificates,omitempty"`
  6034. // UrlMap: URL to the UrlMap resource that defines the mapping from URL
  6035. // to the BackendService.
  6036. UrlMap string `json:"urlMap,omitempty"`
  6037. // ServerResponse contains the HTTP response code and headers from the
  6038. // server.
  6039. googleapi.ServerResponse `json:"-"`
  6040. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  6041. // to unconditionally include in API requests. By default, fields with
  6042. // empty values are omitted from API requests. However, any non-pointer,
  6043. // non-interface field appearing in ForceSendFields will be sent to the
  6044. // server regardless of whether the field is empty or not. This may be
  6045. // used to include empty fields in Patch requests.
  6046. ForceSendFields []string `json:"-"`
  6047. }
  6048. func (s *TargetHttpsProxy) MarshalJSON() ([]byte, error) {
  6049. type noMethod TargetHttpsProxy
  6050. raw := noMethod(*s)
  6051. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6052. }
  6053. // TargetHttpsProxyList: Contains a list of TargetHttpsProxy resources.
  6054. type TargetHttpsProxyList struct {
  6055. // Id: [Output Only] The unique identifier for the resource. This
  6056. // identifier is defined by the server.
  6057. Id string `json:"id,omitempty"`
  6058. // Items: A list of TargetHttpsProxy resources.
  6059. Items []*TargetHttpsProxy `json:"items,omitempty"`
  6060. // Kind: Type of resource.
  6061. Kind string `json:"kind,omitempty"`
  6062. // NextPageToken: [Output Only] This token allows you to get the next
  6063. // page of results for list requests. If the number of results is larger
  6064. // than maxResults, use the nextPageToken as a value for the query
  6065. // parameter pageToken in the next list request. Subsequent list
  6066. // requests will have their own nextPageToken to continue paging through
  6067. // the results.
  6068. NextPageToken string `json:"nextPageToken,omitempty"`
  6069. // SelfLink: [Output Only] Server-defined URL for this resource.
  6070. SelfLink string `json:"selfLink,omitempty"`
  6071. // ServerResponse contains the HTTP response code and headers from the
  6072. // server.
  6073. googleapi.ServerResponse `json:"-"`
  6074. // ForceSendFields is a list of field names (e.g. "Id") to
  6075. // unconditionally include in API requests. By default, fields with
  6076. // empty values are omitted from API requests. However, any non-pointer,
  6077. // non-interface field appearing in ForceSendFields will be sent to the
  6078. // server regardless of whether the field is empty or not. This may be
  6079. // used to include empty fields in Patch requests.
  6080. ForceSendFields []string `json:"-"`
  6081. }
  6082. func (s *TargetHttpsProxyList) MarshalJSON() ([]byte, error) {
  6083. type noMethod TargetHttpsProxyList
  6084. raw := noMethod(*s)
  6085. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6086. }
  6087. // TargetInstance: A TargetInstance resource. This resource defines an
  6088. // endpoint instance that terminates traffic of certain protocols.
  6089. type TargetInstance struct {
  6090. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  6091. // format.
  6092. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  6093. // Description: An optional description of this resource. Provide this
  6094. // property when you create the resource.
  6095. Description string `json:"description,omitempty"`
  6096. // Id: [Output Only] The unique identifier for the resource. This
  6097. // identifier is defined by the server.
  6098. Id uint64 `json:"id,omitempty,string"`
  6099. // Instance: The URL to the instance that terminates the relevant
  6100. // traffic.
  6101. Instance string `json:"instance,omitempty"`
  6102. // Kind: [Output Only] The type of the resource. Always
  6103. // compute#targetInstance for target instances.
  6104. Kind string `json:"kind,omitempty"`
  6105. // Name: Name of the resource. Provided by the client when the resource
  6106. // is created. The name must be 1-63 characters long, and comply with
  6107. // RFC1035. Specifically, the name must be 1-63 characters long and
  6108. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  6109. // the first character must be a lowercase letter, and all following
  6110. // characters must be a dash, lowercase letter, or digit, except the
  6111. // last character, which cannot be a dash.
  6112. Name string `json:"name,omitempty"`
  6113. // NatPolicy: NAT option controlling how IPs are NAT'ed to the instance.
  6114. // Currently only NO_NAT (default value) is supported.
  6115. //
  6116. // Possible values:
  6117. // "NO_NAT"
  6118. NatPolicy string `json:"natPolicy,omitempty"`
  6119. // SelfLink: [Output Only] Server-defined URL for the resource.
  6120. SelfLink string `json:"selfLink,omitempty"`
  6121. // Zone: [Output Only] URL of the zone where the target instance
  6122. // resides.
  6123. Zone string `json:"zone,omitempty"`
  6124. // ServerResponse contains the HTTP response code and headers from the
  6125. // server.
  6126. googleapi.ServerResponse `json:"-"`
  6127. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  6128. // to unconditionally include in API requests. By default, fields with
  6129. // empty values are omitted from API requests. However, any non-pointer,
  6130. // non-interface field appearing in ForceSendFields will be sent to the
  6131. // server regardless of whether the field is empty or not. This may be
  6132. // used to include empty fields in Patch requests.
  6133. ForceSendFields []string `json:"-"`
  6134. }
  6135. func (s *TargetInstance) MarshalJSON() ([]byte, error) {
  6136. type noMethod TargetInstance
  6137. raw := noMethod(*s)
  6138. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6139. }
  6140. type TargetInstanceAggregatedList struct {
  6141. // Id: [Output Only] Unique identifier for the resource; defined by the
  6142. // server.
  6143. Id string `json:"id,omitempty"`
  6144. // Items: A map of scoped target instance lists.
  6145. Items map[string]TargetInstancesScopedList `json:"items,omitempty"`
  6146. // Kind: Type of resource.
  6147. Kind string `json:"kind,omitempty"`
  6148. // NextPageToken: [Output Only] This token allows you to get the next
  6149. // page of results for list requests. If the number of results is larger
  6150. // than maxResults, use the nextPageToken as a value for the query
  6151. // parameter pageToken in the next list request. Subsequent list
  6152. // requests will have their own nextPageToken to continue paging through
  6153. // the results.
  6154. NextPageToken string `json:"nextPageToken,omitempty"`
  6155. // SelfLink: [Output Only] Server-defined URL for this resource.
  6156. SelfLink string `json:"selfLink,omitempty"`
  6157. // ServerResponse contains the HTTP response code and headers from the
  6158. // server.
  6159. googleapi.ServerResponse `json:"-"`
  6160. // ForceSendFields is a list of field names (e.g. "Id") to
  6161. // unconditionally include in API requests. By default, fields with
  6162. // empty values are omitted from API requests. However, any non-pointer,
  6163. // non-interface field appearing in ForceSendFields will be sent to the
  6164. // server regardless of whether the field is empty or not. This may be
  6165. // used to include empty fields in Patch requests.
  6166. ForceSendFields []string `json:"-"`
  6167. }
  6168. func (s *TargetInstanceAggregatedList) MarshalJSON() ([]byte, error) {
  6169. type noMethod TargetInstanceAggregatedList
  6170. raw := noMethod(*s)
  6171. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6172. }
  6173. // TargetInstanceList: Contains a list of TargetInstance resources.
  6174. type TargetInstanceList struct {
  6175. // Id: [Output Only] The unique identifier for the resource. This
  6176. // identifier is defined by the server.
  6177. Id string `json:"id,omitempty"`
  6178. // Items: A list of TargetInstance resources.
  6179. Items []*TargetInstance `json:"items,omitempty"`
  6180. // Kind: Type of resource.
  6181. Kind string `json:"kind,omitempty"`
  6182. // NextPageToken: [Output Only] This token allows you to get the next
  6183. // page of results for list requests. If the number of results is larger
  6184. // than maxResults, use the nextPageToken as a value for the query
  6185. // parameter pageToken in the next list request. Subsequent list
  6186. // requests will have their own nextPageToken to continue paging through
  6187. // the results.
  6188. NextPageToken string `json:"nextPageToken,omitempty"`
  6189. // SelfLink: [Output Only] Server-defined URL for this resource.
  6190. SelfLink string `json:"selfLink,omitempty"`
  6191. // ServerResponse contains the HTTP response code and headers from the
  6192. // server.
  6193. googleapi.ServerResponse `json:"-"`
  6194. // ForceSendFields is a list of field names (e.g. "Id") to
  6195. // unconditionally include in API requests. By default, fields with
  6196. // empty values are omitted from API requests. However, any non-pointer,
  6197. // non-interface field appearing in ForceSendFields will be sent to the
  6198. // server regardless of whether the field is empty or not. This may be
  6199. // used to include empty fields in Patch requests.
  6200. ForceSendFields []string `json:"-"`
  6201. }
  6202. func (s *TargetInstanceList) MarshalJSON() ([]byte, error) {
  6203. type noMethod TargetInstanceList
  6204. raw := noMethod(*s)
  6205. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6206. }
  6207. type TargetInstancesScopedList struct {
  6208. // TargetInstances: List of target instances contained in this scope.
  6209. TargetInstances []*TargetInstance `json:"targetInstances,omitempty"`
  6210. // Warning: Informational warning which replaces the list of addresses
  6211. // when the list is empty.
  6212. Warning *TargetInstancesScopedListWarning `json:"warning,omitempty"`
  6213. // ForceSendFields is a list of field names (e.g. "TargetInstances") to
  6214. // unconditionally include in API requests. By default, fields with
  6215. // empty values are omitted from API requests. However, any non-pointer,
  6216. // non-interface field appearing in ForceSendFields will be sent to the
  6217. // server regardless of whether the field is empty or not. This may be
  6218. // used to include empty fields in Patch requests.
  6219. ForceSendFields []string `json:"-"`
  6220. }
  6221. func (s *TargetInstancesScopedList) MarshalJSON() ([]byte, error) {
  6222. type noMethod TargetInstancesScopedList
  6223. raw := noMethod(*s)
  6224. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6225. }
  6226. // TargetInstancesScopedListWarning: Informational warning which
  6227. // replaces the list of addresses when the list is empty.
  6228. type TargetInstancesScopedListWarning struct {
  6229. // Code: [Output Only] A warning code, if applicable. For example,
  6230. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6231. // the response.
  6232. //
  6233. // Possible values:
  6234. // "DEPRECATED_RESOURCE_USED"
  6235. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6236. // "INJECTED_KERNELS_DEPRECATED"
  6237. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6238. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6239. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6240. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6241. // "NEXT_HOP_NOT_RUNNING"
  6242. // "NOT_CRITICAL_ERROR"
  6243. // "NO_RESULTS_ON_PAGE"
  6244. // "REQUIRED_TOS_AGREEMENT"
  6245. // "RESOURCE_NOT_DELETED"
  6246. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6247. // "UNREACHABLE"
  6248. Code string `json:"code,omitempty"`
  6249. // Data: [Output Only] Metadata about this warning in key: value format.
  6250. // For example:
  6251. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6252. Data []*TargetInstancesScopedListWarningData `json:"data,omitempty"`
  6253. // Message: [Output Only] A human-readable description of the warning
  6254. // code.
  6255. Message string `json:"message,omitempty"`
  6256. // ForceSendFields is a list of field names (e.g. "Code") to
  6257. // unconditionally include in API requests. By default, fields with
  6258. // empty values are omitted from API requests. However, any non-pointer,
  6259. // non-interface field appearing in ForceSendFields will be sent to the
  6260. // server regardless of whether the field is empty or not. This may be
  6261. // used to include empty fields in Patch requests.
  6262. ForceSendFields []string `json:"-"`
  6263. }
  6264. func (s *TargetInstancesScopedListWarning) MarshalJSON() ([]byte, error) {
  6265. type noMethod TargetInstancesScopedListWarning
  6266. raw := noMethod(*s)
  6267. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6268. }
  6269. type TargetInstancesScopedListWarningData struct {
  6270. // Key: [Output Only] A key that provides more detail on the warning
  6271. // being returned. For example, for warnings where there are no results
  6272. // in a list request for a particular zone, this key might be scope and
  6273. // the key value might be the zone name. Other examples might be a key
  6274. // indicating a deprecated resource, and a suggested replacement, or a
  6275. // warning about invalid network settings (for example, if an instance
  6276. // attempts to perform IP forwarding but is not enabled for IP
  6277. // forwarding).
  6278. Key string `json:"key,omitempty"`
  6279. // Value: [Output Only] A warning data value corresponding to the key.
  6280. Value string `json:"value,omitempty"`
  6281. // ForceSendFields is a list of field names (e.g. "Key") to
  6282. // unconditionally include in API requests. By default, fields with
  6283. // empty values are omitted from API requests. However, any non-pointer,
  6284. // non-interface field appearing in ForceSendFields will be sent to the
  6285. // server regardless of whether the field is empty or not. This may be
  6286. // used to include empty fields in Patch requests.
  6287. ForceSendFields []string `json:"-"`
  6288. }
  6289. func (s *TargetInstancesScopedListWarningData) MarshalJSON() ([]byte, error) {
  6290. type noMethod TargetInstancesScopedListWarningData
  6291. raw := noMethod(*s)
  6292. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6293. }
  6294. // TargetPool: A TargetPool resource. This resource defines a pool of
  6295. // instances, associated HttpHealthCheck resources, and the fallback
  6296. // TargetPool.
  6297. type TargetPool struct {
  6298. // BackupPool: This field is applicable only when the containing target
  6299. // pool is serving a forwarding rule as the primary pool, and its
  6300. // failoverRatio field is properly set to a value between [0,
  6301. // 1].
  6302. //
  6303. // backupPool and failoverRatio together define the fallback behavior of
  6304. // the primary target pool: if the ratio of the healthy instances in the
  6305. // primary pool is at or below failoverRatio, traffic arriving at the
  6306. // load-balanced IP will be directed to the backup pool.
  6307. //
  6308. // In case where failoverRatio and backupPool are not set, or all the
  6309. // instances in the backup pool are unhealthy, the traffic will be
  6310. // directed back to the primary pool in the "force" mode, where traffic
  6311. // will be spread to the healthy instances with the best effort, or to
  6312. // all instances when no instance is healthy.
  6313. BackupPool string `json:"backupPool,omitempty"`
  6314. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  6315. // format.
  6316. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  6317. // Description: An optional description of this resource. Provide this
  6318. // property when you create the resource.
  6319. Description string `json:"description,omitempty"`
  6320. // FailoverRatio: This field is applicable only when the containing
  6321. // target pool is serving a forwarding rule as the primary pool (i.e.,
  6322. // not as a backup pool to some other target pool). The value of the
  6323. // field must be in [0, 1].
  6324. //
  6325. // If set, backupPool must also be set. They together define the
  6326. // fallback behavior of the primary target pool: if the ratio of the
  6327. // healthy instances in the primary pool is at or below this number,
  6328. // traffic arriving at the load-balanced IP will be directed to the
  6329. // backup pool.
  6330. //
  6331. // In case where failoverRatio is not set or all the instances in the
  6332. // backup pool are unhealthy, the traffic will be directed back to the
  6333. // primary pool in the "force" mode, where traffic will be spread to the
  6334. // healthy instances with the best effort, or to all instances when no
  6335. // instance is healthy.
  6336. FailoverRatio float64 `json:"failoverRatio,omitempty"`
  6337. // HealthChecks: A list of URLs to the HttpHealthCheck resource. A
  6338. // member instance in this pool is considered healthy if and only if all
  6339. // specified health checks pass. An empty list means all member
  6340. // instances will be considered healthy at all times.
  6341. HealthChecks []string `json:"healthChecks,omitempty"`
  6342. // Id: [Output Only] The unique identifier for the resource. This
  6343. // identifier is defined by the server.
  6344. Id uint64 `json:"id,omitempty,string"`
  6345. // Instances: A list of resource URLs to the member virtual machines
  6346. // serving this pool. They must live in zones contained in the same
  6347. // region as this pool.
  6348. Instances []string `json:"instances,omitempty"`
  6349. // Kind: [Output Only] Type of the resource. Always compute#targetPool
  6350. // for target pools.
  6351. Kind string `json:"kind,omitempty"`
  6352. // Name: Name of the resource. Provided by the client when the resource
  6353. // is created. The name must be 1-63 characters long, and comply with
  6354. // RFC1035. Specifically, the name must be 1-63 characters long and
  6355. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  6356. // the first character must be a lowercase letter, and all following
  6357. // characters must be a dash, lowercase letter, or digit, except the
  6358. // last character, which cannot be a dash.
  6359. Name string `json:"name,omitempty"`
  6360. // Region: [Output Only] URL of the region where the target pool
  6361. // resides.
  6362. Region string `json:"region,omitempty"`
  6363. // SelfLink: [Output Only] Server-defined URL for the resource.
  6364. SelfLink string `json:"selfLink,omitempty"`
  6365. // SessionAffinity: Sesssion affinity option, must be one of the
  6366. // following values:
  6367. // NONE: Connections from the same client IP may go to any instance in
  6368. // the pool.
  6369. // CLIENT_IP: Connections from the same client IP will go to the same
  6370. // instance in the pool while that instance remains
  6371. // healthy.
  6372. // CLIENT_IP_PROTO: Connections from the same client IP with the same IP
  6373. // protocol will go to the same instance in the pool while that instance
  6374. // remains healthy.
  6375. //
  6376. // Possible values:
  6377. // "CLIENT_IP"
  6378. // "CLIENT_IP_PROTO"
  6379. // "NONE"
  6380. SessionAffinity string `json:"sessionAffinity,omitempty"`
  6381. // ServerResponse contains the HTTP response code and headers from the
  6382. // server.
  6383. googleapi.ServerResponse `json:"-"`
  6384. // ForceSendFields is a list of field names (e.g. "BackupPool") to
  6385. // unconditionally include in API requests. By default, fields with
  6386. // empty values are omitted from API requests. However, any non-pointer,
  6387. // non-interface field appearing in ForceSendFields will be sent to the
  6388. // server regardless of whether the field is empty or not. This may be
  6389. // used to include empty fields in Patch requests.
  6390. ForceSendFields []string `json:"-"`
  6391. }
  6392. func (s *TargetPool) MarshalJSON() ([]byte, error) {
  6393. type noMethod TargetPool
  6394. raw := noMethod(*s)
  6395. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6396. }
  6397. type TargetPoolAggregatedList struct {
  6398. // Id: [Output Only] Unique identifier for the resource. Defined by the
  6399. // server.
  6400. Id string `json:"id,omitempty"`
  6401. // Items: A map of scoped target pool lists.
  6402. Items map[string]TargetPoolsScopedList `json:"items,omitempty"`
  6403. // Kind: Type of resource.
  6404. Kind string `json:"kind,omitempty"`
  6405. // NextPageToken: [Output Only] This token allows you to get the next
  6406. // page of results for list requests. If the number of results is larger
  6407. // than maxResults, use the nextPageToken as a value for the query
  6408. // parameter pageToken in the next list request. Subsequent list
  6409. // requests will have their own nextPageToken to continue paging through
  6410. // the results.
  6411. NextPageToken string `json:"nextPageToken,omitempty"`
  6412. // SelfLink: [Output Only] Server-defined URL for this resource.
  6413. SelfLink string `json:"selfLink,omitempty"`
  6414. // ServerResponse contains the HTTP response code and headers from the
  6415. // server.
  6416. googleapi.ServerResponse `json:"-"`
  6417. // ForceSendFields is a list of field names (e.g. "Id") to
  6418. // unconditionally include in API requests. By default, fields with
  6419. // empty values are omitted from API requests. However, any non-pointer,
  6420. // non-interface field appearing in ForceSendFields will be sent to the
  6421. // server regardless of whether the field is empty or not. This may be
  6422. // used to include empty fields in Patch requests.
  6423. ForceSendFields []string `json:"-"`
  6424. }
  6425. func (s *TargetPoolAggregatedList) MarshalJSON() ([]byte, error) {
  6426. type noMethod TargetPoolAggregatedList
  6427. raw := noMethod(*s)
  6428. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6429. }
  6430. type TargetPoolInstanceHealth struct {
  6431. HealthStatus []*HealthStatus `json:"healthStatus,omitempty"`
  6432. // Kind: Type of resource.
  6433. Kind string `json:"kind,omitempty"`
  6434. // ServerResponse contains the HTTP response code and headers from the
  6435. // server.
  6436. googleapi.ServerResponse `json:"-"`
  6437. // ForceSendFields is a list of field names (e.g. "HealthStatus") to
  6438. // unconditionally include in API requests. By default, fields with
  6439. // empty values are omitted from API requests. However, any non-pointer,
  6440. // non-interface field appearing in ForceSendFields will be sent to the
  6441. // server regardless of whether the field is empty or not. This may be
  6442. // used to include empty fields in Patch requests.
  6443. ForceSendFields []string `json:"-"`
  6444. }
  6445. func (s *TargetPoolInstanceHealth) MarshalJSON() ([]byte, error) {
  6446. type noMethod TargetPoolInstanceHealth
  6447. raw := noMethod(*s)
  6448. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6449. }
  6450. // TargetPoolList: Contains a list of TargetPool resources.
  6451. type TargetPoolList struct {
  6452. // Id: [Output Only] Unique identifier for the resource. Defined by the
  6453. // server.
  6454. Id string `json:"id,omitempty"`
  6455. // Items: A list of TargetPool resources.
  6456. Items []*TargetPool `json:"items,omitempty"`
  6457. // Kind: Type of resource.
  6458. Kind string `json:"kind,omitempty"`
  6459. // NextPageToken: [Output Only] This token allows you to get the next
  6460. // page of results for list requests. If the number of results is larger
  6461. // than maxResults, use the nextPageToken as a value for the query
  6462. // parameter pageToken in the next list request. Subsequent list
  6463. // requests will have their own nextPageToken to continue paging through
  6464. // the results.
  6465. NextPageToken string `json:"nextPageToken,omitempty"`
  6466. // SelfLink: [Output Only] Server-defined URL for this resource.
  6467. SelfLink string `json:"selfLink,omitempty"`
  6468. // ServerResponse contains the HTTP response code and headers from the
  6469. // server.
  6470. googleapi.ServerResponse `json:"-"`
  6471. // ForceSendFields is a list of field names (e.g. "Id") to
  6472. // unconditionally include in API requests. By default, fields with
  6473. // empty values are omitted from API requests. However, any non-pointer,
  6474. // non-interface field appearing in ForceSendFields will be sent to the
  6475. // server regardless of whether the field is empty or not. This may be
  6476. // used to include empty fields in Patch requests.
  6477. ForceSendFields []string `json:"-"`
  6478. }
  6479. func (s *TargetPoolList) MarshalJSON() ([]byte, error) {
  6480. type noMethod TargetPoolList
  6481. raw := noMethod(*s)
  6482. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6483. }
  6484. type TargetPoolsAddHealthCheckRequest struct {
  6485. // HealthChecks: Health check URLs to be added to targetPool.
  6486. HealthChecks []*HealthCheckReference `json:"healthChecks,omitempty"`
  6487. // ForceSendFields is a list of field names (e.g. "HealthChecks") to
  6488. // unconditionally include in API requests. By default, fields with
  6489. // empty values are omitted from API requests. However, any non-pointer,
  6490. // non-interface field appearing in ForceSendFields will be sent to the
  6491. // server regardless of whether the field is empty or not. This may be
  6492. // used to include empty fields in Patch requests.
  6493. ForceSendFields []string `json:"-"`
  6494. }
  6495. func (s *TargetPoolsAddHealthCheckRequest) MarshalJSON() ([]byte, error) {
  6496. type noMethod TargetPoolsAddHealthCheckRequest
  6497. raw := noMethod(*s)
  6498. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6499. }
  6500. type TargetPoolsAddInstanceRequest struct {
  6501. // Instances: URLs of the instances to be added to targetPool.
  6502. Instances []*InstanceReference `json:"instances,omitempty"`
  6503. // ForceSendFields is a list of field names (e.g. "Instances") to
  6504. // unconditionally include in API requests. By default, fields with
  6505. // empty values are omitted from API requests. However, any non-pointer,
  6506. // non-interface field appearing in ForceSendFields will be sent to the
  6507. // server regardless of whether the field is empty or not. This may be
  6508. // used to include empty fields in Patch requests.
  6509. ForceSendFields []string `json:"-"`
  6510. }
  6511. func (s *TargetPoolsAddInstanceRequest) MarshalJSON() ([]byte, error) {
  6512. type noMethod TargetPoolsAddInstanceRequest
  6513. raw := noMethod(*s)
  6514. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6515. }
  6516. type TargetPoolsRemoveHealthCheckRequest struct {
  6517. // HealthChecks: Health check URLs to be removed from targetPool.
  6518. HealthChecks []*HealthCheckReference `json:"healthChecks,omitempty"`
  6519. // ForceSendFields is a list of field names (e.g. "HealthChecks") to
  6520. // unconditionally include in API requests. By default, fields with
  6521. // empty values are omitted from API requests. However, any non-pointer,
  6522. // non-interface field appearing in ForceSendFields will be sent to the
  6523. // server regardless of whether the field is empty or not. This may be
  6524. // used to include empty fields in Patch requests.
  6525. ForceSendFields []string `json:"-"`
  6526. }
  6527. func (s *TargetPoolsRemoveHealthCheckRequest) MarshalJSON() ([]byte, error) {
  6528. type noMethod TargetPoolsRemoveHealthCheckRequest
  6529. raw := noMethod(*s)
  6530. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6531. }
  6532. type TargetPoolsRemoveInstanceRequest struct {
  6533. // Instances: URLs of the instances to be removed from targetPool.
  6534. Instances []*InstanceReference `json:"instances,omitempty"`
  6535. // ForceSendFields is a list of field names (e.g. "Instances") to
  6536. // unconditionally include in API requests. By default, fields with
  6537. // empty values are omitted from API requests. However, any non-pointer,
  6538. // non-interface field appearing in ForceSendFields will be sent to the
  6539. // server regardless of whether the field is empty or not. This may be
  6540. // used to include empty fields in Patch requests.
  6541. ForceSendFields []string `json:"-"`
  6542. }
  6543. func (s *TargetPoolsRemoveInstanceRequest) MarshalJSON() ([]byte, error) {
  6544. type noMethod TargetPoolsRemoveInstanceRequest
  6545. raw := noMethod(*s)
  6546. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6547. }
  6548. type TargetPoolsScopedList struct {
  6549. // TargetPools: List of target pools contained in this scope.
  6550. TargetPools []*TargetPool `json:"targetPools,omitempty"`
  6551. // Warning: Informational warning which replaces the list of addresses
  6552. // when the list is empty.
  6553. Warning *TargetPoolsScopedListWarning `json:"warning,omitempty"`
  6554. // ForceSendFields is a list of field names (e.g. "TargetPools") to
  6555. // unconditionally include in API requests. By default, fields with
  6556. // empty values are omitted from API requests. However, any non-pointer,
  6557. // non-interface field appearing in ForceSendFields will be sent to the
  6558. // server regardless of whether the field is empty or not. This may be
  6559. // used to include empty fields in Patch requests.
  6560. ForceSendFields []string `json:"-"`
  6561. }
  6562. func (s *TargetPoolsScopedList) MarshalJSON() ([]byte, error) {
  6563. type noMethod TargetPoolsScopedList
  6564. raw := noMethod(*s)
  6565. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6566. }
  6567. // TargetPoolsScopedListWarning: Informational warning which replaces
  6568. // the list of addresses when the list is empty.
  6569. type TargetPoolsScopedListWarning struct {
  6570. // Code: [Output Only] A warning code, if applicable. For example,
  6571. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6572. // the response.
  6573. //
  6574. // Possible values:
  6575. // "DEPRECATED_RESOURCE_USED"
  6576. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6577. // "INJECTED_KERNELS_DEPRECATED"
  6578. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6579. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6580. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6581. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6582. // "NEXT_HOP_NOT_RUNNING"
  6583. // "NOT_CRITICAL_ERROR"
  6584. // "NO_RESULTS_ON_PAGE"
  6585. // "REQUIRED_TOS_AGREEMENT"
  6586. // "RESOURCE_NOT_DELETED"
  6587. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6588. // "UNREACHABLE"
  6589. Code string `json:"code,omitempty"`
  6590. // Data: [Output Only] Metadata about this warning in key: value format.
  6591. // For example:
  6592. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6593. Data []*TargetPoolsScopedListWarningData `json:"data,omitempty"`
  6594. // Message: [Output Only] A human-readable description of the warning
  6595. // code.
  6596. Message string `json:"message,omitempty"`
  6597. // ForceSendFields is a list of field names (e.g. "Code") to
  6598. // unconditionally include in API requests. By default, fields with
  6599. // empty values are omitted from API requests. However, any non-pointer,
  6600. // non-interface field appearing in ForceSendFields will be sent to the
  6601. // server regardless of whether the field is empty or not. This may be
  6602. // used to include empty fields in Patch requests.
  6603. ForceSendFields []string `json:"-"`
  6604. }
  6605. func (s *TargetPoolsScopedListWarning) MarshalJSON() ([]byte, error) {
  6606. type noMethod TargetPoolsScopedListWarning
  6607. raw := noMethod(*s)
  6608. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6609. }
  6610. type TargetPoolsScopedListWarningData struct {
  6611. // Key: [Output Only] A key that provides more detail on the warning
  6612. // being returned. For example, for warnings where there are no results
  6613. // in a list request for a particular zone, this key might be scope and
  6614. // the key value might be the zone name. Other examples might be a key
  6615. // indicating a deprecated resource, and a suggested replacement, or a
  6616. // warning about invalid network settings (for example, if an instance
  6617. // attempts to perform IP forwarding but is not enabled for IP
  6618. // forwarding).
  6619. Key string `json:"key,omitempty"`
  6620. // Value: [Output Only] A warning data value corresponding to the key.
  6621. Value string `json:"value,omitempty"`
  6622. // ForceSendFields is a list of field names (e.g. "Key") to
  6623. // unconditionally include in API requests. By default, fields with
  6624. // empty values are omitted from API requests. However, any non-pointer,
  6625. // non-interface field appearing in ForceSendFields will be sent to the
  6626. // server regardless of whether the field is empty or not. This may be
  6627. // used to include empty fields in Patch requests.
  6628. ForceSendFields []string `json:"-"`
  6629. }
  6630. func (s *TargetPoolsScopedListWarningData) MarshalJSON() ([]byte, error) {
  6631. type noMethod TargetPoolsScopedListWarningData
  6632. raw := noMethod(*s)
  6633. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6634. }
  6635. type TargetReference struct {
  6636. Target string `json:"target,omitempty"`
  6637. // ForceSendFields is a list of field names (e.g. "Target") to
  6638. // unconditionally include in API requests. By default, fields with
  6639. // empty values are omitted from API requests. However, any non-pointer,
  6640. // non-interface field appearing in ForceSendFields will be sent to the
  6641. // server regardless of whether the field is empty or not. This may be
  6642. // used to include empty fields in Patch requests.
  6643. ForceSendFields []string `json:"-"`
  6644. }
  6645. func (s *TargetReference) MarshalJSON() ([]byte, error) {
  6646. type noMethod TargetReference
  6647. raw := noMethod(*s)
  6648. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6649. }
  6650. type TargetVpnGateway struct {
  6651. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  6652. // format.
  6653. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  6654. // Description: An optional description of this resource. Provide this
  6655. // property when you create the resource.
  6656. Description string `json:"description,omitempty"`
  6657. // ForwardingRules: [Output Only] A list of URLs to the ForwardingRule
  6658. // resources. ForwardingRules are created using
  6659. // compute.forwardingRules.insert and associated to a VPN gateway.
  6660. ForwardingRules []string `json:"forwardingRules,omitempty"`
  6661. // Id: [Output Only] The unique identifier for the resource. This
  6662. // identifier is defined by the server.
  6663. Id uint64 `json:"id,omitempty,string"`
  6664. // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway
  6665. // for target VPN gateways.
  6666. Kind string `json:"kind,omitempty"`
  6667. // Name: Name of the resource; provided by the client when the resource
  6668. // is created. The name must be 1-63 characters long, and comply with
  6669. // RFC1035. Specifically, the name must be 1-63 characters long and
  6670. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  6671. // the first character must be a lowercase letter, and all following
  6672. // characters must be a dash, lowercase letter, or digit, except the
  6673. // last character, which cannot be a dash.
  6674. Name string `json:"name,omitempty"`
  6675. // Network: URL of the network to which this VPN gateway is attached.
  6676. // Provided by the client when the VPN gateway is created.
  6677. Network string `json:"network,omitempty"`
  6678. // Region: [Output Only] URL of the region where the target VPN gateway
  6679. // resides.
  6680. Region string `json:"region,omitempty"`
  6681. // SelfLink: [Output Only] Server-defined URL for the resource.
  6682. SelfLink string `json:"selfLink,omitempty"`
  6683. // Status: [Output Only] The status of the VPN gateway.
  6684. //
  6685. // Possible values:
  6686. // "CREATING"
  6687. // "DELETING"
  6688. // "FAILED"
  6689. // "READY"
  6690. Status string `json:"status,omitempty"`
  6691. // Tunnels: [Output Only] A list of URLs to VpnTunnel resources.
  6692. // VpnTunnels are created using compute.vpntunnels.insert and associated
  6693. // to a VPN gateway.
  6694. Tunnels []string `json:"tunnels,omitempty"`
  6695. // ServerResponse contains the HTTP response code and headers from the
  6696. // server.
  6697. googleapi.ServerResponse `json:"-"`
  6698. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  6699. // to unconditionally include in API requests. By default, fields with
  6700. // empty values are omitted from API requests. However, any non-pointer,
  6701. // non-interface field appearing in ForceSendFields will be sent to the
  6702. // server regardless of whether the field is empty or not. This may be
  6703. // used to include empty fields in Patch requests.
  6704. ForceSendFields []string `json:"-"`
  6705. }
  6706. func (s *TargetVpnGateway) MarshalJSON() ([]byte, error) {
  6707. type noMethod TargetVpnGateway
  6708. raw := noMethod(*s)
  6709. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6710. }
  6711. type TargetVpnGatewayAggregatedList struct {
  6712. // Id: [Output Only] The unique identifier for the resource. This
  6713. // identifier is defined by the server.
  6714. Id string `json:"id,omitempty"`
  6715. // Items: A map of scoped target vpn gateway lists.
  6716. Items map[string]TargetVpnGatewaysScopedList `json:"items,omitempty"`
  6717. // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway
  6718. // for target VPN gateways.
  6719. Kind string `json:"kind,omitempty"`
  6720. // NextPageToken: [Output Only] This token allows you to get the next
  6721. // page of results for list requests. If the number of results is larger
  6722. // than maxResults, use the nextPageToken as a value for the query
  6723. // parameter pageToken in the next list request. Subsequent list
  6724. // requests will have their own nextPageToken to continue paging through
  6725. // the results.
  6726. NextPageToken string `json:"nextPageToken,omitempty"`
  6727. // SelfLink: [Output Only] Server-defined URL for the resource.
  6728. SelfLink string `json:"selfLink,omitempty"`
  6729. // ServerResponse contains the HTTP response code and headers from the
  6730. // server.
  6731. googleapi.ServerResponse `json:"-"`
  6732. // ForceSendFields is a list of field names (e.g. "Id") to
  6733. // unconditionally include in API requests. By default, fields with
  6734. // empty values are omitted from API requests. However, any non-pointer,
  6735. // non-interface field appearing in ForceSendFields will be sent to the
  6736. // server regardless of whether the field is empty or not. This may be
  6737. // used to include empty fields in Patch requests.
  6738. ForceSendFields []string `json:"-"`
  6739. }
  6740. func (s *TargetVpnGatewayAggregatedList) MarshalJSON() ([]byte, error) {
  6741. type noMethod TargetVpnGatewayAggregatedList
  6742. raw := noMethod(*s)
  6743. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6744. }
  6745. // TargetVpnGatewayList: Contains a list of TargetVpnGateway resources.
  6746. type TargetVpnGatewayList struct {
  6747. // Id: [Output Only] The unique identifier for the resource. This
  6748. // identifier is defined by the server.
  6749. Id string `json:"id,omitempty"`
  6750. // Items: [Output Only] A list of TargetVpnGateway resources.
  6751. Items []*TargetVpnGateway `json:"items,omitempty"`
  6752. // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway
  6753. // for target VPN gateways.
  6754. Kind string `json:"kind,omitempty"`
  6755. // NextPageToken: [Output Only] This token allows you to get the next
  6756. // page of results for list requests. If the number of results is larger
  6757. // than maxResults, use the nextPageToken as a value for the query
  6758. // parameter pageToken in the next list request. Subsequent list
  6759. // requests will have their own nextPageToken to continue paging through
  6760. // the results.
  6761. NextPageToken string `json:"nextPageToken,omitempty"`
  6762. // SelfLink: [Output Only] Server-defined URL for the resource.
  6763. SelfLink string `json:"selfLink,omitempty"`
  6764. // ServerResponse contains the HTTP response code and headers from the
  6765. // server.
  6766. googleapi.ServerResponse `json:"-"`
  6767. // ForceSendFields is a list of field names (e.g. "Id") to
  6768. // unconditionally include in API requests. By default, fields with
  6769. // empty values are omitted from API requests. However, any non-pointer,
  6770. // non-interface field appearing in ForceSendFields will be sent to the
  6771. // server regardless of whether the field is empty or not. This may be
  6772. // used to include empty fields in Patch requests.
  6773. ForceSendFields []string `json:"-"`
  6774. }
  6775. func (s *TargetVpnGatewayList) MarshalJSON() ([]byte, error) {
  6776. type noMethod TargetVpnGatewayList
  6777. raw := noMethod(*s)
  6778. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6779. }
  6780. type TargetVpnGatewaysScopedList struct {
  6781. // TargetVpnGateways: [Output Only] List of target vpn gateways
  6782. // contained in this scope.
  6783. TargetVpnGateways []*TargetVpnGateway `json:"targetVpnGateways,omitempty"`
  6784. // Warning: [Output Only] Informational warning which replaces the list
  6785. // of addresses when the list is empty.
  6786. Warning *TargetVpnGatewaysScopedListWarning `json:"warning,omitempty"`
  6787. // ForceSendFields is a list of field names (e.g. "TargetVpnGateways")
  6788. // to unconditionally include in API requests. By default, fields with
  6789. // empty values are omitted from API requests. However, any non-pointer,
  6790. // non-interface field appearing in ForceSendFields will be sent to the
  6791. // server regardless of whether the field is empty or not. This may be
  6792. // used to include empty fields in Patch requests.
  6793. ForceSendFields []string `json:"-"`
  6794. }
  6795. func (s *TargetVpnGatewaysScopedList) MarshalJSON() ([]byte, error) {
  6796. type noMethod TargetVpnGatewaysScopedList
  6797. raw := noMethod(*s)
  6798. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6799. }
  6800. // TargetVpnGatewaysScopedListWarning: [Output Only] Informational
  6801. // warning which replaces the list of addresses when the list is empty.
  6802. type TargetVpnGatewaysScopedListWarning struct {
  6803. // Code: [Output Only] A warning code, if applicable. For example,
  6804. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6805. // the response.
  6806. //
  6807. // Possible values:
  6808. // "DEPRECATED_RESOURCE_USED"
  6809. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6810. // "INJECTED_KERNELS_DEPRECATED"
  6811. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6812. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6813. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6814. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6815. // "NEXT_HOP_NOT_RUNNING"
  6816. // "NOT_CRITICAL_ERROR"
  6817. // "NO_RESULTS_ON_PAGE"
  6818. // "REQUIRED_TOS_AGREEMENT"
  6819. // "RESOURCE_NOT_DELETED"
  6820. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6821. // "UNREACHABLE"
  6822. Code string `json:"code,omitempty"`
  6823. // Data: [Output Only] Metadata about this warning in key: value format.
  6824. // For example:
  6825. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6826. Data []*TargetVpnGatewaysScopedListWarningData `json:"data,omitempty"`
  6827. // Message: [Output Only] A human-readable description of the warning
  6828. // code.
  6829. Message string `json:"message,omitempty"`
  6830. // ForceSendFields is a list of field names (e.g. "Code") to
  6831. // unconditionally include in API requests. By default, fields with
  6832. // empty values are omitted from API requests. However, any non-pointer,
  6833. // non-interface field appearing in ForceSendFields will be sent to the
  6834. // server regardless of whether the field is empty or not. This may be
  6835. // used to include empty fields in Patch requests.
  6836. ForceSendFields []string `json:"-"`
  6837. }
  6838. func (s *TargetVpnGatewaysScopedListWarning) MarshalJSON() ([]byte, error) {
  6839. type noMethod TargetVpnGatewaysScopedListWarning
  6840. raw := noMethod(*s)
  6841. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6842. }
  6843. type TargetVpnGatewaysScopedListWarningData struct {
  6844. // Key: [Output Only] A key that provides more detail on the warning
  6845. // being returned. For example, for warnings where there are no results
  6846. // in a list request for a particular zone, this key might be scope and
  6847. // the key value might be the zone name. Other examples might be a key
  6848. // indicating a deprecated resource, and a suggested replacement, or a
  6849. // warning about invalid network settings (for example, if an instance
  6850. // attempts to perform IP forwarding but is not enabled for IP
  6851. // forwarding).
  6852. Key string `json:"key,omitempty"`
  6853. // Value: [Output Only] A warning data value corresponding to the key.
  6854. Value string `json:"value,omitempty"`
  6855. // ForceSendFields is a list of field names (e.g. "Key") to
  6856. // unconditionally include in API requests. By default, fields with
  6857. // empty values are omitted from API requests. However, any non-pointer,
  6858. // non-interface field appearing in ForceSendFields will be sent to the
  6859. // server regardless of whether the field is empty or not. This may be
  6860. // used to include empty fields in Patch requests.
  6861. ForceSendFields []string `json:"-"`
  6862. }
  6863. func (s *TargetVpnGatewaysScopedListWarningData) MarshalJSON() ([]byte, error) {
  6864. type noMethod TargetVpnGatewaysScopedListWarningData
  6865. raw := noMethod(*s)
  6866. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6867. }
  6868. type TestFailure struct {
  6869. ActualService string `json:"actualService,omitempty"`
  6870. ExpectedService string `json:"expectedService,omitempty"`
  6871. Host string `json:"host,omitempty"`
  6872. Path string `json:"path,omitempty"`
  6873. // ForceSendFields is a list of field names (e.g. "ActualService") to
  6874. // unconditionally include in API requests. By default, fields with
  6875. // empty values are omitted from API requests. However, any non-pointer,
  6876. // non-interface field appearing in ForceSendFields will be sent to the
  6877. // server regardless of whether the field is empty or not. This may be
  6878. // used to include empty fields in Patch requests.
  6879. ForceSendFields []string `json:"-"`
  6880. }
  6881. func (s *TestFailure) MarshalJSON() ([]byte, error) {
  6882. type noMethod TestFailure
  6883. raw := noMethod(*s)
  6884. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6885. }
  6886. // UrlMap: A UrlMap resource. This resource defines the mapping from URL
  6887. // to the BackendService resource, based on the "longest-match" of the
  6888. // URL's host and path.
  6889. type UrlMap struct {
  6890. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  6891. // format.
  6892. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  6893. // DefaultService: The URL of the BackendService resource if none of the
  6894. // hostRules match.
  6895. DefaultService string `json:"defaultService,omitempty"`
  6896. // Description: An optional description of this resource. Provide this
  6897. // property when you create the resource.
  6898. Description string `json:"description,omitempty"`
  6899. // Fingerprint: Fingerprint of this resource. A hash of the contents
  6900. // stored in this object. This field is used in optimistic locking. This
  6901. // field will be ignored when inserting a UrlMap. An up-to-date
  6902. // fingerprint must be provided in order to update the UrlMap.
  6903. Fingerprint string `json:"fingerprint,omitempty"`
  6904. // HostRules: The list of HostRules to use against the URL.
  6905. HostRules []*HostRule `json:"hostRules,omitempty"`
  6906. // Id: [Output Only] The unique identifier for the resource. This
  6907. // identifier is defined by the server.
  6908. Id uint64 `json:"id,omitempty,string"`
  6909. // Kind: [Output Only] Type of the resource. Always compute#urlMaps for
  6910. // url maps.
  6911. Kind string `json:"kind,omitempty"`
  6912. // Name: Name of the resource. Provided by the client when the resource
  6913. // is created. The name must be 1-63 characters long, and comply with
  6914. // RFC1035. Specifically, the name must be 1-63 characters long and
  6915. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  6916. // the first character must be a lowercase letter, and all following
  6917. // characters must be a dash, lowercase letter, or digit, except the
  6918. // last character, which cannot be a dash.
  6919. Name string `json:"name,omitempty"`
  6920. // PathMatchers: The list of named PathMatchers to use against the URL.
  6921. PathMatchers []*PathMatcher `json:"pathMatchers,omitempty"`
  6922. // SelfLink: [Output Only] Server-defined URL for the resource.
  6923. SelfLink string `json:"selfLink,omitempty"`
  6924. // Tests: The list of expected URL mappings. Request to update this
  6925. // UrlMap will succeed only all of the test cases pass.
  6926. Tests []*UrlMapTest `json:"tests,omitempty"`
  6927. // ServerResponse contains the HTTP response code and headers from the
  6928. // server.
  6929. googleapi.ServerResponse `json:"-"`
  6930. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  6931. // to unconditionally include in API requests. By default, fields with
  6932. // empty values are omitted from API requests. However, any non-pointer,
  6933. // non-interface field appearing in ForceSendFields will be sent to the
  6934. // server regardless of whether the field is empty or not. This may be
  6935. // used to include empty fields in Patch requests.
  6936. ForceSendFields []string `json:"-"`
  6937. }
  6938. func (s *UrlMap) MarshalJSON() ([]byte, error) {
  6939. type noMethod UrlMap
  6940. raw := noMethod(*s)
  6941. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6942. }
  6943. // UrlMapList: Contains a list of UrlMap resources.
  6944. type UrlMapList struct {
  6945. // Id: [Output Only] Unique identifier for the resource. Set by the
  6946. // server.
  6947. Id string `json:"id,omitempty"`
  6948. // Items: A list of UrlMap resources.
  6949. Items []*UrlMap `json:"items,omitempty"`
  6950. // Kind: Type of resource.
  6951. Kind string `json:"kind,omitempty"`
  6952. // NextPageToken: [Output Only] This token allows you to get the next
  6953. // page of results for list requests. If the number of results is larger
  6954. // than maxResults, use the nextPageToken as a value for the query
  6955. // parameter pageToken in the next list request. Subsequent list
  6956. // requests will have their own nextPageToken to continue paging through
  6957. // the results.
  6958. NextPageToken string `json:"nextPageToken,omitempty"`
  6959. // SelfLink: [Output Only] Server-defined URL for this resource.
  6960. SelfLink string `json:"selfLink,omitempty"`
  6961. // ServerResponse contains the HTTP response code and headers from the
  6962. // server.
  6963. googleapi.ServerResponse `json:"-"`
  6964. // ForceSendFields is a list of field names (e.g. "Id") to
  6965. // unconditionally include in API requests. By default, fields with
  6966. // empty values are omitted from API requests. However, any non-pointer,
  6967. // non-interface field appearing in ForceSendFields will be sent to the
  6968. // server regardless of whether the field is empty or not. This may be
  6969. // used to include empty fields in Patch requests.
  6970. ForceSendFields []string `json:"-"`
  6971. }
  6972. func (s *UrlMapList) MarshalJSON() ([]byte, error) {
  6973. type noMethod UrlMapList
  6974. raw := noMethod(*s)
  6975. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6976. }
  6977. type UrlMapReference struct {
  6978. UrlMap string `json:"urlMap,omitempty"`
  6979. // ForceSendFields is a list of field names (e.g. "UrlMap") to
  6980. // unconditionally include in API requests. By default, fields with
  6981. // empty values are omitted from API requests. However, any non-pointer,
  6982. // non-interface field appearing in ForceSendFields will be sent to the
  6983. // server regardless of whether the field is empty or not. This may be
  6984. // used to include empty fields in Patch requests.
  6985. ForceSendFields []string `json:"-"`
  6986. }
  6987. func (s *UrlMapReference) MarshalJSON() ([]byte, error) {
  6988. type noMethod UrlMapReference
  6989. raw := noMethod(*s)
  6990. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6991. }
  6992. // UrlMapTest: Message for the expected URL mappings.
  6993. type UrlMapTest struct {
  6994. // Description: Description of this test case.
  6995. Description string `json:"description,omitempty"`
  6996. // Host: Host portion of the URL.
  6997. Host string `json:"host,omitempty"`
  6998. // Path: Path portion of the URL.
  6999. Path string `json:"path,omitempty"`
  7000. // Service: Expected BackendService resource the given URL should be
  7001. // mapped to.
  7002. Service string `json:"service,omitempty"`
  7003. // ForceSendFields is a list of field names (e.g. "Description") to
  7004. // unconditionally include in API requests. By default, fields with
  7005. // empty values are omitted from API requests. However, any non-pointer,
  7006. // non-interface field appearing in ForceSendFields will be sent to the
  7007. // server regardless of whether the field is empty or not. This may be
  7008. // used to include empty fields in Patch requests.
  7009. ForceSendFields []string `json:"-"`
  7010. }
  7011. func (s *UrlMapTest) MarshalJSON() ([]byte, error) {
  7012. type noMethod UrlMapTest
  7013. raw := noMethod(*s)
  7014. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  7015. }
  7016. // UrlMapValidationResult: Message representing the validation result
  7017. // for a UrlMap.
  7018. type UrlMapValidationResult struct {
  7019. LoadErrors []string `json:"loadErrors,omitempty"`
  7020. // LoadSucceeded: Whether the given UrlMap can be successfully loaded.
  7021. // If false, 'loadErrors' indicates the reasons.
  7022. LoadSucceeded bool `json:"loadSucceeded,omitempty"`
  7023. TestFailures []*TestFailure `json:"testFailures,omitempty"`
  7024. // TestPassed: If successfully loaded, this field indicates whether the
  7025. // test passed. If false, 'testFailures's indicate the reason of
  7026. // failure.
  7027. TestPassed bool `json:"testPassed,omitempty"`
  7028. // ForceSendFields is a list of field names (e.g. "LoadErrors") to
  7029. // unconditionally include in API requests. By default, fields with
  7030. // empty values are omitted from API requests. However, any non-pointer,
  7031. // non-interface field appearing in ForceSendFields will be sent to the
  7032. // server regardless of whether the field is empty or not. This may be
  7033. // used to include empty fields in Patch requests.
  7034. ForceSendFields []string `json:"-"`
  7035. }
  7036. func (s *UrlMapValidationResult) MarshalJSON() ([]byte, error) {
  7037. type noMethod UrlMapValidationResult
  7038. raw := noMethod(*s)
  7039. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  7040. }
  7041. type UrlMapsValidateRequest struct {
  7042. // Resource: Content of the UrlMap to be validated.
  7043. Resource *UrlMap `json:"resource,omitempty"`
  7044. // ForceSendFields is a list of field names (e.g. "Resource") to
  7045. // unconditionally include in API requests. By default, fields with
  7046. // empty values are omitted from API requests. However, any non-pointer,
  7047. // non-interface field appearing in ForceSendFields will be sent to the
  7048. // server regardless of whether the field is empty or not. This may be
  7049. // used to include empty fields in Patch requests.
  7050. ForceSendFields []string `json:"-"`
  7051. }
  7052. func (s *UrlMapsValidateRequest) MarshalJSON() ([]byte, error) {
  7053. type noMethod UrlMapsValidateRequest
  7054. raw := noMethod(*s)
  7055. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  7056. }
  7057. type UrlMapsValidateResponse struct {
  7058. Result *UrlMapValidationResult `json:"result,omitempty"`
  7059. // ServerResponse contains the HTTP response code and headers from the
  7060. // server.
  7061. googleapi.ServerResponse `json:"-"`
  7062. // ForceSendFields is a list of field names (e.g. "Result") to
  7063. // unconditionally include in API requests. By default, fields with
  7064. // empty values are omitted from API requests. However, any non-pointer,
  7065. // non-interface field appearing in ForceSendFields will be sent to the
  7066. // server regardless of whether the field is empty or not. This may be
  7067. // used to include empty fields in Patch requests.
  7068. ForceSendFields []string `json:"-"`
  7069. }
  7070. func (s *UrlMapsValidateResponse) MarshalJSON() ([]byte, error) {
  7071. type noMethod UrlMapsValidateResponse
  7072. raw := noMethod(*s)
  7073. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  7074. }
  7075. // UsageExportLocation: The location in Cloud Storage and naming method
  7076. // of the daily usage report. Contains bucket_name and report_name
  7077. // prefix.
  7078. type UsageExportLocation struct {
  7079. // BucketName: The name of an existing bucket in Cloud Storage where the
  7080. // usage report object is stored. The Google Service Account is granted
  7081. // write access to this bucket. This can either be the bucket name by
  7082. // itself, such as example-bucket, or the bucket name with gs:// or
  7083. // https://storage.googleapis.com/ in front of it, such as
  7084. // gs://example-bucket.
  7085. BucketName string `json:"bucketName,omitempty"`
  7086. // ReportNamePrefix: An optional prefix for the name of the usage report
  7087. // object stored in bucketName. If not supplied, defaults to usage. The
  7088. // report is stored as a CSV file named
  7089. // report_name_prefix_gce_YYYYMMDD.csv where YYYYMMDD is the day of the
  7090. // usage according to Pacific Time. If you supply a prefix, it should
  7091. // conform to Cloud Storage object naming conventions.
  7092. ReportNamePrefix string `json:"reportNamePrefix,omitempty"`
  7093. // ForceSendFields is a list of field names (e.g. "BucketName") to
  7094. // unconditionally include in API requests. By default, fields with
  7095. // empty values are omitted from API requests. However, any non-pointer,
  7096. // non-interface field appearing in ForceSendFields will be sent to the
  7097. // server regardless of whether the field is empty or not. This may be
  7098. // used to include empty fields in Patch requests.
  7099. ForceSendFields []string `json:"-"`
  7100. }
  7101. func (s *UsageExportLocation) MarshalJSON() ([]byte, error) {
  7102. type noMethod UsageExportLocation
  7103. raw := noMethod(*s)
  7104. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  7105. }
  7106. type VpnTunnel struct {
  7107. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  7108. // format.
  7109. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  7110. // Description: An optional description of this resource. Provide this
  7111. // property when you create the resource.
  7112. Description string `json:"description,omitempty"`
  7113. // DetailedStatus: [Output Only] Detailed status message for the VPN
  7114. // tunnel.
  7115. DetailedStatus string `json:"detailedStatus,omitempty"`
  7116. // Id: [Output Only] The unique identifier for the resource. This
  7117. // identifier is defined by the server.
  7118. Id uint64 `json:"id,omitempty,string"`
  7119. // IkeVersion: IKE protocol version to use when establishing the VPN
  7120. // tunnel with peer VPN gateway. Acceptable IKE versions are 1 or 2.
  7121. // Default version is 2.
  7122. IkeVersion int64 `json:"ikeVersion,omitempty"`
  7123. // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for
  7124. // VPN tunnels.
  7125. Kind string `json:"kind,omitempty"`
  7126. // LocalTrafficSelector: Local traffic selector to use when establishing
  7127. // the VPN tunnel with peer VPN gateway. The value should be a CIDR
  7128. // formatted string, for example: 192.168.0.0/16. The ranges should be
  7129. // disjoint.
  7130. LocalTrafficSelector []string `json:"localTrafficSelector,omitempty"`
  7131. // Name: Name of the resource; provided by the client when the resource
  7132. // is created. The name must be 1-63 characters long, and comply with
  7133. // RFC1035. Specifically, the name must be 1-63 characters long and
  7134. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  7135. // the first character must be a lowercase letter, and all following
  7136. // characters must be a dash, lowercase letter, or digit, except the
  7137. // last character, which cannot be a dash.
  7138. Name string `json:"name,omitempty"`
  7139. // PeerIp: IP address of the peer VPN gateway.
  7140. PeerIp string `json:"peerIp,omitempty"`
  7141. // Region: [Output Only] URL of the region where the VPN tunnel resides.
  7142. Region string `json:"region,omitempty"`
  7143. // SelfLink: [Output Only] Server-defined URL for the resource.
  7144. SelfLink string `json:"selfLink,omitempty"`
  7145. // SharedSecret: Shared secret used to set the secure session between
  7146. // the Cloud VPN gateway and the peer VPN gateway.
  7147. SharedSecret string `json:"sharedSecret,omitempty"`
  7148. // SharedSecretHash: Hash of the shared secret.
  7149. SharedSecretHash string `json:"sharedSecretHash,omitempty"`
  7150. // Status: [Output Only] The status of the VPN tunnel.
  7151. //
  7152. // Possible values:
  7153. // "AUTHORIZATION_ERROR"
  7154. // "DEPROVISIONING"
  7155. // "ESTABLISHED"
  7156. // "FAILED"
  7157. // "FIRST_HANDSHAKE"
  7158. // "NEGOTIATION_FAILURE"
  7159. // "NETWORK_ERROR"
  7160. // "NO_INCOMING_PACKETS"
  7161. // "PROVISIONING"
  7162. // "REJECTED"
  7163. // "WAITING_FOR_FULL_CONFIG"
  7164. Status string `json:"status,omitempty"`
  7165. // TargetVpnGateway: URL of the VPN gateway to which this VPN tunnel is
  7166. // associated. Provided by the client when the VPN tunnel is created.
  7167. TargetVpnGateway string `json:"targetVpnGateway,omitempty"`
  7168. // ServerResponse contains the HTTP response code and headers from the
  7169. // server.
  7170. googleapi.ServerResponse `json:"-"`
  7171. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  7172. // to unconditionally include in API requests. By default, fields with
  7173. // empty values are omitted from API requests. However, any non-pointer,
  7174. // non-interface field appearing in ForceSendFields will be sent to the
  7175. // server regardless of whether the field is empty or not. This may be
  7176. // used to include empty fields in Patch requests.
  7177. ForceSendFields []string `json:"-"`
  7178. }
  7179. func (s *VpnTunnel) MarshalJSON() ([]byte, error) {
  7180. type noMethod VpnTunnel
  7181. raw := noMethod(*s)
  7182. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  7183. }
  7184. type VpnTunnelAggregatedList struct {
  7185. // Id: [Output Only] The unique identifier for the resource. This
  7186. // identifier is defined by the server.
  7187. Id string `json:"id,omitempty"`
  7188. // Items: [Output Only] A map of scoped vpn tunnel lists.
  7189. Items map[string]VpnTunnelsScopedList `json:"items,omitempty"`
  7190. // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for
  7191. // VPN tunnels.
  7192. Kind string `json:"kind,omitempty"`
  7193. // NextPageToken: [Output Only] This token allows you to get the next
  7194. // page of results for list requests. If the number of results is larger
  7195. // than maxResults, use the nextPageToken as a value for the query
  7196. // parameter pageToken in the next list request. Subsequent list
  7197. // requests will have their own nextPageToken to continue paging through
  7198. // the results.
  7199. NextPageToken string `json:"nextPageToken,omitempty"`
  7200. // SelfLink: [Output Only] Server-defined URL for this resource.
  7201. SelfLink string `json:"selfLink,omitempty"`
  7202. // ServerResponse contains the HTTP response code and headers from the
  7203. // server.
  7204. googleapi.ServerResponse `json:"-"`
  7205. // ForceSendFields is a list of field names (e.g. "Id") to
  7206. // unconditionally include in API requests. By default, fields with
  7207. // empty values are omitted from API requests. However, any non-pointer,
  7208. // non-interface field appearing in ForceSendFields will be sent to the
  7209. // server regardless of whether the field is empty or not. This may be
  7210. // used to include empty fields in Patch requests.
  7211. ForceSendFields []string `json:"-"`
  7212. }
  7213. func (s *VpnTunnelAggregatedList) MarshalJSON() ([]byte, error) {
  7214. type noMethod VpnTunnelAggregatedList
  7215. raw := noMethod(*s)
  7216. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  7217. }
  7218. // VpnTunnelList: Contains a list of VpnTunnel resources.
  7219. type VpnTunnelList struct {
  7220. // Id: [Output Only] The unique identifier for the resource. This
  7221. // identifier is defined by the server.
  7222. Id string `json:"id,omitempty"`
  7223. // Items: [Output Only] A list of VpnTunnel resources.
  7224. Items []*VpnTunnel `json:"items,omitempty"`
  7225. // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for
  7226. // VPN tunnels.
  7227. Kind string `json:"kind,omitempty"`
  7228. // NextPageToken: [Output Only] This token allows you to get the next
  7229. // page of results for list requests. If the number of results is larger
  7230. // than maxResults, use the nextPageToken as a value for the query
  7231. // parameter pageToken in the next list request. Subsequent list
  7232. // requests will have their own nextPageToken to continue paging through
  7233. // the results.
  7234. NextPageToken string `json:"nextPageToken,omitempty"`
  7235. // SelfLink: [Output Only] Server-defined URL for the resource.
  7236. SelfLink string `json:"selfLink,omitempty"`
  7237. // ServerResponse contains the HTTP response code and headers from the
  7238. // server.
  7239. googleapi.ServerResponse `json:"-"`
  7240. // ForceSendFields is a list of field names (e.g. "Id") to
  7241. // unconditionally include in API requests. By default, fields with
  7242. // empty values are omitted from API requests. However, any non-pointer,
  7243. // non-interface field appearing in ForceSendFields will be sent to the
  7244. // server regardless of whether the field is empty or not. This may be
  7245. // used to include empty fields in Patch requests.
  7246. ForceSendFields []string `json:"-"`
  7247. }
  7248. func (s *VpnTunnelList) MarshalJSON() ([]byte, error) {
  7249. type noMethod VpnTunnelList
  7250. raw := noMethod(*s)
  7251. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  7252. }
  7253. type VpnTunnelsScopedList struct {
  7254. // VpnTunnels: List of vpn tunnels contained in this scope.
  7255. VpnTunnels []*VpnTunnel `json:"vpnTunnels,omitempty"`
  7256. // Warning: Informational warning which replaces the list of addresses
  7257. // when the list is empty.
  7258. Warning *VpnTunnelsScopedListWarning `json:"warning,omitempty"`
  7259. // ForceSendFields is a list of field names (e.g. "VpnTunnels") to
  7260. // unconditionally include in API requests. By default, fields with
  7261. // empty values are omitted from API requests. However, any non-pointer,
  7262. // non-interface field appearing in ForceSendFields will be sent to the
  7263. // server regardless of whether the field is empty or not. This may be
  7264. // used to include empty fields in Patch requests.
  7265. ForceSendFields []string `json:"-"`
  7266. }
  7267. func (s *VpnTunnelsScopedList) MarshalJSON() ([]byte, error) {
  7268. type noMethod VpnTunnelsScopedList
  7269. raw := noMethod(*s)
  7270. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  7271. }
  7272. // VpnTunnelsScopedListWarning: Informational warning which replaces the
  7273. // list of addresses when the list is empty.
  7274. type VpnTunnelsScopedListWarning struct {
  7275. // Code: [Output Only] A warning code, if applicable. For example,
  7276. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  7277. // the response.
  7278. //
  7279. // Possible values:
  7280. // "DEPRECATED_RESOURCE_USED"
  7281. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  7282. // "INJECTED_KERNELS_DEPRECATED"
  7283. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  7284. // "NEXT_HOP_CANNOT_IP_FORWARD"
  7285. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  7286. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  7287. // "NEXT_HOP_NOT_RUNNING"
  7288. // "NOT_CRITICAL_ERROR"
  7289. // "NO_RESULTS_ON_PAGE"
  7290. // "REQUIRED_TOS_AGREEMENT"
  7291. // "RESOURCE_NOT_DELETED"
  7292. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  7293. // "UNREACHABLE"
  7294. Code string `json:"code,omitempty"`
  7295. // Data: [Output Only] Metadata about this warning in key: value format.
  7296. // For example:
  7297. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  7298. Data []*VpnTunnelsScopedListWarningData `json:"data,omitempty"`
  7299. // Message: [Output Only] A human-readable description of the warning
  7300. // code.
  7301. Message string `json:"message,omitempty"`
  7302. // ForceSendFields is a list of field names (e.g. "Code") to
  7303. // unconditionally include in API requests. By default, fields with
  7304. // empty values are omitted from API requests. However, any non-pointer,
  7305. // non-interface field appearing in ForceSendFields will be sent to the
  7306. // server regardless of whether the field is empty or not. This may be
  7307. // used to include empty fields in Patch requests.
  7308. ForceSendFields []string `json:"-"`
  7309. }
  7310. func (s *VpnTunnelsScopedListWarning) MarshalJSON() ([]byte, error) {
  7311. type noMethod VpnTunnelsScopedListWarning
  7312. raw := noMethod(*s)
  7313. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  7314. }
  7315. type VpnTunnelsScopedListWarningData struct {
  7316. // Key: [Output Only] A key that provides more detail on the warning
  7317. // being returned. For example, for warnings where there are no results
  7318. // in a list request for a particular zone, this key might be scope and
  7319. // the key value might be the zone name. Other examples might be a key
  7320. // indicating a deprecated resource, and a suggested replacement, or a
  7321. // warning about invalid network settings (for example, if an instance
  7322. // attempts to perform IP forwarding but is not enabled for IP
  7323. // forwarding).
  7324. Key string `json:"key,omitempty"`
  7325. // Value: [Output Only] A warning data value corresponding to the key.
  7326. Value string `json:"value,omitempty"`
  7327. // ForceSendFields is a list of field names (e.g. "Key") to
  7328. // unconditionally include in API requests. By default, fields with
  7329. // empty values are omitted from API requests. However, any non-pointer,
  7330. // non-interface field appearing in ForceSendFields will be sent to the
  7331. // server regardless of whether the field is empty or not. This may be
  7332. // used to include empty fields in Patch requests.
  7333. ForceSendFields []string `json:"-"`
  7334. }
  7335. func (s *VpnTunnelsScopedListWarningData) MarshalJSON() ([]byte, error) {
  7336. type noMethod VpnTunnelsScopedListWarningData
  7337. raw := noMethod(*s)
  7338. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  7339. }
  7340. // Zone: A Zone resource.
  7341. type Zone struct {
  7342. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  7343. // format.
  7344. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  7345. // Deprecated: [Output Only] The deprecation status associated with this
  7346. // zone.
  7347. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  7348. // Description: [Output Only] Textual description of the resource.
  7349. Description string `json:"description,omitempty"`
  7350. // Id: [Output Only] The unique identifier for the resource. This
  7351. // identifier is defined by the server.
  7352. Id uint64 `json:"id,omitempty,string"`
  7353. // Kind: [Output Only] Type of the resource. Always compute#zone for
  7354. // zones.
  7355. Kind string `json:"kind,omitempty"`
  7356. // MaintenanceWindows: [Output Only] Any scheduled maintenance windows
  7357. // for this zone. When the zone is in a maintenance window, all
  7358. // resources which reside in the zone will be unavailable. For more
  7359. // information, see Maintenance Windows
  7360. MaintenanceWindows []*ZoneMaintenanceWindows `json:"maintenanceWindows,omitempty"`
  7361. // Name: [Output Only] Name of the resource.
  7362. Name string `json:"name,omitempty"`
  7363. // Region: [Output Only] Full URL reference to the region which hosts
  7364. // the zone.
  7365. Region string `json:"region,omitempty"`
  7366. // SelfLink: [Output Only] Server-defined URL for the resource.
  7367. SelfLink string `json:"selfLink,omitempty"`
  7368. // Status: [Output Only] Status of the zone, either UP or DOWN.
  7369. //
  7370. // Possible values:
  7371. // "DOWN"
  7372. // "UP"
  7373. Status string `json:"status,omitempty"`
  7374. // ServerResponse contains the HTTP response code and headers from the
  7375. // server.
  7376. googleapi.ServerResponse `json:"-"`
  7377. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  7378. // to unconditionally include in API requests. By default, fields with
  7379. // empty values are omitted from API requests. However, any non-pointer,
  7380. // non-interface field appearing in ForceSendFields will be sent to the
  7381. // server regardless of whether the field is empty or not. This may be
  7382. // used to include empty fields in Patch requests.
  7383. ForceSendFields []string `json:"-"`
  7384. }
  7385. func (s *Zone) MarshalJSON() ([]byte, error) {
  7386. type noMethod Zone
  7387. raw := noMethod(*s)
  7388. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  7389. }
  7390. type ZoneMaintenanceWindows struct {
  7391. // BeginTime: [Output Only] Starting time of the maintenance window, in
  7392. // RFC3339 format.
  7393. BeginTime string `json:"beginTime,omitempty"`
  7394. // Description: [Output Only] Textual description of the maintenance
  7395. // window.
  7396. Description string `json:"description,omitempty"`
  7397. // EndTime: [Output Only] Ending time of the maintenance window, in
  7398. // RFC3339 format.
  7399. EndTime string `json:"endTime,omitempty"`
  7400. // Name: [Output Only] Name of the maintenance window.
  7401. Name string `json:"name,omitempty"`
  7402. // ForceSendFields is a list of field names (e.g. "BeginTime") to
  7403. // unconditionally include in API requests. By default, fields with
  7404. // empty values are omitted from API requests. However, any non-pointer,
  7405. // non-interface field appearing in ForceSendFields will be sent to the
  7406. // server regardless of whether the field is empty or not. This may be
  7407. // used to include empty fields in Patch requests.
  7408. ForceSendFields []string `json:"-"`
  7409. }
  7410. func (s *ZoneMaintenanceWindows) MarshalJSON() ([]byte, error) {
  7411. type noMethod ZoneMaintenanceWindows
  7412. raw := noMethod(*s)
  7413. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  7414. }
  7415. // ZoneList: Contains a list of zone resources.
  7416. type ZoneList struct {
  7417. // Id: [Output Only] Unique identifier for the resource; defined by the
  7418. // server.
  7419. Id string `json:"id,omitempty"`
  7420. // Items: [Output Only] A list of Zone resources.
  7421. Items []*Zone `json:"items,omitempty"`
  7422. // Kind: Type of resource.
  7423. Kind string `json:"kind,omitempty"`
  7424. // NextPageToken: [Output Only] This token allows you to get the next
  7425. // page of results for list requests. If the number of results is larger
  7426. // than maxResults, use the nextPageToken as a value for the query
  7427. // parameter pageToken in the next list request. Subsequent list
  7428. // requests will have their own nextPageToken to continue paging through
  7429. // the results.
  7430. NextPageToken string `json:"nextPageToken,omitempty"`
  7431. // SelfLink: [Output Only] Server-defined URL for this resource.
  7432. SelfLink string `json:"selfLink,omitempty"`
  7433. // ServerResponse contains the HTTP response code and headers from the
  7434. // server.
  7435. googleapi.ServerResponse `json:"-"`
  7436. // ForceSendFields is a list of field names (e.g. "Id") to
  7437. // unconditionally include in API requests. By default, fields with
  7438. // empty values are omitted from API requests. However, any non-pointer,
  7439. // non-interface field appearing in ForceSendFields will be sent to the
  7440. // server regardless of whether the field is empty or not. This may be
  7441. // used to include empty fields in Patch requests.
  7442. ForceSendFields []string `json:"-"`
  7443. }
  7444. func (s *ZoneList) MarshalJSON() ([]byte, error) {
  7445. type noMethod ZoneList
  7446. raw := noMethod(*s)
  7447. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  7448. }
  7449. // method id "compute.addresses.aggregatedList":
  7450. type AddressesAggregatedListCall struct {
  7451. s *Service
  7452. project string
  7453. urlParams_ gensupport.URLParams
  7454. ifNoneMatch_ string
  7455. ctx_ context.Context
  7456. }
  7457. // AggregatedList: Retrieves an aggregated list of addresses.
  7458. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/aggregatedList
  7459. func (r *AddressesService) AggregatedList(project string) *AddressesAggregatedListCall {
  7460. c := &AddressesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7461. c.project = project
  7462. return c
  7463. }
  7464. // Filter sets the optional parameter "filter": Sets a filter expression
  7465. // for filtering listed resources, in the form filter={expression}. Your
  7466. // {expression} must be in the format: field_name comparison_string
  7467. // literal_string.
  7468. //
  7469. // The field_name is the name of the field you want to compare. Only
  7470. // atomic field types are supported (string, number, boolean). The
  7471. // comparison_string must be either eq (equals) or ne (not equals). The
  7472. // literal_string is the string value to filter to. The literal value
  7473. // must be valid for the type of field you are filtering by (string,
  7474. // number, boolean). For string fields, the literal value is interpreted
  7475. // as a regular expression using RE2 syntax. The literal value must
  7476. // match the entire field.
  7477. //
  7478. // For example, filter=name ne example-instance.
  7479. //
  7480. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  7481. // you can also filter on nested fields. For example, you could filter
  7482. // on instances that have set the scheduling.automaticRestart field to
  7483. // true. In particular, use filtering on nested fields to take advantage
  7484. // of instance labels to organize and filter results based on label
  7485. // values.
  7486. //
  7487. // The Beta API also supports filtering on multiple expressions by
  7488. // providing each separate expression within parentheses. For example,
  7489. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  7490. // Multiple expressions are treated as AND expressions meaning that
  7491. // resources must match all expressions to pass the filters.
  7492. func (c *AddressesAggregatedListCall) Filter(filter string) *AddressesAggregatedListCall {
  7493. c.urlParams_.Set("filter", filter)
  7494. return c
  7495. }
  7496. // MaxResults sets the optional parameter "maxResults": The maximum
  7497. // number of results per page that Compute Engine should return. If the
  7498. // number of available results is larger than maxResults, Compute Engine
  7499. // returns a nextPageToken that can be used to get the next page of
  7500. // results in subsequent list requests.
  7501. func (c *AddressesAggregatedListCall) MaxResults(maxResults int64) *AddressesAggregatedListCall {
  7502. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  7503. return c
  7504. }
  7505. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  7506. // a certain order. By default, results are returned in alphanumerical
  7507. // order based on the resource name.
  7508. //
  7509. // You can also sort results in descending order based on the creation
  7510. // timestamp using orderBy="creationTimestamp desc". This sorts results
  7511. // based on the creationTimestamp field in reverse chronological order
  7512. // (newest result first). Use this to sort resources like operations so
  7513. // that the newest operation is returned first.
  7514. //
  7515. // Currently, only sorting by name or creationTimestamp desc is
  7516. // supported.
  7517. func (c *AddressesAggregatedListCall) OrderBy(orderBy string) *AddressesAggregatedListCall {
  7518. c.urlParams_.Set("orderBy", orderBy)
  7519. return c
  7520. }
  7521. // PageToken sets the optional parameter "pageToken": Specifies a page
  7522. // token to use. Set pageToken to the nextPageToken returned by a
  7523. // previous list request to get the next page of results.
  7524. func (c *AddressesAggregatedListCall) PageToken(pageToken string) *AddressesAggregatedListCall {
  7525. c.urlParams_.Set("pageToken", pageToken)
  7526. return c
  7527. }
  7528. // Fields allows partial responses to be retrieved. See
  7529. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7530. // for more information.
  7531. func (c *AddressesAggregatedListCall) Fields(s ...googleapi.Field) *AddressesAggregatedListCall {
  7532. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7533. return c
  7534. }
  7535. // IfNoneMatch sets the optional parameter which makes the operation
  7536. // fail if the object's ETag matches the given value. This is useful for
  7537. // getting updates only after the object has changed since the last
  7538. // request. Use googleapi.IsNotModified to check whether the response
  7539. // error from Do is the result of In-None-Match.
  7540. func (c *AddressesAggregatedListCall) IfNoneMatch(entityTag string) *AddressesAggregatedListCall {
  7541. c.ifNoneMatch_ = entityTag
  7542. return c
  7543. }
  7544. // Context sets the context to be used in this call's Do method. Any
  7545. // pending HTTP request will be aborted if the provided context is
  7546. // canceled.
  7547. func (c *AddressesAggregatedListCall) Context(ctx context.Context) *AddressesAggregatedListCall {
  7548. c.ctx_ = ctx
  7549. return c
  7550. }
  7551. func (c *AddressesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  7552. var body io.Reader = nil
  7553. c.urlParams_.Set("alt", alt)
  7554. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/addresses")
  7555. urls += "?" + c.urlParams_.Encode()
  7556. req, _ := http.NewRequest("GET", urls, body)
  7557. googleapi.Expand(req.URL, map[string]string{
  7558. "project": c.project,
  7559. })
  7560. req.Header.Set("User-Agent", c.s.userAgent())
  7561. if c.ifNoneMatch_ != "" {
  7562. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  7563. }
  7564. if c.ctx_ != nil {
  7565. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7566. }
  7567. return c.s.client.Do(req)
  7568. }
  7569. // Do executes the "compute.addresses.aggregatedList" call.
  7570. // Exactly one of *AddressAggregatedList or error will be non-nil. Any
  7571. // non-2xx status code is an error. Response headers are in either
  7572. // *AddressAggregatedList.ServerResponse.Header or (if a response was
  7573. // returned at all) in error.(*googleapi.Error).Header. Use
  7574. // googleapi.IsNotModified to check whether the returned error was
  7575. // because http.StatusNotModified was returned.
  7576. func (c *AddressesAggregatedListCall) Do(opts ...googleapi.CallOption) (*AddressAggregatedList, error) {
  7577. gensupport.SetOptions(c.urlParams_, opts...)
  7578. res, err := c.doRequest("json")
  7579. if res != nil && res.StatusCode == http.StatusNotModified {
  7580. if res.Body != nil {
  7581. res.Body.Close()
  7582. }
  7583. return nil, &googleapi.Error{
  7584. Code: res.StatusCode,
  7585. Header: res.Header,
  7586. }
  7587. }
  7588. if err != nil {
  7589. return nil, err
  7590. }
  7591. defer googleapi.CloseBody(res)
  7592. if err := googleapi.CheckResponse(res); err != nil {
  7593. return nil, err
  7594. }
  7595. ret := &AddressAggregatedList{
  7596. ServerResponse: googleapi.ServerResponse{
  7597. Header: res.Header,
  7598. HTTPStatusCode: res.StatusCode,
  7599. },
  7600. }
  7601. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7602. return nil, err
  7603. }
  7604. return ret, nil
  7605. // {
  7606. // "description": "Retrieves an aggregated list of addresses.",
  7607. // "httpMethod": "GET",
  7608. // "id": "compute.addresses.aggregatedList",
  7609. // "parameterOrder": [
  7610. // "project"
  7611. // ],
  7612. // "parameters": {
  7613. // "filter": {
  7614. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  7615. // "location": "query",
  7616. // "type": "string"
  7617. // },
  7618. // "maxResults": {
  7619. // "default": "500",
  7620. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  7621. // "format": "uint32",
  7622. // "location": "query",
  7623. // "maximum": "500",
  7624. // "minimum": "0",
  7625. // "type": "integer"
  7626. // },
  7627. // "orderBy": {
  7628. // "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.",
  7629. // "location": "query",
  7630. // "type": "string"
  7631. // },
  7632. // "pageToken": {
  7633. // "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.",
  7634. // "location": "query",
  7635. // "type": "string"
  7636. // },
  7637. // "project": {
  7638. // "description": "Project ID for this request.",
  7639. // "location": "path",
  7640. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  7641. // "required": true,
  7642. // "type": "string"
  7643. // }
  7644. // },
  7645. // "path": "{project}/aggregated/addresses",
  7646. // "response": {
  7647. // "$ref": "AddressAggregatedList"
  7648. // },
  7649. // "scopes": [
  7650. // "https://www.googleapis.com/auth/cloud-platform",
  7651. // "https://www.googleapis.com/auth/compute",
  7652. // "https://www.googleapis.com/auth/compute.readonly"
  7653. // ]
  7654. // }
  7655. }
  7656. // Pages invokes f for each page of results.
  7657. // A non-nil error returned from f will halt the iteration.
  7658. // The provided context supersedes any context provided to the Context method.
  7659. func (c *AddressesAggregatedListCall) Pages(ctx context.Context, f func(*AddressAggregatedList) error) error {
  7660. c.ctx_ = ctx
  7661. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  7662. for {
  7663. x, err := c.Do()
  7664. if err != nil {
  7665. return err
  7666. }
  7667. if err := f(x); err != nil {
  7668. return err
  7669. }
  7670. if x.NextPageToken == "" {
  7671. return nil
  7672. }
  7673. c.PageToken(x.NextPageToken)
  7674. }
  7675. }
  7676. // method id "compute.addresses.delete":
  7677. type AddressesDeleteCall struct {
  7678. s *Service
  7679. project string
  7680. region string
  7681. address string
  7682. urlParams_ gensupport.URLParams
  7683. ctx_ context.Context
  7684. }
  7685. // Delete: Deletes the specified address resource.
  7686. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/delete
  7687. func (r *AddressesService) Delete(project string, region string, address string) *AddressesDeleteCall {
  7688. c := &AddressesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7689. c.project = project
  7690. c.region = region
  7691. c.address = address
  7692. return c
  7693. }
  7694. // Fields allows partial responses to be retrieved. See
  7695. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7696. // for more information.
  7697. func (c *AddressesDeleteCall) Fields(s ...googleapi.Field) *AddressesDeleteCall {
  7698. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7699. return c
  7700. }
  7701. // Context sets the context to be used in this call's Do method. Any
  7702. // pending HTTP request will be aborted if the provided context is
  7703. // canceled.
  7704. func (c *AddressesDeleteCall) Context(ctx context.Context) *AddressesDeleteCall {
  7705. c.ctx_ = ctx
  7706. return c
  7707. }
  7708. func (c *AddressesDeleteCall) doRequest(alt string) (*http.Response, error) {
  7709. var body io.Reader = nil
  7710. c.urlParams_.Set("alt", alt)
  7711. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{address}")
  7712. urls += "?" + c.urlParams_.Encode()
  7713. req, _ := http.NewRequest("DELETE", urls, body)
  7714. googleapi.Expand(req.URL, map[string]string{
  7715. "project": c.project,
  7716. "region": c.region,
  7717. "address": c.address,
  7718. })
  7719. req.Header.Set("User-Agent", c.s.userAgent())
  7720. if c.ctx_ != nil {
  7721. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7722. }
  7723. return c.s.client.Do(req)
  7724. }
  7725. // Do executes the "compute.addresses.delete" call.
  7726. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  7727. // status code is an error. Response headers are in either
  7728. // *Operation.ServerResponse.Header or (if a response was returned at
  7729. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7730. // to check whether the returned error was because
  7731. // http.StatusNotModified was returned.
  7732. func (c *AddressesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  7733. gensupport.SetOptions(c.urlParams_, opts...)
  7734. res, err := c.doRequest("json")
  7735. if res != nil && res.StatusCode == http.StatusNotModified {
  7736. if res.Body != nil {
  7737. res.Body.Close()
  7738. }
  7739. return nil, &googleapi.Error{
  7740. Code: res.StatusCode,
  7741. Header: res.Header,
  7742. }
  7743. }
  7744. if err != nil {
  7745. return nil, err
  7746. }
  7747. defer googleapi.CloseBody(res)
  7748. if err := googleapi.CheckResponse(res); err != nil {
  7749. return nil, err
  7750. }
  7751. ret := &Operation{
  7752. ServerResponse: googleapi.ServerResponse{
  7753. Header: res.Header,
  7754. HTTPStatusCode: res.StatusCode,
  7755. },
  7756. }
  7757. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7758. return nil, err
  7759. }
  7760. return ret, nil
  7761. // {
  7762. // "description": "Deletes the specified address resource.",
  7763. // "httpMethod": "DELETE",
  7764. // "id": "compute.addresses.delete",
  7765. // "parameterOrder": [
  7766. // "project",
  7767. // "region",
  7768. // "address"
  7769. // ],
  7770. // "parameters": {
  7771. // "address": {
  7772. // "description": "Name of the address resource to delete.",
  7773. // "location": "path",
  7774. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  7775. // "required": true,
  7776. // "type": "string"
  7777. // },
  7778. // "project": {
  7779. // "description": "Project ID for this request.",
  7780. // "location": "path",
  7781. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  7782. // "required": true,
  7783. // "type": "string"
  7784. // },
  7785. // "region": {
  7786. // "description": "The name of the region for this request.",
  7787. // "location": "path",
  7788. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  7789. // "required": true,
  7790. // "type": "string"
  7791. // }
  7792. // },
  7793. // "path": "{project}/regions/{region}/addresses/{address}",
  7794. // "response": {
  7795. // "$ref": "Operation"
  7796. // },
  7797. // "scopes": [
  7798. // "https://www.googleapis.com/auth/cloud-platform",
  7799. // "https://www.googleapis.com/auth/compute"
  7800. // ]
  7801. // }
  7802. }
  7803. // method id "compute.addresses.get":
  7804. type AddressesGetCall struct {
  7805. s *Service
  7806. project string
  7807. region string
  7808. address string
  7809. urlParams_ gensupport.URLParams
  7810. ifNoneMatch_ string
  7811. ctx_ context.Context
  7812. }
  7813. // Get: Returns the specified address resource.
  7814. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/get
  7815. func (r *AddressesService) Get(project string, region string, address string) *AddressesGetCall {
  7816. c := &AddressesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7817. c.project = project
  7818. c.region = region
  7819. c.address = address
  7820. return c
  7821. }
  7822. // Fields allows partial responses to be retrieved. See
  7823. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7824. // for more information.
  7825. func (c *AddressesGetCall) Fields(s ...googleapi.Field) *AddressesGetCall {
  7826. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7827. return c
  7828. }
  7829. // IfNoneMatch sets the optional parameter which makes the operation
  7830. // fail if the object's ETag matches the given value. This is useful for
  7831. // getting updates only after the object has changed since the last
  7832. // request. Use googleapi.IsNotModified to check whether the response
  7833. // error from Do is the result of In-None-Match.
  7834. func (c *AddressesGetCall) IfNoneMatch(entityTag string) *AddressesGetCall {
  7835. c.ifNoneMatch_ = entityTag
  7836. return c
  7837. }
  7838. // Context sets the context to be used in this call's Do method. Any
  7839. // pending HTTP request will be aborted if the provided context is
  7840. // canceled.
  7841. func (c *AddressesGetCall) Context(ctx context.Context) *AddressesGetCall {
  7842. c.ctx_ = ctx
  7843. return c
  7844. }
  7845. func (c *AddressesGetCall) doRequest(alt string) (*http.Response, error) {
  7846. var body io.Reader = nil
  7847. c.urlParams_.Set("alt", alt)
  7848. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{address}")
  7849. urls += "?" + c.urlParams_.Encode()
  7850. req, _ := http.NewRequest("GET", urls, body)
  7851. googleapi.Expand(req.URL, map[string]string{
  7852. "project": c.project,
  7853. "region": c.region,
  7854. "address": c.address,
  7855. })
  7856. req.Header.Set("User-Agent", c.s.userAgent())
  7857. if c.ifNoneMatch_ != "" {
  7858. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  7859. }
  7860. if c.ctx_ != nil {
  7861. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7862. }
  7863. return c.s.client.Do(req)
  7864. }
  7865. // Do executes the "compute.addresses.get" call.
  7866. // Exactly one of *Address or error will be non-nil. Any non-2xx status
  7867. // code is an error. Response headers are in either
  7868. // *Address.ServerResponse.Header or (if a response was returned at all)
  7869. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7870. // check whether the returned error was because http.StatusNotModified
  7871. // was returned.
  7872. func (c *AddressesGetCall) Do(opts ...googleapi.CallOption) (*Address, error) {
  7873. gensupport.SetOptions(c.urlParams_, opts...)
  7874. res, err := c.doRequest("json")
  7875. if res != nil && res.StatusCode == http.StatusNotModified {
  7876. if res.Body != nil {
  7877. res.Body.Close()
  7878. }
  7879. return nil, &googleapi.Error{
  7880. Code: res.StatusCode,
  7881. Header: res.Header,
  7882. }
  7883. }
  7884. if err != nil {
  7885. return nil, err
  7886. }
  7887. defer googleapi.CloseBody(res)
  7888. if err := googleapi.CheckResponse(res); err != nil {
  7889. return nil, err
  7890. }
  7891. ret := &Address{
  7892. ServerResponse: googleapi.ServerResponse{
  7893. Header: res.Header,
  7894. HTTPStatusCode: res.StatusCode,
  7895. },
  7896. }
  7897. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7898. return nil, err
  7899. }
  7900. return ret, nil
  7901. // {
  7902. // "description": "Returns the specified address resource.",
  7903. // "httpMethod": "GET",
  7904. // "id": "compute.addresses.get",
  7905. // "parameterOrder": [
  7906. // "project",
  7907. // "region",
  7908. // "address"
  7909. // ],
  7910. // "parameters": {
  7911. // "address": {
  7912. // "description": "Name of the address resource to return.",
  7913. // "location": "path",
  7914. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  7915. // "required": true,
  7916. // "type": "string"
  7917. // },
  7918. // "project": {
  7919. // "description": "Project ID for this request.",
  7920. // "location": "path",
  7921. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  7922. // "required": true,
  7923. // "type": "string"
  7924. // },
  7925. // "region": {
  7926. // "description": "The name of the region for this request.",
  7927. // "location": "path",
  7928. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  7929. // "required": true,
  7930. // "type": "string"
  7931. // }
  7932. // },
  7933. // "path": "{project}/regions/{region}/addresses/{address}",
  7934. // "response": {
  7935. // "$ref": "Address"
  7936. // },
  7937. // "scopes": [
  7938. // "https://www.googleapis.com/auth/cloud-platform",
  7939. // "https://www.googleapis.com/auth/compute",
  7940. // "https://www.googleapis.com/auth/compute.readonly"
  7941. // ]
  7942. // }
  7943. }
  7944. // method id "compute.addresses.insert":
  7945. type AddressesInsertCall struct {
  7946. s *Service
  7947. project string
  7948. region string
  7949. address *Address
  7950. urlParams_ gensupport.URLParams
  7951. ctx_ context.Context
  7952. }
  7953. // Insert: Creates an address resource in the specified project using
  7954. // the data included in the request.
  7955. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/insert
  7956. func (r *AddressesService) Insert(project string, region string, address *Address) *AddressesInsertCall {
  7957. c := &AddressesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7958. c.project = project
  7959. c.region = region
  7960. c.address = address
  7961. return c
  7962. }
  7963. // Fields allows partial responses to be retrieved. See
  7964. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7965. // for more information.
  7966. func (c *AddressesInsertCall) Fields(s ...googleapi.Field) *AddressesInsertCall {
  7967. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7968. return c
  7969. }
  7970. // Context sets the context to be used in this call's Do method. Any
  7971. // pending HTTP request will be aborted if the provided context is
  7972. // canceled.
  7973. func (c *AddressesInsertCall) Context(ctx context.Context) *AddressesInsertCall {
  7974. c.ctx_ = ctx
  7975. return c
  7976. }
  7977. func (c *AddressesInsertCall) doRequest(alt string) (*http.Response, error) {
  7978. var body io.Reader = nil
  7979. body, err := googleapi.WithoutDataWrapper.JSONReader(c.address)
  7980. if err != nil {
  7981. return nil, err
  7982. }
  7983. ctype := "application/json"
  7984. c.urlParams_.Set("alt", alt)
  7985. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses")
  7986. urls += "?" + c.urlParams_.Encode()
  7987. req, _ := http.NewRequest("POST", urls, body)
  7988. googleapi.Expand(req.URL, map[string]string{
  7989. "project": c.project,
  7990. "region": c.region,
  7991. })
  7992. req.Header.Set("Content-Type", ctype)
  7993. req.Header.Set("User-Agent", c.s.userAgent())
  7994. if c.ctx_ != nil {
  7995. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7996. }
  7997. return c.s.client.Do(req)
  7998. }
  7999. // Do executes the "compute.addresses.insert" call.
  8000. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  8001. // status code is an error. Response headers are in either
  8002. // *Operation.ServerResponse.Header or (if a response was returned at
  8003. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8004. // to check whether the returned error was because
  8005. // http.StatusNotModified was returned.
  8006. func (c *AddressesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  8007. gensupport.SetOptions(c.urlParams_, opts...)
  8008. res, err := c.doRequest("json")
  8009. if res != nil && res.StatusCode == http.StatusNotModified {
  8010. if res.Body != nil {
  8011. res.Body.Close()
  8012. }
  8013. return nil, &googleapi.Error{
  8014. Code: res.StatusCode,
  8015. Header: res.Header,
  8016. }
  8017. }
  8018. if err != nil {
  8019. return nil, err
  8020. }
  8021. defer googleapi.CloseBody(res)
  8022. if err := googleapi.CheckResponse(res); err != nil {
  8023. return nil, err
  8024. }
  8025. ret := &Operation{
  8026. ServerResponse: googleapi.ServerResponse{
  8027. Header: res.Header,
  8028. HTTPStatusCode: res.StatusCode,
  8029. },
  8030. }
  8031. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8032. return nil, err
  8033. }
  8034. return ret, nil
  8035. // {
  8036. // "description": "Creates an address resource in the specified project using the data included in the request.",
  8037. // "httpMethod": "POST",
  8038. // "id": "compute.addresses.insert",
  8039. // "parameterOrder": [
  8040. // "project",
  8041. // "region"
  8042. // ],
  8043. // "parameters": {
  8044. // "project": {
  8045. // "description": "Project ID for this request.",
  8046. // "location": "path",
  8047. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  8048. // "required": true,
  8049. // "type": "string"
  8050. // },
  8051. // "region": {
  8052. // "description": "The name of the region for this request.",
  8053. // "location": "path",
  8054. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  8055. // "required": true,
  8056. // "type": "string"
  8057. // }
  8058. // },
  8059. // "path": "{project}/regions/{region}/addresses",
  8060. // "request": {
  8061. // "$ref": "Address"
  8062. // },
  8063. // "response": {
  8064. // "$ref": "Operation"
  8065. // },
  8066. // "scopes": [
  8067. // "https://www.googleapis.com/auth/cloud-platform",
  8068. // "https://www.googleapis.com/auth/compute"
  8069. // ]
  8070. // }
  8071. }
  8072. // method id "compute.addresses.list":
  8073. type AddressesListCall struct {
  8074. s *Service
  8075. project string
  8076. region string
  8077. urlParams_ gensupport.URLParams
  8078. ifNoneMatch_ string
  8079. ctx_ context.Context
  8080. }
  8081. // List: Retrieves a list of address resources contained within the
  8082. // specified region.
  8083. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/list
  8084. func (r *AddressesService) List(project string, region string) *AddressesListCall {
  8085. c := &AddressesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8086. c.project = project
  8087. c.region = region
  8088. return c
  8089. }
  8090. // Filter sets the optional parameter "filter": Sets a filter expression
  8091. // for filtering listed resources, in the form filter={expression}. Your
  8092. // {expression} must be in the format: field_name comparison_string
  8093. // literal_string.
  8094. //
  8095. // The field_name is the name of the field you want to compare. Only
  8096. // atomic field types are supported (string, number, boolean). The
  8097. // comparison_string must be either eq (equals) or ne (not equals). The
  8098. // literal_string is the string value to filter to. The literal value
  8099. // must be valid for the type of field you are filtering by (string,
  8100. // number, boolean). For string fields, the literal value is interpreted
  8101. // as a regular expression using RE2 syntax. The literal value must
  8102. // match the entire field.
  8103. //
  8104. // For example, filter=name ne example-instance.
  8105. //
  8106. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  8107. // you can also filter on nested fields. For example, you could filter
  8108. // on instances that have set the scheduling.automaticRestart field to
  8109. // true. In particular, use filtering on nested fields to take advantage
  8110. // of instance labels to organize and filter results based on label
  8111. // values.
  8112. //
  8113. // The Beta API also supports filtering on multiple expressions by
  8114. // providing each separate expression within parentheses. For example,
  8115. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  8116. // Multiple expressions are treated as AND expressions meaning that
  8117. // resources must match all expressions to pass the filters.
  8118. func (c *AddressesListCall) Filter(filter string) *AddressesListCall {
  8119. c.urlParams_.Set("filter", filter)
  8120. return c
  8121. }
  8122. // MaxResults sets the optional parameter "maxResults": The maximum
  8123. // number of results per page that Compute Engine should return. If the
  8124. // number of available results is larger than maxResults, Compute Engine
  8125. // returns a nextPageToken that can be used to get the next page of
  8126. // results in subsequent list requests.
  8127. func (c *AddressesListCall) MaxResults(maxResults int64) *AddressesListCall {
  8128. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  8129. return c
  8130. }
  8131. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  8132. // a certain order. By default, results are returned in alphanumerical
  8133. // order based on the resource name.
  8134. //
  8135. // You can also sort results in descending order based on the creation
  8136. // timestamp using orderBy="creationTimestamp desc". This sorts results
  8137. // based on the creationTimestamp field in reverse chronological order
  8138. // (newest result first). Use this to sort resources like operations so
  8139. // that the newest operation is returned first.
  8140. //
  8141. // Currently, only sorting by name or creationTimestamp desc is
  8142. // supported.
  8143. func (c *AddressesListCall) OrderBy(orderBy string) *AddressesListCall {
  8144. c.urlParams_.Set("orderBy", orderBy)
  8145. return c
  8146. }
  8147. // PageToken sets the optional parameter "pageToken": Specifies a page
  8148. // token to use. Set pageToken to the nextPageToken returned by a
  8149. // previous list request to get the next page of results.
  8150. func (c *AddressesListCall) PageToken(pageToken string) *AddressesListCall {
  8151. c.urlParams_.Set("pageToken", pageToken)
  8152. return c
  8153. }
  8154. // Fields allows partial responses to be retrieved. See
  8155. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8156. // for more information.
  8157. func (c *AddressesListCall) Fields(s ...googleapi.Field) *AddressesListCall {
  8158. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8159. return c
  8160. }
  8161. // IfNoneMatch sets the optional parameter which makes the operation
  8162. // fail if the object's ETag matches the given value. This is useful for
  8163. // getting updates only after the object has changed since the last
  8164. // request. Use googleapi.IsNotModified to check whether the response
  8165. // error from Do is the result of In-None-Match.
  8166. func (c *AddressesListCall) IfNoneMatch(entityTag string) *AddressesListCall {
  8167. c.ifNoneMatch_ = entityTag
  8168. return c
  8169. }
  8170. // Context sets the context to be used in this call's Do method. Any
  8171. // pending HTTP request will be aborted if the provided context is
  8172. // canceled.
  8173. func (c *AddressesListCall) Context(ctx context.Context) *AddressesListCall {
  8174. c.ctx_ = ctx
  8175. return c
  8176. }
  8177. func (c *AddressesListCall) doRequest(alt string) (*http.Response, error) {
  8178. var body io.Reader = nil
  8179. c.urlParams_.Set("alt", alt)
  8180. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses")
  8181. urls += "?" + c.urlParams_.Encode()
  8182. req, _ := http.NewRequest("GET", urls, body)
  8183. googleapi.Expand(req.URL, map[string]string{
  8184. "project": c.project,
  8185. "region": c.region,
  8186. })
  8187. req.Header.Set("User-Agent", c.s.userAgent())
  8188. if c.ifNoneMatch_ != "" {
  8189. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  8190. }
  8191. if c.ctx_ != nil {
  8192. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8193. }
  8194. return c.s.client.Do(req)
  8195. }
  8196. // Do executes the "compute.addresses.list" call.
  8197. // Exactly one of *AddressList or error will be non-nil. Any non-2xx
  8198. // status code is an error. Response headers are in either
  8199. // *AddressList.ServerResponse.Header or (if a response was returned at
  8200. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8201. // to check whether the returned error was because
  8202. // http.StatusNotModified was returned.
  8203. func (c *AddressesListCall) Do(opts ...googleapi.CallOption) (*AddressList, error) {
  8204. gensupport.SetOptions(c.urlParams_, opts...)
  8205. res, err := c.doRequest("json")
  8206. if res != nil && res.StatusCode == http.StatusNotModified {
  8207. if res.Body != nil {
  8208. res.Body.Close()
  8209. }
  8210. return nil, &googleapi.Error{
  8211. Code: res.StatusCode,
  8212. Header: res.Header,
  8213. }
  8214. }
  8215. if err != nil {
  8216. return nil, err
  8217. }
  8218. defer googleapi.CloseBody(res)
  8219. if err := googleapi.CheckResponse(res); err != nil {
  8220. return nil, err
  8221. }
  8222. ret := &AddressList{
  8223. ServerResponse: googleapi.ServerResponse{
  8224. Header: res.Header,
  8225. HTTPStatusCode: res.StatusCode,
  8226. },
  8227. }
  8228. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8229. return nil, err
  8230. }
  8231. return ret, nil
  8232. // {
  8233. // "description": "Retrieves a list of address resources contained within the specified region.",
  8234. // "httpMethod": "GET",
  8235. // "id": "compute.addresses.list",
  8236. // "parameterOrder": [
  8237. // "project",
  8238. // "region"
  8239. // ],
  8240. // "parameters": {
  8241. // "filter": {
  8242. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  8243. // "location": "query",
  8244. // "type": "string"
  8245. // },
  8246. // "maxResults": {
  8247. // "default": "500",
  8248. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  8249. // "format": "uint32",
  8250. // "location": "query",
  8251. // "maximum": "500",
  8252. // "minimum": "0",
  8253. // "type": "integer"
  8254. // },
  8255. // "orderBy": {
  8256. // "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.",
  8257. // "location": "query",
  8258. // "type": "string"
  8259. // },
  8260. // "pageToken": {
  8261. // "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.",
  8262. // "location": "query",
  8263. // "type": "string"
  8264. // },
  8265. // "project": {
  8266. // "description": "Project ID for this request.",
  8267. // "location": "path",
  8268. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  8269. // "required": true,
  8270. // "type": "string"
  8271. // },
  8272. // "region": {
  8273. // "description": "The name of the region for this request.",
  8274. // "location": "path",
  8275. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  8276. // "required": true,
  8277. // "type": "string"
  8278. // }
  8279. // },
  8280. // "path": "{project}/regions/{region}/addresses",
  8281. // "response": {
  8282. // "$ref": "AddressList"
  8283. // },
  8284. // "scopes": [
  8285. // "https://www.googleapis.com/auth/cloud-platform",
  8286. // "https://www.googleapis.com/auth/compute",
  8287. // "https://www.googleapis.com/auth/compute.readonly"
  8288. // ]
  8289. // }
  8290. }
  8291. // Pages invokes f for each page of results.
  8292. // A non-nil error returned from f will halt the iteration.
  8293. // The provided context supersedes any context provided to the Context method.
  8294. func (c *AddressesListCall) Pages(ctx context.Context, f func(*AddressList) error) error {
  8295. c.ctx_ = ctx
  8296. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  8297. for {
  8298. x, err := c.Do()
  8299. if err != nil {
  8300. return err
  8301. }
  8302. if err := f(x); err != nil {
  8303. return err
  8304. }
  8305. if x.NextPageToken == "" {
  8306. return nil
  8307. }
  8308. c.PageToken(x.NextPageToken)
  8309. }
  8310. }
  8311. // method id "compute.autoscalers.aggregatedList":
  8312. type AutoscalersAggregatedListCall struct {
  8313. s *Service
  8314. project string
  8315. urlParams_ gensupport.URLParams
  8316. ifNoneMatch_ string
  8317. ctx_ context.Context
  8318. }
  8319. // AggregatedList: Retrieves an aggregated list of autoscalers.
  8320. func (r *AutoscalersService) AggregatedList(project string) *AutoscalersAggregatedListCall {
  8321. c := &AutoscalersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8322. c.project = project
  8323. return c
  8324. }
  8325. // Filter sets the optional parameter "filter": Sets a filter expression
  8326. // for filtering listed resources, in the form filter={expression}. Your
  8327. // {expression} must be in the format: field_name comparison_string
  8328. // literal_string.
  8329. //
  8330. // The field_name is the name of the field you want to compare. Only
  8331. // atomic field types are supported (string, number, boolean). The
  8332. // comparison_string must be either eq (equals) or ne (not equals). The
  8333. // literal_string is the string value to filter to. The literal value
  8334. // must be valid for the type of field you are filtering by (string,
  8335. // number, boolean). For string fields, the literal value is interpreted
  8336. // as a regular expression using RE2 syntax. The literal value must
  8337. // match the entire field.
  8338. //
  8339. // For example, filter=name ne example-instance.
  8340. //
  8341. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  8342. // you can also filter on nested fields. For example, you could filter
  8343. // on instances that have set the scheduling.automaticRestart field to
  8344. // true. In particular, use filtering on nested fields to take advantage
  8345. // of instance labels to organize and filter results based on label
  8346. // values.
  8347. //
  8348. // The Beta API also supports filtering on multiple expressions by
  8349. // providing each separate expression within parentheses. For example,
  8350. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  8351. // Multiple expressions are treated as AND expressions meaning that
  8352. // resources must match all expressions to pass the filters.
  8353. func (c *AutoscalersAggregatedListCall) Filter(filter string) *AutoscalersAggregatedListCall {
  8354. c.urlParams_.Set("filter", filter)
  8355. return c
  8356. }
  8357. // MaxResults sets the optional parameter "maxResults": The maximum
  8358. // number of results per page that Compute Engine should return. If the
  8359. // number of available results is larger than maxResults, Compute Engine
  8360. // returns a nextPageToken that can be used to get the next page of
  8361. // results in subsequent list requests.
  8362. func (c *AutoscalersAggregatedListCall) MaxResults(maxResults int64) *AutoscalersAggregatedListCall {
  8363. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  8364. return c
  8365. }
  8366. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  8367. // a certain order. By default, results are returned in alphanumerical
  8368. // order based on the resource name.
  8369. //
  8370. // You can also sort results in descending order based on the creation
  8371. // timestamp using orderBy="creationTimestamp desc". This sorts results
  8372. // based on the creationTimestamp field in reverse chronological order
  8373. // (newest result first). Use this to sort resources like operations so
  8374. // that the newest operation is returned first.
  8375. //
  8376. // Currently, only sorting by name or creationTimestamp desc is
  8377. // supported.
  8378. func (c *AutoscalersAggregatedListCall) OrderBy(orderBy string) *AutoscalersAggregatedListCall {
  8379. c.urlParams_.Set("orderBy", orderBy)
  8380. return c
  8381. }
  8382. // PageToken sets the optional parameter "pageToken": Specifies a page
  8383. // token to use. Set pageToken to the nextPageToken returned by a
  8384. // previous list request to get the next page of results.
  8385. func (c *AutoscalersAggregatedListCall) PageToken(pageToken string) *AutoscalersAggregatedListCall {
  8386. c.urlParams_.Set("pageToken", pageToken)
  8387. return c
  8388. }
  8389. // Fields allows partial responses to be retrieved. See
  8390. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8391. // for more information.
  8392. func (c *AutoscalersAggregatedListCall) Fields(s ...googleapi.Field) *AutoscalersAggregatedListCall {
  8393. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8394. return c
  8395. }
  8396. // IfNoneMatch sets the optional parameter which makes the operation
  8397. // fail if the object's ETag matches the given value. This is useful for
  8398. // getting updates only after the object has changed since the last
  8399. // request. Use googleapi.IsNotModified to check whether the response
  8400. // error from Do is the result of In-None-Match.
  8401. func (c *AutoscalersAggregatedListCall) IfNoneMatch(entityTag string) *AutoscalersAggregatedListCall {
  8402. c.ifNoneMatch_ = entityTag
  8403. return c
  8404. }
  8405. // Context sets the context to be used in this call's Do method. Any
  8406. // pending HTTP request will be aborted if the provided context is
  8407. // canceled.
  8408. func (c *AutoscalersAggregatedListCall) Context(ctx context.Context) *AutoscalersAggregatedListCall {
  8409. c.ctx_ = ctx
  8410. return c
  8411. }
  8412. func (c *AutoscalersAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  8413. var body io.Reader = nil
  8414. c.urlParams_.Set("alt", alt)
  8415. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/autoscalers")
  8416. urls += "?" + c.urlParams_.Encode()
  8417. req, _ := http.NewRequest("GET", urls, body)
  8418. googleapi.Expand(req.URL, map[string]string{
  8419. "project": c.project,
  8420. })
  8421. req.Header.Set("User-Agent", c.s.userAgent())
  8422. if c.ifNoneMatch_ != "" {
  8423. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  8424. }
  8425. if c.ctx_ != nil {
  8426. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8427. }
  8428. return c.s.client.Do(req)
  8429. }
  8430. // Do executes the "compute.autoscalers.aggregatedList" call.
  8431. // Exactly one of *AutoscalerAggregatedList or error will be non-nil.
  8432. // Any non-2xx status code is an error. Response headers are in either
  8433. // *AutoscalerAggregatedList.ServerResponse.Header or (if a response was
  8434. // returned at all) in error.(*googleapi.Error).Header. Use
  8435. // googleapi.IsNotModified to check whether the returned error was
  8436. // because http.StatusNotModified was returned.
  8437. func (c *AutoscalersAggregatedListCall) Do(opts ...googleapi.CallOption) (*AutoscalerAggregatedList, error) {
  8438. gensupport.SetOptions(c.urlParams_, opts...)
  8439. res, err := c.doRequest("json")
  8440. if res != nil && res.StatusCode == http.StatusNotModified {
  8441. if res.Body != nil {
  8442. res.Body.Close()
  8443. }
  8444. return nil, &googleapi.Error{
  8445. Code: res.StatusCode,
  8446. Header: res.Header,
  8447. }
  8448. }
  8449. if err != nil {
  8450. return nil, err
  8451. }
  8452. defer googleapi.CloseBody(res)
  8453. if err := googleapi.CheckResponse(res); err != nil {
  8454. return nil, err
  8455. }
  8456. ret := &AutoscalerAggregatedList{
  8457. ServerResponse: googleapi.ServerResponse{
  8458. Header: res.Header,
  8459. HTTPStatusCode: res.StatusCode,
  8460. },
  8461. }
  8462. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8463. return nil, err
  8464. }
  8465. return ret, nil
  8466. // {
  8467. // "description": "Retrieves an aggregated list of autoscalers.",
  8468. // "httpMethod": "GET",
  8469. // "id": "compute.autoscalers.aggregatedList",
  8470. // "parameterOrder": [
  8471. // "project"
  8472. // ],
  8473. // "parameters": {
  8474. // "filter": {
  8475. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  8476. // "location": "query",
  8477. // "type": "string"
  8478. // },
  8479. // "maxResults": {
  8480. // "default": "500",
  8481. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  8482. // "format": "uint32",
  8483. // "location": "query",
  8484. // "maximum": "500",
  8485. // "minimum": "0",
  8486. // "type": "integer"
  8487. // },
  8488. // "orderBy": {
  8489. // "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.",
  8490. // "location": "query",
  8491. // "type": "string"
  8492. // },
  8493. // "pageToken": {
  8494. // "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.",
  8495. // "location": "query",
  8496. // "type": "string"
  8497. // },
  8498. // "project": {
  8499. // "description": "Project ID for this request.",
  8500. // "location": "path",
  8501. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  8502. // "required": true,
  8503. // "type": "string"
  8504. // }
  8505. // },
  8506. // "path": "{project}/aggregated/autoscalers",
  8507. // "response": {
  8508. // "$ref": "AutoscalerAggregatedList"
  8509. // },
  8510. // "scopes": [
  8511. // "https://www.googleapis.com/auth/cloud-platform",
  8512. // "https://www.googleapis.com/auth/compute",
  8513. // "https://www.googleapis.com/auth/compute.readonly"
  8514. // ]
  8515. // }
  8516. }
  8517. // Pages invokes f for each page of results.
  8518. // A non-nil error returned from f will halt the iteration.
  8519. // The provided context supersedes any context provided to the Context method.
  8520. func (c *AutoscalersAggregatedListCall) Pages(ctx context.Context, f func(*AutoscalerAggregatedList) error) error {
  8521. c.ctx_ = ctx
  8522. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  8523. for {
  8524. x, err := c.Do()
  8525. if err != nil {
  8526. return err
  8527. }
  8528. if err := f(x); err != nil {
  8529. return err
  8530. }
  8531. if x.NextPageToken == "" {
  8532. return nil
  8533. }
  8534. c.PageToken(x.NextPageToken)
  8535. }
  8536. }
  8537. // method id "compute.autoscalers.delete":
  8538. type AutoscalersDeleteCall struct {
  8539. s *Service
  8540. project string
  8541. zone string
  8542. autoscaler string
  8543. urlParams_ gensupport.URLParams
  8544. ctx_ context.Context
  8545. }
  8546. // Delete: Deletes the specified autoscaler resource.
  8547. func (r *AutoscalersService) Delete(project string, zone string, autoscaler string) *AutoscalersDeleteCall {
  8548. c := &AutoscalersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8549. c.project = project
  8550. c.zone = zone
  8551. c.autoscaler = autoscaler
  8552. return c
  8553. }
  8554. // Fields allows partial responses to be retrieved. See
  8555. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8556. // for more information.
  8557. func (c *AutoscalersDeleteCall) Fields(s ...googleapi.Field) *AutoscalersDeleteCall {
  8558. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8559. return c
  8560. }
  8561. // Context sets the context to be used in this call's Do method. Any
  8562. // pending HTTP request will be aborted if the provided context is
  8563. // canceled.
  8564. func (c *AutoscalersDeleteCall) Context(ctx context.Context) *AutoscalersDeleteCall {
  8565. c.ctx_ = ctx
  8566. return c
  8567. }
  8568. func (c *AutoscalersDeleteCall) doRequest(alt string) (*http.Response, error) {
  8569. var body io.Reader = nil
  8570. c.urlParams_.Set("alt", alt)
  8571. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers/{autoscaler}")
  8572. urls += "?" + c.urlParams_.Encode()
  8573. req, _ := http.NewRequest("DELETE", urls, body)
  8574. googleapi.Expand(req.URL, map[string]string{
  8575. "project": c.project,
  8576. "zone": c.zone,
  8577. "autoscaler": c.autoscaler,
  8578. })
  8579. req.Header.Set("User-Agent", c.s.userAgent())
  8580. if c.ctx_ != nil {
  8581. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8582. }
  8583. return c.s.client.Do(req)
  8584. }
  8585. // Do executes the "compute.autoscalers.delete" call.
  8586. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  8587. // status code is an error. Response headers are in either
  8588. // *Operation.ServerResponse.Header or (if a response was returned at
  8589. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8590. // to check whether the returned error was because
  8591. // http.StatusNotModified was returned.
  8592. func (c *AutoscalersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  8593. gensupport.SetOptions(c.urlParams_, opts...)
  8594. res, err := c.doRequest("json")
  8595. if res != nil && res.StatusCode == http.StatusNotModified {
  8596. if res.Body != nil {
  8597. res.Body.Close()
  8598. }
  8599. return nil, &googleapi.Error{
  8600. Code: res.StatusCode,
  8601. Header: res.Header,
  8602. }
  8603. }
  8604. if err != nil {
  8605. return nil, err
  8606. }
  8607. defer googleapi.CloseBody(res)
  8608. if err := googleapi.CheckResponse(res); err != nil {
  8609. return nil, err
  8610. }
  8611. ret := &Operation{
  8612. ServerResponse: googleapi.ServerResponse{
  8613. Header: res.Header,
  8614. HTTPStatusCode: res.StatusCode,
  8615. },
  8616. }
  8617. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8618. return nil, err
  8619. }
  8620. return ret, nil
  8621. // {
  8622. // "description": "Deletes the specified autoscaler resource.",
  8623. // "httpMethod": "DELETE",
  8624. // "id": "compute.autoscalers.delete",
  8625. // "parameterOrder": [
  8626. // "project",
  8627. // "zone",
  8628. // "autoscaler"
  8629. // ],
  8630. // "parameters": {
  8631. // "autoscaler": {
  8632. // "description": "Name of the persistent autoscaler resource to delete.",
  8633. // "location": "path",
  8634. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  8635. // "required": true,
  8636. // "type": "string"
  8637. // },
  8638. // "project": {
  8639. // "description": "Project ID for this request.",
  8640. // "location": "path",
  8641. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  8642. // "required": true,
  8643. // "type": "string"
  8644. // },
  8645. // "zone": {
  8646. // "description": "Name of the zone scoping this request.",
  8647. // "location": "path",
  8648. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  8649. // "required": true,
  8650. // "type": "string"
  8651. // }
  8652. // },
  8653. // "path": "{project}/zones/{zone}/autoscalers/{autoscaler}",
  8654. // "response": {
  8655. // "$ref": "Operation"
  8656. // },
  8657. // "scopes": [
  8658. // "https://www.googleapis.com/auth/cloud-platform",
  8659. // "https://www.googleapis.com/auth/compute"
  8660. // ]
  8661. // }
  8662. }
  8663. // method id "compute.autoscalers.get":
  8664. type AutoscalersGetCall struct {
  8665. s *Service
  8666. project string
  8667. zone string
  8668. autoscaler string
  8669. urlParams_ gensupport.URLParams
  8670. ifNoneMatch_ string
  8671. ctx_ context.Context
  8672. }
  8673. // Get: Returns the specified autoscaler resource.
  8674. func (r *AutoscalersService) Get(project string, zone string, autoscaler string) *AutoscalersGetCall {
  8675. c := &AutoscalersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8676. c.project = project
  8677. c.zone = zone
  8678. c.autoscaler = autoscaler
  8679. return c
  8680. }
  8681. // Fields allows partial responses to be retrieved. See
  8682. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8683. // for more information.
  8684. func (c *AutoscalersGetCall) Fields(s ...googleapi.Field) *AutoscalersGetCall {
  8685. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8686. return c
  8687. }
  8688. // IfNoneMatch sets the optional parameter which makes the operation
  8689. // fail if the object's ETag matches the given value. This is useful for
  8690. // getting updates only after the object has changed since the last
  8691. // request. Use googleapi.IsNotModified to check whether the response
  8692. // error from Do is the result of In-None-Match.
  8693. func (c *AutoscalersGetCall) IfNoneMatch(entityTag string) *AutoscalersGetCall {
  8694. c.ifNoneMatch_ = entityTag
  8695. return c
  8696. }
  8697. // Context sets the context to be used in this call's Do method. Any
  8698. // pending HTTP request will be aborted if the provided context is
  8699. // canceled.
  8700. func (c *AutoscalersGetCall) Context(ctx context.Context) *AutoscalersGetCall {
  8701. c.ctx_ = ctx
  8702. return c
  8703. }
  8704. func (c *AutoscalersGetCall) doRequest(alt string) (*http.Response, error) {
  8705. var body io.Reader = nil
  8706. c.urlParams_.Set("alt", alt)
  8707. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers/{autoscaler}")
  8708. urls += "?" + c.urlParams_.Encode()
  8709. req, _ := http.NewRequest("GET", urls, body)
  8710. googleapi.Expand(req.URL, map[string]string{
  8711. "project": c.project,
  8712. "zone": c.zone,
  8713. "autoscaler": c.autoscaler,
  8714. })
  8715. req.Header.Set("User-Agent", c.s.userAgent())
  8716. if c.ifNoneMatch_ != "" {
  8717. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  8718. }
  8719. if c.ctx_ != nil {
  8720. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8721. }
  8722. return c.s.client.Do(req)
  8723. }
  8724. // Do executes the "compute.autoscalers.get" call.
  8725. // Exactly one of *Autoscaler or error will be non-nil. Any non-2xx
  8726. // status code is an error. Response headers are in either
  8727. // *Autoscaler.ServerResponse.Header or (if a response was returned at
  8728. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8729. // to check whether the returned error was because
  8730. // http.StatusNotModified was returned.
  8731. func (c *AutoscalersGetCall) Do(opts ...googleapi.CallOption) (*Autoscaler, error) {
  8732. gensupport.SetOptions(c.urlParams_, opts...)
  8733. res, err := c.doRequest("json")
  8734. if res != nil && res.StatusCode == http.StatusNotModified {
  8735. if res.Body != nil {
  8736. res.Body.Close()
  8737. }
  8738. return nil, &googleapi.Error{
  8739. Code: res.StatusCode,
  8740. Header: res.Header,
  8741. }
  8742. }
  8743. if err != nil {
  8744. return nil, err
  8745. }
  8746. defer googleapi.CloseBody(res)
  8747. if err := googleapi.CheckResponse(res); err != nil {
  8748. return nil, err
  8749. }
  8750. ret := &Autoscaler{
  8751. ServerResponse: googleapi.ServerResponse{
  8752. Header: res.Header,
  8753. HTTPStatusCode: res.StatusCode,
  8754. },
  8755. }
  8756. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8757. return nil, err
  8758. }
  8759. return ret, nil
  8760. // {
  8761. // "description": "Returns the specified autoscaler resource.",
  8762. // "httpMethod": "GET",
  8763. // "id": "compute.autoscalers.get",
  8764. // "parameterOrder": [
  8765. // "project",
  8766. // "zone",
  8767. // "autoscaler"
  8768. // ],
  8769. // "parameters": {
  8770. // "autoscaler": {
  8771. // "description": "Name of the persistent autoscaler resource to return.",
  8772. // "location": "path",
  8773. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  8774. // "required": true,
  8775. // "type": "string"
  8776. // },
  8777. // "project": {
  8778. // "description": "Project ID for this request.",
  8779. // "location": "path",
  8780. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  8781. // "required": true,
  8782. // "type": "string"
  8783. // },
  8784. // "zone": {
  8785. // "description": "Name of the zone scoping this request.",
  8786. // "location": "path",
  8787. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  8788. // "required": true,
  8789. // "type": "string"
  8790. // }
  8791. // },
  8792. // "path": "{project}/zones/{zone}/autoscalers/{autoscaler}",
  8793. // "response": {
  8794. // "$ref": "Autoscaler"
  8795. // },
  8796. // "scopes": [
  8797. // "https://www.googleapis.com/auth/cloud-platform",
  8798. // "https://www.googleapis.com/auth/compute",
  8799. // "https://www.googleapis.com/auth/compute.readonly"
  8800. // ]
  8801. // }
  8802. }
  8803. // method id "compute.autoscalers.insert":
  8804. type AutoscalersInsertCall struct {
  8805. s *Service
  8806. project string
  8807. zone string
  8808. autoscaler *Autoscaler
  8809. urlParams_ gensupport.URLParams
  8810. ctx_ context.Context
  8811. }
  8812. // Insert: Creates an autoscaler resource in the specified project using
  8813. // the data included in the request.
  8814. func (r *AutoscalersService) Insert(project string, zone string, autoscaler *Autoscaler) *AutoscalersInsertCall {
  8815. c := &AutoscalersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8816. c.project = project
  8817. c.zone = zone
  8818. c.autoscaler = autoscaler
  8819. return c
  8820. }
  8821. // Fields allows partial responses to be retrieved. See
  8822. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8823. // for more information.
  8824. func (c *AutoscalersInsertCall) Fields(s ...googleapi.Field) *AutoscalersInsertCall {
  8825. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8826. return c
  8827. }
  8828. // Context sets the context to be used in this call's Do method. Any
  8829. // pending HTTP request will be aborted if the provided context is
  8830. // canceled.
  8831. func (c *AutoscalersInsertCall) Context(ctx context.Context) *AutoscalersInsertCall {
  8832. c.ctx_ = ctx
  8833. return c
  8834. }
  8835. func (c *AutoscalersInsertCall) doRequest(alt string) (*http.Response, error) {
  8836. var body io.Reader = nil
  8837. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  8838. if err != nil {
  8839. return nil, err
  8840. }
  8841. ctype := "application/json"
  8842. c.urlParams_.Set("alt", alt)
  8843. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  8844. urls += "?" + c.urlParams_.Encode()
  8845. req, _ := http.NewRequest("POST", urls, body)
  8846. googleapi.Expand(req.URL, map[string]string{
  8847. "project": c.project,
  8848. "zone": c.zone,
  8849. })
  8850. req.Header.Set("Content-Type", ctype)
  8851. req.Header.Set("User-Agent", c.s.userAgent())
  8852. if c.ctx_ != nil {
  8853. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8854. }
  8855. return c.s.client.Do(req)
  8856. }
  8857. // Do executes the "compute.autoscalers.insert" call.
  8858. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  8859. // status code is an error. Response headers are in either
  8860. // *Operation.ServerResponse.Header or (if a response was returned at
  8861. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8862. // to check whether the returned error was because
  8863. // http.StatusNotModified was returned.
  8864. func (c *AutoscalersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  8865. gensupport.SetOptions(c.urlParams_, opts...)
  8866. res, err := c.doRequest("json")
  8867. if res != nil && res.StatusCode == http.StatusNotModified {
  8868. if res.Body != nil {
  8869. res.Body.Close()
  8870. }
  8871. return nil, &googleapi.Error{
  8872. Code: res.StatusCode,
  8873. Header: res.Header,
  8874. }
  8875. }
  8876. if err != nil {
  8877. return nil, err
  8878. }
  8879. defer googleapi.CloseBody(res)
  8880. if err := googleapi.CheckResponse(res); err != nil {
  8881. return nil, err
  8882. }
  8883. ret := &Operation{
  8884. ServerResponse: googleapi.ServerResponse{
  8885. Header: res.Header,
  8886. HTTPStatusCode: res.StatusCode,
  8887. },
  8888. }
  8889. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8890. return nil, err
  8891. }
  8892. return ret, nil
  8893. // {
  8894. // "description": "Creates an autoscaler resource in the specified project using the data included in the request.",
  8895. // "httpMethod": "POST",
  8896. // "id": "compute.autoscalers.insert",
  8897. // "parameterOrder": [
  8898. // "project",
  8899. // "zone"
  8900. // ],
  8901. // "parameters": {
  8902. // "project": {
  8903. // "description": "Project ID for this request.",
  8904. // "location": "path",
  8905. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  8906. // "required": true,
  8907. // "type": "string"
  8908. // },
  8909. // "zone": {
  8910. // "description": "Name of the zone scoping this request.",
  8911. // "location": "path",
  8912. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  8913. // "required": true,
  8914. // "type": "string"
  8915. // }
  8916. // },
  8917. // "path": "{project}/zones/{zone}/autoscalers",
  8918. // "request": {
  8919. // "$ref": "Autoscaler"
  8920. // },
  8921. // "response": {
  8922. // "$ref": "Operation"
  8923. // },
  8924. // "scopes": [
  8925. // "https://www.googleapis.com/auth/cloud-platform",
  8926. // "https://www.googleapis.com/auth/compute"
  8927. // ]
  8928. // }
  8929. }
  8930. // method id "compute.autoscalers.list":
  8931. type AutoscalersListCall struct {
  8932. s *Service
  8933. project string
  8934. zone string
  8935. urlParams_ gensupport.URLParams
  8936. ifNoneMatch_ string
  8937. ctx_ context.Context
  8938. }
  8939. // List: Retrieves a list of autoscaler resources contained within the
  8940. // specified zone.
  8941. func (r *AutoscalersService) List(project string, zone string) *AutoscalersListCall {
  8942. c := &AutoscalersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8943. c.project = project
  8944. c.zone = zone
  8945. return c
  8946. }
  8947. // Filter sets the optional parameter "filter": Sets a filter expression
  8948. // for filtering listed resources, in the form filter={expression}. Your
  8949. // {expression} must be in the format: field_name comparison_string
  8950. // literal_string.
  8951. //
  8952. // The field_name is the name of the field you want to compare. Only
  8953. // atomic field types are supported (string, number, boolean). The
  8954. // comparison_string must be either eq (equals) or ne (not equals). The
  8955. // literal_string is the string value to filter to. The literal value
  8956. // must be valid for the type of field you are filtering by (string,
  8957. // number, boolean). For string fields, the literal value is interpreted
  8958. // as a regular expression using RE2 syntax. The literal value must
  8959. // match the entire field.
  8960. //
  8961. // For example, filter=name ne example-instance.
  8962. //
  8963. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  8964. // you can also filter on nested fields. For example, you could filter
  8965. // on instances that have set the scheduling.automaticRestart field to
  8966. // true. In particular, use filtering on nested fields to take advantage
  8967. // of instance labels to organize and filter results based on label
  8968. // values.
  8969. //
  8970. // The Beta API also supports filtering on multiple expressions by
  8971. // providing each separate expression within parentheses. For example,
  8972. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  8973. // Multiple expressions are treated as AND expressions meaning that
  8974. // resources must match all expressions to pass the filters.
  8975. func (c *AutoscalersListCall) Filter(filter string) *AutoscalersListCall {
  8976. c.urlParams_.Set("filter", filter)
  8977. return c
  8978. }
  8979. // MaxResults sets the optional parameter "maxResults": The maximum
  8980. // number of results per page that Compute Engine should return. If the
  8981. // number of available results is larger than maxResults, Compute Engine
  8982. // returns a nextPageToken that can be used to get the next page of
  8983. // results in subsequent list requests.
  8984. func (c *AutoscalersListCall) MaxResults(maxResults int64) *AutoscalersListCall {
  8985. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  8986. return c
  8987. }
  8988. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  8989. // a certain order. By default, results are returned in alphanumerical
  8990. // order based on the resource name.
  8991. //
  8992. // You can also sort results in descending order based on the creation
  8993. // timestamp using orderBy="creationTimestamp desc". This sorts results
  8994. // based on the creationTimestamp field in reverse chronological order
  8995. // (newest result first). Use this to sort resources like operations so
  8996. // that the newest operation is returned first.
  8997. //
  8998. // Currently, only sorting by name or creationTimestamp desc is
  8999. // supported.
  9000. func (c *AutoscalersListCall) OrderBy(orderBy string) *AutoscalersListCall {
  9001. c.urlParams_.Set("orderBy", orderBy)
  9002. return c
  9003. }
  9004. // PageToken sets the optional parameter "pageToken": Specifies a page
  9005. // token to use. Set pageToken to the nextPageToken returned by a
  9006. // previous list request to get the next page of results.
  9007. func (c *AutoscalersListCall) PageToken(pageToken string) *AutoscalersListCall {
  9008. c.urlParams_.Set("pageToken", pageToken)
  9009. return c
  9010. }
  9011. // Fields allows partial responses to be retrieved. See
  9012. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9013. // for more information.
  9014. func (c *AutoscalersListCall) Fields(s ...googleapi.Field) *AutoscalersListCall {
  9015. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9016. return c
  9017. }
  9018. // IfNoneMatch sets the optional parameter which makes the operation
  9019. // fail if the object's ETag matches the given value. This is useful for
  9020. // getting updates only after the object has changed since the last
  9021. // request. Use googleapi.IsNotModified to check whether the response
  9022. // error from Do is the result of In-None-Match.
  9023. func (c *AutoscalersListCall) IfNoneMatch(entityTag string) *AutoscalersListCall {
  9024. c.ifNoneMatch_ = entityTag
  9025. return c
  9026. }
  9027. // Context sets the context to be used in this call's Do method. Any
  9028. // pending HTTP request will be aborted if the provided context is
  9029. // canceled.
  9030. func (c *AutoscalersListCall) Context(ctx context.Context) *AutoscalersListCall {
  9031. c.ctx_ = ctx
  9032. return c
  9033. }
  9034. func (c *AutoscalersListCall) doRequest(alt string) (*http.Response, error) {
  9035. var body io.Reader = nil
  9036. c.urlParams_.Set("alt", alt)
  9037. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  9038. urls += "?" + c.urlParams_.Encode()
  9039. req, _ := http.NewRequest("GET", urls, body)
  9040. googleapi.Expand(req.URL, map[string]string{
  9041. "project": c.project,
  9042. "zone": c.zone,
  9043. })
  9044. req.Header.Set("User-Agent", c.s.userAgent())
  9045. if c.ifNoneMatch_ != "" {
  9046. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  9047. }
  9048. if c.ctx_ != nil {
  9049. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9050. }
  9051. return c.s.client.Do(req)
  9052. }
  9053. // Do executes the "compute.autoscalers.list" call.
  9054. // Exactly one of *AutoscalerList or error will be non-nil. Any non-2xx
  9055. // status code is an error. Response headers are in either
  9056. // *AutoscalerList.ServerResponse.Header or (if a response was returned
  9057. // at all) in error.(*googleapi.Error).Header. Use
  9058. // googleapi.IsNotModified to check whether the returned error was
  9059. // because http.StatusNotModified was returned.
  9060. func (c *AutoscalersListCall) Do(opts ...googleapi.CallOption) (*AutoscalerList, error) {
  9061. gensupport.SetOptions(c.urlParams_, opts...)
  9062. res, err := c.doRequest("json")
  9063. if res != nil && res.StatusCode == http.StatusNotModified {
  9064. if res.Body != nil {
  9065. res.Body.Close()
  9066. }
  9067. return nil, &googleapi.Error{
  9068. Code: res.StatusCode,
  9069. Header: res.Header,
  9070. }
  9071. }
  9072. if err != nil {
  9073. return nil, err
  9074. }
  9075. defer googleapi.CloseBody(res)
  9076. if err := googleapi.CheckResponse(res); err != nil {
  9077. return nil, err
  9078. }
  9079. ret := &AutoscalerList{
  9080. ServerResponse: googleapi.ServerResponse{
  9081. Header: res.Header,
  9082. HTTPStatusCode: res.StatusCode,
  9083. },
  9084. }
  9085. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9086. return nil, err
  9087. }
  9088. return ret, nil
  9089. // {
  9090. // "description": "Retrieves a list of autoscaler resources contained within the specified zone.",
  9091. // "httpMethod": "GET",
  9092. // "id": "compute.autoscalers.list",
  9093. // "parameterOrder": [
  9094. // "project",
  9095. // "zone"
  9096. // ],
  9097. // "parameters": {
  9098. // "filter": {
  9099. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  9100. // "location": "query",
  9101. // "type": "string"
  9102. // },
  9103. // "maxResults": {
  9104. // "default": "500",
  9105. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  9106. // "format": "uint32",
  9107. // "location": "query",
  9108. // "maximum": "500",
  9109. // "minimum": "0",
  9110. // "type": "integer"
  9111. // },
  9112. // "orderBy": {
  9113. // "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.",
  9114. // "location": "query",
  9115. // "type": "string"
  9116. // },
  9117. // "pageToken": {
  9118. // "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.",
  9119. // "location": "query",
  9120. // "type": "string"
  9121. // },
  9122. // "project": {
  9123. // "description": "Project ID for this request.",
  9124. // "location": "path",
  9125. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  9126. // "required": true,
  9127. // "type": "string"
  9128. // },
  9129. // "zone": {
  9130. // "description": "Name of the zone scoping this request.",
  9131. // "location": "path",
  9132. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  9133. // "required": true,
  9134. // "type": "string"
  9135. // }
  9136. // },
  9137. // "path": "{project}/zones/{zone}/autoscalers",
  9138. // "response": {
  9139. // "$ref": "AutoscalerList"
  9140. // },
  9141. // "scopes": [
  9142. // "https://www.googleapis.com/auth/cloud-platform",
  9143. // "https://www.googleapis.com/auth/compute",
  9144. // "https://www.googleapis.com/auth/compute.readonly"
  9145. // ]
  9146. // }
  9147. }
  9148. // Pages invokes f for each page of results.
  9149. // A non-nil error returned from f will halt the iteration.
  9150. // The provided context supersedes any context provided to the Context method.
  9151. func (c *AutoscalersListCall) Pages(ctx context.Context, f func(*AutoscalerList) error) error {
  9152. c.ctx_ = ctx
  9153. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  9154. for {
  9155. x, err := c.Do()
  9156. if err != nil {
  9157. return err
  9158. }
  9159. if err := f(x); err != nil {
  9160. return err
  9161. }
  9162. if x.NextPageToken == "" {
  9163. return nil
  9164. }
  9165. c.PageToken(x.NextPageToken)
  9166. }
  9167. }
  9168. // method id "compute.autoscalers.patch":
  9169. type AutoscalersPatchCall struct {
  9170. s *Service
  9171. project string
  9172. zone string
  9173. autoscaler2 *Autoscaler
  9174. urlParams_ gensupport.URLParams
  9175. ctx_ context.Context
  9176. }
  9177. // Patch: Updates an autoscaler resource in the specified project using
  9178. // the data included in the request. This method supports patch
  9179. // semantics.
  9180. func (r *AutoscalersService) Patch(project string, zone string, autoscaler string, autoscaler2 *Autoscaler) *AutoscalersPatchCall {
  9181. c := &AutoscalersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9182. c.project = project
  9183. c.zone = zone
  9184. c.urlParams_.Set("autoscaler", autoscaler)
  9185. c.autoscaler2 = autoscaler2
  9186. return c
  9187. }
  9188. // Fields allows partial responses to be retrieved. See
  9189. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9190. // for more information.
  9191. func (c *AutoscalersPatchCall) Fields(s ...googleapi.Field) *AutoscalersPatchCall {
  9192. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9193. return c
  9194. }
  9195. // Context sets the context to be used in this call's Do method. Any
  9196. // pending HTTP request will be aborted if the provided context is
  9197. // canceled.
  9198. func (c *AutoscalersPatchCall) Context(ctx context.Context) *AutoscalersPatchCall {
  9199. c.ctx_ = ctx
  9200. return c
  9201. }
  9202. func (c *AutoscalersPatchCall) doRequest(alt string) (*http.Response, error) {
  9203. var body io.Reader = nil
  9204. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler2)
  9205. if err != nil {
  9206. return nil, err
  9207. }
  9208. ctype := "application/json"
  9209. c.urlParams_.Set("alt", alt)
  9210. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  9211. urls += "?" + c.urlParams_.Encode()
  9212. req, _ := http.NewRequest("PATCH", urls, body)
  9213. googleapi.Expand(req.URL, map[string]string{
  9214. "project": c.project,
  9215. "zone": c.zone,
  9216. })
  9217. req.Header.Set("Content-Type", ctype)
  9218. req.Header.Set("User-Agent", c.s.userAgent())
  9219. if c.ctx_ != nil {
  9220. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9221. }
  9222. return c.s.client.Do(req)
  9223. }
  9224. // Do executes the "compute.autoscalers.patch" call.
  9225. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  9226. // status code is an error. Response headers are in either
  9227. // *Operation.ServerResponse.Header or (if a response was returned at
  9228. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9229. // to check whether the returned error was because
  9230. // http.StatusNotModified was returned.
  9231. func (c *AutoscalersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  9232. gensupport.SetOptions(c.urlParams_, opts...)
  9233. res, err := c.doRequest("json")
  9234. if res != nil && res.StatusCode == http.StatusNotModified {
  9235. if res.Body != nil {
  9236. res.Body.Close()
  9237. }
  9238. return nil, &googleapi.Error{
  9239. Code: res.StatusCode,
  9240. Header: res.Header,
  9241. }
  9242. }
  9243. if err != nil {
  9244. return nil, err
  9245. }
  9246. defer googleapi.CloseBody(res)
  9247. if err := googleapi.CheckResponse(res); err != nil {
  9248. return nil, err
  9249. }
  9250. ret := &Operation{
  9251. ServerResponse: googleapi.ServerResponse{
  9252. Header: res.Header,
  9253. HTTPStatusCode: res.StatusCode,
  9254. },
  9255. }
  9256. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9257. return nil, err
  9258. }
  9259. return ret, nil
  9260. // {
  9261. // "description": "Updates an autoscaler resource in the specified project using the data included in the request. This method supports patch semantics.",
  9262. // "httpMethod": "PATCH",
  9263. // "id": "compute.autoscalers.patch",
  9264. // "parameterOrder": [
  9265. // "project",
  9266. // "zone",
  9267. // "autoscaler"
  9268. // ],
  9269. // "parameters": {
  9270. // "autoscaler": {
  9271. // "description": "Name of the autoscaler resource to update.",
  9272. // "location": "query",
  9273. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  9274. // "required": true,
  9275. // "type": "string"
  9276. // },
  9277. // "project": {
  9278. // "description": "Project ID for this request.",
  9279. // "location": "path",
  9280. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  9281. // "required": true,
  9282. // "type": "string"
  9283. // },
  9284. // "zone": {
  9285. // "description": "Name of the zone scoping this request.",
  9286. // "location": "path",
  9287. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  9288. // "required": true,
  9289. // "type": "string"
  9290. // }
  9291. // },
  9292. // "path": "{project}/zones/{zone}/autoscalers",
  9293. // "request": {
  9294. // "$ref": "Autoscaler"
  9295. // },
  9296. // "response": {
  9297. // "$ref": "Operation"
  9298. // },
  9299. // "scopes": [
  9300. // "https://www.googleapis.com/auth/cloud-platform",
  9301. // "https://www.googleapis.com/auth/compute"
  9302. // ]
  9303. // }
  9304. }
  9305. // method id "compute.autoscalers.update":
  9306. type AutoscalersUpdateCall struct {
  9307. s *Service
  9308. project string
  9309. zone string
  9310. autoscaler *Autoscaler
  9311. urlParams_ gensupport.URLParams
  9312. ctx_ context.Context
  9313. }
  9314. // Update: Updates an autoscaler resource in the specified project using
  9315. // the data included in the request.
  9316. func (r *AutoscalersService) Update(project string, zone string, autoscaler *Autoscaler) *AutoscalersUpdateCall {
  9317. c := &AutoscalersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9318. c.project = project
  9319. c.zone = zone
  9320. c.autoscaler = autoscaler
  9321. return c
  9322. }
  9323. // Autoscaler sets the optional parameter "autoscaler": Name of the
  9324. // autoscaler resource to update.
  9325. func (c *AutoscalersUpdateCall) Autoscaler(autoscaler string) *AutoscalersUpdateCall {
  9326. c.urlParams_.Set("autoscaler", autoscaler)
  9327. return c
  9328. }
  9329. // Fields allows partial responses to be retrieved. See
  9330. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9331. // for more information.
  9332. func (c *AutoscalersUpdateCall) Fields(s ...googleapi.Field) *AutoscalersUpdateCall {
  9333. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9334. return c
  9335. }
  9336. // Context sets the context to be used in this call's Do method. Any
  9337. // pending HTTP request will be aborted if the provided context is
  9338. // canceled.
  9339. func (c *AutoscalersUpdateCall) Context(ctx context.Context) *AutoscalersUpdateCall {
  9340. c.ctx_ = ctx
  9341. return c
  9342. }
  9343. func (c *AutoscalersUpdateCall) doRequest(alt string) (*http.Response, error) {
  9344. var body io.Reader = nil
  9345. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  9346. if err != nil {
  9347. return nil, err
  9348. }
  9349. ctype := "application/json"
  9350. c.urlParams_.Set("alt", alt)
  9351. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  9352. urls += "?" + c.urlParams_.Encode()
  9353. req, _ := http.NewRequest("PUT", urls, body)
  9354. googleapi.Expand(req.URL, map[string]string{
  9355. "project": c.project,
  9356. "zone": c.zone,
  9357. })
  9358. req.Header.Set("Content-Type", ctype)
  9359. req.Header.Set("User-Agent", c.s.userAgent())
  9360. if c.ctx_ != nil {
  9361. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9362. }
  9363. return c.s.client.Do(req)
  9364. }
  9365. // Do executes the "compute.autoscalers.update" call.
  9366. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  9367. // status code is an error. Response headers are in either
  9368. // *Operation.ServerResponse.Header or (if a response was returned at
  9369. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9370. // to check whether the returned error was because
  9371. // http.StatusNotModified was returned.
  9372. func (c *AutoscalersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  9373. gensupport.SetOptions(c.urlParams_, opts...)
  9374. res, err := c.doRequest("json")
  9375. if res != nil && res.StatusCode == http.StatusNotModified {
  9376. if res.Body != nil {
  9377. res.Body.Close()
  9378. }
  9379. return nil, &googleapi.Error{
  9380. Code: res.StatusCode,
  9381. Header: res.Header,
  9382. }
  9383. }
  9384. if err != nil {
  9385. return nil, err
  9386. }
  9387. defer googleapi.CloseBody(res)
  9388. if err := googleapi.CheckResponse(res); err != nil {
  9389. return nil, err
  9390. }
  9391. ret := &Operation{
  9392. ServerResponse: googleapi.ServerResponse{
  9393. Header: res.Header,
  9394. HTTPStatusCode: res.StatusCode,
  9395. },
  9396. }
  9397. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9398. return nil, err
  9399. }
  9400. return ret, nil
  9401. // {
  9402. // "description": "Updates an autoscaler resource in the specified project using the data included in the request.",
  9403. // "httpMethod": "PUT",
  9404. // "id": "compute.autoscalers.update",
  9405. // "parameterOrder": [
  9406. // "project",
  9407. // "zone"
  9408. // ],
  9409. // "parameters": {
  9410. // "autoscaler": {
  9411. // "description": "Name of the autoscaler resource to update.",
  9412. // "location": "query",
  9413. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  9414. // "type": "string"
  9415. // },
  9416. // "project": {
  9417. // "description": "Project ID for this request.",
  9418. // "location": "path",
  9419. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  9420. // "required": true,
  9421. // "type": "string"
  9422. // },
  9423. // "zone": {
  9424. // "description": "Name of the zone scoping this request.",
  9425. // "location": "path",
  9426. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  9427. // "required": true,
  9428. // "type": "string"
  9429. // }
  9430. // },
  9431. // "path": "{project}/zones/{zone}/autoscalers",
  9432. // "request": {
  9433. // "$ref": "Autoscaler"
  9434. // },
  9435. // "response": {
  9436. // "$ref": "Operation"
  9437. // },
  9438. // "scopes": [
  9439. // "https://www.googleapis.com/auth/cloud-platform",
  9440. // "https://www.googleapis.com/auth/compute"
  9441. // ]
  9442. // }
  9443. }
  9444. // method id "compute.backendServices.delete":
  9445. type BackendServicesDeleteCall struct {
  9446. s *Service
  9447. project string
  9448. backendService string
  9449. urlParams_ gensupport.URLParams
  9450. ctx_ context.Context
  9451. }
  9452. // Delete: Deletes the specified BackendService resource.
  9453. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/delete
  9454. func (r *BackendServicesService) Delete(project string, backendService string) *BackendServicesDeleteCall {
  9455. c := &BackendServicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9456. c.project = project
  9457. c.backendService = backendService
  9458. return c
  9459. }
  9460. // Fields allows partial responses to be retrieved. See
  9461. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9462. // for more information.
  9463. func (c *BackendServicesDeleteCall) Fields(s ...googleapi.Field) *BackendServicesDeleteCall {
  9464. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9465. return c
  9466. }
  9467. // Context sets the context to be used in this call's Do method. Any
  9468. // pending HTTP request will be aborted if the provided context is
  9469. // canceled.
  9470. func (c *BackendServicesDeleteCall) Context(ctx context.Context) *BackendServicesDeleteCall {
  9471. c.ctx_ = ctx
  9472. return c
  9473. }
  9474. func (c *BackendServicesDeleteCall) doRequest(alt string) (*http.Response, error) {
  9475. var body io.Reader = nil
  9476. c.urlParams_.Set("alt", alt)
  9477. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  9478. urls += "?" + c.urlParams_.Encode()
  9479. req, _ := http.NewRequest("DELETE", urls, body)
  9480. googleapi.Expand(req.URL, map[string]string{
  9481. "project": c.project,
  9482. "backendService": c.backendService,
  9483. })
  9484. req.Header.Set("User-Agent", c.s.userAgent())
  9485. if c.ctx_ != nil {
  9486. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9487. }
  9488. return c.s.client.Do(req)
  9489. }
  9490. // Do executes the "compute.backendServices.delete" call.
  9491. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  9492. // status code is an error. Response headers are in either
  9493. // *Operation.ServerResponse.Header or (if a response was returned at
  9494. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9495. // to check whether the returned error was because
  9496. // http.StatusNotModified was returned.
  9497. func (c *BackendServicesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  9498. gensupport.SetOptions(c.urlParams_, opts...)
  9499. res, err := c.doRequest("json")
  9500. if res != nil && res.StatusCode == http.StatusNotModified {
  9501. if res.Body != nil {
  9502. res.Body.Close()
  9503. }
  9504. return nil, &googleapi.Error{
  9505. Code: res.StatusCode,
  9506. Header: res.Header,
  9507. }
  9508. }
  9509. if err != nil {
  9510. return nil, err
  9511. }
  9512. defer googleapi.CloseBody(res)
  9513. if err := googleapi.CheckResponse(res); err != nil {
  9514. return nil, err
  9515. }
  9516. ret := &Operation{
  9517. ServerResponse: googleapi.ServerResponse{
  9518. Header: res.Header,
  9519. HTTPStatusCode: res.StatusCode,
  9520. },
  9521. }
  9522. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9523. return nil, err
  9524. }
  9525. return ret, nil
  9526. // {
  9527. // "description": "Deletes the specified BackendService resource.",
  9528. // "httpMethod": "DELETE",
  9529. // "id": "compute.backendServices.delete",
  9530. // "parameterOrder": [
  9531. // "project",
  9532. // "backendService"
  9533. // ],
  9534. // "parameters": {
  9535. // "backendService": {
  9536. // "description": "Name of the BackendService resource to delete.",
  9537. // "location": "path",
  9538. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  9539. // "required": true,
  9540. // "type": "string"
  9541. // },
  9542. // "project": {
  9543. // "description": "Project ID for this request.",
  9544. // "location": "path",
  9545. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  9546. // "required": true,
  9547. // "type": "string"
  9548. // }
  9549. // },
  9550. // "path": "{project}/global/backendServices/{backendService}",
  9551. // "response": {
  9552. // "$ref": "Operation"
  9553. // },
  9554. // "scopes": [
  9555. // "https://www.googleapis.com/auth/cloud-platform",
  9556. // "https://www.googleapis.com/auth/compute"
  9557. // ]
  9558. // }
  9559. }
  9560. // method id "compute.backendServices.get":
  9561. type BackendServicesGetCall struct {
  9562. s *Service
  9563. project string
  9564. backendService string
  9565. urlParams_ gensupport.URLParams
  9566. ifNoneMatch_ string
  9567. ctx_ context.Context
  9568. }
  9569. // Get: Returns the specified BackendService resource.
  9570. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/get
  9571. func (r *BackendServicesService) Get(project string, backendService string) *BackendServicesGetCall {
  9572. c := &BackendServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9573. c.project = project
  9574. c.backendService = backendService
  9575. return c
  9576. }
  9577. // Fields allows partial responses to be retrieved. See
  9578. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9579. // for more information.
  9580. func (c *BackendServicesGetCall) Fields(s ...googleapi.Field) *BackendServicesGetCall {
  9581. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9582. return c
  9583. }
  9584. // IfNoneMatch sets the optional parameter which makes the operation
  9585. // fail if the object's ETag matches the given value. This is useful for
  9586. // getting updates only after the object has changed since the last
  9587. // request. Use googleapi.IsNotModified to check whether the response
  9588. // error from Do is the result of In-None-Match.
  9589. func (c *BackendServicesGetCall) IfNoneMatch(entityTag string) *BackendServicesGetCall {
  9590. c.ifNoneMatch_ = entityTag
  9591. return c
  9592. }
  9593. // Context sets the context to be used in this call's Do method. Any
  9594. // pending HTTP request will be aborted if the provided context is
  9595. // canceled.
  9596. func (c *BackendServicesGetCall) Context(ctx context.Context) *BackendServicesGetCall {
  9597. c.ctx_ = ctx
  9598. return c
  9599. }
  9600. func (c *BackendServicesGetCall) doRequest(alt string) (*http.Response, error) {
  9601. var body io.Reader = nil
  9602. c.urlParams_.Set("alt", alt)
  9603. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  9604. urls += "?" + c.urlParams_.Encode()
  9605. req, _ := http.NewRequest("GET", urls, body)
  9606. googleapi.Expand(req.URL, map[string]string{
  9607. "project": c.project,
  9608. "backendService": c.backendService,
  9609. })
  9610. req.Header.Set("User-Agent", c.s.userAgent())
  9611. if c.ifNoneMatch_ != "" {
  9612. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  9613. }
  9614. if c.ctx_ != nil {
  9615. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9616. }
  9617. return c.s.client.Do(req)
  9618. }
  9619. // Do executes the "compute.backendServices.get" call.
  9620. // Exactly one of *BackendService or error will be non-nil. Any non-2xx
  9621. // status code is an error. Response headers are in either
  9622. // *BackendService.ServerResponse.Header or (if a response was returned
  9623. // at all) in error.(*googleapi.Error).Header. Use
  9624. // googleapi.IsNotModified to check whether the returned error was
  9625. // because http.StatusNotModified was returned.
  9626. func (c *BackendServicesGetCall) Do(opts ...googleapi.CallOption) (*BackendService, error) {
  9627. gensupport.SetOptions(c.urlParams_, opts...)
  9628. res, err := c.doRequest("json")
  9629. if res != nil && res.StatusCode == http.StatusNotModified {
  9630. if res.Body != nil {
  9631. res.Body.Close()
  9632. }
  9633. return nil, &googleapi.Error{
  9634. Code: res.StatusCode,
  9635. Header: res.Header,
  9636. }
  9637. }
  9638. if err != nil {
  9639. return nil, err
  9640. }
  9641. defer googleapi.CloseBody(res)
  9642. if err := googleapi.CheckResponse(res); err != nil {
  9643. return nil, err
  9644. }
  9645. ret := &BackendService{
  9646. ServerResponse: googleapi.ServerResponse{
  9647. Header: res.Header,
  9648. HTTPStatusCode: res.StatusCode,
  9649. },
  9650. }
  9651. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9652. return nil, err
  9653. }
  9654. return ret, nil
  9655. // {
  9656. // "description": "Returns the specified BackendService resource.",
  9657. // "httpMethod": "GET",
  9658. // "id": "compute.backendServices.get",
  9659. // "parameterOrder": [
  9660. // "project",
  9661. // "backendService"
  9662. // ],
  9663. // "parameters": {
  9664. // "backendService": {
  9665. // "description": "Name of the BackendService resource to return.",
  9666. // "location": "path",
  9667. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  9668. // "required": true,
  9669. // "type": "string"
  9670. // },
  9671. // "project": {
  9672. // "description": "Project ID for this request.",
  9673. // "location": "path",
  9674. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  9675. // "required": true,
  9676. // "type": "string"
  9677. // }
  9678. // },
  9679. // "path": "{project}/global/backendServices/{backendService}",
  9680. // "response": {
  9681. // "$ref": "BackendService"
  9682. // },
  9683. // "scopes": [
  9684. // "https://www.googleapis.com/auth/cloud-platform",
  9685. // "https://www.googleapis.com/auth/compute",
  9686. // "https://www.googleapis.com/auth/compute.readonly"
  9687. // ]
  9688. // }
  9689. }
  9690. // method id "compute.backendServices.getHealth":
  9691. type BackendServicesGetHealthCall struct {
  9692. s *Service
  9693. project string
  9694. backendService string
  9695. resourcegroupreference *ResourceGroupReference
  9696. urlParams_ gensupport.URLParams
  9697. ctx_ context.Context
  9698. }
  9699. // GetHealth: Gets the most recent health check results for this
  9700. // BackendService.
  9701. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/getHealth
  9702. func (r *BackendServicesService) GetHealth(project string, backendService string, resourcegroupreference *ResourceGroupReference) *BackendServicesGetHealthCall {
  9703. c := &BackendServicesGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9704. c.project = project
  9705. c.backendService = backendService
  9706. c.resourcegroupreference = resourcegroupreference
  9707. return c
  9708. }
  9709. // Fields allows partial responses to be retrieved. See
  9710. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9711. // for more information.
  9712. func (c *BackendServicesGetHealthCall) Fields(s ...googleapi.Field) *BackendServicesGetHealthCall {
  9713. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9714. return c
  9715. }
  9716. // Context sets the context to be used in this call's Do method. Any
  9717. // pending HTTP request will be aborted if the provided context is
  9718. // canceled.
  9719. func (c *BackendServicesGetHealthCall) Context(ctx context.Context) *BackendServicesGetHealthCall {
  9720. c.ctx_ = ctx
  9721. return c
  9722. }
  9723. func (c *BackendServicesGetHealthCall) doRequest(alt string) (*http.Response, error) {
  9724. var body io.Reader = nil
  9725. body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcegroupreference)
  9726. if err != nil {
  9727. return nil, err
  9728. }
  9729. ctype := "application/json"
  9730. c.urlParams_.Set("alt", alt)
  9731. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}/getHealth")
  9732. urls += "?" + c.urlParams_.Encode()
  9733. req, _ := http.NewRequest("POST", urls, body)
  9734. googleapi.Expand(req.URL, map[string]string{
  9735. "project": c.project,
  9736. "backendService": c.backendService,
  9737. })
  9738. req.Header.Set("Content-Type", ctype)
  9739. req.Header.Set("User-Agent", c.s.userAgent())
  9740. if c.ctx_ != nil {
  9741. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9742. }
  9743. return c.s.client.Do(req)
  9744. }
  9745. // Do executes the "compute.backendServices.getHealth" call.
  9746. // Exactly one of *BackendServiceGroupHealth or error will be non-nil.
  9747. // Any non-2xx status code is an error. Response headers are in either
  9748. // *BackendServiceGroupHealth.ServerResponse.Header or (if a response
  9749. // was returned at all) in error.(*googleapi.Error).Header. Use
  9750. // googleapi.IsNotModified to check whether the returned error was
  9751. // because http.StatusNotModified was returned.
  9752. func (c *BackendServicesGetHealthCall) Do(opts ...googleapi.CallOption) (*BackendServiceGroupHealth, error) {
  9753. gensupport.SetOptions(c.urlParams_, opts...)
  9754. res, err := c.doRequest("json")
  9755. if res != nil && res.StatusCode == http.StatusNotModified {
  9756. if res.Body != nil {
  9757. res.Body.Close()
  9758. }
  9759. return nil, &googleapi.Error{
  9760. Code: res.StatusCode,
  9761. Header: res.Header,
  9762. }
  9763. }
  9764. if err != nil {
  9765. return nil, err
  9766. }
  9767. defer googleapi.CloseBody(res)
  9768. if err := googleapi.CheckResponse(res); err != nil {
  9769. return nil, err
  9770. }
  9771. ret := &BackendServiceGroupHealth{
  9772. ServerResponse: googleapi.ServerResponse{
  9773. Header: res.Header,
  9774. HTTPStatusCode: res.StatusCode,
  9775. },
  9776. }
  9777. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9778. return nil, err
  9779. }
  9780. return ret, nil
  9781. // {
  9782. // "description": "Gets the most recent health check results for this BackendService.",
  9783. // "httpMethod": "POST",
  9784. // "id": "compute.backendServices.getHealth",
  9785. // "parameterOrder": [
  9786. // "project",
  9787. // "backendService"
  9788. // ],
  9789. // "parameters": {
  9790. // "backendService": {
  9791. // "description": "Name of the BackendService resource to which the queried instance belongs.",
  9792. // "location": "path",
  9793. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  9794. // "required": true,
  9795. // "type": "string"
  9796. // },
  9797. // "project": {
  9798. // "location": "path",
  9799. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  9800. // "required": true,
  9801. // "type": "string"
  9802. // }
  9803. // },
  9804. // "path": "{project}/global/backendServices/{backendService}/getHealth",
  9805. // "request": {
  9806. // "$ref": "ResourceGroupReference"
  9807. // },
  9808. // "response": {
  9809. // "$ref": "BackendServiceGroupHealth"
  9810. // },
  9811. // "scopes": [
  9812. // "https://www.googleapis.com/auth/cloud-platform",
  9813. // "https://www.googleapis.com/auth/compute",
  9814. // "https://www.googleapis.com/auth/compute.readonly"
  9815. // ]
  9816. // }
  9817. }
  9818. // method id "compute.backendServices.insert":
  9819. type BackendServicesInsertCall struct {
  9820. s *Service
  9821. project string
  9822. backendservice *BackendService
  9823. urlParams_ gensupport.URLParams
  9824. ctx_ context.Context
  9825. }
  9826. // Insert: Creates a BackendService resource in the specified project
  9827. // using the data included in the request. There are several
  9828. // restrictions and guidelines to keep in mind when creating a backend
  9829. // service. Read Restrictions and Guidelines for more information.
  9830. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/insert
  9831. func (r *BackendServicesService) Insert(project string, backendservice *BackendService) *BackendServicesInsertCall {
  9832. c := &BackendServicesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9833. c.project = project
  9834. c.backendservice = backendservice
  9835. return c
  9836. }
  9837. // Fields allows partial responses to be retrieved. See
  9838. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9839. // for more information.
  9840. func (c *BackendServicesInsertCall) Fields(s ...googleapi.Field) *BackendServicesInsertCall {
  9841. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9842. return c
  9843. }
  9844. // Context sets the context to be used in this call's Do method. Any
  9845. // pending HTTP request will be aborted if the provided context is
  9846. // canceled.
  9847. func (c *BackendServicesInsertCall) Context(ctx context.Context) *BackendServicesInsertCall {
  9848. c.ctx_ = ctx
  9849. return c
  9850. }
  9851. func (c *BackendServicesInsertCall) doRequest(alt string) (*http.Response, error) {
  9852. var body io.Reader = nil
  9853. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  9854. if err != nil {
  9855. return nil, err
  9856. }
  9857. ctype := "application/json"
  9858. c.urlParams_.Set("alt", alt)
  9859. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices")
  9860. urls += "?" + c.urlParams_.Encode()
  9861. req, _ := http.NewRequest("POST", urls, body)
  9862. googleapi.Expand(req.URL, map[string]string{
  9863. "project": c.project,
  9864. })
  9865. req.Header.Set("Content-Type", ctype)
  9866. req.Header.Set("User-Agent", c.s.userAgent())
  9867. if c.ctx_ != nil {
  9868. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9869. }
  9870. return c.s.client.Do(req)
  9871. }
  9872. // Do executes the "compute.backendServices.insert" call.
  9873. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  9874. // status code is an error. Response headers are in either
  9875. // *Operation.ServerResponse.Header or (if a response was returned at
  9876. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9877. // to check whether the returned error was because
  9878. // http.StatusNotModified was returned.
  9879. func (c *BackendServicesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  9880. gensupport.SetOptions(c.urlParams_, opts...)
  9881. res, err := c.doRequest("json")
  9882. if res != nil && res.StatusCode == http.StatusNotModified {
  9883. if res.Body != nil {
  9884. res.Body.Close()
  9885. }
  9886. return nil, &googleapi.Error{
  9887. Code: res.StatusCode,
  9888. Header: res.Header,
  9889. }
  9890. }
  9891. if err != nil {
  9892. return nil, err
  9893. }
  9894. defer googleapi.CloseBody(res)
  9895. if err := googleapi.CheckResponse(res); err != nil {
  9896. return nil, err
  9897. }
  9898. ret := &Operation{
  9899. ServerResponse: googleapi.ServerResponse{
  9900. Header: res.Header,
  9901. HTTPStatusCode: res.StatusCode,
  9902. },
  9903. }
  9904. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9905. return nil, err
  9906. }
  9907. return ret, nil
  9908. // {
  9909. // "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.",
  9910. // "httpMethod": "POST",
  9911. // "id": "compute.backendServices.insert",
  9912. // "parameterOrder": [
  9913. // "project"
  9914. // ],
  9915. // "parameters": {
  9916. // "project": {
  9917. // "description": "Project ID for this request.",
  9918. // "location": "path",
  9919. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  9920. // "required": true,
  9921. // "type": "string"
  9922. // }
  9923. // },
  9924. // "path": "{project}/global/backendServices",
  9925. // "request": {
  9926. // "$ref": "BackendService"
  9927. // },
  9928. // "response": {
  9929. // "$ref": "Operation"
  9930. // },
  9931. // "scopes": [
  9932. // "https://www.googleapis.com/auth/cloud-platform",
  9933. // "https://www.googleapis.com/auth/compute"
  9934. // ]
  9935. // }
  9936. }
  9937. // method id "compute.backendServices.list":
  9938. type BackendServicesListCall struct {
  9939. s *Service
  9940. project string
  9941. urlParams_ gensupport.URLParams
  9942. ifNoneMatch_ string
  9943. ctx_ context.Context
  9944. }
  9945. // List: Retrieves the list of BackendService resources available to the
  9946. // specified project.
  9947. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/list
  9948. func (r *BackendServicesService) List(project string) *BackendServicesListCall {
  9949. c := &BackendServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9950. c.project = project
  9951. return c
  9952. }
  9953. // Filter sets the optional parameter "filter": Sets a filter expression
  9954. // for filtering listed resources, in the form filter={expression}. Your
  9955. // {expression} must be in the format: field_name comparison_string
  9956. // literal_string.
  9957. //
  9958. // The field_name is the name of the field you want to compare. Only
  9959. // atomic field types are supported (string, number, boolean). The
  9960. // comparison_string must be either eq (equals) or ne (not equals). The
  9961. // literal_string is the string value to filter to. The literal value
  9962. // must be valid for the type of field you are filtering by (string,
  9963. // number, boolean). For string fields, the literal value is interpreted
  9964. // as a regular expression using RE2 syntax. The literal value must
  9965. // match the entire field.
  9966. //
  9967. // For example, filter=name ne example-instance.
  9968. //
  9969. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  9970. // you can also filter on nested fields. For example, you could filter
  9971. // on instances that have set the scheduling.automaticRestart field to
  9972. // true. In particular, use filtering on nested fields to take advantage
  9973. // of instance labels to organize and filter results based on label
  9974. // values.
  9975. //
  9976. // The Beta API also supports filtering on multiple expressions by
  9977. // providing each separate expression within parentheses. For example,
  9978. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  9979. // Multiple expressions are treated as AND expressions meaning that
  9980. // resources must match all expressions to pass the filters.
  9981. func (c *BackendServicesListCall) Filter(filter string) *BackendServicesListCall {
  9982. c.urlParams_.Set("filter", filter)
  9983. return c
  9984. }
  9985. // MaxResults sets the optional parameter "maxResults": The maximum
  9986. // number of results per page that Compute Engine should return. If the
  9987. // number of available results is larger than maxResults, Compute Engine
  9988. // returns a nextPageToken that can be used to get the next page of
  9989. // results in subsequent list requests.
  9990. func (c *BackendServicesListCall) MaxResults(maxResults int64) *BackendServicesListCall {
  9991. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  9992. return c
  9993. }
  9994. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  9995. // a certain order. By default, results are returned in alphanumerical
  9996. // order based on the resource name.
  9997. //
  9998. // You can also sort results in descending order based on the creation
  9999. // timestamp using orderBy="creationTimestamp desc". This sorts results
  10000. // based on the creationTimestamp field in reverse chronological order
  10001. // (newest result first). Use this to sort resources like operations so
  10002. // that the newest operation is returned first.
  10003. //
  10004. // Currently, only sorting by name or creationTimestamp desc is
  10005. // supported.
  10006. func (c *BackendServicesListCall) OrderBy(orderBy string) *BackendServicesListCall {
  10007. c.urlParams_.Set("orderBy", orderBy)
  10008. return c
  10009. }
  10010. // PageToken sets the optional parameter "pageToken": Specifies a page
  10011. // token to use. Set pageToken to the nextPageToken returned by a
  10012. // previous list request to get the next page of results.
  10013. func (c *BackendServicesListCall) PageToken(pageToken string) *BackendServicesListCall {
  10014. c.urlParams_.Set("pageToken", pageToken)
  10015. return c
  10016. }
  10017. // Fields allows partial responses to be retrieved. See
  10018. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10019. // for more information.
  10020. func (c *BackendServicesListCall) Fields(s ...googleapi.Field) *BackendServicesListCall {
  10021. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10022. return c
  10023. }
  10024. // IfNoneMatch sets the optional parameter which makes the operation
  10025. // fail if the object's ETag matches the given value. This is useful for
  10026. // getting updates only after the object has changed since the last
  10027. // request. Use googleapi.IsNotModified to check whether the response
  10028. // error from Do is the result of In-None-Match.
  10029. func (c *BackendServicesListCall) IfNoneMatch(entityTag string) *BackendServicesListCall {
  10030. c.ifNoneMatch_ = entityTag
  10031. return c
  10032. }
  10033. // Context sets the context to be used in this call's Do method. Any
  10034. // pending HTTP request will be aborted if the provided context is
  10035. // canceled.
  10036. func (c *BackendServicesListCall) Context(ctx context.Context) *BackendServicesListCall {
  10037. c.ctx_ = ctx
  10038. return c
  10039. }
  10040. func (c *BackendServicesListCall) doRequest(alt string) (*http.Response, error) {
  10041. var body io.Reader = nil
  10042. c.urlParams_.Set("alt", alt)
  10043. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices")
  10044. urls += "?" + c.urlParams_.Encode()
  10045. req, _ := http.NewRequest("GET", urls, body)
  10046. googleapi.Expand(req.URL, map[string]string{
  10047. "project": c.project,
  10048. })
  10049. req.Header.Set("User-Agent", c.s.userAgent())
  10050. if c.ifNoneMatch_ != "" {
  10051. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  10052. }
  10053. if c.ctx_ != nil {
  10054. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10055. }
  10056. return c.s.client.Do(req)
  10057. }
  10058. // Do executes the "compute.backendServices.list" call.
  10059. // Exactly one of *BackendServiceList or error will be non-nil. Any
  10060. // non-2xx status code is an error. Response headers are in either
  10061. // *BackendServiceList.ServerResponse.Header or (if a response was
  10062. // returned at all) in error.(*googleapi.Error).Header. Use
  10063. // googleapi.IsNotModified to check whether the returned error was
  10064. // because http.StatusNotModified was returned.
  10065. func (c *BackendServicesListCall) Do(opts ...googleapi.CallOption) (*BackendServiceList, error) {
  10066. gensupport.SetOptions(c.urlParams_, opts...)
  10067. res, err := c.doRequest("json")
  10068. if res != nil && res.StatusCode == http.StatusNotModified {
  10069. if res.Body != nil {
  10070. res.Body.Close()
  10071. }
  10072. return nil, &googleapi.Error{
  10073. Code: res.StatusCode,
  10074. Header: res.Header,
  10075. }
  10076. }
  10077. if err != nil {
  10078. return nil, err
  10079. }
  10080. defer googleapi.CloseBody(res)
  10081. if err := googleapi.CheckResponse(res); err != nil {
  10082. return nil, err
  10083. }
  10084. ret := &BackendServiceList{
  10085. ServerResponse: googleapi.ServerResponse{
  10086. Header: res.Header,
  10087. HTTPStatusCode: res.StatusCode,
  10088. },
  10089. }
  10090. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  10091. return nil, err
  10092. }
  10093. return ret, nil
  10094. // {
  10095. // "description": "Retrieves the list of BackendService resources available to the specified project.",
  10096. // "httpMethod": "GET",
  10097. // "id": "compute.backendServices.list",
  10098. // "parameterOrder": [
  10099. // "project"
  10100. // ],
  10101. // "parameters": {
  10102. // "filter": {
  10103. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  10104. // "location": "query",
  10105. // "type": "string"
  10106. // },
  10107. // "maxResults": {
  10108. // "default": "500",
  10109. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  10110. // "format": "uint32",
  10111. // "location": "query",
  10112. // "maximum": "500",
  10113. // "minimum": "0",
  10114. // "type": "integer"
  10115. // },
  10116. // "orderBy": {
  10117. // "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.",
  10118. // "location": "query",
  10119. // "type": "string"
  10120. // },
  10121. // "pageToken": {
  10122. // "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.",
  10123. // "location": "query",
  10124. // "type": "string"
  10125. // },
  10126. // "project": {
  10127. // "description": "Project ID for this request.",
  10128. // "location": "path",
  10129. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  10130. // "required": true,
  10131. // "type": "string"
  10132. // }
  10133. // },
  10134. // "path": "{project}/global/backendServices",
  10135. // "response": {
  10136. // "$ref": "BackendServiceList"
  10137. // },
  10138. // "scopes": [
  10139. // "https://www.googleapis.com/auth/cloud-platform",
  10140. // "https://www.googleapis.com/auth/compute",
  10141. // "https://www.googleapis.com/auth/compute.readonly"
  10142. // ]
  10143. // }
  10144. }
  10145. // Pages invokes f for each page of results.
  10146. // A non-nil error returned from f will halt the iteration.
  10147. // The provided context supersedes any context provided to the Context method.
  10148. func (c *BackendServicesListCall) Pages(ctx context.Context, f func(*BackendServiceList) error) error {
  10149. c.ctx_ = ctx
  10150. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  10151. for {
  10152. x, err := c.Do()
  10153. if err != nil {
  10154. return err
  10155. }
  10156. if err := f(x); err != nil {
  10157. return err
  10158. }
  10159. if x.NextPageToken == "" {
  10160. return nil
  10161. }
  10162. c.PageToken(x.NextPageToken)
  10163. }
  10164. }
  10165. // method id "compute.backendServices.patch":
  10166. type BackendServicesPatchCall struct {
  10167. s *Service
  10168. project string
  10169. backendService string
  10170. backendservice *BackendService
  10171. urlParams_ gensupport.URLParams
  10172. ctx_ context.Context
  10173. }
  10174. // Patch: Updates the entire content of the BackendService resource.
  10175. // There are several restrictions and guidelines to keep in mind when
  10176. // updating a backend service. Read Restrictions and Guidelines for
  10177. // more information. This method supports patch semantics.
  10178. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/patch
  10179. func (r *BackendServicesService) Patch(project string, backendService string, backendservice *BackendService) *BackendServicesPatchCall {
  10180. c := &BackendServicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10181. c.project = project
  10182. c.backendService = backendService
  10183. c.backendservice = backendservice
  10184. return c
  10185. }
  10186. // Fields allows partial responses to be retrieved. See
  10187. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10188. // for more information.
  10189. func (c *BackendServicesPatchCall) Fields(s ...googleapi.Field) *BackendServicesPatchCall {
  10190. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10191. return c
  10192. }
  10193. // Context sets the context to be used in this call's Do method. Any
  10194. // pending HTTP request will be aborted if the provided context is
  10195. // canceled.
  10196. func (c *BackendServicesPatchCall) Context(ctx context.Context) *BackendServicesPatchCall {
  10197. c.ctx_ = ctx
  10198. return c
  10199. }
  10200. func (c *BackendServicesPatchCall) doRequest(alt string) (*http.Response, error) {
  10201. var body io.Reader = nil
  10202. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  10203. if err != nil {
  10204. return nil, err
  10205. }
  10206. ctype := "application/json"
  10207. c.urlParams_.Set("alt", alt)
  10208. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  10209. urls += "?" + c.urlParams_.Encode()
  10210. req, _ := http.NewRequest("PATCH", urls, body)
  10211. googleapi.Expand(req.URL, map[string]string{
  10212. "project": c.project,
  10213. "backendService": c.backendService,
  10214. })
  10215. req.Header.Set("Content-Type", ctype)
  10216. req.Header.Set("User-Agent", c.s.userAgent())
  10217. if c.ctx_ != nil {
  10218. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10219. }
  10220. return c.s.client.Do(req)
  10221. }
  10222. // Do executes the "compute.backendServices.patch" call.
  10223. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  10224. // status code is an error. Response headers are in either
  10225. // *Operation.ServerResponse.Header or (if a response was returned at
  10226. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10227. // to check whether the returned error was because
  10228. // http.StatusNotModified was returned.
  10229. func (c *BackendServicesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  10230. gensupport.SetOptions(c.urlParams_, opts...)
  10231. res, err := c.doRequest("json")
  10232. if res != nil && res.StatusCode == http.StatusNotModified {
  10233. if res.Body != nil {
  10234. res.Body.Close()
  10235. }
  10236. return nil, &googleapi.Error{
  10237. Code: res.StatusCode,
  10238. Header: res.Header,
  10239. }
  10240. }
  10241. if err != nil {
  10242. return nil, err
  10243. }
  10244. defer googleapi.CloseBody(res)
  10245. if err := googleapi.CheckResponse(res); err != nil {
  10246. return nil, err
  10247. }
  10248. ret := &Operation{
  10249. ServerResponse: googleapi.ServerResponse{
  10250. Header: res.Header,
  10251. HTTPStatusCode: res.StatusCode,
  10252. },
  10253. }
  10254. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  10255. return nil, err
  10256. }
  10257. return ret, nil
  10258. // {
  10259. // "description": "Updates the entire content of the BackendService resource. 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.",
  10260. // "httpMethod": "PATCH",
  10261. // "id": "compute.backendServices.patch",
  10262. // "parameterOrder": [
  10263. // "project",
  10264. // "backendService"
  10265. // ],
  10266. // "parameters": {
  10267. // "backendService": {
  10268. // "description": "Name of the BackendService resource to update.",
  10269. // "location": "path",
  10270. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  10271. // "required": true,
  10272. // "type": "string"
  10273. // },
  10274. // "project": {
  10275. // "description": "Project ID for this request.",
  10276. // "location": "path",
  10277. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  10278. // "required": true,
  10279. // "type": "string"
  10280. // }
  10281. // },
  10282. // "path": "{project}/global/backendServices/{backendService}",
  10283. // "request": {
  10284. // "$ref": "BackendService"
  10285. // },
  10286. // "response": {
  10287. // "$ref": "Operation"
  10288. // },
  10289. // "scopes": [
  10290. // "https://www.googleapis.com/auth/cloud-platform",
  10291. // "https://www.googleapis.com/auth/compute"
  10292. // ]
  10293. // }
  10294. }
  10295. // method id "compute.backendServices.update":
  10296. type BackendServicesUpdateCall struct {
  10297. s *Service
  10298. project string
  10299. backendService string
  10300. backendservice *BackendService
  10301. urlParams_ gensupport.URLParams
  10302. ctx_ context.Context
  10303. }
  10304. // Update: Updates the entire content of the BackendService resource.
  10305. // There are several restrictions and guidelines to keep in mind when
  10306. // updating a backend service. Read Restrictions and Guidelines for
  10307. // more information.
  10308. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/update
  10309. func (r *BackendServicesService) Update(project string, backendService string, backendservice *BackendService) *BackendServicesUpdateCall {
  10310. c := &BackendServicesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10311. c.project = project
  10312. c.backendService = backendService
  10313. c.backendservice = backendservice
  10314. return c
  10315. }
  10316. // Fields allows partial responses to be retrieved. See
  10317. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10318. // for more information.
  10319. func (c *BackendServicesUpdateCall) Fields(s ...googleapi.Field) *BackendServicesUpdateCall {
  10320. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10321. return c
  10322. }
  10323. // Context sets the context to be used in this call's Do method. Any
  10324. // pending HTTP request will be aborted if the provided context is
  10325. // canceled.
  10326. func (c *BackendServicesUpdateCall) Context(ctx context.Context) *BackendServicesUpdateCall {
  10327. c.ctx_ = ctx
  10328. return c
  10329. }
  10330. func (c *BackendServicesUpdateCall) doRequest(alt string) (*http.Response, error) {
  10331. var body io.Reader = nil
  10332. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  10333. if err != nil {
  10334. return nil, err
  10335. }
  10336. ctype := "application/json"
  10337. c.urlParams_.Set("alt", alt)
  10338. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  10339. urls += "?" + c.urlParams_.Encode()
  10340. req, _ := http.NewRequest("PUT", urls, body)
  10341. googleapi.Expand(req.URL, map[string]string{
  10342. "project": c.project,
  10343. "backendService": c.backendService,
  10344. })
  10345. req.Header.Set("Content-Type", ctype)
  10346. req.Header.Set("User-Agent", c.s.userAgent())
  10347. if c.ctx_ != nil {
  10348. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10349. }
  10350. return c.s.client.Do(req)
  10351. }
  10352. // Do executes the "compute.backendServices.update" call.
  10353. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  10354. // status code is an error. Response headers are in either
  10355. // *Operation.ServerResponse.Header or (if a response was returned at
  10356. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10357. // to check whether the returned error was because
  10358. // http.StatusNotModified was returned.
  10359. func (c *BackendServicesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  10360. gensupport.SetOptions(c.urlParams_, opts...)
  10361. res, err := c.doRequest("json")
  10362. if res != nil && res.StatusCode == http.StatusNotModified {
  10363. if res.Body != nil {
  10364. res.Body.Close()
  10365. }
  10366. return nil, &googleapi.Error{
  10367. Code: res.StatusCode,
  10368. Header: res.Header,
  10369. }
  10370. }
  10371. if err != nil {
  10372. return nil, err
  10373. }
  10374. defer googleapi.CloseBody(res)
  10375. if err := googleapi.CheckResponse(res); err != nil {
  10376. return nil, err
  10377. }
  10378. ret := &Operation{
  10379. ServerResponse: googleapi.ServerResponse{
  10380. Header: res.Header,
  10381. HTTPStatusCode: res.StatusCode,
  10382. },
  10383. }
  10384. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  10385. return nil, err
  10386. }
  10387. return ret, nil
  10388. // {
  10389. // "description": "Updates the entire content of the BackendService resource. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information.",
  10390. // "httpMethod": "PUT",
  10391. // "id": "compute.backendServices.update",
  10392. // "parameterOrder": [
  10393. // "project",
  10394. // "backendService"
  10395. // ],
  10396. // "parameters": {
  10397. // "backendService": {
  10398. // "description": "Name of the BackendService resource to update.",
  10399. // "location": "path",
  10400. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  10401. // "required": true,
  10402. // "type": "string"
  10403. // },
  10404. // "project": {
  10405. // "description": "Project ID for this request.",
  10406. // "location": "path",
  10407. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  10408. // "required": true,
  10409. // "type": "string"
  10410. // }
  10411. // },
  10412. // "path": "{project}/global/backendServices/{backendService}",
  10413. // "request": {
  10414. // "$ref": "BackendService"
  10415. // },
  10416. // "response": {
  10417. // "$ref": "Operation"
  10418. // },
  10419. // "scopes": [
  10420. // "https://www.googleapis.com/auth/cloud-platform",
  10421. // "https://www.googleapis.com/auth/compute"
  10422. // ]
  10423. // }
  10424. }
  10425. // method id "compute.diskTypes.aggregatedList":
  10426. type DiskTypesAggregatedListCall struct {
  10427. s *Service
  10428. project string
  10429. urlParams_ gensupport.URLParams
  10430. ifNoneMatch_ string
  10431. ctx_ context.Context
  10432. }
  10433. // AggregatedList: Retrieves an aggregated list of disk type resources.
  10434. // For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/aggregatedList
  10435. func (r *DiskTypesService) AggregatedList(project string) *DiskTypesAggregatedListCall {
  10436. c := &DiskTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10437. c.project = project
  10438. return c
  10439. }
  10440. // Filter sets the optional parameter "filter": Sets a filter expression
  10441. // for filtering listed resources, in the form filter={expression}. Your
  10442. // {expression} must be in the format: field_name comparison_string
  10443. // literal_string.
  10444. //
  10445. // The field_name is the name of the field you want to compare. Only
  10446. // atomic field types are supported (string, number, boolean). The
  10447. // comparison_string must be either eq (equals) or ne (not equals). The
  10448. // literal_string is the string value to filter to. The literal value
  10449. // must be valid for the type of field you are filtering by (string,
  10450. // number, boolean). For string fields, the literal value is interpreted
  10451. // as a regular expression using RE2 syntax. The literal value must
  10452. // match the entire field.
  10453. //
  10454. // For example, filter=name ne example-instance.
  10455. //
  10456. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  10457. // you can also filter on nested fields. For example, you could filter
  10458. // on instances that have set the scheduling.automaticRestart field to
  10459. // true. In particular, use filtering on nested fields to take advantage
  10460. // of instance labels to organize and filter results based on label
  10461. // values.
  10462. //
  10463. // The Beta API also supports filtering on multiple expressions by
  10464. // providing each separate expression within parentheses. For example,
  10465. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  10466. // Multiple expressions are treated as AND expressions meaning that
  10467. // resources must match all expressions to pass the filters.
  10468. func (c *DiskTypesAggregatedListCall) Filter(filter string) *DiskTypesAggregatedListCall {
  10469. c.urlParams_.Set("filter", filter)
  10470. return c
  10471. }
  10472. // MaxResults sets the optional parameter "maxResults": The maximum
  10473. // number of results per page that Compute Engine should return. If the
  10474. // number of available results is larger than maxResults, Compute Engine
  10475. // returns a nextPageToken that can be used to get the next page of
  10476. // results in subsequent list requests.
  10477. func (c *DiskTypesAggregatedListCall) MaxResults(maxResults int64) *DiskTypesAggregatedListCall {
  10478. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  10479. return c
  10480. }
  10481. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  10482. // a certain order. By default, results are returned in alphanumerical
  10483. // order based on the resource name.
  10484. //
  10485. // You can also sort results in descending order based on the creation
  10486. // timestamp using orderBy="creationTimestamp desc". This sorts results
  10487. // based on the creationTimestamp field in reverse chronological order
  10488. // (newest result first). Use this to sort resources like operations so
  10489. // that the newest operation is returned first.
  10490. //
  10491. // Currently, only sorting by name or creationTimestamp desc is
  10492. // supported.
  10493. func (c *DiskTypesAggregatedListCall) OrderBy(orderBy string) *DiskTypesAggregatedListCall {
  10494. c.urlParams_.Set("orderBy", orderBy)
  10495. return c
  10496. }
  10497. // PageToken sets the optional parameter "pageToken": Specifies a page
  10498. // token to use. Set pageToken to the nextPageToken returned by a
  10499. // previous list request to get the next page of results.
  10500. func (c *DiskTypesAggregatedListCall) PageToken(pageToken string) *DiskTypesAggregatedListCall {
  10501. c.urlParams_.Set("pageToken", pageToken)
  10502. return c
  10503. }
  10504. // Fields allows partial responses to be retrieved. See
  10505. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10506. // for more information.
  10507. func (c *DiskTypesAggregatedListCall) Fields(s ...googleapi.Field) *DiskTypesAggregatedListCall {
  10508. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10509. return c
  10510. }
  10511. // IfNoneMatch sets the optional parameter which makes the operation
  10512. // fail if the object's ETag matches the given value. This is useful for
  10513. // getting updates only after the object has changed since the last
  10514. // request. Use googleapi.IsNotModified to check whether the response
  10515. // error from Do is the result of In-None-Match.
  10516. func (c *DiskTypesAggregatedListCall) IfNoneMatch(entityTag string) *DiskTypesAggregatedListCall {
  10517. c.ifNoneMatch_ = entityTag
  10518. return c
  10519. }
  10520. // Context sets the context to be used in this call's Do method. Any
  10521. // pending HTTP request will be aborted if the provided context is
  10522. // canceled.
  10523. func (c *DiskTypesAggregatedListCall) Context(ctx context.Context) *DiskTypesAggregatedListCall {
  10524. c.ctx_ = ctx
  10525. return c
  10526. }
  10527. func (c *DiskTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  10528. var body io.Reader = nil
  10529. c.urlParams_.Set("alt", alt)
  10530. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/diskTypes")
  10531. urls += "?" + c.urlParams_.Encode()
  10532. req, _ := http.NewRequest("GET", urls, body)
  10533. googleapi.Expand(req.URL, map[string]string{
  10534. "project": c.project,
  10535. })
  10536. req.Header.Set("User-Agent", c.s.userAgent())
  10537. if c.ifNoneMatch_ != "" {
  10538. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  10539. }
  10540. if c.ctx_ != nil {
  10541. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10542. }
  10543. return c.s.client.Do(req)
  10544. }
  10545. // Do executes the "compute.diskTypes.aggregatedList" call.
  10546. // Exactly one of *DiskTypeAggregatedList or error will be non-nil. Any
  10547. // non-2xx status code is an error. Response headers are in either
  10548. // *DiskTypeAggregatedList.ServerResponse.Header or (if a response was
  10549. // returned at all) in error.(*googleapi.Error).Header. Use
  10550. // googleapi.IsNotModified to check whether the returned error was
  10551. // because http.StatusNotModified was returned.
  10552. func (c *DiskTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*DiskTypeAggregatedList, error) {
  10553. gensupport.SetOptions(c.urlParams_, opts...)
  10554. res, err := c.doRequest("json")
  10555. if res != nil && res.StatusCode == http.StatusNotModified {
  10556. if res.Body != nil {
  10557. res.Body.Close()
  10558. }
  10559. return nil, &googleapi.Error{
  10560. Code: res.StatusCode,
  10561. Header: res.Header,
  10562. }
  10563. }
  10564. if err != nil {
  10565. return nil, err
  10566. }
  10567. defer googleapi.CloseBody(res)
  10568. if err := googleapi.CheckResponse(res); err != nil {
  10569. return nil, err
  10570. }
  10571. ret := &DiskTypeAggregatedList{
  10572. ServerResponse: googleapi.ServerResponse{
  10573. Header: res.Header,
  10574. HTTPStatusCode: res.StatusCode,
  10575. },
  10576. }
  10577. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  10578. return nil, err
  10579. }
  10580. return ret, nil
  10581. // {
  10582. // "description": "Retrieves an aggregated list of disk type resources.",
  10583. // "httpMethod": "GET",
  10584. // "id": "compute.diskTypes.aggregatedList",
  10585. // "parameterOrder": [
  10586. // "project"
  10587. // ],
  10588. // "parameters": {
  10589. // "filter": {
  10590. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  10591. // "location": "query",
  10592. // "type": "string"
  10593. // },
  10594. // "maxResults": {
  10595. // "default": "500",
  10596. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  10597. // "format": "uint32",
  10598. // "location": "query",
  10599. // "maximum": "500",
  10600. // "minimum": "0",
  10601. // "type": "integer"
  10602. // },
  10603. // "orderBy": {
  10604. // "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.",
  10605. // "location": "query",
  10606. // "type": "string"
  10607. // },
  10608. // "pageToken": {
  10609. // "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.",
  10610. // "location": "query",
  10611. // "type": "string"
  10612. // },
  10613. // "project": {
  10614. // "description": "Project ID for this request.",
  10615. // "location": "path",
  10616. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  10617. // "required": true,
  10618. // "type": "string"
  10619. // }
  10620. // },
  10621. // "path": "{project}/aggregated/diskTypes",
  10622. // "response": {
  10623. // "$ref": "DiskTypeAggregatedList"
  10624. // },
  10625. // "scopes": [
  10626. // "https://www.googleapis.com/auth/cloud-platform",
  10627. // "https://www.googleapis.com/auth/compute",
  10628. // "https://www.googleapis.com/auth/compute.readonly"
  10629. // ]
  10630. // }
  10631. }
  10632. // Pages invokes f for each page of results.
  10633. // A non-nil error returned from f will halt the iteration.
  10634. // The provided context supersedes any context provided to the Context method.
  10635. func (c *DiskTypesAggregatedListCall) Pages(ctx context.Context, f func(*DiskTypeAggregatedList) error) error {
  10636. c.ctx_ = ctx
  10637. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  10638. for {
  10639. x, err := c.Do()
  10640. if err != nil {
  10641. return err
  10642. }
  10643. if err := f(x); err != nil {
  10644. return err
  10645. }
  10646. if x.NextPageToken == "" {
  10647. return nil
  10648. }
  10649. c.PageToken(x.NextPageToken)
  10650. }
  10651. }
  10652. // method id "compute.diskTypes.get":
  10653. type DiskTypesGetCall struct {
  10654. s *Service
  10655. project string
  10656. zone string
  10657. diskType string
  10658. urlParams_ gensupport.URLParams
  10659. ifNoneMatch_ string
  10660. ctx_ context.Context
  10661. }
  10662. // Get: Returns the specified disk type resource.
  10663. // For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/get
  10664. func (r *DiskTypesService) Get(project string, zone string, diskType string) *DiskTypesGetCall {
  10665. c := &DiskTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10666. c.project = project
  10667. c.zone = zone
  10668. c.diskType = diskType
  10669. return c
  10670. }
  10671. // Fields allows partial responses to be retrieved. See
  10672. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10673. // for more information.
  10674. func (c *DiskTypesGetCall) Fields(s ...googleapi.Field) *DiskTypesGetCall {
  10675. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10676. return c
  10677. }
  10678. // IfNoneMatch sets the optional parameter which makes the operation
  10679. // fail if the object's ETag matches the given value. This is useful for
  10680. // getting updates only after the object has changed since the last
  10681. // request. Use googleapi.IsNotModified to check whether the response
  10682. // error from Do is the result of In-None-Match.
  10683. func (c *DiskTypesGetCall) IfNoneMatch(entityTag string) *DiskTypesGetCall {
  10684. c.ifNoneMatch_ = entityTag
  10685. return c
  10686. }
  10687. // Context sets the context to be used in this call's Do method. Any
  10688. // pending HTTP request will be aborted if the provided context is
  10689. // canceled.
  10690. func (c *DiskTypesGetCall) Context(ctx context.Context) *DiskTypesGetCall {
  10691. c.ctx_ = ctx
  10692. return c
  10693. }
  10694. func (c *DiskTypesGetCall) doRequest(alt string) (*http.Response, error) {
  10695. var body io.Reader = nil
  10696. c.urlParams_.Set("alt", alt)
  10697. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/diskTypes/{diskType}")
  10698. urls += "?" + c.urlParams_.Encode()
  10699. req, _ := http.NewRequest("GET", urls, body)
  10700. googleapi.Expand(req.URL, map[string]string{
  10701. "project": c.project,
  10702. "zone": c.zone,
  10703. "diskType": c.diskType,
  10704. })
  10705. req.Header.Set("User-Agent", c.s.userAgent())
  10706. if c.ifNoneMatch_ != "" {
  10707. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  10708. }
  10709. if c.ctx_ != nil {
  10710. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10711. }
  10712. return c.s.client.Do(req)
  10713. }
  10714. // Do executes the "compute.diskTypes.get" call.
  10715. // Exactly one of *DiskType or error will be non-nil. Any non-2xx status
  10716. // code is an error. Response headers are in either
  10717. // *DiskType.ServerResponse.Header or (if a response was returned at
  10718. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10719. // to check whether the returned error was because
  10720. // http.StatusNotModified was returned.
  10721. func (c *DiskTypesGetCall) Do(opts ...googleapi.CallOption) (*DiskType, error) {
  10722. gensupport.SetOptions(c.urlParams_, opts...)
  10723. res, err := c.doRequest("json")
  10724. if res != nil && res.StatusCode == http.StatusNotModified {
  10725. if res.Body != nil {
  10726. res.Body.Close()
  10727. }
  10728. return nil, &googleapi.Error{
  10729. Code: res.StatusCode,
  10730. Header: res.Header,
  10731. }
  10732. }
  10733. if err != nil {
  10734. return nil, err
  10735. }
  10736. defer googleapi.CloseBody(res)
  10737. if err := googleapi.CheckResponse(res); err != nil {
  10738. return nil, err
  10739. }
  10740. ret := &DiskType{
  10741. ServerResponse: googleapi.ServerResponse{
  10742. Header: res.Header,
  10743. HTTPStatusCode: res.StatusCode,
  10744. },
  10745. }
  10746. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  10747. return nil, err
  10748. }
  10749. return ret, nil
  10750. // {
  10751. // "description": "Returns the specified disk type resource.",
  10752. // "httpMethod": "GET",
  10753. // "id": "compute.diskTypes.get",
  10754. // "parameterOrder": [
  10755. // "project",
  10756. // "zone",
  10757. // "diskType"
  10758. // ],
  10759. // "parameters": {
  10760. // "diskType": {
  10761. // "description": "Name of the disk type resource to return.",
  10762. // "location": "path",
  10763. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  10764. // "required": true,
  10765. // "type": "string"
  10766. // },
  10767. // "project": {
  10768. // "description": "Project ID for this request.",
  10769. // "location": "path",
  10770. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  10771. // "required": true,
  10772. // "type": "string"
  10773. // },
  10774. // "zone": {
  10775. // "description": "The name of the zone for this request.",
  10776. // "location": "path",
  10777. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  10778. // "required": true,
  10779. // "type": "string"
  10780. // }
  10781. // },
  10782. // "path": "{project}/zones/{zone}/diskTypes/{diskType}",
  10783. // "response": {
  10784. // "$ref": "DiskType"
  10785. // },
  10786. // "scopes": [
  10787. // "https://www.googleapis.com/auth/cloud-platform",
  10788. // "https://www.googleapis.com/auth/compute",
  10789. // "https://www.googleapis.com/auth/compute.readonly"
  10790. // ]
  10791. // }
  10792. }
  10793. // method id "compute.diskTypes.list":
  10794. type DiskTypesListCall struct {
  10795. s *Service
  10796. project string
  10797. zone string
  10798. urlParams_ gensupport.URLParams
  10799. ifNoneMatch_ string
  10800. ctx_ context.Context
  10801. }
  10802. // List: Retrieves a list of disk type resources available to the
  10803. // specified project.
  10804. // For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/list
  10805. func (r *DiskTypesService) List(project string, zone string) *DiskTypesListCall {
  10806. c := &DiskTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10807. c.project = project
  10808. c.zone = zone
  10809. return c
  10810. }
  10811. // Filter sets the optional parameter "filter": Sets a filter expression
  10812. // for filtering listed resources, in the form filter={expression}. Your
  10813. // {expression} must be in the format: field_name comparison_string
  10814. // literal_string.
  10815. //
  10816. // The field_name is the name of the field you want to compare. Only
  10817. // atomic field types are supported (string, number, boolean). The
  10818. // comparison_string must be either eq (equals) or ne (not equals). The
  10819. // literal_string is the string value to filter to. The literal value
  10820. // must be valid for the type of field you are filtering by (string,
  10821. // number, boolean). For string fields, the literal value is interpreted
  10822. // as a regular expression using RE2 syntax. The literal value must
  10823. // match the entire field.
  10824. //
  10825. // For example, filter=name ne example-instance.
  10826. //
  10827. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  10828. // you can also filter on nested fields. For example, you could filter
  10829. // on instances that have set the scheduling.automaticRestart field to
  10830. // true. In particular, use filtering on nested fields to take advantage
  10831. // of instance labels to organize and filter results based on label
  10832. // values.
  10833. //
  10834. // The Beta API also supports filtering on multiple expressions by
  10835. // providing each separate expression within parentheses. For example,
  10836. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  10837. // Multiple expressions are treated as AND expressions meaning that
  10838. // resources must match all expressions to pass the filters.
  10839. func (c *DiskTypesListCall) Filter(filter string) *DiskTypesListCall {
  10840. c.urlParams_.Set("filter", filter)
  10841. return c
  10842. }
  10843. // MaxResults sets the optional parameter "maxResults": The maximum
  10844. // number of results per page that Compute Engine should return. If the
  10845. // number of available results is larger than maxResults, Compute Engine
  10846. // returns a nextPageToken that can be used to get the next page of
  10847. // results in subsequent list requests.
  10848. func (c *DiskTypesListCall) MaxResults(maxResults int64) *DiskTypesListCall {
  10849. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  10850. return c
  10851. }
  10852. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  10853. // a certain order. By default, results are returned in alphanumerical
  10854. // order based on the resource name.
  10855. //
  10856. // You can also sort results in descending order based on the creation
  10857. // timestamp using orderBy="creationTimestamp desc". This sorts results
  10858. // based on the creationTimestamp field in reverse chronological order
  10859. // (newest result first). Use this to sort resources like operations so
  10860. // that the newest operation is returned first.
  10861. //
  10862. // Currently, only sorting by name or creationTimestamp desc is
  10863. // supported.
  10864. func (c *DiskTypesListCall) OrderBy(orderBy string) *DiskTypesListCall {
  10865. c.urlParams_.Set("orderBy", orderBy)
  10866. return c
  10867. }
  10868. // PageToken sets the optional parameter "pageToken": Specifies a page
  10869. // token to use. Set pageToken to the nextPageToken returned by a
  10870. // previous list request to get the next page of results.
  10871. func (c *DiskTypesListCall) PageToken(pageToken string) *DiskTypesListCall {
  10872. c.urlParams_.Set("pageToken", pageToken)
  10873. return c
  10874. }
  10875. // Fields allows partial responses to be retrieved. See
  10876. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10877. // for more information.
  10878. func (c *DiskTypesListCall) Fields(s ...googleapi.Field) *DiskTypesListCall {
  10879. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10880. return c
  10881. }
  10882. // IfNoneMatch sets the optional parameter which makes the operation
  10883. // fail if the object's ETag matches the given value. This is useful for
  10884. // getting updates only after the object has changed since the last
  10885. // request. Use googleapi.IsNotModified to check whether the response
  10886. // error from Do is the result of In-None-Match.
  10887. func (c *DiskTypesListCall) IfNoneMatch(entityTag string) *DiskTypesListCall {
  10888. c.ifNoneMatch_ = entityTag
  10889. return c
  10890. }
  10891. // Context sets the context to be used in this call's Do method. Any
  10892. // pending HTTP request will be aborted if the provided context is
  10893. // canceled.
  10894. func (c *DiskTypesListCall) Context(ctx context.Context) *DiskTypesListCall {
  10895. c.ctx_ = ctx
  10896. return c
  10897. }
  10898. func (c *DiskTypesListCall) doRequest(alt string) (*http.Response, error) {
  10899. var body io.Reader = nil
  10900. c.urlParams_.Set("alt", alt)
  10901. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/diskTypes")
  10902. urls += "?" + c.urlParams_.Encode()
  10903. req, _ := http.NewRequest("GET", urls, body)
  10904. googleapi.Expand(req.URL, map[string]string{
  10905. "project": c.project,
  10906. "zone": c.zone,
  10907. })
  10908. req.Header.Set("User-Agent", c.s.userAgent())
  10909. if c.ifNoneMatch_ != "" {
  10910. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  10911. }
  10912. if c.ctx_ != nil {
  10913. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10914. }
  10915. return c.s.client.Do(req)
  10916. }
  10917. // Do executes the "compute.diskTypes.list" call.
  10918. // Exactly one of *DiskTypeList or error will be non-nil. Any non-2xx
  10919. // status code is an error. Response headers are in either
  10920. // *DiskTypeList.ServerResponse.Header or (if a response was returned at
  10921. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10922. // to check whether the returned error was because
  10923. // http.StatusNotModified was returned.
  10924. func (c *DiskTypesListCall) Do(opts ...googleapi.CallOption) (*DiskTypeList, error) {
  10925. gensupport.SetOptions(c.urlParams_, opts...)
  10926. res, err := c.doRequest("json")
  10927. if res != nil && res.StatusCode == http.StatusNotModified {
  10928. if res.Body != nil {
  10929. res.Body.Close()
  10930. }
  10931. return nil, &googleapi.Error{
  10932. Code: res.StatusCode,
  10933. Header: res.Header,
  10934. }
  10935. }
  10936. if err != nil {
  10937. return nil, err
  10938. }
  10939. defer googleapi.CloseBody(res)
  10940. if err := googleapi.CheckResponse(res); err != nil {
  10941. return nil, err
  10942. }
  10943. ret := &DiskTypeList{
  10944. ServerResponse: googleapi.ServerResponse{
  10945. Header: res.Header,
  10946. HTTPStatusCode: res.StatusCode,
  10947. },
  10948. }
  10949. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  10950. return nil, err
  10951. }
  10952. return ret, nil
  10953. // {
  10954. // "description": "Retrieves a list of disk type resources available to the specified project.",
  10955. // "httpMethod": "GET",
  10956. // "id": "compute.diskTypes.list",
  10957. // "parameterOrder": [
  10958. // "project",
  10959. // "zone"
  10960. // ],
  10961. // "parameters": {
  10962. // "filter": {
  10963. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  10964. // "location": "query",
  10965. // "type": "string"
  10966. // },
  10967. // "maxResults": {
  10968. // "default": "500",
  10969. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  10970. // "format": "uint32",
  10971. // "location": "query",
  10972. // "maximum": "500",
  10973. // "minimum": "0",
  10974. // "type": "integer"
  10975. // },
  10976. // "orderBy": {
  10977. // "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.",
  10978. // "location": "query",
  10979. // "type": "string"
  10980. // },
  10981. // "pageToken": {
  10982. // "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.",
  10983. // "location": "query",
  10984. // "type": "string"
  10985. // },
  10986. // "project": {
  10987. // "description": "Project ID for this request.",
  10988. // "location": "path",
  10989. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  10990. // "required": true,
  10991. // "type": "string"
  10992. // },
  10993. // "zone": {
  10994. // "description": "The name of the zone for this request.",
  10995. // "location": "path",
  10996. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  10997. // "required": true,
  10998. // "type": "string"
  10999. // }
  11000. // },
  11001. // "path": "{project}/zones/{zone}/diskTypes",
  11002. // "response": {
  11003. // "$ref": "DiskTypeList"
  11004. // },
  11005. // "scopes": [
  11006. // "https://www.googleapis.com/auth/cloud-platform",
  11007. // "https://www.googleapis.com/auth/compute",
  11008. // "https://www.googleapis.com/auth/compute.readonly"
  11009. // ]
  11010. // }
  11011. }
  11012. // Pages invokes f for each page of results.
  11013. // A non-nil error returned from f will halt the iteration.
  11014. // The provided context supersedes any context provided to the Context method.
  11015. func (c *DiskTypesListCall) Pages(ctx context.Context, f func(*DiskTypeList) error) error {
  11016. c.ctx_ = ctx
  11017. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  11018. for {
  11019. x, err := c.Do()
  11020. if err != nil {
  11021. return err
  11022. }
  11023. if err := f(x); err != nil {
  11024. return err
  11025. }
  11026. if x.NextPageToken == "" {
  11027. return nil
  11028. }
  11029. c.PageToken(x.NextPageToken)
  11030. }
  11031. }
  11032. // method id "compute.disks.aggregatedList":
  11033. type DisksAggregatedListCall struct {
  11034. s *Service
  11035. project string
  11036. urlParams_ gensupport.URLParams
  11037. ifNoneMatch_ string
  11038. ctx_ context.Context
  11039. }
  11040. // AggregatedList: Retrieves an aggregated list of persistent disks.
  11041. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/aggregatedList
  11042. func (r *DisksService) AggregatedList(project string) *DisksAggregatedListCall {
  11043. c := &DisksAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11044. c.project = project
  11045. return c
  11046. }
  11047. // Filter sets the optional parameter "filter": Sets a filter expression
  11048. // for filtering listed resources, in the form filter={expression}. Your
  11049. // {expression} must be in the format: field_name comparison_string
  11050. // literal_string.
  11051. //
  11052. // The field_name is the name of the field you want to compare. Only
  11053. // atomic field types are supported (string, number, boolean). The
  11054. // comparison_string must be either eq (equals) or ne (not equals). The
  11055. // literal_string is the string value to filter to. The literal value
  11056. // must be valid for the type of field you are filtering by (string,
  11057. // number, boolean). For string fields, the literal value is interpreted
  11058. // as a regular expression using RE2 syntax. The literal value must
  11059. // match the entire field.
  11060. //
  11061. // For example, filter=name ne example-instance.
  11062. //
  11063. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  11064. // you can also filter on nested fields. For example, you could filter
  11065. // on instances that have set the scheduling.automaticRestart field to
  11066. // true. In particular, use filtering on nested fields to take advantage
  11067. // of instance labels to organize and filter results based on label
  11068. // values.
  11069. //
  11070. // The Beta API also supports filtering on multiple expressions by
  11071. // providing each separate expression within parentheses. For example,
  11072. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  11073. // Multiple expressions are treated as AND expressions meaning that
  11074. // resources must match all expressions to pass the filters.
  11075. func (c *DisksAggregatedListCall) Filter(filter string) *DisksAggregatedListCall {
  11076. c.urlParams_.Set("filter", filter)
  11077. return c
  11078. }
  11079. // MaxResults sets the optional parameter "maxResults": The maximum
  11080. // number of results per page that Compute Engine should return. If the
  11081. // number of available results is larger than maxResults, Compute Engine
  11082. // returns a nextPageToken that can be used to get the next page of
  11083. // results in subsequent list requests.
  11084. func (c *DisksAggregatedListCall) MaxResults(maxResults int64) *DisksAggregatedListCall {
  11085. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  11086. return c
  11087. }
  11088. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  11089. // a certain order. By default, results are returned in alphanumerical
  11090. // order based on the resource name.
  11091. //
  11092. // You can also sort results in descending order based on the creation
  11093. // timestamp using orderBy="creationTimestamp desc". This sorts results
  11094. // based on the creationTimestamp field in reverse chronological order
  11095. // (newest result first). Use this to sort resources like operations so
  11096. // that the newest operation is returned first.
  11097. //
  11098. // Currently, only sorting by name or creationTimestamp desc is
  11099. // supported.
  11100. func (c *DisksAggregatedListCall) OrderBy(orderBy string) *DisksAggregatedListCall {
  11101. c.urlParams_.Set("orderBy", orderBy)
  11102. return c
  11103. }
  11104. // PageToken sets the optional parameter "pageToken": Specifies a page
  11105. // token to use. Set pageToken to the nextPageToken returned by a
  11106. // previous list request to get the next page of results.
  11107. func (c *DisksAggregatedListCall) PageToken(pageToken string) *DisksAggregatedListCall {
  11108. c.urlParams_.Set("pageToken", pageToken)
  11109. return c
  11110. }
  11111. // Fields allows partial responses to be retrieved. See
  11112. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11113. // for more information.
  11114. func (c *DisksAggregatedListCall) Fields(s ...googleapi.Field) *DisksAggregatedListCall {
  11115. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11116. return c
  11117. }
  11118. // IfNoneMatch sets the optional parameter which makes the operation
  11119. // fail if the object's ETag matches the given value. This is useful for
  11120. // getting updates only after the object has changed since the last
  11121. // request. Use googleapi.IsNotModified to check whether the response
  11122. // error from Do is the result of In-None-Match.
  11123. func (c *DisksAggregatedListCall) IfNoneMatch(entityTag string) *DisksAggregatedListCall {
  11124. c.ifNoneMatch_ = entityTag
  11125. return c
  11126. }
  11127. // Context sets the context to be used in this call's Do method. Any
  11128. // pending HTTP request will be aborted if the provided context is
  11129. // canceled.
  11130. func (c *DisksAggregatedListCall) Context(ctx context.Context) *DisksAggregatedListCall {
  11131. c.ctx_ = ctx
  11132. return c
  11133. }
  11134. func (c *DisksAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  11135. var body io.Reader = nil
  11136. c.urlParams_.Set("alt", alt)
  11137. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/disks")
  11138. urls += "?" + c.urlParams_.Encode()
  11139. req, _ := http.NewRequest("GET", urls, body)
  11140. googleapi.Expand(req.URL, map[string]string{
  11141. "project": c.project,
  11142. })
  11143. req.Header.Set("User-Agent", c.s.userAgent())
  11144. if c.ifNoneMatch_ != "" {
  11145. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  11146. }
  11147. if c.ctx_ != nil {
  11148. return ctxhttp.Do(c.ctx_, c.s.client, req)
  11149. }
  11150. return c.s.client.Do(req)
  11151. }
  11152. // Do executes the "compute.disks.aggregatedList" call.
  11153. // Exactly one of *DiskAggregatedList or error will be non-nil. Any
  11154. // non-2xx status code is an error. Response headers are in either
  11155. // *DiskAggregatedList.ServerResponse.Header or (if a response was
  11156. // returned at all) in error.(*googleapi.Error).Header. Use
  11157. // googleapi.IsNotModified to check whether the returned error was
  11158. // because http.StatusNotModified was returned.
  11159. func (c *DisksAggregatedListCall) Do(opts ...googleapi.CallOption) (*DiskAggregatedList, error) {
  11160. gensupport.SetOptions(c.urlParams_, opts...)
  11161. res, err := c.doRequest("json")
  11162. if res != nil && res.StatusCode == http.StatusNotModified {
  11163. if res.Body != nil {
  11164. res.Body.Close()
  11165. }
  11166. return nil, &googleapi.Error{
  11167. Code: res.StatusCode,
  11168. Header: res.Header,
  11169. }
  11170. }
  11171. if err != nil {
  11172. return nil, err
  11173. }
  11174. defer googleapi.CloseBody(res)
  11175. if err := googleapi.CheckResponse(res); err != nil {
  11176. return nil, err
  11177. }
  11178. ret := &DiskAggregatedList{
  11179. ServerResponse: googleapi.ServerResponse{
  11180. Header: res.Header,
  11181. HTTPStatusCode: res.StatusCode,
  11182. },
  11183. }
  11184. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  11185. return nil, err
  11186. }
  11187. return ret, nil
  11188. // {
  11189. // "description": "Retrieves an aggregated list of persistent disks.",
  11190. // "httpMethod": "GET",
  11191. // "id": "compute.disks.aggregatedList",
  11192. // "parameterOrder": [
  11193. // "project"
  11194. // ],
  11195. // "parameters": {
  11196. // "filter": {
  11197. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  11198. // "location": "query",
  11199. // "type": "string"
  11200. // },
  11201. // "maxResults": {
  11202. // "default": "500",
  11203. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  11204. // "format": "uint32",
  11205. // "location": "query",
  11206. // "maximum": "500",
  11207. // "minimum": "0",
  11208. // "type": "integer"
  11209. // },
  11210. // "orderBy": {
  11211. // "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.",
  11212. // "location": "query",
  11213. // "type": "string"
  11214. // },
  11215. // "pageToken": {
  11216. // "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.",
  11217. // "location": "query",
  11218. // "type": "string"
  11219. // },
  11220. // "project": {
  11221. // "description": "Project ID for this request.",
  11222. // "location": "path",
  11223. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  11224. // "required": true,
  11225. // "type": "string"
  11226. // }
  11227. // },
  11228. // "path": "{project}/aggregated/disks",
  11229. // "response": {
  11230. // "$ref": "DiskAggregatedList"
  11231. // },
  11232. // "scopes": [
  11233. // "https://www.googleapis.com/auth/cloud-platform",
  11234. // "https://www.googleapis.com/auth/compute",
  11235. // "https://www.googleapis.com/auth/compute.readonly"
  11236. // ]
  11237. // }
  11238. }
  11239. // Pages invokes f for each page of results.
  11240. // A non-nil error returned from f will halt the iteration.
  11241. // The provided context supersedes any context provided to the Context method.
  11242. func (c *DisksAggregatedListCall) Pages(ctx context.Context, f func(*DiskAggregatedList) error) error {
  11243. c.ctx_ = ctx
  11244. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  11245. for {
  11246. x, err := c.Do()
  11247. if err != nil {
  11248. return err
  11249. }
  11250. if err := f(x); err != nil {
  11251. return err
  11252. }
  11253. if x.NextPageToken == "" {
  11254. return nil
  11255. }
  11256. c.PageToken(x.NextPageToken)
  11257. }
  11258. }
  11259. // method id "compute.disks.createSnapshot":
  11260. type DisksCreateSnapshotCall struct {
  11261. s *Service
  11262. project string
  11263. zone string
  11264. disk string
  11265. snapshot *Snapshot
  11266. urlParams_ gensupport.URLParams
  11267. ctx_ context.Context
  11268. }
  11269. // CreateSnapshot: Creates a snapshot of a specified persistent disk.
  11270. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/createSnapshot
  11271. func (r *DisksService) CreateSnapshot(project string, zone string, disk string, snapshot *Snapshot) *DisksCreateSnapshotCall {
  11272. c := &DisksCreateSnapshotCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11273. c.project = project
  11274. c.zone = zone
  11275. c.disk = disk
  11276. c.snapshot = snapshot
  11277. return c
  11278. }
  11279. // Fields allows partial responses to be retrieved. See
  11280. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11281. // for more information.
  11282. func (c *DisksCreateSnapshotCall) Fields(s ...googleapi.Field) *DisksCreateSnapshotCall {
  11283. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11284. return c
  11285. }
  11286. // Context sets the context to be used in this call's Do method. Any
  11287. // pending HTTP request will be aborted if the provided context is
  11288. // canceled.
  11289. func (c *DisksCreateSnapshotCall) Context(ctx context.Context) *DisksCreateSnapshotCall {
  11290. c.ctx_ = ctx
  11291. return c
  11292. }
  11293. func (c *DisksCreateSnapshotCall) doRequest(alt string) (*http.Response, error) {
  11294. var body io.Reader = nil
  11295. body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot)
  11296. if err != nil {
  11297. return nil, err
  11298. }
  11299. ctype := "application/json"
  11300. c.urlParams_.Set("alt", alt)
  11301. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}/createSnapshot")
  11302. urls += "?" + c.urlParams_.Encode()
  11303. req, _ := http.NewRequest("POST", urls, body)
  11304. googleapi.Expand(req.URL, map[string]string{
  11305. "project": c.project,
  11306. "zone": c.zone,
  11307. "disk": c.disk,
  11308. })
  11309. req.Header.Set("Content-Type", ctype)
  11310. req.Header.Set("User-Agent", c.s.userAgent())
  11311. if c.ctx_ != nil {
  11312. return ctxhttp.Do(c.ctx_, c.s.client, req)
  11313. }
  11314. return c.s.client.Do(req)
  11315. }
  11316. // Do executes the "compute.disks.createSnapshot" call.
  11317. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  11318. // status code is an error. Response headers are in either
  11319. // *Operation.ServerResponse.Header or (if a response was returned at
  11320. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11321. // to check whether the returned error was because
  11322. // http.StatusNotModified was returned.
  11323. func (c *DisksCreateSnapshotCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  11324. gensupport.SetOptions(c.urlParams_, opts...)
  11325. res, err := c.doRequest("json")
  11326. if res != nil && res.StatusCode == http.StatusNotModified {
  11327. if res.Body != nil {
  11328. res.Body.Close()
  11329. }
  11330. return nil, &googleapi.Error{
  11331. Code: res.StatusCode,
  11332. Header: res.Header,
  11333. }
  11334. }
  11335. if err != nil {
  11336. return nil, err
  11337. }
  11338. defer googleapi.CloseBody(res)
  11339. if err := googleapi.CheckResponse(res); err != nil {
  11340. return nil, err
  11341. }
  11342. ret := &Operation{
  11343. ServerResponse: googleapi.ServerResponse{
  11344. Header: res.Header,
  11345. HTTPStatusCode: res.StatusCode,
  11346. },
  11347. }
  11348. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  11349. return nil, err
  11350. }
  11351. return ret, nil
  11352. // {
  11353. // "description": "Creates a snapshot of a specified persistent disk.",
  11354. // "httpMethod": "POST",
  11355. // "id": "compute.disks.createSnapshot",
  11356. // "parameterOrder": [
  11357. // "project",
  11358. // "zone",
  11359. // "disk"
  11360. // ],
  11361. // "parameters": {
  11362. // "disk": {
  11363. // "description": "Name of the persistent disk to snapshot.",
  11364. // "location": "path",
  11365. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  11366. // "required": true,
  11367. // "type": "string"
  11368. // },
  11369. // "project": {
  11370. // "description": "Project ID for this request.",
  11371. // "location": "path",
  11372. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  11373. // "required": true,
  11374. // "type": "string"
  11375. // },
  11376. // "zone": {
  11377. // "description": "The name of the zone for this request.",
  11378. // "location": "path",
  11379. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  11380. // "required": true,
  11381. // "type": "string"
  11382. // }
  11383. // },
  11384. // "path": "{project}/zones/{zone}/disks/{disk}/createSnapshot",
  11385. // "request": {
  11386. // "$ref": "Snapshot"
  11387. // },
  11388. // "response": {
  11389. // "$ref": "Operation"
  11390. // },
  11391. // "scopes": [
  11392. // "https://www.googleapis.com/auth/cloud-platform",
  11393. // "https://www.googleapis.com/auth/compute"
  11394. // ]
  11395. // }
  11396. }
  11397. // method id "compute.disks.delete":
  11398. type DisksDeleteCall struct {
  11399. s *Service
  11400. project string
  11401. zone string
  11402. disk string
  11403. urlParams_ gensupport.URLParams
  11404. ctx_ context.Context
  11405. }
  11406. // Delete: Deletes the specified persistent disk. Deleting a disk
  11407. // removes its data permanently and is irreversible. However, deleting a
  11408. // disk does not delete any snapshots previously made from the disk. You
  11409. // must separately delete snapshots.
  11410. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/delete
  11411. func (r *DisksService) Delete(project string, zone string, disk string) *DisksDeleteCall {
  11412. c := &DisksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11413. c.project = project
  11414. c.zone = zone
  11415. c.disk = disk
  11416. return c
  11417. }
  11418. // Fields allows partial responses to be retrieved. See
  11419. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11420. // for more information.
  11421. func (c *DisksDeleteCall) Fields(s ...googleapi.Field) *DisksDeleteCall {
  11422. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11423. return c
  11424. }
  11425. // Context sets the context to be used in this call's Do method. Any
  11426. // pending HTTP request will be aborted if the provided context is
  11427. // canceled.
  11428. func (c *DisksDeleteCall) Context(ctx context.Context) *DisksDeleteCall {
  11429. c.ctx_ = ctx
  11430. return c
  11431. }
  11432. func (c *DisksDeleteCall) doRequest(alt string) (*http.Response, error) {
  11433. var body io.Reader = nil
  11434. c.urlParams_.Set("alt", alt)
  11435. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}")
  11436. urls += "?" + c.urlParams_.Encode()
  11437. req, _ := http.NewRequest("DELETE", urls, body)
  11438. googleapi.Expand(req.URL, map[string]string{
  11439. "project": c.project,
  11440. "zone": c.zone,
  11441. "disk": c.disk,
  11442. })
  11443. req.Header.Set("User-Agent", c.s.userAgent())
  11444. if c.ctx_ != nil {
  11445. return ctxhttp.Do(c.ctx_, c.s.client, req)
  11446. }
  11447. return c.s.client.Do(req)
  11448. }
  11449. // Do executes the "compute.disks.delete" call.
  11450. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  11451. // status code is an error. Response headers are in either
  11452. // *Operation.ServerResponse.Header or (if a response was returned at
  11453. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11454. // to check whether the returned error was because
  11455. // http.StatusNotModified was returned.
  11456. func (c *DisksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  11457. gensupport.SetOptions(c.urlParams_, opts...)
  11458. res, err := c.doRequest("json")
  11459. if res != nil && res.StatusCode == http.StatusNotModified {
  11460. if res.Body != nil {
  11461. res.Body.Close()
  11462. }
  11463. return nil, &googleapi.Error{
  11464. Code: res.StatusCode,
  11465. Header: res.Header,
  11466. }
  11467. }
  11468. if err != nil {
  11469. return nil, err
  11470. }
  11471. defer googleapi.CloseBody(res)
  11472. if err := googleapi.CheckResponse(res); err != nil {
  11473. return nil, err
  11474. }
  11475. ret := &Operation{
  11476. ServerResponse: googleapi.ServerResponse{
  11477. Header: res.Header,
  11478. HTTPStatusCode: res.StatusCode,
  11479. },
  11480. }
  11481. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  11482. return nil, err
  11483. }
  11484. return ret, nil
  11485. // {
  11486. // "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.",
  11487. // "httpMethod": "DELETE",
  11488. // "id": "compute.disks.delete",
  11489. // "parameterOrder": [
  11490. // "project",
  11491. // "zone",
  11492. // "disk"
  11493. // ],
  11494. // "parameters": {
  11495. // "disk": {
  11496. // "description": "Name of the persistent disk to delete.",
  11497. // "location": "path",
  11498. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  11499. // "required": true,
  11500. // "type": "string"
  11501. // },
  11502. // "project": {
  11503. // "description": "Project ID for this request.",
  11504. // "location": "path",
  11505. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  11506. // "required": true,
  11507. // "type": "string"
  11508. // },
  11509. // "zone": {
  11510. // "description": "The name of the zone for this request.",
  11511. // "location": "path",
  11512. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  11513. // "required": true,
  11514. // "type": "string"
  11515. // }
  11516. // },
  11517. // "path": "{project}/zones/{zone}/disks/{disk}",
  11518. // "response": {
  11519. // "$ref": "Operation"
  11520. // },
  11521. // "scopes": [
  11522. // "https://www.googleapis.com/auth/cloud-platform",
  11523. // "https://www.googleapis.com/auth/compute"
  11524. // ]
  11525. // }
  11526. }
  11527. // method id "compute.disks.get":
  11528. type DisksGetCall struct {
  11529. s *Service
  11530. project string
  11531. zone string
  11532. disk string
  11533. urlParams_ gensupport.URLParams
  11534. ifNoneMatch_ string
  11535. ctx_ context.Context
  11536. }
  11537. // Get: Returns a specified persistent disk.
  11538. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/get
  11539. func (r *DisksService) Get(project string, zone string, disk string) *DisksGetCall {
  11540. c := &DisksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11541. c.project = project
  11542. c.zone = zone
  11543. c.disk = disk
  11544. return c
  11545. }
  11546. // Fields allows partial responses to be retrieved. See
  11547. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11548. // for more information.
  11549. func (c *DisksGetCall) Fields(s ...googleapi.Field) *DisksGetCall {
  11550. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11551. return c
  11552. }
  11553. // IfNoneMatch sets the optional parameter which makes the operation
  11554. // fail if the object's ETag matches the given value. This is useful for
  11555. // getting updates only after the object has changed since the last
  11556. // request. Use googleapi.IsNotModified to check whether the response
  11557. // error from Do is the result of In-None-Match.
  11558. func (c *DisksGetCall) IfNoneMatch(entityTag string) *DisksGetCall {
  11559. c.ifNoneMatch_ = entityTag
  11560. return c
  11561. }
  11562. // Context sets the context to be used in this call's Do method. Any
  11563. // pending HTTP request will be aborted if the provided context is
  11564. // canceled.
  11565. func (c *DisksGetCall) Context(ctx context.Context) *DisksGetCall {
  11566. c.ctx_ = ctx
  11567. return c
  11568. }
  11569. func (c *DisksGetCall) doRequest(alt string) (*http.Response, error) {
  11570. var body io.Reader = nil
  11571. c.urlParams_.Set("alt", alt)
  11572. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}")
  11573. urls += "?" + c.urlParams_.Encode()
  11574. req, _ := http.NewRequest("GET", urls, body)
  11575. googleapi.Expand(req.URL, map[string]string{
  11576. "project": c.project,
  11577. "zone": c.zone,
  11578. "disk": c.disk,
  11579. })
  11580. req.Header.Set("User-Agent", c.s.userAgent())
  11581. if c.ifNoneMatch_ != "" {
  11582. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  11583. }
  11584. if c.ctx_ != nil {
  11585. return ctxhttp.Do(c.ctx_, c.s.client, req)
  11586. }
  11587. return c.s.client.Do(req)
  11588. }
  11589. // Do executes the "compute.disks.get" call.
  11590. // Exactly one of *Disk or error will be non-nil. Any non-2xx status
  11591. // code is an error. Response headers are in either
  11592. // *Disk.ServerResponse.Header or (if a response was returned at all) in
  11593. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  11594. // whether the returned error was because http.StatusNotModified was
  11595. // returned.
  11596. func (c *DisksGetCall) Do(opts ...googleapi.CallOption) (*Disk, error) {
  11597. gensupport.SetOptions(c.urlParams_, opts...)
  11598. res, err := c.doRequest("json")
  11599. if res != nil && res.StatusCode == http.StatusNotModified {
  11600. if res.Body != nil {
  11601. res.Body.Close()
  11602. }
  11603. return nil, &googleapi.Error{
  11604. Code: res.StatusCode,
  11605. Header: res.Header,
  11606. }
  11607. }
  11608. if err != nil {
  11609. return nil, err
  11610. }
  11611. defer googleapi.CloseBody(res)
  11612. if err := googleapi.CheckResponse(res); err != nil {
  11613. return nil, err
  11614. }
  11615. ret := &Disk{
  11616. ServerResponse: googleapi.ServerResponse{
  11617. Header: res.Header,
  11618. HTTPStatusCode: res.StatusCode,
  11619. },
  11620. }
  11621. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  11622. return nil, err
  11623. }
  11624. return ret, nil
  11625. // {
  11626. // "description": "Returns a specified persistent disk.",
  11627. // "httpMethod": "GET",
  11628. // "id": "compute.disks.get",
  11629. // "parameterOrder": [
  11630. // "project",
  11631. // "zone",
  11632. // "disk"
  11633. // ],
  11634. // "parameters": {
  11635. // "disk": {
  11636. // "description": "Name of the persistent disk to return.",
  11637. // "location": "path",
  11638. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  11639. // "required": true,
  11640. // "type": "string"
  11641. // },
  11642. // "project": {
  11643. // "description": "Project ID for this request.",
  11644. // "location": "path",
  11645. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  11646. // "required": true,
  11647. // "type": "string"
  11648. // },
  11649. // "zone": {
  11650. // "description": "The name of the zone for this request.",
  11651. // "location": "path",
  11652. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  11653. // "required": true,
  11654. // "type": "string"
  11655. // }
  11656. // },
  11657. // "path": "{project}/zones/{zone}/disks/{disk}",
  11658. // "response": {
  11659. // "$ref": "Disk"
  11660. // },
  11661. // "scopes": [
  11662. // "https://www.googleapis.com/auth/cloud-platform",
  11663. // "https://www.googleapis.com/auth/compute",
  11664. // "https://www.googleapis.com/auth/compute.readonly"
  11665. // ]
  11666. // }
  11667. }
  11668. // method id "compute.disks.insert":
  11669. type DisksInsertCall struct {
  11670. s *Service
  11671. project string
  11672. zone string
  11673. disk *Disk
  11674. urlParams_ gensupport.URLParams
  11675. ctx_ context.Context
  11676. }
  11677. // Insert: Creates a persistent disk in the specified project using the
  11678. // data included in the request.
  11679. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/insert
  11680. func (r *DisksService) Insert(project string, zone string, disk *Disk) *DisksInsertCall {
  11681. c := &DisksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11682. c.project = project
  11683. c.zone = zone
  11684. c.disk = disk
  11685. return c
  11686. }
  11687. // SourceImage sets the optional parameter "sourceImage": Source image
  11688. // to restore onto a disk.
  11689. func (c *DisksInsertCall) SourceImage(sourceImage string) *DisksInsertCall {
  11690. c.urlParams_.Set("sourceImage", sourceImage)
  11691. return c
  11692. }
  11693. // Fields allows partial responses to be retrieved. See
  11694. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11695. // for more information.
  11696. func (c *DisksInsertCall) Fields(s ...googleapi.Field) *DisksInsertCall {
  11697. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11698. return c
  11699. }
  11700. // Context sets the context to be used in this call's Do method. Any
  11701. // pending HTTP request will be aborted if the provided context is
  11702. // canceled.
  11703. func (c *DisksInsertCall) Context(ctx context.Context) *DisksInsertCall {
  11704. c.ctx_ = ctx
  11705. return c
  11706. }
  11707. func (c *DisksInsertCall) doRequest(alt string) (*http.Response, error) {
  11708. var body io.Reader = nil
  11709. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk)
  11710. if err != nil {
  11711. return nil, err
  11712. }
  11713. ctype := "application/json"
  11714. c.urlParams_.Set("alt", alt)
  11715. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks")
  11716. urls += "?" + c.urlParams_.Encode()
  11717. req, _ := http.NewRequest("POST", urls, body)
  11718. googleapi.Expand(req.URL, map[string]string{
  11719. "project": c.project,
  11720. "zone": c.zone,
  11721. })
  11722. req.Header.Set("Content-Type", ctype)
  11723. req.Header.Set("User-Agent", c.s.userAgent())
  11724. if c.ctx_ != nil {
  11725. return ctxhttp.Do(c.ctx_, c.s.client, req)
  11726. }
  11727. return c.s.client.Do(req)
  11728. }
  11729. // Do executes the "compute.disks.insert" call.
  11730. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  11731. // status code is an error. Response headers are in either
  11732. // *Operation.ServerResponse.Header or (if a response was returned at
  11733. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11734. // to check whether the returned error was because
  11735. // http.StatusNotModified was returned.
  11736. func (c *DisksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  11737. gensupport.SetOptions(c.urlParams_, opts...)
  11738. res, err := c.doRequest("json")
  11739. if res != nil && res.StatusCode == http.StatusNotModified {
  11740. if res.Body != nil {
  11741. res.Body.Close()
  11742. }
  11743. return nil, &googleapi.Error{
  11744. Code: res.StatusCode,
  11745. Header: res.Header,
  11746. }
  11747. }
  11748. if err != nil {
  11749. return nil, err
  11750. }
  11751. defer googleapi.CloseBody(res)
  11752. if err := googleapi.CheckResponse(res); err != nil {
  11753. return nil, err
  11754. }
  11755. ret := &Operation{
  11756. ServerResponse: googleapi.ServerResponse{
  11757. Header: res.Header,
  11758. HTTPStatusCode: res.StatusCode,
  11759. },
  11760. }
  11761. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  11762. return nil, err
  11763. }
  11764. return ret, nil
  11765. // {
  11766. // "description": "Creates a persistent disk in the specified project using the data included in the request.",
  11767. // "httpMethod": "POST",
  11768. // "id": "compute.disks.insert",
  11769. // "parameterOrder": [
  11770. // "project",
  11771. // "zone"
  11772. // ],
  11773. // "parameters": {
  11774. // "project": {
  11775. // "description": "Project ID for this request.",
  11776. // "location": "path",
  11777. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  11778. // "required": true,
  11779. // "type": "string"
  11780. // },
  11781. // "sourceImage": {
  11782. // "description": "Optional. Source image to restore onto a disk.",
  11783. // "location": "query",
  11784. // "type": "string"
  11785. // },
  11786. // "zone": {
  11787. // "description": "The name of the zone for this request.",
  11788. // "location": "path",
  11789. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  11790. // "required": true,
  11791. // "type": "string"
  11792. // }
  11793. // },
  11794. // "path": "{project}/zones/{zone}/disks",
  11795. // "request": {
  11796. // "$ref": "Disk"
  11797. // },
  11798. // "response": {
  11799. // "$ref": "Operation"
  11800. // },
  11801. // "scopes": [
  11802. // "https://www.googleapis.com/auth/cloud-platform",
  11803. // "https://www.googleapis.com/auth/compute"
  11804. // ]
  11805. // }
  11806. }
  11807. // method id "compute.disks.list":
  11808. type DisksListCall struct {
  11809. s *Service
  11810. project string
  11811. zone string
  11812. urlParams_ gensupport.URLParams
  11813. ifNoneMatch_ string
  11814. ctx_ context.Context
  11815. }
  11816. // List: Retrieves a list of persistent disks contained within the
  11817. // specified zone.
  11818. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/list
  11819. func (r *DisksService) List(project string, zone string) *DisksListCall {
  11820. c := &DisksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11821. c.project = project
  11822. c.zone = zone
  11823. return c
  11824. }
  11825. // Filter sets the optional parameter "filter": Sets a filter expression
  11826. // for filtering listed resources, in the form filter={expression}. Your
  11827. // {expression} must be in the format: field_name comparison_string
  11828. // literal_string.
  11829. //
  11830. // The field_name is the name of the field you want to compare. Only
  11831. // atomic field types are supported (string, number, boolean). The
  11832. // comparison_string must be either eq (equals) or ne (not equals). The
  11833. // literal_string is the string value to filter to. The literal value
  11834. // must be valid for the type of field you are filtering by (string,
  11835. // number, boolean). For string fields, the literal value is interpreted
  11836. // as a regular expression using RE2 syntax. The literal value must
  11837. // match the entire field.
  11838. //
  11839. // For example, filter=name ne example-instance.
  11840. //
  11841. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  11842. // you can also filter on nested fields. For example, you could filter
  11843. // on instances that have set the scheduling.automaticRestart field to
  11844. // true. In particular, use filtering on nested fields to take advantage
  11845. // of instance labels to organize and filter results based on label
  11846. // values.
  11847. //
  11848. // The Beta API also supports filtering on multiple expressions by
  11849. // providing each separate expression within parentheses. For example,
  11850. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  11851. // Multiple expressions are treated as AND expressions meaning that
  11852. // resources must match all expressions to pass the filters.
  11853. func (c *DisksListCall) Filter(filter string) *DisksListCall {
  11854. c.urlParams_.Set("filter", filter)
  11855. return c
  11856. }
  11857. // MaxResults sets the optional parameter "maxResults": The maximum
  11858. // number of results per page that Compute Engine should return. If the
  11859. // number of available results is larger than maxResults, Compute Engine
  11860. // returns a nextPageToken that can be used to get the next page of
  11861. // results in subsequent list requests.
  11862. func (c *DisksListCall) MaxResults(maxResults int64) *DisksListCall {
  11863. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  11864. return c
  11865. }
  11866. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  11867. // a certain order. By default, results are returned in alphanumerical
  11868. // order based on the resource name.
  11869. //
  11870. // You can also sort results in descending order based on the creation
  11871. // timestamp using orderBy="creationTimestamp desc". This sorts results
  11872. // based on the creationTimestamp field in reverse chronological order
  11873. // (newest result first). Use this to sort resources like operations so
  11874. // that the newest operation is returned first.
  11875. //
  11876. // Currently, only sorting by name or creationTimestamp desc is
  11877. // supported.
  11878. func (c *DisksListCall) OrderBy(orderBy string) *DisksListCall {
  11879. c.urlParams_.Set("orderBy", orderBy)
  11880. return c
  11881. }
  11882. // PageToken sets the optional parameter "pageToken": Specifies a page
  11883. // token to use. Set pageToken to the nextPageToken returned by a
  11884. // previous list request to get the next page of results.
  11885. func (c *DisksListCall) PageToken(pageToken string) *DisksListCall {
  11886. c.urlParams_.Set("pageToken", pageToken)
  11887. return c
  11888. }
  11889. // Fields allows partial responses to be retrieved. See
  11890. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11891. // for more information.
  11892. func (c *DisksListCall) Fields(s ...googleapi.Field) *DisksListCall {
  11893. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11894. return c
  11895. }
  11896. // IfNoneMatch sets the optional parameter which makes the operation
  11897. // fail if the object's ETag matches the given value. This is useful for
  11898. // getting updates only after the object has changed since the last
  11899. // request. Use googleapi.IsNotModified to check whether the response
  11900. // error from Do is the result of In-None-Match.
  11901. func (c *DisksListCall) IfNoneMatch(entityTag string) *DisksListCall {
  11902. c.ifNoneMatch_ = entityTag
  11903. return c
  11904. }
  11905. // Context sets the context to be used in this call's Do method. Any
  11906. // pending HTTP request will be aborted if the provided context is
  11907. // canceled.
  11908. func (c *DisksListCall) Context(ctx context.Context) *DisksListCall {
  11909. c.ctx_ = ctx
  11910. return c
  11911. }
  11912. func (c *DisksListCall) doRequest(alt string) (*http.Response, error) {
  11913. var body io.Reader = nil
  11914. c.urlParams_.Set("alt", alt)
  11915. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks")
  11916. urls += "?" + c.urlParams_.Encode()
  11917. req, _ := http.NewRequest("GET", urls, body)
  11918. googleapi.Expand(req.URL, map[string]string{
  11919. "project": c.project,
  11920. "zone": c.zone,
  11921. })
  11922. req.Header.Set("User-Agent", c.s.userAgent())
  11923. if c.ifNoneMatch_ != "" {
  11924. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  11925. }
  11926. if c.ctx_ != nil {
  11927. return ctxhttp.Do(c.ctx_, c.s.client, req)
  11928. }
  11929. return c.s.client.Do(req)
  11930. }
  11931. // Do executes the "compute.disks.list" call.
  11932. // Exactly one of *DiskList or error will be non-nil. Any non-2xx status
  11933. // code is an error. Response headers are in either
  11934. // *DiskList.ServerResponse.Header or (if a response was returned at
  11935. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11936. // to check whether the returned error was because
  11937. // http.StatusNotModified was returned.
  11938. func (c *DisksListCall) Do(opts ...googleapi.CallOption) (*DiskList, error) {
  11939. gensupport.SetOptions(c.urlParams_, opts...)
  11940. res, err := c.doRequest("json")
  11941. if res != nil && res.StatusCode == http.StatusNotModified {
  11942. if res.Body != nil {
  11943. res.Body.Close()
  11944. }
  11945. return nil, &googleapi.Error{
  11946. Code: res.StatusCode,
  11947. Header: res.Header,
  11948. }
  11949. }
  11950. if err != nil {
  11951. return nil, err
  11952. }
  11953. defer googleapi.CloseBody(res)
  11954. if err := googleapi.CheckResponse(res); err != nil {
  11955. return nil, err
  11956. }
  11957. ret := &DiskList{
  11958. ServerResponse: googleapi.ServerResponse{
  11959. Header: res.Header,
  11960. HTTPStatusCode: res.StatusCode,
  11961. },
  11962. }
  11963. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  11964. return nil, err
  11965. }
  11966. return ret, nil
  11967. // {
  11968. // "description": "Retrieves a list of persistent disks contained within the specified zone.",
  11969. // "httpMethod": "GET",
  11970. // "id": "compute.disks.list",
  11971. // "parameterOrder": [
  11972. // "project",
  11973. // "zone"
  11974. // ],
  11975. // "parameters": {
  11976. // "filter": {
  11977. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  11978. // "location": "query",
  11979. // "type": "string"
  11980. // },
  11981. // "maxResults": {
  11982. // "default": "500",
  11983. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  11984. // "format": "uint32",
  11985. // "location": "query",
  11986. // "maximum": "500",
  11987. // "minimum": "0",
  11988. // "type": "integer"
  11989. // },
  11990. // "orderBy": {
  11991. // "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.",
  11992. // "location": "query",
  11993. // "type": "string"
  11994. // },
  11995. // "pageToken": {
  11996. // "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.",
  11997. // "location": "query",
  11998. // "type": "string"
  11999. // },
  12000. // "project": {
  12001. // "description": "Project ID for this request.",
  12002. // "location": "path",
  12003. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  12004. // "required": true,
  12005. // "type": "string"
  12006. // },
  12007. // "zone": {
  12008. // "description": "The name of the zone for this request.",
  12009. // "location": "path",
  12010. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  12011. // "required": true,
  12012. // "type": "string"
  12013. // }
  12014. // },
  12015. // "path": "{project}/zones/{zone}/disks",
  12016. // "response": {
  12017. // "$ref": "DiskList"
  12018. // },
  12019. // "scopes": [
  12020. // "https://www.googleapis.com/auth/cloud-platform",
  12021. // "https://www.googleapis.com/auth/compute",
  12022. // "https://www.googleapis.com/auth/compute.readonly"
  12023. // ]
  12024. // }
  12025. }
  12026. // Pages invokes f for each page of results.
  12027. // A non-nil error returned from f will halt the iteration.
  12028. // The provided context supersedes any context provided to the Context method.
  12029. func (c *DisksListCall) Pages(ctx context.Context, f func(*DiskList) error) error {
  12030. c.ctx_ = ctx
  12031. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  12032. for {
  12033. x, err := c.Do()
  12034. if err != nil {
  12035. return err
  12036. }
  12037. if err := f(x); err != nil {
  12038. return err
  12039. }
  12040. if x.NextPageToken == "" {
  12041. return nil
  12042. }
  12043. c.PageToken(x.NextPageToken)
  12044. }
  12045. }
  12046. // method id "compute.disks.resize":
  12047. type DisksResizeCall struct {
  12048. s *Service
  12049. project string
  12050. zone string
  12051. disk string
  12052. disksresizerequest *DisksResizeRequest
  12053. urlParams_ gensupport.URLParams
  12054. ctx_ context.Context
  12055. }
  12056. // Resize: Resizes the specified persistent disk.
  12057. func (r *DisksService) Resize(project string, zone string, disk string, disksresizerequest *DisksResizeRequest) *DisksResizeCall {
  12058. c := &DisksResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12059. c.project = project
  12060. c.zone = zone
  12061. c.disk = disk
  12062. c.disksresizerequest = disksresizerequest
  12063. return c
  12064. }
  12065. // Fields allows partial responses to be retrieved. See
  12066. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12067. // for more information.
  12068. func (c *DisksResizeCall) Fields(s ...googleapi.Field) *DisksResizeCall {
  12069. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12070. return c
  12071. }
  12072. // Context sets the context to be used in this call's Do method. Any
  12073. // pending HTTP request will be aborted if the provided context is
  12074. // canceled.
  12075. func (c *DisksResizeCall) Context(ctx context.Context) *DisksResizeCall {
  12076. c.ctx_ = ctx
  12077. return c
  12078. }
  12079. func (c *DisksResizeCall) doRequest(alt string) (*http.Response, error) {
  12080. var body io.Reader = nil
  12081. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksresizerequest)
  12082. if err != nil {
  12083. return nil, err
  12084. }
  12085. ctype := "application/json"
  12086. c.urlParams_.Set("alt", alt)
  12087. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}/resize")
  12088. urls += "?" + c.urlParams_.Encode()
  12089. req, _ := http.NewRequest("POST", urls, body)
  12090. googleapi.Expand(req.URL, map[string]string{
  12091. "project": c.project,
  12092. "zone": c.zone,
  12093. "disk": c.disk,
  12094. })
  12095. req.Header.Set("Content-Type", ctype)
  12096. req.Header.Set("User-Agent", c.s.userAgent())
  12097. if c.ctx_ != nil {
  12098. return ctxhttp.Do(c.ctx_, c.s.client, req)
  12099. }
  12100. return c.s.client.Do(req)
  12101. }
  12102. // Do executes the "compute.disks.resize" call.
  12103. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  12104. // status code is an error. Response headers are in either
  12105. // *Operation.ServerResponse.Header or (if a response was returned at
  12106. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  12107. // to check whether the returned error was because
  12108. // http.StatusNotModified was returned.
  12109. func (c *DisksResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  12110. gensupport.SetOptions(c.urlParams_, opts...)
  12111. res, err := c.doRequest("json")
  12112. if res != nil && res.StatusCode == http.StatusNotModified {
  12113. if res.Body != nil {
  12114. res.Body.Close()
  12115. }
  12116. return nil, &googleapi.Error{
  12117. Code: res.StatusCode,
  12118. Header: res.Header,
  12119. }
  12120. }
  12121. if err != nil {
  12122. return nil, err
  12123. }
  12124. defer googleapi.CloseBody(res)
  12125. if err := googleapi.CheckResponse(res); err != nil {
  12126. return nil, err
  12127. }
  12128. ret := &Operation{
  12129. ServerResponse: googleapi.ServerResponse{
  12130. Header: res.Header,
  12131. HTTPStatusCode: res.StatusCode,
  12132. },
  12133. }
  12134. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  12135. return nil, err
  12136. }
  12137. return ret, nil
  12138. // {
  12139. // "description": "Resizes the specified persistent disk.",
  12140. // "httpMethod": "POST",
  12141. // "id": "compute.disks.resize",
  12142. // "parameterOrder": [
  12143. // "project",
  12144. // "zone",
  12145. // "disk"
  12146. // ],
  12147. // "parameters": {
  12148. // "disk": {
  12149. // "description": "The name of the persistent disk.",
  12150. // "location": "path",
  12151. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  12152. // "required": true,
  12153. // "type": "string"
  12154. // },
  12155. // "project": {
  12156. // "description": "Project ID for this request.",
  12157. // "location": "path",
  12158. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  12159. // "required": true,
  12160. // "type": "string"
  12161. // },
  12162. // "zone": {
  12163. // "description": "The name of the zone for this request.",
  12164. // "location": "path",
  12165. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  12166. // "required": true,
  12167. // "type": "string"
  12168. // }
  12169. // },
  12170. // "path": "{project}/zones/{zone}/disks/{disk}/resize",
  12171. // "request": {
  12172. // "$ref": "DisksResizeRequest"
  12173. // },
  12174. // "response": {
  12175. // "$ref": "Operation"
  12176. // },
  12177. // "scopes": [
  12178. // "https://www.googleapis.com/auth/cloud-platform",
  12179. // "https://www.googleapis.com/auth/compute"
  12180. // ]
  12181. // }
  12182. }
  12183. // method id "compute.firewalls.delete":
  12184. type FirewallsDeleteCall struct {
  12185. s *Service
  12186. project string
  12187. firewall string
  12188. urlParams_ gensupport.URLParams
  12189. ctx_ context.Context
  12190. }
  12191. // Delete: Deletes the specified firewall resource.
  12192. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/delete
  12193. func (r *FirewallsService) Delete(project string, firewall string) *FirewallsDeleteCall {
  12194. c := &FirewallsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12195. c.project = project
  12196. c.firewall = firewall
  12197. return c
  12198. }
  12199. // Fields allows partial responses to be retrieved. See
  12200. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12201. // for more information.
  12202. func (c *FirewallsDeleteCall) Fields(s ...googleapi.Field) *FirewallsDeleteCall {
  12203. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12204. return c
  12205. }
  12206. // Context sets the context to be used in this call's Do method. Any
  12207. // pending HTTP request will be aborted if the provided context is
  12208. // canceled.
  12209. func (c *FirewallsDeleteCall) Context(ctx context.Context) *FirewallsDeleteCall {
  12210. c.ctx_ = ctx
  12211. return c
  12212. }
  12213. func (c *FirewallsDeleteCall) doRequest(alt string) (*http.Response, error) {
  12214. var body io.Reader = nil
  12215. c.urlParams_.Set("alt", alt)
  12216. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  12217. urls += "?" + c.urlParams_.Encode()
  12218. req, _ := http.NewRequest("DELETE", urls, body)
  12219. googleapi.Expand(req.URL, map[string]string{
  12220. "project": c.project,
  12221. "firewall": c.firewall,
  12222. })
  12223. req.Header.Set("User-Agent", c.s.userAgent())
  12224. if c.ctx_ != nil {
  12225. return ctxhttp.Do(c.ctx_, c.s.client, req)
  12226. }
  12227. return c.s.client.Do(req)
  12228. }
  12229. // Do executes the "compute.firewalls.delete" call.
  12230. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  12231. // status code is an error. Response headers are in either
  12232. // *Operation.ServerResponse.Header or (if a response was returned at
  12233. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  12234. // to check whether the returned error was because
  12235. // http.StatusNotModified was returned.
  12236. func (c *FirewallsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  12237. gensupport.SetOptions(c.urlParams_, opts...)
  12238. res, err := c.doRequest("json")
  12239. if res != nil && res.StatusCode == http.StatusNotModified {
  12240. if res.Body != nil {
  12241. res.Body.Close()
  12242. }
  12243. return nil, &googleapi.Error{
  12244. Code: res.StatusCode,
  12245. Header: res.Header,
  12246. }
  12247. }
  12248. if err != nil {
  12249. return nil, err
  12250. }
  12251. defer googleapi.CloseBody(res)
  12252. if err := googleapi.CheckResponse(res); err != nil {
  12253. return nil, err
  12254. }
  12255. ret := &Operation{
  12256. ServerResponse: googleapi.ServerResponse{
  12257. Header: res.Header,
  12258. HTTPStatusCode: res.StatusCode,
  12259. },
  12260. }
  12261. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  12262. return nil, err
  12263. }
  12264. return ret, nil
  12265. // {
  12266. // "description": "Deletes the specified firewall resource.",
  12267. // "httpMethod": "DELETE",
  12268. // "id": "compute.firewalls.delete",
  12269. // "parameterOrder": [
  12270. // "project",
  12271. // "firewall"
  12272. // ],
  12273. // "parameters": {
  12274. // "firewall": {
  12275. // "description": "Name of the firewall resource to delete.",
  12276. // "location": "path",
  12277. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  12278. // "required": true,
  12279. // "type": "string"
  12280. // },
  12281. // "project": {
  12282. // "description": "Project ID for this request.",
  12283. // "location": "path",
  12284. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  12285. // "required": true,
  12286. // "type": "string"
  12287. // }
  12288. // },
  12289. // "path": "{project}/global/firewalls/{firewall}",
  12290. // "response": {
  12291. // "$ref": "Operation"
  12292. // },
  12293. // "scopes": [
  12294. // "https://www.googleapis.com/auth/cloud-platform",
  12295. // "https://www.googleapis.com/auth/compute"
  12296. // ]
  12297. // }
  12298. }
  12299. // method id "compute.firewalls.get":
  12300. type FirewallsGetCall struct {
  12301. s *Service
  12302. project string
  12303. firewall string
  12304. urlParams_ gensupport.URLParams
  12305. ifNoneMatch_ string
  12306. ctx_ context.Context
  12307. }
  12308. // Get: Returns the specified firewall resource.
  12309. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/get
  12310. func (r *FirewallsService) Get(project string, firewall string) *FirewallsGetCall {
  12311. c := &FirewallsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12312. c.project = project
  12313. c.firewall = firewall
  12314. return c
  12315. }
  12316. // Fields allows partial responses to be retrieved. See
  12317. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12318. // for more information.
  12319. func (c *FirewallsGetCall) Fields(s ...googleapi.Field) *FirewallsGetCall {
  12320. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12321. return c
  12322. }
  12323. // IfNoneMatch sets the optional parameter which makes the operation
  12324. // fail if the object's ETag matches the given value. This is useful for
  12325. // getting updates only after the object has changed since the last
  12326. // request. Use googleapi.IsNotModified to check whether the response
  12327. // error from Do is the result of In-None-Match.
  12328. func (c *FirewallsGetCall) IfNoneMatch(entityTag string) *FirewallsGetCall {
  12329. c.ifNoneMatch_ = entityTag
  12330. return c
  12331. }
  12332. // Context sets the context to be used in this call's Do method. Any
  12333. // pending HTTP request will be aborted if the provided context is
  12334. // canceled.
  12335. func (c *FirewallsGetCall) Context(ctx context.Context) *FirewallsGetCall {
  12336. c.ctx_ = ctx
  12337. return c
  12338. }
  12339. func (c *FirewallsGetCall) doRequest(alt string) (*http.Response, error) {
  12340. var body io.Reader = nil
  12341. c.urlParams_.Set("alt", alt)
  12342. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  12343. urls += "?" + c.urlParams_.Encode()
  12344. req, _ := http.NewRequest("GET", urls, body)
  12345. googleapi.Expand(req.URL, map[string]string{
  12346. "project": c.project,
  12347. "firewall": c.firewall,
  12348. })
  12349. req.Header.Set("User-Agent", c.s.userAgent())
  12350. if c.ifNoneMatch_ != "" {
  12351. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  12352. }
  12353. if c.ctx_ != nil {
  12354. return ctxhttp.Do(c.ctx_, c.s.client, req)
  12355. }
  12356. return c.s.client.Do(req)
  12357. }
  12358. // Do executes the "compute.firewalls.get" call.
  12359. // Exactly one of *Firewall or error will be non-nil. Any non-2xx status
  12360. // code is an error. Response headers are in either
  12361. // *Firewall.ServerResponse.Header or (if a response was returned at
  12362. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  12363. // to check whether the returned error was because
  12364. // http.StatusNotModified was returned.
  12365. func (c *FirewallsGetCall) Do(opts ...googleapi.CallOption) (*Firewall, error) {
  12366. gensupport.SetOptions(c.urlParams_, opts...)
  12367. res, err := c.doRequest("json")
  12368. if res != nil && res.StatusCode == http.StatusNotModified {
  12369. if res.Body != nil {
  12370. res.Body.Close()
  12371. }
  12372. return nil, &googleapi.Error{
  12373. Code: res.StatusCode,
  12374. Header: res.Header,
  12375. }
  12376. }
  12377. if err != nil {
  12378. return nil, err
  12379. }
  12380. defer googleapi.CloseBody(res)
  12381. if err := googleapi.CheckResponse(res); err != nil {
  12382. return nil, err
  12383. }
  12384. ret := &Firewall{
  12385. ServerResponse: googleapi.ServerResponse{
  12386. Header: res.Header,
  12387. HTTPStatusCode: res.StatusCode,
  12388. },
  12389. }
  12390. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  12391. return nil, err
  12392. }
  12393. return ret, nil
  12394. // {
  12395. // "description": "Returns the specified firewall resource.",
  12396. // "httpMethod": "GET",
  12397. // "id": "compute.firewalls.get",
  12398. // "parameterOrder": [
  12399. // "project",
  12400. // "firewall"
  12401. // ],
  12402. // "parameters": {
  12403. // "firewall": {
  12404. // "description": "Name of the firewall resource to return.",
  12405. // "location": "path",
  12406. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  12407. // "required": true,
  12408. // "type": "string"
  12409. // },
  12410. // "project": {
  12411. // "description": "Project ID for this request.",
  12412. // "location": "path",
  12413. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  12414. // "required": true,
  12415. // "type": "string"
  12416. // }
  12417. // },
  12418. // "path": "{project}/global/firewalls/{firewall}",
  12419. // "response": {
  12420. // "$ref": "Firewall"
  12421. // },
  12422. // "scopes": [
  12423. // "https://www.googleapis.com/auth/cloud-platform",
  12424. // "https://www.googleapis.com/auth/compute",
  12425. // "https://www.googleapis.com/auth/compute.readonly"
  12426. // ]
  12427. // }
  12428. }
  12429. // method id "compute.firewalls.insert":
  12430. type FirewallsInsertCall struct {
  12431. s *Service
  12432. project string
  12433. firewall *Firewall
  12434. urlParams_ gensupport.URLParams
  12435. ctx_ context.Context
  12436. }
  12437. // Insert: Creates a firewall resource in the specified project using
  12438. // the data included in the request.
  12439. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/insert
  12440. func (r *FirewallsService) Insert(project string, firewall *Firewall) *FirewallsInsertCall {
  12441. c := &FirewallsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12442. c.project = project
  12443. c.firewall = firewall
  12444. return c
  12445. }
  12446. // Fields allows partial responses to be retrieved. See
  12447. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12448. // for more information.
  12449. func (c *FirewallsInsertCall) Fields(s ...googleapi.Field) *FirewallsInsertCall {
  12450. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12451. return c
  12452. }
  12453. // Context sets the context to be used in this call's Do method. Any
  12454. // pending HTTP request will be aborted if the provided context is
  12455. // canceled.
  12456. func (c *FirewallsInsertCall) Context(ctx context.Context) *FirewallsInsertCall {
  12457. c.ctx_ = ctx
  12458. return c
  12459. }
  12460. func (c *FirewallsInsertCall) doRequest(alt string) (*http.Response, error) {
  12461. var body io.Reader = nil
  12462. body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall)
  12463. if err != nil {
  12464. return nil, err
  12465. }
  12466. ctype := "application/json"
  12467. c.urlParams_.Set("alt", alt)
  12468. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls")
  12469. urls += "?" + c.urlParams_.Encode()
  12470. req, _ := http.NewRequest("POST", urls, body)
  12471. googleapi.Expand(req.URL, map[string]string{
  12472. "project": c.project,
  12473. })
  12474. req.Header.Set("Content-Type", ctype)
  12475. req.Header.Set("User-Agent", c.s.userAgent())
  12476. if c.ctx_ != nil {
  12477. return ctxhttp.Do(c.ctx_, c.s.client, req)
  12478. }
  12479. return c.s.client.Do(req)
  12480. }
  12481. // Do executes the "compute.firewalls.insert" call.
  12482. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  12483. // status code is an error. Response headers are in either
  12484. // *Operation.ServerResponse.Header or (if a response was returned at
  12485. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  12486. // to check whether the returned error was because
  12487. // http.StatusNotModified was returned.
  12488. func (c *FirewallsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  12489. gensupport.SetOptions(c.urlParams_, opts...)
  12490. res, err := c.doRequest("json")
  12491. if res != nil && res.StatusCode == http.StatusNotModified {
  12492. if res.Body != nil {
  12493. res.Body.Close()
  12494. }
  12495. return nil, &googleapi.Error{
  12496. Code: res.StatusCode,
  12497. Header: res.Header,
  12498. }
  12499. }
  12500. if err != nil {
  12501. return nil, err
  12502. }
  12503. defer googleapi.CloseBody(res)
  12504. if err := googleapi.CheckResponse(res); err != nil {
  12505. return nil, err
  12506. }
  12507. ret := &Operation{
  12508. ServerResponse: googleapi.ServerResponse{
  12509. Header: res.Header,
  12510. HTTPStatusCode: res.StatusCode,
  12511. },
  12512. }
  12513. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  12514. return nil, err
  12515. }
  12516. return ret, nil
  12517. // {
  12518. // "description": "Creates a firewall resource in the specified project using the data included in the request.",
  12519. // "httpMethod": "POST",
  12520. // "id": "compute.firewalls.insert",
  12521. // "parameterOrder": [
  12522. // "project"
  12523. // ],
  12524. // "parameters": {
  12525. // "project": {
  12526. // "description": "Project ID for this request.",
  12527. // "location": "path",
  12528. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  12529. // "required": true,
  12530. // "type": "string"
  12531. // }
  12532. // },
  12533. // "path": "{project}/global/firewalls",
  12534. // "request": {
  12535. // "$ref": "Firewall"
  12536. // },
  12537. // "response": {
  12538. // "$ref": "Operation"
  12539. // },
  12540. // "scopes": [
  12541. // "https://www.googleapis.com/auth/cloud-platform",
  12542. // "https://www.googleapis.com/auth/compute"
  12543. // ]
  12544. // }
  12545. }
  12546. // method id "compute.firewalls.list":
  12547. type FirewallsListCall struct {
  12548. s *Service
  12549. project string
  12550. urlParams_ gensupport.URLParams
  12551. ifNoneMatch_ string
  12552. ctx_ context.Context
  12553. }
  12554. // List: Retrieves the list of firewall resources available to the
  12555. // specified project.
  12556. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/list
  12557. func (r *FirewallsService) List(project string) *FirewallsListCall {
  12558. c := &FirewallsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12559. c.project = project
  12560. return c
  12561. }
  12562. // Filter sets the optional parameter "filter": Sets a filter expression
  12563. // for filtering listed resources, in the form filter={expression}. Your
  12564. // {expression} must be in the format: field_name comparison_string
  12565. // literal_string.
  12566. //
  12567. // The field_name is the name of the field you want to compare. Only
  12568. // atomic field types are supported (string, number, boolean). The
  12569. // comparison_string must be either eq (equals) or ne (not equals). The
  12570. // literal_string is the string value to filter to. The literal value
  12571. // must be valid for the type of field you are filtering by (string,
  12572. // number, boolean). For string fields, the literal value is interpreted
  12573. // as a regular expression using RE2 syntax. The literal value must
  12574. // match the entire field.
  12575. //
  12576. // For example, filter=name ne example-instance.
  12577. //
  12578. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  12579. // you can also filter on nested fields. For example, you could filter
  12580. // on instances that have set the scheduling.automaticRestart field to
  12581. // true. In particular, use filtering on nested fields to take advantage
  12582. // of instance labels to organize and filter results based on label
  12583. // values.
  12584. //
  12585. // The Beta API also supports filtering on multiple expressions by
  12586. // providing each separate expression within parentheses. For example,
  12587. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  12588. // Multiple expressions are treated as AND expressions meaning that
  12589. // resources must match all expressions to pass the filters.
  12590. func (c *FirewallsListCall) Filter(filter string) *FirewallsListCall {
  12591. c.urlParams_.Set("filter", filter)
  12592. return c
  12593. }
  12594. // MaxResults sets the optional parameter "maxResults": The maximum
  12595. // number of results per page that Compute Engine should return. If the
  12596. // number of available results is larger than maxResults, Compute Engine
  12597. // returns a nextPageToken that can be used to get the next page of
  12598. // results in subsequent list requests.
  12599. func (c *FirewallsListCall) MaxResults(maxResults int64) *FirewallsListCall {
  12600. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  12601. return c
  12602. }
  12603. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  12604. // a certain order. By default, results are returned in alphanumerical
  12605. // order based on the resource name.
  12606. //
  12607. // You can also sort results in descending order based on the creation
  12608. // timestamp using orderBy="creationTimestamp desc". This sorts results
  12609. // based on the creationTimestamp field in reverse chronological order
  12610. // (newest result first). Use this to sort resources like operations so
  12611. // that the newest operation is returned first.
  12612. //
  12613. // Currently, only sorting by name or creationTimestamp desc is
  12614. // supported.
  12615. func (c *FirewallsListCall) OrderBy(orderBy string) *FirewallsListCall {
  12616. c.urlParams_.Set("orderBy", orderBy)
  12617. return c
  12618. }
  12619. // PageToken sets the optional parameter "pageToken": Specifies a page
  12620. // token to use. Set pageToken to the nextPageToken returned by a
  12621. // previous list request to get the next page of results.
  12622. func (c *FirewallsListCall) PageToken(pageToken string) *FirewallsListCall {
  12623. c.urlParams_.Set("pageToken", pageToken)
  12624. return c
  12625. }
  12626. // Fields allows partial responses to be retrieved. See
  12627. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12628. // for more information.
  12629. func (c *FirewallsListCall) Fields(s ...googleapi.Field) *FirewallsListCall {
  12630. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12631. return c
  12632. }
  12633. // IfNoneMatch sets the optional parameter which makes the operation
  12634. // fail if the object's ETag matches the given value. This is useful for
  12635. // getting updates only after the object has changed since the last
  12636. // request. Use googleapi.IsNotModified to check whether the response
  12637. // error from Do is the result of In-None-Match.
  12638. func (c *FirewallsListCall) IfNoneMatch(entityTag string) *FirewallsListCall {
  12639. c.ifNoneMatch_ = entityTag
  12640. return c
  12641. }
  12642. // Context sets the context to be used in this call's Do method. Any
  12643. // pending HTTP request will be aborted if the provided context is
  12644. // canceled.
  12645. func (c *FirewallsListCall) Context(ctx context.Context) *FirewallsListCall {
  12646. c.ctx_ = ctx
  12647. return c
  12648. }
  12649. func (c *FirewallsListCall) doRequest(alt string) (*http.Response, error) {
  12650. var body io.Reader = nil
  12651. c.urlParams_.Set("alt", alt)
  12652. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls")
  12653. urls += "?" + c.urlParams_.Encode()
  12654. req, _ := http.NewRequest("GET", urls, body)
  12655. googleapi.Expand(req.URL, map[string]string{
  12656. "project": c.project,
  12657. })
  12658. req.Header.Set("User-Agent", c.s.userAgent())
  12659. if c.ifNoneMatch_ != "" {
  12660. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  12661. }
  12662. if c.ctx_ != nil {
  12663. return ctxhttp.Do(c.ctx_, c.s.client, req)
  12664. }
  12665. return c.s.client.Do(req)
  12666. }
  12667. // Do executes the "compute.firewalls.list" call.
  12668. // Exactly one of *FirewallList or error will be non-nil. Any non-2xx
  12669. // status code is an error. Response headers are in either
  12670. // *FirewallList.ServerResponse.Header or (if a response was returned at
  12671. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  12672. // to check whether the returned error was because
  12673. // http.StatusNotModified was returned.
  12674. func (c *FirewallsListCall) Do(opts ...googleapi.CallOption) (*FirewallList, error) {
  12675. gensupport.SetOptions(c.urlParams_, opts...)
  12676. res, err := c.doRequest("json")
  12677. if res != nil && res.StatusCode == http.StatusNotModified {
  12678. if res.Body != nil {
  12679. res.Body.Close()
  12680. }
  12681. return nil, &googleapi.Error{
  12682. Code: res.StatusCode,
  12683. Header: res.Header,
  12684. }
  12685. }
  12686. if err != nil {
  12687. return nil, err
  12688. }
  12689. defer googleapi.CloseBody(res)
  12690. if err := googleapi.CheckResponse(res); err != nil {
  12691. return nil, err
  12692. }
  12693. ret := &FirewallList{
  12694. ServerResponse: googleapi.ServerResponse{
  12695. Header: res.Header,
  12696. HTTPStatusCode: res.StatusCode,
  12697. },
  12698. }
  12699. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  12700. return nil, err
  12701. }
  12702. return ret, nil
  12703. // {
  12704. // "description": "Retrieves the list of firewall resources available to the specified project.",
  12705. // "httpMethod": "GET",
  12706. // "id": "compute.firewalls.list",
  12707. // "parameterOrder": [
  12708. // "project"
  12709. // ],
  12710. // "parameters": {
  12711. // "filter": {
  12712. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  12713. // "location": "query",
  12714. // "type": "string"
  12715. // },
  12716. // "maxResults": {
  12717. // "default": "500",
  12718. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  12719. // "format": "uint32",
  12720. // "location": "query",
  12721. // "maximum": "500",
  12722. // "minimum": "0",
  12723. // "type": "integer"
  12724. // },
  12725. // "orderBy": {
  12726. // "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.",
  12727. // "location": "query",
  12728. // "type": "string"
  12729. // },
  12730. // "pageToken": {
  12731. // "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.",
  12732. // "location": "query",
  12733. // "type": "string"
  12734. // },
  12735. // "project": {
  12736. // "description": "Project ID for this request.",
  12737. // "location": "path",
  12738. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  12739. // "required": true,
  12740. // "type": "string"
  12741. // }
  12742. // },
  12743. // "path": "{project}/global/firewalls",
  12744. // "response": {
  12745. // "$ref": "FirewallList"
  12746. // },
  12747. // "scopes": [
  12748. // "https://www.googleapis.com/auth/cloud-platform",
  12749. // "https://www.googleapis.com/auth/compute",
  12750. // "https://www.googleapis.com/auth/compute.readonly"
  12751. // ]
  12752. // }
  12753. }
  12754. // Pages invokes f for each page of results.
  12755. // A non-nil error returned from f will halt the iteration.
  12756. // The provided context supersedes any context provided to the Context method.
  12757. func (c *FirewallsListCall) Pages(ctx context.Context, f func(*FirewallList) error) error {
  12758. c.ctx_ = ctx
  12759. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  12760. for {
  12761. x, err := c.Do()
  12762. if err != nil {
  12763. return err
  12764. }
  12765. if err := f(x); err != nil {
  12766. return err
  12767. }
  12768. if x.NextPageToken == "" {
  12769. return nil
  12770. }
  12771. c.PageToken(x.NextPageToken)
  12772. }
  12773. }
  12774. // method id "compute.firewalls.patch":
  12775. type FirewallsPatchCall struct {
  12776. s *Service
  12777. project string
  12778. firewall string
  12779. firewall2 *Firewall
  12780. urlParams_ gensupport.URLParams
  12781. ctx_ context.Context
  12782. }
  12783. // Patch: Updates the specified firewall resource with the data included
  12784. // in the request. This method supports patch semantics.
  12785. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/patch
  12786. func (r *FirewallsService) Patch(project string, firewall string, firewall2 *Firewall) *FirewallsPatchCall {
  12787. c := &FirewallsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12788. c.project = project
  12789. c.firewall = firewall
  12790. c.firewall2 = firewall2
  12791. return c
  12792. }
  12793. // Fields allows partial responses to be retrieved. See
  12794. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12795. // for more information.
  12796. func (c *FirewallsPatchCall) Fields(s ...googleapi.Field) *FirewallsPatchCall {
  12797. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12798. return c
  12799. }
  12800. // Context sets the context to be used in this call's Do method. Any
  12801. // pending HTTP request will be aborted if the provided context is
  12802. // canceled.
  12803. func (c *FirewallsPatchCall) Context(ctx context.Context) *FirewallsPatchCall {
  12804. c.ctx_ = ctx
  12805. return c
  12806. }
  12807. func (c *FirewallsPatchCall) doRequest(alt string) (*http.Response, error) {
  12808. var body io.Reader = nil
  12809. body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2)
  12810. if err != nil {
  12811. return nil, err
  12812. }
  12813. ctype := "application/json"
  12814. c.urlParams_.Set("alt", alt)
  12815. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  12816. urls += "?" + c.urlParams_.Encode()
  12817. req, _ := http.NewRequest("PATCH", urls, body)
  12818. googleapi.Expand(req.URL, map[string]string{
  12819. "project": c.project,
  12820. "firewall": c.firewall,
  12821. })
  12822. req.Header.Set("Content-Type", ctype)
  12823. req.Header.Set("User-Agent", c.s.userAgent())
  12824. if c.ctx_ != nil {
  12825. return ctxhttp.Do(c.ctx_, c.s.client, req)
  12826. }
  12827. return c.s.client.Do(req)
  12828. }
  12829. // Do executes the "compute.firewalls.patch" call.
  12830. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  12831. // status code is an error. Response headers are in either
  12832. // *Operation.ServerResponse.Header or (if a response was returned at
  12833. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  12834. // to check whether the returned error was because
  12835. // http.StatusNotModified was returned.
  12836. func (c *FirewallsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  12837. gensupport.SetOptions(c.urlParams_, opts...)
  12838. res, err := c.doRequest("json")
  12839. if res != nil && res.StatusCode == http.StatusNotModified {
  12840. if res.Body != nil {
  12841. res.Body.Close()
  12842. }
  12843. return nil, &googleapi.Error{
  12844. Code: res.StatusCode,
  12845. Header: res.Header,
  12846. }
  12847. }
  12848. if err != nil {
  12849. return nil, err
  12850. }
  12851. defer googleapi.CloseBody(res)
  12852. if err := googleapi.CheckResponse(res); err != nil {
  12853. return nil, err
  12854. }
  12855. ret := &Operation{
  12856. ServerResponse: googleapi.ServerResponse{
  12857. Header: res.Header,
  12858. HTTPStatusCode: res.StatusCode,
  12859. },
  12860. }
  12861. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  12862. return nil, err
  12863. }
  12864. return ret, nil
  12865. // {
  12866. // "description": "Updates the specified firewall resource with the data included in the request. This method supports patch semantics.",
  12867. // "httpMethod": "PATCH",
  12868. // "id": "compute.firewalls.patch",
  12869. // "parameterOrder": [
  12870. // "project",
  12871. // "firewall"
  12872. // ],
  12873. // "parameters": {
  12874. // "firewall": {
  12875. // "description": "Name of the firewall resource to update.",
  12876. // "location": "path",
  12877. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  12878. // "required": true,
  12879. // "type": "string"
  12880. // },
  12881. // "project": {
  12882. // "description": "Project ID for this request.",
  12883. // "location": "path",
  12884. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  12885. // "required": true,
  12886. // "type": "string"
  12887. // }
  12888. // },
  12889. // "path": "{project}/global/firewalls/{firewall}",
  12890. // "request": {
  12891. // "$ref": "Firewall"
  12892. // },
  12893. // "response": {
  12894. // "$ref": "Operation"
  12895. // },
  12896. // "scopes": [
  12897. // "https://www.googleapis.com/auth/cloud-platform",
  12898. // "https://www.googleapis.com/auth/compute"
  12899. // ]
  12900. // }
  12901. }
  12902. // method id "compute.firewalls.update":
  12903. type FirewallsUpdateCall struct {
  12904. s *Service
  12905. project string
  12906. firewall string
  12907. firewall2 *Firewall
  12908. urlParams_ gensupport.URLParams
  12909. ctx_ context.Context
  12910. }
  12911. // Update: Updates the specified firewall resource with the data
  12912. // included in the request.
  12913. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/update
  12914. func (r *FirewallsService) Update(project string, firewall string, firewall2 *Firewall) *FirewallsUpdateCall {
  12915. c := &FirewallsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12916. c.project = project
  12917. c.firewall = firewall
  12918. c.firewall2 = firewall2
  12919. return c
  12920. }
  12921. // Fields allows partial responses to be retrieved. See
  12922. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12923. // for more information.
  12924. func (c *FirewallsUpdateCall) Fields(s ...googleapi.Field) *FirewallsUpdateCall {
  12925. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12926. return c
  12927. }
  12928. // Context sets the context to be used in this call's Do method. Any
  12929. // pending HTTP request will be aborted if the provided context is
  12930. // canceled.
  12931. func (c *FirewallsUpdateCall) Context(ctx context.Context) *FirewallsUpdateCall {
  12932. c.ctx_ = ctx
  12933. return c
  12934. }
  12935. func (c *FirewallsUpdateCall) doRequest(alt string) (*http.Response, error) {
  12936. var body io.Reader = nil
  12937. body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2)
  12938. if err != nil {
  12939. return nil, err
  12940. }
  12941. ctype := "application/json"
  12942. c.urlParams_.Set("alt", alt)
  12943. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  12944. urls += "?" + c.urlParams_.Encode()
  12945. req, _ := http.NewRequest("PUT", urls, body)
  12946. googleapi.Expand(req.URL, map[string]string{
  12947. "project": c.project,
  12948. "firewall": c.firewall,
  12949. })
  12950. req.Header.Set("Content-Type", ctype)
  12951. req.Header.Set("User-Agent", c.s.userAgent())
  12952. if c.ctx_ != nil {
  12953. return ctxhttp.Do(c.ctx_, c.s.client, req)
  12954. }
  12955. return c.s.client.Do(req)
  12956. }
  12957. // Do executes the "compute.firewalls.update" call.
  12958. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  12959. // status code is an error. Response headers are in either
  12960. // *Operation.ServerResponse.Header or (if a response was returned at
  12961. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  12962. // to check whether the returned error was because
  12963. // http.StatusNotModified was returned.
  12964. func (c *FirewallsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  12965. gensupport.SetOptions(c.urlParams_, opts...)
  12966. res, err := c.doRequest("json")
  12967. if res != nil && res.StatusCode == http.StatusNotModified {
  12968. if res.Body != nil {
  12969. res.Body.Close()
  12970. }
  12971. return nil, &googleapi.Error{
  12972. Code: res.StatusCode,
  12973. Header: res.Header,
  12974. }
  12975. }
  12976. if err != nil {
  12977. return nil, err
  12978. }
  12979. defer googleapi.CloseBody(res)
  12980. if err := googleapi.CheckResponse(res); err != nil {
  12981. return nil, err
  12982. }
  12983. ret := &Operation{
  12984. ServerResponse: googleapi.ServerResponse{
  12985. Header: res.Header,
  12986. HTTPStatusCode: res.StatusCode,
  12987. },
  12988. }
  12989. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  12990. return nil, err
  12991. }
  12992. return ret, nil
  12993. // {
  12994. // "description": "Updates the specified firewall resource with the data included in the request.",
  12995. // "httpMethod": "PUT",
  12996. // "id": "compute.firewalls.update",
  12997. // "parameterOrder": [
  12998. // "project",
  12999. // "firewall"
  13000. // ],
  13001. // "parameters": {
  13002. // "firewall": {
  13003. // "description": "Name of the firewall resource to update.",
  13004. // "location": "path",
  13005. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  13006. // "required": true,
  13007. // "type": "string"
  13008. // },
  13009. // "project": {
  13010. // "description": "Project ID for this request.",
  13011. // "location": "path",
  13012. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  13013. // "required": true,
  13014. // "type": "string"
  13015. // }
  13016. // },
  13017. // "path": "{project}/global/firewalls/{firewall}",
  13018. // "request": {
  13019. // "$ref": "Firewall"
  13020. // },
  13021. // "response": {
  13022. // "$ref": "Operation"
  13023. // },
  13024. // "scopes": [
  13025. // "https://www.googleapis.com/auth/cloud-platform",
  13026. // "https://www.googleapis.com/auth/compute"
  13027. // ]
  13028. // }
  13029. }
  13030. // method id "compute.forwardingRules.aggregatedList":
  13031. type ForwardingRulesAggregatedListCall struct {
  13032. s *Service
  13033. project string
  13034. urlParams_ gensupport.URLParams
  13035. ifNoneMatch_ string
  13036. ctx_ context.Context
  13037. }
  13038. // AggregatedList: Retrieves an aggregated list of forwarding rules.
  13039. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/aggregatedList
  13040. func (r *ForwardingRulesService) AggregatedList(project string) *ForwardingRulesAggregatedListCall {
  13041. c := &ForwardingRulesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13042. c.project = project
  13043. return c
  13044. }
  13045. // Filter sets the optional parameter "filter": Sets a filter expression
  13046. // for filtering listed resources, in the form filter={expression}. Your
  13047. // {expression} must be in the format: field_name comparison_string
  13048. // literal_string.
  13049. //
  13050. // The field_name is the name of the field you want to compare. Only
  13051. // atomic field types are supported (string, number, boolean). The
  13052. // comparison_string must be either eq (equals) or ne (not equals). The
  13053. // literal_string is the string value to filter to. The literal value
  13054. // must be valid for the type of field you are filtering by (string,
  13055. // number, boolean). For string fields, the literal value is interpreted
  13056. // as a regular expression using RE2 syntax. The literal value must
  13057. // match the entire field.
  13058. //
  13059. // For example, filter=name ne example-instance.
  13060. //
  13061. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  13062. // you can also filter on nested fields. For example, you could filter
  13063. // on instances that have set the scheduling.automaticRestart field to
  13064. // true. In particular, use filtering on nested fields to take advantage
  13065. // of instance labels to organize and filter results based on label
  13066. // values.
  13067. //
  13068. // The Beta API also supports filtering on multiple expressions by
  13069. // providing each separate expression within parentheses. For example,
  13070. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  13071. // Multiple expressions are treated as AND expressions meaning that
  13072. // resources must match all expressions to pass the filters.
  13073. func (c *ForwardingRulesAggregatedListCall) Filter(filter string) *ForwardingRulesAggregatedListCall {
  13074. c.urlParams_.Set("filter", filter)
  13075. return c
  13076. }
  13077. // MaxResults sets the optional parameter "maxResults": The maximum
  13078. // number of results per page that Compute Engine should return. If the
  13079. // number of available results is larger than maxResults, Compute Engine
  13080. // returns a nextPageToken that can be used to get the next page of
  13081. // results in subsequent list requests.
  13082. func (c *ForwardingRulesAggregatedListCall) MaxResults(maxResults int64) *ForwardingRulesAggregatedListCall {
  13083. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  13084. return c
  13085. }
  13086. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  13087. // a certain order. By default, results are returned in alphanumerical
  13088. // order based on the resource name.
  13089. //
  13090. // You can also sort results in descending order based on the creation
  13091. // timestamp using orderBy="creationTimestamp desc". This sorts results
  13092. // based on the creationTimestamp field in reverse chronological order
  13093. // (newest result first). Use this to sort resources like operations so
  13094. // that the newest operation is returned first.
  13095. //
  13096. // Currently, only sorting by name or creationTimestamp desc is
  13097. // supported.
  13098. func (c *ForwardingRulesAggregatedListCall) OrderBy(orderBy string) *ForwardingRulesAggregatedListCall {
  13099. c.urlParams_.Set("orderBy", orderBy)
  13100. return c
  13101. }
  13102. // PageToken sets the optional parameter "pageToken": Specifies a page
  13103. // token to use. Set pageToken to the nextPageToken returned by a
  13104. // previous list request to get the next page of results.
  13105. func (c *ForwardingRulesAggregatedListCall) PageToken(pageToken string) *ForwardingRulesAggregatedListCall {
  13106. c.urlParams_.Set("pageToken", pageToken)
  13107. return c
  13108. }
  13109. // Fields allows partial responses to be retrieved. See
  13110. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13111. // for more information.
  13112. func (c *ForwardingRulesAggregatedListCall) Fields(s ...googleapi.Field) *ForwardingRulesAggregatedListCall {
  13113. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13114. return c
  13115. }
  13116. // IfNoneMatch sets the optional parameter which makes the operation
  13117. // fail if the object's ETag matches the given value. This is useful for
  13118. // getting updates only after the object has changed since the last
  13119. // request. Use googleapi.IsNotModified to check whether the response
  13120. // error from Do is the result of In-None-Match.
  13121. func (c *ForwardingRulesAggregatedListCall) IfNoneMatch(entityTag string) *ForwardingRulesAggregatedListCall {
  13122. c.ifNoneMatch_ = entityTag
  13123. return c
  13124. }
  13125. // Context sets the context to be used in this call's Do method. Any
  13126. // pending HTTP request will be aborted if the provided context is
  13127. // canceled.
  13128. func (c *ForwardingRulesAggregatedListCall) Context(ctx context.Context) *ForwardingRulesAggregatedListCall {
  13129. c.ctx_ = ctx
  13130. return c
  13131. }
  13132. func (c *ForwardingRulesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  13133. var body io.Reader = nil
  13134. c.urlParams_.Set("alt", alt)
  13135. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/forwardingRules")
  13136. urls += "?" + c.urlParams_.Encode()
  13137. req, _ := http.NewRequest("GET", urls, body)
  13138. googleapi.Expand(req.URL, map[string]string{
  13139. "project": c.project,
  13140. })
  13141. req.Header.Set("User-Agent", c.s.userAgent())
  13142. if c.ifNoneMatch_ != "" {
  13143. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  13144. }
  13145. if c.ctx_ != nil {
  13146. return ctxhttp.Do(c.ctx_, c.s.client, req)
  13147. }
  13148. return c.s.client.Do(req)
  13149. }
  13150. // Do executes the "compute.forwardingRules.aggregatedList" call.
  13151. // Exactly one of *ForwardingRuleAggregatedList or error will be
  13152. // non-nil. Any non-2xx status code is an error. Response headers are in
  13153. // either *ForwardingRuleAggregatedList.ServerResponse.Header or (if a
  13154. // response was returned at all) in error.(*googleapi.Error).Header. Use
  13155. // googleapi.IsNotModified to check whether the returned error was
  13156. // because http.StatusNotModified was returned.
  13157. func (c *ForwardingRulesAggregatedListCall) Do(opts ...googleapi.CallOption) (*ForwardingRuleAggregatedList, error) {
  13158. gensupport.SetOptions(c.urlParams_, opts...)
  13159. res, err := c.doRequest("json")
  13160. if res != nil && res.StatusCode == http.StatusNotModified {
  13161. if res.Body != nil {
  13162. res.Body.Close()
  13163. }
  13164. return nil, &googleapi.Error{
  13165. Code: res.StatusCode,
  13166. Header: res.Header,
  13167. }
  13168. }
  13169. if err != nil {
  13170. return nil, err
  13171. }
  13172. defer googleapi.CloseBody(res)
  13173. if err := googleapi.CheckResponse(res); err != nil {
  13174. return nil, err
  13175. }
  13176. ret := &ForwardingRuleAggregatedList{
  13177. ServerResponse: googleapi.ServerResponse{
  13178. Header: res.Header,
  13179. HTTPStatusCode: res.StatusCode,
  13180. },
  13181. }
  13182. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  13183. return nil, err
  13184. }
  13185. return ret, nil
  13186. // {
  13187. // "description": "Retrieves an aggregated list of forwarding rules.",
  13188. // "httpMethod": "GET",
  13189. // "id": "compute.forwardingRules.aggregatedList",
  13190. // "parameterOrder": [
  13191. // "project"
  13192. // ],
  13193. // "parameters": {
  13194. // "filter": {
  13195. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  13196. // "location": "query",
  13197. // "type": "string"
  13198. // },
  13199. // "maxResults": {
  13200. // "default": "500",
  13201. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  13202. // "format": "uint32",
  13203. // "location": "query",
  13204. // "maximum": "500",
  13205. // "minimum": "0",
  13206. // "type": "integer"
  13207. // },
  13208. // "orderBy": {
  13209. // "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.",
  13210. // "location": "query",
  13211. // "type": "string"
  13212. // },
  13213. // "pageToken": {
  13214. // "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.",
  13215. // "location": "query",
  13216. // "type": "string"
  13217. // },
  13218. // "project": {
  13219. // "description": "Project ID for this request.",
  13220. // "location": "path",
  13221. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  13222. // "required": true,
  13223. // "type": "string"
  13224. // }
  13225. // },
  13226. // "path": "{project}/aggregated/forwardingRules",
  13227. // "response": {
  13228. // "$ref": "ForwardingRuleAggregatedList"
  13229. // },
  13230. // "scopes": [
  13231. // "https://www.googleapis.com/auth/cloud-platform",
  13232. // "https://www.googleapis.com/auth/compute",
  13233. // "https://www.googleapis.com/auth/compute.readonly"
  13234. // ]
  13235. // }
  13236. }
  13237. // Pages invokes f for each page of results.
  13238. // A non-nil error returned from f will halt the iteration.
  13239. // The provided context supersedes any context provided to the Context method.
  13240. func (c *ForwardingRulesAggregatedListCall) Pages(ctx context.Context, f func(*ForwardingRuleAggregatedList) error) error {
  13241. c.ctx_ = ctx
  13242. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  13243. for {
  13244. x, err := c.Do()
  13245. if err != nil {
  13246. return err
  13247. }
  13248. if err := f(x); err != nil {
  13249. return err
  13250. }
  13251. if x.NextPageToken == "" {
  13252. return nil
  13253. }
  13254. c.PageToken(x.NextPageToken)
  13255. }
  13256. }
  13257. // method id "compute.forwardingRules.delete":
  13258. type ForwardingRulesDeleteCall struct {
  13259. s *Service
  13260. project string
  13261. region string
  13262. forwardingRule string
  13263. urlParams_ gensupport.URLParams
  13264. ctx_ context.Context
  13265. }
  13266. // Delete: Deletes the specified ForwardingRule resource.
  13267. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/delete
  13268. func (r *ForwardingRulesService) Delete(project string, region string, forwardingRule string) *ForwardingRulesDeleteCall {
  13269. c := &ForwardingRulesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13270. c.project = project
  13271. c.region = region
  13272. c.forwardingRule = forwardingRule
  13273. return c
  13274. }
  13275. // Fields allows partial responses to be retrieved. See
  13276. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13277. // for more information.
  13278. func (c *ForwardingRulesDeleteCall) Fields(s ...googleapi.Field) *ForwardingRulesDeleteCall {
  13279. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13280. return c
  13281. }
  13282. // Context sets the context to be used in this call's Do method. Any
  13283. // pending HTTP request will be aborted if the provided context is
  13284. // canceled.
  13285. func (c *ForwardingRulesDeleteCall) Context(ctx context.Context) *ForwardingRulesDeleteCall {
  13286. c.ctx_ = ctx
  13287. return c
  13288. }
  13289. func (c *ForwardingRulesDeleteCall) doRequest(alt string) (*http.Response, error) {
  13290. var body io.Reader = nil
  13291. c.urlParams_.Set("alt", alt)
  13292. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}")
  13293. urls += "?" + c.urlParams_.Encode()
  13294. req, _ := http.NewRequest("DELETE", urls, body)
  13295. googleapi.Expand(req.URL, map[string]string{
  13296. "project": c.project,
  13297. "region": c.region,
  13298. "forwardingRule": c.forwardingRule,
  13299. })
  13300. req.Header.Set("User-Agent", c.s.userAgent())
  13301. if c.ctx_ != nil {
  13302. return ctxhttp.Do(c.ctx_, c.s.client, req)
  13303. }
  13304. return c.s.client.Do(req)
  13305. }
  13306. // Do executes the "compute.forwardingRules.delete" call.
  13307. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  13308. // status code is an error. Response headers are in either
  13309. // *Operation.ServerResponse.Header or (if a response was returned at
  13310. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  13311. // to check whether the returned error was because
  13312. // http.StatusNotModified was returned.
  13313. func (c *ForwardingRulesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  13314. gensupport.SetOptions(c.urlParams_, opts...)
  13315. res, err := c.doRequest("json")
  13316. if res != nil && res.StatusCode == http.StatusNotModified {
  13317. if res.Body != nil {
  13318. res.Body.Close()
  13319. }
  13320. return nil, &googleapi.Error{
  13321. Code: res.StatusCode,
  13322. Header: res.Header,
  13323. }
  13324. }
  13325. if err != nil {
  13326. return nil, err
  13327. }
  13328. defer googleapi.CloseBody(res)
  13329. if err := googleapi.CheckResponse(res); err != nil {
  13330. return nil, err
  13331. }
  13332. ret := &Operation{
  13333. ServerResponse: googleapi.ServerResponse{
  13334. Header: res.Header,
  13335. HTTPStatusCode: res.StatusCode,
  13336. },
  13337. }
  13338. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  13339. return nil, err
  13340. }
  13341. return ret, nil
  13342. // {
  13343. // "description": "Deletes the specified ForwardingRule resource.",
  13344. // "httpMethod": "DELETE",
  13345. // "id": "compute.forwardingRules.delete",
  13346. // "parameterOrder": [
  13347. // "project",
  13348. // "region",
  13349. // "forwardingRule"
  13350. // ],
  13351. // "parameters": {
  13352. // "forwardingRule": {
  13353. // "description": "Name of the ForwardingRule resource to delete.",
  13354. // "location": "path",
  13355. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  13356. // "required": true,
  13357. // "type": "string"
  13358. // },
  13359. // "project": {
  13360. // "description": "Project ID for this request.",
  13361. // "location": "path",
  13362. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  13363. // "required": true,
  13364. // "type": "string"
  13365. // },
  13366. // "region": {
  13367. // "description": "Name of the region scoping this request.",
  13368. // "location": "path",
  13369. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  13370. // "required": true,
  13371. // "type": "string"
  13372. // }
  13373. // },
  13374. // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}",
  13375. // "response": {
  13376. // "$ref": "Operation"
  13377. // },
  13378. // "scopes": [
  13379. // "https://www.googleapis.com/auth/cloud-platform",
  13380. // "https://www.googleapis.com/auth/compute"
  13381. // ]
  13382. // }
  13383. }
  13384. // method id "compute.forwardingRules.get":
  13385. type ForwardingRulesGetCall struct {
  13386. s *Service
  13387. project string
  13388. region string
  13389. forwardingRule string
  13390. urlParams_ gensupport.URLParams
  13391. ifNoneMatch_ string
  13392. ctx_ context.Context
  13393. }
  13394. // Get: Returns the specified ForwardingRule resource.
  13395. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/get
  13396. func (r *ForwardingRulesService) Get(project string, region string, forwardingRule string) *ForwardingRulesGetCall {
  13397. c := &ForwardingRulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13398. c.project = project
  13399. c.region = region
  13400. c.forwardingRule = forwardingRule
  13401. return c
  13402. }
  13403. // Fields allows partial responses to be retrieved. See
  13404. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13405. // for more information.
  13406. func (c *ForwardingRulesGetCall) Fields(s ...googleapi.Field) *ForwardingRulesGetCall {
  13407. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13408. return c
  13409. }
  13410. // IfNoneMatch sets the optional parameter which makes the operation
  13411. // fail if the object's ETag matches the given value. This is useful for
  13412. // getting updates only after the object has changed since the last
  13413. // request. Use googleapi.IsNotModified to check whether the response
  13414. // error from Do is the result of In-None-Match.
  13415. func (c *ForwardingRulesGetCall) IfNoneMatch(entityTag string) *ForwardingRulesGetCall {
  13416. c.ifNoneMatch_ = entityTag
  13417. return c
  13418. }
  13419. // Context sets the context to be used in this call's Do method. Any
  13420. // pending HTTP request will be aborted if the provided context is
  13421. // canceled.
  13422. func (c *ForwardingRulesGetCall) Context(ctx context.Context) *ForwardingRulesGetCall {
  13423. c.ctx_ = ctx
  13424. return c
  13425. }
  13426. func (c *ForwardingRulesGetCall) doRequest(alt string) (*http.Response, error) {
  13427. var body io.Reader = nil
  13428. c.urlParams_.Set("alt", alt)
  13429. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}")
  13430. urls += "?" + c.urlParams_.Encode()
  13431. req, _ := http.NewRequest("GET", urls, body)
  13432. googleapi.Expand(req.URL, map[string]string{
  13433. "project": c.project,
  13434. "region": c.region,
  13435. "forwardingRule": c.forwardingRule,
  13436. })
  13437. req.Header.Set("User-Agent", c.s.userAgent())
  13438. if c.ifNoneMatch_ != "" {
  13439. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  13440. }
  13441. if c.ctx_ != nil {
  13442. return ctxhttp.Do(c.ctx_, c.s.client, req)
  13443. }
  13444. return c.s.client.Do(req)
  13445. }
  13446. // Do executes the "compute.forwardingRules.get" call.
  13447. // Exactly one of *ForwardingRule or error will be non-nil. Any non-2xx
  13448. // status code is an error. Response headers are in either
  13449. // *ForwardingRule.ServerResponse.Header or (if a response was returned
  13450. // at all) in error.(*googleapi.Error).Header. Use
  13451. // googleapi.IsNotModified to check whether the returned error was
  13452. // because http.StatusNotModified was returned.
  13453. func (c *ForwardingRulesGetCall) Do(opts ...googleapi.CallOption) (*ForwardingRule, error) {
  13454. gensupport.SetOptions(c.urlParams_, opts...)
  13455. res, err := c.doRequest("json")
  13456. if res != nil && res.StatusCode == http.StatusNotModified {
  13457. if res.Body != nil {
  13458. res.Body.Close()
  13459. }
  13460. return nil, &googleapi.Error{
  13461. Code: res.StatusCode,
  13462. Header: res.Header,
  13463. }
  13464. }
  13465. if err != nil {
  13466. return nil, err
  13467. }
  13468. defer googleapi.CloseBody(res)
  13469. if err := googleapi.CheckResponse(res); err != nil {
  13470. return nil, err
  13471. }
  13472. ret := &ForwardingRule{
  13473. ServerResponse: googleapi.ServerResponse{
  13474. Header: res.Header,
  13475. HTTPStatusCode: res.StatusCode,
  13476. },
  13477. }
  13478. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  13479. return nil, err
  13480. }
  13481. return ret, nil
  13482. // {
  13483. // "description": "Returns the specified ForwardingRule resource.",
  13484. // "httpMethod": "GET",
  13485. // "id": "compute.forwardingRules.get",
  13486. // "parameterOrder": [
  13487. // "project",
  13488. // "region",
  13489. // "forwardingRule"
  13490. // ],
  13491. // "parameters": {
  13492. // "forwardingRule": {
  13493. // "description": "Name of the ForwardingRule resource to return.",
  13494. // "location": "path",
  13495. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  13496. // "required": true,
  13497. // "type": "string"
  13498. // },
  13499. // "project": {
  13500. // "description": "Project ID for this request.",
  13501. // "location": "path",
  13502. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  13503. // "required": true,
  13504. // "type": "string"
  13505. // },
  13506. // "region": {
  13507. // "description": "Name of the region scoping this request.",
  13508. // "location": "path",
  13509. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  13510. // "required": true,
  13511. // "type": "string"
  13512. // }
  13513. // },
  13514. // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}",
  13515. // "response": {
  13516. // "$ref": "ForwardingRule"
  13517. // },
  13518. // "scopes": [
  13519. // "https://www.googleapis.com/auth/cloud-platform",
  13520. // "https://www.googleapis.com/auth/compute",
  13521. // "https://www.googleapis.com/auth/compute.readonly"
  13522. // ]
  13523. // }
  13524. }
  13525. // method id "compute.forwardingRules.insert":
  13526. type ForwardingRulesInsertCall struct {
  13527. s *Service
  13528. project string
  13529. region string
  13530. forwardingrule *ForwardingRule
  13531. urlParams_ gensupport.URLParams
  13532. ctx_ context.Context
  13533. }
  13534. // Insert: Creates a ForwardingRule resource in the specified project
  13535. // and region using the data included in the request.
  13536. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/insert
  13537. func (r *ForwardingRulesService) Insert(project string, region string, forwardingrule *ForwardingRule) *ForwardingRulesInsertCall {
  13538. c := &ForwardingRulesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13539. c.project = project
  13540. c.region = region
  13541. c.forwardingrule = forwardingrule
  13542. return c
  13543. }
  13544. // Fields allows partial responses to be retrieved. See
  13545. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13546. // for more information.
  13547. func (c *ForwardingRulesInsertCall) Fields(s ...googleapi.Field) *ForwardingRulesInsertCall {
  13548. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13549. return c
  13550. }
  13551. // Context sets the context to be used in this call's Do method. Any
  13552. // pending HTTP request will be aborted if the provided context is
  13553. // canceled.
  13554. func (c *ForwardingRulesInsertCall) Context(ctx context.Context) *ForwardingRulesInsertCall {
  13555. c.ctx_ = ctx
  13556. return c
  13557. }
  13558. func (c *ForwardingRulesInsertCall) doRequest(alt string) (*http.Response, error) {
  13559. var body io.Reader = nil
  13560. body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule)
  13561. if err != nil {
  13562. return nil, err
  13563. }
  13564. ctype := "application/json"
  13565. c.urlParams_.Set("alt", alt)
  13566. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules")
  13567. urls += "?" + c.urlParams_.Encode()
  13568. req, _ := http.NewRequest("POST", urls, body)
  13569. googleapi.Expand(req.URL, map[string]string{
  13570. "project": c.project,
  13571. "region": c.region,
  13572. })
  13573. req.Header.Set("Content-Type", ctype)
  13574. req.Header.Set("User-Agent", c.s.userAgent())
  13575. if c.ctx_ != nil {
  13576. return ctxhttp.Do(c.ctx_, c.s.client, req)
  13577. }
  13578. return c.s.client.Do(req)
  13579. }
  13580. // Do executes the "compute.forwardingRules.insert" call.
  13581. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  13582. // status code is an error. Response headers are in either
  13583. // *Operation.ServerResponse.Header or (if a response was returned at
  13584. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  13585. // to check whether the returned error was because
  13586. // http.StatusNotModified was returned.
  13587. func (c *ForwardingRulesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  13588. gensupport.SetOptions(c.urlParams_, opts...)
  13589. res, err := c.doRequest("json")
  13590. if res != nil && res.StatusCode == http.StatusNotModified {
  13591. if res.Body != nil {
  13592. res.Body.Close()
  13593. }
  13594. return nil, &googleapi.Error{
  13595. Code: res.StatusCode,
  13596. Header: res.Header,
  13597. }
  13598. }
  13599. if err != nil {
  13600. return nil, err
  13601. }
  13602. defer googleapi.CloseBody(res)
  13603. if err := googleapi.CheckResponse(res); err != nil {
  13604. return nil, err
  13605. }
  13606. ret := &Operation{
  13607. ServerResponse: googleapi.ServerResponse{
  13608. Header: res.Header,
  13609. HTTPStatusCode: res.StatusCode,
  13610. },
  13611. }
  13612. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  13613. return nil, err
  13614. }
  13615. return ret, nil
  13616. // {
  13617. // "description": "Creates a ForwardingRule resource in the specified project and region using the data included in the request.",
  13618. // "httpMethod": "POST",
  13619. // "id": "compute.forwardingRules.insert",
  13620. // "parameterOrder": [
  13621. // "project",
  13622. // "region"
  13623. // ],
  13624. // "parameters": {
  13625. // "project": {
  13626. // "description": "Project ID for this request.",
  13627. // "location": "path",
  13628. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  13629. // "required": true,
  13630. // "type": "string"
  13631. // },
  13632. // "region": {
  13633. // "description": "Name of the region scoping this request.",
  13634. // "location": "path",
  13635. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  13636. // "required": true,
  13637. // "type": "string"
  13638. // }
  13639. // },
  13640. // "path": "{project}/regions/{region}/forwardingRules",
  13641. // "request": {
  13642. // "$ref": "ForwardingRule"
  13643. // },
  13644. // "response": {
  13645. // "$ref": "Operation"
  13646. // },
  13647. // "scopes": [
  13648. // "https://www.googleapis.com/auth/cloud-platform",
  13649. // "https://www.googleapis.com/auth/compute"
  13650. // ]
  13651. // }
  13652. }
  13653. // method id "compute.forwardingRules.list":
  13654. type ForwardingRulesListCall struct {
  13655. s *Service
  13656. project string
  13657. region string
  13658. urlParams_ gensupport.URLParams
  13659. ifNoneMatch_ string
  13660. ctx_ context.Context
  13661. }
  13662. // List: Retrieves a list of ForwardingRule resources available to the
  13663. // specified project and region.
  13664. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/list
  13665. func (r *ForwardingRulesService) List(project string, region string) *ForwardingRulesListCall {
  13666. c := &ForwardingRulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13667. c.project = project
  13668. c.region = region
  13669. return c
  13670. }
  13671. // Filter sets the optional parameter "filter": Sets a filter expression
  13672. // for filtering listed resources, in the form filter={expression}. Your
  13673. // {expression} must be in the format: field_name comparison_string
  13674. // literal_string.
  13675. //
  13676. // The field_name is the name of the field you want to compare. Only
  13677. // atomic field types are supported (string, number, boolean). The
  13678. // comparison_string must be either eq (equals) or ne (not equals). The
  13679. // literal_string is the string value to filter to. The literal value
  13680. // must be valid for the type of field you are filtering by (string,
  13681. // number, boolean). For string fields, the literal value is interpreted
  13682. // as a regular expression using RE2 syntax. The literal value must
  13683. // match the entire field.
  13684. //
  13685. // For example, filter=name ne example-instance.
  13686. //
  13687. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  13688. // you can also filter on nested fields. For example, you could filter
  13689. // on instances that have set the scheduling.automaticRestart field to
  13690. // true. In particular, use filtering on nested fields to take advantage
  13691. // of instance labels to organize and filter results based on label
  13692. // values.
  13693. //
  13694. // The Beta API also supports filtering on multiple expressions by
  13695. // providing each separate expression within parentheses. For example,
  13696. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  13697. // Multiple expressions are treated as AND expressions meaning that
  13698. // resources must match all expressions to pass the filters.
  13699. func (c *ForwardingRulesListCall) Filter(filter string) *ForwardingRulesListCall {
  13700. c.urlParams_.Set("filter", filter)
  13701. return c
  13702. }
  13703. // MaxResults sets the optional parameter "maxResults": The maximum
  13704. // number of results per page that Compute Engine should return. If the
  13705. // number of available results is larger than maxResults, Compute Engine
  13706. // returns a nextPageToken that can be used to get the next page of
  13707. // results in subsequent list requests.
  13708. func (c *ForwardingRulesListCall) MaxResults(maxResults int64) *ForwardingRulesListCall {
  13709. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  13710. return c
  13711. }
  13712. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  13713. // a certain order. By default, results are returned in alphanumerical
  13714. // order based on the resource name.
  13715. //
  13716. // You can also sort results in descending order based on the creation
  13717. // timestamp using orderBy="creationTimestamp desc". This sorts results
  13718. // based on the creationTimestamp field in reverse chronological order
  13719. // (newest result first). Use this to sort resources like operations so
  13720. // that the newest operation is returned first.
  13721. //
  13722. // Currently, only sorting by name or creationTimestamp desc is
  13723. // supported.
  13724. func (c *ForwardingRulesListCall) OrderBy(orderBy string) *ForwardingRulesListCall {
  13725. c.urlParams_.Set("orderBy", orderBy)
  13726. return c
  13727. }
  13728. // PageToken sets the optional parameter "pageToken": Specifies a page
  13729. // token to use. Set pageToken to the nextPageToken returned by a
  13730. // previous list request to get the next page of results.
  13731. func (c *ForwardingRulesListCall) PageToken(pageToken string) *ForwardingRulesListCall {
  13732. c.urlParams_.Set("pageToken", pageToken)
  13733. return c
  13734. }
  13735. // Fields allows partial responses to be retrieved. See
  13736. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13737. // for more information.
  13738. func (c *ForwardingRulesListCall) Fields(s ...googleapi.Field) *ForwardingRulesListCall {
  13739. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13740. return c
  13741. }
  13742. // IfNoneMatch sets the optional parameter which makes the operation
  13743. // fail if the object's ETag matches the given value. This is useful for
  13744. // getting updates only after the object has changed since the last
  13745. // request. Use googleapi.IsNotModified to check whether the response
  13746. // error from Do is the result of In-None-Match.
  13747. func (c *ForwardingRulesListCall) IfNoneMatch(entityTag string) *ForwardingRulesListCall {
  13748. c.ifNoneMatch_ = entityTag
  13749. return c
  13750. }
  13751. // Context sets the context to be used in this call's Do method. Any
  13752. // pending HTTP request will be aborted if the provided context is
  13753. // canceled.
  13754. func (c *ForwardingRulesListCall) Context(ctx context.Context) *ForwardingRulesListCall {
  13755. c.ctx_ = ctx
  13756. return c
  13757. }
  13758. func (c *ForwardingRulesListCall) doRequest(alt string) (*http.Response, error) {
  13759. var body io.Reader = nil
  13760. c.urlParams_.Set("alt", alt)
  13761. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules")
  13762. urls += "?" + c.urlParams_.Encode()
  13763. req, _ := http.NewRequest("GET", urls, body)
  13764. googleapi.Expand(req.URL, map[string]string{
  13765. "project": c.project,
  13766. "region": c.region,
  13767. })
  13768. req.Header.Set("User-Agent", c.s.userAgent())
  13769. if c.ifNoneMatch_ != "" {
  13770. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  13771. }
  13772. if c.ctx_ != nil {
  13773. return ctxhttp.Do(c.ctx_, c.s.client, req)
  13774. }
  13775. return c.s.client.Do(req)
  13776. }
  13777. // Do executes the "compute.forwardingRules.list" call.
  13778. // Exactly one of *ForwardingRuleList or error will be non-nil. Any
  13779. // non-2xx status code is an error. Response headers are in either
  13780. // *ForwardingRuleList.ServerResponse.Header or (if a response was
  13781. // returned at all) in error.(*googleapi.Error).Header. Use
  13782. // googleapi.IsNotModified to check whether the returned error was
  13783. // because http.StatusNotModified was returned.
  13784. func (c *ForwardingRulesListCall) Do(opts ...googleapi.CallOption) (*ForwardingRuleList, error) {
  13785. gensupport.SetOptions(c.urlParams_, opts...)
  13786. res, err := c.doRequest("json")
  13787. if res != nil && res.StatusCode == http.StatusNotModified {
  13788. if res.Body != nil {
  13789. res.Body.Close()
  13790. }
  13791. return nil, &googleapi.Error{
  13792. Code: res.StatusCode,
  13793. Header: res.Header,
  13794. }
  13795. }
  13796. if err != nil {
  13797. return nil, err
  13798. }
  13799. defer googleapi.CloseBody(res)
  13800. if err := googleapi.CheckResponse(res); err != nil {
  13801. return nil, err
  13802. }
  13803. ret := &ForwardingRuleList{
  13804. ServerResponse: googleapi.ServerResponse{
  13805. Header: res.Header,
  13806. HTTPStatusCode: res.StatusCode,
  13807. },
  13808. }
  13809. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  13810. return nil, err
  13811. }
  13812. return ret, nil
  13813. // {
  13814. // "description": "Retrieves a list of ForwardingRule resources available to the specified project and region.",
  13815. // "httpMethod": "GET",
  13816. // "id": "compute.forwardingRules.list",
  13817. // "parameterOrder": [
  13818. // "project",
  13819. // "region"
  13820. // ],
  13821. // "parameters": {
  13822. // "filter": {
  13823. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  13824. // "location": "query",
  13825. // "type": "string"
  13826. // },
  13827. // "maxResults": {
  13828. // "default": "500",
  13829. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  13830. // "format": "uint32",
  13831. // "location": "query",
  13832. // "maximum": "500",
  13833. // "minimum": "0",
  13834. // "type": "integer"
  13835. // },
  13836. // "orderBy": {
  13837. // "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.",
  13838. // "location": "query",
  13839. // "type": "string"
  13840. // },
  13841. // "pageToken": {
  13842. // "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.",
  13843. // "location": "query",
  13844. // "type": "string"
  13845. // },
  13846. // "project": {
  13847. // "description": "Project ID for this request.",
  13848. // "location": "path",
  13849. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  13850. // "required": true,
  13851. // "type": "string"
  13852. // },
  13853. // "region": {
  13854. // "description": "Name of the region scoping this request.",
  13855. // "location": "path",
  13856. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  13857. // "required": true,
  13858. // "type": "string"
  13859. // }
  13860. // },
  13861. // "path": "{project}/regions/{region}/forwardingRules",
  13862. // "response": {
  13863. // "$ref": "ForwardingRuleList"
  13864. // },
  13865. // "scopes": [
  13866. // "https://www.googleapis.com/auth/cloud-platform",
  13867. // "https://www.googleapis.com/auth/compute",
  13868. // "https://www.googleapis.com/auth/compute.readonly"
  13869. // ]
  13870. // }
  13871. }
  13872. // Pages invokes f for each page of results.
  13873. // A non-nil error returned from f will halt the iteration.
  13874. // The provided context supersedes any context provided to the Context method.
  13875. func (c *ForwardingRulesListCall) Pages(ctx context.Context, f func(*ForwardingRuleList) error) error {
  13876. c.ctx_ = ctx
  13877. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  13878. for {
  13879. x, err := c.Do()
  13880. if err != nil {
  13881. return err
  13882. }
  13883. if err := f(x); err != nil {
  13884. return err
  13885. }
  13886. if x.NextPageToken == "" {
  13887. return nil
  13888. }
  13889. c.PageToken(x.NextPageToken)
  13890. }
  13891. }
  13892. // method id "compute.forwardingRules.setTarget":
  13893. type ForwardingRulesSetTargetCall struct {
  13894. s *Service
  13895. project string
  13896. region string
  13897. forwardingRule string
  13898. targetreference *TargetReference
  13899. urlParams_ gensupport.URLParams
  13900. ctx_ context.Context
  13901. }
  13902. // SetTarget: Changes target URL for forwarding rule. The new target
  13903. // should be of the same type as the old target.
  13904. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/setTarget
  13905. func (r *ForwardingRulesService) SetTarget(project string, region string, forwardingRule string, targetreference *TargetReference) *ForwardingRulesSetTargetCall {
  13906. c := &ForwardingRulesSetTargetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13907. c.project = project
  13908. c.region = region
  13909. c.forwardingRule = forwardingRule
  13910. c.targetreference = targetreference
  13911. return c
  13912. }
  13913. // Fields allows partial responses to be retrieved. See
  13914. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13915. // for more information.
  13916. func (c *ForwardingRulesSetTargetCall) Fields(s ...googleapi.Field) *ForwardingRulesSetTargetCall {
  13917. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13918. return c
  13919. }
  13920. // Context sets the context to be used in this call's Do method. Any
  13921. // pending HTTP request will be aborted if the provided context is
  13922. // canceled.
  13923. func (c *ForwardingRulesSetTargetCall) Context(ctx context.Context) *ForwardingRulesSetTargetCall {
  13924. c.ctx_ = ctx
  13925. return c
  13926. }
  13927. func (c *ForwardingRulesSetTargetCall) doRequest(alt string) (*http.Response, error) {
  13928. var body io.Reader = nil
  13929. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference)
  13930. if err != nil {
  13931. return nil, err
  13932. }
  13933. ctype := "application/json"
  13934. c.urlParams_.Set("alt", alt)
  13935. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget")
  13936. urls += "?" + c.urlParams_.Encode()
  13937. req, _ := http.NewRequest("POST", urls, body)
  13938. googleapi.Expand(req.URL, map[string]string{
  13939. "project": c.project,
  13940. "region": c.region,
  13941. "forwardingRule": c.forwardingRule,
  13942. })
  13943. req.Header.Set("Content-Type", ctype)
  13944. req.Header.Set("User-Agent", c.s.userAgent())
  13945. if c.ctx_ != nil {
  13946. return ctxhttp.Do(c.ctx_, c.s.client, req)
  13947. }
  13948. return c.s.client.Do(req)
  13949. }
  13950. // Do executes the "compute.forwardingRules.setTarget" call.
  13951. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  13952. // status code is an error. Response headers are in either
  13953. // *Operation.ServerResponse.Header or (if a response was returned at
  13954. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  13955. // to check whether the returned error was because
  13956. // http.StatusNotModified was returned.
  13957. func (c *ForwardingRulesSetTargetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  13958. gensupport.SetOptions(c.urlParams_, opts...)
  13959. res, err := c.doRequest("json")
  13960. if res != nil && res.StatusCode == http.StatusNotModified {
  13961. if res.Body != nil {
  13962. res.Body.Close()
  13963. }
  13964. return nil, &googleapi.Error{
  13965. Code: res.StatusCode,
  13966. Header: res.Header,
  13967. }
  13968. }
  13969. if err != nil {
  13970. return nil, err
  13971. }
  13972. defer googleapi.CloseBody(res)
  13973. if err := googleapi.CheckResponse(res); err != nil {
  13974. return nil, err
  13975. }
  13976. ret := &Operation{
  13977. ServerResponse: googleapi.ServerResponse{
  13978. Header: res.Header,
  13979. HTTPStatusCode: res.StatusCode,
  13980. },
  13981. }
  13982. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  13983. return nil, err
  13984. }
  13985. return ret, nil
  13986. // {
  13987. // "description": "Changes target URL for forwarding rule. The new target should be of the same type as the old target.",
  13988. // "httpMethod": "POST",
  13989. // "id": "compute.forwardingRules.setTarget",
  13990. // "parameterOrder": [
  13991. // "project",
  13992. // "region",
  13993. // "forwardingRule"
  13994. // ],
  13995. // "parameters": {
  13996. // "forwardingRule": {
  13997. // "description": "Name of the ForwardingRule resource in which target is to be set.",
  13998. // "location": "path",
  13999. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  14000. // "required": true,
  14001. // "type": "string"
  14002. // },
  14003. // "project": {
  14004. // "description": "Project ID for this request.",
  14005. // "location": "path",
  14006. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  14007. // "required": true,
  14008. // "type": "string"
  14009. // },
  14010. // "region": {
  14011. // "description": "Name of the region scoping this request.",
  14012. // "location": "path",
  14013. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  14014. // "required": true,
  14015. // "type": "string"
  14016. // }
  14017. // },
  14018. // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget",
  14019. // "request": {
  14020. // "$ref": "TargetReference"
  14021. // },
  14022. // "response": {
  14023. // "$ref": "Operation"
  14024. // },
  14025. // "scopes": [
  14026. // "https://www.googleapis.com/auth/cloud-platform",
  14027. // "https://www.googleapis.com/auth/compute"
  14028. // ]
  14029. // }
  14030. }
  14031. // method id "compute.globalAddresses.delete":
  14032. type GlobalAddressesDeleteCall struct {
  14033. s *Service
  14034. project string
  14035. address string
  14036. urlParams_ gensupport.URLParams
  14037. ctx_ context.Context
  14038. }
  14039. // Delete: Deletes the specified address resource.
  14040. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/delete
  14041. func (r *GlobalAddressesService) Delete(project string, address string) *GlobalAddressesDeleteCall {
  14042. c := &GlobalAddressesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14043. c.project = project
  14044. c.address = address
  14045. return c
  14046. }
  14047. // Fields allows partial responses to be retrieved. See
  14048. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14049. // for more information.
  14050. func (c *GlobalAddressesDeleteCall) Fields(s ...googleapi.Field) *GlobalAddressesDeleteCall {
  14051. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14052. return c
  14053. }
  14054. // Context sets the context to be used in this call's Do method. Any
  14055. // pending HTTP request will be aborted if the provided context is
  14056. // canceled.
  14057. func (c *GlobalAddressesDeleteCall) Context(ctx context.Context) *GlobalAddressesDeleteCall {
  14058. c.ctx_ = ctx
  14059. return c
  14060. }
  14061. func (c *GlobalAddressesDeleteCall) doRequest(alt string) (*http.Response, error) {
  14062. var body io.Reader = nil
  14063. c.urlParams_.Set("alt", alt)
  14064. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{address}")
  14065. urls += "?" + c.urlParams_.Encode()
  14066. req, _ := http.NewRequest("DELETE", urls, body)
  14067. googleapi.Expand(req.URL, map[string]string{
  14068. "project": c.project,
  14069. "address": c.address,
  14070. })
  14071. req.Header.Set("User-Agent", c.s.userAgent())
  14072. if c.ctx_ != nil {
  14073. return ctxhttp.Do(c.ctx_, c.s.client, req)
  14074. }
  14075. return c.s.client.Do(req)
  14076. }
  14077. // Do executes the "compute.globalAddresses.delete" call.
  14078. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  14079. // status code is an error. Response headers are in either
  14080. // *Operation.ServerResponse.Header or (if a response was returned at
  14081. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  14082. // to check whether the returned error was because
  14083. // http.StatusNotModified was returned.
  14084. func (c *GlobalAddressesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  14085. gensupport.SetOptions(c.urlParams_, opts...)
  14086. res, err := c.doRequest("json")
  14087. if res != nil && res.StatusCode == http.StatusNotModified {
  14088. if res.Body != nil {
  14089. res.Body.Close()
  14090. }
  14091. return nil, &googleapi.Error{
  14092. Code: res.StatusCode,
  14093. Header: res.Header,
  14094. }
  14095. }
  14096. if err != nil {
  14097. return nil, err
  14098. }
  14099. defer googleapi.CloseBody(res)
  14100. if err := googleapi.CheckResponse(res); err != nil {
  14101. return nil, err
  14102. }
  14103. ret := &Operation{
  14104. ServerResponse: googleapi.ServerResponse{
  14105. Header: res.Header,
  14106. HTTPStatusCode: res.StatusCode,
  14107. },
  14108. }
  14109. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  14110. return nil, err
  14111. }
  14112. return ret, nil
  14113. // {
  14114. // "description": "Deletes the specified address resource.",
  14115. // "httpMethod": "DELETE",
  14116. // "id": "compute.globalAddresses.delete",
  14117. // "parameterOrder": [
  14118. // "project",
  14119. // "address"
  14120. // ],
  14121. // "parameters": {
  14122. // "address": {
  14123. // "description": "Name of the address resource to delete.",
  14124. // "location": "path",
  14125. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  14126. // "required": true,
  14127. // "type": "string"
  14128. // },
  14129. // "project": {
  14130. // "description": "Project ID for this request.",
  14131. // "location": "path",
  14132. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  14133. // "required": true,
  14134. // "type": "string"
  14135. // }
  14136. // },
  14137. // "path": "{project}/global/addresses/{address}",
  14138. // "response": {
  14139. // "$ref": "Operation"
  14140. // },
  14141. // "scopes": [
  14142. // "https://www.googleapis.com/auth/cloud-platform",
  14143. // "https://www.googleapis.com/auth/compute"
  14144. // ]
  14145. // }
  14146. }
  14147. // method id "compute.globalAddresses.get":
  14148. type GlobalAddressesGetCall struct {
  14149. s *Service
  14150. project string
  14151. address string
  14152. urlParams_ gensupport.URLParams
  14153. ifNoneMatch_ string
  14154. ctx_ context.Context
  14155. }
  14156. // Get: Returns the specified address resource.
  14157. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/get
  14158. func (r *GlobalAddressesService) Get(project string, address string) *GlobalAddressesGetCall {
  14159. c := &GlobalAddressesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14160. c.project = project
  14161. c.address = address
  14162. return c
  14163. }
  14164. // Fields allows partial responses to be retrieved. See
  14165. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14166. // for more information.
  14167. func (c *GlobalAddressesGetCall) Fields(s ...googleapi.Field) *GlobalAddressesGetCall {
  14168. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14169. return c
  14170. }
  14171. // IfNoneMatch sets the optional parameter which makes the operation
  14172. // fail if the object's ETag matches the given value. This is useful for
  14173. // getting updates only after the object has changed since the last
  14174. // request. Use googleapi.IsNotModified to check whether the response
  14175. // error from Do is the result of In-None-Match.
  14176. func (c *GlobalAddressesGetCall) IfNoneMatch(entityTag string) *GlobalAddressesGetCall {
  14177. c.ifNoneMatch_ = entityTag
  14178. return c
  14179. }
  14180. // Context sets the context to be used in this call's Do method. Any
  14181. // pending HTTP request will be aborted if the provided context is
  14182. // canceled.
  14183. func (c *GlobalAddressesGetCall) Context(ctx context.Context) *GlobalAddressesGetCall {
  14184. c.ctx_ = ctx
  14185. return c
  14186. }
  14187. func (c *GlobalAddressesGetCall) doRequest(alt string) (*http.Response, error) {
  14188. var body io.Reader = nil
  14189. c.urlParams_.Set("alt", alt)
  14190. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{address}")
  14191. urls += "?" + c.urlParams_.Encode()
  14192. req, _ := http.NewRequest("GET", urls, body)
  14193. googleapi.Expand(req.URL, map[string]string{
  14194. "project": c.project,
  14195. "address": c.address,
  14196. })
  14197. req.Header.Set("User-Agent", c.s.userAgent())
  14198. if c.ifNoneMatch_ != "" {
  14199. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  14200. }
  14201. if c.ctx_ != nil {
  14202. return ctxhttp.Do(c.ctx_, c.s.client, req)
  14203. }
  14204. return c.s.client.Do(req)
  14205. }
  14206. // Do executes the "compute.globalAddresses.get" call.
  14207. // Exactly one of *Address or error will be non-nil. Any non-2xx status
  14208. // code is an error. Response headers are in either
  14209. // *Address.ServerResponse.Header or (if a response was returned at all)
  14210. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  14211. // check whether the returned error was because http.StatusNotModified
  14212. // was returned.
  14213. func (c *GlobalAddressesGetCall) Do(opts ...googleapi.CallOption) (*Address, error) {
  14214. gensupport.SetOptions(c.urlParams_, opts...)
  14215. res, err := c.doRequest("json")
  14216. if res != nil && res.StatusCode == http.StatusNotModified {
  14217. if res.Body != nil {
  14218. res.Body.Close()
  14219. }
  14220. return nil, &googleapi.Error{
  14221. Code: res.StatusCode,
  14222. Header: res.Header,
  14223. }
  14224. }
  14225. if err != nil {
  14226. return nil, err
  14227. }
  14228. defer googleapi.CloseBody(res)
  14229. if err := googleapi.CheckResponse(res); err != nil {
  14230. return nil, err
  14231. }
  14232. ret := &Address{
  14233. ServerResponse: googleapi.ServerResponse{
  14234. Header: res.Header,
  14235. HTTPStatusCode: res.StatusCode,
  14236. },
  14237. }
  14238. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  14239. return nil, err
  14240. }
  14241. return ret, nil
  14242. // {
  14243. // "description": "Returns the specified address resource.",
  14244. // "httpMethod": "GET",
  14245. // "id": "compute.globalAddresses.get",
  14246. // "parameterOrder": [
  14247. // "project",
  14248. // "address"
  14249. // ],
  14250. // "parameters": {
  14251. // "address": {
  14252. // "description": "Name of the address resource to return.",
  14253. // "location": "path",
  14254. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  14255. // "required": true,
  14256. // "type": "string"
  14257. // },
  14258. // "project": {
  14259. // "description": "Project ID for this request.",
  14260. // "location": "path",
  14261. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  14262. // "required": true,
  14263. // "type": "string"
  14264. // }
  14265. // },
  14266. // "path": "{project}/global/addresses/{address}",
  14267. // "response": {
  14268. // "$ref": "Address"
  14269. // },
  14270. // "scopes": [
  14271. // "https://www.googleapis.com/auth/cloud-platform",
  14272. // "https://www.googleapis.com/auth/compute",
  14273. // "https://www.googleapis.com/auth/compute.readonly"
  14274. // ]
  14275. // }
  14276. }
  14277. // method id "compute.globalAddresses.insert":
  14278. type GlobalAddressesInsertCall struct {
  14279. s *Service
  14280. project string
  14281. address *Address
  14282. urlParams_ gensupport.URLParams
  14283. ctx_ context.Context
  14284. }
  14285. // Insert: Creates an address resource in the specified project using
  14286. // the data included in the request.
  14287. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/insert
  14288. func (r *GlobalAddressesService) Insert(project string, address *Address) *GlobalAddressesInsertCall {
  14289. c := &GlobalAddressesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14290. c.project = project
  14291. c.address = address
  14292. return c
  14293. }
  14294. // Fields allows partial responses to be retrieved. See
  14295. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14296. // for more information.
  14297. func (c *GlobalAddressesInsertCall) Fields(s ...googleapi.Field) *GlobalAddressesInsertCall {
  14298. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14299. return c
  14300. }
  14301. // Context sets the context to be used in this call's Do method. Any
  14302. // pending HTTP request will be aborted if the provided context is
  14303. // canceled.
  14304. func (c *GlobalAddressesInsertCall) Context(ctx context.Context) *GlobalAddressesInsertCall {
  14305. c.ctx_ = ctx
  14306. return c
  14307. }
  14308. func (c *GlobalAddressesInsertCall) doRequest(alt string) (*http.Response, error) {
  14309. var body io.Reader = nil
  14310. body, err := googleapi.WithoutDataWrapper.JSONReader(c.address)
  14311. if err != nil {
  14312. return nil, err
  14313. }
  14314. ctype := "application/json"
  14315. c.urlParams_.Set("alt", alt)
  14316. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses")
  14317. urls += "?" + c.urlParams_.Encode()
  14318. req, _ := http.NewRequest("POST", urls, body)
  14319. googleapi.Expand(req.URL, map[string]string{
  14320. "project": c.project,
  14321. })
  14322. req.Header.Set("Content-Type", ctype)
  14323. req.Header.Set("User-Agent", c.s.userAgent())
  14324. if c.ctx_ != nil {
  14325. return ctxhttp.Do(c.ctx_, c.s.client, req)
  14326. }
  14327. return c.s.client.Do(req)
  14328. }
  14329. // Do executes the "compute.globalAddresses.insert" call.
  14330. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  14331. // status code is an error. Response headers are in either
  14332. // *Operation.ServerResponse.Header or (if a response was returned at
  14333. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  14334. // to check whether the returned error was because
  14335. // http.StatusNotModified was returned.
  14336. func (c *GlobalAddressesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  14337. gensupport.SetOptions(c.urlParams_, opts...)
  14338. res, err := c.doRequest("json")
  14339. if res != nil && res.StatusCode == http.StatusNotModified {
  14340. if res.Body != nil {
  14341. res.Body.Close()
  14342. }
  14343. return nil, &googleapi.Error{
  14344. Code: res.StatusCode,
  14345. Header: res.Header,
  14346. }
  14347. }
  14348. if err != nil {
  14349. return nil, err
  14350. }
  14351. defer googleapi.CloseBody(res)
  14352. if err := googleapi.CheckResponse(res); err != nil {
  14353. return nil, err
  14354. }
  14355. ret := &Operation{
  14356. ServerResponse: googleapi.ServerResponse{
  14357. Header: res.Header,
  14358. HTTPStatusCode: res.StatusCode,
  14359. },
  14360. }
  14361. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  14362. return nil, err
  14363. }
  14364. return ret, nil
  14365. // {
  14366. // "description": "Creates an address resource in the specified project using the data included in the request.",
  14367. // "httpMethod": "POST",
  14368. // "id": "compute.globalAddresses.insert",
  14369. // "parameterOrder": [
  14370. // "project"
  14371. // ],
  14372. // "parameters": {
  14373. // "project": {
  14374. // "description": "Project ID for this request.",
  14375. // "location": "path",
  14376. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  14377. // "required": true,
  14378. // "type": "string"
  14379. // }
  14380. // },
  14381. // "path": "{project}/global/addresses",
  14382. // "request": {
  14383. // "$ref": "Address"
  14384. // },
  14385. // "response": {
  14386. // "$ref": "Operation"
  14387. // },
  14388. // "scopes": [
  14389. // "https://www.googleapis.com/auth/cloud-platform",
  14390. // "https://www.googleapis.com/auth/compute"
  14391. // ]
  14392. // }
  14393. }
  14394. // method id "compute.globalAddresses.list":
  14395. type GlobalAddressesListCall struct {
  14396. s *Service
  14397. project string
  14398. urlParams_ gensupport.URLParams
  14399. ifNoneMatch_ string
  14400. ctx_ context.Context
  14401. }
  14402. // List: Retrieves a list of global address resources.
  14403. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/list
  14404. func (r *GlobalAddressesService) List(project string) *GlobalAddressesListCall {
  14405. c := &GlobalAddressesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14406. c.project = project
  14407. return c
  14408. }
  14409. // Filter sets the optional parameter "filter": Sets a filter expression
  14410. // for filtering listed resources, in the form filter={expression}. Your
  14411. // {expression} must be in the format: field_name comparison_string
  14412. // literal_string.
  14413. //
  14414. // The field_name is the name of the field you want to compare. Only
  14415. // atomic field types are supported (string, number, boolean). The
  14416. // comparison_string must be either eq (equals) or ne (not equals). The
  14417. // literal_string is the string value to filter to. The literal value
  14418. // must be valid for the type of field you are filtering by (string,
  14419. // number, boolean). For string fields, the literal value is interpreted
  14420. // as a regular expression using RE2 syntax. The literal value must
  14421. // match the entire field.
  14422. //
  14423. // For example, filter=name ne example-instance.
  14424. //
  14425. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  14426. // you can also filter on nested fields. For example, you could filter
  14427. // on instances that have set the scheduling.automaticRestart field to
  14428. // true. In particular, use filtering on nested fields to take advantage
  14429. // of instance labels to organize and filter results based on label
  14430. // values.
  14431. //
  14432. // The Beta API also supports filtering on multiple expressions by
  14433. // providing each separate expression within parentheses. For example,
  14434. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  14435. // Multiple expressions are treated as AND expressions meaning that
  14436. // resources must match all expressions to pass the filters.
  14437. func (c *GlobalAddressesListCall) Filter(filter string) *GlobalAddressesListCall {
  14438. c.urlParams_.Set("filter", filter)
  14439. return c
  14440. }
  14441. // MaxResults sets the optional parameter "maxResults": The maximum
  14442. // number of results per page that Compute Engine should return. If the
  14443. // number of available results is larger than maxResults, Compute Engine
  14444. // returns a nextPageToken that can be used to get the next page of
  14445. // results in subsequent list requests.
  14446. func (c *GlobalAddressesListCall) MaxResults(maxResults int64) *GlobalAddressesListCall {
  14447. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  14448. return c
  14449. }
  14450. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  14451. // a certain order. By default, results are returned in alphanumerical
  14452. // order based on the resource name.
  14453. //
  14454. // You can also sort results in descending order based on the creation
  14455. // timestamp using orderBy="creationTimestamp desc". This sorts results
  14456. // based on the creationTimestamp field in reverse chronological order
  14457. // (newest result first). Use this to sort resources like operations so
  14458. // that the newest operation is returned first.
  14459. //
  14460. // Currently, only sorting by name or creationTimestamp desc is
  14461. // supported.
  14462. func (c *GlobalAddressesListCall) OrderBy(orderBy string) *GlobalAddressesListCall {
  14463. c.urlParams_.Set("orderBy", orderBy)
  14464. return c
  14465. }
  14466. // PageToken sets the optional parameter "pageToken": Specifies a page
  14467. // token to use. Set pageToken to the nextPageToken returned by a
  14468. // previous list request to get the next page of results.
  14469. func (c *GlobalAddressesListCall) PageToken(pageToken string) *GlobalAddressesListCall {
  14470. c.urlParams_.Set("pageToken", pageToken)
  14471. return c
  14472. }
  14473. // Fields allows partial responses to be retrieved. See
  14474. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14475. // for more information.
  14476. func (c *GlobalAddressesListCall) Fields(s ...googleapi.Field) *GlobalAddressesListCall {
  14477. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14478. return c
  14479. }
  14480. // IfNoneMatch sets the optional parameter which makes the operation
  14481. // fail if the object's ETag matches the given value. This is useful for
  14482. // getting updates only after the object has changed since the last
  14483. // request. Use googleapi.IsNotModified to check whether the response
  14484. // error from Do is the result of In-None-Match.
  14485. func (c *GlobalAddressesListCall) IfNoneMatch(entityTag string) *GlobalAddressesListCall {
  14486. c.ifNoneMatch_ = entityTag
  14487. return c
  14488. }
  14489. // Context sets the context to be used in this call's Do method. Any
  14490. // pending HTTP request will be aborted if the provided context is
  14491. // canceled.
  14492. func (c *GlobalAddressesListCall) Context(ctx context.Context) *GlobalAddressesListCall {
  14493. c.ctx_ = ctx
  14494. return c
  14495. }
  14496. func (c *GlobalAddressesListCall) doRequest(alt string) (*http.Response, error) {
  14497. var body io.Reader = nil
  14498. c.urlParams_.Set("alt", alt)
  14499. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses")
  14500. urls += "?" + c.urlParams_.Encode()
  14501. req, _ := http.NewRequest("GET", urls, body)
  14502. googleapi.Expand(req.URL, map[string]string{
  14503. "project": c.project,
  14504. })
  14505. req.Header.Set("User-Agent", c.s.userAgent())
  14506. if c.ifNoneMatch_ != "" {
  14507. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  14508. }
  14509. if c.ctx_ != nil {
  14510. return ctxhttp.Do(c.ctx_, c.s.client, req)
  14511. }
  14512. return c.s.client.Do(req)
  14513. }
  14514. // Do executes the "compute.globalAddresses.list" call.
  14515. // Exactly one of *AddressList or error will be non-nil. Any non-2xx
  14516. // status code is an error. Response headers are in either
  14517. // *AddressList.ServerResponse.Header or (if a response was returned at
  14518. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  14519. // to check whether the returned error was because
  14520. // http.StatusNotModified was returned.
  14521. func (c *GlobalAddressesListCall) Do(opts ...googleapi.CallOption) (*AddressList, error) {
  14522. gensupport.SetOptions(c.urlParams_, opts...)
  14523. res, err := c.doRequest("json")
  14524. if res != nil && res.StatusCode == http.StatusNotModified {
  14525. if res.Body != nil {
  14526. res.Body.Close()
  14527. }
  14528. return nil, &googleapi.Error{
  14529. Code: res.StatusCode,
  14530. Header: res.Header,
  14531. }
  14532. }
  14533. if err != nil {
  14534. return nil, err
  14535. }
  14536. defer googleapi.CloseBody(res)
  14537. if err := googleapi.CheckResponse(res); err != nil {
  14538. return nil, err
  14539. }
  14540. ret := &AddressList{
  14541. ServerResponse: googleapi.ServerResponse{
  14542. Header: res.Header,
  14543. HTTPStatusCode: res.StatusCode,
  14544. },
  14545. }
  14546. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  14547. return nil, err
  14548. }
  14549. return ret, nil
  14550. // {
  14551. // "description": "Retrieves a list of global address resources.",
  14552. // "httpMethod": "GET",
  14553. // "id": "compute.globalAddresses.list",
  14554. // "parameterOrder": [
  14555. // "project"
  14556. // ],
  14557. // "parameters": {
  14558. // "filter": {
  14559. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  14560. // "location": "query",
  14561. // "type": "string"
  14562. // },
  14563. // "maxResults": {
  14564. // "default": "500",
  14565. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  14566. // "format": "uint32",
  14567. // "location": "query",
  14568. // "maximum": "500",
  14569. // "minimum": "0",
  14570. // "type": "integer"
  14571. // },
  14572. // "orderBy": {
  14573. // "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.",
  14574. // "location": "query",
  14575. // "type": "string"
  14576. // },
  14577. // "pageToken": {
  14578. // "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.",
  14579. // "location": "query",
  14580. // "type": "string"
  14581. // },
  14582. // "project": {
  14583. // "description": "Project ID for this request.",
  14584. // "location": "path",
  14585. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  14586. // "required": true,
  14587. // "type": "string"
  14588. // }
  14589. // },
  14590. // "path": "{project}/global/addresses",
  14591. // "response": {
  14592. // "$ref": "AddressList"
  14593. // },
  14594. // "scopes": [
  14595. // "https://www.googleapis.com/auth/cloud-platform",
  14596. // "https://www.googleapis.com/auth/compute",
  14597. // "https://www.googleapis.com/auth/compute.readonly"
  14598. // ]
  14599. // }
  14600. }
  14601. // Pages invokes f for each page of results.
  14602. // A non-nil error returned from f will halt the iteration.
  14603. // The provided context supersedes any context provided to the Context method.
  14604. func (c *GlobalAddressesListCall) Pages(ctx context.Context, f func(*AddressList) error) error {
  14605. c.ctx_ = ctx
  14606. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  14607. for {
  14608. x, err := c.Do()
  14609. if err != nil {
  14610. return err
  14611. }
  14612. if err := f(x); err != nil {
  14613. return err
  14614. }
  14615. if x.NextPageToken == "" {
  14616. return nil
  14617. }
  14618. c.PageToken(x.NextPageToken)
  14619. }
  14620. }
  14621. // method id "compute.globalForwardingRules.delete":
  14622. type GlobalForwardingRulesDeleteCall struct {
  14623. s *Service
  14624. project string
  14625. forwardingRule string
  14626. urlParams_ gensupport.URLParams
  14627. ctx_ context.Context
  14628. }
  14629. // Delete: Deletes the specified ForwardingRule resource.
  14630. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/delete
  14631. func (r *GlobalForwardingRulesService) Delete(project string, forwardingRule string) *GlobalForwardingRulesDeleteCall {
  14632. c := &GlobalForwardingRulesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14633. c.project = project
  14634. c.forwardingRule = forwardingRule
  14635. return c
  14636. }
  14637. // Fields allows partial responses to be retrieved. See
  14638. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14639. // for more information.
  14640. func (c *GlobalForwardingRulesDeleteCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesDeleteCall {
  14641. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14642. return c
  14643. }
  14644. // Context sets the context to be used in this call's Do method. Any
  14645. // pending HTTP request will be aborted if the provided context is
  14646. // canceled.
  14647. func (c *GlobalForwardingRulesDeleteCall) Context(ctx context.Context) *GlobalForwardingRulesDeleteCall {
  14648. c.ctx_ = ctx
  14649. return c
  14650. }
  14651. func (c *GlobalForwardingRulesDeleteCall) doRequest(alt string) (*http.Response, error) {
  14652. var body io.Reader = nil
  14653. c.urlParams_.Set("alt", alt)
  14654. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}")
  14655. urls += "?" + c.urlParams_.Encode()
  14656. req, _ := http.NewRequest("DELETE", urls, body)
  14657. googleapi.Expand(req.URL, map[string]string{
  14658. "project": c.project,
  14659. "forwardingRule": c.forwardingRule,
  14660. })
  14661. req.Header.Set("User-Agent", c.s.userAgent())
  14662. if c.ctx_ != nil {
  14663. return ctxhttp.Do(c.ctx_, c.s.client, req)
  14664. }
  14665. return c.s.client.Do(req)
  14666. }
  14667. // Do executes the "compute.globalForwardingRules.delete" call.
  14668. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  14669. // status code is an error. Response headers are in either
  14670. // *Operation.ServerResponse.Header or (if a response was returned at
  14671. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  14672. // to check whether the returned error was because
  14673. // http.StatusNotModified was returned.
  14674. func (c *GlobalForwardingRulesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  14675. gensupport.SetOptions(c.urlParams_, opts...)
  14676. res, err := c.doRequest("json")
  14677. if res != nil && res.StatusCode == http.StatusNotModified {
  14678. if res.Body != nil {
  14679. res.Body.Close()
  14680. }
  14681. return nil, &googleapi.Error{
  14682. Code: res.StatusCode,
  14683. Header: res.Header,
  14684. }
  14685. }
  14686. if err != nil {
  14687. return nil, err
  14688. }
  14689. defer googleapi.CloseBody(res)
  14690. if err := googleapi.CheckResponse(res); err != nil {
  14691. return nil, err
  14692. }
  14693. ret := &Operation{
  14694. ServerResponse: googleapi.ServerResponse{
  14695. Header: res.Header,
  14696. HTTPStatusCode: res.StatusCode,
  14697. },
  14698. }
  14699. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  14700. return nil, err
  14701. }
  14702. return ret, nil
  14703. // {
  14704. // "description": "Deletes the specified ForwardingRule resource.",
  14705. // "httpMethod": "DELETE",
  14706. // "id": "compute.globalForwardingRules.delete",
  14707. // "parameterOrder": [
  14708. // "project",
  14709. // "forwardingRule"
  14710. // ],
  14711. // "parameters": {
  14712. // "forwardingRule": {
  14713. // "description": "Name of the ForwardingRule resource to delete.",
  14714. // "location": "path",
  14715. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  14716. // "required": true,
  14717. // "type": "string"
  14718. // },
  14719. // "project": {
  14720. // "description": "Project ID for this request.",
  14721. // "location": "path",
  14722. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  14723. // "required": true,
  14724. // "type": "string"
  14725. // }
  14726. // },
  14727. // "path": "{project}/global/forwardingRules/{forwardingRule}",
  14728. // "response": {
  14729. // "$ref": "Operation"
  14730. // },
  14731. // "scopes": [
  14732. // "https://www.googleapis.com/auth/cloud-platform",
  14733. // "https://www.googleapis.com/auth/compute"
  14734. // ]
  14735. // }
  14736. }
  14737. // method id "compute.globalForwardingRules.get":
  14738. type GlobalForwardingRulesGetCall struct {
  14739. s *Service
  14740. project string
  14741. forwardingRule string
  14742. urlParams_ gensupport.URLParams
  14743. ifNoneMatch_ string
  14744. ctx_ context.Context
  14745. }
  14746. // Get: Returns the specified ForwardingRule resource.
  14747. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/get
  14748. func (r *GlobalForwardingRulesService) Get(project string, forwardingRule string) *GlobalForwardingRulesGetCall {
  14749. c := &GlobalForwardingRulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14750. c.project = project
  14751. c.forwardingRule = forwardingRule
  14752. return c
  14753. }
  14754. // Fields allows partial responses to be retrieved. See
  14755. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14756. // for more information.
  14757. func (c *GlobalForwardingRulesGetCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesGetCall {
  14758. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14759. return c
  14760. }
  14761. // IfNoneMatch sets the optional parameter which makes the operation
  14762. // fail if the object's ETag matches the given value. This is useful for
  14763. // getting updates only after the object has changed since the last
  14764. // request. Use googleapi.IsNotModified to check whether the response
  14765. // error from Do is the result of In-None-Match.
  14766. func (c *GlobalForwardingRulesGetCall) IfNoneMatch(entityTag string) *GlobalForwardingRulesGetCall {
  14767. c.ifNoneMatch_ = entityTag
  14768. return c
  14769. }
  14770. // Context sets the context to be used in this call's Do method. Any
  14771. // pending HTTP request will be aborted if the provided context is
  14772. // canceled.
  14773. func (c *GlobalForwardingRulesGetCall) Context(ctx context.Context) *GlobalForwardingRulesGetCall {
  14774. c.ctx_ = ctx
  14775. return c
  14776. }
  14777. func (c *GlobalForwardingRulesGetCall) doRequest(alt string) (*http.Response, error) {
  14778. var body io.Reader = nil
  14779. c.urlParams_.Set("alt", alt)
  14780. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}")
  14781. urls += "?" + c.urlParams_.Encode()
  14782. req, _ := http.NewRequest("GET", urls, body)
  14783. googleapi.Expand(req.URL, map[string]string{
  14784. "project": c.project,
  14785. "forwardingRule": c.forwardingRule,
  14786. })
  14787. req.Header.Set("User-Agent", c.s.userAgent())
  14788. if c.ifNoneMatch_ != "" {
  14789. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  14790. }
  14791. if c.ctx_ != nil {
  14792. return ctxhttp.Do(c.ctx_, c.s.client, req)
  14793. }
  14794. return c.s.client.Do(req)
  14795. }
  14796. // Do executes the "compute.globalForwardingRules.get" call.
  14797. // Exactly one of *ForwardingRule or error will be non-nil. Any non-2xx
  14798. // status code is an error. Response headers are in either
  14799. // *ForwardingRule.ServerResponse.Header or (if a response was returned
  14800. // at all) in error.(*googleapi.Error).Header. Use
  14801. // googleapi.IsNotModified to check whether the returned error was
  14802. // because http.StatusNotModified was returned.
  14803. func (c *GlobalForwardingRulesGetCall) Do(opts ...googleapi.CallOption) (*ForwardingRule, error) {
  14804. gensupport.SetOptions(c.urlParams_, opts...)
  14805. res, err := c.doRequest("json")
  14806. if res != nil && res.StatusCode == http.StatusNotModified {
  14807. if res.Body != nil {
  14808. res.Body.Close()
  14809. }
  14810. return nil, &googleapi.Error{
  14811. Code: res.StatusCode,
  14812. Header: res.Header,
  14813. }
  14814. }
  14815. if err != nil {
  14816. return nil, err
  14817. }
  14818. defer googleapi.CloseBody(res)
  14819. if err := googleapi.CheckResponse(res); err != nil {
  14820. return nil, err
  14821. }
  14822. ret := &ForwardingRule{
  14823. ServerResponse: googleapi.ServerResponse{
  14824. Header: res.Header,
  14825. HTTPStatusCode: res.StatusCode,
  14826. },
  14827. }
  14828. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  14829. return nil, err
  14830. }
  14831. return ret, nil
  14832. // {
  14833. // "description": "Returns the specified ForwardingRule resource.",
  14834. // "httpMethod": "GET",
  14835. // "id": "compute.globalForwardingRules.get",
  14836. // "parameterOrder": [
  14837. // "project",
  14838. // "forwardingRule"
  14839. // ],
  14840. // "parameters": {
  14841. // "forwardingRule": {
  14842. // "description": "Name of the ForwardingRule resource to return.",
  14843. // "location": "path",
  14844. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  14845. // "required": true,
  14846. // "type": "string"
  14847. // },
  14848. // "project": {
  14849. // "description": "Project ID for this request.",
  14850. // "location": "path",
  14851. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  14852. // "required": true,
  14853. // "type": "string"
  14854. // }
  14855. // },
  14856. // "path": "{project}/global/forwardingRules/{forwardingRule}",
  14857. // "response": {
  14858. // "$ref": "ForwardingRule"
  14859. // },
  14860. // "scopes": [
  14861. // "https://www.googleapis.com/auth/cloud-platform",
  14862. // "https://www.googleapis.com/auth/compute",
  14863. // "https://www.googleapis.com/auth/compute.readonly"
  14864. // ]
  14865. // }
  14866. }
  14867. // method id "compute.globalForwardingRules.insert":
  14868. type GlobalForwardingRulesInsertCall struct {
  14869. s *Service
  14870. project string
  14871. forwardingrule *ForwardingRule
  14872. urlParams_ gensupport.URLParams
  14873. ctx_ context.Context
  14874. }
  14875. // Insert: Creates a ForwardingRule resource in the specified project
  14876. // and region using the data included in the request.
  14877. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/insert
  14878. func (r *GlobalForwardingRulesService) Insert(project string, forwardingrule *ForwardingRule) *GlobalForwardingRulesInsertCall {
  14879. c := &GlobalForwardingRulesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14880. c.project = project
  14881. c.forwardingrule = forwardingrule
  14882. return c
  14883. }
  14884. // Fields allows partial responses to be retrieved. See
  14885. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14886. // for more information.
  14887. func (c *GlobalForwardingRulesInsertCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesInsertCall {
  14888. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14889. return c
  14890. }
  14891. // Context sets the context to be used in this call's Do method. Any
  14892. // pending HTTP request will be aborted if the provided context is
  14893. // canceled.
  14894. func (c *GlobalForwardingRulesInsertCall) Context(ctx context.Context) *GlobalForwardingRulesInsertCall {
  14895. c.ctx_ = ctx
  14896. return c
  14897. }
  14898. func (c *GlobalForwardingRulesInsertCall) doRequest(alt string) (*http.Response, error) {
  14899. var body io.Reader = nil
  14900. body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule)
  14901. if err != nil {
  14902. return nil, err
  14903. }
  14904. ctype := "application/json"
  14905. c.urlParams_.Set("alt", alt)
  14906. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules")
  14907. urls += "?" + c.urlParams_.Encode()
  14908. req, _ := http.NewRequest("POST", urls, body)
  14909. googleapi.Expand(req.URL, map[string]string{
  14910. "project": c.project,
  14911. })
  14912. req.Header.Set("Content-Type", ctype)
  14913. req.Header.Set("User-Agent", c.s.userAgent())
  14914. if c.ctx_ != nil {
  14915. return ctxhttp.Do(c.ctx_, c.s.client, req)
  14916. }
  14917. return c.s.client.Do(req)
  14918. }
  14919. // Do executes the "compute.globalForwardingRules.insert" call.
  14920. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  14921. // status code is an error. Response headers are in either
  14922. // *Operation.ServerResponse.Header or (if a response was returned at
  14923. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  14924. // to check whether the returned error was because
  14925. // http.StatusNotModified was returned.
  14926. func (c *GlobalForwardingRulesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  14927. gensupport.SetOptions(c.urlParams_, opts...)
  14928. res, err := c.doRequest("json")
  14929. if res != nil && res.StatusCode == http.StatusNotModified {
  14930. if res.Body != nil {
  14931. res.Body.Close()
  14932. }
  14933. return nil, &googleapi.Error{
  14934. Code: res.StatusCode,
  14935. Header: res.Header,
  14936. }
  14937. }
  14938. if err != nil {
  14939. return nil, err
  14940. }
  14941. defer googleapi.CloseBody(res)
  14942. if err := googleapi.CheckResponse(res); err != nil {
  14943. return nil, err
  14944. }
  14945. ret := &Operation{
  14946. ServerResponse: googleapi.ServerResponse{
  14947. Header: res.Header,
  14948. HTTPStatusCode: res.StatusCode,
  14949. },
  14950. }
  14951. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  14952. return nil, err
  14953. }
  14954. return ret, nil
  14955. // {
  14956. // "description": "Creates a ForwardingRule resource in the specified project and region using the data included in the request.",
  14957. // "httpMethod": "POST",
  14958. // "id": "compute.globalForwardingRules.insert",
  14959. // "parameterOrder": [
  14960. // "project"
  14961. // ],
  14962. // "parameters": {
  14963. // "project": {
  14964. // "description": "Project ID for this request.",
  14965. // "location": "path",
  14966. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  14967. // "required": true,
  14968. // "type": "string"
  14969. // }
  14970. // },
  14971. // "path": "{project}/global/forwardingRules",
  14972. // "request": {
  14973. // "$ref": "ForwardingRule"
  14974. // },
  14975. // "response": {
  14976. // "$ref": "Operation"
  14977. // },
  14978. // "scopes": [
  14979. // "https://www.googleapis.com/auth/cloud-platform",
  14980. // "https://www.googleapis.com/auth/compute"
  14981. // ]
  14982. // }
  14983. }
  14984. // method id "compute.globalForwardingRules.list":
  14985. type GlobalForwardingRulesListCall struct {
  14986. s *Service
  14987. project string
  14988. urlParams_ gensupport.URLParams
  14989. ifNoneMatch_ string
  14990. ctx_ context.Context
  14991. }
  14992. // List: Retrieves a list of ForwardingRule resources available to the
  14993. // specified project.
  14994. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/list
  14995. func (r *GlobalForwardingRulesService) List(project string) *GlobalForwardingRulesListCall {
  14996. c := &GlobalForwardingRulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14997. c.project = project
  14998. return c
  14999. }
  15000. // Filter sets the optional parameter "filter": Sets a filter expression
  15001. // for filtering listed resources, in the form filter={expression}. Your
  15002. // {expression} must be in the format: field_name comparison_string
  15003. // literal_string.
  15004. //
  15005. // The field_name is the name of the field you want to compare. Only
  15006. // atomic field types are supported (string, number, boolean). The
  15007. // comparison_string must be either eq (equals) or ne (not equals). The
  15008. // literal_string is the string value to filter to. The literal value
  15009. // must be valid for the type of field you are filtering by (string,
  15010. // number, boolean). For string fields, the literal value is interpreted
  15011. // as a regular expression using RE2 syntax. The literal value must
  15012. // match the entire field.
  15013. //
  15014. // For example, filter=name ne example-instance.
  15015. //
  15016. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  15017. // you can also filter on nested fields. For example, you could filter
  15018. // on instances that have set the scheduling.automaticRestart field to
  15019. // true. In particular, use filtering on nested fields to take advantage
  15020. // of instance labels to organize and filter results based on label
  15021. // values.
  15022. //
  15023. // The Beta API also supports filtering on multiple expressions by
  15024. // providing each separate expression within parentheses. For example,
  15025. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  15026. // Multiple expressions are treated as AND expressions meaning that
  15027. // resources must match all expressions to pass the filters.
  15028. func (c *GlobalForwardingRulesListCall) Filter(filter string) *GlobalForwardingRulesListCall {
  15029. c.urlParams_.Set("filter", filter)
  15030. return c
  15031. }
  15032. // MaxResults sets the optional parameter "maxResults": The maximum
  15033. // number of results per page that Compute Engine should return. If the
  15034. // number of available results is larger than maxResults, Compute Engine
  15035. // returns a nextPageToken that can be used to get the next page of
  15036. // results in subsequent list requests.
  15037. func (c *GlobalForwardingRulesListCall) MaxResults(maxResults int64) *GlobalForwardingRulesListCall {
  15038. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  15039. return c
  15040. }
  15041. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  15042. // a certain order. By default, results are returned in alphanumerical
  15043. // order based on the resource name.
  15044. //
  15045. // You can also sort results in descending order based on the creation
  15046. // timestamp using orderBy="creationTimestamp desc". This sorts results
  15047. // based on the creationTimestamp field in reverse chronological order
  15048. // (newest result first). Use this to sort resources like operations so
  15049. // that the newest operation is returned first.
  15050. //
  15051. // Currently, only sorting by name or creationTimestamp desc is
  15052. // supported.
  15053. func (c *GlobalForwardingRulesListCall) OrderBy(orderBy string) *GlobalForwardingRulesListCall {
  15054. c.urlParams_.Set("orderBy", orderBy)
  15055. return c
  15056. }
  15057. // PageToken sets the optional parameter "pageToken": Specifies a page
  15058. // token to use. Set pageToken to the nextPageToken returned by a
  15059. // previous list request to get the next page of results.
  15060. func (c *GlobalForwardingRulesListCall) PageToken(pageToken string) *GlobalForwardingRulesListCall {
  15061. c.urlParams_.Set("pageToken", pageToken)
  15062. return c
  15063. }
  15064. // Fields allows partial responses to be retrieved. See
  15065. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15066. // for more information.
  15067. func (c *GlobalForwardingRulesListCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesListCall {
  15068. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15069. return c
  15070. }
  15071. // IfNoneMatch sets the optional parameter which makes the operation
  15072. // fail if the object's ETag matches the given value. This is useful for
  15073. // getting updates only after the object has changed since the last
  15074. // request. Use googleapi.IsNotModified to check whether the response
  15075. // error from Do is the result of In-None-Match.
  15076. func (c *GlobalForwardingRulesListCall) IfNoneMatch(entityTag string) *GlobalForwardingRulesListCall {
  15077. c.ifNoneMatch_ = entityTag
  15078. return c
  15079. }
  15080. // Context sets the context to be used in this call's Do method. Any
  15081. // pending HTTP request will be aborted if the provided context is
  15082. // canceled.
  15083. func (c *GlobalForwardingRulesListCall) Context(ctx context.Context) *GlobalForwardingRulesListCall {
  15084. c.ctx_ = ctx
  15085. return c
  15086. }
  15087. func (c *GlobalForwardingRulesListCall) doRequest(alt string) (*http.Response, error) {
  15088. var body io.Reader = nil
  15089. c.urlParams_.Set("alt", alt)
  15090. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules")
  15091. urls += "?" + c.urlParams_.Encode()
  15092. req, _ := http.NewRequest("GET", urls, body)
  15093. googleapi.Expand(req.URL, map[string]string{
  15094. "project": c.project,
  15095. })
  15096. req.Header.Set("User-Agent", c.s.userAgent())
  15097. if c.ifNoneMatch_ != "" {
  15098. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  15099. }
  15100. if c.ctx_ != nil {
  15101. return ctxhttp.Do(c.ctx_, c.s.client, req)
  15102. }
  15103. return c.s.client.Do(req)
  15104. }
  15105. // Do executes the "compute.globalForwardingRules.list" call.
  15106. // Exactly one of *ForwardingRuleList or error will be non-nil. Any
  15107. // non-2xx status code is an error. Response headers are in either
  15108. // *ForwardingRuleList.ServerResponse.Header or (if a response was
  15109. // returned at all) in error.(*googleapi.Error).Header. Use
  15110. // googleapi.IsNotModified to check whether the returned error was
  15111. // because http.StatusNotModified was returned.
  15112. func (c *GlobalForwardingRulesListCall) Do(opts ...googleapi.CallOption) (*ForwardingRuleList, error) {
  15113. gensupport.SetOptions(c.urlParams_, opts...)
  15114. res, err := c.doRequest("json")
  15115. if res != nil && res.StatusCode == http.StatusNotModified {
  15116. if res.Body != nil {
  15117. res.Body.Close()
  15118. }
  15119. return nil, &googleapi.Error{
  15120. Code: res.StatusCode,
  15121. Header: res.Header,
  15122. }
  15123. }
  15124. if err != nil {
  15125. return nil, err
  15126. }
  15127. defer googleapi.CloseBody(res)
  15128. if err := googleapi.CheckResponse(res); err != nil {
  15129. return nil, err
  15130. }
  15131. ret := &ForwardingRuleList{
  15132. ServerResponse: googleapi.ServerResponse{
  15133. Header: res.Header,
  15134. HTTPStatusCode: res.StatusCode,
  15135. },
  15136. }
  15137. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  15138. return nil, err
  15139. }
  15140. return ret, nil
  15141. // {
  15142. // "description": "Retrieves a list of ForwardingRule resources available to the specified project.",
  15143. // "httpMethod": "GET",
  15144. // "id": "compute.globalForwardingRules.list",
  15145. // "parameterOrder": [
  15146. // "project"
  15147. // ],
  15148. // "parameters": {
  15149. // "filter": {
  15150. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  15151. // "location": "query",
  15152. // "type": "string"
  15153. // },
  15154. // "maxResults": {
  15155. // "default": "500",
  15156. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  15157. // "format": "uint32",
  15158. // "location": "query",
  15159. // "maximum": "500",
  15160. // "minimum": "0",
  15161. // "type": "integer"
  15162. // },
  15163. // "orderBy": {
  15164. // "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.",
  15165. // "location": "query",
  15166. // "type": "string"
  15167. // },
  15168. // "pageToken": {
  15169. // "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.",
  15170. // "location": "query",
  15171. // "type": "string"
  15172. // },
  15173. // "project": {
  15174. // "description": "Project ID for this request.",
  15175. // "location": "path",
  15176. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  15177. // "required": true,
  15178. // "type": "string"
  15179. // }
  15180. // },
  15181. // "path": "{project}/global/forwardingRules",
  15182. // "response": {
  15183. // "$ref": "ForwardingRuleList"
  15184. // },
  15185. // "scopes": [
  15186. // "https://www.googleapis.com/auth/cloud-platform",
  15187. // "https://www.googleapis.com/auth/compute",
  15188. // "https://www.googleapis.com/auth/compute.readonly"
  15189. // ]
  15190. // }
  15191. }
  15192. // Pages invokes f for each page of results.
  15193. // A non-nil error returned from f will halt the iteration.
  15194. // The provided context supersedes any context provided to the Context method.
  15195. func (c *GlobalForwardingRulesListCall) Pages(ctx context.Context, f func(*ForwardingRuleList) error) error {
  15196. c.ctx_ = ctx
  15197. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  15198. for {
  15199. x, err := c.Do()
  15200. if err != nil {
  15201. return err
  15202. }
  15203. if err := f(x); err != nil {
  15204. return err
  15205. }
  15206. if x.NextPageToken == "" {
  15207. return nil
  15208. }
  15209. c.PageToken(x.NextPageToken)
  15210. }
  15211. }
  15212. // method id "compute.globalForwardingRules.setTarget":
  15213. type GlobalForwardingRulesSetTargetCall struct {
  15214. s *Service
  15215. project string
  15216. forwardingRule string
  15217. targetreference *TargetReference
  15218. urlParams_ gensupport.URLParams
  15219. ctx_ context.Context
  15220. }
  15221. // SetTarget: Changes target URL for forwarding rule. The new target
  15222. // should be of the same type as the old target.
  15223. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/setTarget
  15224. func (r *GlobalForwardingRulesService) SetTarget(project string, forwardingRule string, targetreference *TargetReference) *GlobalForwardingRulesSetTargetCall {
  15225. c := &GlobalForwardingRulesSetTargetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15226. c.project = project
  15227. c.forwardingRule = forwardingRule
  15228. c.targetreference = targetreference
  15229. return c
  15230. }
  15231. // Fields allows partial responses to be retrieved. See
  15232. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15233. // for more information.
  15234. func (c *GlobalForwardingRulesSetTargetCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesSetTargetCall {
  15235. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15236. return c
  15237. }
  15238. // Context sets the context to be used in this call's Do method. Any
  15239. // pending HTTP request will be aborted if the provided context is
  15240. // canceled.
  15241. func (c *GlobalForwardingRulesSetTargetCall) Context(ctx context.Context) *GlobalForwardingRulesSetTargetCall {
  15242. c.ctx_ = ctx
  15243. return c
  15244. }
  15245. func (c *GlobalForwardingRulesSetTargetCall) doRequest(alt string) (*http.Response, error) {
  15246. var body io.Reader = nil
  15247. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference)
  15248. if err != nil {
  15249. return nil, err
  15250. }
  15251. ctype := "application/json"
  15252. c.urlParams_.Set("alt", alt)
  15253. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}/setTarget")
  15254. urls += "?" + c.urlParams_.Encode()
  15255. req, _ := http.NewRequest("POST", urls, body)
  15256. googleapi.Expand(req.URL, map[string]string{
  15257. "project": c.project,
  15258. "forwardingRule": c.forwardingRule,
  15259. })
  15260. req.Header.Set("Content-Type", ctype)
  15261. req.Header.Set("User-Agent", c.s.userAgent())
  15262. if c.ctx_ != nil {
  15263. return ctxhttp.Do(c.ctx_, c.s.client, req)
  15264. }
  15265. return c.s.client.Do(req)
  15266. }
  15267. // Do executes the "compute.globalForwardingRules.setTarget" call.
  15268. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  15269. // status code is an error. Response headers are in either
  15270. // *Operation.ServerResponse.Header or (if a response was returned at
  15271. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  15272. // to check whether the returned error was because
  15273. // http.StatusNotModified was returned.
  15274. func (c *GlobalForwardingRulesSetTargetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  15275. gensupport.SetOptions(c.urlParams_, opts...)
  15276. res, err := c.doRequest("json")
  15277. if res != nil && res.StatusCode == http.StatusNotModified {
  15278. if res.Body != nil {
  15279. res.Body.Close()
  15280. }
  15281. return nil, &googleapi.Error{
  15282. Code: res.StatusCode,
  15283. Header: res.Header,
  15284. }
  15285. }
  15286. if err != nil {
  15287. return nil, err
  15288. }
  15289. defer googleapi.CloseBody(res)
  15290. if err := googleapi.CheckResponse(res); err != nil {
  15291. return nil, err
  15292. }
  15293. ret := &Operation{
  15294. ServerResponse: googleapi.ServerResponse{
  15295. Header: res.Header,
  15296. HTTPStatusCode: res.StatusCode,
  15297. },
  15298. }
  15299. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  15300. return nil, err
  15301. }
  15302. return ret, nil
  15303. // {
  15304. // "description": "Changes target URL for forwarding rule. The new target should be of the same type as the old target.",
  15305. // "httpMethod": "POST",
  15306. // "id": "compute.globalForwardingRules.setTarget",
  15307. // "parameterOrder": [
  15308. // "project",
  15309. // "forwardingRule"
  15310. // ],
  15311. // "parameters": {
  15312. // "forwardingRule": {
  15313. // "description": "Name of the ForwardingRule resource in which target is to be set.",
  15314. // "location": "path",
  15315. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  15316. // "required": true,
  15317. // "type": "string"
  15318. // },
  15319. // "project": {
  15320. // "description": "Project ID for this request.",
  15321. // "location": "path",
  15322. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  15323. // "required": true,
  15324. // "type": "string"
  15325. // }
  15326. // },
  15327. // "path": "{project}/global/forwardingRules/{forwardingRule}/setTarget",
  15328. // "request": {
  15329. // "$ref": "TargetReference"
  15330. // },
  15331. // "response": {
  15332. // "$ref": "Operation"
  15333. // },
  15334. // "scopes": [
  15335. // "https://www.googleapis.com/auth/cloud-platform",
  15336. // "https://www.googleapis.com/auth/compute"
  15337. // ]
  15338. // }
  15339. }
  15340. // method id "compute.globalOperations.aggregatedList":
  15341. type GlobalOperationsAggregatedListCall struct {
  15342. s *Service
  15343. project string
  15344. urlParams_ gensupport.URLParams
  15345. ifNoneMatch_ string
  15346. ctx_ context.Context
  15347. }
  15348. // AggregatedList: Retrieves an aggregated list of all operations.
  15349. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/aggregatedList
  15350. func (r *GlobalOperationsService) AggregatedList(project string) *GlobalOperationsAggregatedListCall {
  15351. c := &GlobalOperationsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15352. c.project = project
  15353. return c
  15354. }
  15355. // Filter sets the optional parameter "filter": Sets a filter expression
  15356. // for filtering listed resources, in the form filter={expression}. Your
  15357. // {expression} must be in the format: field_name comparison_string
  15358. // literal_string.
  15359. //
  15360. // The field_name is the name of the field you want to compare. Only
  15361. // atomic field types are supported (string, number, boolean). The
  15362. // comparison_string must be either eq (equals) or ne (not equals). The
  15363. // literal_string is the string value to filter to. The literal value
  15364. // must be valid for the type of field you are filtering by (string,
  15365. // number, boolean). For string fields, the literal value is interpreted
  15366. // as a regular expression using RE2 syntax. The literal value must
  15367. // match the entire field.
  15368. //
  15369. // For example, filter=name ne example-instance.
  15370. //
  15371. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  15372. // you can also filter on nested fields. For example, you could filter
  15373. // on instances that have set the scheduling.automaticRestart field to
  15374. // true. In particular, use filtering on nested fields to take advantage
  15375. // of instance labels to organize and filter results based on label
  15376. // values.
  15377. //
  15378. // The Beta API also supports filtering on multiple expressions by
  15379. // providing each separate expression within parentheses. For example,
  15380. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  15381. // Multiple expressions are treated as AND expressions meaning that
  15382. // resources must match all expressions to pass the filters.
  15383. func (c *GlobalOperationsAggregatedListCall) Filter(filter string) *GlobalOperationsAggregatedListCall {
  15384. c.urlParams_.Set("filter", filter)
  15385. return c
  15386. }
  15387. // MaxResults sets the optional parameter "maxResults": The maximum
  15388. // number of results per page that Compute Engine should return. If the
  15389. // number of available results is larger than maxResults, Compute Engine
  15390. // returns a nextPageToken that can be used to get the next page of
  15391. // results in subsequent list requests.
  15392. func (c *GlobalOperationsAggregatedListCall) MaxResults(maxResults int64) *GlobalOperationsAggregatedListCall {
  15393. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  15394. return c
  15395. }
  15396. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  15397. // a certain order. By default, results are returned in alphanumerical
  15398. // order based on the resource name.
  15399. //
  15400. // You can also sort results in descending order based on the creation
  15401. // timestamp using orderBy="creationTimestamp desc". This sorts results
  15402. // based on the creationTimestamp field in reverse chronological order
  15403. // (newest result first). Use this to sort resources like operations so
  15404. // that the newest operation is returned first.
  15405. //
  15406. // Currently, only sorting by name or creationTimestamp desc is
  15407. // supported.
  15408. func (c *GlobalOperationsAggregatedListCall) OrderBy(orderBy string) *GlobalOperationsAggregatedListCall {
  15409. c.urlParams_.Set("orderBy", orderBy)
  15410. return c
  15411. }
  15412. // PageToken sets the optional parameter "pageToken": Specifies a page
  15413. // token to use. Set pageToken to the nextPageToken returned by a
  15414. // previous list request to get the next page of results.
  15415. func (c *GlobalOperationsAggregatedListCall) PageToken(pageToken string) *GlobalOperationsAggregatedListCall {
  15416. c.urlParams_.Set("pageToken", pageToken)
  15417. return c
  15418. }
  15419. // Fields allows partial responses to be retrieved. See
  15420. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15421. // for more information.
  15422. func (c *GlobalOperationsAggregatedListCall) Fields(s ...googleapi.Field) *GlobalOperationsAggregatedListCall {
  15423. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15424. return c
  15425. }
  15426. // IfNoneMatch sets the optional parameter which makes the operation
  15427. // fail if the object's ETag matches the given value. This is useful for
  15428. // getting updates only after the object has changed since the last
  15429. // request. Use googleapi.IsNotModified to check whether the response
  15430. // error from Do is the result of In-None-Match.
  15431. func (c *GlobalOperationsAggregatedListCall) IfNoneMatch(entityTag string) *GlobalOperationsAggregatedListCall {
  15432. c.ifNoneMatch_ = entityTag
  15433. return c
  15434. }
  15435. // Context sets the context to be used in this call's Do method. Any
  15436. // pending HTTP request will be aborted if the provided context is
  15437. // canceled.
  15438. func (c *GlobalOperationsAggregatedListCall) Context(ctx context.Context) *GlobalOperationsAggregatedListCall {
  15439. c.ctx_ = ctx
  15440. return c
  15441. }
  15442. func (c *GlobalOperationsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  15443. var body io.Reader = nil
  15444. c.urlParams_.Set("alt", alt)
  15445. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/operations")
  15446. urls += "?" + c.urlParams_.Encode()
  15447. req, _ := http.NewRequest("GET", urls, body)
  15448. googleapi.Expand(req.URL, map[string]string{
  15449. "project": c.project,
  15450. })
  15451. req.Header.Set("User-Agent", c.s.userAgent())
  15452. if c.ifNoneMatch_ != "" {
  15453. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  15454. }
  15455. if c.ctx_ != nil {
  15456. return ctxhttp.Do(c.ctx_, c.s.client, req)
  15457. }
  15458. return c.s.client.Do(req)
  15459. }
  15460. // Do executes the "compute.globalOperations.aggregatedList" call.
  15461. // Exactly one of *OperationAggregatedList or error will be non-nil. Any
  15462. // non-2xx status code is an error. Response headers are in either
  15463. // *OperationAggregatedList.ServerResponse.Header or (if a response was
  15464. // returned at all) in error.(*googleapi.Error).Header. Use
  15465. // googleapi.IsNotModified to check whether the returned error was
  15466. // because http.StatusNotModified was returned.
  15467. func (c *GlobalOperationsAggregatedListCall) Do(opts ...googleapi.CallOption) (*OperationAggregatedList, error) {
  15468. gensupport.SetOptions(c.urlParams_, opts...)
  15469. res, err := c.doRequest("json")
  15470. if res != nil && res.StatusCode == http.StatusNotModified {
  15471. if res.Body != nil {
  15472. res.Body.Close()
  15473. }
  15474. return nil, &googleapi.Error{
  15475. Code: res.StatusCode,
  15476. Header: res.Header,
  15477. }
  15478. }
  15479. if err != nil {
  15480. return nil, err
  15481. }
  15482. defer googleapi.CloseBody(res)
  15483. if err := googleapi.CheckResponse(res); err != nil {
  15484. return nil, err
  15485. }
  15486. ret := &OperationAggregatedList{
  15487. ServerResponse: googleapi.ServerResponse{
  15488. Header: res.Header,
  15489. HTTPStatusCode: res.StatusCode,
  15490. },
  15491. }
  15492. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  15493. return nil, err
  15494. }
  15495. return ret, nil
  15496. // {
  15497. // "description": "Retrieves an aggregated list of all operations.",
  15498. // "httpMethod": "GET",
  15499. // "id": "compute.globalOperations.aggregatedList",
  15500. // "parameterOrder": [
  15501. // "project"
  15502. // ],
  15503. // "parameters": {
  15504. // "filter": {
  15505. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  15506. // "location": "query",
  15507. // "type": "string"
  15508. // },
  15509. // "maxResults": {
  15510. // "default": "500",
  15511. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  15512. // "format": "uint32",
  15513. // "location": "query",
  15514. // "maximum": "500",
  15515. // "minimum": "0",
  15516. // "type": "integer"
  15517. // },
  15518. // "orderBy": {
  15519. // "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.",
  15520. // "location": "query",
  15521. // "type": "string"
  15522. // },
  15523. // "pageToken": {
  15524. // "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.",
  15525. // "location": "query",
  15526. // "type": "string"
  15527. // },
  15528. // "project": {
  15529. // "description": "Project ID for this request.",
  15530. // "location": "path",
  15531. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  15532. // "required": true,
  15533. // "type": "string"
  15534. // }
  15535. // },
  15536. // "path": "{project}/aggregated/operations",
  15537. // "response": {
  15538. // "$ref": "OperationAggregatedList"
  15539. // },
  15540. // "scopes": [
  15541. // "https://www.googleapis.com/auth/cloud-platform",
  15542. // "https://www.googleapis.com/auth/compute",
  15543. // "https://www.googleapis.com/auth/compute.readonly"
  15544. // ]
  15545. // }
  15546. }
  15547. // Pages invokes f for each page of results.
  15548. // A non-nil error returned from f will halt the iteration.
  15549. // The provided context supersedes any context provided to the Context method.
  15550. func (c *GlobalOperationsAggregatedListCall) Pages(ctx context.Context, f func(*OperationAggregatedList) error) error {
  15551. c.ctx_ = ctx
  15552. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  15553. for {
  15554. x, err := c.Do()
  15555. if err != nil {
  15556. return err
  15557. }
  15558. if err := f(x); err != nil {
  15559. return err
  15560. }
  15561. if x.NextPageToken == "" {
  15562. return nil
  15563. }
  15564. c.PageToken(x.NextPageToken)
  15565. }
  15566. }
  15567. // method id "compute.globalOperations.delete":
  15568. type GlobalOperationsDeleteCall struct {
  15569. s *Service
  15570. project string
  15571. operation string
  15572. urlParams_ gensupport.URLParams
  15573. ctx_ context.Context
  15574. }
  15575. // Delete: Deletes the specified Operations resource.
  15576. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/delete
  15577. func (r *GlobalOperationsService) Delete(project string, operation string) *GlobalOperationsDeleteCall {
  15578. c := &GlobalOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15579. c.project = project
  15580. c.operation = operation
  15581. return c
  15582. }
  15583. // Fields allows partial responses to be retrieved. See
  15584. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15585. // for more information.
  15586. func (c *GlobalOperationsDeleteCall) Fields(s ...googleapi.Field) *GlobalOperationsDeleteCall {
  15587. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15588. return c
  15589. }
  15590. // Context sets the context to be used in this call's Do method. Any
  15591. // pending HTTP request will be aborted if the provided context is
  15592. // canceled.
  15593. func (c *GlobalOperationsDeleteCall) Context(ctx context.Context) *GlobalOperationsDeleteCall {
  15594. c.ctx_ = ctx
  15595. return c
  15596. }
  15597. func (c *GlobalOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  15598. var body io.Reader = nil
  15599. c.urlParams_.Set("alt", alt)
  15600. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}")
  15601. urls += "?" + c.urlParams_.Encode()
  15602. req, _ := http.NewRequest("DELETE", urls, body)
  15603. googleapi.Expand(req.URL, map[string]string{
  15604. "project": c.project,
  15605. "operation": c.operation,
  15606. })
  15607. req.Header.Set("User-Agent", c.s.userAgent())
  15608. if c.ctx_ != nil {
  15609. return ctxhttp.Do(c.ctx_, c.s.client, req)
  15610. }
  15611. return c.s.client.Do(req)
  15612. }
  15613. // Do executes the "compute.globalOperations.delete" call.
  15614. func (c *GlobalOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  15615. gensupport.SetOptions(c.urlParams_, opts...)
  15616. res, err := c.doRequest("json")
  15617. if err != nil {
  15618. return err
  15619. }
  15620. defer googleapi.CloseBody(res)
  15621. if err := googleapi.CheckResponse(res); err != nil {
  15622. return err
  15623. }
  15624. return nil
  15625. // {
  15626. // "description": "Deletes the specified Operations resource.",
  15627. // "httpMethod": "DELETE",
  15628. // "id": "compute.globalOperations.delete",
  15629. // "parameterOrder": [
  15630. // "project",
  15631. // "operation"
  15632. // ],
  15633. // "parameters": {
  15634. // "operation": {
  15635. // "description": "Name of the Operations resource to delete.",
  15636. // "location": "path",
  15637. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  15638. // "required": true,
  15639. // "type": "string"
  15640. // },
  15641. // "project": {
  15642. // "description": "Project ID for this request.",
  15643. // "location": "path",
  15644. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  15645. // "required": true,
  15646. // "type": "string"
  15647. // }
  15648. // },
  15649. // "path": "{project}/global/operations/{operation}",
  15650. // "scopes": [
  15651. // "https://www.googleapis.com/auth/cloud-platform",
  15652. // "https://www.googleapis.com/auth/compute"
  15653. // ]
  15654. // }
  15655. }
  15656. // method id "compute.globalOperations.get":
  15657. type GlobalOperationsGetCall struct {
  15658. s *Service
  15659. project string
  15660. operation string
  15661. urlParams_ gensupport.URLParams
  15662. ifNoneMatch_ string
  15663. ctx_ context.Context
  15664. }
  15665. // Get: Retrieves the specified Operations resource.
  15666. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/get
  15667. func (r *GlobalOperationsService) Get(project string, operation string) *GlobalOperationsGetCall {
  15668. c := &GlobalOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15669. c.project = project
  15670. c.operation = operation
  15671. return c
  15672. }
  15673. // Fields allows partial responses to be retrieved. See
  15674. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15675. // for more information.
  15676. func (c *GlobalOperationsGetCall) Fields(s ...googleapi.Field) *GlobalOperationsGetCall {
  15677. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15678. return c
  15679. }
  15680. // IfNoneMatch sets the optional parameter which makes the operation
  15681. // fail if the object's ETag matches the given value. This is useful for
  15682. // getting updates only after the object has changed since the last
  15683. // request. Use googleapi.IsNotModified to check whether the response
  15684. // error from Do is the result of In-None-Match.
  15685. func (c *GlobalOperationsGetCall) IfNoneMatch(entityTag string) *GlobalOperationsGetCall {
  15686. c.ifNoneMatch_ = entityTag
  15687. return c
  15688. }
  15689. // Context sets the context to be used in this call's Do method. Any
  15690. // pending HTTP request will be aborted if the provided context is
  15691. // canceled.
  15692. func (c *GlobalOperationsGetCall) Context(ctx context.Context) *GlobalOperationsGetCall {
  15693. c.ctx_ = ctx
  15694. return c
  15695. }
  15696. func (c *GlobalOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  15697. var body io.Reader = nil
  15698. c.urlParams_.Set("alt", alt)
  15699. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}")
  15700. urls += "?" + c.urlParams_.Encode()
  15701. req, _ := http.NewRequest("GET", urls, body)
  15702. googleapi.Expand(req.URL, map[string]string{
  15703. "project": c.project,
  15704. "operation": c.operation,
  15705. })
  15706. req.Header.Set("User-Agent", c.s.userAgent())
  15707. if c.ifNoneMatch_ != "" {
  15708. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  15709. }
  15710. if c.ctx_ != nil {
  15711. return ctxhttp.Do(c.ctx_, c.s.client, req)
  15712. }
  15713. return c.s.client.Do(req)
  15714. }
  15715. // Do executes the "compute.globalOperations.get" call.
  15716. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  15717. // status code is an error. Response headers are in either
  15718. // *Operation.ServerResponse.Header or (if a response was returned at
  15719. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  15720. // to check whether the returned error was because
  15721. // http.StatusNotModified was returned.
  15722. func (c *GlobalOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  15723. gensupport.SetOptions(c.urlParams_, opts...)
  15724. res, err := c.doRequest("json")
  15725. if res != nil && res.StatusCode == http.StatusNotModified {
  15726. if res.Body != nil {
  15727. res.Body.Close()
  15728. }
  15729. return nil, &googleapi.Error{
  15730. Code: res.StatusCode,
  15731. Header: res.Header,
  15732. }
  15733. }
  15734. if err != nil {
  15735. return nil, err
  15736. }
  15737. defer googleapi.CloseBody(res)
  15738. if err := googleapi.CheckResponse(res); err != nil {
  15739. return nil, err
  15740. }
  15741. ret := &Operation{
  15742. ServerResponse: googleapi.ServerResponse{
  15743. Header: res.Header,
  15744. HTTPStatusCode: res.StatusCode,
  15745. },
  15746. }
  15747. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  15748. return nil, err
  15749. }
  15750. return ret, nil
  15751. // {
  15752. // "description": "Retrieves the specified Operations resource.",
  15753. // "httpMethod": "GET",
  15754. // "id": "compute.globalOperations.get",
  15755. // "parameterOrder": [
  15756. // "project",
  15757. // "operation"
  15758. // ],
  15759. // "parameters": {
  15760. // "operation": {
  15761. // "description": "Name of the Operations resource to return.",
  15762. // "location": "path",
  15763. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  15764. // "required": true,
  15765. // "type": "string"
  15766. // },
  15767. // "project": {
  15768. // "description": "Project ID for this request.",
  15769. // "location": "path",
  15770. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  15771. // "required": true,
  15772. // "type": "string"
  15773. // }
  15774. // },
  15775. // "path": "{project}/global/operations/{operation}",
  15776. // "response": {
  15777. // "$ref": "Operation"
  15778. // },
  15779. // "scopes": [
  15780. // "https://www.googleapis.com/auth/cloud-platform",
  15781. // "https://www.googleapis.com/auth/compute",
  15782. // "https://www.googleapis.com/auth/compute.readonly"
  15783. // ]
  15784. // }
  15785. }
  15786. // method id "compute.globalOperations.list":
  15787. type GlobalOperationsListCall struct {
  15788. s *Service
  15789. project string
  15790. urlParams_ gensupport.URLParams
  15791. ifNoneMatch_ string
  15792. ctx_ context.Context
  15793. }
  15794. // List: Retrieves a list of Operation resources contained within the
  15795. // specified project.
  15796. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/list
  15797. func (r *GlobalOperationsService) List(project string) *GlobalOperationsListCall {
  15798. c := &GlobalOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15799. c.project = project
  15800. return c
  15801. }
  15802. // Filter sets the optional parameter "filter": Sets a filter expression
  15803. // for filtering listed resources, in the form filter={expression}. Your
  15804. // {expression} must be in the format: field_name comparison_string
  15805. // literal_string.
  15806. //
  15807. // The field_name is the name of the field you want to compare. Only
  15808. // atomic field types are supported (string, number, boolean). The
  15809. // comparison_string must be either eq (equals) or ne (not equals). The
  15810. // literal_string is the string value to filter to. The literal value
  15811. // must be valid for the type of field you are filtering by (string,
  15812. // number, boolean). For string fields, the literal value is interpreted
  15813. // as a regular expression using RE2 syntax. The literal value must
  15814. // match the entire field.
  15815. //
  15816. // For example, filter=name ne example-instance.
  15817. //
  15818. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  15819. // you can also filter on nested fields. For example, you could filter
  15820. // on instances that have set the scheduling.automaticRestart field to
  15821. // true. In particular, use filtering on nested fields to take advantage
  15822. // of instance labels to organize and filter results based on label
  15823. // values.
  15824. //
  15825. // The Beta API also supports filtering on multiple expressions by
  15826. // providing each separate expression within parentheses. For example,
  15827. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  15828. // Multiple expressions are treated as AND expressions meaning that
  15829. // resources must match all expressions to pass the filters.
  15830. func (c *GlobalOperationsListCall) Filter(filter string) *GlobalOperationsListCall {
  15831. c.urlParams_.Set("filter", filter)
  15832. return c
  15833. }
  15834. // MaxResults sets the optional parameter "maxResults": The maximum
  15835. // number of results per page that Compute Engine should return. If the
  15836. // number of available results is larger than maxResults, Compute Engine
  15837. // returns a nextPageToken that can be used to get the next page of
  15838. // results in subsequent list requests.
  15839. func (c *GlobalOperationsListCall) MaxResults(maxResults int64) *GlobalOperationsListCall {
  15840. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  15841. return c
  15842. }
  15843. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  15844. // a certain order. By default, results are returned in alphanumerical
  15845. // order based on the resource name.
  15846. //
  15847. // You can also sort results in descending order based on the creation
  15848. // timestamp using orderBy="creationTimestamp desc". This sorts results
  15849. // based on the creationTimestamp field in reverse chronological order
  15850. // (newest result first). Use this to sort resources like operations so
  15851. // that the newest operation is returned first.
  15852. //
  15853. // Currently, only sorting by name or creationTimestamp desc is
  15854. // supported.
  15855. func (c *GlobalOperationsListCall) OrderBy(orderBy string) *GlobalOperationsListCall {
  15856. c.urlParams_.Set("orderBy", orderBy)
  15857. return c
  15858. }
  15859. // PageToken sets the optional parameter "pageToken": Specifies a page
  15860. // token to use. Set pageToken to the nextPageToken returned by a
  15861. // previous list request to get the next page of results.
  15862. func (c *GlobalOperationsListCall) PageToken(pageToken string) *GlobalOperationsListCall {
  15863. c.urlParams_.Set("pageToken", pageToken)
  15864. return c
  15865. }
  15866. // Fields allows partial responses to be retrieved. See
  15867. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15868. // for more information.
  15869. func (c *GlobalOperationsListCall) Fields(s ...googleapi.Field) *GlobalOperationsListCall {
  15870. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15871. return c
  15872. }
  15873. // IfNoneMatch sets the optional parameter which makes the operation
  15874. // fail if the object's ETag matches the given value. This is useful for
  15875. // getting updates only after the object has changed since the last
  15876. // request. Use googleapi.IsNotModified to check whether the response
  15877. // error from Do is the result of In-None-Match.
  15878. func (c *GlobalOperationsListCall) IfNoneMatch(entityTag string) *GlobalOperationsListCall {
  15879. c.ifNoneMatch_ = entityTag
  15880. return c
  15881. }
  15882. // Context sets the context to be used in this call's Do method. Any
  15883. // pending HTTP request will be aborted if the provided context is
  15884. // canceled.
  15885. func (c *GlobalOperationsListCall) Context(ctx context.Context) *GlobalOperationsListCall {
  15886. c.ctx_ = ctx
  15887. return c
  15888. }
  15889. func (c *GlobalOperationsListCall) doRequest(alt string) (*http.Response, error) {
  15890. var body io.Reader = nil
  15891. c.urlParams_.Set("alt", alt)
  15892. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations")
  15893. urls += "?" + c.urlParams_.Encode()
  15894. req, _ := http.NewRequest("GET", urls, body)
  15895. googleapi.Expand(req.URL, map[string]string{
  15896. "project": c.project,
  15897. })
  15898. req.Header.Set("User-Agent", c.s.userAgent())
  15899. if c.ifNoneMatch_ != "" {
  15900. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  15901. }
  15902. if c.ctx_ != nil {
  15903. return ctxhttp.Do(c.ctx_, c.s.client, req)
  15904. }
  15905. return c.s.client.Do(req)
  15906. }
  15907. // Do executes the "compute.globalOperations.list" call.
  15908. // Exactly one of *OperationList or error will be non-nil. Any non-2xx
  15909. // status code is an error. Response headers are in either
  15910. // *OperationList.ServerResponse.Header or (if a response was returned
  15911. // at all) in error.(*googleapi.Error).Header. Use
  15912. // googleapi.IsNotModified to check whether the returned error was
  15913. // because http.StatusNotModified was returned.
  15914. func (c *GlobalOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, error) {
  15915. gensupport.SetOptions(c.urlParams_, opts...)
  15916. res, err := c.doRequest("json")
  15917. if res != nil && res.StatusCode == http.StatusNotModified {
  15918. if res.Body != nil {
  15919. res.Body.Close()
  15920. }
  15921. return nil, &googleapi.Error{
  15922. Code: res.StatusCode,
  15923. Header: res.Header,
  15924. }
  15925. }
  15926. if err != nil {
  15927. return nil, err
  15928. }
  15929. defer googleapi.CloseBody(res)
  15930. if err := googleapi.CheckResponse(res); err != nil {
  15931. return nil, err
  15932. }
  15933. ret := &OperationList{
  15934. ServerResponse: googleapi.ServerResponse{
  15935. Header: res.Header,
  15936. HTTPStatusCode: res.StatusCode,
  15937. },
  15938. }
  15939. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  15940. return nil, err
  15941. }
  15942. return ret, nil
  15943. // {
  15944. // "description": "Retrieves a list of Operation resources contained within the specified project.",
  15945. // "httpMethod": "GET",
  15946. // "id": "compute.globalOperations.list",
  15947. // "parameterOrder": [
  15948. // "project"
  15949. // ],
  15950. // "parameters": {
  15951. // "filter": {
  15952. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  15953. // "location": "query",
  15954. // "type": "string"
  15955. // },
  15956. // "maxResults": {
  15957. // "default": "500",
  15958. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  15959. // "format": "uint32",
  15960. // "location": "query",
  15961. // "maximum": "500",
  15962. // "minimum": "0",
  15963. // "type": "integer"
  15964. // },
  15965. // "orderBy": {
  15966. // "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.",
  15967. // "location": "query",
  15968. // "type": "string"
  15969. // },
  15970. // "pageToken": {
  15971. // "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.",
  15972. // "location": "query",
  15973. // "type": "string"
  15974. // },
  15975. // "project": {
  15976. // "description": "Project ID for this request.",
  15977. // "location": "path",
  15978. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  15979. // "required": true,
  15980. // "type": "string"
  15981. // }
  15982. // },
  15983. // "path": "{project}/global/operations",
  15984. // "response": {
  15985. // "$ref": "OperationList"
  15986. // },
  15987. // "scopes": [
  15988. // "https://www.googleapis.com/auth/cloud-platform",
  15989. // "https://www.googleapis.com/auth/compute",
  15990. // "https://www.googleapis.com/auth/compute.readonly"
  15991. // ]
  15992. // }
  15993. }
  15994. // Pages invokes f for each page of results.
  15995. // A non-nil error returned from f will halt the iteration.
  15996. // The provided context supersedes any context provided to the Context method.
  15997. func (c *GlobalOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
  15998. c.ctx_ = ctx
  15999. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  16000. for {
  16001. x, err := c.Do()
  16002. if err != nil {
  16003. return err
  16004. }
  16005. if err := f(x); err != nil {
  16006. return err
  16007. }
  16008. if x.NextPageToken == "" {
  16009. return nil
  16010. }
  16011. c.PageToken(x.NextPageToken)
  16012. }
  16013. }
  16014. // method id "compute.httpHealthChecks.delete":
  16015. type HttpHealthChecksDeleteCall struct {
  16016. s *Service
  16017. project string
  16018. httpHealthCheck string
  16019. urlParams_ gensupport.URLParams
  16020. ctx_ context.Context
  16021. }
  16022. // Delete: Deletes the specified HttpHealthCheck resource.
  16023. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/delete
  16024. func (r *HttpHealthChecksService) Delete(project string, httpHealthCheck string) *HttpHealthChecksDeleteCall {
  16025. c := &HttpHealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16026. c.project = project
  16027. c.httpHealthCheck = httpHealthCheck
  16028. return c
  16029. }
  16030. // Fields allows partial responses to be retrieved. See
  16031. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16032. // for more information.
  16033. func (c *HttpHealthChecksDeleteCall) Fields(s ...googleapi.Field) *HttpHealthChecksDeleteCall {
  16034. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16035. return c
  16036. }
  16037. // Context sets the context to be used in this call's Do method. Any
  16038. // pending HTTP request will be aborted if the provided context is
  16039. // canceled.
  16040. func (c *HttpHealthChecksDeleteCall) Context(ctx context.Context) *HttpHealthChecksDeleteCall {
  16041. c.ctx_ = ctx
  16042. return c
  16043. }
  16044. func (c *HttpHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
  16045. var body io.Reader = nil
  16046. c.urlParams_.Set("alt", alt)
  16047. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  16048. urls += "?" + c.urlParams_.Encode()
  16049. req, _ := http.NewRequest("DELETE", urls, body)
  16050. googleapi.Expand(req.URL, map[string]string{
  16051. "project": c.project,
  16052. "httpHealthCheck": c.httpHealthCheck,
  16053. })
  16054. req.Header.Set("User-Agent", c.s.userAgent())
  16055. if c.ctx_ != nil {
  16056. return ctxhttp.Do(c.ctx_, c.s.client, req)
  16057. }
  16058. return c.s.client.Do(req)
  16059. }
  16060. // Do executes the "compute.httpHealthChecks.delete" call.
  16061. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  16062. // status code is an error. Response headers are in either
  16063. // *Operation.ServerResponse.Header or (if a response was returned at
  16064. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16065. // to check whether the returned error was because
  16066. // http.StatusNotModified was returned.
  16067. func (c *HttpHealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  16068. gensupport.SetOptions(c.urlParams_, opts...)
  16069. res, err := c.doRequest("json")
  16070. if res != nil && res.StatusCode == http.StatusNotModified {
  16071. if res.Body != nil {
  16072. res.Body.Close()
  16073. }
  16074. return nil, &googleapi.Error{
  16075. Code: res.StatusCode,
  16076. Header: res.Header,
  16077. }
  16078. }
  16079. if err != nil {
  16080. return nil, err
  16081. }
  16082. defer googleapi.CloseBody(res)
  16083. if err := googleapi.CheckResponse(res); err != nil {
  16084. return nil, err
  16085. }
  16086. ret := &Operation{
  16087. ServerResponse: googleapi.ServerResponse{
  16088. Header: res.Header,
  16089. HTTPStatusCode: res.StatusCode,
  16090. },
  16091. }
  16092. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  16093. return nil, err
  16094. }
  16095. return ret, nil
  16096. // {
  16097. // "description": "Deletes the specified HttpHealthCheck resource.",
  16098. // "httpMethod": "DELETE",
  16099. // "id": "compute.httpHealthChecks.delete",
  16100. // "parameterOrder": [
  16101. // "project",
  16102. // "httpHealthCheck"
  16103. // ],
  16104. // "parameters": {
  16105. // "httpHealthCheck": {
  16106. // "description": "Name of the HttpHealthCheck resource to delete.",
  16107. // "location": "path",
  16108. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  16109. // "required": true,
  16110. // "type": "string"
  16111. // },
  16112. // "project": {
  16113. // "description": "Project ID for this request.",
  16114. // "location": "path",
  16115. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  16116. // "required": true,
  16117. // "type": "string"
  16118. // }
  16119. // },
  16120. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  16121. // "response": {
  16122. // "$ref": "Operation"
  16123. // },
  16124. // "scopes": [
  16125. // "https://www.googleapis.com/auth/cloud-platform",
  16126. // "https://www.googleapis.com/auth/compute"
  16127. // ]
  16128. // }
  16129. }
  16130. // method id "compute.httpHealthChecks.get":
  16131. type HttpHealthChecksGetCall struct {
  16132. s *Service
  16133. project string
  16134. httpHealthCheck string
  16135. urlParams_ gensupport.URLParams
  16136. ifNoneMatch_ string
  16137. ctx_ context.Context
  16138. }
  16139. // Get: Returns the specified HttpHealthCheck resource.
  16140. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/get
  16141. func (r *HttpHealthChecksService) Get(project string, httpHealthCheck string) *HttpHealthChecksGetCall {
  16142. c := &HttpHealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16143. c.project = project
  16144. c.httpHealthCheck = httpHealthCheck
  16145. return c
  16146. }
  16147. // Fields allows partial responses to be retrieved. See
  16148. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16149. // for more information.
  16150. func (c *HttpHealthChecksGetCall) Fields(s ...googleapi.Field) *HttpHealthChecksGetCall {
  16151. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16152. return c
  16153. }
  16154. // IfNoneMatch sets the optional parameter which makes the operation
  16155. // fail if the object's ETag matches the given value. This is useful for
  16156. // getting updates only after the object has changed since the last
  16157. // request. Use googleapi.IsNotModified to check whether the response
  16158. // error from Do is the result of In-None-Match.
  16159. func (c *HttpHealthChecksGetCall) IfNoneMatch(entityTag string) *HttpHealthChecksGetCall {
  16160. c.ifNoneMatch_ = entityTag
  16161. return c
  16162. }
  16163. // Context sets the context to be used in this call's Do method. Any
  16164. // pending HTTP request will be aborted if the provided context is
  16165. // canceled.
  16166. func (c *HttpHealthChecksGetCall) Context(ctx context.Context) *HttpHealthChecksGetCall {
  16167. c.ctx_ = ctx
  16168. return c
  16169. }
  16170. func (c *HttpHealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
  16171. var body io.Reader = nil
  16172. c.urlParams_.Set("alt", alt)
  16173. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  16174. urls += "?" + c.urlParams_.Encode()
  16175. req, _ := http.NewRequest("GET", urls, body)
  16176. googleapi.Expand(req.URL, map[string]string{
  16177. "project": c.project,
  16178. "httpHealthCheck": c.httpHealthCheck,
  16179. })
  16180. req.Header.Set("User-Agent", c.s.userAgent())
  16181. if c.ifNoneMatch_ != "" {
  16182. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  16183. }
  16184. if c.ctx_ != nil {
  16185. return ctxhttp.Do(c.ctx_, c.s.client, req)
  16186. }
  16187. return c.s.client.Do(req)
  16188. }
  16189. // Do executes the "compute.httpHealthChecks.get" call.
  16190. // Exactly one of *HttpHealthCheck or error will be non-nil. Any non-2xx
  16191. // status code is an error. Response headers are in either
  16192. // *HttpHealthCheck.ServerResponse.Header or (if a response was returned
  16193. // at all) in error.(*googleapi.Error).Header. Use
  16194. // googleapi.IsNotModified to check whether the returned error was
  16195. // because http.StatusNotModified was returned.
  16196. func (c *HttpHealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HttpHealthCheck, error) {
  16197. gensupport.SetOptions(c.urlParams_, opts...)
  16198. res, err := c.doRequest("json")
  16199. if res != nil && res.StatusCode == http.StatusNotModified {
  16200. if res.Body != nil {
  16201. res.Body.Close()
  16202. }
  16203. return nil, &googleapi.Error{
  16204. Code: res.StatusCode,
  16205. Header: res.Header,
  16206. }
  16207. }
  16208. if err != nil {
  16209. return nil, err
  16210. }
  16211. defer googleapi.CloseBody(res)
  16212. if err := googleapi.CheckResponse(res); err != nil {
  16213. return nil, err
  16214. }
  16215. ret := &HttpHealthCheck{
  16216. ServerResponse: googleapi.ServerResponse{
  16217. Header: res.Header,
  16218. HTTPStatusCode: res.StatusCode,
  16219. },
  16220. }
  16221. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  16222. return nil, err
  16223. }
  16224. return ret, nil
  16225. // {
  16226. // "description": "Returns the specified HttpHealthCheck resource.",
  16227. // "httpMethod": "GET",
  16228. // "id": "compute.httpHealthChecks.get",
  16229. // "parameterOrder": [
  16230. // "project",
  16231. // "httpHealthCheck"
  16232. // ],
  16233. // "parameters": {
  16234. // "httpHealthCheck": {
  16235. // "description": "Name of the HttpHealthCheck resource to return.",
  16236. // "location": "path",
  16237. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  16238. // "required": true,
  16239. // "type": "string"
  16240. // },
  16241. // "project": {
  16242. // "description": "Project ID for this request.",
  16243. // "location": "path",
  16244. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  16245. // "required": true,
  16246. // "type": "string"
  16247. // }
  16248. // },
  16249. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  16250. // "response": {
  16251. // "$ref": "HttpHealthCheck"
  16252. // },
  16253. // "scopes": [
  16254. // "https://www.googleapis.com/auth/cloud-platform",
  16255. // "https://www.googleapis.com/auth/compute",
  16256. // "https://www.googleapis.com/auth/compute.readonly"
  16257. // ]
  16258. // }
  16259. }
  16260. // method id "compute.httpHealthChecks.insert":
  16261. type HttpHealthChecksInsertCall struct {
  16262. s *Service
  16263. project string
  16264. httphealthcheck *HttpHealthCheck
  16265. urlParams_ gensupport.URLParams
  16266. ctx_ context.Context
  16267. }
  16268. // Insert: Creates a HttpHealthCheck resource in the specified project
  16269. // using the data included in the request.
  16270. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/insert
  16271. func (r *HttpHealthChecksService) Insert(project string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksInsertCall {
  16272. c := &HttpHealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16273. c.project = project
  16274. c.httphealthcheck = httphealthcheck
  16275. return c
  16276. }
  16277. // Fields allows partial responses to be retrieved. See
  16278. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16279. // for more information.
  16280. func (c *HttpHealthChecksInsertCall) Fields(s ...googleapi.Field) *HttpHealthChecksInsertCall {
  16281. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16282. return c
  16283. }
  16284. // Context sets the context to be used in this call's Do method. Any
  16285. // pending HTTP request will be aborted if the provided context is
  16286. // canceled.
  16287. func (c *HttpHealthChecksInsertCall) Context(ctx context.Context) *HttpHealthChecksInsertCall {
  16288. c.ctx_ = ctx
  16289. return c
  16290. }
  16291. func (c *HttpHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
  16292. var body io.Reader = nil
  16293. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck)
  16294. if err != nil {
  16295. return nil, err
  16296. }
  16297. ctype := "application/json"
  16298. c.urlParams_.Set("alt", alt)
  16299. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks")
  16300. urls += "?" + c.urlParams_.Encode()
  16301. req, _ := http.NewRequest("POST", urls, body)
  16302. googleapi.Expand(req.URL, map[string]string{
  16303. "project": c.project,
  16304. })
  16305. req.Header.Set("Content-Type", ctype)
  16306. req.Header.Set("User-Agent", c.s.userAgent())
  16307. if c.ctx_ != nil {
  16308. return ctxhttp.Do(c.ctx_, c.s.client, req)
  16309. }
  16310. return c.s.client.Do(req)
  16311. }
  16312. // Do executes the "compute.httpHealthChecks.insert" call.
  16313. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  16314. // status code is an error. Response headers are in either
  16315. // *Operation.ServerResponse.Header or (if a response was returned at
  16316. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16317. // to check whether the returned error was because
  16318. // http.StatusNotModified was returned.
  16319. func (c *HttpHealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  16320. gensupport.SetOptions(c.urlParams_, opts...)
  16321. res, err := c.doRequest("json")
  16322. if res != nil && res.StatusCode == http.StatusNotModified {
  16323. if res.Body != nil {
  16324. res.Body.Close()
  16325. }
  16326. return nil, &googleapi.Error{
  16327. Code: res.StatusCode,
  16328. Header: res.Header,
  16329. }
  16330. }
  16331. if err != nil {
  16332. return nil, err
  16333. }
  16334. defer googleapi.CloseBody(res)
  16335. if err := googleapi.CheckResponse(res); err != nil {
  16336. return nil, err
  16337. }
  16338. ret := &Operation{
  16339. ServerResponse: googleapi.ServerResponse{
  16340. Header: res.Header,
  16341. HTTPStatusCode: res.StatusCode,
  16342. },
  16343. }
  16344. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  16345. return nil, err
  16346. }
  16347. return ret, nil
  16348. // {
  16349. // "description": "Creates a HttpHealthCheck resource in the specified project using the data included in the request.",
  16350. // "httpMethod": "POST",
  16351. // "id": "compute.httpHealthChecks.insert",
  16352. // "parameterOrder": [
  16353. // "project"
  16354. // ],
  16355. // "parameters": {
  16356. // "project": {
  16357. // "description": "Project ID for this request.",
  16358. // "location": "path",
  16359. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  16360. // "required": true,
  16361. // "type": "string"
  16362. // }
  16363. // },
  16364. // "path": "{project}/global/httpHealthChecks",
  16365. // "request": {
  16366. // "$ref": "HttpHealthCheck"
  16367. // },
  16368. // "response": {
  16369. // "$ref": "Operation"
  16370. // },
  16371. // "scopes": [
  16372. // "https://www.googleapis.com/auth/cloud-platform",
  16373. // "https://www.googleapis.com/auth/compute"
  16374. // ]
  16375. // }
  16376. }
  16377. // method id "compute.httpHealthChecks.list":
  16378. type HttpHealthChecksListCall struct {
  16379. s *Service
  16380. project string
  16381. urlParams_ gensupport.URLParams
  16382. ifNoneMatch_ string
  16383. ctx_ context.Context
  16384. }
  16385. // List: Retrieves the list of HttpHealthCheck resources available to
  16386. // the specified project.
  16387. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/list
  16388. func (r *HttpHealthChecksService) List(project string) *HttpHealthChecksListCall {
  16389. c := &HttpHealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16390. c.project = project
  16391. return c
  16392. }
  16393. // Filter sets the optional parameter "filter": Sets a filter expression
  16394. // for filtering listed resources, in the form filter={expression}. Your
  16395. // {expression} must be in the format: field_name comparison_string
  16396. // literal_string.
  16397. //
  16398. // The field_name is the name of the field you want to compare. Only
  16399. // atomic field types are supported (string, number, boolean). The
  16400. // comparison_string must be either eq (equals) or ne (not equals). The
  16401. // literal_string is the string value to filter to. The literal value
  16402. // must be valid for the type of field you are filtering by (string,
  16403. // number, boolean). For string fields, the literal value is interpreted
  16404. // as a regular expression using RE2 syntax. The literal value must
  16405. // match the entire field.
  16406. //
  16407. // For example, filter=name ne example-instance.
  16408. //
  16409. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  16410. // you can also filter on nested fields. For example, you could filter
  16411. // on instances that have set the scheduling.automaticRestart field to
  16412. // true. In particular, use filtering on nested fields to take advantage
  16413. // of instance labels to organize and filter results based on label
  16414. // values.
  16415. //
  16416. // The Beta API also supports filtering on multiple expressions by
  16417. // providing each separate expression within parentheses. For example,
  16418. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  16419. // Multiple expressions are treated as AND expressions meaning that
  16420. // resources must match all expressions to pass the filters.
  16421. func (c *HttpHealthChecksListCall) Filter(filter string) *HttpHealthChecksListCall {
  16422. c.urlParams_.Set("filter", filter)
  16423. return c
  16424. }
  16425. // MaxResults sets the optional parameter "maxResults": The maximum
  16426. // number of results per page that Compute Engine should return. If the
  16427. // number of available results is larger than maxResults, Compute Engine
  16428. // returns a nextPageToken that can be used to get the next page of
  16429. // results in subsequent list requests.
  16430. func (c *HttpHealthChecksListCall) MaxResults(maxResults int64) *HttpHealthChecksListCall {
  16431. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  16432. return c
  16433. }
  16434. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  16435. // a certain order. By default, results are returned in alphanumerical
  16436. // order based on the resource name.
  16437. //
  16438. // You can also sort results in descending order based on the creation
  16439. // timestamp using orderBy="creationTimestamp desc". This sorts results
  16440. // based on the creationTimestamp field in reverse chronological order
  16441. // (newest result first). Use this to sort resources like operations so
  16442. // that the newest operation is returned first.
  16443. //
  16444. // Currently, only sorting by name or creationTimestamp desc is
  16445. // supported.
  16446. func (c *HttpHealthChecksListCall) OrderBy(orderBy string) *HttpHealthChecksListCall {
  16447. c.urlParams_.Set("orderBy", orderBy)
  16448. return c
  16449. }
  16450. // PageToken sets the optional parameter "pageToken": Specifies a page
  16451. // token to use. Set pageToken to the nextPageToken returned by a
  16452. // previous list request to get the next page of results.
  16453. func (c *HttpHealthChecksListCall) PageToken(pageToken string) *HttpHealthChecksListCall {
  16454. c.urlParams_.Set("pageToken", pageToken)
  16455. return c
  16456. }
  16457. // Fields allows partial responses to be retrieved. See
  16458. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16459. // for more information.
  16460. func (c *HttpHealthChecksListCall) Fields(s ...googleapi.Field) *HttpHealthChecksListCall {
  16461. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16462. return c
  16463. }
  16464. // IfNoneMatch sets the optional parameter which makes the operation
  16465. // fail if the object's ETag matches the given value. This is useful for
  16466. // getting updates only after the object has changed since the last
  16467. // request. Use googleapi.IsNotModified to check whether the response
  16468. // error from Do is the result of In-None-Match.
  16469. func (c *HttpHealthChecksListCall) IfNoneMatch(entityTag string) *HttpHealthChecksListCall {
  16470. c.ifNoneMatch_ = entityTag
  16471. return c
  16472. }
  16473. // Context sets the context to be used in this call's Do method. Any
  16474. // pending HTTP request will be aborted if the provided context is
  16475. // canceled.
  16476. func (c *HttpHealthChecksListCall) Context(ctx context.Context) *HttpHealthChecksListCall {
  16477. c.ctx_ = ctx
  16478. return c
  16479. }
  16480. func (c *HttpHealthChecksListCall) doRequest(alt string) (*http.Response, error) {
  16481. var body io.Reader = nil
  16482. c.urlParams_.Set("alt", alt)
  16483. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks")
  16484. urls += "?" + c.urlParams_.Encode()
  16485. req, _ := http.NewRequest("GET", urls, body)
  16486. googleapi.Expand(req.URL, map[string]string{
  16487. "project": c.project,
  16488. })
  16489. req.Header.Set("User-Agent", c.s.userAgent())
  16490. if c.ifNoneMatch_ != "" {
  16491. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  16492. }
  16493. if c.ctx_ != nil {
  16494. return ctxhttp.Do(c.ctx_, c.s.client, req)
  16495. }
  16496. return c.s.client.Do(req)
  16497. }
  16498. // Do executes the "compute.httpHealthChecks.list" call.
  16499. // Exactly one of *HttpHealthCheckList or error will be non-nil. Any
  16500. // non-2xx status code is an error. Response headers are in either
  16501. // *HttpHealthCheckList.ServerResponse.Header or (if a response was
  16502. // returned at all) in error.(*googleapi.Error).Header. Use
  16503. // googleapi.IsNotModified to check whether the returned error was
  16504. // because http.StatusNotModified was returned.
  16505. func (c *HttpHealthChecksListCall) Do(opts ...googleapi.CallOption) (*HttpHealthCheckList, error) {
  16506. gensupport.SetOptions(c.urlParams_, opts...)
  16507. res, err := c.doRequest("json")
  16508. if res != nil && res.StatusCode == http.StatusNotModified {
  16509. if res.Body != nil {
  16510. res.Body.Close()
  16511. }
  16512. return nil, &googleapi.Error{
  16513. Code: res.StatusCode,
  16514. Header: res.Header,
  16515. }
  16516. }
  16517. if err != nil {
  16518. return nil, err
  16519. }
  16520. defer googleapi.CloseBody(res)
  16521. if err := googleapi.CheckResponse(res); err != nil {
  16522. return nil, err
  16523. }
  16524. ret := &HttpHealthCheckList{
  16525. ServerResponse: googleapi.ServerResponse{
  16526. Header: res.Header,
  16527. HTTPStatusCode: res.StatusCode,
  16528. },
  16529. }
  16530. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  16531. return nil, err
  16532. }
  16533. return ret, nil
  16534. // {
  16535. // "description": "Retrieves the list of HttpHealthCheck resources available to the specified project.",
  16536. // "httpMethod": "GET",
  16537. // "id": "compute.httpHealthChecks.list",
  16538. // "parameterOrder": [
  16539. // "project"
  16540. // ],
  16541. // "parameters": {
  16542. // "filter": {
  16543. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  16544. // "location": "query",
  16545. // "type": "string"
  16546. // },
  16547. // "maxResults": {
  16548. // "default": "500",
  16549. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  16550. // "format": "uint32",
  16551. // "location": "query",
  16552. // "maximum": "500",
  16553. // "minimum": "0",
  16554. // "type": "integer"
  16555. // },
  16556. // "orderBy": {
  16557. // "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.",
  16558. // "location": "query",
  16559. // "type": "string"
  16560. // },
  16561. // "pageToken": {
  16562. // "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.",
  16563. // "location": "query",
  16564. // "type": "string"
  16565. // },
  16566. // "project": {
  16567. // "description": "Project ID for this request.",
  16568. // "location": "path",
  16569. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  16570. // "required": true,
  16571. // "type": "string"
  16572. // }
  16573. // },
  16574. // "path": "{project}/global/httpHealthChecks",
  16575. // "response": {
  16576. // "$ref": "HttpHealthCheckList"
  16577. // },
  16578. // "scopes": [
  16579. // "https://www.googleapis.com/auth/cloud-platform",
  16580. // "https://www.googleapis.com/auth/compute",
  16581. // "https://www.googleapis.com/auth/compute.readonly"
  16582. // ]
  16583. // }
  16584. }
  16585. // Pages invokes f for each page of results.
  16586. // A non-nil error returned from f will halt the iteration.
  16587. // The provided context supersedes any context provided to the Context method.
  16588. func (c *HttpHealthChecksListCall) Pages(ctx context.Context, f func(*HttpHealthCheckList) error) error {
  16589. c.ctx_ = ctx
  16590. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  16591. for {
  16592. x, err := c.Do()
  16593. if err != nil {
  16594. return err
  16595. }
  16596. if err := f(x); err != nil {
  16597. return err
  16598. }
  16599. if x.NextPageToken == "" {
  16600. return nil
  16601. }
  16602. c.PageToken(x.NextPageToken)
  16603. }
  16604. }
  16605. // method id "compute.httpHealthChecks.patch":
  16606. type HttpHealthChecksPatchCall struct {
  16607. s *Service
  16608. project string
  16609. httpHealthCheck string
  16610. httphealthcheck *HttpHealthCheck
  16611. urlParams_ gensupport.URLParams
  16612. ctx_ context.Context
  16613. }
  16614. // Patch: Updates a HttpHealthCheck resource in the specified project
  16615. // using the data included in the request. This method supports patch
  16616. // semantics.
  16617. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/patch
  16618. func (r *HttpHealthChecksService) Patch(project string, httpHealthCheck string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksPatchCall {
  16619. c := &HttpHealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16620. c.project = project
  16621. c.httpHealthCheck = httpHealthCheck
  16622. c.httphealthcheck = httphealthcheck
  16623. return c
  16624. }
  16625. // Fields allows partial responses to be retrieved. See
  16626. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16627. // for more information.
  16628. func (c *HttpHealthChecksPatchCall) Fields(s ...googleapi.Field) *HttpHealthChecksPatchCall {
  16629. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16630. return c
  16631. }
  16632. // Context sets the context to be used in this call's Do method. Any
  16633. // pending HTTP request will be aborted if the provided context is
  16634. // canceled.
  16635. func (c *HttpHealthChecksPatchCall) Context(ctx context.Context) *HttpHealthChecksPatchCall {
  16636. c.ctx_ = ctx
  16637. return c
  16638. }
  16639. func (c *HttpHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
  16640. var body io.Reader = nil
  16641. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck)
  16642. if err != nil {
  16643. return nil, err
  16644. }
  16645. ctype := "application/json"
  16646. c.urlParams_.Set("alt", alt)
  16647. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  16648. urls += "?" + c.urlParams_.Encode()
  16649. req, _ := http.NewRequest("PATCH", urls, body)
  16650. googleapi.Expand(req.URL, map[string]string{
  16651. "project": c.project,
  16652. "httpHealthCheck": c.httpHealthCheck,
  16653. })
  16654. req.Header.Set("Content-Type", ctype)
  16655. req.Header.Set("User-Agent", c.s.userAgent())
  16656. if c.ctx_ != nil {
  16657. return ctxhttp.Do(c.ctx_, c.s.client, req)
  16658. }
  16659. return c.s.client.Do(req)
  16660. }
  16661. // Do executes the "compute.httpHealthChecks.patch" call.
  16662. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  16663. // status code is an error. Response headers are in either
  16664. // *Operation.ServerResponse.Header or (if a response was returned at
  16665. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16666. // to check whether the returned error was because
  16667. // http.StatusNotModified was returned.
  16668. func (c *HttpHealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  16669. gensupport.SetOptions(c.urlParams_, opts...)
  16670. res, err := c.doRequest("json")
  16671. if res != nil && res.StatusCode == http.StatusNotModified {
  16672. if res.Body != nil {
  16673. res.Body.Close()
  16674. }
  16675. return nil, &googleapi.Error{
  16676. Code: res.StatusCode,
  16677. Header: res.Header,
  16678. }
  16679. }
  16680. if err != nil {
  16681. return nil, err
  16682. }
  16683. defer googleapi.CloseBody(res)
  16684. if err := googleapi.CheckResponse(res); err != nil {
  16685. return nil, err
  16686. }
  16687. ret := &Operation{
  16688. ServerResponse: googleapi.ServerResponse{
  16689. Header: res.Header,
  16690. HTTPStatusCode: res.StatusCode,
  16691. },
  16692. }
  16693. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  16694. return nil, err
  16695. }
  16696. return ret, nil
  16697. // {
  16698. // "description": "Updates a HttpHealthCheck resource in the specified project using the data included in the request. This method supports patch semantics.",
  16699. // "httpMethod": "PATCH",
  16700. // "id": "compute.httpHealthChecks.patch",
  16701. // "parameterOrder": [
  16702. // "project",
  16703. // "httpHealthCheck"
  16704. // ],
  16705. // "parameters": {
  16706. // "httpHealthCheck": {
  16707. // "description": "Name of the HttpHealthCheck resource to update.",
  16708. // "location": "path",
  16709. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  16710. // "required": true,
  16711. // "type": "string"
  16712. // },
  16713. // "project": {
  16714. // "description": "Project ID for this request.",
  16715. // "location": "path",
  16716. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  16717. // "required": true,
  16718. // "type": "string"
  16719. // }
  16720. // },
  16721. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  16722. // "request": {
  16723. // "$ref": "HttpHealthCheck"
  16724. // },
  16725. // "response": {
  16726. // "$ref": "Operation"
  16727. // },
  16728. // "scopes": [
  16729. // "https://www.googleapis.com/auth/cloud-platform",
  16730. // "https://www.googleapis.com/auth/compute"
  16731. // ]
  16732. // }
  16733. }
  16734. // method id "compute.httpHealthChecks.update":
  16735. type HttpHealthChecksUpdateCall struct {
  16736. s *Service
  16737. project string
  16738. httpHealthCheck string
  16739. httphealthcheck *HttpHealthCheck
  16740. urlParams_ gensupport.URLParams
  16741. ctx_ context.Context
  16742. }
  16743. // Update: Updates a HttpHealthCheck resource in the specified project
  16744. // using the data included in the request.
  16745. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/update
  16746. func (r *HttpHealthChecksService) Update(project string, httpHealthCheck string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksUpdateCall {
  16747. c := &HttpHealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16748. c.project = project
  16749. c.httpHealthCheck = httpHealthCheck
  16750. c.httphealthcheck = httphealthcheck
  16751. return c
  16752. }
  16753. // Fields allows partial responses to be retrieved. See
  16754. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16755. // for more information.
  16756. func (c *HttpHealthChecksUpdateCall) Fields(s ...googleapi.Field) *HttpHealthChecksUpdateCall {
  16757. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16758. return c
  16759. }
  16760. // Context sets the context to be used in this call's Do method. Any
  16761. // pending HTTP request will be aborted if the provided context is
  16762. // canceled.
  16763. func (c *HttpHealthChecksUpdateCall) Context(ctx context.Context) *HttpHealthChecksUpdateCall {
  16764. c.ctx_ = ctx
  16765. return c
  16766. }
  16767. func (c *HttpHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
  16768. var body io.Reader = nil
  16769. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck)
  16770. if err != nil {
  16771. return nil, err
  16772. }
  16773. ctype := "application/json"
  16774. c.urlParams_.Set("alt", alt)
  16775. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  16776. urls += "?" + c.urlParams_.Encode()
  16777. req, _ := http.NewRequest("PUT", urls, body)
  16778. googleapi.Expand(req.URL, map[string]string{
  16779. "project": c.project,
  16780. "httpHealthCheck": c.httpHealthCheck,
  16781. })
  16782. req.Header.Set("Content-Type", ctype)
  16783. req.Header.Set("User-Agent", c.s.userAgent())
  16784. if c.ctx_ != nil {
  16785. return ctxhttp.Do(c.ctx_, c.s.client, req)
  16786. }
  16787. return c.s.client.Do(req)
  16788. }
  16789. // Do executes the "compute.httpHealthChecks.update" call.
  16790. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  16791. // status code is an error. Response headers are in either
  16792. // *Operation.ServerResponse.Header or (if a response was returned at
  16793. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16794. // to check whether the returned error was because
  16795. // http.StatusNotModified was returned.
  16796. func (c *HttpHealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  16797. gensupport.SetOptions(c.urlParams_, opts...)
  16798. res, err := c.doRequest("json")
  16799. if res != nil && res.StatusCode == http.StatusNotModified {
  16800. if res.Body != nil {
  16801. res.Body.Close()
  16802. }
  16803. return nil, &googleapi.Error{
  16804. Code: res.StatusCode,
  16805. Header: res.Header,
  16806. }
  16807. }
  16808. if err != nil {
  16809. return nil, err
  16810. }
  16811. defer googleapi.CloseBody(res)
  16812. if err := googleapi.CheckResponse(res); err != nil {
  16813. return nil, err
  16814. }
  16815. ret := &Operation{
  16816. ServerResponse: googleapi.ServerResponse{
  16817. Header: res.Header,
  16818. HTTPStatusCode: res.StatusCode,
  16819. },
  16820. }
  16821. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  16822. return nil, err
  16823. }
  16824. return ret, nil
  16825. // {
  16826. // "description": "Updates a HttpHealthCheck resource in the specified project using the data included in the request.",
  16827. // "httpMethod": "PUT",
  16828. // "id": "compute.httpHealthChecks.update",
  16829. // "parameterOrder": [
  16830. // "project",
  16831. // "httpHealthCheck"
  16832. // ],
  16833. // "parameters": {
  16834. // "httpHealthCheck": {
  16835. // "description": "Name of the HttpHealthCheck resource to update.",
  16836. // "location": "path",
  16837. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  16838. // "required": true,
  16839. // "type": "string"
  16840. // },
  16841. // "project": {
  16842. // "description": "Project ID for this request.",
  16843. // "location": "path",
  16844. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  16845. // "required": true,
  16846. // "type": "string"
  16847. // }
  16848. // },
  16849. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  16850. // "request": {
  16851. // "$ref": "HttpHealthCheck"
  16852. // },
  16853. // "response": {
  16854. // "$ref": "Operation"
  16855. // },
  16856. // "scopes": [
  16857. // "https://www.googleapis.com/auth/cloud-platform",
  16858. // "https://www.googleapis.com/auth/compute"
  16859. // ]
  16860. // }
  16861. }
  16862. // method id "compute.httpsHealthChecks.delete":
  16863. type HttpsHealthChecksDeleteCall struct {
  16864. s *Service
  16865. project string
  16866. httpsHealthCheck string
  16867. urlParams_ gensupport.URLParams
  16868. ctx_ context.Context
  16869. }
  16870. // Delete: Deletes the specified HttpsHealthCheck resource.
  16871. func (r *HttpsHealthChecksService) Delete(project string, httpsHealthCheck string) *HttpsHealthChecksDeleteCall {
  16872. c := &HttpsHealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16873. c.project = project
  16874. c.httpsHealthCheck = httpsHealthCheck
  16875. return c
  16876. }
  16877. // Fields allows partial responses to be retrieved. See
  16878. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16879. // for more information.
  16880. func (c *HttpsHealthChecksDeleteCall) Fields(s ...googleapi.Field) *HttpsHealthChecksDeleteCall {
  16881. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16882. return c
  16883. }
  16884. // Context sets the context to be used in this call's Do method. Any
  16885. // pending HTTP request will be aborted if the provided context is
  16886. // canceled.
  16887. func (c *HttpsHealthChecksDeleteCall) Context(ctx context.Context) *HttpsHealthChecksDeleteCall {
  16888. c.ctx_ = ctx
  16889. return c
  16890. }
  16891. func (c *HttpsHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
  16892. var body io.Reader = nil
  16893. c.urlParams_.Set("alt", alt)
  16894. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  16895. urls += "?" + c.urlParams_.Encode()
  16896. req, _ := http.NewRequest("DELETE", urls, body)
  16897. googleapi.Expand(req.URL, map[string]string{
  16898. "project": c.project,
  16899. "httpsHealthCheck": c.httpsHealthCheck,
  16900. })
  16901. req.Header.Set("User-Agent", c.s.userAgent())
  16902. if c.ctx_ != nil {
  16903. return ctxhttp.Do(c.ctx_, c.s.client, req)
  16904. }
  16905. return c.s.client.Do(req)
  16906. }
  16907. // Do executes the "compute.httpsHealthChecks.delete" call.
  16908. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  16909. // status code is an error. Response headers are in either
  16910. // *Operation.ServerResponse.Header or (if a response was returned at
  16911. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16912. // to check whether the returned error was because
  16913. // http.StatusNotModified was returned.
  16914. func (c *HttpsHealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  16915. gensupport.SetOptions(c.urlParams_, opts...)
  16916. res, err := c.doRequest("json")
  16917. if res != nil && res.StatusCode == http.StatusNotModified {
  16918. if res.Body != nil {
  16919. res.Body.Close()
  16920. }
  16921. return nil, &googleapi.Error{
  16922. Code: res.StatusCode,
  16923. Header: res.Header,
  16924. }
  16925. }
  16926. if err != nil {
  16927. return nil, err
  16928. }
  16929. defer googleapi.CloseBody(res)
  16930. if err := googleapi.CheckResponse(res); err != nil {
  16931. return nil, err
  16932. }
  16933. ret := &Operation{
  16934. ServerResponse: googleapi.ServerResponse{
  16935. Header: res.Header,
  16936. HTTPStatusCode: res.StatusCode,
  16937. },
  16938. }
  16939. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  16940. return nil, err
  16941. }
  16942. return ret, nil
  16943. // {
  16944. // "description": "Deletes the specified HttpsHealthCheck resource.",
  16945. // "httpMethod": "DELETE",
  16946. // "id": "compute.httpsHealthChecks.delete",
  16947. // "parameterOrder": [
  16948. // "project",
  16949. // "httpsHealthCheck"
  16950. // ],
  16951. // "parameters": {
  16952. // "httpsHealthCheck": {
  16953. // "description": "Name of the HttpsHealthCheck resource to delete.",
  16954. // "location": "path",
  16955. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  16956. // "required": true,
  16957. // "type": "string"
  16958. // },
  16959. // "project": {
  16960. // "description": "Project ID for this request.",
  16961. // "location": "path",
  16962. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  16963. // "required": true,
  16964. // "type": "string"
  16965. // }
  16966. // },
  16967. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  16968. // "response": {
  16969. // "$ref": "Operation"
  16970. // },
  16971. // "scopes": [
  16972. // "https://www.googleapis.com/auth/cloud-platform",
  16973. // "https://www.googleapis.com/auth/compute"
  16974. // ]
  16975. // }
  16976. }
  16977. // method id "compute.httpsHealthChecks.get":
  16978. type HttpsHealthChecksGetCall struct {
  16979. s *Service
  16980. project string
  16981. httpsHealthCheck string
  16982. urlParams_ gensupport.URLParams
  16983. ifNoneMatch_ string
  16984. ctx_ context.Context
  16985. }
  16986. // Get: Returns the specified HttpsHealthCheck resource.
  16987. func (r *HttpsHealthChecksService) Get(project string, httpsHealthCheck string) *HttpsHealthChecksGetCall {
  16988. c := &HttpsHealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16989. c.project = project
  16990. c.httpsHealthCheck = httpsHealthCheck
  16991. return c
  16992. }
  16993. // Fields allows partial responses to be retrieved. See
  16994. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16995. // for more information.
  16996. func (c *HttpsHealthChecksGetCall) Fields(s ...googleapi.Field) *HttpsHealthChecksGetCall {
  16997. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16998. return c
  16999. }
  17000. // IfNoneMatch sets the optional parameter which makes the operation
  17001. // fail if the object's ETag matches the given value. This is useful for
  17002. // getting updates only after the object has changed since the last
  17003. // request. Use googleapi.IsNotModified to check whether the response
  17004. // error from Do is the result of In-None-Match.
  17005. func (c *HttpsHealthChecksGetCall) IfNoneMatch(entityTag string) *HttpsHealthChecksGetCall {
  17006. c.ifNoneMatch_ = entityTag
  17007. return c
  17008. }
  17009. // Context sets the context to be used in this call's Do method. Any
  17010. // pending HTTP request will be aborted if the provided context is
  17011. // canceled.
  17012. func (c *HttpsHealthChecksGetCall) Context(ctx context.Context) *HttpsHealthChecksGetCall {
  17013. c.ctx_ = ctx
  17014. return c
  17015. }
  17016. func (c *HttpsHealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
  17017. var body io.Reader = nil
  17018. c.urlParams_.Set("alt", alt)
  17019. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  17020. urls += "?" + c.urlParams_.Encode()
  17021. req, _ := http.NewRequest("GET", urls, body)
  17022. googleapi.Expand(req.URL, map[string]string{
  17023. "project": c.project,
  17024. "httpsHealthCheck": c.httpsHealthCheck,
  17025. })
  17026. req.Header.Set("User-Agent", c.s.userAgent())
  17027. if c.ifNoneMatch_ != "" {
  17028. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  17029. }
  17030. if c.ctx_ != nil {
  17031. return ctxhttp.Do(c.ctx_, c.s.client, req)
  17032. }
  17033. return c.s.client.Do(req)
  17034. }
  17035. // Do executes the "compute.httpsHealthChecks.get" call.
  17036. // Exactly one of *HttpsHealthCheck or error will be non-nil. Any
  17037. // non-2xx status code is an error. Response headers are in either
  17038. // *HttpsHealthCheck.ServerResponse.Header or (if a response was
  17039. // returned at all) in error.(*googleapi.Error).Header. Use
  17040. // googleapi.IsNotModified to check whether the returned error was
  17041. // because http.StatusNotModified was returned.
  17042. func (c *HttpsHealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HttpsHealthCheck, error) {
  17043. gensupport.SetOptions(c.urlParams_, opts...)
  17044. res, err := c.doRequest("json")
  17045. if res != nil && res.StatusCode == http.StatusNotModified {
  17046. if res.Body != nil {
  17047. res.Body.Close()
  17048. }
  17049. return nil, &googleapi.Error{
  17050. Code: res.StatusCode,
  17051. Header: res.Header,
  17052. }
  17053. }
  17054. if err != nil {
  17055. return nil, err
  17056. }
  17057. defer googleapi.CloseBody(res)
  17058. if err := googleapi.CheckResponse(res); err != nil {
  17059. return nil, err
  17060. }
  17061. ret := &HttpsHealthCheck{
  17062. ServerResponse: googleapi.ServerResponse{
  17063. Header: res.Header,
  17064. HTTPStatusCode: res.StatusCode,
  17065. },
  17066. }
  17067. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  17068. return nil, err
  17069. }
  17070. return ret, nil
  17071. // {
  17072. // "description": "Returns the specified HttpsHealthCheck resource.",
  17073. // "httpMethod": "GET",
  17074. // "id": "compute.httpsHealthChecks.get",
  17075. // "parameterOrder": [
  17076. // "project",
  17077. // "httpsHealthCheck"
  17078. // ],
  17079. // "parameters": {
  17080. // "httpsHealthCheck": {
  17081. // "description": "Name of the HttpsHealthCheck resource to return.",
  17082. // "location": "path",
  17083. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  17084. // "required": true,
  17085. // "type": "string"
  17086. // },
  17087. // "project": {
  17088. // "description": "Project ID for this request.",
  17089. // "location": "path",
  17090. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  17091. // "required": true,
  17092. // "type": "string"
  17093. // }
  17094. // },
  17095. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  17096. // "response": {
  17097. // "$ref": "HttpsHealthCheck"
  17098. // },
  17099. // "scopes": [
  17100. // "https://www.googleapis.com/auth/cloud-platform",
  17101. // "https://www.googleapis.com/auth/compute",
  17102. // "https://www.googleapis.com/auth/compute.readonly"
  17103. // ]
  17104. // }
  17105. }
  17106. // method id "compute.httpsHealthChecks.insert":
  17107. type HttpsHealthChecksInsertCall struct {
  17108. s *Service
  17109. project string
  17110. httpshealthcheck *HttpsHealthCheck
  17111. urlParams_ gensupport.URLParams
  17112. ctx_ context.Context
  17113. }
  17114. // Insert: Creates a HttpsHealthCheck resource in the specified project
  17115. // using the data included in the request.
  17116. func (r *HttpsHealthChecksService) Insert(project string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksInsertCall {
  17117. c := &HttpsHealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17118. c.project = project
  17119. c.httpshealthcheck = httpshealthcheck
  17120. return c
  17121. }
  17122. // Fields allows partial responses to be retrieved. See
  17123. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17124. // for more information.
  17125. func (c *HttpsHealthChecksInsertCall) Fields(s ...googleapi.Field) *HttpsHealthChecksInsertCall {
  17126. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17127. return c
  17128. }
  17129. // Context sets the context to be used in this call's Do method. Any
  17130. // pending HTTP request will be aborted if the provided context is
  17131. // canceled.
  17132. func (c *HttpsHealthChecksInsertCall) Context(ctx context.Context) *HttpsHealthChecksInsertCall {
  17133. c.ctx_ = ctx
  17134. return c
  17135. }
  17136. func (c *HttpsHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
  17137. var body io.Reader = nil
  17138. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck)
  17139. if err != nil {
  17140. return nil, err
  17141. }
  17142. ctype := "application/json"
  17143. c.urlParams_.Set("alt", alt)
  17144. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks")
  17145. urls += "?" + c.urlParams_.Encode()
  17146. req, _ := http.NewRequest("POST", urls, body)
  17147. googleapi.Expand(req.URL, map[string]string{
  17148. "project": c.project,
  17149. })
  17150. req.Header.Set("Content-Type", ctype)
  17151. req.Header.Set("User-Agent", c.s.userAgent())
  17152. if c.ctx_ != nil {
  17153. return ctxhttp.Do(c.ctx_, c.s.client, req)
  17154. }
  17155. return c.s.client.Do(req)
  17156. }
  17157. // Do executes the "compute.httpsHealthChecks.insert" call.
  17158. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  17159. // status code is an error. Response headers are in either
  17160. // *Operation.ServerResponse.Header or (if a response was returned at
  17161. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  17162. // to check whether the returned error was because
  17163. // http.StatusNotModified was returned.
  17164. func (c *HttpsHealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  17165. gensupport.SetOptions(c.urlParams_, opts...)
  17166. res, err := c.doRequest("json")
  17167. if res != nil && res.StatusCode == http.StatusNotModified {
  17168. if res.Body != nil {
  17169. res.Body.Close()
  17170. }
  17171. return nil, &googleapi.Error{
  17172. Code: res.StatusCode,
  17173. Header: res.Header,
  17174. }
  17175. }
  17176. if err != nil {
  17177. return nil, err
  17178. }
  17179. defer googleapi.CloseBody(res)
  17180. if err := googleapi.CheckResponse(res); err != nil {
  17181. return nil, err
  17182. }
  17183. ret := &Operation{
  17184. ServerResponse: googleapi.ServerResponse{
  17185. Header: res.Header,
  17186. HTTPStatusCode: res.StatusCode,
  17187. },
  17188. }
  17189. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  17190. return nil, err
  17191. }
  17192. return ret, nil
  17193. // {
  17194. // "description": "Creates a HttpsHealthCheck resource in the specified project using the data included in the request.",
  17195. // "httpMethod": "POST",
  17196. // "id": "compute.httpsHealthChecks.insert",
  17197. // "parameterOrder": [
  17198. // "project"
  17199. // ],
  17200. // "parameters": {
  17201. // "project": {
  17202. // "description": "Project ID for this request.",
  17203. // "location": "path",
  17204. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  17205. // "required": true,
  17206. // "type": "string"
  17207. // }
  17208. // },
  17209. // "path": "{project}/global/httpsHealthChecks",
  17210. // "request": {
  17211. // "$ref": "HttpsHealthCheck"
  17212. // },
  17213. // "response": {
  17214. // "$ref": "Operation"
  17215. // },
  17216. // "scopes": [
  17217. // "https://www.googleapis.com/auth/cloud-platform",
  17218. // "https://www.googleapis.com/auth/compute"
  17219. // ]
  17220. // }
  17221. }
  17222. // method id "compute.httpsHealthChecks.list":
  17223. type HttpsHealthChecksListCall struct {
  17224. s *Service
  17225. project string
  17226. urlParams_ gensupport.URLParams
  17227. ifNoneMatch_ string
  17228. ctx_ context.Context
  17229. }
  17230. // List: Retrieves the list of HttpsHealthCheck resources available to
  17231. // the specified project.
  17232. func (r *HttpsHealthChecksService) List(project string) *HttpsHealthChecksListCall {
  17233. c := &HttpsHealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17234. c.project = project
  17235. return c
  17236. }
  17237. // Filter sets the optional parameter "filter": Sets a filter expression
  17238. // for filtering listed resources, in the form filter={expression}. Your
  17239. // {expression} must be in the format: field_name comparison_string
  17240. // literal_string.
  17241. //
  17242. // The field_name is the name of the field you want to compare. Only
  17243. // atomic field types are supported (string, number, boolean). The
  17244. // comparison_string must be either eq (equals) or ne (not equals). The
  17245. // literal_string is the string value to filter to. The literal value
  17246. // must be valid for the type of field you are filtering by (string,
  17247. // number, boolean). For string fields, the literal value is interpreted
  17248. // as a regular expression using RE2 syntax. The literal value must
  17249. // match the entire field.
  17250. //
  17251. // For example, filter=name ne example-instance.
  17252. //
  17253. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  17254. // you can also filter on nested fields. For example, you could filter
  17255. // on instances that have set the scheduling.automaticRestart field to
  17256. // true. In particular, use filtering on nested fields to take advantage
  17257. // of instance labels to organize and filter results based on label
  17258. // values.
  17259. //
  17260. // The Beta API also supports filtering on multiple expressions by
  17261. // providing each separate expression within parentheses. For example,
  17262. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  17263. // Multiple expressions are treated as AND expressions meaning that
  17264. // resources must match all expressions to pass the filters.
  17265. func (c *HttpsHealthChecksListCall) Filter(filter string) *HttpsHealthChecksListCall {
  17266. c.urlParams_.Set("filter", filter)
  17267. return c
  17268. }
  17269. // MaxResults sets the optional parameter "maxResults": The maximum
  17270. // number of results per page that Compute Engine should return. If the
  17271. // number of available results is larger than maxResults, Compute Engine
  17272. // returns a nextPageToken that can be used to get the next page of
  17273. // results in subsequent list requests.
  17274. func (c *HttpsHealthChecksListCall) MaxResults(maxResults int64) *HttpsHealthChecksListCall {
  17275. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  17276. return c
  17277. }
  17278. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  17279. // a certain order. By default, results are returned in alphanumerical
  17280. // order based on the resource name.
  17281. //
  17282. // You can also sort results in descending order based on the creation
  17283. // timestamp using orderBy="creationTimestamp desc". This sorts results
  17284. // based on the creationTimestamp field in reverse chronological order
  17285. // (newest result first). Use this to sort resources like operations so
  17286. // that the newest operation is returned first.
  17287. //
  17288. // Currently, only sorting by name or creationTimestamp desc is
  17289. // supported.
  17290. func (c *HttpsHealthChecksListCall) OrderBy(orderBy string) *HttpsHealthChecksListCall {
  17291. c.urlParams_.Set("orderBy", orderBy)
  17292. return c
  17293. }
  17294. // PageToken sets the optional parameter "pageToken": Specifies a page
  17295. // token to use. Set pageToken to the nextPageToken returned by a
  17296. // previous list request to get the next page of results.
  17297. func (c *HttpsHealthChecksListCall) PageToken(pageToken string) *HttpsHealthChecksListCall {
  17298. c.urlParams_.Set("pageToken", pageToken)
  17299. return c
  17300. }
  17301. // Fields allows partial responses to be retrieved. See
  17302. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17303. // for more information.
  17304. func (c *HttpsHealthChecksListCall) Fields(s ...googleapi.Field) *HttpsHealthChecksListCall {
  17305. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17306. return c
  17307. }
  17308. // IfNoneMatch sets the optional parameter which makes the operation
  17309. // fail if the object's ETag matches the given value. This is useful for
  17310. // getting updates only after the object has changed since the last
  17311. // request. Use googleapi.IsNotModified to check whether the response
  17312. // error from Do is the result of In-None-Match.
  17313. func (c *HttpsHealthChecksListCall) IfNoneMatch(entityTag string) *HttpsHealthChecksListCall {
  17314. c.ifNoneMatch_ = entityTag
  17315. return c
  17316. }
  17317. // Context sets the context to be used in this call's Do method. Any
  17318. // pending HTTP request will be aborted if the provided context is
  17319. // canceled.
  17320. func (c *HttpsHealthChecksListCall) Context(ctx context.Context) *HttpsHealthChecksListCall {
  17321. c.ctx_ = ctx
  17322. return c
  17323. }
  17324. func (c *HttpsHealthChecksListCall) doRequest(alt string) (*http.Response, error) {
  17325. var body io.Reader = nil
  17326. c.urlParams_.Set("alt", alt)
  17327. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks")
  17328. urls += "?" + c.urlParams_.Encode()
  17329. req, _ := http.NewRequest("GET", urls, body)
  17330. googleapi.Expand(req.URL, map[string]string{
  17331. "project": c.project,
  17332. })
  17333. req.Header.Set("User-Agent", c.s.userAgent())
  17334. if c.ifNoneMatch_ != "" {
  17335. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  17336. }
  17337. if c.ctx_ != nil {
  17338. return ctxhttp.Do(c.ctx_, c.s.client, req)
  17339. }
  17340. return c.s.client.Do(req)
  17341. }
  17342. // Do executes the "compute.httpsHealthChecks.list" call.
  17343. // Exactly one of *HttpsHealthCheckList or error will be non-nil. Any
  17344. // non-2xx status code is an error. Response headers are in either
  17345. // *HttpsHealthCheckList.ServerResponse.Header or (if a response was
  17346. // returned at all) in error.(*googleapi.Error).Header. Use
  17347. // googleapi.IsNotModified to check whether the returned error was
  17348. // because http.StatusNotModified was returned.
  17349. func (c *HttpsHealthChecksListCall) Do(opts ...googleapi.CallOption) (*HttpsHealthCheckList, error) {
  17350. gensupport.SetOptions(c.urlParams_, opts...)
  17351. res, err := c.doRequest("json")
  17352. if res != nil && res.StatusCode == http.StatusNotModified {
  17353. if res.Body != nil {
  17354. res.Body.Close()
  17355. }
  17356. return nil, &googleapi.Error{
  17357. Code: res.StatusCode,
  17358. Header: res.Header,
  17359. }
  17360. }
  17361. if err != nil {
  17362. return nil, err
  17363. }
  17364. defer googleapi.CloseBody(res)
  17365. if err := googleapi.CheckResponse(res); err != nil {
  17366. return nil, err
  17367. }
  17368. ret := &HttpsHealthCheckList{
  17369. ServerResponse: googleapi.ServerResponse{
  17370. Header: res.Header,
  17371. HTTPStatusCode: res.StatusCode,
  17372. },
  17373. }
  17374. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  17375. return nil, err
  17376. }
  17377. return ret, nil
  17378. // {
  17379. // "description": "Retrieves the list of HttpsHealthCheck resources available to the specified project.",
  17380. // "httpMethod": "GET",
  17381. // "id": "compute.httpsHealthChecks.list",
  17382. // "parameterOrder": [
  17383. // "project"
  17384. // ],
  17385. // "parameters": {
  17386. // "filter": {
  17387. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  17388. // "location": "query",
  17389. // "type": "string"
  17390. // },
  17391. // "maxResults": {
  17392. // "default": "500",
  17393. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  17394. // "format": "uint32",
  17395. // "location": "query",
  17396. // "maximum": "500",
  17397. // "minimum": "0",
  17398. // "type": "integer"
  17399. // },
  17400. // "orderBy": {
  17401. // "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.",
  17402. // "location": "query",
  17403. // "type": "string"
  17404. // },
  17405. // "pageToken": {
  17406. // "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.",
  17407. // "location": "query",
  17408. // "type": "string"
  17409. // },
  17410. // "project": {
  17411. // "description": "Project ID for this request.",
  17412. // "location": "path",
  17413. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  17414. // "required": true,
  17415. // "type": "string"
  17416. // }
  17417. // },
  17418. // "path": "{project}/global/httpsHealthChecks",
  17419. // "response": {
  17420. // "$ref": "HttpsHealthCheckList"
  17421. // },
  17422. // "scopes": [
  17423. // "https://www.googleapis.com/auth/cloud-platform",
  17424. // "https://www.googleapis.com/auth/compute",
  17425. // "https://www.googleapis.com/auth/compute.readonly"
  17426. // ]
  17427. // }
  17428. }
  17429. // Pages invokes f for each page of results.
  17430. // A non-nil error returned from f will halt the iteration.
  17431. // The provided context supersedes any context provided to the Context method.
  17432. func (c *HttpsHealthChecksListCall) Pages(ctx context.Context, f func(*HttpsHealthCheckList) error) error {
  17433. c.ctx_ = ctx
  17434. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  17435. for {
  17436. x, err := c.Do()
  17437. if err != nil {
  17438. return err
  17439. }
  17440. if err := f(x); err != nil {
  17441. return err
  17442. }
  17443. if x.NextPageToken == "" {
  17444. return nil
  17445. }
  17446. c.PageToken(x.NextPageToken)
  17447. }
  17448. }
  17449. // method id "compute.httpsHealthChecks.patch":
  17450. type HttpsHealthChecksPatchCall struct {
  17451. s *Service
  17452. project string
  17453. httpsHealthCheck string
  17454. httpshealthcheck *HttpsHealthCheck
  17455. urlParams_ gensupport.URLParams
  17456. ctx_ context.Context
  17457. }
  17458. // Patch: Updates a HttpsHealthCheck resource in the specified project
  17459. // using the data included in the request. This method supports patch
  17460. // semantics.
  17461. func (r *HttpsHealthChecksService) Patch(project string, httpsHealthCheck string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksPatchCall {
  17462. c := &HttpsHealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17463. c.project = project
  17464. c.httpsHealthCheck = httpsHealthCheck
  17465. c.httpshealthcheck = httpshealthcheck
  17466. return c
  17467. }
  17468. // Fields allows partial responses to be retrieved. See
  17469. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17470. // for more information.
  17471. func (c *HttpsHealthChecksPatchCall) Fields(s ...googleapi.Field) *HttpsHealthChecksPatchCall {
  17472. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17473. return c
  17474. }
  17475. // Context sets the context to be used in this call's Do method. Any
  17476. // pending HTTP request will be aborted if the provided context is
  17477. // canceled.
  17478. func (c *HttpsHealthChecksPatchCall) Context(ctx context.Context) *HttpsHealthChecksPatchCall {
  17479. c.ctx_ = ctx
  17480. return c
  17481. }
  17482. func (c *HttpsHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
  17483. var body io.Reader = nil
  17484. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck)
  17485. if err != nil {
  17486. return nil, err
  17487. }
  17488. ctype := "application/json"
  17489. c.urlParams_.Set("alt", alt)
  17490. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  17491. urls += "?" + c.urlParams_.Encode()
  17492. req, _ := http.NewRequest("PATCH", urls, body)
  17493. googleapi.Expand(req.URL, map[string]string{
  17494. "project": c.project,
  17495. "httpsHealthCheck": c.httpsHealthCheck,
  17496. })
  17497. req.Header.Set("Content-Type", ctype)
  17498. req.Header.Set("User-Agent", c.s.userAgent())
  17499. if c.ctx_ != nil {
  17500. return ctxhttp.Do(c.ctx_, c.s.client, req)
  17501. }
  17502. return c.s.client.Do(req)
  17503. }
  17504. // Do executes the "compute.httpsHealthChecks.patch" call.
  17505. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  17506. // status code is an error. Response headers are in either
  17507. // *Operation.ServerResponse.Header or (if a response was returned at
  17508. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  17509. // to check whether the returned error was because
  17510. // http.StatusNotModified was returned.
  17511. func (c *HttpsHealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  17512. gensupport.SetOptions(c.urlParams_, opts...)
  17513. res, err := c.doRequest("json")
  17514. if res != nil && res.StatusCode == http.StatusNotModified {
  17515. if res.Body != nil {
  17516. res.Body.Close()
  17517. }
  17518. return nil, &googleapi.Error{
  17519. Code: res.StatusCode,
  17520. Header: res.Header,
  17521. }
  17522. }
  17523. if err != nil {
  17524. return nil, err
  17525. }
  17526. defer googleapi.CloseBody(res)
  17527. if err := googleapi.CheckResponse(res); err != nil {
  17528. return nil, err
  17529. }
  17530. ret := &Operation{
  17531. ServerResponse: googleapi.ServerResponse{
  17532. Header: res.Header,
  17533. HTTPStatusCode: res.StatusCode,
  17534. },
  17535. }
  17536. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  17537. return nil, err
  17538. }
  17539. return ret, nil
  17540. // {
  17541. // "description": "Updates a HttpsHealthCheck resource in the specified project using the data included in the request. This method supports patch semantics.",
  17542. // "httpMethod": "PATCH",
  17543. // "id": "compute.httpsHealthChecks.patch",
  17544. // "parameterOrder": [
  17545. // "project",
  17546. // "httpsHealthCheck"
  17547. // ],
  17548. // "parameters": {
  17549. // "httpsHealthCheck": {
  17550. // "description": "Name of the HttpsHealthCheck resource to update.",
  17551. // "location": "path",
  17552. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  17553. // "required": true,
  17554. // "type": "string"
  17555. // },
  17556. // "project": {
  17557. // "description": "Project ID for this request.",
  17558. // "location": "path",
  17559. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  17560. // "required": true,
  17561. // "type": "string"
  17562. // }
  17563. // },
  17564. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  17565. // "request": {
  17566. // "$ref": "HttpsHealthCheck"
  17567. // },
  17568. // "response": {
  17569. // "$ref": "Operation"
  17570. // },
  17571. // "scopes": [
  17572. // "https://www.googleapis.com/auth/cloud-platform",
  17573. // "https://www.googleapis.com/auth/compute"
  17574. // ]
  17575. // }
  17576. }
  17577. // method id "compute.httpsHealthChecks.update":
  17578. type HttpsHealthChecksUpdateCall struct {
  17579. s *Service
  17580. project string
  17581. httpsHealthCheck string
  17582. httpshealthcheck *HttpsHealthCheck
  17583. urlParams_ gensupport.URLParams
  17584. ctx_ context.Context
  17585. }
  17586. // Update: Updates a HttpsHealthCheck resource in the specified project
  17587. // using the data included in the request.
  17588. func (r *HttpsHealthChecksService) Update(project string, httpsHealthCheck string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksUpdateCall {
  17589. c := &HttpsHealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17590. c.project = project
  17591. c.httpsHealthCheck = httpsHealthCheck
  17592. c.httpshealthcheck = httpshealthcheck
  17593. return c
  17594. }
  17595. // Fields allows partial responses to be retrieved. See
  17596. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17597. // for more information.
  17598. func (c *HttpsHealthChecksUpdateCall) Fields(s ...googleapi.Field) *HttpsHealthChecksUpdateCall {
  17599. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17600. return c
  17601. }
  17602. // Context sets the context to be used in this call's Do method. Any
  17603. // pending HTTP request will be aborted if the provided context is
  17604. // canceled.
  17605. func (c *HttpsHealthChecksUpdateCall) Context(ctx context.Context) *HttpsHealthChecksUpdateCall {
  17606. c.ctx_ = ctx
  17607. return c
  17608. }
  17609. func (c *HttpsHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
  17610. var body io.Reader = nil
  17611. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck)
  17612. if err != nil {
  17613. return nil, err
  17614. }
  17615. ctype := "application/json"
  17616. c.urlParams_.Set("alt", alt)
  17617. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  17618. urls += "?" + c.urlParams_.Encode()
  17619. req, _ := http.NewRequest("PUT", urls, body)
  17620. googleapi.Expand(req.URL, map[string]string{
  17621. "project": c.project,
  17622. "httpsHealthCheck": c.httpsHealthCheck,
  17623. })
  17624. req.Header.Set("Content-Type", ctype)
  17625. req.Header.Set("User-Agent", c.s.userAgent())
  17626. if c.ctx_ != nil {
  17627. return ctxhttp.Do(c.ctx_, c.s.client, req)
  17628. }
  17629. return c.s.client.Do(req)
  17630. }
  17631. // Do executes the "compute.httpsHealthChecks.update" call.
  17632. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  17633. // status code is an error. Response headers are in either
  17634. // *Operation.ServerResponse.Header or (if a response was returned at
  17635. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  17636. // to check whether the returned error was because
  17637. // http.StatusNotModified was returned.
  17638. func (c *HttpsHealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  17639. gensupport.SetOptions(c.urlParams_, opts...)
  17640. res, err := c.doRequest("json")
  17641. if res != nil && res.StatusCode == http.StatusNotModified {
  17642. if res.Body != nil {
  17643. res.Body.Close()
  17644. }
  17645. return nil, &googleapi.Error{
  17646. Code: res.StatusCode,
  17647. Header: res.Header,
  17648. }
  17649. }
  17650. if err != nil {
  17651. return nil, err
  17652. }
  17653. defer googleapi.CloseBody(res)
  17654. if err := googleapi.CheckResponse(res); err != nil {
  17655. return nil, err
  17656. }
  17657. ret := &Operation{
  17658. ServerResponse: googleapi.ServerResponse{
  17659. Header: res.Header,
  17660. HTTPStatusCode: res.StatusCode,
  17661. },
  17662. }
  17663. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  17664. return nil, err
  17665. }
  17666. return ret, nil
  17667. // {
  17668. // "description": "Updates a HttpsHealthCheck resource in the specified project using the data included in the request.",
  17669. // "httpMethod": "PUT",
  17670. // "id": "compute.httpsHealthChecks.update",
  17671. // "parameterOrder": [
  17672. // "project",
  17673. // "httpsHealthCheck"
  17674. // ],
  17675. // "parameters": {
  17676. // "httpsHealthCheck": {
  17677. // "description": "Name of the HttpsHealthCheck resource to update.",
  17678. // "location": "path",
  17679. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  17680. // "required": true,
  17681. // "type": "string"
  17682. // },
  17683. // "project": {
  17684. // "description": "Project ID for this request.",
  17685. // "location": "path",
  17686. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  17687. // "required": true,
  17688. // "type": "string"
  17689. // }
  17690. // },
  17691. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  17692. // "request": {
  17693. // "$ref": "HttpsHealthCheck"
  17694. // },
  17695. // "response": {
  17696. // "$ref": "Operation"
  17697. // },
  17698. // "scopes": [
  17699. // "https://www.googleapis.com/auth/cloud-platform",
  17700. // "https://www.googleapis.com/auth/compute"
  17701. // ]
  17702. // }
  17703. }
  17704. // method id "compute.images.delete":
  17705. type ImagesDeleteCall struct {
  17706. s *Service
  17707. project string
  17708. image string
  17709. urlParams_ gensupport.URLParams
  17710. ctx_ context.Context
  17711. }
  17712. // Delete: Deletes the specified image resource.
  17713. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/delete
  17714. func (r *ImagesService) Delete(project string, image string) *ImagesDeleteCall {
  17715. c := &ImagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17716. c.project = project
  17717. c.image = image
  17718. return c
  17719. }
  17720. // Fields allows partial responses to be retrieved. See
  17721. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17722. // for more information.
  17723. func (c *ImagesDeleteCall) Fields(s ...googleapi.Field) *ImagesDeleteCall {
  17724. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17725. return c
  17726. }
  17727. // Context sets the context to be used in this call's Do method. Any
  17728. // pending HTTP request will be aborted if the provided context is
  17729. // canceled.
  17730. func (c *ImagesDeleteCall) Context(ctx context.Context) *ImagesDeleteCall {
  17731. c.ctx_ = ctx
  17732. return c
  17733. }
  17734. func (c *ImagesDeleteCall) doRequest(alt string) (*http.Response, error) {
  17735. var body io.Reader = nil
  17736. c.urlParams_.Set("alt", alt)
  17737. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}")
  17738. urls += "?" + c.urlParams_.Encode()
  17739. req, _ := http.NewRequest("DELETE", urls, body)
  17740. googleapi.Expand(req.URL, map[string]string{
  17741. "project": c.project,
  17742. "image": c.image,
  17743. })
  17744. req.Header.Set("User-Agent", c.s.userAgent())
  17745. if c.ctx_ != nil {
  17746. return ctxhttp.Do(c.ctx_, c.s.client, req)
  17747. }
  17748. return c.s.client.Do(req)
  17749. }
  17750. // Do executes the "compute.images.delete" call.
  17751. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  17752. // status code is an error. Response headers are in either
  17753. // *Operation.ServerResponse.Header or (if a response was returned at
  17754. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  17755. // to check whether the returned error was because
  17756. // http.StatusNotModified was returned.
  17757. func (c *ImagesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  17758. gensupport.SetOptions(c.urlParams_, opts...)
  17759. res, err := c.doRequest("json")
  17760. if res != nil && res.StatusCode == http.StatusNotModified {
  17761. if res.Body != nil {
  17762. res.Body.Close()
  17763. }
  17764. return nil, &googleapi.Error{
  17765. Code: res.StatusCode,
  17766. Header: res.Header,
  17767. }
  17768. }
  17769. if err != nil {
  17770. return nil, err
  17771. }
  17772. defer googleapi.CloseBody(res)
  17773. if err := googleapi.CheckResponse(res); err != nil {
  17774. return nil, err
  17775. }
  17776. ret := &Operation{
  17777. ServerResponse: googleapi.ServerResponse{
  17778. Header: res.Header,
  17779. HTTPStatusCode: res.StatusCode,
  17780. },
  17781. }
  17782. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  17783. return nil, err
  17784. }
  17785. return ret, nil
  17786. // {
  17787. // "description": "Deletes the specified image resource.",
  17788. // "httpMethod": "DELETE",
  17789. // "id": "compute.images.delete",
  17790. // "parameterOrder": [
  17791. // "project",
  17792. // "image"
  17793. // ],
  17794. // "parameters": {
  17795. // "image": {
  17796. // "description": "Name of the image resource to delete.",
  17797. // "location": "path",
  17798. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  17799. // "required": true,
  17800. // "type": "string"
  17801. // },
  17802. // "project": {
  17803. // "description": "Project ID for this request.",
  17804. // "location": "path",
  17805. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  17806. // "required": true,
  17807. // "type": "string"
  17808. // }
  17809. // },
  17810. // "path": "{project}/global/images/{image}",
  17811. // "response": {
  17812. // "$ref": "Operation"
  17813. // },
  17814. // "scopes": [
  17815. // "https://www.googleapis.com/auth/cloud-platform",
  17816. // "https://www.googleapis.com/auth/compute"
  17817. // ]
  17818. // }
  17819. }
  17820. // method id "compute.images.deprecate":
  17821. type ImagesDeprecateCall struct {
  17822. s *Service
  17823. project string
  17824. image string
  17825. deprecationstatus *DeprecationStatus
  17826. urlParams_ gensupport.URLParams
  17827. ctx_ context.Context
  17828. }
  17829. // Deprecate: Sets the deprecation status of an image.
  17830. //
  17831. // If an empty request body is given, clears the deprecation status
  17832. // instead.
  17833. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/deprecate
  17834. func (r *ImagesService) Deprecate(project string, image string, deprecationstatus *DeprecationStatus) *ImagesDeprecateCall {
  17835. c := &ImagesDeprecateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17836. c.project = project
  17837. c.image = image
  17838. c.deprecationstatus = deprecationstatus
  17839. return c
  17840. }
  17841. // Fields allows partial responses to be retrieved. See
  17842. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17843. // for more information.
  17844. func (c *ImagesDeprecateCall) Fields(s ...googleapi.Field) *ImagesDeprecateCall {
  17845. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17846. return c
  17847. }
  17848. // Context sets the context to be used in this call's Do method. Any
  17849. // pending HTTP request will be aborted if the provided context is
  17850. // canceled.
  17851. func (c *ImagesDeprecateCall) Context(ctx context.Context) *ImagesDeprecateCall {
  17852. c.ctx_ = ctx
  17853. return c
  17854. }
  17855. func (c *ImagesDeprecateCall) doRequest(alt string) (*http.Response, error) {
  17856. var body io.Reader = nil
  17857. body, err := googleapi.WithoutDataWrapper.JSONReader(c.deprecationstatus)
  17858. if err != nil {
  17859. return nil, err
  17860. }
  17861. ctype := "application/json"
  17862. c.urlParams_.Set("alt", alt)
  17863. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}/deprecate")
  17864. urls += "?" + c.urlParams_.Encode()
  17865. req, _ := http.NewRequest("POST", urls, body)
  17866. googleapi.Expand(req.URL, map[string]string{
  17867. "project": c.project,
  17868. "image": c.image,
  17869. })
  17870. req.Header.Set("Content-Type", ctype)
  17871. req.Header.Set("User-Agent", c.s.userAgent())
  17872. if c.ctx_ != nil {
  17873. return ctxhttp.Do(c.ctx_, c.s.client, req)
  17874. }
  17875. return c.s.client.Do(req)
  17876. }
  17877. // Do executes the "compute.images.deprecate" call.
  17878. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  17879. // status code is an error. Response headers are in either
  17880. // *Operation.ServerResponse.Header or (if a response was returned at
  17881. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  17882. // to check whether the returned error was because
  17883. // http.StatusNotModified was returned.
  17884. func (c *ImagesDeprecateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  17885. gensupport.SetOptions(c.urlParams_, opts...)
  17886. res, err := c.doRequest("json")
  17887. if res != nil && res.StatusCode == http.StatusNotModified {
  17888. if res.Body != nil {
  17889. res.Body.Close()
  17890. }
  17891. return nil, &googleapi.Error{
  17892. Code: res.StatusCode,
  17893. Header: res.Header,
  17894. }
  17895. }
  17896. if err != nil {
  17897. return nil, err
  17898. }
  17899. defer googleapi.CloseBody(res)
  17900. if err := googleapi.CheckResponse(res); err != nil {
  17901. return nil, err
  17902. }
  17903. ret := &Operation{
  17904. ServerResponse: googleapi.ServerResponse{
  17905. Header: res.Header,
  17906. HTTPStatusCode: res.StatusCode,
  17907. },
  17908. }
  17909. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  17910. return nil, err
  17911. }
  17912. return ret, nil
  17913. // {
  17914. // "description": "Sets the deprecation status of an image.\n\nIf an empty request body is given, clears the deprecation status instead.",
  17915. // "httpMethod": "POST",
  17916. // "id": "compute.images.deprecate",
  17917. // "parameterOrder": [
  17918. // "project",
  17919. // "image"
  17920. // ],
  17921. // "parameters": {
  17922. // "image": {
  17923. // "description": "Image name.",
  17924. // "location": "path",
  17925. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  17926. // "required": true,
  17927. // "type": "string"
  17928. // },
  17929. // "project": {
  17930. // "description": "Project ID for this request.",
  17931. // "location": "path",
  17932. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  17933. // "required": true,
  17934. // "type": "string"
  17935. // }
  17936. // },
  17937. // "path": "{project}/global/images/{image}/deprecate",
  17938. // "request": {
  17939. // "$ref": "DeprecationStatus"
  17940. // },
  17941. // "response": {
  17942. // "$ref": "Operation"
  17943. // },
  17944. // "scopes": [
  17945. // "https://www.googleapis.com/auth/cloud-platform",
  17946. // "https://www.googleapis.com/auth/compute"
  17947. // ]
  17948. // }
  17949. }
  17950. // method id "compute.images.get":
  17951. type ImagesGetCall struct {
  17952. s *Service
  17953. project string
  17954. image string
  17955. urlParams_ gensupport.URLParams
  17956. ifNoneMatch_ string
  17957. ctx_ context.Context
  17958. }
  17959. // Get: Returns the specified image resource.
  17960. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/get
  17961. func (r *ImagesService) Get(project string, image string) *ImagesGetCall {
  17962. c := &ImagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17963. c.project = project
  17964. c.image = image
  17965. return c
  17966. }
  17967. // Fields allows partial responses to be retrieved. See
  17968. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17969. // for more information.
  17970. func (c *ImagesGetCall) Fields(s ...googleapi.Field) *ImagesGetCall {
  17971. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17972. return c
  17973. }
  17974. // IfNoneMatch sets the optional parameter which makes the operation
  17975. // fail if the object's ETag matches the given value. This is useful for
  17976. // getting updates only after the object has changed since the last
  17977. // request. Use googleapi.IsNotModified to check whether the response
  17978. // error from Do is the result of In-None-Match.
  17979. func (c *ImagesGetCall) IfNoneMatch(entityTag string) *ImagesGetCall {
  17980. c.ifNoneMatch_ = entityTag
  17981. return c
  17982. }
  17983. // Context sets the context to be used in this call's Do method. Any
  17984. // pending HTTP request will be aborted if the provided context is
  17985. // canceled.
  17986. func (c *ImagesGetCall) Context(ctx context.Context) *ImagesGetCall {
  17987. c.ctx_ = ctx
  17988. return c
  17989. }
  17990. func (c *ImagesGetCall) doRequest(alt string) (*http.Response, error) {
  17991. var body io.Reader = nil
  17992. c.urlParams_.Set("alt", alt)
  17993. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}")
  17994. urls += "?" + c.urlParams_.Encode()
  17995. req, _ := http.NewRequest("GET", urls, body)
  17996. googleapi.Expand(req.URL, map[string]string{
  17997. "project": c.project,
  17998. "image": c.image,
  17999. })
  18000. req.Header.Set("User-Agent", c.s.userAgent())
  18001. if c.ifNoneMatch_ != "" {
  18002. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  18003. }
  18004. if c.ctx_ != nil {
  18005. return ctxhttp.Do(c.ctx_, c.s.client, req)
  18006. }
  18007. return c.s.client.Do(req)
  18008. }
  18009. // Do executes the "compute.images.get" call.
  18010. // Exactly one of *Image or error will be non-nil. Any non-2xx status
  18011. // code is an error. Response headers are in either
  18012. // *Image.ServerResponse.Header or (if a response was returned at all)
  18013. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  18014. // check whether the returned error was because http.StatusNotModified
  18015. // was returned.
  18016. func (c *ImagesGetCall) Do(opts ...googleapi.CallOption) (*Image, error) {
  18017. gensupport.SetOptions(c.urlParams_, opts...)
  18018. res, err := c.doRequest("json")
  18019. if res != nil && res.StatusCode == http.StatusNotModified {
  18020. if res.Body != nil {
  18021. res.Body.Close()
  18022. }
  18023. return nil, &googleapi.Error{
  18024. Code: res.StatusCode,
  18025. Header: res.Header,
  18026. }
  18027. }
  18028. if err != nil {
  18029. return nil, err
  18030. }
  18031. defer googleapi.CloseBody(res)
  18032. if err := googleapi.CheckResponse(res); err != nil {
  18033. return nil, err
  18034. }
  18035. ret := &Image{
  18036. ServerResponse: googleapi.ServerResponse{
  18037. Header: res.Header,
  18038. HTTPStatusCode: res.StatusCode,
  18039. },
  18040. }
  18041. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  18042. return nil, err
  18043. }
  18044. return ret, nil
  18045. // {
  18046. // "description": "Returns the specified image resource.",
  18047. // "httpMethod": "GET",
  18048. // "id": "compute.images.get",
  18049. // "parameterOrder": [
  18050. // "project",
  18051. // "image"
  18052. // ],
  18053. // "parameters": {
  18054. // "image": {
  18055. // "description": "Name of the image resource to return.",
  18056. // "location": "path",
  18057. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  18058. // "required": true,
  18059. // "type": "string"
  18060. // },
  18061. // "project": {
  18062. // "description": "Project ID for this request.",
  18063. // "location": "path",
  18064. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  18065. // "required": true,
  18066. // "type": "string"
  18067. // }
  18068. // },
  18069. // "path": "{project}/global/images/{image}",
  18070. // "response": {
  18071. // "$ref": "Image"
  18072. // },
  18073. // "scopes": [
  18074. // "https://www.googleapis.com/auth/cloud-platform",
  18075. // "https://www.googleapis.com/auth/compute",
  18076. // "https://www.googleapis.com/auth/compute.readonly"
  18077. // ]
  18078. // }
  18079. }
  18080. // method id "compute.images.insert":
  18081. type ImagesInsertCall struct {
  18082. s *Service
  18083. project string
  18084. image *Image
  18085. urlParams_ gensupport.URLParams
  18086. ctx_ context.Context
  18087. }
  18088. // Insert: Creates an image resource in the specified project using the
  18089. // data included in the request.
  18090. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/insert
  18091. func (r *ImagesService) Insert(project string, image *Image) *ImagesInsertCall {
  18092. c := &ImagesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18093. c.project = project
  18094. c.image = image
  18095. return c
  18096. }
  18097. // Fields allows partial responses to be retrieved. See
  18098. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18099. // for more information.
  18100. func (c *ImagesInsertCall) Fields(s ...googleapi.Field) *ImagesInsertCall {
  18101. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18102. return c
  18103. }
  18104. // Context sets the context to be used in this call's Do method. Any
  18105. // pending HTTP request will be aborted if the provided context is
  18106. // canceled.
  18107. func (c *ImagesInsertCall) Context(ctx context.Context) *ImagesInsertCall {
  18108. c.ctx_ = ctx
  18109. return c
  18110. }
  18111. func (c *ImagesInsertCall) doRequest(alt string) (*http.Response, error) {
  18112. var body io.Reader = nil
  18113. body, err := googleapi.WithoutDataWrapper.JSONReader(c.image)
  18114. if err != nil {
  18115. return nil, err
  18116. }
  18117. ctype := "application/json"
  18118. c.urlParams_.Set("alt", alt)
  18119. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images")
  18120. urls += "?" + c.urlParams_.Encode()
  18121. req, _ := http.NewRequest("POST", urls, body)
  18122. googleapi.Expand(req.URL, map[string]string{
  18123. "project": c.project,
  18124. })
  18125. req.Header.Set("Content-Type", ctype)
  18126. req.Header.Set("User-Agent", c.s.userAgent())
  18127. if c.ctx_ != nil {
  18128. return ctxhttp.Do(c.ctx_, c.s.client, req)
  18129. }
  18130. return c.s.client.Do(req)
  18131. }
  18132. // Do executes the "compute.images.insert" call.
  18133. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  18134. // status code is an error. Response headers are in either
  18135. // *Operation.ServerResponse.Header or (if a response was returned at
  18136. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  18137. // to check whether the returned error was because
  18138. // http.StatusNotModified was returned.
  18139. func (c *ImagesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  18140. gensupport.SetOptions(c.urlParams_, opts...)
  18141. res, err := c.doRequest("json")
  18142. if res != nil && res.StatusCode == http.StatusNotModified {
  18143. if res.Body != nil {
  18144. res.Body.Close()
  18145. }
  18146. return nil, &googleapi.Error{
  18147. Code: res.StatusCode,
  18148. Header: res.Header,
  18149. }
  18150. }
  18151. if err != nil {
  18152. return nil, err
  18153. }
  18154. defer googleapi.CloseBody(res)
  18155. if err := googleapi.CheckResponse(res); err != nil {
  18156. return nil, err
  18157. }
  18158. ret := &Operation{
  18159. ServerResponse: googleapi.ServerResponse{
  18160. Header: res.Header,
  18161. HTTPStatusCode: res.StatusCode,
  18162. },
  18163. }
  18164. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  18165. return nil, err
  18166. }
  18167. return ret, nil
  18168. // {
  18169. // "description": "Creates an image resource in the specified project using the data included in the request.",
  18170. // "httpMethod": "POST",
  18171. // "id": "compute.images.insert",
  18172. // "parameterOrder": [
  18173. // "project"
  18174. // ],
  18175. // "parameters": {
  18176. // "project": {
  18177. // "description": "Project ID for this request.",
  18178. // "location": "path",
  18179. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  18180. // "required": true,
  18181. // "type": "string"
  18182. // }
  18183. // },
  18184. // "path": "{project}/global/images",
  18185. // "request": {
  18186. // "$ref": "Image"
  18187. // },
  18188. // "response": {
  18189. // "$ref": "Operation"
  18190. // },
  18191. // "scopes": [
  18192. // "https://www.googleapis.com/auth/cloud-platform",
  18193. // "https://www.googleapis.com/auth/compute",
  18194. // "https://www.googleapis.com/auth/devstorage.full_control",
  18195. // "https://www.googleapis.com/auth/devstorage.read_only",
  18196. // "https://www.googleapis.com/auth/devstorage.read_write"
  18197. // ]
  18198. // }
  18199. }
  18200. // method id "compute.images.list":
  18201. type ImagesListCall struct {
  18202. s *Service
  18203. project string
  18204. urlParams_ gensupport.URLParams
  18205. ifNoneMatch_ string
  18206. ctx_ context.Context
  18207. }
  18208. // List: Retrieves the list of private images available to the specified
  18209. // project. Private images are images you create that belong to your
  18210. // project. This method does not get any images that belong to other
  18211. // projects, including publicly-available images, like Debian 7. If you
  18212. // want to get a list of publicly-available images, use this method to
  18213. // make a request to the respective image project, such as debian-cloud
  18214. // or windows-cloud.
  18215. //
  18216. // See Accessing images for more information.
  18217. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/list
  18218. func (r *ImagesService) List(project string) *ImagesListCall {
  18219. c := &ImagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18220. c.project = project
  18221. return c
  18222. }
  18223. // Filter sets the optional parameter "filter": Sets a filter expression
  18224. // for filtering listed resources, in the form filter={expression}. Your
  18225. // {expression} must be in the format: field_name comparison_string
  18226. // literal_string.
  18227. //
  18228. // The field_name is the name of the field you want to compare. Only
  18229. // atomic field types are supported (string, number, boolean). The
  18230. // comparison_string must be either eq (equals) or ne (not equals). The
  18231. // literal_string is the string value to filter to. The literal value
  18232. // must be valid for the type of field you are filtering by (string,
  18233. // number, boolean). For string fields, the literal value is interpreted
  18234. // as a regular expression using RE2 syntax. The literal value must
  18235. // match the entire field.
  18236. //
  18237. // For example, filter=name ne example-instance.
  18238. //
  18239. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  18240. // you can also filter on nested fields. For example, you could filter
  18241. // on instances that have set the scheduling.automaticRestart field to
  18242. // true. In particular, use filtering on nested fields to take advantage
  18243. // of instance labels to organize and filter results based on label
  18244. // values.
  18245. //
  18246. // The Beta API also supports filtering on multiple expressions by
  18247. // providing each separate expression within parentheses. For example,
  18248. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  18249. // Multiple expressions are treated as AND expressions meaning that
  18250. // resources must match all expressions to pass the filters.
  18251. func (c *ImagesListCall) Filter(filter string) *ImagesListCall {
  18252. c.urlParams_.Set("filter", filter)
  18253. return c
  18254. }
  18255. // MaxResults sets the optional parameter "maxResults": The maximum
  18256. // number of results per page that Compute Engine should return. If the
  18257. // number of available results is larger than maxResults, Compute Engine
  18258. // returns a nextPageToken that can be used to get the next page of
  18259. // results in subsequent list requests.
  18260. func (c *ImagesListCall) MaxResults(maxResults int64) *ImagesListCall {
  18261. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  18262. return c
  18263. }
  18264. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  18265. // a certain order. By default, results are returned in alphanumerical
  18266. // order based on the resource name.
  18267. //
  18268. // You can also sort results in descending order based on the creation
  18269. // timestamp using orderBy="creationTimestamp desc". This sorts results
  18270. // based on the creationTimestamp field in reverse chronological order
  18271. // (newest result first). Use this to sort resources like operations so
  18272. // that the newest operation is returned first.
  18273. //
  18274. // Currently, only sorting by name or creationTimestamp desc is
  18275. // supported.
  18276. func (c *ImagesListCall) OrderBy(orderBy string) *ImagesListCall {
  18277. c.urlParams_.Set("orderBy", orderBy)
  18278. return c
  18279. }
  18280. // PageToken sets the optional parameter "pageToken": Specifies a page
  18281. // token to use. Set pageToken to the nextPageToken returned by a
  18282. // previous list request to get the next page of results.
  18283. func (c *ImagesListCall) PageToken(pageToken string) *ImagesListCall {
  18284. c.urlParams_.Set("pageToken", pageToken)
  18285. return c
  18286. }
  18287. // Fields allows partial responses to be retrieved. See
  18288. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18289. // for more information.
  18290. func (c *ImagesListCall) Fields(s ...googleapi.Field) *ImagesListCall {
  18291. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18292. return c
  18293. }
  18294. // IfNoneMatch sets the optional parameter which makes the operation
  18295. // fail if the object's ETag matches the given value. This is useful for
  18296. // getting updates only after the object has changed since the last
  18297. // request. Use googleapi.IsNotModified to check whether the response
  18298. // error from Do is the result of In-None-Match.
  18299. func (c *ImagesListCall) IfNoneMatch(entityTag string) *ImagesListCall {
  18300. c.ifNoneMatch_ = entityTag
  18301. return c
  18302. }
  18303. // Context sets the context to be used in this call's Do method. Any
  18304. // pending HTTP request will be aborted if the provided context is
  18305. // canceled.
  18306. func (c *ImagesListCall) Context(ctx context.Context) *ImagesListCall {
  18307. c.ctx_ = ctx
  18308. return c
  18309. }
  18310. func (c *ImagesListCall) doRequest(alt string) (*http.Response, error) {
  18311. var body io.Reader = nil
  18312. c.urlParams_.Set("alt", alt)
  18313. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images")
  18314. urls += "?" + c.urlParams_.Encode()
  18315. req, _ := http.NewRequest("GET", urls, body)
  18316. googleapi.Expand(req.URL, map[string]string{
  18317. "project": c.project,
  18318. })
  18319. req.Header.Set("User-Agent", c.s.userAgent())
  18320. if c.ifNoneMatch_ != "" {
  18321. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  18322. }
  18323. if c.ctx_ != nil {
  18324. return ctxhttp.Do(c.ctx_, c.s.client, req)
  18325. }
  18326. return c.s.client.Do(req)
  18327. }
  18328. // Do executes the "compute.images.list" call.
  18329. // Exactly one of *ImageList or error will be non-nil. Any non-2xx
  18330. // status code is an error. Response headers are in either
  18331. // *ImageList.ServerResponse.Header or (if a response was returned at
  18332. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  18333. // to check whether the returned error was because
  18334. // http.StatusNotModified was returned.
  18335. func (c *ImagesListCall) Do(opts ...googleapi.CallOption) (*ImageList, error) {
  18336. gensupport.SetOptions(c.urlParams_, opts...)
  18337. res, err := c.doRequest("json")
  18338. if res != nil && res.StatusCode == http.StatusNotModified {
  18339. if res.Body != nil {
  18340. res.Body.Close()
  18341. }
  18342. return nil, &googleapi.Error{
  18343. Code: res.StatusCode,
  18344. Header: res.Header,
  18345. }
  18346. }
  18347. if err != nil {
  18348. return nil, err
  18349. }
  18350. defer googleapi.CloseBody(res)
  18351. if err := googleapi.CheckResponse(res); err != nil {
  18352. return nil, err
  18353. }
  18354. ret := &ImageList{
  18355. ServerResponse: googleapi.ServerResponse{
  18356. Header: res.Header,
  18357. HTTPStatusCode: res.StatusCode,
  18358. },
  18359. }
  18360. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  18361. return nil, err
  18362. }
  18363. return ret, nil
  18364. // {
  18365. // "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 7. 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.\n\nSee Accessing images for more information.",
  18366. // "httpMethod": "GET",
  18367. // "id": "compute.images.list",
  18368. // "parameterOrder": [
  18369. // "project"
  18370. // ],
  18371. // "parameters": {
  18372. // "filter": {
  18373. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  18374. // "location": "query",
  18375. // "type": "string"
  18376. // },
  18377. // "maxResults": {
  18378. // "default": "500",
  18379. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  18380. // "format": "uint32",
  18381. // "location": "query",
  18382. // "maximum": "500",
  18383. // "minimum": "0",
  18384. // "type": "integer"
  18385. // },
  18386. // "orderBy": {
  18387. // "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.",
  18388. // "location": "query",
  18389. // "type": "string"
  18390. // },
  18391. // "pageToken": {
  18392. // "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.",
  18393. // "location": "query",
  18394. // "type": "string"
  18395. // },
  18396. // "project": {
  18397. // "description": "Project ID for this request.",
  18398. // "location": "path",
  18399. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  18400. // "required": true,
  18401. // "type": "string"
  18402. // }
  18403. // },
  18404. // "path": "{project}/global/images",
  18405. // "response": {
  18406. // "$ref": "ImageList"
  18407. // },
  18408. // "scopes": [
  18409. // "https://www.googleapis.com/auth/cloud-platform",
  18410. // "https://www.googleapis.com/auth/compute",
  18411. // "https://www.googleapis.com/auth/compute.readonly"
  18412. // ]
  18413. // }
  18414. }
  18415. // Pages invokes f for each page of results.
  18416. // A non-nil error returned from f will halt the iteration.
  18417. // The provided context supersedes any context provided to the Context method.
  18418. func (c *ImagesListCall) Pages(ctx context.Context, f func(*ImageList) error) error {
  18419. c.ctx_ = ctx
  18420. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  18421. for {
  18422. x, err := c.Do()
  18423. if err != nil {
  18424. return err
  18425. }
  18426. if err := f(x); err != nil {
  18427. return err
  18428. }
  18429. if x.NextPageToken == "" {
  18430. return nil
  18431. }
  18432. c.PageToken(x.NextPageToken)
  18433. }
  18434. }
  18435. // method id "compute.instanceGroupManagers.abandonInstances":
  18436. type InstanceGroupManagersAbandonInstancesCall struct {
  18437. s *Service
  18438. project string
  18439. zone string
  18440. instanceGroupManager string
  18441. instancegroupmanagersabandoninstancesrequest *InstanceGroupManagersAbandonInstancesRequest
  18442. urlParams_ gensupport.URLParams
  18443. ctx_ context.Context
  18444. }
  18445. // AbandonInstances: Schedules a group action to remove the specified
  18446. // instances from the managed instance group. Abandoning an instance
  18447. // does not delete the instance, but it does remove the instance from
  18448. // any target pools that are applied by the managed instance group. This
  18449. // method reduces the targetSize of the managed instance group by the
  18450. // number of instances that you abandon. This operation is marked as
  18451. // DONE when the action is scheduled even if the instances have not yet
  18452. // been removed from the group. You must separately verify the status of
  18453. // the abandoning action with the listmanagedinstances method.
  18454. func (r *InstanceGroupManagersService) AbandonInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersabandoninstancesrequest *InstanceGroupManagersAbandonInstancesRequest) *InstanceGroupManagersAbandonInstancesCall {
  18455. c := &InstanceGroupManagersAbandonInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18456. c.project = project
  18457. c.zone = zone
  18458. c.instanceGroupManager = instanceGroupManager
  18459. c.instancegroupmanagersabandoninstancesrequest = instancegroupmanagersabandoninstancesrequest
  18460. return c
  18461. }
  18462. // Fields allows partial responses to be retrieved. See
  18463. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18464. // for more information.
  18465. func (c *InstanceGroupManagersAbandonInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersAbandonInstancesCall {
  18466. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18467. return c
  18468. }
  18469. // Context sets the context to be used in this call's Do method. Any
  18470. // pending HTTP request will be aborted if the provided context is
  18471. // canceled.
  18472. func (c *InstanceGroupManagersAbandonInstancesCall) Context(ctx context.Context) *InstanceGroupManagersAbandonInstancesCall {
  18473. c.ctx_ = ctx
  18474. return c
  18475. }
  18476. func (c *InstanceGroupManagersAbandonInstancesCall) doRequest(alt string) (*http.Response, error) {
  18477. var body io.Reader = nil
  18478. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersabandoninstancesrequest)
  18479. if err != nil {
  18480. return nil, err
  18481. }
  18482. ctype := "application/json"
  18483. c.urlParams_.Set("alt", alt)
  18484. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances")
  18485. urls += "?" + c.urlParams_.Encode()
  18486. req, _ := http.NewRequest("POST", urls, body)
  18487. googleapi.Expand(req.URL, map[string]string{
  18488. "project": c.project,
  18489. "zone": c.zone,
  18490. "instanceGroupManager": c.instanceGroupManager,
  18491. })
  18492. req.Header.Set("Content-Type", ctype)
  18493. req.Header.Set("User-Agent", c.s.userAgent())
  18494. if c.ctx_ != nil {
  18495. return ctxhttp.Do(c.ctx_, c.s.client, req)
  18496. }
  18497. return c.s.client.Do(req)
  18498. }
  18499. // Do executes the "compute.instanceGroupManagers.abandonInstances" call.
  18500. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  18501. // status code is an error. Response headers are in either
  18502. // *Operation.ServerResponse.Header or (if a response was returned at
  18503. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  18504. // to check whether the returned error was because
  18505. // http.StatusNotModified was returned.
  18506. func (c *InstanceGroupManagersAbandonInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  18507. gensupport.SetOptions(c.urlParams_, opts...)
  18508. res, err := c.doRequest("json")
  18509. if res != nil && res.StatusCode == http.StatusNotModified {
  18510. if res.Body != nil {
  18511. res.Body.Close()
  18512. }
  18513. return nil, &googleapi.Error{
  18514. Code: res.StatusCode,
  18515. Header: res.Header,
  18516. }
  18517. }
  18518. if err != nil {
  18519. return nil, err
  18520. }
  18521. defer googleapi.CloseBody(res)
  18522. if err := googleapi.CheckResponse(res); err != nil {
  18523. return nil, err
  18524. }
  18525. ret := &Operation{
  18526. ServerResponse: googleapi.ServerResponse{
  18527. Header: res.Header,
  18528. HTTPStatusCode: res.StatusCode,
  18529. },
  18530. }
  18531. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  18532. return nil, err
  18533. }
  18534. return ret, nil
  18535. // {
  18536. // "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.",
  18537. // "httpMethod": "POST",
  18538. // "id": "compute.instanceGroupManagers.abandonInstances",
  18539. // "parameterOrder": [
  18540. // "project",
  18541. // "zone",
  18542. // "instanceGroupManager"
  18543. // ],
  18544. // "parameters": {
  18545. // "instanceGroupManager": {
  18546. // "description": "The name of the managed instance group.",
  18547. // "location": "path",
  18548. // "required": true,
  18549. // "type": "string"
  18550. // },
  18551. // "project": {
  18552. // "description": "Project ID for this request.",
  18553. // "location": "path",
  18554. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  18555. // "required": true,
  18556. // "type": "string"
  18557. // },
  18558. // "zone": {
  18559. // "description": "The name of the zone where the managed instance group is located.",
  18560. // "location": "path",
  18561. // "required": true,
  18562. // "type": "string"
  18563. // }
  18564. // },
  18565. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances",
  18566. // "request": {
  18567. // "$ref": "InstanceGroupManagersAbandonInstancesRequest"
  18568. // },
  18569. // "response": {
  18570. // "$ref": "Operation"
  18571. // },
  18572. // "scopes": [
  18573. // "https://www.googleapis.com/auth/cloud-platform",
  18574. // "https://www.googleapis.com/auth/compute"
  18575. // ]
  18576. // }
  18577. }
  18578. // method id "compute.instanceGroupManagers.aggregatedList":
  18579. type InstanceGroupManagersAggregatedListCall struct {
  18580. s *Service
  18581. project string
  18582. urlParams_ gensupport.URLParams
  18583. ifNoneMatch_ string
  18584. ctx_ context.Context
  18585. }
  18586. // AggregatedList: Retrieves the list of managed instance groups and
  18587. // groups them by zone.
  18588. func (r *InstanceGroupManagersService) AggregatedList(project string) *InstanceGroupManagersAggregatedListCall {
  18589. c := &InstanceGroupManagersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18590. c.project = project
  18591. return c
  18592. }
  18593. // Filter sets the optional parameter "filter": Sets a filter expression
  18594. // for filtering listed resources, in the form filter={expression}. Your
  18595. // {expression} must be in the format: field_name comparison_string
  18596. // literal_string.
  18597. //
  18598. // The field_name is the name of the field you want to compare. Only
  18599. // atomic field types are supported (string, number, boolean). The
  18600. // comparison_string must be either eq (equals) or ne (not equals). The
  18601. // literal_string is the string value to filter to. The literal value
  18602. // must be valid for the type of field you are filtering by (string,
  18603. // number, boolean). For string fields, the literal value is interpreted
  18604. // as a regular expression using RE2 syntax. The literal value must
  18605. // match the entire field.
  18606. //
  18607. // For example, filter=name ne example-instance.
  18608. //
  18609. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  18610. // you can also filter on nested fields. For example, you could filter
  18611. // on instances that have set the scheduling.automaticRestart field to
  18612. // true. In particular, use filtering on nested fields to take advantage
  18613. // of instance labels to organize and filter results based on label
  18614. // values.
  18615. //
  18616. // The Beta API also supports filtering on multiple expressions by
  18617. // providing each separate expression within parentheses. For example,
  18618. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  18619. // Multiple expressions are treated as AND expressions meaning that
  18620. // resources must match all expressions to pass the filters.
  18621. func (c *InstanceGroupManagersAggregatedListCall) Filter(filter string) *InstanceGroupManagersAggregatedListCall {
  18622. c.urlParams_.Set("filter", filter)
  18623. return c
  18624. }
  18625. // MaxResults sets the optional parameter "maxResults": The maximum
  18626. // number of results per page that Compute Engine should return. If the
  18627. // number of available results is larger than maxResults, Compute Engine
  18628. // returns a nextPageToken that can be used to get the next page of
  18629. // results in subsequent list requests.
  18630. func (c *InstanceGroupManagersAggregatedListCall) MaxResults(maxResults int64) *InstanceGroupManagersAggregatedListCall {
  18631. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  18632. return c
  18633. }
  18634. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  18635. // a certain order. By default, results are returned in alphanumerical
  18636. // order based on the resource name.
  18637. //
  18638. // You can also sort results in descending order based on the creation
  18639. // timestamp using orderBy="creationTimestamp desc". This sorts results
  18640. // based on the creationTimestamp field in reverse chronological order
  18641. // (newest result first). Use this to sort resources like operations so
  18642. // that the newest operation is returned first.
  18643. //
  18644. // Currently, only sorting by name or creationTimestamp desc is
  18645. // supported.
  18646. func (c *InstanceGroupManagersAggregatedListCall) OrderBy(orderBy string) *InstanceGroupManagersAggregatedListCall {
  18647. c.urlParams_.Set("orderBy", orderBy)
  18648. return c
  18649. }
  18650. // PageToken sets the optional parameter "pageToken": Specifies a page
  18651. // token to use. Set pageToken to the nextPageToken returned by a
  18652. // previous list request to get the next page of results.
  18653. func (c *InstanceGroupManagersAggregatedListCall) PageToken(pageToken string) *InstanceGroupManagersAggregatedListCall {
  18654. c.urlParams_.Set("pageToken", pageToken)
  18655. return c
  18656. }
  18657. // Fields allows partial responses to be retrieved. See
  18658. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18659. // for more information.
  18660. func (c *InstanceGroupManagersAggregatedListCall) Fields(s ...googleapi.Field) *InstanceGroupManagersAggregatedListCall {
  18661. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18662. return c
  18663. }
  18664. // IfNoneMatch sets the optional parameter which makes the operation
  18665. // fail if the object's ETag matches the given value. This is useful for
  18666. // getting updates only after the object has changed since the last
  18667. // request. Use googleapi.IsNotModified to check whether the response
  18668. // error from Do is the result of In-None-Match.
  18669. func (c *InstanceGroupManagersAggregatedListCall) IfNoneMatch(entityTag string) *InstanceGroupManagersAggregatedListCall {
  18670. c.ifNoneMatch_ = entityTag
  18671. return c
  18672. }
  18673. // Context sets the context to be used in this call's Do method. Any
  18674. // pending HTTP request will be aborted if the provided context is
  18675. // canceled.
  18676. func (c *InstanceGroupManagersAggregatedListCall) Context(ctx context.Context) *InstanceGroupManagersAggregatedListCall {
  18677. c.ctx_ = ctx
  18678. return c
  18679. }
  18680. func (c *InstanceGroupManagersAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  18681. var body io.Reader = nil
  18682. c.urlParams_.Set("alt", alt)
  18683. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instanceGroupManagers")
  18684. urls += "?" + c.urlParams_.Encode()
  18685. req, _ := http.NewRequest("GET", urls, body)
  18686. googleapi.Expand(req.URL, map[string]string{
  18687. "project": c.project,
  18688. })
  18689. req.Header.Set("User-Agent", c.s.userAgent())
  18690. if c.ifNoneMatch_ != "" {
  18691. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  18692. }
  18693. if c.ctx_ != nil {
  18694. return ctxhttp.Do(c.ctx_, c.s.client, req)
  18695. }
  18696. return c.s.client.Do(req)
  18697. }
  18698. // Do executes the "compute.instanceGroupManagers.aggregatedList" call.
  18699. // Exactly one of *InstanceGroupManagerAggregatedList or error will be
  18700. // non-nil. Any non-2xx status code is an error. Response headers are in
  18701. // either *InstanceGroupManagerAggregatedList.ServerResponse.Header or
  18702. // (if a response was returned at all) in
  18703. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  18704. // whether the returned error was because http.StatusNotModified was
  18705. // returned.
  18706. func (c *InstanceGroupManagersAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagerAggregatedList, error) {
  18707. gensupport.SetOptions(c.urlParams_, opts...)
  18708. res, err := c.doRequest("json")
  18709. if res != nil && res.StatusCode == http.StatusNotModified {
  18710. if res.Body != nil {
  18711. res.Body.Close()
  18712. }
  18713. return nil, &googleapi.Error{
  18714. Code: res.StatusCode,
  18715. Header: res.Header,
  18716. }
  18717. }
  18718. if err != nil {
  18719. return nil, err
  18720. }
  18721. defer googleapi.CloseBody(res)
  18722. if err := googleapi.CheckResponse(res); err != nil {
  18723. return nil, err
  18724. }
  18725. ret := &InstanceGroupManagerAggregatedList{
  18726. ServerResponse: googleapi.ServerResponse{
  18727. Header: res.Header,
  18728. HTTPStatusCode: res.StatusCode,
  18729. },
  18730. }
  18731. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  18732. return nil, err
  18733. }
  18734. return ret, nil
  18735. // {
  18736. // "description": "Retrieves the list of managed instance groups and groups them by zone.",
  18737. // "httpMethod": "GET",
  18738. // "id": "compute.instanceGroupManagers.aggregatedList",
  18739. // "parameterOrder": [
  18740. // "project"
  18741. // ],
  18742. // "parameters": {
  18743. // "filter": {
  18744. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  18745. // "location": "query",
  18746. // "type": "string"
  18747. // },
  18748. // "maxResults": {
  18749. // "default": "500",
  18750. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  18751. // "format": "uint32",
  18752. // "location": "query",
  18753. // "maximum": "500",
  18754. // "minimum": "0",
  18755. // "type": "integer"
  18756. // },
  18757. // "orderBy": {
  18758. // "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.",
  18759. // "location": "query",
  18760. // "type": "string"
  18761. // },
  18762. // "pageToken": {
  18763. // "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.",
  18764. // "location": "query",
  18765. // "type": "string"
  18766. // },
  18767. // "project": {
  18768. // "description": "Project ID for this request.",
  18769. // "location": "path",
  18770. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  18771. // "required": true,
  18772. // "type": "string"
  18773. // }
  18774. // },
  18775. // "path": "{project}/aggregated/instanceGroupManagers",
  18776. // "response": {
  18777. // "$ref": "InstanceGroupManagerAggregatedList"
  18778. // },
  18779. // "scopes": [
  18780. // "https://www.googleapis.com/auth/cloud-platform",
  18781. // "https://www.googleapis.com/auth/compute",
  18782. // "https://www.googleapis.com/auth/compute.readonly"
  18783. // ]
  18784. // }
  18785. }
  18786. // Pages invokes f for each page of results.
  18787. // A non-nil error returned from f will halt the iteration.
  18788. // The provided context supersedes any context provided to the Context method.
  18789. func (c *InstanceGroupManagersAggregatedListCall) Pages(ctx context.Context, f func(*InstanceGroupManagerAggregatedList) error) error {
  18790. c.ctx_ = ctx
  18791. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  18792. for {
  18793. x, err := c.Do()
  18794. if err != nil {
  18795. return err
  18796. }
  18797. if err := f(x); err != nil {
  18798. return err
  18799. }
  18800. if x.NextPageToken == "" {
  18801. return nil
  18802. }
  18803. c.PageToken(x.NextPageToken)
  18804. }
  18805. }
  18806. // method id "compute.instanceGroupManagers.delete":
  18807. type InstanceGroupManagersDeleteCall struct {
  18808. s *Service
  18809. project string
  18810. zone string
  18811. instanceGroupManager string
  18812. urlParams_ gensupport.URLParams
  18813. ctx_ context.Context
  18814. }
  18815. // Delete: Deletes the specified managed instance group and all of the
  18816. // instances in that group. Note that the instance group must not belong
  18817. // to a backend service. Read Deleting an instance group for more
  18818. // information.
  18819. func (r *InstanceGroupManagersService) Delete(project string, zone string, instanceGroupManager string) *InstanceGroupManagersDeleteCall {
  18820. c := &InstanceGroupManagersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18821. c.project = project
  18822. c.zone = zone
  18823. c.instanceGroupManager = instanceGroupManager
  18824. return c
  18825. }
  18826. // Fields allows partial responses to be retrieved. See
  18827. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18828. // for more information.
  18829. func (c *InstanceGroupManagersDeleteCall) Fields(s ...googleapi.Field) *InstanceGroupManagersDeleteCall {
  18830. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18831. return c
  18832. }
  18833. // Context sets the context to be used in this call's Do method. Any
  18834. // pending HTTP request will be aborted if the provided context is
  18835. // canceled.
  18836. func (c *InstanceGroupManagersDeleteCall) Context(ctx context.Context) *InstanceGroupManagersDeleteCall {
  18837. c.ctx_ = ctx
  18838. return c
  18839. }
  18840. func (c *InstanceGroupManagersDeleteCall) doRequest(alt string) (*http.Response, error) {
  18841. var body io.Reader = nil
  18842. c.urlParams_.Set("alt", alt)
  18843. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
  18844. urls += "?" + c.urlParams_.Encode()
  18845. req, _ := http.NewRequest("DELETE", urls, body)
  18846. googleapi.Expand(req.URL, map[string]string{
  18847. "project": c.project,
  18848. "zone": c.zone,
  18849. "instanceGroupManager": c.instanceGroupManager,
  18850. })
  18851. req.Header.Set("User-Agent", c.s.userAgent())
  18852. if c.ctx_ != nil {
  18853. return ctxhttp.Do(c.ctx_, c.s.client, req)
  18854. }
  18855. return c.s.client.Do(req)
  18856. }
  18857. // Do executes the "compute.instanceGroupManagers.delete" call.
  18858. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  18859. // status code is an error. Response headers are in either
  18860. // *Operation.ServerResponse.Header or (if a response was returned at
  18861. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  18862. // to check whether the returned error was because
  18863. // http.StatusNotModified was returned.
  18864. func (c *InstanceGroupManagersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  18865. gensupport.SetOptions(c.urlParams_, opts...)
  18866. res, err := c.doRequest("json")
  18867. if res != nil && res.StatusCode == http.StatusNotModified {
  18868. if res.Body != nil {
  18869. res.Body.Close()
  18870. }
  18871. return nil, &googleapi.Error{
  18872. Code: res.StatusCode,
  18873. Header: res.Header,
  18874. }
  18875. }
  18876. if err != nil {
  18877. return nil, err
  18878. }
  18879. defer googleapi.CloseBody(res)
  18880. if err := googleapi.CheckResponse(res); err != nil {
  18881. return nil, err
  18882. }
  18883. ret := &Operation{
  18884. ServerResponse: googleapi.ServerResponse{
  18885. Header: res.Header,
  18886. HTTPStatusCode: res.StatusCode,
  18887. },
  18888. }
  18889. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  18890. return nil, err
  18891. }
  18892. return ret, nil
  18893. // {
  18894. // "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.",
  18895. // "httpMethod": "DELETE",
  18896. // "id": "compute.instanceGroupManagers.delete",
  18897. // "parameterOrder": [
  18898. // "project",
  18899. // "zone",
  18900. // "instanceGroupManager"
  18901. // ],
  18902. // "parameters": {
  18903. // "instanceGroupManager": {
  18904. // "description": "The name of the managed instance group to delete.",
  18905. // "location": "path",
  18906. // "required": true,
  18907. // "type": "string"
  18908. // },
  18909. // "project": {
  18910. // "description": "Project ID for this request.",
  18911. // "location": "path",
  18912. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  18913. // "required": true,
  18914. // "type": "string"
  18915. // },
  18916. // "zone": {
  18917. // "description": "The name of the zone where the managed instance group is located.",
  18918. // "location": "path",
  18919. // "required": true,
  18920. // "type": "string"
  18921. // }
  18922. // },
  18923. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
  18924. // "response": {
  18925. // "$ref": "Operation"
  18926. // },
  18927. // "scopes": [
  18928. // "https://www.googleapis.com/auth/cloud-platform",
  18929. // "https://www.googleapis.com/auth/compute"
  18930. // ]
  18931. // }
  18932. }
  18933. // method id "compute.instanceGroupManagers.deleteInstances":
  18934. type InstanceGroupManagersDeleteInstancesCall struct {
  18935. s *Service
  18936. project string
  18937. zone string
  18938. instanceGroupManager string
  18939. instancegroupmanagersdeleteinstancesrequest *InstanceGroupManagersDeleteInstancesRequest
  18940. urlParams_ gensupport.URLParams
  18941. ctx_ context.Context
  18942. }
  18943. // DeleteInstances: Schedules a group action to delete the specified
  18944. // instances in the managed instance group. The instances are also
  18945. // removed from any target pools of which they were a member. This
  18946. // method reduces the targetSize of the managed instance group by the
  18947. // number of instances that you delete. This operation is marked as DONE
  18948. // when the action is scheduled even if the instances are still being
  18949. // deleted. You must separately verify the status of the deleting action
  18950. // with the listmanagedinstances method.
  18951. func (r *InstanceGroupManagersService) DeleteInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersdeleteinstancesrequest *InstanceGroupManagersDeleteInstancesRequest) *InstanceGroupManagersDeleteInstancesCall {
  18952. c := &InstanceGroupManagersDeleteInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18953. c.project = project
  18954. c.zone = zone
  18955. c.instanceGroupManager = instanceGroupManager
  18956. c.instancegroupmanagersdeleteinstancesrequest = instancegroupmanagersdeleteinstancesrequest
  18957. return c
  18958. }
  18959. // Fields allows partial responses to be retrieved. See
  18960. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18961. // for more information.
  18962. func (c *InstanceGroupManagersDeleteInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersDeleteInstancesCall {
  18963. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18964. return c
  18965. }
  18966. // Context sets the context to be used in this call's Do method. Any
  18967. // pending HTTP request will be aborted if the provided context is
  18968. // canceled.
  18969. func (c *InstanceGroupManagersDeleteInstancesCall) Context(ctx context.Context) *InstanceGroupManagersDeleteInstancesCall {
  18970. c.ctx_ = ctx
  18971. return c
  18972. }
  18973. func (c *InstanceGroupManagersDeleteInstancesCall) doRequest(alt string) (*http.Response, error) {
  18974. var body io.Reader = nil
  18975. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersdeleteinstancesrequest)
  18976. if err != nil {
  18977. return nil, err
  18978. }
  18979. ctype := "application/json"
  18980. c.urlParams_.Set("alt", alt)
  18981. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances")
  18982. urls += "?" + c.urlParams_.Encode()
  18983. req, _ := http.NewRequest("POST", urls, body)
  18984. googleapi.Expand(req.URL, map[string]string{
  18985. "project": c.project,
  18986. "zone": c.zone,
  18987. "instanceGroupManager": c.instanceGroupManager,
  18988. })
  18989. req.Header.Set("Content-Type", ctype)
  18990. req.Header.Set("User-Agent", c.s.userAgent())
  18991. if c.ctx_ != nil {
  18992. return ctxhttp.Do(c.ctx_, c.s.client, req)
  18993. }
  18994. return c.s.client.Do(req)
  18995. }
  18996. // Do executes the "compute.instanceGroupManagers.deleteInstances" call.
  18997. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  18998. // status code is an error. Response headers are in either
  18999. // *Operation.ServerResponse.Header or (if a response was returned at
  19000. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  19001. // to check whether the returned error was because
  19002. // http.StatusNotModified was returned.
  19003. func (c *InstanceGroupManagersDeleteInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  19004. gensupport.SetOptions(c.urlParams_, opts...)
  19005. res, err := c.doRequest("json")
  19006. if res != nil && res.StatusCode == http.StatusNotModified {
  19007. if res.Body != nil {
  19008. res.Body.Close()
  19009. }
  19010. return nil, &googleapi.Error{
  19011. Code: res.StatusCode,
  19012. Header: res.Header,
  19013. }
  19014. }
  19015. if err != nil {
  19016. return nil, err
  19017. }
  19018. defer googleapi.CloseBody(res)
  19019. if err := googleapi.CheckResponse(res); err != nil {
  19020. return nil, err
  19021. }
  19022. ret := &Operation{
  19023. ServerResponse: googleapi.ServerResponse{
  19024. Header: res.Header,
  19025. HTTPStatusCode: res.StatusCode,
  19026. },
  19027. }
  19028. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  19029. return nil, err
  19030. }
  19031. return ret, nil
  19032. // {
  19033. // "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.",
  19034. // "httpMethod": "POST",
  19035. // "id": "compute.instanceGroupManagers.deleteInstances",
  19036. // "parameterOrder": [
  19037. // "project",
  19038. // "zone",
  19039. // "instanceGroupManager"
  19040. // ],
  19041. // "parameters": {
  19042. // "instanceGroupManager": {
  19043. // "description": "The name of the managed instance group.",
  19044. // "location": "path",
  19045. // "required": true,
  19046. // "type": "string"
  19047. // },
  19048. // "project": {
  19049. // "description": "Project ID for this request.",
  19050. // "location": "path",
  19051. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  19052. // "required": true,
  19053. // "type": "string"
  19054. // },
  19055. // "zone": {
  19056. // "description": "The name of the zone where the managed instance group is located.",
  19057. // "location": "path",
  19058. // "required": true,
  19059. // "type": "string"
  19060. // }
  19061. // },
  19062. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances",
  19063. // "request": {
  19064. // "$ref": "InstanceGroupManagersDeleteInstancesRequest"
  19065. // },
  19066. // "response": {
  19067. // "$ref": "Operation"
  19068. // },
  19069. // "scopes": [
  19070. // "https://www.googleapis.com/auth/cloud-platform",
  19071. // "https://www.googleapis.com/auth/compute"
  19072. // ]
  19073. // }
  19074. }
  19075. // method id "compute.instanceGroupManagers.get":
  19076. type InstanceGroupManagersGetCall struct {
  19077. s *Service
  19078. project string
  19079. zone string
  19080. instanceGroupManager string
  19081. urlParams_ gensupport.URLParams
  19082. ifNoneMatch_ string
  19083. ctx_ context.Context
  19084. }
  19085. // Get: Returns all of the details about the specified managed instance
  19086. // group.
  19087. func (r *InstanceGroupManagersService) Get(project string, zone string, instanceGroupManager string) *InstanceGroupManagersGetCall {
  19088. c := &InstanceGroupManagersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19089. c.project = project
  19090. c.zone = zone
  19091. c.instanceGroupManager = instanceGroupManager
  19092. return c
  19093. }
  19094. // Fields allows partial responses to be retrieved. See
  19095. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19096. // for more information.
  19097. func (c *InstanceGroupManagersGetCall) Fields(s ...googleapi.Field) *InstanceGroupManagersGetCall {
  19098. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19099. return c
  19100. }
  19101. // IfNoneMatch sets the optional parameter which makes the operation
  19102. // fail if the object's ETag matches the given value. This is useful for
  19103. // getting updates only after the object has changed since the last
  19104. // request. Use googleapi.IsNotModified to check whether the response
  19105. // error from Do is the result of In-None-Match.
  19106. func (c *InstanceGroupManagersGetCall) IfNoneMatch(entityTag string) *InstanceGroupManagersGetCall {
  19107. c.ifNoneMatch_ = entityTag
  19108. return c
  19109. }
  19110. // Context sets the context to be used in this call's Do method. Any
  19111. // pending HTTP request will be aborted if the provided context is
  19112. // canceled.
  19113. func (c *InstanceGroupManagersGetCall) Context(ctx context.Context) *InstanceGroupManagersGetCall {
  19114. c.ctx_ = ctx
  19115. return c
  19116. }
  19117. func (c *InstanceGroupManagersGetCall) doRequest(alt string) (*http.Response, error) {
  19118. var body io.Reader = nil
  19119. c.urlParams_.Set("alt", alt)
  19120. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
  19121. urls += "?" + c.urlParams_.Encode()
  19122. req, _ := http.NewRequest("GET", urls, body)
  19123. googleapi.Expand(req.URL, map[string]string{
  19124. "project": c.project,
  19125. "zone": c.zone,
  19126. "instanceGroupManager": c.instanceGroupManager,
  19127. })
  19128. req.Header.Set("User-Agent", c.s.userAgent())
  19129. if c.ifNoneMatch_ != "" {
  19130. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  19131. }
  19132. if c.ctx_ != nil {
  19133. return ctxhttp.Do(c.ctx_, c.s.client, req)
  19134. }
  19135. return c.s.client.Do(req)
  19136. }
  19137. // Do executes the "compute.instanceGroupManagers.get" call.
  19138. // Exactly one of *InstanceGroupManager or error will be non-nil. Any
  19139. // non-2xx status code is an error. Response headers are in either
  19140. // *InstanceGroupManager.ServerResponse.Header or (if a response was
  19141. // returned at all) in error.(*googleapi.Error).Header. Use
  19142. // googleapi.IsNotModified to check whether the returned error was
  19143. // because http.StatusNotModified was returned.
  19144. func (c *InstanceGroupManagersGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManager, error) {
  19145. gensupport.SetOptions(c.urlParams_, opts...)
  19146. res, err := c.doRequest("json")
  19147. if res != nil && res.StatusCode == http.StatusNotModified {
  19148. if res.Body != nil {
  19149. res.Body.Close()
  19150. }
  19151. return nil, &googleapi.Error{
  19152. Code: res.StatusCode,
  19153. Header: res.Header,
  19154. }
  19155. }
  19156. if err != nil {
  19157. return nil, err
  19158. }
  19159. defer googleapi.CloseBody(res)
  19160. if err := googleapi.CheckResponse(res); err != nil {
  19161. return nil, err
  19162. }
  19163. ret := &InstanceGroupManager{
  19164. ServerResponse: googleapi.ServerResponse{
  19165. Header: res.Header,
  19166. HTTPStatusCode: res.StatusCode,
  19167. },
  19168. }
  19169. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  19170. return nil, err
  19171. }
  19172. return ret, nil
  19173. // {
  19174. // "description": "Returns all of the details about the specified managed instance group.",
  19175. // "httpMethod": "GET",
  19176. // "id": "compute.instanceGroupManagers.get",
  19177. // "parameterOrder": [
  19178. // "project",
  19179. // "zone",
  19180. // "instanceGroupManager"
  19181. // ],
  19182. // "parameters": {
  19183. // "instanceGroupManager": {
  19184. // "description": "The name of the managed instance group.",
  19185. // "location": "path",
  19186. // "required": true,
  19187. // "type": "string"
  19188. // },
  19189. // "project": {
  19190. // "description": "Project ID for this request.",
  19191. // "location": "path",
  19192. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  19193. // "required": true,
  19194. // "type": "string"
  19195. // },
  19196. // "zone": {
  19197. // "description": "The name of the zone where the managed instance group is located.",
  19198. // "location": "path",
  19199. // "required": true,
  19200. // "type": "string"
  19201. // }
  19202. // },
  19203. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
  19204. // "response": {
  19205. // "$ref": "InstanceGroupManager"
  19206. // },
  19207. // "scopes": [
  19208. // "https://www.googleapis.com/auth/cloud-platform",
  19209. // "https://www.googleapis.com/auth/compute",
  19210. // "https://www.googleapis.com/auth/compute.readonly"
  19211. // ]
  19212. // }
  19213. }
  19214. // method id "compute.instanceGroupManagers.insert":
  19215. type InstanceGroupManagersInsertCall struct {
  19216. s *Service
  19217. project string
  19218. zone string
  19219. instancegroupmanager *InstanceGroupManager
  19220. urlParams_ gensupport.URLParams
  19221. ctx_ context.Context
  19222. }
  19223. // Insert: Creates a managed instance group using the information that
  19224. // you specify in the request. After the group is created, it schedules
  19225. // an action to create instances in the group using the specified
  19226. // instance template. This operation is marked as DONE when the group is
  19227. // created even if the instances in the group have not yet been created.
  19228. // You must separately verify the status of the individual instances
  19229. // with the listmanagedinstances method.
  19230. func (r *InstanceGroupManagersService) Insert(project string, zone string, instancegroupmanager *InstanceGroupManager) *InstanceGroupManagersInsertCall {
  19231. c := &InstanceGroupManagersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19232. c.project = project
  19233. c.zone = zone
  19234. c.instancegroupmanager = instancegroupmanager
  19235. return c
  19236. }
  19237. // Fields allows partial responses to be retrieved. See
  19238. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19239. // for more information.
  19240. func (c *InstanceGroupManagersInsertCall) Fields(s ...googleapi.Field) *InstanceGroupManagersInsertCall {
  19241. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19242. return c
  19243. }
  19244. // Context sets the context to be used in this call's Do method. Any
  19245. // pending HTTP request will be aborted if the provided context is
  19246. // canceled.
  19247. func (c *InstanceGroupManagersInsertCall) Context(ctx context.Context) *InstanceGroupManagersInsertCall {
  19248. c.ctx_ = ctx
  19249. return c
  19250. }
  19251. func (c *InstanceGroupManagersInsertCall) doRequest(alt string) (*http.Response, error) {
  19252. var body io.Reader = nil
  19253. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  19254. if err != nil {
  19255. return nil, err
  19256. }
  19257. ctype := "application/json"
  19258. c.urlParams_.Set("alt", alt)
  19259. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers")
  19260. urls += "?" + c.urlParams_.Encode()
  19261. req, _ := http.NewRequest("POST", urls, body)
  19262. googleapi.Expand(req.URL, map[string]string{
  19263. "project": c.project,
  19264. "zone": c.zone,
  19265. })
  19266. req.Header.Set("Content-Type", ctype)
  19267. req.Header.Set("User-Agent", c.s.userAgent())
  19268. if c.ctx_ != nil {
  19269. return ctxhttp.Do(c.ctx_, c.s.client, req)
  19270. }
  19271. return c.s.client.Do(req)
  19272. }
  19273. // Do executes the "compute.instanceGroupManagers.insert" call.
  19274. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  19275. // status code is an error. Response headers are in either
  19276. // *Operation.ServerResponse.Header or (if a response was returned at
  19277. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  19278. // to check whether the returned error was because
  19279. // http.StatusNotModified was returned.
  19280. func (c *InstanceGroupManagersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  19281. gensupport.SetOptions(c.urlParams_, opts...)
  19282. res, err := c.doRequest("json")
  19283. if res != nil && res.StatusCode == http.StatusNotModified {
  19284. if res.Body != nil {
  19285. res.Body.Close()
  19286. }
  19287. return nil, &googleapi.Error{
  19288. Code: res.StatusCode,
  19289. Header: res.Header,
  19290. }
  19291. }
  19292. if err != nil {
  19293. return nil, err
  19294. }
  19295. defer googleapi.CloseBody(res)
  19296. if err := googleapi.CheckResponse(res); err != nil {
  19297. return nil, err
  19298. }
  19299. ret := &Operation{
  19300. ServerResponse: googleapi.ServerResponse{
  19301. Header: res.Header,
  19302. HTTPStatusCode: res.StatusCode,
  19303. },
  19304. }
  19305. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  19306. return nil, err
  19307. }
  19308. return ret, nil
  19309. // {
  19310. // "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.",
  19311. // "httpMethod": "POST",
  19312. // "id": "compute.instanceGroupManagers.insert",
  19313. // "parameterOrder": [
  19314. // "project",
  19315. // "zone"
  19316. // ],
  19317. // "parameters": {
  19318. // "project": {
  19319. // "description": "Project ID for this request.",
  19320. // "location": "path",
  19321. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  19322. // "required": true,
  19323. // "type": "string"
  19324. // },
  19325. // "zone": {
  19326. // "description": "The name of the zone where you want to create the managed instance group.",
  19327. // "location": "path",
  19328. // "required": true,
  19329. // "type": "string"
  19330. // }
  19331. // },
  19332. // "path": "{project}/zones/{zone}/instanceGroupManagers",
  19333. // "request": {
  19334. // "$ref": "InstanceGroupManager"
  19335. // },
  19336. // "response": {
  19337. // "$ref": "Operation"
  19338. // },
  19339. // "scopes": [
  19340. // "https://www.googleapis.com/auth/cloud-platform",
  19341. // "https://www.googleapis.com/auth/compute"
  19342. // ]
  19343. // }
  19344. }
  19345. // method id "compute.instanceGroupManagers.list":
  19346. type InstanceGroupManagersListCall struct {
  19347. s *Service
  19348. project string
  19349. zone string
  19350. urlParams_ gensupport.URLParams
  19351. ifNoneMatch_ string
  19352. ctx_ context.Context
  19353. }
  19354. // List: Retrieves a list of managed instance groups that are contained
  19355. // within the specified project and zone.
  19356. func (r *InstanceGroupManagersService) List(project string, zone string) *InstanceGroupManagersListCall {
  19357. c := &InstanceGroupManagersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19358. c.project = project
  19359. c.zone = zone
  19360. return c
  19361. }
  19362. // Filter sets the optional parameter "filter": Sets a filter expression
  19363. // for filtering listed resources, in the form filter={expression}. Your
  19364. // {expression} must be in the format: field_name comparison_string
  19365. // literal_string.
  19366. //
  19367. // The field_name is the name of the field you want to compare. Only
  19368. // atomic field types are supported (string, number, boolean). The
  19369. // comparison_string must be either eq (equals) or ne (not equals). The
  19370. // literal_string is the string value to filter to. The literal value
  19371. // must be valid for the type of field you are filtering by (string,
  19372. // number, boolean). For string fields, the literal value is interpreted
  19373. // as a regular expression using RE2 syntax. The literal value must
  19374. // match the entire field.
  19375. //
  19376. // For example, filter=name ne example-instance.
  19377. //
  19378. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  19379. // you can also filter on nested fields. For example, you could filter
  19380. // on instances that have set the scheduling.automaticRestart field to
  19381. // true. In particular, use filtering on nested fields to take advantage
  19382. // of instance labels to organize and filter results based on label
  19383. // values.
  19384. //
  19385. // The Beta API also supports filtering on multiple expressions by
  19386. // providing each separate expression within parentheses. For example,
  19387. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  19388. // Multiple expressions are treated as AND expressions meaning that
  19389. // resources must match all expressions to pass the filters.
  19390. func (c *InstanceGroupManagersListCall) Filter(filter string) *InstanceGroupManagersListCall {
  19391. c.urlParams_.Set("filter", filter)
  19392. return c
  19393. }
  19394. // MaxResults sets the optional parameter "maxResults": The maximum
  19395. // number of results per page that Compute Engine should return. If the
  19396. // number of available results is larger than maxResults, Compute Engine
  19397. // returns a nextPageToken that can be used to get the next page of
  19398. // results in subsequent list requests.
  19399. func (c *InstanceGroupManagersListCall) MaxResults(maxResults int64) *InstanceGroupManagersListCall {
  19400. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  19401. return c
  19402. }
  19403. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  19404. // a certain order. By default, results are returned in alphanumerical
  19405. // order based on the resource name.
  19406. //
  19407. // You can also sort results in descending order based on the creation
  19408. // timestamp using orderBy="creationTimestamp desc". This sorts results
  19409. // based on the creationTimestamp field in reverse chronological order
  19410. // (newest result first). Use this to sort resources like operations so
  19411. // that the newest operation is returned first.
  19412. //
  19413. // Currently, only sorting by name or creationTimestamp desc is
  19414. // supported.
  19415. func (c *InstanceGroupManagersListCall) OrderBy(orderBy string) *InstanceGroupManagersListCall {
  19416. c.urlParams_.Set("orderBy", orderBy)
  19417. return c
  19418. }
  19419. // PageToken sets the optional parameter "pageToken": Specifies a page
  19420. // token to use. Set pageToken to the nextPageToken returned by a
  19421. // previous list request to get the next page of results.
  19422. func (c *InstanceGroupManagersListCall) PageToken(pageToken string) *InstanceGroupManagersListCall {
  19423. c.urlParams_.Set("pageToken", pageToken)
  19424. return c
  19425. }
  19426. // Fields allows partial responses to be retrieved. See
  19427. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19428. // for more information.
  19429. func (c *InstanceGroupManagersListCall) Fields(s ...googleapi.Field) *InstanceGroupManagersListCall {
  19430. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19431. return c
  19432. }
  19433. // IfNoneMatch sets the optional parameter which makes the operation
  19434. // fail if the object's ETag matches the given value. This is useful for
  19435. // getting updates only after the object has changed since the last
  19436. // request. Use googleapi.IsNotModified to check whether the response
  19437. // error from Do is the result of In-None-Match.
  19438. func (c *InstanceGroupManagersListCall) IfNoneMatch(entityTag string) *InstanceGroupManagersListCall {
  19439. c.ifNoneMatch_ = entityTag
  19440. return c
  19441. }
  19442. // Context sets the context to be used in this call's Do method. Any
  19443. // pending HTTP request will be aborted if the provided context is
  19444. // canceled.
  19445. func (c *InstanceGroupManagersListCall) Context(ctx context.Context) *InstanceGroupManagersListCall {
  19446. c.ctx_ = ctx
  19447. return c
  19448. }
  19449. func (c *InstanceGroupManagersListCall) doRequest(alt string) (*http.Response, error) {
  19450. var body io.Reader = nil
  19451. c.urlParams_.Set("alt", alt)
  19452. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers")
  19453. urls += "?" + c.urlParams_.Encode()
  19454. req, _ := http.NewRequest("GET", urls, body)
  19455. googleapi.Expand(req.URL, map[string]string{
  19456. "project": c.project,
  19457. "zone": c.zone,
  19458. })
  19459. req.Header.Set("User-Agent", c.s.userAgent())
  19460. if c.ifNoneMatch_ != "" {
  19461. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  19462. }
  19463. if c.ctx_ != nil {
  19464. return ctxhttp.Do(c.ctx_, c.s.client, req)
  19465. }
  19466. return c.s.client.Do(req)
  19467. }
  19468. // Do executes the "compute.instanceGroupManagers.list" call.
  19469. // Exactly one of *InstanceGroupManagerList or error will be non-nil.
  19470. // Any non-2xx status code is an error. Response headers are in either
  19471. // *InstanceGroupManagerList.ServerResponse.Header or (if a response was
  19472. // returned at all) in error.(*googleapi.Error).Header. Use
  19473. // googleapi.IsNotModified to check whether the returned error was
  19474. // because http.StatusNotModified was returned.
  19475. func (c *InstanceGroupManagersListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagerList, error) {
  19476. gensupport.SetOptions(c.urlParams_, opts...)
  19477. res, err := c.doRequest("json")
  19478. if res != nil && res.StatusCode == http.StatusNotModified {
  19479. if res.Body != nil {
  19480. res.Body.Close()
  19481. }
  19482. return nil, &googleapi.Error{
  19483. Code: res.StatusCode,
  19484. Header: res.Header,
  19485. }
  19486. }
  19487. if err != nil {
  19488. return nil, err
  19489. }
  19490. defer googleapi.CloseBody(res)
  19491. if err := googleapi.CheckResponse(res); err != nil {
  19492. return nil, err
  19493. }
  19494. ret := &InstanceGroupManagerList{
  19495. ServerResponse: googleapi.ServerResponse{
  19496. Header: res.Header,
  19497. HTTPStatusCode: res.StatusCode,
  19498. },
  19499. }
  19500. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  19501. return nil, err
  19502. }
  19503. return ret, nil
  19504. // {
  19505. // "description": "Retrieves a list of managed instance groups that are contained within the specified project and zone.",
  19506. // "httpMethod": "GET",
  19507. // "id": "compute.instanceGroupManagers.list",
  19508. // "parameterOrder": [
  19509. // "project",
  19510. // "zone"
  19511. // ],
  19512. // "parameters": {
  19513. // "filter": {
  19514. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  19515. // "location": "query",
  19516. // "type": "string"
  19517. // },
  19518. // "maxResults": {
  19519. // "default": "500",
  19520. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  19521. // "format": "uint32",
  19522. // "location": "query",
  19523. // "maximum": "500",
  19524. // "minimum": "0",
  19525. // "type": "integer"
  19526. // },
  19527. // "orderBy": {
  19528. // "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.",
  19529. // "location": "query",
  19530. // "type": "string"
  19531. // },
  19532. // "pageToken": {
  19533. // "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.",
  19534. // "location": "query",
  19535. // "type": "string"
  19536. // },
  19537. // "project": {
  19538. // "description": "Project ID for this request.",
  19539. // "location": "path",
  19540. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  19541. // "required": true,
  19542. // "type": "string"
  19543. // },
  19544. // "zone": {
  19545. // "description": "The name of the zone where the managed instance group is located.",
  19546. // "location": "path",
  19547. // "required": true,
  19548. // "type": "string"
  19549. // }
  19550. // },
  19551. // "path": "{project}/zones/{zone}/instanceGroupManagers",
  19552. // "response": {
  19553. // "$ref": "InstanceGroupManagerList"
  19554. // },
  19555. // "scopes": [
  19556. // "https://www.googleapis.com/auth/cloud-platform",
  19557. // "https://www.googleapis.com/auth/compute",
  19558. // "https://www.googleapis.com/auth/compute.readonly"
  19559. // ]
  19560. // }
  19561. }
  19562. // Pages invokes f for each page of results.
  19563. // A non-nil error returned from f will halt the iteration.
  19564. // The provided context supersedes any context provided to the Context method.
  19565. func (c *InstanceGroupManagersListCall) Pages(ctx context.Context, f func(*InstanceGroupManagerList) error) error {
  19566. c.ctx_ = ctx
  19567. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  19568. for {
  19569. x, err := c.Do()
  19570. if err != nil {
  19571. return err
  19572. }
  19573. if err := f(x); err != nil {
  19574. return err
  19575. }
  19576. if x.NextPageToken == "" {
  19577. return nil
  19578. }
  19579. c.PageToken(x.NextPageToken)
  19580. }
  19581. }
  19582. // method id "compute.instanceGroupManagers.listManagedInstances":
  19583. type InstanceGroupManagersListManagedInstancesCall struct {
  19584. s *Service
  19585. project string
  19586. zone string
  19587. instanceGroupManager string
  19588. urlParams_ gensupport.URLParams
  19589. ctx_ context.Context
  19590. }
  19591. // ListManagedInstances: Lists all of the instances in the managed
  19592. // instance group. Each instance in the list has a currentAction, which
  19593. // indicates the action that the managed instance group is performing on
  19594. // the instance. For example, if the group is still creating an
  19595. // instance, the currentAction is CREATING. If a previous action failed,
  19596. // the list displays the errors for that failed action.
  19597. func (r *InstanceGroupManagersService) ListManagedInstances(project string, zone string, instanceGroupManager string) *InstanceGroupManagersListManagedInstancesCall {
  19598. c := &InstanceGroupManagersListManagedInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19599. c.project = project
  19600. c.zone = zone
  19601. c.instanceGroupManager = instanceGroupManager
  19602. return c
  19603. }
  19604. // Fields allows partial responses to be retrieved. See
  19605. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19606. // for more information.
  19607. func (c *InstanceGroupManagersListManagedInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersListManagedInstancesCall {
  19608. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19609. return c
  19610. }
  19611. // Context sets the context to be used in this call's Do method. Any
  19612. // pending HTTP request will be aborted if the provided context is
  19613. // canceled.
  19614. func (c *InstanceGroupManagersListManagedInstancesCall) Context(ctx context.Context) *InstanceGroupManagersListManagedInstancesCall {
  19615. c.ctx_ = ctx
  19616. return c
  19617. }
  19618. func (c *InstanceGroupManagersListManagedInstancesCall) doRequest(alt string) (*http.Response, error) {
  19619. var body io.Reader = nil
  19620. c.urlParams_.Set("alt", alt)
  19621. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances")
  19622. urls += "?" + c.urlParams_.Encode()
  19623. req, _ := http.NewRequest("POST", urls, body)
  19624. googleapi.Expand(req.URL, map[string]string{
  19625. "project": c.project,
  19626. "zone": c.zone,
  19627. "instanceGroupManager": c.instanceGroupManager,
  19628. })
  19629. req.Header.Set("User-Agent", c.s.userAgent())
  19630. if c.ctx_ != nil {
  19631. return ctxhttp.Do(c.ctx_, c.s.client, req)
  19632. }
  19633. return c.s.client.Do(req)
  19634. }
  19635. // Do executes the "compute.instanceGroupManagers.listManagedInstances" call.
  19636. // Exactly one of *InstanceGroupManagersListManagedInstancesResponse or
  19637. // error will be non-nil. Any non-2xx status code is an error. Response
  19638. // headers are in either
  19639. // *InstanceGroupManagersListManagedInstancesResponse.ServerResponse.Head
  19640. // er or (if a response was returned at all) in
  19641. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  19642. // whether the returned error was because http.StatusNotModified was
  19643. // returned.
  19644. func (c *InstanceGroupManagersListManagedInstancesCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagersListManagedInstancesResponse, error) {
  19645. gensupport.SetOptions(c.urlParams_, opts...)
  19646. res, err := c.doRequest("json")
  19647. if res != nil && res.StatusCode == http.StatusNotModified {
  19648. if res.Body != nil {
  19649. res.Body.Close()
  19650. }
  19651. return nil, &googleapi.Error{
  19652. Code: res.StatusCode,
  19653. Header: res.Header,
  19654. }
  19655. }
  19656. if err != nil {
  19657. return nil, err
  19658. }
  19659. defer googleapi.CloseBody(res)
  19660. if err := googleapi.CheckResponse(res); err != nil {
  19661. return nil, err
  19662. }
  19663. ret := &InstanceGroupManagersListManagedInstancesResponse{
  19664. ServerResponse: googleapi.ServerResponse{
  19665. Header: res.Header,
  19666. HTTPStatusCode: res.StatusCode,
  19667. },
  19668. }
  19669. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  19670. return nil, err
  19671. }
  19672. return ret, nil
  19673. // {
  19674. // "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.",
  19675. // "httpMethod": "POST",
  19676. // "id": "compute.instanceGroupManagers.listManagedInstances",
  19677. // "parameterOrder": [
  19678. // "project",
  19679. // "zone",
  19680. // "instanceGroupManager"
  19681. // ],
  19682. // "parameters": {
  19683. // "instanceGroupManager": {
  19684. // "description": "The name of the managed instance group.",
  19685. // "location": "path",
  19686. // "required": true,
  19687. // "type": "string"
  19688. // },
  19689. // "project": {
  19690. // "description": "Project ID for this request.",
  19691. // "location": "path",
  19692. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  19693. // "required": true,
  19694. // "type": "string"
  19695. // },
  19696. // "zone": {
  19697. // "description": "The name of the zone where the managed instance group is located.",
  19698. // "location": "path",
  19699. // "required": true,
  19700. // "type": "string"
  19701. // }
  19702. // },
  19703. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances",
  19704. // "response": {
  19705. // "$ref": "InstanceGroupManagersListManagedInstancesResponse"
  19706. // },
  19707. // "scopes": [
  19708. // "https://www.googleapis.com/auth/cloud-platform",
  19709. // "https://www.googleapis.com/auth/compute",
  19710. // "https://www.googleapis.com/auth/compute.readonly"
  19711. // ]
  19712. // }
  19713. }
  19714. // method id "compute.instanceGroupManagers.recreateInstances":
  19715. type InstanceGroupManagersRecreateInstancesCall struct {
  19716. s *Service
  19717. project string
  19718. zone string
  19719. instanceGroupManager string
  19720. instancegroupmanagersrecreateinstancesrequest *InstanceGroupManagersRecreateInstancesRequest
  19721. urlParams_ gensupport.URLParams
  19722. ctx_ context.Context
  19723. }
  19724. // RecreateInstances: Schedules a group action to recreate the specified
  19725. // instances in the managed instance group. The instances are deleted
  19726. // and recreated using the current instance template for the managed
  19727. // instance group. This operation is marked as DONE when the action is
  19728. // scheduled even if the instances have not yet been recreated. You must
  19729. // separately verify the status of the recreating action with the
  19730. // listmanagedinstances method.
  19731. func (r *InstanceGroupManagersService) RecreateInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersrecreateinstancesrequest *InstanceGroupManagersRecreateInstancesRequest) *InstanceGroupManagersRecreateInstancesCall {
  19732. c := &InstanceGroupManagersRecreateInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19733. c.project = project
  19734. c.zone = zone
  19735. c.instanceGroupManager = instanceGroupManager
  19736. c.instancegroupmanagersrecreateinstancesrequest = instancegroupmanagersrecreateinstancesrequest
  19737. return c
  19738. }
  19739. // Fields allows partial responses to be retrieved. See
  19740. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19741. // for more information.
  19742. func (c *InstanceGroupManagersRecreateInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersRecreateInstancesCall {
  19743. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19744. return c
  19745. }
  19746. // Context sets the context to be used in this call's Do method. Any
  19747. // pending HTTP request will be aborted if the provided context is
  19748. // canceled.
  19749. func (c *InstanceGroupManagersRecreateInstancesCall) Context(ctx context.Context) *InstanceGroupManagersRecreateInstancesCall {
  19750. c.ctx_ = ctx
  19751. return c
  19752. }
  19753. func (c *InstanceGroupManagersRecreateInstancesCall) doRequest(alt string) (*http.Response, error) {
  19754. var body io.Reader = nil
  19755. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersrecreateinstancesrequest)
  19756. if err != nil {
  19757. return nil, err
  19758. }
  19759. ctype := "application/json"
  19760. c.urlParams_.Set("alt", alt)
  19761. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances")
  19762. urls += "?" + c.urlParams_.Encode()
  19763. req, _ := http.NewRequest("POST", urls, body)
  19764. googleapi.Expand(req.URL, map[string]string{
  19765. "project": c.project,
  19766. "zone": c.zone,
  19767. "instanceGroupManager": c.instanceGroupManager,
  19768. })
  19769. req.Header.Set("Content-Type", ctype)
  19770. req.Header.Set("User-Agent", c.s.userAgent())
  19771. if c.ctx_ != nil {
  19772. return ctxhttp.Do(c.ctx_, c.s.client, req)
  19773. }
  19774. return c.s.client.Do(req)
  19775. }
  19776. // Do executes the "compute.instanceGroupManagers.recreateInstances" call.
  19777. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  19778. // status code is an error. Response headers are in either
  19779. // *Operation.ServerResponse.Header or (if a response was returned at
  19780. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  19781. // to check whether the returned error was because
  19782. // http.StatusNotModified was returned.
  19783. func (c *InstanceGroupManagersRecreateInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  19784. gensupport.SetOptions(c.urlParams_, opts...)
  19785. res, err := c.doRequest("json")
  19786. if res != nil && res.StatusCode == http.StatusNotModified {
  19787. if res.Body != nil {
  19788. res.Body.Close()
  19789. }
  19790. return nil, &googleapi.Error{
  19791. Code: res.StatusCode,
  19792. Header: res.Header,
  19793. }
  19794. }
  19795. if err != nil {
  19796. return nil, err
  19797. }
  19798. defer googleapi.CloseBody(res)
  19799. if err := googleapi.CheckResponse(res); err != nil {
  19800. return nil, err
  19801. }
  19802. ret := &Operation{
  19803. ServerResponse: googleapi.ServerResponse{
  19804. Header: res.Header,
  19805. HTTPStatusCode: res.StatusCode,
  19806. },
  19807. }
  19808. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  19809. return nil, err
  19810. }
  19811. return ret, nil
  19812. // {
  19813. // "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.",
  19814. // "httpMethod": "POST",
  19815. // "id": "compute.instanceGroupManagers.recreateInstances",
  19816. // "parameterOrder": [
  19817. // "project",
  19818. // "zone",
  19819. // "instanceGroupManager"
  19820. // ],
  19821. // "parameters": {
  19822. // "instanceGroupManager": {
  19823. // "description": "The name of the managed instance group.",
  19824. // "location": "path",
  19825. // "required": true,
  19826. // "type": "string"
  19827. // },
  19828. // "project": {
  19829. // "description": "Project ID for this request.",
  19830. // "location": "path",
  19831. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  19832. // "required": true,
  19833. // "type": "string"
  19834. // },
  19835. // "zone": {
  19836. // "description": "The name of the zone where the managed instance group is located.",
  19837. // "location": "path",
  19838. // "required": true,
  19839. // "type": "string"
  19840. // }
  19841. // },
  19842. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances",
  19843. // "request": {
  19844. // "$ref": "InstanceGroupManagersRecreateInstancesRequest"
  19845. // },
  19846. // "response": {
  19847. // "$ref": "Operation"
  19848. // },
  19849. // "scopes": [
  19850. // "https://www.googleapis.com/auth/cloud-platform",
  19851. // "https://www.googleapis.com/auth/compute"
  19852. // ]
  19853. // }
  19854. }
  19855. // method id "compute.instanceGroupManagers.resize":
  19856. type InstanceGroupManagersResizeCall struct {
  19857. s *Service
  19858. project string
  19859. zone string
  19860. instanceGroupManager string
  19861. urlParams_ gensupport.URLParams
  19862. ctx_ context.Context
  19863. }
  19864. // Resize: Resizes the managed instance group. If you increase the size,
  19865. // the group creates new instances using the current instance template.
  19866. // If you decrease the size, the group deletes instances. The resize
  19867. // operation is marked DONE when the resize actions are scheduled even
  19868. // if the group has not yet added or deleted any instances. You must
  19869. // separately verify the status of the creating or deleting actions with
  19870. // the listmanagedinstances method.
  19871. func (r *InstanceGroupManagersService) Resize(project string, zone string, instanceGroupManager string, size int64) *InstanceGroupManagersResizeCall {
  19872. c := &InstanceGroupManagersResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19873. c.project = project
  19874. c.zone = zone
  19875. c.instanceGroupManager = instanceGroupManager
  19876. c.urlParams_.Set("size", fmt.Sprint(size))
  19877. return c
  19878. }
  19879. // Fields allows partial responses to be retrieved. See
  19880. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19881. // for more information.
  19882. func (c *InstanceGroupManagersResizeCall) Fields(s ...googleapi.Field) *InstanceGroupManagersResizeCall {
  19883. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19884. return c
  19885. }
  19886. // Context sets the context to be used in this call's Do method. Any
  19887. // pending HTTP request will be aborted if the provided context is
  19888. // canceled.
  19889. func (c *InstanceGroupManagersResizeCall) Context(ctx context.Context) *InstanceGroupManagersResizeCall {
  19890. c.ctx_ = ctx
  19891. return c
  19892. }
  19893. func (c *InstanceGroupManagersResizeCall) doRequest(alt string) (*http.Response, error) {
  19894. var body io.Reader = nil
  19895. c.urlParams_.Set("alt", alt)
  19896. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize")
  19897. urls += "?" + c.urlParams_.Encode()
  19898. req, _ := http.NewRequest("POST", urls, body)
  19899. googleapi.Expand(req.URL, map[string]string{
  19900. "project": c.project,
  19901. "zone": c.zone,
  19902. "instanceGroupManager": c.instanceGroupManager,
  19903. })
  19904. req.Header.Set("User-Agent", c.s.userAgent())
  19905. if c.ctx_ != nil {
  19906. return ctxhttp.Do(c.ctx_, c.s.client, req)
  19907. }
  19908. return c.s.client.Do(req)
  19909. }
  19910. // Do executes the "compute.instanceGroupManagers.resize" call.
  19911. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  19912. // status code is an error. Response headers are in either
  19913. // *Operation.ServerResponse.Header or (if a response was returned at
  19914. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  19915. // to check whether the returned error was because
  19916. // http.StatusNotModified was returned.
  19917. func (c *InstanceGroupManagersResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  19918. gensupport.SetOptions(c.urlParams_, opts...)
  19919. res, err := c.doRequest("json")
  19920. if res != nil && res.StatusCode == http.StatusNotModified {
  19921. if res.Body != nil {
  19922. res.Body.Close()
  19923. }
  19924. return nil, &googleapi.Error{
  19925. Code: res.StatusCode,
  19926. Header: res.Header,
  19927. }
  19928. }
  19929. if err != nil {
  19930. return nil, err
  19931. }
  19932. defer googleapi.CloseBody(res)
  19933. if err := googleapi.CheckResponse(res); err != nil {
  19934. return nil, err
  19935. }
  19936. ret := &Operation{
  19937. ServerResponse: googleapi.ServerResponse{
  19938. Header: res.Header,
  19939. HTTPStatusCode: res.StatusCode,
  19940. },
  19941. }
  19942. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  19943. return nil, err
  19944. }
  19945. return ret, nil
  19946. // {
  19947. // "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.",
  19948. // "httpMethod": "POST",
  19949. // "id": "compute.instanceGroupManagers.resize",
  19950. // "parameterOrder": [
  19951. // "project",
  19952. // "zone",
  19953. // "instanceGroupManager",
  19954. // "size"
  19955. // ],
  19956. // "parameters": {
  19957. // "instanceGroupManager": {
  19958. // "description": "The name of the managed instance group.",
  19959. // "location": "path",
  19960. // "required": true,
  19961. // "type": "string"
  19962. // },
  19963. // "project": {
  19964. // "description": "Project ID for this request.",
  19965. // "location": "path",
  19966. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  19967. // "required": true,
  19968. // "type": "string"
  19969. // },
  19970. // "size": {
  19971. // "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.",
  19972. // "format": "int32",
  19973. // "location": "query",
  19974. // "required": true,
  19975. // "type": "integer"
  19976. // },
  19977. // "zone": {
  19978. // "description": "The name of the zone where the managed instance group is located.",
  19979. // "location": "path",
  19980. // "required": true,
  19981. // "type": "string"
  19982. // }
  19983. // },
  19984. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize",
  19985. // "response": {
  19986. // "$ref": "Operation"
  19987. // },
  19988. // "scopes": [
  19989. // "https://www.googleapis.com/auth/cloud-platform",
  19990. // "https://www.googleapis.com/auth/compute"
  19991. // ]
  19992. // }
  19993. }
  19994. // method id "compute.instanceGroupManagers.setAutoHealingPolicies":
  19995. type InstanceGroupManagersSetAutoHealingPoliciesCall struct {
  19996. s *Service
  19997. project string
  19998. zone string
  19999. instanceGroupManager string
  20000. instancegroupmanagerssetautohealingrequest *InstanceGroupManagersSetAutoHealingRequest
  20001. urlParams_ gensupport.URLParams
  20002. ctx_ context.Context
  20003. }
  20004. // SetAutoHealingPolicies: Modifies the autohealing policies.
  20005. func (r *InstanceGroupManagersService) SetAutoHealingPolicies(project string, zone string, instanceGroupManager string, instancegroupmanagerssetautohealingrequest *InstanceGroupManagersSetAutoHealingRequest) *InstanceGroupManagersSetAutoHealingPoliciesCall {
  20006. c := &InstanceGroupManagersSetAutoHealingPoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20007. c.project = project
  20008. c.zone = zone
  20009. c.instanceGroupManager = instanceGroupManager
  20010. c.instancegroupmanagerssetautohealingrequest = instancegroupmanagerssetautohealingrequest
  20011. return c
  20012. }
  20013. // Fields allows partial responses to be retrieved. See
  20014. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20015. // for more information.
  20016. func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetAutoHealingPoliciesCall {
  20017. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20018. return c
  20019. }
  20020. // Context sets the context to be used in this call's Do method. Any
  20021. // pending HTTP request will be aborted if the provided context is
  20022. // canceled.
  20023. func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) Context(ctx context.Context) *InstanceGroupManagersSetAutoHealingPoliciesCall {
  20024. c.ctx_ = ctx
  20025. return c
  20026. }
  20027. func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) doRequest(alt string) (*http.Response, error) {
  20028. var body io.Reader = nil
  20029. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssetautohealingrequest)
  20030. if err != nil {
  20031. return nil, err
  20032. }
  20033. ctype := "application/json"
  20034. c.urlParams_.Set("alt", alt)
  20035. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setAutoHealingPolicies")
  20036. urls += "?" + c.urlParams_.Encode()
  20037. req, _ := http.NewRequest("POST", urls, body)
  20038. googleapi.Expand(req.URL, map[string]string{
  20039. "project": c.project,
  20040. "zone": c.zone,
  20041. "instanceGroupManager": c.instanceGroupManager,
  20042. })
  20043. req.Header.Set("Content-Type", ctype)
  20044. req.Header.Set("User-Agent", c.s.userAgent())
  20045. if c.ctx_ != nil {
  20046. return ctxhttp.Do(c.ctx_, c.s.client, req)
  20047. }
  20048. return c.s.client.Do(req)
  20049. }
  20050. // Do executes the "compute.instanceGroupManagers.setAutoHealingPolicies" call.
  20051. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  20052. // status code is an error. Response headers are in either
  20053. // *Operation.ServerResponse.Header or (if a response was returned at
  20054. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  20055. // to check whether the returned error was because
  20056. // http.StatusNotModified was returned.
  20057. func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  20058. gensupport.SetOptions(c.urlParams_, opts...)
  20059. res, err := c.doRequest("json")
  20060. if res != nil && res.StatusCode == http.StatusNotModified {
  20061. if res.Body != nil {
  20062. res.Body.Close()
  20063. }
  20064. return nil, &googleapi.Error{
  20065. Code: res.StatusCode,
  20066. Header: res.Header,
  20067. }
  20068. }
  20069. if err != nil {
  20070. return nil, err
  20071. }
  20072. defer googleapi.CloseBody(res)
  20073. if err := googleapi.CheckResponse(res); err != nil {
  20074. return nil, err
  20075. }
  20076. ret := &Operation{
  20077. ServerResponse: googleapi.ServerResponse{
  20078. Header: res.Header,
  20079. HTTPStatusCode: res.StatusCode,
  20080. },
  20081. }
  20082. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  20083. return nil, err
  20084. }
  20085. return ret, nil
  20086. // {
  20087. // "description": "Modifies the autohealing policies.",
  20088. // "httpMethod": "POST",
  20089. // "id": "compute.instanceGroupManagers.setAutoHealingPolicies",
  20090. // "parameterOrder": [
  20091. // "project",
  20092. // "zone",
  20093. // "instanceGroupManager"
  20094. // ],
  20095. // "parameters": {
  20096. // "instanceGroupManager": {
  20097. // "description": "The name of the instance group manager.",
  20098. // "location": "path",
  20099. // "required": true,
  20100. // "type": "string"
  20101. // },
  20102. // "project": {
  20103. // "description": "Project ID for this request.",
  20104. // "location": "path",
  20105. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  20106. // "required": true,
  20107. // "type": "string"
  20108. // },
  20109. // "zone": {
  20110. // "description": "The URL of the zone where the managed instance group is located.",
  20111. // "location": "path",
  20112. // "required": true,
  20113. // "type": "string"
  20114. // }
  20115. // },
  20116. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setAutoHealingPolicies",
  20117. // "request": {
  20118. // "$ref": "InstanceGroupManagersSetAutoHealingRequest"
  20119. // },
  20120. // "response": {
  20121. // "$ref": "Operation"
  20122. // },
  20123. // "scopes": [
  20124. // "https://www.googleapis.com/auth/cloud-platform",
  20125. // "https://www.googleapis.com/auth/compute"
  20126. // ]
  20127. // }
  20128. }
  20129. // method id "compute.instanceGroupManagers.setInstanceTemplate":
  20130. type InstanceGroupManagersSetInstanceTemplateCall struct {
  20131. s *Service
  20132. project string
  20133. zone string
  20134. instanceGroupManager string
  20135. instancegroupmanagerssetinstancetemplaterequest *InstanceGroupManagersSetInstanceTemplateRequest
  20136. urlParams_ gensupport.URLParams
  20137. ctx_ context.Context
  20138. }
  20139. // SetInstanceTemplate: Specifies the instance template to use when
  20140. // creating new instances in this group. The templates for existing
  20141. // instances in the group do not change unless you recreate them.
  20142. func (r *InstanceGroupManagersService) SetInstanceTemplate(project string, zone string, instanceGroupManager string, instancegroupmanagerssetinstancetemplaterequest *InstanceGroupManagersSetInstanceTemplateRequest) *InstanceGroupManagersSetInstanceTemplateCall {
  20143. c := &InstanceGroupManagersSetInstanceTemplateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20144. c.project = project
  20145. c.zone = zone
  20146. c.instanceGroupManager = instanceGroupManager
  20147. c.instancegroupmanagerssetinstancetemplaterequest = instancegroupmanagerssetinstancetemplaterequest
  20148. return c
  20149. }
  20150. // Fields allows partial responses to be retrieved. See
  20151. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20152. // for more information.
  20153. func (c *InstanceGroupManagersSetInstanceTemplateCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetInstanceTemplateCall {
  20154. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20155. return c
  20156. }
  20157. // Context sets the context to be used in this call's Do method. Any
  20158. // pending HTTP request will be aborted if the provided context is
  20159. // canceled.
  20160. func (c *InstanceGroupManagersSetInstanceTemplateCall) Context(ctx context.Context) *InstanceGroupManagersSetInstanceTemplateCall {
  20161. c.ctx_ = ctx
  20162. return c
  20163. }
  20164. func (c *InstanceGroupManagersSetInstanceTemplateCall) doRequest(alt string) (*http.Response, error) {
  20165. var body io.Reader = nil
  20166. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssetinstancetemplaterequest)
  20167. if err != nil {
  20168. return nil, err
  20169. }
  20170. ctype := "application/json"
  20171. c.urlParams_.Set("alt", alt)
  20172. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate")
  20173. urls += "?" + c.urlParams_.Encode()
  20174. req, _ := http.NewRequest("POST", urls, body)
  20175. googleapi.Expand(req.URL, map[string]string{
  20176. "project": c.project,
  20177. "zone": c.zone,
  20178. "instanceGroupManager": c.instanceGroupManager,
  20179. })
  20180. req.Header.Set("Content-Type", ctype)
  20181. req.Header.Set("User-Agent", c.s.userAgent())
  20182. if c.ctx_ != nil {
  20183. return ctxhttp.Do(c.ctx_, c.s.client, req)
  20184. }
  20185. return c.s.client.Do(req)
  20186. }
  20187. // Do executes the "compute.instanceGroupManagers.setInstanceTemplate" 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 *InstanceGroupManagersSetInstanceTemplateCall) 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. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  20220. return nil, err
  20221. }
  20222. return ret, nil
  20223. // {
  20224. // "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.",
  20225. // "httpMethod": "POST",
  20226. // "id": "compute.instanceGroupManagers.setInstanceTemplate",
  20227. // "parameterOrder": [
  20228. // "project",
  20229. // "zone",
  20230. // "instanceGroupManager"
  20231. // ],
  20232. // "parameters": {
  20233. // "instanceGroupManager": {
  20234. // "description": "The name of the managed instance group.",
  20235. // "location": "path",
  20236. // "required": true,
  20237. // "type": "string"
  20238. // },
  20239. // "project": {
  20240. // "description": "Project ID for this request.",
  20241. // "location": "path",
  20242. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  20243. // "required": true,
  20244. // "type": "string"
  20245. // },
  20246. // "zone": {
  20247. // "description": "The name of the zone where the managed instance group is located.",
  20248. // "location": "path",
  20249. // "required": true,
  20250. // "type": "string"
  20251. // }
  20252. // },
  20253. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate",
  20254. // "request": {
  20255. // "$ref": "InstanceGroupManagersSetInstanceTemplateRequest"
  20256. // },
  20257. // "response": {
  20258. // "$ref": "Operation"
  20259. // },
  20260. // "scopes": [
  20261. // "https://www.googleapis.com/auth/cloud-platform",
  20262. // "https://www.googleapis.com/auth/compute"
  20263. // ]
  20264. // }
  20265. }
  20266. // method id "compute.instanceGroupManagers.setTargetPools":
  20267. type InstanceGroupManagersSetTargetPoolsCall struct {
  20268. s *Service
  20269. project string
  20270. zone string
  20271. instanceGroupManager string
  20272. instancegroupmanagerssettargetpoolsrequest *InstanceGroupManagersSetTargetPoolsRequest
  20273. urlParams_ gensupport.URLParams
  20274. ctx_ context.Context
  20275. }
  20276. // SetTargetPools: Modifies the target pools to which all instances in
  20277. // this managed instance group are assigned. The target pools
  20278. // automatically apply to all of the instances in the managed instance
  20279. // group. This operation is marked DONE when you make the request even
  20280. // if the instances have not yet been added to their target pools. The
  20281. // change might take some time to apply to all of the instances in the
  20282. // group depending on the size of the group.
  20283. func (r *InstanceGroupManagersService) SetTargetPools(project string, zone string, instanceGroupManager string, instancegroupmanagerssettargetpoolsrequest *InstanceGroupManagersSetTargetPoolsRequest) *InstanceGroupManagersSetTargetPoolsCall {
  20284. c := &InstanceGroupManagersSetTargetPoolsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20285. c.project = project
  20286. c.zone = zone
  20287. c.instanceGroupManager = instanceGroupManager
  20288. c.instancegroupmanagerssettargetpoolsrequest = instancegroupmanagerssettargetpoolsrequest
  20289. return c
  20290. }
  20291. // Fields allows partial responses to be retrieved. See
  20292. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20293. // for more information.
  20294. func (c *InstanceGroupManagersSetTargetPoolsCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetTargetPoolsCall {
  20295. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20296. return c
  20297. }
  20298. // Context sets the context to be used in this call's Do method. Any
  20299. // pending HTTP request will be aborted if the provided context is
  20300. // canceled.
  20301. func (c *InstanceGroupManagersSetTargetPoolsCall) Context(ctx context.Context) *InstanceGroupManagersSetTargetPoolsCall {
  20302. c.ctx_ = ctx
  20303. return c
  20304. }
  20305. func (c *InstanceGroupManagersSetTargetPoolsCall) doRequest(alt string) (*http.Response, error) {
  20306. var body io.Reader = nil
  20307. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssettargetpoolsrequest)
  20308. if err != nil {
  20309. return nil, err
  20310. }
  20311. ctype := "application/json"
  20312. c.urlParams_.Set("alt", alt)
  20313. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools")
  20314. urls += "?" + c.urlParams_.Encode()
  20315. req, _ := http.NewRequest("POST", urls, body)
  20316. googleapi.Expand(req.URL, map[string]string{
  20317. "project": c.project,
  20318. "zone": c.zone,
  20319. "instanceGroupManager": c.instanceGroupManager,
  20320. })
  20321. req.Header.Set("Content-Type", ctype)
  20322. req.Header.Set("User-Agent", c.s.userAgent())
  20323. if c.ctx_ != nil {
  20324. return ctxhttp.Do(c.ctx_, c.s.client, req)
  20325. }
  20326. return c.s.client.Do(req)
  20327. }
  20328. // Do executes the "compute.instanceGroupManagers.setTargetPools" call.
  20329. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  20330. // status code is an error. Response headers are in either
  20331. // *Operation.ServerResponse.Header or (if a response was returned at
  20332. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  20333. // to check whether the returned error was because
  20334. // http.StatusNotModified was returned.
  20335. func (c *InstanceGroupManagersSetTargetPoolsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  20336. gensupport.SetOptions(c.urlParams_, opts...)
  20337. res, err := c.doRequest("json")
  20338. if res != nil && res.StatusCode == http.StatusNotModified {
  20339. if res.Body != nil {
  20340. res.Body.Close()
  20341. }
  20342. return nil, &googleapi.Error{
  20343. Code: res.StatusCode,
  20344. Header: res.Header,
  20345. }
  20346. }
  20347. if err != nil {
  20348. return nil, err
  20349. }
  20350. defer googleapi.CloseBody(res)
  20351. if err := googleapi.CheckResponse(res); err != nil {
  20352. return nil, err
  20353. }
  20354. ret := &Operation{
  20355. ServerResponse: googleapi.ServerResponse{
  20356. Header: res.Header,
  20357. HTTPStatusCode: res.StatusCode,
  20358. },
  20359. }
  20360. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  20361. return nil, err
  20362. }
  20363. return ret, nil
  20364. // {
  20365. // "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.",
  20366. // "httpMethod": "POST",
  20367. // "id": "compute.instanceGroupManagers.setTargetPools",
  20368. // "parameterOrder": [
  20369. // "project",
  20370. // "zone",
  20371. // "instanceGroupManager"
  20372. // ],
  20373. // "parameters": {
  20374. // "instanceGroupManager": {
  20375. // "description": "The name of the managed instance group.",
  20376. // "location": "path",
  20377. // "required": true,
  20378. // "type": "string"
  20379. // },
  20380. // "project": {
  20381. // "description": "Project ID for this request.",
  20382. // "location": "path",
  20383. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  20384. // "required": true,
  20385. // "type": "string"
  20386. // },
  20387. // "zone": {
  20388. // "description": "The name of the zone where the managed instance group is located.",
  20389. // "location": "path",
  20390. // "required": true,
  20391. // "type": "string"
  20392. // }
  20393. // },
  20394. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools",
  20395. // "request": {
  20396. // "$ref": "InstanceGroupManagersSetTargetPoolsRequest"
  20397. // },
  20398. // "response": {
  20399. // "$ref": "Operation"
  20400. // },
  20401. // "scopes": [
  20402. // "https://www.googleapis.com/auth/cloud-platform",
  20403. // "https://www.googleapis.com/auth/compute"
  20404. // ]
  20405. // }
  20406. }
  20407. // method id "compute.instanceGroups.addInstances":
  20408. type InstanceGroupsAddInstancesCall struct {
  20409. s *Service
  20410. project string
  20411. zone string
  20412. instanceGroup string
  20413. instancegroupsaddinstancesrequest *InstanceGroupsAddInstancesRequest
  20414. urlParams_ gensupport.URLParams
  20415. ctx_ context.Context
  20416. }
  20417. // AddInstances: Adds a list of instances to the specified instance
  20418. // group. Read Adding instances for more information.
  20419. func (r *InstanceGroupsService) AddInstances(project string, zone string, instanceGroup string, instancegroupsaddinstancesrequest *InstanceGroupsAddInstancesRequest) *InstanceGroupsAddInstancesCall {
  20420. c := &InstanceGroupsAddInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20421. c.project = project
  20422. c.zone = zone
  20423. c.instanceGroup = instanceGroup
  20424. c.instancegroupsaddinstancesrequest = instancegroupsaddinstancesrequest
  20425. return c
  20426. }
  20427. // Fields allows partial responses to be retrieved. See
  20428. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20429. // for more information.
  20430. func (c *InstanceGroupsAddInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsAddInstancesCall {
  20431. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20432. return c
  20433. }
  20434. // Context sets the context to be used in this call's Do method. Any
  20435. // pending HTTP request will be aborted if the provided context is
  20436. // canceled.
  20437. func (c *InstanceGroupsAddInstancesCall) Context(ctx context.Context) *InstanceGroupsAddInstancesCall {
  20438. c.ctx_ = ctx
  20439. return c
  20440. }
  20441. func (c *InstanceGroupsAddInstancesCall) doRequest(alt string) (*http.Response, error) {
  20442. var body io.Reader = nil
  20443. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupsaddinstancesrequest)
  20444. if err != nil {
  20445. return nil, err
  20446. }
  20447. ctype := "application/json"
  20448. c.urlParams_.Set("alt", alt)
  20449. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances")
  20450. urls += "?" + c.urlParams_.Encode()
  20451. req, _ := http.NewRequest("POST", urls, body)
  20452. googleapi.Expand(req.URL, map[string]string{
  20453. "project": c.project,
  20454. "zone": c.zone,
  20455. "instanceGroup": c.instanceGroup,
  20456. })
  20457. req.Header.Set("Content-Type", ctype)
  20458. req.Header.Set("User-Agent", c.s.userAgent())
  20459. if c.ctx_ != nil {
  20460. return ctxhttp.Do(c.ctx_, c.s.client, req)
  20461. }
  20462. return c.s.client.Do(req)
  20463. }
  20464. // Do executes the "compute.instanceGroups.addInstances" call.
  20465. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  20466. // status code is an error. Response headers are in either
  20467. // *Operation.ServerResponse.Header or (if a response was returned at
  20468. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  20469. // to check whether the returned error was because
  20470. // http.StatusNotModified was returned.
  20471. func (c *InstanceGroupsAddInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  20472. gensupport.SetOptions(c.urlParams_, opts...)
  20473. res, err := c.doRequest("json")
  20474. if res != nil && res.StatusCode == http.StatusNotModified {
  20475. if res.Body != nil {
  20476. res.Body.Close()
  20477. }
  20478. return nil, &googleapi.Error{
  20479. Code: res.StatusCode,
  20480. Header: res.Header,
  20481. }
  20482. }
  20483. if err != nil {
  20484. return nil, err
  20485. }
  20486. defer googleapi.CloseBody(res)
  20487. if err := googleapi.CheckResponse(res); err != nil {
  20488. return nil, err
  20489. }
  20490. ret := &Operation{
  20491. ServerResponse: googleapi.ServerResponse{
  20492. Header: res.Header,
  20493. HTTPStatusCode: res.StatusCode,
  20494. },
  20495. }
  20496. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  20497. return nil, err
  20498. }
  20499. return ret, nil
  20500. // {
  20501. // "description": "Adds a list of instances to the specified instance group. Read Adding instances for more information.",
  20502. // "httpMethod": "POST",
  20503. // "id": "compute.instanceGroups.addInstances",
  20504. // "parameterOrder": [
  20505. // "project",
  20506. // "zone",
  20507. // "instanceGroup"
  20508. // ],
  20509. // "parameters": {
  20510. // "instanceGroup": {
  20511. // "description": "The name of the instance group where you are adding instances.",
  20512. // "location": "path",
  20513. // "required": true,
  20514. // "type": "string"
  20515. // },
  20516. // "project": {
  20517. // "description": "Project ID for this request.",
  20518. // "location": "path",
  20519. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  20520. // "required": true,
  20521. // "type": "string"
  20522. // },
  20523. // "zone": {
  20524. // "description": "The name of the zone where the instance group is located.",
  20525. // "location": "path",
  20526. // "required": true,
  20527. // "type": "string"
  20528. // }
  20529. // },
  20530. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances",
  20531. // "request": {
  20532. // "$ref": "InstanceGroupsAddInstancesRequest"
  20533. // },
  20534. // "response": {
  20535. // "$ref": "Operation"
  20536. // },
  20537. // "scopes": [
  20538. // "https://www.googleapis.com/auth/cloud-platform",
  20539. // "https://www.googleapis.com/auth/compute"
  20540. // ]
  20541. // }
  20542. }
  20543. // method id "compute.instanceGroups.aggregatedList":
  20544. type InstanceGroupsAggregatedListCall struct {
  20545. s *Service
  20546. project string
  20547. urlParams_ gensupport.URLParams
  20548. ifNoneMatch_ string
  20549. ctx_ context.Context
  20550. }
  20551. // AggregatedList: Retrieves the list of instance groups and sorts them
  20552. // by zone.
  20553. func (r *InstanceGroupsService) AggregatedList(project string) *InstanceGroupsAggregatedListCall {
  20554. c := &InstanceGroupsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20555. c.project = project
  20556. return c
  20557. }
  20558. // Filter sets the optional parameter "filter": Sets a filter expression
  20559. // for filtering listed resources, in the form filter={expression}. Your
  20560. // {expression} must be in the format: field_name comparison_string
  20561. // literal_string.
  20562. //
  20563. // The field_name is the name of the field you want to compare. Only
  20564. // atomic field types are supported (string, number, boolean). The
  20565. // comparison_string must be either eq (equals) or ne (not equals). The
  20566. // literal_string is the string value to filter to. The literal value
  20567. // must be valid for the type of field you are filtering by (string,
  20568. // number, boolean). For string fields, the literal value is interpreted
  20569. // as a regular expression using RE2 syntax. The literal value must
  20570. // match the entire field.
  20571. //
  20572. // For example, filter=name ne example-instance.
  20573. //
  20574. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  20575. // you can also filter on nested fields. For example, you could filter
  20576. // on instances that have set the scheduling.automaticRestart field to
  20577. // true. In particular, use filtering on nested fields to take advantage
  20578. // of instance labels to organize and filter results based on label
  20579. // values.
  20580. //
  20581. // The Beta API also supports filtering on multiple expressions by
  20582. // providing each separate expression within parentheses. For example,
  20583. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  20584. // Multiple expressions are treated as AND expressions meaning that
  20585. // resources must match all expressions to pass the filters.
  20586. func (c *InstanceGroupsAggregatedListCall) Filter(filter string) *InstanceGroupsAggregatedListCall {
  20587. c.urlParams_.Set("filter", filter)
  20588. return c
  20589. }
  20590. // MaxResults sets the optional parameter "maxResults": The maximum
  20591. // number of results per page that Compute Engine should return. If the
  20592. // number of available results is larger than maxResults, Compute Engine
  20593. // returns a nextPageToken that can be used to get the next page of
  20594. // results in subsequent list requests.
  20595. func (c *InstanceGroupsAggregatedListCall) MaxResults(maxResults int64) *InstanceGroupsAggregatedListCall {
  20596. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  20597. return c
  20598. }
  20599. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  20600. // a certain order. By default, results are returned in alphanumerical
  20601. // order based on the resource name.
  20602. //
  20603. // You can also sort results in descending order based on the creation
  20604. // timestamp using orderBy="creationTimestamp desc". This sorts results
  20605. // based on the creationTimestamp field in reverse chronological order
  20606. // (newest result first). Use this to sort resources like operations so
  20607. // that the newest operation is returned first.
  20608. //
  20609. // Currently, only sorting by name or creationTimestamp desc is
  20610. // supported.
  20611. func (c *InstanceGroupsAggregatedListCall) OrderBy(orderBy string) *InstanceGroupsAggregatedListCall {
  20612. c.urlParams_.Set("orderBy", orderBy)
  20613. return c
  20614. }
  20615. // PageToken sets the optional parameter "pageToken": Specifies a page
  20616. // token to use. Set pageToken to the nextPageToken returned by a
  20617. // previous list request to get the next page of results.
  20618. func (c *InstanceGroupsAggregatedListCall) PageToken(pageToken string) *InstanceGroupsAggregatedListCall {
  20619. c.urlParams_.Set("pageToken", pageToken)
  20620. return c
  20621. }
  20622. // Fields allows partial responses to be retrieved. See
  20623. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20624. // for more information.
  20625. func (c *InstanceGroupsAggregatedListCall) Fields(s ...googleapi.Field) *InstanceGroupsAggregatedListCall {
  20626. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20627. return c
  20628. }
  20629. // IfNoneMatch sets the optional parameter which makes the operation
  20630. // fail if the object's ETag matches the given value. This is useful for
  20631. // getting updates only after the object has changed since the last
  20632. // request. Use googleapi.IsNotModified to check whether the response
  20633. // error from Do is the result of In-None-Match.
  20634. func (c *InstanceGroupsAggregatedListCall) IfNoneMatch(entityTag string) *InstanceGroupsAggregatedListCall {
  20635. c.ifNoneMatch_ = entityTag
  20636. return c
  20637. }
  20638. // Context sets the context to be used in this call's Do method. Any
  20639. // pending HTTP request will be aborted if the provided context is
  20640. // canceled.
  20641. func (c *InstanceGroupsAggregatedListCall) Context(ctx context.Context) *InstanceGroupsAggregatedListCall {
  20642. c.ctx_ = ctx
  20643. return c
  20644. }
  20645. func (c *InstanceGroupsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  20646. var body io.Reader = nil
  20647. c.urlParams_.Set("alt", alt)
  20648. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instanceGroups")
  20649. urls += "?" + c.urlParams_.Encode()
  20650. req, _ := http.NewRequest("GET", urls, body)
  20651. googleapi.Expand(req.URL, map[string]string{
  20652. "project": c.project,
  20653. })
  20654. req.Header.Set("User-Agent", c.s.userAgent())
  20655. if c.ifNoneMatch_ != "" {
  20656. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  20657. }
  20658. if c.ctx_ != nil {
  20659. return ctxhttp.Do(c.ctx_, c.s.client, req)
  20660. }
  20661. return c.s.client.Do(req)
  20662. }
  20663. // Do executes the "compute.instanceGroups.aggregatedList" call.
  20664. // Exactly one of *InstanceGroupAggregatedList or error will be non-nil.
  20665. // Any non-2xx status code is an error. Response headers are in either
  20666. // *InstanceGroupAggregatedList.ServerResponse.Header or (if a response
  20667. // was returned at all) in error.(*googleapi.Error).Header. Use
  20668. // googleapi.IsNotModified to check whether the returned error was
  20669. // because http.StatusNotModified was returned.
  20670. func (c *InstanceGroupsAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupAggregatedList, error) {
  20671. gensupport.SetOptions(c.urlParams_, opts...)
  20672. res, err := c.doRequest("json")
  20673. if res != nil && res.StatusCode == http.StatusNotModified {
  20674. if res.Body != nil {
  20675. res.Body.Close()
  20676. }
  20677. return nil, &googleapi.Error{
  20678. Code: res.StatusCode,
  20679. Header: res.Header,
  20680. }
  20681. }
  20682. if err != nil {
  20683. return nil, err
  20684. }
  20685. defer googleapi.CloseBody(res)
  20686. if err := googleapi.CheckResponse(res); err != nil {
  20687. return nil, err
  20688. }
  20689. ret := &InstanceGroupAggregatedList{
  20690. ServerResponse: googleapi.ServerResponse{
  20691. Header: res.Header,
  20692. HTTPStatusCode: res.StatusCode,
  20693. },
  20694. }
  20695. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  20696. return nil, err
  20697. }
  20698. return ret, nil
  20699. // {
  20700. // "description": "Retrieves the list of instance groups and sorts them by zone.",
  20701. // "httpMethod": "GET",
  20702. // "id": "compute.instanceGroups.aggregatedList",
  20703. // "parameterOrder": [
  20704. // "project"
  20705. // ],
  20706. // "parameters": {
  20707. // "filter": {
  20708. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  20709. // "location": "query",
  20710. // "type": "string"
  20711. // },
  20712. // "maxResults": {
  20713. // "default": "500",
  20714. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  20715. // "format": "uint32",
  20716. // "location": "query",
  20717. // "maximum": "500",
  20718. // "minimum": "0",
  20719. // "type": "integer"
  20720. // },
  20721. // "orderBy": {
  20722. // "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.",
  20723. // "location": "query",
  20724. // "type": "string"
  20725. // },
  20726. // "pageToken": {
  20727. // "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.",
  20728. // "location": "query",
  20729. // "type": "string"
  20730. // },
  20731. // "project": {
  20732. // "description": "Project ID for this request.",
  20733. // "location": "path",
  20734. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  20735. // "required": true,
  20736. // "type": "string"
  20737. // }
  20738. // },
  20739. // "path": "{project}/aggregated/instanceGroups",
  20740. // "response": {
  20741. // "$ref": "InstanceGroupAggregatedList"
  20742. // },
  20743. // "scopes": [
  20744. // "https://www.googleapis.com/auth/cloud-platform",
  20745. // "https://www.googleapis.com/auth/compute",
  20746. // "https://www.googleapis.com/auth/compute.readonly"
  20747. // ]
  20748. // }
  20749. }
  20750. // Pages invokes f for each page of results.
  20751. // A non-nil error returned from f will halt the iteration.
  20752. // The provided context supersedes any context provided to the Context method.
  20753. func (c *InstanceGroupsAggregatedListCall) Pages(ctx context.Context, f func(*InstanceGroupAggregatedList) error) error {
  20754. c.ctx_ = ctx
  20755. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  20756. for {
  20757. x, err := c.Do()
  20758. if err != nil {
  20759. return err
  20760. }
  20761. if err := f(x); err != nil {
  20762. return err
  20763. }
  20764. if x.NextPageToken == "" {
  20765. return nil
  20766. }
  20767. c.PageToken(x.NextPageToken)
  20768. }
  20769. }
  20770. // method id "compute.instanceGroups.delete":
  20771. type InstanceGroupsDeleteCall struct {
  20772. s *Service
  20773. project string
  20774. zone string
  20775. instanceGroup string
  20776. urlParams_ gensupport.URLParams
  20777. ctx_ context.Context
  20778. }
  20779. // Delete: Deletes the specified instance group. The instances in the
  20780. // group are not deleted. Note that instance group must not belong to a
  20781. // backend service. Read Deleting an instance group for more
  20782. // information.
  20783. func (r *InstanceGroupsService) Delete(project string, zone string, instanceGroup string) *InstanceGroupsDeleteCall {
  20784. c := &InstanceGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20785. c.project = project
  20786. c.zone = zone
  20787. c.instanceGroup = instanceGroup
  20788. return c
  20789. }
  20790. // Fields allows partial responses to be retrieved. See
  20791. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20792. // for more information.
  20793. func (c *InstanceGroupsDeleteCall) Fields(s ...googleapi.Field) *InstanceGroupsDeleteCall {
  20794. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20795. return c
  20796. }
  20797. // Context sets the context to be used in this call's Do method. Any
  20798. // pending HTTP request will be aborted if the provided context is
  20799. // canceled.
  20800. func (c *InstanceGroupsDeleteCall) Context(ctx context.Context) *InstanceGroupsDeleteCall {
  20801. c.ctx_ = ctx
  20802. return c
  20803. }
  20804. func (c *InstanceGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
  20805. var body io.Reader = nil
  20806. c.urlParams_.Set("alt", alt)
  20807. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}")
  20808. urls += "?" + c.urlParams_.Encode()
  20809. req, _ := http.NewRequest("DELETE", urls, body)
  20810. googleapi.Expand(req.URL, map[string]string{
  20811. "project": c.project,
  20812. "zone": c.zone,
  20813. "instanceGroup": c.instanceGroup,
  20814. })
  20815. req.Header.Set("User-Agent", c.s.userAgent())
  20816. if c.ctx_ != nil {
  20817. return ctxhttp.Do(c.ctx_, c.s.client, req)
  20818. }
  20819. return c.s.client.Do(req)
  20820. }
  20821. // Do executes the "compute.instanceGroups.delete" call.
  20822. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  20823. // status code is an error. Response headers are in either
  20824. // *Operation.ServerResponse.Header or (if a response was returned at
  20825. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  20826. // to check whether the returned error was because
  20827. // http.StatusNotModified was returned.
  20828. func (c *InstanceGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  20829. gensupport.SetOptions(c.urlParams_, opts...)
  20830. res, err := c.doRequest("json")
  20831. if res != nil && res.StatusCode == http.StatusNotModified {
  20832. if res.Body != nil {
  20833. res.Body.Close()
  20834. }
  20835. return nil, &googleapi.Error{
  20836. Code: res.StatusCode,
  20837. Header: res.Header,
  20838. }
  20839. }
  20840. if err != nil {
  20841. return nil, err
  20842. }
  20843. defer googleapi.CloseBody(res)
  20844. if err := googleapi.CheckResponse(res); err != nil {
  20845. return nil, err
  20846. }
  20847. ret := &Operation{
  20848. ServerResponse: googleapi.ServerResponse{
  20849. Header: res.Header,
  20850. HTTPStatusCode: res.StatusCode,
  20851. },
  20852. }
  20853. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  20854. return nil, err
  20855. }
  20856. return ret, nil
  20857. // {
  20858. // "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.",
  20859. // "httpMethod": "DELETE",
  20860. // "id": "compute.instanceGroups.delete",
  20861. // "parameterOrder": [
  20862. // "project",
  20863. // "zone",
  20864. // "instanceGroup"
  20865. // ],
  20866. // "parameters": {
  20867. // "instanceGroup": {
  20868. // "description": "The name of the instance group to delete.",
  20869. // "location": "path",
  20870. // "required": true,
  20871. // "type": "string"
  20872. // },
  20873. // "project": {
  20874. // "description": "Project ID for this request.",
  20875. // "location": "path",
  20876. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  20877. // "required": true,
  20878. // "type": "string"
  20879. // },
  20880. // "zone": {
  20881. // "description": "The name of the zone where the instance group is located.",
  20882. // "location": "path",
  20883. // "required": true,
  20884. // "type": "string"
  20885. // }
  20886. // },
  20887. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}",
  20888. // "response": {
  20889. // "$ref": "Operation"
  20890. // },
  20891. // "scopes": [
  20892. // "https://www.googleapis.com/auth/cloud-platform",
  20893. // "https://www.googleapis.com/auth/compute"
  20894. // ]
  20895. // }
  20896. }
  20897. // method id "compute.instanceGroups.get":
  20898. type InstanceGroupsGetCall struct {
  20899. s *Service
  20900. project string
  20901. zone string
  20902. instanceGroup string
  20903. urlParams_ gensupport.URLParams
  20904. ifNoneMatch_ string
  20905. ctx_ context.Context
  20906. }
  20907. // Get: Returns the specified instance group resource.
  20908. func (r *InstanceGroupsService) Get(project string, zone string, instanceGroup string) *InstanceGroupsGetCall {
  20909. c := &InstanceGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20910. c.project = project
  20911. c.zone = zone
  20912. c.instanceGroup = instanceGroup
  20913. return c
  20914. }
  20915. // Fields allows partial responses to be retrieved. See
  20916. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20917. // for more information.
  20918. func (c *InstanceGroupsGetCall) Fields(s ...googleapi.Field) *InstanceGroupsGetCall {
  20919. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20920. return c
  20921. }
  20922. // IfNoneMatch sets the optional parameter which makes the operation
  20923. // fail if the object's ETag matches the given value. This is useful for
  20924. // getting updates only after the object has changed since the last
  20925. // request. Use googleapi.IsNotModified to check whether the response
  20926. // error from Do is the result of In-None-Match.
  20927. func (c *InstanceGroupsGetCall) IfNoneMatch(entityTag string) *InstanceGroupsGetCall {
  20928. c.ifNoneMatch_ = entityTag
  20929. return c
  20930. }
  20931. // Context sets the context to be used in this call's Do method. Any
  20932. // pending HTTP request will be aborted if the provided context is
  20933. // canceled.
  20934. func (c *InstanceGroupsGetCall) Context(ctx context.Context) *InstanceGroupsGetCall {
  20935. c.ctx_ = ctx
  20936. return c
  20937. }
  20938. func (c *InstanceGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  20939. var body io.Reader = nil
  20940. c.urlParams_.Set("alt", alt)
  20941. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}")
  20942. urls += "?" + c.urlParams_.Encode()
  20943. req, _ := http.NewRequest("GET", urls, body)
  20944. googleapi.Expand(req.URL, map[string]string{
  20945. "project": c.project,
  20946. "zone": c.zone,
  20947. "instanceGroup": c.instanceGroup,
  20948. })
  20949. req.Header.Set("User-Agent", c.s.userAgent())
  20950. if c.ifNoneMatch_ != "" {
  20951. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  20952. }
  20953. if c.ctx_ != nil {
  20954. return ctxhttp.Do(c.ctx_, c.s.client, req)
  20955. }
  20956. return c.s.client.Do(req)
  20957. }
  20958. // Do executes the "compute.instanceGroups.get" call.
  20959. // Exactly one of *InstanceGroup or error will be non-nil. Any non-2xx
  20960. // status code is an error. Response headers are in either
  20961. // *InstanceGroup.ServerResponse.Header or (if a response was returned
  20962. // at all) in error.(*googleapi.Error).Header. Use
  20963. // googleapi.IsNotModified to check whether the returned error was
  20964. // because http.StatusNotModified was returned.
  20965. func (c *InstanceGroupsGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroup, error) {
  20966. gensupport.SetOptions(c.urlParams_, opts...)
  20967. res, err := c.doRequest("json")
  20968. if res != nil && res.StatusCode == http.StatusNotModified {
  20969. if res.Body != nil {
  20970. res.Body.Close()
  20971. }
  20972. return nil, &googleapi.Error{
  20973. Code: res.StatusCode,
  20974. Header: res.Header,
  20975. }
  20976. }
  20977. if err != nil {
  20978. return nil, err
  20979. }
  20980. defer googleapi.CloseBody(res)
  20981. if err := googleapi.CheckResponse(res); err != nil {
  20982. return nil, err
  20983. }
  20984. ret := &InstanceGroup{
  20985. ServerResponse: googleapi.ServerResponse{
  20986. Header: res.Header,
  20987. HTTPStatusCode: res.StatusCode,
  20988. },
  20989. }
  20990. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  20991. return nil, err
  20992. }
  20993. return ret, nil
  20994. // {
  20995. // "description": "Returns the specified instance group resource.",
  20996. // "httpMethod": "GET",
  20997. // "id": "compute.instanceGroups.get",
  20998. // "parameterOrder": [
  20999. // "project",
  21000. // "zone",
  21001. // "instanceGroup"
  21002. // ],
  21003. // "parameters": {
  21004. // "instanceGroup": {
  21005. // "description": "The name of the instance group.",
  21006. // "location": "path",
  21007. // "required": true,
  21008. // "type": "string"
  21009. // },
  21010. // "project": {
  21011. // "description": "Project ID for this request.",
  21012. // "location": "path",
  21013. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  21014. // "required": true,
  21015. // "type": "string"
  21016. // },
  21017. // "zone": {
  21018. // "description": "The name of the zone where the instance group is located.",
  21019. // "location": "path",
  21020. // "required": true,
  21021. // "type": "string"
  21022. // }
  21023. // },
  21024. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}",
  21025. // "response": {
  21026. // "$ref": "InstanceGroup"
  21027. // },
  21028. // "scopes": [
  21029. // "https://www.googleapis.com/auth/cloud-platform",
  21030. // "https://www.googleapis.com/auth/compute",
  21031. // "https://www.googleapis.com/auth/compute.readonly"
  21032. // ]
  21033. // }
  21034. }
  21035. // method id "compute.instanceGroups.insert":
  21036. type InstanceGroupsInsertCall struct {
  21037. s *Service
  21038. project string
  21039. zone string
  21040. instancegroup *InstanceGroup
  21041. urlParams_ gensupport.URLParams
  21042. ctx_ context.Context
  21043. }
  21044. // Insert: Creates an instance group in the specified project using the
  21045. // parameters that are included in the request.
  21046. func (r *InstanceGroupsService) Insert(project string, zone string, instancegroup *InstanceGroup) *InstanceGroupsInsertCall {
  21047. c := &InstanceGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21048. c.project = project
  21049. c.zone = zone
  21050. c.instancegroup = instancegroup
  21051. return c
  21052. }
  21053. // Fields allows partial responses to be retrieved. See
  21054. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21055. // for more information.
  21056. func (c *InstanceGroupsInsertCall) Fields(s ...googleapi.Field) *InstanceGroupsInsertCall {
  21057. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21058. return c
  21059. }
  21060. // Context sets the context to be used in this call's Do method. Any
  21061. // pending HTTP request will be aborted if the provided context is
  21062. // canceled.
  21063. func (c *InstanceGroupsInsertCall) Context(ctx context.Context) *InstanceGroupsInsertCall {
  21064. c.ctx_ = ctx
  21065. return c
  21066. }
  21067. func (c *InstanceGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  21068. var body io.Reader = nil
  21069. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroup)
  21070. if err != nil {
  21071. return nil, err
  21072. }
  21073. ctype := "application/json"
  21074. c.urlParams_.Set("alt", alt)
  21075. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups")
  21076. urls += "?" + c.urlParams_.Encode()
  21077. req, _ := http.NewRequest("POST", urls, body)
  21078. googleapi.Expand(req.URL, map[string]string{
  21079. "project": c.project,
  21080. "zone": c.zone,
  21081. })
  21082. req.Header.Set("Content-Type", ctype)
  21083. req.Header.Set("User-Agent", c.s.userAgent())
  21084. if c.ctx_ != nil {
  21085. return ctxhttp.Do(c.ctx_, c.s.client, req)
  21086. }
  21087. return c.s.client.Do(req)
  21088. }
  21089. // Do executes the "compute.instanceGroups.insert" call.
  21090. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  21091. // status code is an error. Response headers are in either
  21092. // *Operation.ServerResponse.Header or (if a response was returned at
  21093. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  21094. // to check whether the returned error was because
  21095. // http.StatusNotModified was returned.
  21096. func (c *InstanceGroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  21097. gensupport.SetOptions(c.urlParams_, opts...)
  21098. res, err := c.doRequest("json")
  21099. if res != nil && res.StatusCode == http.StatusNotModified {
  21100. if res.Body != nil {
  21101. res.Body.Close()
  21102. }
  21103. return nil, &googleapi.Error{
  21104. Code: res.StatusCode,
  21105. Header: res.Header,
  21106. }
  21107. }
  21108. if err != nil {
  21109. return nil, err
  21110. }
  21111. defer googleapi.CloseBody(res)
  21112. if err := googleapi.CheckResponse(res); err != nil {
  21113. return nil, err
  21114. }
  21115. ret := &Operation{
  21116. ServerResponse: googleapi.ServerResponse{
  21117. Header: res.Header,
  21118. HTTPStatusCode: res.StatusCode,
  21119. },
  21120. }
  21121. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  21122. return nil, err
  21123. }
  21124. return ret, nil
  21125. // {
  21126. // "description": "Creates an instance group in the specified project using the parameters that are included in the request.",
  21127. // "httpMethod": "POST",
  21128. // "id": "compute.instanceGroups.insert",
  21129. // "parameterOrder": [
  21130. // "project",
  21131. // "zone"
  21132. // ],
  21133. // "parameters": {
  21134. // "project": {
  21135. // "description": "Project ID for this request.",
  21136. // "location": "path",
  21137. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  21138. // "required": true,
  21139. // "type": "string"
  21140. // },
  21141. // "zone": {
  21142. // "description": "The name of the zone where you want to create the instance group.",
  21143. // "location": "path",
  21144. // "required": true,
  21145. // "type": "string"
  21146. // }
  21147. // },
  21148. // "path": "{project}/zones/{zone}/instanceGroups",
  21149. // "request": {
  21150. // "$ref": "InstanceGroup"
  21151. // },
  21152. // "response": {
  21153. // "$ref": "Operation"
  21154. // },
  21155. // "scopes": [
  21156. // "https://www.googleapis.com/auth/cloud-platform",
  21157. // "https://www.googleapis.com/auth/compute"
  21158. // ]
  21159. // }
  21160. }
  21161. // method id "compute.instanceGroups.list":
  21162. type InstanceGroupsListCall struct {
  21163. s *Service
  21164. project string
  21165. zone string
  21166. urlParams_ gensupport.URLParams
  21167. ifNoneMatch_ string
  21168. ctx_ context.Context
  21169. }
  21170. // List: Retrieves the list of instance groups that are located in the
  21171. // specified project and zone.
  21172. func (r *InstanceGroupsService) List(project string, zone string) *InstanceGroupsListCall {
  21173. c := &InstanceGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21174. c.project = project
  21175. c.zone = zone
  21176. return c
  21177. }
  21178. // Filter sets the optional parameter "filter": Sets a filter expression
  21179. // for filtering listed resources, in the form filter={expression}. Your
  21180. // {expression} must be in the format: field_name comparison_string
  21181. // literal_string.
  21182. //
  21183. // The field_name is the name of the field you want to compare. Only
  21184. // atomic field types are supported (string, number, boolean). The
  21185. // comparison_string must be either eq (equals) or ne (not equals). The
  21186. // literal_string is the string value to filter to. The literal value
  21187. // must be valid for the type of field you are filtering by (string,
  21188. // number, boolean). For string fields, the literal value is interpreted
  21189. // as a regular expression using RE2 syntax. The literal value must
  21190. // match the entire field.
  21191. //
  21192. // For example, filter=name ne example-instance.
  21193. //
  21194. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  21195. // you can also filter on nested fields. For example, you could filter
  21196. // on instances that have set the scheduling.automaticRestart field to
  21197. // true. In particular, use filtering on nested fields to take advantage
  21198. // of instance labels to organize and filter results based on label
  21199. // values.
  21200. //
  21201. // The Beta API also supports filtering on multiple expressions by
  21202. // providing each separate expression within parentheses. For example,
  21203. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  21204. // Multiple expressions are treated as AND expressions meaning that
  21205. // resources must match all expressions to pass the filters.
  21206. func (c *InstanceGroupsListCall) Filter(filter string) *InstanceGroupsListCall {
  21207. c.urlParams_.Set("filter", filter)
  21208. return c
  21209. }
  21210. // MaxResults sets the optional parameter "maxResults": The maximum
  21211. // number of results per page that Compute Engine should return. If the
  21212. // number of available results is larger than maxResults, Compute Engine
  21213. // returns a nextPageToken that can be used to get the next page of
  21214. // results in subsequent list requests.
  21215. func (c *InstanceGroupsListCall) MaxResults(maxResults int64) *InstanceGroupsListCall {
  21216. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  21217. return c
  21218. }
  21219. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  21220. // a certain order. By default, results are returned in alphanumerical
  21221. // order based on the resource name.
  21222. //
  21223. // You can also sort results in descending order based on the creation
  21224. // timestamp using orderBy="creationTimestamp desc". This sorts results
  21225. // based on the creationTimestamp field in reverse chronological order
  21226. // (newest result first). Use this to sort resources like operations so
  21227. // that the newest operation is returned first.
  21228. //
  21229. // Currently, only sorting by name or creationTimestamp desc is
  21230. // supported.
  21231. func (c *InstanceGroupsListCall) OrderBy(orderBy string) *InstanceGroupsListCall {
  21232. c.urlParams_.Set("orderBy", orderBy)
  21233. return c
  21234. }
  21235. // PageToken sets the optional parameter "pageToken": Specifies a page
  21236. // token to use. Set pageToken to the nextPageToken returned by a
  21237. // previous list request to get the next page of results.
  21238. func (c *InstanceGroupsListCall) PageToken(pageToken string) *InstanceGroupsListCall {
  21239. c.urlParams_.Set("pageToken", pageToken)
  21240. return c
  21241. }
  21242. // Fields allows partial responses to be retrieved. See
  21243. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21244. // for more information.
  21245. func (c *InstanceGroupsListCall) Fields(s ...googleapi.Field) *InstanceGroupsListCall {
  21246. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21247. return c
  21248. }
  21249. // IfNoneMatch sets the optional parameter which makes the operation
  21250. // fail if the object's ETag matches the given value. This is useful for
  21251. // getting updates only after the object has changed since the last
  21252. // request. Use googleapi.IsNotModified to check whether the response
  21253. // error from Do is the result of In-None-Match.
  21254. func (c *InstanceGroupsListCall) IfNoneMatch(entityTag string) *InstanceGroupsListCall {
  21255. c.ifNoneMatch_ = entityTag
  21256. return c
  21257. }
  21258. // Context sets the context to be used in this call's Do method. Any
  21259. // pending HTTP request will be aborted if the provided context is
  21260. // canceled.
  21261. func (c *InstanceGroupsListCall) Context(ctx context.Context) *InstanceGroupsListCall {
  21262. c.ctx_ = ctx
  21263. return c
  21264. }
  21265. func (c *InstanceGroupsListCall) doRequest(alt string) (*http.Response, error) {
  21266. var body io.Reader = nil
  21267. c.urlParams_.Set("alt", alt)
  21268. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups")
  21269. urls += "?" + c.urlParams_.Encode()
  21270. req, _ := http.NewRequest("GET", urls, body)
  21271. googleapi.Expand(req.URL, map[string]string{
  21272. "project": c.project,
  21273. "zone": c.zone,
  21274. })
  21275. req.Header.Set("User-Agent", c.s.userAgent())
  21276. if c.ifNoneMatch_ != "" {
  21277. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  21278. }
  21279. if c.ctx_ != nil {
  21280. return ctxhttp.Do(c.ctx_, c.s.client, req)
  21281. }
  21282. return c.s.client.Do(req)
  21283. }
  21284. // Do executes the "compute.instanceGroups.list" call.
  21285. // Exactly one of *InstanceGroupList or error will be non-nil. Any
  21286. // non-2xx status code is an error. Response headers are in either
  21287. // *InstanceGroupList.ServerResponse.Header or (if a response was
  21288. // returned at all) in error.(*googleapi.Error).Header. Use
  21289. // googleapi.IsNotModified to check whether the returned error was
  21290. // because http.StatusNotModified was returned.
  21291. func (c *InstanceGroupsListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupList, error) {
  21292. gensupport.SetOptions(c.urlParams_, opts...)
  21293. res, err := c.doRequest("json")
  21294. if res != nil && res.StatusCode == http.StatusNotModified {
  21295. if res.Body != nil {
  21296. res.Body.Close()
  21297. }
  21298. return nil, &googleapi.Error{
  21299. Code: res.StatusCode,
  21300. Header: res.Header,
  21301. }
  21302. }
  21303. if err != nil {
  21304. return nil, err
  21305. }
  21306. defer googleapi.CloseBody(res)
  21307. if err := googleapi.CheckResponse(res); err != nil {
  21308. return nil, err
  21309. }
  21310. ret := &InstanceGroupList{
  21311. ServerResponse: googleapi.ServerResponse{
  21312. Header: res.Header,
  21313. HTTPStatusCode: res.StatusCode,
  21314. },
  21315. }
  21316. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  21317. return nil, err
  21318. }
  21319. return ret, nil
  21320. // {
  21321. // "description": "Retrieves the list of instance groups that are located in the specified project and zone.",
  21322. // "httpMethod": "GET",
  21323. // "id": "compute.instanceGroups.list",
  21324. // "parameterOrder": [
  21325. // "project",
  21326. // "zone"
  21327. // ],
  21328. // "parameters": {
  21329. // "filter": {
  21330. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  21331. // "location": "query",
  21332. // "type": "string"
  21333. // },
  21334. // "maxResults": {
  21335. // "default": "500",
  21336. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  21337. // "format": "uint32",
  21338. // "location": "query",
  21339. // "maximum": "500",
  21340. // "minimum": "0",
  21341. // "type": "integer"
  21342. // },
  21343. // "orderBy": {
  21344. // "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.",
  21345. // "location": "query",
  21346. // "type": "string"
  21347. // },
  21348. // "pageToken": {
  21349. // "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.",
  21350. // "location": "query",
  21351. // "type": "string"
  21352. // },
  21353. // "project": {
  21354. // "description": "Project ID for this request.",
  21355. // "location": "path",
  21356. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  21357. // "required": true,
  21358. // "type": "string"
  21359. // },
  21360. // "zone": {
  21361. // "description": "The name of the zone where the instance group is located.",
  21362. // "location": "path",
  21363. // "required": true,
  21364. // "type": "string"
  21365. // }
  21366. // },
  21367. // "path": "{project}/zones/{zone}/instanceGroups",
  21368. // "response": {
  21369. // "$ref": "InstanceGroupList"
  21370. // },
  21371. // "scopes": [
  21372. // "https://www.googleapis.com/auth/cloud-platform",
  21373. // "https://www.googleapis.com/auth/compute",
  21374. // "https://www.googleapis.com/auth/compute.readonly"
  21375. // ]
  21376. // }
  21377. }
  21378. // Pages invokes f for each page of results.
  21379. // A non-nil error returned from f will halt the iteration.
  21380. // The provided context supersedes any context provided to the Context method.
  21381. func (c *InstanceGroupsListCall) Pages(ctx context.Context, f func(*InstanceGroupList) error) error {
  21382. c.ctx_ = ctx
  21383. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  21384. for {
  21385. x, err := c.Do()
  21386. if err != nil {
  21387. return err
  21388. }
  21389. if err := f(x); err != nil {
  21390. return err
  21391. }
  21392. if x.NextPageToken == "" {
  21393. return nil
  21394. }
  21395. c.PageToken(x.NextPageToken)
  21396. }
  21397. }
  21398. // method id "compute.instanceGroups.listInstances":
  21399. type InstanceGroupsListInstancesCall struct {
  21400. s *Service
  21401. project string
  21402. zone string
  21403. instanceGroup string
  21404. instancegroupslistinstancesrequest *InstanceGroupsListInstancesRequest
  21405. urlParams_ gensupport.URLParams
  21406. ctx_ context.Context
  21407. }
  21408. // ListInstances: Lists the instances in the specified instance group.
  21409. func (r *InstanceGroupsService) ListInstances(project string, zone string, instanceGroup string, instancegroupslistinstancesrequest *InstanceGroupsListInstancesRequest) *InstanceGroupsListInstancesCall {
  21410. c := &InstanceGroupsListInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21411. c.project = project
  21412. c.zone = zone
  21413. c.instanceGroup = instanceGroup
  21414. c.instancegroupslistinstancesrequest = instancegroupslistinstancesrequest
  21415. return c
  21416. }
  21417. // Filter sets the optional parameter "filter": Sets a filter expression
  21418. // for filtering listed resources, in the form filter={expression}. Your
  21419. // {expression} must be in the format: field_name comparison_string
  21420. // literal_string.
  21421. //
  21422. // The field_name is the name of the field you want to compare. Only
  21423. // atomic field types are supported (string, number, boolean). The
  21424. // comparison_string must be either eq (equals) or ne (not equals). The
  21425. // literal_string is the string value to filter to. The literal value
  21426. // must be valid for the type of field you are filtering by (string,
  21427. // number, boolean). For string fields, the literal value is interpreted
  21428. // as a regular expression using RE2 syntax. The literal value must
  21429. // match the entire field.
  21430. //
  21431. // For example, filter=name ne example-instance.
  21432. //
  21433. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  21434. // you can also filter on nested fields. For example, you could filter
  21435. // on instances that have set the scheduling.automaticRestart field to
  21436. // true. In particular, use filtering on nested fields to take advantage
  21437. // of instance labels to organize and filter results based on label
  21438. // values.
  21439. //
  21440. // The Beta API also supports filtering on multiple expressions by
  21441. // providing each separate expression within parentheses. For example,
  21442. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  21443. // Multiple expressions are treated as AND expressions meaning that
  21444. // resources must match all expressions to pass the filters.
  21445. func (c *InstanceGroupsListInstancesCall) Filter(filter string) *InstanceGroupsListInstancesCall {
  21446. c.urlParams_.Set("filter", filter)
  21447. return c
  21448. }
  21449. // MaxResults sets the optional parameter "maxResults": The maximum
  21450. // number of results per page that Compute Engine should return. If the
  21451. // number of available results is larger than maxResults, Compute Engine
  21452. // returns a nextPageToken that can be used to get the next page of
  21453. // results in subsequent list requests.
  21454. func (c *InstanceGroupsListInstancesCall) MaxResults(maxResults int64) *InstanceGroupsListInstancesCall {
  21455. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  21456. return c
  21457. }
  21458. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  21459. // a certain order. By default, results are returned in alphanumerical
  21460. // order based on the resource name.
  21461. //
  21462. // You can also sort results in descending order based on the creation
  21463. // timestamp using orderBy="creationTimestamp desc". This sorts results
  21464. // based on the creationTimestamp field in reverse chronological order
  21465. // (newest result first). Use this to sort resources like operations so
  21466. // that the newest operation is returned first.
  21467. //
  21468. // Currently, only sorting by name or creationTimestamp desc is
  21469. // supported.
  21470. func (c *InstanceGroupsListInstancesCall) OrderBy(orderBy string) *InstanceGroupsListInstancesCall {
  21471. c.urlParams_.Set("orderBy", orderBy)
  21472. return c
  21473. }
  21474. // PageToken sets the optional parameter "pageToken": Specifies a page
  21475. // token to use. Set pageToken to the nextPageToken returned by a
  21476. // previous list request to get the next page of results.
  21477. func (c *InstanceGroupsListInstancesCall) PageToken(pageToken string) *InstanceGroupsListInstancesCall {
  21478. c.urlParams_.Set("pageToken", pageToken)
  21479. return c
  21480. }
  21481. // Fields allows partial responses to be retrieved. See
  21482. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21483. // for more information.
  21484. func (c *InstanceGroupsListInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsListInstancesCall {
  21485. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21486. return c
  21487. }
  21488. // Context sets the context to be used in this call's Do method. Any
  21489. // pending HTTP request will be aborted if the provided context is
  21490. // canceled.
  21491. func (c *InstanceGroupsListInstancesCall) Context(ctx context.Context) *InstanceGroupsListInstancesCall {
  21492. c.ctx_ = ctx
  21493. return c
  21494. }
  21495. func (c *InstanceGroupsListInstancesCall) doRequest(alt string) (*http.Response, error) {
  21496. var body io.Reader = nil
  21497. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupslistinstancesrequest)
  21498. if err != nil {
  21499. return nil, err
  21500. }
  21501. ctype := "application/json"
  21502. c.urlParams_.Set("alt", alt)
  21503. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances")
  21504. urls += "?" + c.urlParams_.Encode()
  21505. req, _ := http.NewRequest("POST", urls, body)
  21506. googleapi.Expand(req.URL, map[string]string{
  21507. "project": c.project,
  21508. "zone": c.zone,
  21509. "instanceGroup": c.instanceGroup,
  21510. })
  21511. req.Header.Set("Content-Type", ctype)
  21512. req.Header.Set("User-Agent", c.s.userAgent())
  21513. if c.ctx_ != nil {
  21514. return ctxhttp.Do(c.ctx_, c.s.client, req)
  21515. }
  21516. return c.s.client.Do(req)
  21517. }
  21518. // Do executes the "compute.instanceGroups.listInstances" call.
  21519. // Exactly one of *InstanceGroupsListInstances or error will be non-nil.
  21520. // Any non-2xx status code is an error. Response headers are in either
  21521. // *InstanceGroupsListInstances.ServerResponse.Header or (if a response
  21522. // was returned at all) in error.(*googleapi.Error).Header. Use
  21523. // googleapi.IsNotModified to check whether the returned error was
  21524. // because http.StatusNotModified was returned.
  21525. func (c *InstanceGroupsListInstancesCall) Do(opts ...googleapi.CallOption) (*InstanceGroupsListInstances, error) {
  21526. gensupport.SetOptions(c.urlParams_, opts...)
  21527. res, err := c.doRequest("json")
  21528. if res != nil && res.StatusCode == http.StatusNotModified {
  21529. if res.Body != nil {
  21530. res.Body.Close()
  21531. }
  21532. return nil, &googleapi.Error{
  21533. Code: res.StatusCode,
  21534. Header: res.Header,
  21535. }
  21536. }
  21537. if err != nil {
  21538. return nil, err
  21539. }
  21540. defer googleapi.CloseBody(res)
  21541. if err := googleapi.CheckResponse(res); err != nil {
  21542. return nil, err
  21543. }
  21544. ret := &InstanceGroupsListInstances{
  21545. ServerResponse: googleapi.ServerResponse{
  21546. Header: res.Header,
  21547. HTTPStatusCode: res.StatusCode,
  21548. },
  21549. }
  21550. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  21551. return nil, err
  21552. }
  21553. return ret, nil
  21554. // {
  21555. // "description": "Lists the instances in the specified instance group.",
  21556. // "httpMethod": "POST",
  21557. // "id": "compute.instanceGroups.listInstances",
  21558. // "parameterOrder": [
  21559. // "project",
  21560. // "zone",
  21561. // "instanceGroup"
  21562. // ],
  21563. // "parameters": {
  21564. // "filter": {
  21565. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  21566. // "location": "query",
  21567. // "type": "string"
  21568. // },
  21569. // "instanceGroup": {
  21570. // "description": "The name of the instance group from which you want to generate a list of included instances.",
  21571. // "location": "path",
  21572. // "required": true,
  21573. // "type": "string"
  21574. // },
  21575. // "maxResults": {
  21576. // "default": "500",
  21577. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  21578. // "format": "uint32",
  21579. // "location": "query",
  21580. // "maximum": "500",
  21581. // "minimum": "0",
  21582. // "type": "integer"
  21583. // },
  21584. // "orderBy": {
  21585. // "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.",
  21586. // "location": "query",
  21587. // "type": "string"
  21588. // },
  21589. // "pageToken": {
  21590. // "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.",
  21591. // "location": "query",
  21592. // "type": "string"
  21593. // },
  21594. // "project": {
  21595. // "description": "Project ID for this request.",
  21596. // "location": "path",
  21597. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  21598. // "required": true,
  21599. // "type": "string"
  21600. // },
  21601. // "zone": {
  21602. // "description": "The name of the zone where the instance group is located.",
  21603. // "location": "path",
  21604. // "required": true,
  21605. // "type": "string"
  21606. // }
  21607. // },
  21608. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances",
  21609. // "request": {
  21610. // "$ref": "InstanceGroupsListInstancesRequest"
  21611. // },
  21612. // "response": {
  21613. // "$ref": "InstanceGroupsListInstances"
  21614. // },
  21615. // "scopes": [
  21616. // "https://www.googleapis.com/auth/cloud-platform",
  21617. // "https://www.googleapis.com/auth/compute",
  21618. // "https://www.googleapis.com/auth/compute.readonly"
  21619. // ]
  21620. // }
  21621. }
  21622. // method id "compute.instanceGroups.removeInstances":
  21623. type InstanceGroupsRemoveInstancesCall struct {
  21624. s *Service
  21625. project string
  21626. zone string
  21627. instanceGroup string
  21628. instancegroupsremoveinstancesrequest *InstanceGroupsRemoveInstancesRequest
  21629. urlParams_ gensupport.URLParams
  21630. ctx_ context.Context
  21631. }
  21632. // RemoveInstances: Removes one or more instances from the specified
  21633. // instance group, but does not delete those instances.
  21634. func (r *InstanceGroupsService) RemoveInstances(project string, zone string, instanceGroup string, instancegroupsremoveinstancesrequest *InstanceGroupsRemoveInstancesRequest) *InstanceGroupsRemoveInstancesCall {
  21635. c := &InstanceGroupsRemoveInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21636. c.project = project
  21637. c.zone = zone
  21638. c.instanceGroup = instanceGroup
  21639. c.instancegroupsremoveinstancesrequest = instancegroupsremoveinstancesrequest
  21640. return c
  21641. }
  21642. // Fields allows partial responses to be retrieved. See
  21643. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21644. // for more information.
  21645. func (c *InstanceGroupsRemoveInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsRemoveInstancesCall {
  21646. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21647. return c
  21648. }
  21649. // Context sets the context to be used in this call's Do method. Any
  21650. // pending HTTP request will be aborted if the provided context is
  21651. // canceled.
  21652. func (c *InstanceGroupsRemoveInstancesCall) Context(ctx context.Context) *InstanceGroupsRemoveInstancesCall {
  21653. c.ctx_ = ctx
  21654. return c
  21655. }
  21656. func (c *InstanceGroupsRemoveInstancesCall) doRequest(alt string) (*http.Response, error) {
  21657. var body io.Reader = nil
  21658. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupsremoveinstancesrequest)
  21659. if err != nil {
  21660. return nil, err
  21661. }
  21662. ctype := "application/json"
  21663. c.urlParams_.Set("alt", alt)
  21664. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances")
  21665. urls += "?" + c.urlParams_.Encode()
  21666. req, _ := http.NewRequest("POST", urls, body)
  21667. googleapi.Expand(req.URL, map[string]string{
  21668. "project": c.project,
  21669. "zone": c.zone,
  21670. "instanceGroup": c.instanceGroup,
  21671. })
  21672. req.Header.Set("Content-Type", ctype)
  21673. req.Header.Set("User-Agent", c.s.userAgent())
  21674. if c.ctx_ != nil {
  21675. return ctxhttp.Do(c.ctx_, c.s.client, req)
  21676. }
  21677. return c.s.client.Do(req)
  21678. }
  21679. // Do executes the "compute.instanceGroups.removeInstances" call.
  21680. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  21681. // status code is an error. Response headers are in either
  21682. // *Operation.ServerResponse.Header or (if a response was returned at
  21683. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  21684. // to check whether the returned error was because
  21685. // http.StatusNotModified was returned.
  21686. func (c *InstanceGroupsRemoveInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  21687. gensupport.SetOptions(c.urlParams_, opts...)
  21688. res, err := c.doRequest("json")
  21689. if res != nil && res.StatusCode == http.StatusNotModified {
  21690. if res.Body != nil {
  21691. res.Body.Close()
  21692. }
  21693. return nil, &googleapi.Error{
  21694. Code: res.StatusCode,
  21695. Header: res.Header,
  21696. }
  21697. }
  21698. if err != nil {
  21699. return nil, err
  21700. }
  21701. defer googleapi.CloseBody(res)
  21702. if err := googleapi.CheckResponse(res); err != nil {
  21703. return nil, err
  21704. }
  21705. ret := &Operation{
  21706. ServerResponse: googleapi.ServerResponse{
  21707. Header: res.Header,
  21708. HTTPStatusCode: res.StatusCode,
  21709. },
  21710. }
  21711. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  21712. return nil, err
  21713. }
  21714. return ret, nil
  21715. // {
  21716. // "description": "Removes one or more instances from the specified instance group, but does not delete those instances.",
  21717. // "httpMethod": "POST",
  21718. // "id": "compute.instanceGroups.removeInstances",
  21719. // "parameterOrder": [
  21720. // "project",
  21721. // "zone",
  21722. // "instanceGroup"
  21723. // ],
  21724. // "parameters": {
  21725. // "instanceGroup": {
  21726. // "description": "The name of the instance group where the specified instances will be removed.",
  21727. // "location": "path",
  21728. // "required": true,
  21729. // "type": "string"
  21730. // },
  21731. // "project": {
  21732. // "description": "Project ID for this request.",
  21733. // "location": "path",
  21734. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  21735. // "required": true,
  21736. // "type": "string"
  21737. // },
  21738. // "zone": {
  21739. // "description": "The name of the zone where the instance group is located.",
  21740. // "location": "path",
  21741. // "required": true,
  21742. // "type": "string"
  21743. // }
  21744. // },
  21745. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances",
  21746. // "request": {
  21747. // "$ref": "InstanceGroupsRemoveInstancesRequest"
  21748. // },
  21749. // "response": {
  21750. // "$ref": "Operation"
  21751. // },
  21752. // "scopes": [
  21753. // "https://www.googleapis.com/auth/cloud-platform",
  21754. // "https://www.googleapis.com/auth/compute"
  21755. // ]
  21756. // }
  21757. }
  21758. // method id "compute.instanceGroups.setNamedPorts":
  21759. type InstanceGroupsSetNamedPortsCall struct {
  21760. s *Service
  21761. project string
  21762. zone string
  21763. instanceGroup string
  21764. instancegroupssetnamedportsrequest *InstanceGroupsSetNamedPortsRequest
  21765. urlParams_ gensupport.URLParams
  21766. ctx_ context.Context
  21767. }
  21768. // SetNamedPorts: Sets the named ports for the specified instance group.
  21769. func (r *InstanceGroupsService) SetNamedPorts(project string, zone string, instanceGroup string, instancegroupssetnamedportsrequest *InstanceGroupsSetNamedPortsRequest) *InstanceGroupsSetNamedPortsCall {
  21770. c := &InstanceGroupsSetNamedPortsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21771. c.project = project
  21772. c.zone = zone
  21773. c.instanceGroup = instanceGroup
  21774. c.instancegroupssetnamedportsrequest = instancegroupssetnamedportsrequest
  21775. return c
  21776. }
  21777. // Fields allows partial responses to be retrieved. See
  21778. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21779. // for more information.
  21780. func (c *InstanceGroupsSetNamedPortsCall) Fields(s ...googleapi.Field) *InstanceGroupsSetNamedPortsCall {
  21781. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21782. return c
  21783. }
  21784. // Context sets the context to be used in this call's Do method. Any
  21785. // pending HTTP request will be aborted if the provided context is
  21786. // canceled.
  21787. func (c *InstanceGroupsSetNamedPortsCall) Context(ctx context.Context) *InstanceGroupsSetNamedPortsCall {
  21788. c.ctx_ = ctx
  21789. return c
  21790. }
  21791. func (c *InstanceGroupsSetNamedPortsCall) doRequest(alt string) (*http.Response, error) {
  21792. var body io.Reader = nil
  21793. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupssetnamedportsrequest)
  21794. if err != nil {
  21795. return nil, err
  21796. }
  21797. ctype := "application/json"
  21798. c.urlParams_.Set("alt", alt)
  21799. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts")
  21800. urls += "?" + c.urlParams_.Encode()
  21801. req, _ := http.NewRequest("POST", urls, body)
  21802. googleapi.Expand(req.URL, map[string]string{
  21803. "project": c.project,
  21804. "zone": c.zone,
  21805. "instanceGroup": c.instanceGroup,
  21806. })
  21807. req.Header.Set("Content-Type", ctype)
  21808. req.Header.Set("User-Agent", c.s.userAgent())
  21809. if c.ctx_ != nil {
  21810. return ctxhttp.Do(c.ctx_, c.s.client, req)
  21811. }
  21812. return c.s.client.Do(req)
  21813. }
  21814. // Do executes the "compute.instanceGroups.setNamedPorts" call.
  21815. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  21816. // status code is an error. Response headers are in either
  21817. // *Operation.ServerResponse.Header or (if a response was returned at
  21818. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  21819. // to check whether the returned error was because
  21820. // http.StatusNotModified was returned.
  21821. func (c *InstanceGroupsSetNamedPortsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  21822. gensupport.SetOptions(c.urlParams_, opts...)
  21823. res, err := c.doRequest("json")
  21824. if res != nil && res.StatusCode == http.StatusNotModified {
  21825. if res.Body != nil {
  21826. res.Body.Close()
  21827. }
  21828. return nil, &googleapi.Error{
  21829. Code: res.StatusCode,
  21830. Header: res.Header,
  21831. }
  21832. }
  21833. if err != nil {
  21834. return nil, err
  21835. }
  21836. defer googleapi.CloseBody(res)
  21837. if err := googleapi.CheckResponse(res); err != nil {
  21838. return nil, err
  21839. }
  21840. ret := &Operation{
  21841. ServerResponse: googleapi.ServerResponse{
  21842. Header: res.Header,
  21843. HTTPStatusCode: res.StatusCode,
  21844. },
  21845. }
  21846. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  21847. return nil, err
  21848. }
  21849. return ret, nil
  21850. // {
  21851. // "description": "Sets the named ports for the specified instance group.",
  21852. // "httpMethod": "POST",
  21853. // "id": "compute.instanceGroups.setNamedPorts",
  21854. // "parameterOrder": [
  21855. // "project",
  21856. // "zone",
  21857. // "instanceGroup"
  21858. // ],
  21859. // "parameters": {
  21860. // "instanceGroup": {
  21861. // "description": "The name of the instance group where the named ports are updated.",
  21862. // "location": "path",
  21863. // "required": true,
  21864. // "type": "string"
  21865. // },
  21866. // "project": {
  21867. // "description": "Project ID for this request.",
  21868. // "location": "path",
  21869. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  21870. // "required": true,
  21871. // "type": "string"
  21872. // },
  21873. // "zone": {
  21874. // "description": "The name of the zone where the instance group is located.",
  21875. // "location": "path",
  21876. // "required": true,
  21877. // "type": "string"
  21878. // }
  21879. // },
  21880. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts",
  21881. // "request": {
  21882. // "$ref": "InstanceGroupsSetNamedPortsRequest"
  21883. // },
  21884. // "response": {
  21885. // "$ref": "Operation"
  21886. // },
  21887. // "scopes": [
  21888. // "https://www.googleapis.com/auth/cloud-platform",
  21889. // "https://www.googleapis.com/auth/compute"
  21890. // ]
  21891. // }
  21892. }
  21893. // method id "compute.instanceTemplates.delete":
  21894. type InstanceTemplatesDeleteCall struct {
  21895. s *Service
  21896. project string
  21897. instanceTemplate string
  21898. urlParams_ gensupport.URLParams
  21899. ctx_ context.Context
  21900. }
  21901. // Delete: Deletes the specified instance template.
  21902. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/delete
  21903. func (r *InstanceTemplatesService) Delete(project string, instanceTemplate string) *InstanceTemplatesDeleteCall {
  21904. c := &InstanceTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21905. c.project = project
  21906. c.instanceTemplate = instanceTemplate
  21907. return c
  21908. }
  21909. // Fields allows partial responses to be retrieved. See
  21910. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21911. // for more information.
  21912. func (c *InstanceTemplatesDeleteCall) Fields(s ...googleapi.Field) *InstanceTemplatesDeleteCall {
  21913. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21914. return c
  21915. }
  21916. // Context sets the context to be used in this call's Do method. Any
  21917. // pending HTTP request will be aborted if the provided context is
  21918. // canceled.
  21919. func (c *InstanceTemplatesDeleteCall) Context(ctx context.Context) *InstanceTemplatesDeleteCall {
  21920. c.ctx_ = ctx
  21921. return c
  21922. }
  21923. func (c *InstanceTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  21924. var body io.Reader = nil
  21925. c.urlParams_.Set("alt", alt)
  21926. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{instanceTemplate}")
  21927. urls += "?" + c.urlParams_.Encode()
  21928. req, _ := http.NewRequest("DELETE", urls, body)
  21929. googleapi.Expand(req.URL, map[string]string{
  21930. "project": c.project,
  21931. "instanceTemplate": c.instanceTemplate,
  21932. })
  21933. req.Header.Set("User-Agent", c.s.userAgent())
  21934. if c.ctx_ != nil {
  21935. return ctxhttp.Do(c.ctx_, c.s.client, req)
  21936. }
  21937. return c.s.client.Do(req)
  21938. }
  21939. // Do executes the "compute.instanceTemplates.delete" call.
  21940. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  21941. // status code is an error. Response headers are in either
  21942. // *Operation.ServerResponse.Header or (if a response was returned at
  21943. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  21944. // to check whether the returned error was because
  21945. // http.StatusNotModified was returned.
  21946. func (c *InstanceTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  21947. gensupport.SetOptions(c.urlParams_, opts...)
  21948. res, err := c.doRequest("json")
  21949. if res != nil && res.StatusCode == http.StatusNotModified {
  21950. if res.Body != nil {
  21951. res.Body.Close()
  21952. }
  21953. return nil, &googleapi.Error{
  21954. Code: res.StatusCode,
  21955. Header: res.Header,
  21956. }
  21957. }
  21958. if err != nil {
  21959. return nil, err
  21960. }
  21961. defer googleapi.CloseBody(res)
  21962. if err := googleapi.CheckResponse(res); err != nil {
  21963. return nil, err
  21964. }
  21965. ret := &Operation{
  21966. ServerResponse: googleapi.ServerResponse{
  21967. Header: res.Header,
  21968. HTTPStatusCode: res.StatusCode,
  21969. },
  21970. }
  21971. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  21972. return nil, err
  21973. }
  21974. return ret, nil
  21975. // {
  21976. // "description": "Deletes the specified instance template.",
  21977. // "httpMethod": "DELETE",
  21978. // "id": "compute.instanceTemplates.delete",
  21979. // "parameterOrder": [
  21980. // "project",
  21981. // "instanceTemplate"
  21982. // ],
  21983. // "parameters": {
  21984. // "instanceTemplate": {
  21985. // "description": "The name of the instance template to delete.",
  21986. // "location": "path",
  21987. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  21988. // "required": true,
  21989. // "type": "string"
  21990. // },
  21991. // "project": {
  21992. // "description": "Project ID for this request.",
  21993. // "location": "path",
  21994. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  21995. // "required": true,
  21996. // "type": "string"
  21997. // }
  21998. // },
  21999. // "path": "{project}/global/instanceTemplates/{instanceTemplate}",
  22000. // "response": {
  22001. // "$ref": "Operation"
  22002. // },
  22003. // "scopes": [
  22004. // "https://www.googleapis.com/auth/cloud-platform",
  22005. // "https://www.googleapis.com/auth/compute"
  22006. // ]
  22007. // }
  22008. }
  22009. // method id "compute.instanceTemplates.get":
  22010. type InstanceTemplatesGetCall struct {
  22011. s *Service
  22012. project string
  22013. instanceTemplate string
  22014. urlParams_ gensupport.URLParams
  22015. ifNoneMatch_ string
  22016. ctx_ context.Context
  22017. }
  22018. // Get: Returns the specified instance template resource.
  22019. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/get
  22020. func (r *InstanceTemplatesService) Get(project string, instanceTemplate string) *InstanceTemplatesGetCall {
  22021. c := &InstanceTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22022. c.project = project
  22023. c.instanceTemplate = instanceTemplate
  22024. return c
  22025. }
  22026. // Fields allows partial responses to be retrieved. See
  22027. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22028. // for more information.
  22029. func (c *InstanceTemplatesGetCall) Fields(s ...googleapi.Field) *InstanceTemplatesGetCall {
  22030. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22031. return c
  22032. }
  22033. // IfNoneMatch sets the optional parameter which makes the operation
  22034. // fail if the object's ETag matches the given value. This is useful for
  22035. // getting updates only after the object has changed since the last
  22036. // request. Use googleapi.IsNotModified to check whether the response
  22037. // error from Do is the result of In-None-Match.
  22038. func (c *InstanceTemplatesGetCall) IfNoneMatch(entityTag string) *InstanceTemplatesGetCall {
  22039. c.ifNoneMatch_ = entityTag
  22040. return c
  22041. }
  22042. // Context sets the context to be used in this call's Do method. Any
  22043. // pending HTTP request will be aborted if the provided context is
  22044. // canceled.
  22045. func (c *InstanceTemplatesGetCall) Context(ctx context.Context) *InstanceTemplatesGetCall {
  22046. c.ctx_ = ctx
  22047. return c
  22048. }
  22049. func (c *InstanceTemplatesGetCall) doRequest(alt string) (*http.Response, error) {
  22050. var body io.Reader = nil
  22051. c.urlParams_.Set("alt", alt)
  22052. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{instanceTemplate}")
  22053. urls += "?" + c.urlParams_.Encode()
  22054. req, _ := http.NewRequest("GET", urls, body)
  22055. googleapi.Expand(req.URL, map[string]string{
  22056. "project": c.project,
  22057. "instanceTemplate": c.instanceTemplate,
  22058. })
  22059. req.Header.Set("User-Agent", c.s.userAgent())
  22060. if c.ifNoneMatch_ != "" {
  22061. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  22062. }
  22063. if c.ctx_ != nil {
  22064. return ctxhttp.Do(c.ctx_, c.s.client, req)
  22065. }
  22066. return c.s.client.Do(req)
  22067. }
  22068. // Do executes the "compute.instanceTemplates.get" call.
  22069. // Exactly one of *InstanceTemplate or error will be non-nil. Any
  22070. // non-2xx status code is an error. Response headers are in either
  22071. // *InstanceTemplate.ServerResponse.Header or (if a response was
  22072. // returned at all) in error.(*googleapi.Error).Header. Use
  22073. // googleapi.IsNotModified to check whether the returned error was
  22074. // because http.StatusNotModified was returned.
  22075. func (c *InstanceTemplatesGetCall) Do(opts ...googleapi.CallOption) (*InstanceTemplate, error) {
  22076. gensupport.SetOptions(c.urlParams_, opts...)
  22077. res, err := c.doRequest("json")
  22078. if res != nil && res.StatusCode == http.StatusNotModified {
  22079. if res.Body != nil {
  22080. res.Body.Close()
  22081. }
  22082. return nil, &googleapi.Error{
  22083. Code: res.StatusCode,
  22084. Header: res.Header,
  22085. }
  22086. }
  22087. if err != nil {
  22088. return nil, err
  22089. }
  22090. defer googleapi.CloseBody(res)
  22091. if err := googleapi.CheckResponse(res); err != nil {
  22092. return nil, err
  22093. }
  22094. ret := &InstanceTemplate{
  22095. ServerResponse: googleapi.ServerResponse{
  22096. Header: res.Header,
  22097. HTTPStatusCode: res.StatusCode,
  22098. },
  22099. }
  22100. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  22101. return nil, err
  22102. }
  22103. return ret, nil
  22104. // {
  22105. // "description": "Returns the specified instance template resource.",
  22106. // "httpMethod": "GET",
  22107. // "id": "compute.instanceTemplates.get",
  22108. // "parameterOrder": [
  22109. // "project",
  22110. // "instanceTemplate"
  22111. // ],
  22112. // "parameters": {
  22113. // "instanceTemplate": {
  22114. // "description": "The name of the instance template.",
  22115. // "location": "path",
  22116. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  22117. // "required": true,
  22118. // "type": "string"
  22119. // },
  22120. // "project": {
  22121. // "description": "Project ID for this request.",
  22122. // "location": "path",
  22123. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  22124. // "required": true,
  22125. // "type": "string"
  22126. // }
  22127. // },
  22128. // "path": "{project}/global/instanceTemplates/{instanceTemplate}",
  22129. // "response": {
  22130. // "$ref": "InstanceTemplate"
  22131. // },
  22132. // "scopes": [
  22133. // "https://www.googleapis.com/auth/cloud-platform",
  22134. // "https://www.googleapis.com/auth/compute",
  22135. // "https://www.googleapis.com/auth/compute.readonly"
  22136. // ]
  22137. // }
  22138. }
  22139. // method id "compute.instanceTemplates.insert":
  22140. type InstanceTemplatesInsertCall struct {
  22141. s *Service
  22142. project string
  22143. instancetemplate *InstanceTemplate
  22144. urlParams_ gensupport.URLParams
  22145. ctx_ context.Context
  22146. }
  22147. // Insert: Creates an instance template in the specified project using
  22148. // the data that is included in the request. If you are creating a new
  22149. // template to update an existing instance group, your new instance
  22150. // template must use the same network or, if applicable, the same
  22151. // subnetwork as the original template.
  22152. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/insert
  22153. func (r *InstanceTemplatesService) Insert(project string, instancetemplate *InstanceTemplate) *InstanceTemplatesInsertCall {
  22154. c := &InstanceTemplatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22155. c.project = project
  22156. c.instancetemplate = instancetemplate
  22157. return c
  22158. }
  22159. // Fields allows partial responses to be retrieved. See
  22160. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22161. // for more information.
  22162. func (c *InstanceTemplatesInsertCall) Fields(s ...googleapi.Field) *InstanceTemplatesInsertCall {
  22163. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22164. return c
  22165. }
  22166. // Context sets the context to be used in this call's Do method. Any
  22167. // pending HTTP request will be aborted if the provided context is
  22168. // canceled.
  22169. func (c *InstanceTemplatesInsertCall) Context(ctx context.Context) *InstanceTemplatesInsertCall {
  22170. c.ctx_ = ctx
  22171. return c
  22172. }
  22173. func (c *InstanceTemplatesInsertCall) doRequest(alt string) (*http.Response, error) {
  22174. var body io.Reader = nil
  22175. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancetemplate)
  22176. if err != nil {
  22177. return nil, err
  22178. }
  22179. ctype := "application/json"
  22180. c.urlParams_.Set("alt", alt)
  22181. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates")
  22182. urls += "?" + c.urlParams_.Encode()
  22183. req, _ := http.NewRequest("POST", urls, body)
  22184. googleapi.Expand(req.URL, map[string]string{
  22185. "project": c.project,
  22186. })
  22187. req.Header.Set("Content-Type", ctype)
  22188. req.Header.Set("User-Agent", c.s.userAgent())
  22189. if c.ctx_ != nil {
  22190. return ctxhttp.Do(c.ctx_, c.s.client, req)
  22191. }
  22192. return c.s.client.Do(req)
  22193. }
  22194. // Do executes the "compute.instanceTemplates.insert" call.
  22195. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  22196. // status code is an error. Response headers are in either
  22197. // *Operation.ServerResponse.Header or (if a response was returned at
  22198. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  22199. // to check whether the returned error was because
  22200. // http.StatusNotModified was returned.
  22201. func (c *InstanceTemplatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  22202. gensupport.SetOptions(c.urlParams_, opts...)
  22203. res, err := c.doRequest("json")
  22204. if res != nil && res.StatusCode == http.StatusNotModified {
  22205. if res.Body != nil {
  22206. res.Body.Close()
  22207. }
  22208. return nil, &googleapi.Error{
  22209. Code: res.StatusCode,
  22210. Header: res.Header,
  22211. }
  22212. }
  22213. if err != nil {
  22214. return nil, err
  22215. }
  22216. defer googleapi.CloseBody(res)
  22217. if err := googleapi.CheckResponse(res); err != nil {
  22218. return nil, err
  22219. }
  22220. ret := &Operation{
  22221. ServerResponse: googleapi.ServerResponse{
  22222. Header: res.Header,
  22223. HTTPStatusCode: res.StatusCode,
  22224. },
  22225. }
  22226. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  22227. return nil, err
  22228. }
  22229. return ret, nil
  22230. // {
  22231. // "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.",
  22232. // "httpMethod": "POST",
  22233. // "id": "compute.instanceTemplates.insert",
  22234. // "parameterOrder": [
  22235. // "project"
  22236. // ],
  22237. // "parameters": {
  22238. // "project": {
  22239. // "description": "Project ID for this request.",
  22240. // "location": "path",
  22241. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  22242. // "required": true,
  22243. // "type": "string"
  22244. // }
  22245. // },
  22246. // "path": "{project}/global/instanceTemplates",
  22247. // "request": {
  22248. // "$ref": "InstanceTemplate"
  22249. // },
  22250. // "response": {
  22251. // "$ref": "Operation"
  22252. // },
  22253. // "scopes": [
  22254. // "https://www.googleapis.com/auth/cloud-platform",
  22255. // "https://www.googleapis.com/auth/compute"
  22256. // ]
  22257. // }
  22258. }
  22259. // method id "compute.instanceTemplates.list":
  22260. type InstanceTemplatesListCall struct {
  22261. s *Service
  22262. project string
  22263. urlParams_ gensupport.URLParams
  22264. ifNoneMatch_ string
  22265. ctx_ context.Context
  22266. }
  22267. // List: Retrieves a list of instance templates that are contained
  22268. // within the specified project and zone.
  22269. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/list
  22270. func (r *InstanceTemplatesService) List(project string) *InstanceTemplatesListCall {
  22271. c := &InstanceTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22272. c.project = project
  22273. return c
  22274. }
  22275. // Filter sets the optional parameter "filter": Sets a filter expression
  22276. // for filtering listed resources, in the form filter={expression}. Your
  22277. // {expression} must be in the format: field_name comparison_string
  22278. // literal_string.
  22279. //
  22280. // The field_name is the name of the field you want to compare. Only
  22281. // atomic field types are supported (string, number, boolean). The
  22282. // comparison_string must be either eq (equals) or ne (not equals). The
  22283. // literal_string is the string value to filter to. The literal value
  22284. // must be valid for the type of field you are filtering by (string,
  22285. // number, boolean). For string fields, the literal value is interpreted
  22286. // as a regular expression using RE2 syntax. The literal value must
  22287. // match the entire field.
  22288. //
  22289. // For example, filter=name ne example-instance.
  22290. //
  22291. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  22292. // you can also filter on nested fields. For example, you could filter
  22293. // on instances that have set the scheduling.automaticRestart field to
  22294. // true. In particular, use filtering on nested fields to take advantage
  22295. // of instance labels to organize and filter results based on label
  22296. // values.
  22297. //
  22298. // The Beta API also supports filtering on multiple expressions by
  22299. // providing each separate expression within parentheses. For example,
  22300. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  22301. // Multiple expressions are treated as AND expressions meaning that
  22302. // resources must match all expressions to pass the filters.
  22303. func (c *InstanceTemplatesListCall) Filter(filter string) *InstanceTemplatesListCall {
  22304. c.urlParams_.Set("filter", filter)
  22305. return c
  22306. }
  22307. // MaxResults sets the optional parameter "maxResults": The maximum
  22308. // number of results per page that Compute Engine should return. If the
  22309. // number of available results is larger than maxResults, Compute Engine
  22310. // returns a nextPageToken that can be used to get the next page of
  22311. // results in subsequent list requests.
  22312. func (c *InstanceTemplatesListCall) MaxResults(maxResults int64) *InstanceTemplatesListCall {
  22313. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  22314. return c
  22315. }
  22316. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  22317. // a certain order. By default, results are returned in alphanumerical
  22318. // order based on the resource name.
  22319. //
  22320. // You can also sort results in descending order based on the creation
  22321. // timestamp using orderBy="creationTimestamp desc". This sorts results
  22322. // based on the creationTimestamp field in reverse chronological order
  22323. // (newest result first). Use this to sort resources like operations so
  22324. // that the newest operation is returned first.
  22325. //
  22326. // Currently, only sorting by name or creationTimestamp desc is
  22327. // supported.
  22328. func (c *InstanceTemplatesListCall) OrderBy(orderBy string) *InstanceTemplatesListCall {
  22329. c.urlParams_.Set("orderBy", orderBy)
  22330. return c
  22331. }
  22332. // PageToken sets the optional parameter "pageToken": Specifies a page
  22333. // token to use. Set pageToken to the nextPageToken returned by a
  22334. // previous list request to get the next page of results.
  22335. func (c *InstanceTemplatesListCall) PageToken(pageToken string) *InstanceTemplatesListCall {
  22336. c.urlParams_.Set("pageToken", pageToken)
  22337. return c
  22338. }
  22339. // Fields allows partial responses to be retrieved. See
  22340. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22341. // for more information.
  22342. func (c *InstanceTemplatesListCall) Fields(s ...googleapi.Field) *InstanceTemplatesListCall {
  22343. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22344. return c
  22345. }
  22346. // IfNoneMatch sets the optional parameter which makes the operation
  22347. // fail if the object's ETag matches the given value. This is useful for
  22348. // getting updates only after the object has changed since the last
  22349. // request. Use googleapi.IsNotModified to check whether the response
  22350. // error from Do is the result of In-None-Match.
  22351. func (c *InstanceTemplatesListCall) IfNoneMatch(entityTag string) *InstanceTemplatesListCall {
  22352. c.ifNoneMatch_ = entityTag
  22353. return c
  22354. }
  22355. // Context sets the context to be used in this call's Do method. Any
  22356. // pending HTTP request will be aborted if the provided context is
  22357. // canceled.
  22358. func (c *InstanceTemplatesListCall) Context(ctx context.Context) *InstanceTemplatesListCall {
  22359. c.ctx_ = ctx
  22360. return c
  22361. }
  22362. func (c *InstanceTemplatesListCall) doRequest(alt string) (*http.Response, error) {
  22363. var body io.Reader = nil
  22364. c.urlParams_.Set("alt", alt)
  22365. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates")
  22366. urls += "?" + c.urlParams_.Encode()
  22367. req, _ := http.NewRequest("GET", urls, body)
  22368. googleapi.Expand(req.URL, map[string]string{
  22369. "project": c.project,
  22370. })
  22371. req.Header.Set("User-Agent", c.s.userAgent())
  22372. if c.ifNoneMatch_ != "" {
  22373. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  22374. }
  22375. if c.ctx_ != nil {
  22376. return ctxhttp.Do(c.ctx_, c.s.client, req)
  22377. }
  22378. return c.s.client.Do(req)
  22379. }
  22380. // Do executes the "compute.instanceTemplates.list" call.
  22381. // Exactly one of *InstanceTemplateList or error will be non-nil. Any
  22382. // non-2xx status code is an error. Response headers are in either
  22383. // *InstanceTemplateList.ServerResponse.Header or (if a response was
  22384. // returned at all) in error.(*googleapi.Error).Header. Use
  22385. // googleapi.IsNotModified to check whether the returned error was
  22386. // because http.StatusNotModified was returned.
  22387. func (c *InstanceTemplatesListCall) Do(opts ...googleapi.CallOption) (*InstanceTemplateList, error) {
  22388. gensupport.SetOptions(c.urlParams_, opts...)
  22389. res, err := c.doRequest("json")
  22390. if res != nil && res.StatusCode == http.StatusNotModified {
  22391. if res.Body != nil {
  22392. res.Body.Close()
  22393. }
  22394. return nil, &googleapi.Error{
  22395. Code: res.StatusCode,
  22396. Header: res.Header,
  22397. }
  22398. }
  22399. if err != nil {
  22400. return nil, err
  22401. }
  22402. defer googleapi.CloseBody(res)
  22403. if err := googleapi.CheckResponse(res); err != nil {
  22404. return nil, err
  22405. }
  22406. ret := &InstanceTemplateList{
  22407. ServerResponse: googleapi.ServerResponse{
  22408. Header: res.Header,
  22409. HTTPStatusCode: res.StatusCode,
  22410. },
  22411. }
  22412. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  22413. return nil, err
  22414. }
  22415. return ret, nil
  22416. // {
  22417. // "description": "Retrieves a list of instance templates that are contained within the specified project and zone.",
  22418. // "httpMethod": "GET",
  22419. // "id": "compute.instanceTemplates.list",
  22420. // "parameterOrder": [
  22421. // "project"
  22422. // ],
  22423. // "parameters": {
  22424. // "filter": {
  22425. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  22426. // "location": "query",
  22427. // "type": "string"
  22428. // },
  22429. // "maxResults": {
  22430. // "default": "500",
  22431. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  22432. // "format": "uint32",
  22433. // "location": "query",
  22434. // "maximum": "500",
  22435. // "minimum": "0",
  22436. // "type": "integer"
  22437. // },
  22438. // "orderBy": {
  22439. // "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.",
  22440. // "location": "query",
  22441. // "type": "string"
  22442. // },
  22443. // "pageToken": {
  22444. // "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.",
  22445. // "location": "query",
  22446. // "type": "string"
  22447. // },
  22448. // "project": {
  22449. // "description": "Project ID for this request.",
  22450. // "location": "path",
  22451. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  22452. // "required": true,
  22453. // "type": "string"
  22454. // }
  22455. // },
  22456. // "path": "{project}/global/instanceTemplates",
  22457. // "response": {
  22458. // "$ref": "InstanceTemplateList"
  22459. // },
  22460. // "scopes": [
  22461. // "https://www.googleapis.com/auth/cloud-platform",
  22462. // "https://www.googleapis.com/auth/compute",
  22463. // "https://www.googleapis.com/auth/compute.readonly"
  22464. // ]
  22465. // }
  22466. }
  22467. // Pages invokes f for each page of results.
  22468. // A non-nil error returned from f will halt the iteration.
  22469. // The provided context supersedes any context provided to the Context method.
  22470. func (c *InstanceTemplatesListCall) Pages(ctx context.Context, f func(*InstanceTemplateList) error) error {
  22471. c.ctx_ = ctx
  22472. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  22473. for {
  22474. x, err := c.Do()
  22475. if err != nil {
  22476. return err
  22477. }
  22478. if err := f(x); err != nil {
  22479. return err
  22480. }
  22481. if x.NextPageToken == "" {
  22482. return nil
  22483. }
  22484. c.PageToken(x.NextPageToken)
  22485. }
  22486. }
  22487. // method id "compute.instances.addAccessConfig":
  22488. type InstancesAddAccessConfigCall struct {
  22489. s *Service
  22490. project string
  22491. zone string
  22492. instance string
  22493. accessconfig *AccessConfig
  22494. urlParams_ gensupport.URLParams
  22495. ctx_ context.Context
  22496. }
  22497. // AddAccessConfig: Adds an access config to an instance's network
  22498. // interface.
  22499. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/addAccessConfig
  22500. func (r *InstancesService) AddAccessConfig(project string, zone string, instance string, networkInterface string, accessconfig *AccessConfig) *InstancesAddAccessConfigCall {
  22501. c := &InstancesAddAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22502. c.project = project
  22503. c.zone = zone
  22504. c.instance = instance
  22505. c.urlParams_.Set("networkInterface", networkInterface)
  22506. c.accessconfig = accessconfig
  22507. return c
  22508. }
  22509. // Fields allows partial responses to be retrieved. See
  22510. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22511. // for more information.
  22512. func (c *InstancesAddAccessConfigCall) Fields(s ...googleapi.Field) *InstancesAddAccessConfigCall {
  22513. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22514. return c
  22515. }
  22516. // Context sets the context to be used in this call's Do method. Any
  22517. // pending HTTP request will be aborted if the provided context is
  22518. // canceled.
  22519. func (c *InstancesAddAccessConfigCall) Context(ctx context.Context) *InstancesAddAccessConfigCall {
  22520. c.ctx_ = ctx
  22521. return c
  22522. }
  22523. func (c *InstancesAddAccessConfigCall) doRequest(alt string) (*http.Response, error) {
  22524. var body io.Reader = nil
  22525. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessconfig)
  22526. if err != nil {
  22527. return nil, err
  22528. }
  22529. ctype := "application/json"
  22530. c.urlParams_.Set("alt", alt)
  22531. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/addAccessConfig")
  22532. urls += "?" + c.urlParams_.Encode()
  22533. req, _ := http.NewRequest("POST", urls, body)
  22534. googleapi.Expand(req.URL, map[string]string{
  22535. "project": c.project,
  22536. "zone": c.zone,
  22537. "instance": c.instance,
  22538. })
  22539. req.Header.Set("Content-Type", ctype)
  22540. req.Header.Set("User-Agent", c.s.userAgent())
  22541. if c.ctx_ != nil {
  22542. return ctxhttp.Do(c.ctx_, c.s.client, req)
  22543. }
  22544. return c.s.client.Do(req)
  22545. }
  22546. // Do executes the "compute.instances.addAccessConfig" call.
  22547. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  22548. // status code is an error. Response headers are in either
  22549. // *Operation.ServerResponse.Header or (if a response was returned at
  22550. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  22551. // to check whether the returned error was because
  22552. // http.StatusNotModified was returned.
  22553. func (c *InstancesAddAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  22554. gensupport.SetOptions(c.urlParams_, opts...)
  22555. res, err := c.doRequest("json")
  22556. if res != nil && res.StatusCode == http.StatusNotModified {
  22557. if res.Body != nil {
  22558. res.Body.Close()
  22559. }
  22560. return nil, &googleapi.Error{
  22561. Code: res.StatusCode,
  22562. Header: res.Header,
  22563. }
  22564. }
  22565. if err != nil {
  22566. return nil, err
  22567. }
  22568. defer googleapi.CloseBody(res)
  22569. if err := googleapi.CheckResponse(res); err != nil {
  22570. return nil, err
  22571. }
  22572. ret := &Operation{
  22573. ServerResponse: googleapi.ServerResponse{
  22574. Header: res.Header,
  22575. HTTPStatusCode: res.StatusCode,
  22576. },
  22577. }
  22578. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  22579. return nil, err
  22580. }
  22581. return ret, nil
  22582. // {
  22583. // "description": "Adds an access config to an instance's network interface.",
  22584. // "httpMethod": "POST",
  22585. // "id": "compute.instances.addAccessConfig",
  22586. // "parameterOrder": [
  22587. // "project",
  22588. // "zone",
  22589. // "instance",
  22590. // "networkInterface"
  22591. // ],
  22592. // "parameters": {
  22593. // "instance": {
  22594. // "description": "The instance name for this request.",
  22595. // "location": "path",
  22596. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  22597. // "required": true,
  22598. // "type": "string"
  22599. // },
  22600. // "networkInterface": {
  22601. // "description": "The name of the network interface to add to this instance.",
  22602. // "location": "query",
  22603. // "required": true,
  22604. // "type": "string"
  22605. // },
  22606. // "project": {
  22607. // "description": "Project ID for this request.",
  22608. // "location": "path",
  22609. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  22610. // "required": true,
  22611. // "type": "string"
  22612. // },
  22613. // "zone": {
  22614. // "description": "The name of the zone for this request.",
  22615. // "location": "path",
  22616. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  22617. // "required": true,
  22618. // "type": "string"
  22619. // }
  22620. // },
  22621. // "path": "{project}/zones/{zone}/instances/{instance}/addAccessConfig",
  22622. // "request": {
  22623. // "$ref": "AccessConfig"
  22624. // },
  22625. // "response": {
  22626. // "$ref": "Operation"
  22627. // },
  22628. // "scopes": [
  22629. // "https://www.googleapis.com/auth/cloud-platform",
  22630. // "https://www.googleapis.com/auth/compute"
  22631. // ]
  22632. // }
  22633. }
  22634. // method id "compute.instances.aggregatedList":
  22635. type InstancesAggregatedListCall struct {
  22636. s *Service
  22637. project string
  22638. urlParams_ gensupport.URLParams
  22639. ifNoneMatch_ string
  22640. ctx_ context.Context
  22641. }
  22642. // AggregatedList: Retrieves aggregated list of instance resources.
  22643. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/aggregatedList
  22644. func (r *InstancesService) AggregatedList(project string) *InstancesAggregatedListCall {
  22645. c := &InstancesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22646. c.project = project
  22647. return c
  22648. }
  22649. // Filter sets the optional parameter "filter": Sets a filter expression
  22650. // for filtering listed resources, in the form filter={expression}. Your
  22651. // {expression} must be in the format: field_name comparison_string
  22652. // literal_string.
  22653. //
  22654. // The field_name is the name of the field you want to compare. Only
  22655. // atomic field types are supported (string, number, boolean). The
  22656. // comparison_string must be either eq (equals) or ne (not equals). The
  22657. // literal_string is the string value to filter to. The literal value
  22658. // must be valid for the type of field you are filtering by (string,
  22659. // number, boolean). For string fields, the literal value is interpreted
  22660. // as a regular expression using RE2 syntax. The literal value must
  22661. // match the entire field.
  22662. //
  22663. // For example, filter=name ne example-instance.
  22664. //
  22665. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  22666. // you can also filter on nested fields. For example, you could filter
  22667. // on instances that have set the scheduling.automaticRestart field to
  22668. // true. In particular, use filtering on nested fields to take advantage
  22669. // of instance labels to organize and filter results based on label
  22670. // values.
  22671. //
  22672. // The Beta API also supports filtering on multiple expressions by
  22673. // providing each separate expression within parentheses. For example,
  22674. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  22675. // Multiple expressions are treated as AND expressions meaning that
  22676. // resources must match all expressions to pass the filters.
  22677. func (c *InstancesAggregatedListCall) Filter(filter string) *InstancesAggregatedListCall {
  22678. c.urlParams_.Set("filter", filter)
  22679. return c
  22680. }
  22681. // MaxResults sets the optional parameter "maxResults": The maximum
  22682. // number of results per page that Compute Engine should return. If the
  22683. // number of available results is larger than maxResults, Compute Engine
  22684. // returns a nextPageToken that can be used to get the next page of
  22685. // results in subsequent list requests.
  22686. func (c *InstancesAggregatedListCall) MaxResults(maxResults int64) *InstancesAggregatedListCall {
  22687. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  22688. return c
  22689. }
  22690. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  22691. // a certain order. By default, results are returned in alphanumerical
  22692. // order based on the resource name.
  22693. //
  22694. // You can also sort results in descending order based on the creation
  22695. // timestamp using orderBy="creationTimestamp desc". This sorts results
  22696. // based on the creationTimestamp field in reverse chronological order
  22697. // (newest result first). Use this to sort resources like operations so
  22698. // that the newest operation is returned first.
  22699. //
  22700. // Currently, only sorting by name or creationTimestamp desc is
  22701. // supported.
  22702. func (c *InstancesAggregatedListCall) OrderBy(orderBy string) *InstancesAggregatedListCall {
  22703. c.urlParams_.Set("orderBy", orderBy)
  22704. return c
  22705. }
  22706. // PageToken sets the optional parameter "pageToken": Specifies a page
  22707. // token to use. Set pageToken to the nextPageToken returned by a
  22708. // previous list request to get the next page of results.
  22709. func (c *InstancesAggregatedListCall) PageToken(pageToken string) *InstancesAggregatedListCall {
  22710. c.urlParams_.Set("pageToken", pageToken)
  22711. return c
  22712. }
  22713. // Fields allows partial responses to be retrieved. See
  22714. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22715. // for more information.
  22716. func (c *InstancesAggregatedListCall) Fields(s ...googleapi.Field) *InstancesAggregatedListCall {
  22717. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22718. return c
  22719. }
  22720. // IfNoneMatch sets the optional parameter which makes the operation
  22721. // fail if the object's ETag matches the given value. This is useful for
  22722. // getting updates only after the object has changed since the last
  22723. // request. Use googleapi.IsNotModified to check whether the response
  22724. // error from Do is the result of In-None-Match.
  22725. func (c *InstancesAggregatedListCall) IfNoneMatch(entityTag string) *InstancesAggregatedListCall {
  22726. c.ifNoneMatch_ = entityTag
  22727. return c
  22728. }
  22729. // Context sets the context to be used in this call's Do method. Any
  22730. // pending HTTP request will be aborted if the provided context is
  22731. // canceled.
  22732. func (c *InstancesAggregatedListCall) Context(ctx context.Context) *InstancesAggregatedListCall {
  22733. c.ctx_ = ctx
  22734. return c
  22735. }
  22736. func (c *InstancesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  22737. var body io.Reader = nil
  22738. c.urlParams_.Set("alt", alt)
  22739. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instances")
  22740. urls += "?" + c.urlParams_.Encode()
  22741. req, _ := http.NewRequest("GET", urls, body)
  22742. googleapi.Expand(req.URL, map[string]string{
  22743. "project": c.project,
  22744. })
  22745. req.Header.Set("User-Agent", c.s.userAgent())
  22746. if c.ifNoneMatch_ != "" {
  22747. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  22748. }
  22749. if c.ctx_ != nil {
  22750. return ctxhttp.Do(c.ctx_, c.s.client, req)
  22751. }
  22752. return c.s.client.Do(req)
  22753. }
  22754. // Do executes the "compute.instances.aggregatedList" call.
  22755. // Exactly one of *InstanceAggregatedList or error will be non-nil. Any
  22756. // non-2xx status code is an error. Response headers are in either
  22757. // *InstanceAggregatedList.ServerResponse.Header or (if a response was
  22758. // returned at all) in error.(*googleapi.Error).Header. Use
  22759. // googleapi.IsNotModified to check whether the returned error was
  22760. // because http.StatusNotModified was returned.
  22761. func (c *InstancesAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceAggregatedList, error) {
  22762. gensupport.SetOptions(c.urlParams_, opts...)
  22763. res, err := c.doRequest("json")
  22764. if res != nil && res.StatusCode == http.StatusNotModified {
  22765. if res.Body != nil {
  22766. res.Body.Close()
  22767. }
  22768. return nil, &googleapi.Error{
  22769. Code: res.StatusCode,
  22770. Header: res.Header,
  22771. }
  22772. }
  22773. if err != nil {
  22774. return nil, err
  22775. }
  22776. defer googleapi.CloseBody(res)
  22777. if err := googleapi.CheckResponse(res); err != nil {
  22778. return nil, err
  22779. }
  22780. ret := &InstanceAggregatedList{
  22781. ServerResponse: googleapi.ServerResponse{
  22782. Header: res.Header,
  22783. HTTPStatusCode: res.StatusCode,
  22784. },
  22785. }
  22786. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  22787. return nil, err
  22788. }
  22789. return ret, nil
  22790. // {
  22791. // "description": "Retrieves aggregated list of instance resources.",
  22792. // "httpMethod": "GET",
  22793. // "id": "compute.instances.aggregatedList",
  22794. // "parameterOrder": [
  22795. // "project"
  22796. // ],
  22797. // "parameters": {
  22798. // "filter": {
  22799. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  22800. // "location": "query",
  22801. // "type": "string"
  22802. // },
  22803. // "maxResults": {
  22804. // "default": "500",
  22805. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  22806. // "format": "uint32",
  22807. // "location": "query",
  22808. // "maximum": "500",
  22809. // "minimum": "0",
  22810. // "type": "integer"
  22811. // },
  22812. // "orderBy": {
  22813. // "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.",
  22814. // "location": "query",
  22815. // "type": "string"
  22816. // },
  22817. // "pageToken": {
  22818. // "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.",
  22819. // "location": "query",
  22820. // "type": "string"
  22821. // },
  22822. // "project": {
  22823. // "description": "Project ID for this request.",
  22824. // "location": "path",
  22825. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  22826. // "required": true,
  22827. // "type": "string"
  22828. // }
  22829. // },
  22830. // "path": "{project}/aggregated/instances",
  22831. // "response": {
  22832. // "$ref": "InstanceAggregatedList"
  22833. // },
  22834. // "scopes": [
  22835. // "https://www.googleapis.com/auth/cloud-platform",
  22836. // "https://www.googleapis.com/auth/compute",
  22837. // "https://www.googleapis.com/auth/compute.readonly"
  22838. // ]
  22839. // }
  22840. }
  22841. // Pages invokes f for each page of results.
  22842. // A non-nil error returned from f will halt the iteration.
  22843. // The provided context supersedes any context provided to the Context method.
  22844. func (c *InstancesAggregatedListCall) Pages(ctx context.Context, f func(*InstanceAggregatedList) error) error {
  22845. c.ctx_ = ctx
  22846. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  22847. for {
  22848. x, err := c.Do()
  22849. if err != nil {
  22850. return err
  22851. }
  22852. if err := f(x); err != nil {
  22853. return err
  22854. }
  22855. if x.NextPageToken == "" {
  22856. return nil
  22857. }
  22858. c.PageToken(x.NextPageToken)
  22859. }
  22860. }
  22861. // method id "compute.instances.attachDisk":
  22862. type InstancesAttachDiskCall struct {
  22863. s *Service
  22864. project string
  22865. zone string
  22866. instance string
  22867. attacheddisk *AttachedDisk
  22868. urlParams_ gensupport.URLParams
  22869. ctx_ context.Context
  22870. }
  22871. // AttachDisk: Attaches a Disk resource to an instance.
  22872. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/attachDisk
  22873. func (r *InstancesService) AttachDisk(project string, zone string, instance string, attacheddisk *AttachedDisk) *InstancesAttachDiskCall {
  22874. c := &InstancesAttachDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22875. c.project = project
  22876. c.zone = zone
  22877. c.instance = instance
  22878. c.attacheddisk = attacheddisk
  22879. return c
  22880. }
  22881. // Fields allows partial responses to be retrieved. See
  22882. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22883. // for more information.
  22884. func (c *InstancesAttachDiskCall) Fields(s ...googleapi.Field) *InstancesAttachDiskCall {
  22885. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22886. return c
  22887. }
  22888. // Context sets the context to be used in this call's Do method. Any
  22889. // pending HTTP request will be aborted if the provided context is
  22890. // canceled.
  22891. func (c *InstancesAttachDiskCall) Context(ctx context.Context) *InstancesAttachDiskCall {
  22892. c.ctx_ = ctx
  22893. return c
  22894. }
  22895. func (c *InstancesAttachDiskCall) doRequest(alt string) (*http.Response, error) {
  22896. var body io.Reader = nil
  22897. body, err := googleapi.WithoutDataWrapper.JSONReader(c.attacheddisk)
  22898. if err != nil {
  22899. return nil, err
  22900. }
  22901. ctype := "application/json"
  22902. c.urlParams_.Set("alt", alt)
  22903. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/attachDisk")
  22904. urls += "?" + c.urlParams_.Encode()
  22905. req, _ := http.NewRequest("POST", urls, body)
  22906. googleapi.Expand(req.URL, map[string]string{
  22907. "project": c.project,
  22908. "zone": c.zone,
  22909. "instance": c.instance,
  22910. })
  22911. req.Header.Set("Content-Type", ctype)
  22912. req.Header.Set("User-Agent", c.s.userAgent())
  22913. if c.ctx_ != nil {
  22914. return ctxhttp.Do(c.ctx_, c.s.client, req)
  22915. }
  22916. return c.s.client.Do(req)
  22917. }
  22918. // Do executes the "compute.instances.attachDisk" call.
  22919. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  22920. // status code is an error. Response headers are in either
  22921. // *Operation.ServerResponse.Header or (if a response was returned at
  22922. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  22923. // to check whether the returned error was because
  22924. // http.StatusNotModified was returned.
  22925. func (c *InstancesAttachDiskCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  22926. gensupport.SetOptions(c.urlParams_, opts...)
  22927. res, err := c.doRequest("json")
  22928. if res != nil && res.StatusCode == http.StatusNotModified {
  22929. if res.Body != nil {
  22930. res.Body.Close()
  22931. }
  22932. return nil, &googleapi.Error{
  22933. Code: res.StatusCode,
  22934. Header: res.Header,
  22935. }
  22936. }
  22937. if err != nil {
  22938. return nil, err
  22939. }
  22940. defer googleapi.CloseBody(res)
  22941. if err := googleapi.CheckResponse(res); err != nil {
  22942. return nil, err
  22943. }
  22944. ret := &Operation{
  22945. ServerResponse: googleapi.ServerResponse{
  22946. Header: res.Header,
  22947. HTTPStatusCode: res.StatusCode,
  22948. },
  22949. }
  22950. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  22951. return nil, err
  22952. }
  22953. return ret, nil
  22954. // {
  22955. // "description": "Attaches a Disk resource to an instance.",
  22956. // "httpMethod": "POST",
  22957. // "id": "compute.instances.attachDisk",
  22958. // "parameterOrder": [
  22959. // "project",
  22960. // "zone",
  22961. // "instance"
  22962. // ],
  22963. // "parameters": {
  22964. // "instance": {
  22965. // "description": "Instance name.",
  22966. // "location": "path",
  22967. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  22968. // "required": true,
  22969. // "type": "string"
  22970. // },
  22971. // "project": {
  22972. // "description": "Project ID for this request.",
  22973. // "location": "path",
  22974. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  22975. // "required": true,
  22976. // "type": "string"
  22977. // },
  22978. // "zone": {
  22979. // "description": "The name of the zone for this request.",
  22980. // "location": "path",
  22981. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  22982. // "required": true,
  22983. // "type": "string"
  22984. // }
  22985. // },
  22986. // "path": "{project}/zones/{zone}/instances/{instance}/attachDisk",
  22987. // "request": {
  22988. // "$ref": "AttachedDisk"
  22989. // },
  22990. // "response": {
  22991. // "$ref": "Operation"
  22992. // },
  22993. // "scopes": [
  22994. // "https://www.googleapis.com/auth/cloud-platform",
  22995. // "https://www.googleapis.com/auth/compute"
  22996. // ]
  22997. // }
  22998. }
  22999. // method id "compute.instances.delete":
  23000. type InstancesDeleteCall struct {
  23001. s *Service
  23002. project string
  23003. zone string
  23004. instance string
  23005. urlParams_ gensupport.URLParams
  23006. ctx_ context.Context
  23007. }
  23008. // Delete: Deletes the specified Instance resource. For more
  23009. // information, see Stopping or Deleting an Instance.
  23010. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/delete
  23011. func (r *InstancesService) Delete(project string, zone string, instance string) *InstancesDeleteCall {
  23012. c := &InstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23013. c.project = project
  23014. c.zone = zone
  23015. c.instance = instance
  23016. return c
  23017. }
  23018. // Fields allows partial responses to be retrieved. See
  23019. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23020. // for more information.
  23021. func (c *InstancesDeleteCall) Fields(s ...googleapi.Field) *InstancesDeleteCall {
  23022. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23023. return c
  23024. }
  23025. // Context sets the context to be used in this call's Do method. Any
  23026. // pending HTTP request will be aborted if the provided context is
  23027. // canceled.
  23028. func (c *InstancesDeleteCall) Context(ctx context.Context) *InstancesDeleteCall {
  23029. c.ctx_ = ctx
  23030. return c
  23031. }
  23032. func (c *InstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
  23033. var body io.Reader = nil
  23034. c.urlParams_.Set("alt", alt)
  23035. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}")
  23036. urls += "?" + c.urlParams_.Encode()
  23037. req, _ := http.NewRequest("DELETE", urls, body)
  23038. googleapi.Expand(req.URL, map[string]string{
  23039. "project": c.project,
  23040. "zone": c.zone,
  23041. "instance": c.instance,
  23042. })
  23043. req.Header.Set("User-Agent", c.s.userAgent())
  23044. if c.ctx_ != nil {
  23045. return ctxhttp.Do(c.ctx_, c.s.client, req)
  23046. }
  23047. return c.s.client.Do(req)
  23048. }
  23049. // Do executes the "compute.instances.delete" call.
  23050. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  23051. // status code is an error. Response headers are in either
  23052. // *Operation.ServerResponse.Header or (if a response was returned at
  23053. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  23054. // to check whether the returned error was because
  23055. // http.StatusNotModified was returned.
  23056. func (c *InstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  23057. gensupport.SetOptions(c.urlParams_, opts...)
  23058. res, err := c.doRequest("json")
  23059. if res != nil && res.StatusCode == http.StatusNotModified {
  23060. if res.Body != nil {
  23061. res.Body.Close()
  23062. }
  23063. return nil, &googleapi.Error{
  23064. Code: res.StatusCode,
  23065. Header: res.Header,
  23066. }
  23067. }
  23068. if err != nil {
  23069. return nil, err
  23070. }
  23071. defer googleapi.CloseBody(res)
  23072. if err := googleapi.CheckResponse(res); err != nil {
  23073. return nil, err
  23074. }
  23075. ret := &Operation{
  23076. ServerResponse: googleapi.ServerResponse{
  23077. Header: res.Header,
  23078. HTTPStatusCode: res.StatusCode,
  23079. },
  23080. }
  23081. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  23082. return nil, err
  23083. }
  23084. return ret, nil
  23085. // {
  23086. // "description": "Deletes the specified Instance resource. For more information, see Stopping or Deleting an Instance.",
  23087. // "httpMethod": "DELETE",
  23088. // "id": "compute.instances.delete",
  23089. // "parameterOrder": [
  23090. // "project",
  23091. // "zone",
  23092. // "instance"
  23093. // ],
  23094. // "parameters": {
  23095. // "instance": {
  23096. // "description": "Name of the instance resource to delete.",
  23097. // "location": "path",
  23098. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  23099. // "required": true,
  23100. // "type": "string"
  23101. // },
  23102. // "project": {
  23103. // "description": "Project ID for this request.",
  23104. // "location": "path",
  23105. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  23106. // "required": true,
  23107. // "type": "string"
  23108. // },
  23109. // "zone": {
  23110. // "description": "The name of the zone for this request.",
  23111. // "location": "path",
  23112. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  23113. // "required": true,
  23114. // "type": "string"
  23115. // }
  23116. // },
  23117. // "path": "{project}/zones/{zone}/instances/{instance}",
  23118. // "response": {
  23119. // "$ref": "Operation"
  23120. // },
  23121. // "scopes": [
  23122. // "https://www.googleapis.com/auth/cloud-platform",
  23123. // "https://www.googleapis.com/auth/compute"
  23124. // ]
  23125. // }
  23126. }
  23127. // method id "compute.instances.deleteAccessConfig":
  23128. type InstancesDeleteAccessConfigCall struct {
  23129. s *Service
  23130. project string
  23131. zone string
  23132. instance string
  23133. urlParams_ gensupport.URLParams
  23134. ctx_ context.Context
  23135. }
  23136. // DeleteAccessConfig: Deletes an access config from an instance's
  23137. // network interface.
  23138. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/deleteAccessConfig
  23139. func (r *InstancesService) DeleteAccessConfig(project string, zone string, instance string, accessConfig string, networkInterface string) *InstancesDeleteAccessConfigCall {
  23140. c := &InstancesDeleteAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23141. c.project = project
  23142. c.zone = zone
  23143. c.instance = instance
  23144. c.urlParams_.Set("accessConfig", accessConfig)
  23145. c.urlParams_.Set("networkInterface", networkInterface)
  23146. return c
  23147. }
  23148. // Fields allows partial responses to be retrieved. See
  23149. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23150. // for more information.
  23151. func (c *InstancesDeleteAccessConfigCall) Fields(s ...googleapi.Field) *InstancesDeleteAccessConfigCall {
  23152. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23153. return c
  23154. }
  23155. // Context sets the context to be used in this call's Do method. Any
  23156. // pending HTTP request will be aborted if the provided context is
  23157. // canceled.
  23158. func (c *InstancesDeleteAccessConfigCall) Context(ctx context.Context) *InstancesDeleteAccessConfigCall {
  23159. c.ctx_ = ctx
  23160. return c
  23161. }
  23162. func (c *InstancesDeleteAccessConfigCall) doRequest(alt string) (*http.Response, error) {
  23163. var body io.Reader = nil
  23164. c.urlParams_.Set("alt", alt)
  23165. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/deleteAccessConfig")
  23166. urls += "?" + c.urlParams_.Encode()
  23167. req, _ := http.NewRequest("POST", urls, body)
  23168. googleapi.Expand(req.URL, map[string]string{
  23169. "project": c.project,
  23170. "zone": c.zone,
  23171. "instance": c.instance,
  23172. })
  23173. req.Header.Set("User-Agent", c.s.userAgent())
  23174. if c.ctx_ != nil {
  23175. return ctxhttp.Do(c.ctx_, c.s.client, req)
  23176. }
  23177. return c.s.client.Do(req)
  23178. }
  23179. // Do executes the "compute.instances.deleteAccessConfig" call.
  23180. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  23181. // status code is an error. Response headers are in either
  23182. // *Operation.ServerResponse.Header or (if a response was returned at
  23183. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  23184. // to check whether the returned error was because
  23185. // http.StatusNotModified was returned.
  23186. func (c *InstancesDeleteAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  23187. gensupport.SetOptions(c.urlParams_, opts...)
  23188. res, err := c.doRequest("json")
  23189. if res != nil && res.StatusCode == http.StatusNotModified {
  23190. if res.Body != nil {
  23191. res.Body.Close()
  23192. }
  23193. return nil, &googleapi.Error{
  23194. Code: res.StatusCode,
  23195. Header: res.Header,
  23196. }
  23197. }
  23198. if err != nil {
  23199. return nil, err
  23200. }
  23201. defer googleapi.CloseBody(res)
  23202. if err := googleapi.CheckResponse(res); err != nil {
  23203. return nil, err
  23204. }
  23205. ret := &Operation{
  23206. ServerResponse: googleapi.ServerResponse{
  23207. Header: res.Header,
  23208. HTTPStatusCode: res.StatusCode,
  23209. },
  23210. }
  23211. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  23212. return nil, err
  23213. }
  23214. return ret, nil
  23215. // {
  23216. // "description": "Deletes an access config from an instance's network interface.",
  23217. // "httpMethod": "POST",
  23218. // "id": "compute.instances.deleteAccessConfig",
  23219. // "parameterOrder": [
  23220. // "project",
  23221. // "zone",
  23222. // "instance",
  23223. // "accessConfig",
  23224. // "networkInterface"
  23225. // ],
  23226. // "parameters": {
  23227. // "accessConfig": {
  23228. // "description": "The name of the access config to delete.",
  23229. // "location": "query",
  23230. // "required": true,
  23231. // "type": "string"
  23232. // },
  23233. // "instance": {
  23234. // "description": "The instance name for this request.",
  23235. // "location": "path",
  23236. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  23237. // "required": true,
  23238. // "type": "string"
  23239. // },
  23240. // "networkInterface": {
  23241. // "description": "The name of the network interface.",
  23242. // "location": "query",
  23243. // "required": true,
  23244. // "type": "string"
  23245. // },
  23246. // "project": {
  23247. // "description": "Project ID for this request.",
  23248. // "location": "path",
  23249. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  23250. // "required": true,
  23251. // "type": "string"
  23252. // },
  23253. // "zone": {
  23254. // "description": "The name of the zone for this request.",
  23255. // "location": "path",
  23256. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  23257. // "required": true,
  23258. // "type": "string"
  23259. // }
  23260. // },
  23261. // "path": "{project}/zones/{zone}/instances/{instance}/deleteAccessConfig",
  23262. // "response": {
  23263. // "$ref": "Operation"
  23264. // },
  23265. // "scopes": [
  23266. // "https://www.googleapis.com/auth/cloud-platform",
  23267. // "https://www.googleapis.com/auth/compute"
  23268. // ]
  23269. // }
  23270. }
  23271. // method id "compute.instances.detachDisk":
  23272. type InstancesDetachDiskCall struct {
  23273. s *Service
  23274. project string
  23275. zone string
  23276. instance string
  23277. urlParams_ gensupport.URLParams
  23278. ctx_ context.Context
  23279. }
  23280. // DetachDisk: Detaches a disk from an instance.
  23281. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/detachDisk
  23282. func (r *InstancesService) DetachDisk(project string, zone string, instance string, deviceName string) *InstancesDetachDiskCall {
  23283. c := &InstancesDetachDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23284. c.project = project
  23285. c.zone = zone
  23286. c.instance = instance
  23287. c.urlParams_.Set("deviceName", deviceName)
  23288. return c
  23289. }
  23290. // Fields allows partial responses to be retrieved. See
  23291. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23292. // for more information.
  23293. func (c *InstancesDetachDiskCall) Fields(s ...googleapi.Field) *InstancesDetachDiskCall {
  23294. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23295. return c
  23296. }
  23297. // Context sets the context to be used in this call's Do method. Any
  23298. // pending HTTP request will be aborted if the provided context is
  23299. // canceled.
  23300. func (c *InstancesDetachDiskCall) Context(ctx context.Context) *InstancesDetachDiskCall {
  23301. c.ctx_ = ctx
  23302. return c
  23303. }
  23304. func (c *InstancesDetachDiskCall) doRequest(alt string) (*http.Response, error) {
  23305. var body io.Reader = nil
  23306. c.urlParams_.Set("alt", alt)
  23307. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/detachDisk")
  23308. urls += "?" + c.urlParams_.Encode()
  23309. req, _ := http.NewRequest("POST", urls, body)
  23310. googleapi.Expand(req.URL, map[string]string{
  23311. "project": c.project,
  23312. "zone": c.zone,
  23313. "instance": c.instance,
  23314. })
  23315. req.Header.Set("User-Agent", c.s.userAgent())
  23316. if c.ctx_ != nil {
  23317. return ctxhttp.Do(c.ctx_, c.s.client, req)
  23318. }
  23319. return c.s.client.Do(req)
  23320. }
  23321. // Do executes the "compute.instances.detachDisk" call.
  23322. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  23323. // status code is an error. Response headers are in either
  23324. // *Operation.ServerResponse.Header or (if a response was returned at
  23325. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  23326. // to check whether the returned error was because
  23327. // http.StatusNotModified was returned.
  23328. func (c *InstancesDetachDiskCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  23329. gensupport.SetOptions(c.urlParams_, opts...)
  23330. res, err := c.doRequest("json")
  23331. if res != nil && res.StatusCode == http.StatusNotModified {
  23332. if res.Body != nil {
  23333. res.Body.Close()
  23334. }
  23335. return nil, &googleapi.Error{
  23336. Code: res.StatusCode,
  23337. Header: res.Header,
  23338. }
  23339. }
  23340. if err != nil {
  23341. return nil, err
  23342. }
  23343. defer googleapi.CloseBody(res)
  23344. if err := googleapi.CheckResponse(res); err != nil {
  23345. return nil, err
  23346. }
  23347. ret := &Operation{
  23348. ServerResponse: googleapi.ServerResponse{
  23349. Header: res.Header,
  23350. HTTPStatusCode: res.StatusCode,
  23351. },
  23352. }
  23353. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  23354. return nil, err
  23355. }
  23356. return ret, nil
  23357. // {
  23358. // "description": "Detaches a disk from an instance.",
  23359. // "httpMethod": "POST",
  23360. // "id": "compute.instances.detachDisk",
  23361. // "parameterOrder": [
  23362. // "project",
  23363. // "zone",
  23364. // "instance",
  23365. // "deviceName"
  23366. // ],
  23367. // "parameters": {
  23368. // "deviceName": {
  23369. // "description": "Disk device name to detach.",
  23370. // "location": "query",
  23371. // "pattern": "\\w[\\w.-]{0,254}",
  23372. // "required": true,
  23373. // "type": "string"
  23374. // },
  23375. // "instance": {
  23376. // "description": "Instance name.",
  23377. // "location": "path",
  23378. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  23379. // "required": true,
  23380. // "type": "string"
  23381. // },
  23382. // "project": {
  23383. // "description": "Project ID for this request.",
  23384. // "location": "path",
  23385. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  23386. // "required": true,
  23387. // "type": "string"
  23388. // },
  23389. // "zone": {
  23390. // "description": "The name of the zone for this request.",
  23391. // "location": "path",
  23392. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  23393. // "required": true,
  23394. // "type": "string"
  23395. // }
  23396. // },
  23397. // "path": "{project}/zones/{zone}/instances/{instance}/detachDisk",
  23398. // "response": {
  23399. // "$ref": "Operation"
  23400. // },
  23401. // "scopes": [
  23402. // "https://www.googleapis.com/auth/cloud-platform",
  23403. // "https://www.googleapis.com/auth/compute"
  23404. // ]
  23405. // }
  23406. }
  23407. // method id "compute.instances.get":
  23408. type InstancesGetCall struct {
  23409. s *Service
  23410. project string
  23411. zone string
  23412. instance string
  23413. urlParams_ gensupport.URLParams
  23414. ifNoneMatch_ string
  23415. ctx_ context.Context
  23416. }
  23417. // Get: Returns the specified instance resource.
  23418. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/get
  23419. func (r *InstancesService) Get(project string, zone string, instance string) *InstancesGetCall {
  23420. c := &InstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23421. c.project = project
  23422. c.zone = zone
  23423. c.instance = instance
  23424. return c
  23425. }
  23426. // Fields allows partial responses to be retrieved. See
  23427. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23428. // for more information.
  23429. func (c *InstancesGetCall) Fields(s ...googleapi.Field) *InstancesGetCall {
  23430. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23431. return c
  23432. }
  23433. // IfNoneMatch sets the optional parameter which makes the operation
  23434. // fail if the object's ETag matches the given value. This is useful for
  23435. // getting updates only after the object has changed since the last
  23436. // request. Use googleapi.IsNotModified to check whether the response
  23437. // error from Do is the result of In-None-Match.
  23438. func (c *InstancesGetCall) IfNoneMatch(entityTag string) *InstancesGetCall {
  23439. c.ifNoneMatch_ = entityTag
  23440. return c
  23441. }
  23442. // Context sets the context to be used in this call's Do method. Any
  23443. // pending HTTP request will be aborted if the provided context is
  23444. // canceled.
  23445. func (c *InstancesGetCall) Context(ctx context.Context) *InstancesGetCall {
  23446. c.ctx_ = ctx
  23447. return c
  23448. }
  23449. func (c *InstancesGetCall) doRequest(alt string) (*http.Response, error) {
  23450. var body io.Reader = nil
  23451. c.urlParams_.Set("alt", alt)
  23452. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}")
  23453. urls += "?" + c.urlParams_.Encode()
  23454. req, _ := http.NewRequest("GET", urls, body)
  23455. googleapi.Expand(req.URL, map[string]string{
  23456. "project": c.project,
  23457. "zone": c.zone,
  23458. "instance": c.instance,
  23459. })
  23460. req.Header.Set("User-Agent", c.s.userAgent())
  23461. if c.ifNoneMatch_ != "" {
  23462. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  23463. }
  23464. if c.ctx_ != nil {
  23465. return ctxhttp.Do(c.ctx_, c.s.client, req)
  23466. }
  23467. return c.s.client.Do(req)
  23468. }
  23469. // Do executes the "compute.instances.get" call.
  23470. // Exactly one of *Instance or error will be non-nil. Any non-2xx status
  23471. // code is an error. Response headers are in either
  23472. // *Instance.ServerResponse.Header or (if a response was returned at
  23473. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  23474. // to check whether the returned error was because
  23475. // http.StatusNotModified was returned.
  23476. func (c *InstancesGetCall) Do(opts ...googleapi.CallOption) (*Instance, error) {
  23477. gensupport.SetOptions(c.urlParams_, opts...)
  23478. res, err := c.doRequest("json")
  23479. if res != nil && res.StatusCode == http.StatusNotModified {
  23480. if res.Body != nil {
  23481. res.Body.Close()
  23482. }
  23483. return nil, &googleapi.Error{
  23484. Code: res.StatusCode,
  23485. Header: res.Header,
  23486. }
  23487. }
  23488. if err != nil {
  23489. return nil, err
  23490. }
  23491. defer googleapi.CloseBody(res)
  23492. if err := googleapi.CheckResponse(res); err != nil {
  23493. return nil, err
  23494. }
  23495. ret := &Instance{
  23496. ServerResponse: googleapi.ServerResponse{
  23497. Header: res.Header,
  23498. HTTPStatusCode: res.StatusCode,
  23499. },
  23500. }
  23501. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  23502. return nil, err
  23503. }
  23504. return ret, nil
  23505. // {
  23506. // "description": "Returns the specified instance resource.",
  23507. // "httpMethod": "GET",
  23508. // "id": "compute.instances.get",
  23509. // "parameterOrder": [
  23510. // "project",
  23511. // "zone",
  23512. // "instance"
  23513. // ],
  23514. // "parameters": {
  23515. // "instance": {
  23516. // "description": "Name of the instance resource to return.",
  23517. // "location": "path",
  23518. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  23519. // "required": true,
  23520. // "type": "string"
  23521. // },
  23522. // "project": {
  23523. // "description": "Project ID for this request.",
  23524. // "location": "path",
  23525. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  23526. // "required": true,
  23527. // "type": "string"
  23528. // },
  23529. // "zone": {
  23530. // "description": "The name of the zone for this request.",
  23531. // "location": "path",
  23532. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  23533. // "required": true,
  23534. // "type": "string"
  23535. // }
  23536. // },
  23537. // "path": "{project}/zones/{zone}/instances/{instance}",
  23538. // "response": {
  23539. // "$ref": "Instance"
  23540. // },
  23541. // "scopes": [
  23542. // "https://www.googleapis.com/auth/cloud-platform",
  23543. // "https://www.googleapis.com/auth/compute",
  23544. // "https://www.googleapis.com/auth/compute.readonly"
  23545. // ]
  23546. // }
  23547. }
  23548. // method id "compute.instances.getSerialPortOutput":
  23549. type InstancesGetSerialPortOutputCall struct {
  23550. s *Service
  23551. project string
  23552. zone string
  23553. instance string
  23554. urlParams_ gensupport.URLParams
  23555. ifNoneMatch_ string
  23556. ctx_ context.Context
  23557. }
  23558. // GetSerialPortOutput: Returns the specified instance's serial port
  23559. // output.
  23560. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/getSerialPortOutput
  23561. func (r *InstancesService) GetSerialPortOutput(project string, zone string, instance string) *InstancesGetSerialPortOutputCall {
  23562. c := &InstancesGetSerialPortOutputCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23563. c.project = project
  23564. c.zone = zone
  23565. c.instance = instance
  23566. return c
  23567. }
  23568. // Port sets the optional parameter "port": Specifies which COM or
  23569. // serial port to retrieve data from.
  23570. func (c *InstancesGetSerialPortOutputCall) Port(port int64) *InstancesGetSerialPortOutputCall {
  23571. c.urlParams_.Set("port", fmt.Sprint(port))
  23572. return c
  23573. }
  23574. // Fields allows partial responses to be retrieved. See
  23575. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23576. // for more information.
  23577. func (c *InstancesGetSerialPortOutputCall) Fields(s ...googleapi.Field) *InstancesGetSerialPortOutputCall {
  23578. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23579. return c
  23580. }
  23581. // IfNoneMatch sets the optional parameter which makes the operation
  23582. // fail if the object's ETag matches the given value. This is useful for
  23583. // getting updates only after the object has changed since the last
  23584. // request. Use googleapi.IsNotModified to check whether the response
  23585. // error from Do is the result of In-None-Match.
  23586. func (c *InstancesGetSerialPortOutputCall) IfNoneMatch(entityTag string) *InstancesGetSerialPortOutputCall {
  23587. c.ifNoneMatch_ = entityTag
  23588. return c
  23589. }
  23590. // Context sets the context to be used in this call's Do method. Any
  23591. // pending HTTP request will be aborted if the provided context is
  23592. // canceled.
  23593. func (c *InstancesGetSerialPortOutputCall) Context(ctx context.Context) *InstancesGetSerialPortOutputCall {
  23594. c.ctx_ = ctx
  23595. return c
  23596. }
  23597. func (c *InstancesGetSerialPortOutputCall) doRequest(alt string) (*http.Response, error) {
  23598. var body io.Reader = nil
  23599. c.urlParams_.Set("alt", alt)
  23600. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/serialPort")
  23601. urls += "?" + c.urlParams_.Encode()
  23602. req, _ := http.NewRequest("GET", urls, body)
  23603. googleapi.Expand(req.URL, map[string]string{
  23604. "project": c.project,
  23605. "zone": c.zone,
  23606. "instance": c.instance,
  23607. })
  23608. req.Header.Set("User-Agent", c.s.userAgent())
  23609. if c.ifNoneMatch_ != "" {
  23610. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  23611. }
  23612. if c.ctx_ != nil {
  23613. return ctxhttp.Do(c.ctx_, c.s.client, req)
  23614. }
  23615. return c.s.client.Do(req)
  23616. }
  23617. // Do executes the "compute.instances.getSerialPortOutput" call.
  23618. // Exactly one of *SerialPortOutput or error will be non-nil. Any
  23619. // non-2xx status code is an error. Response headers are in either
  23620. // *SerialPortOutput.ServerResponse.Header or (if a response was
  23621. // returned at all) in error.(*googleapi.Error).Header. Use
  23622. // googleapi.IsNotModified to check whether the returned error was
  23623. // because http.StatusNotModified was returned.
  23624. func (c *InstancesGetSerialPortOutputCall) Do(opts ...googleapi.CallOption) (*SerialPortOutput, error) {
  23625. gensupport.SetOptions(c.urlParams_, opts...)
  23626. res, err := c.doRequest("json")
  23627. if res != nil && res.StatusCode == http.StatusNotModified {
  23628. if res.Body != nil {
  23629. res.Body.Close()
  23630. }
  23631. return nil, &googleapi.Error{
  23632. Code: res.StatusCode,
  23633. Header: res.Header,
  23634. }
  23635. }
  23636. if err != nil {
  23637. return nil, err
  23638. }
  23639. defer googleapi.CloseBody(res)
  23640. if err := googleapi.CheckResponse(res); err != nil {
  23641. return nil, err
  23642. }
  23643. ret := &SerialPortOutput{
  23644. ServerResponse: googleapi.ServerResponse{
  23645. Header: res.Header,
  23646. HTTPStatusCode: res.StatusCode,
  23647. },
  23648. }
  23649. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  23650. return nil, err
  23651. }
  23652. return ret, nil
  23653. // {
  23654. // "description": "Returns the specified instance's serial port output.",
  23655. // "httpMethod": "GET",
  23656. // "id": "compute.instances.getSerialPortOutput",
  23657. // "parameterOrder": [
  23658. // "project",
  23659. // "zone",
  23660. // "instance"
  23661. // ],
  23662. // "parameters": {
  23663. // "instance": {
  23664. // "description": "Name of the instance scoping this request.",
  23665. // "location": "path",
  23666. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  23667. // "required": true,
  23668. // "type": "string"
  23669. // },
  23670. // "port": {
  23671. // "default": "1",
  23672. // "description": "Specifies which COM or serial port to retrieve data from.",
  23673. // "format": "int32",
  23674. // "location": "query",
  23675. // "maximum": "4",
  23676. // "minimum": "1",
  23677. // "type": "integer"
  23678. // },
  23679. // "project": {
  23680. // "description": "Project ID for this request.",
  23681. // "location": "path",
  23682. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  23683. // "required": true,
  23684. // "type": "string"
  23685. // },
  23686. // "zone": {
  23687. // "description": "The name of the zone for this request.",
  23688. // "location": "path",
  23689. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  23690. // "required": true,
  23691. // "type": "string"
  23692. // }
  23693. // },
  23694. // "path": "{project}/zones/{zone}/instances/{instance}/serialPort",
  23695. // "response": {
  23696. // "$ref": "SerialPortOutput"
  23697. // },
  23698. // "scopes": [
  23699. // "https://www.googleapis.com/auth/cloud-platform",
  23700. // "https://www.googleapis.com/auth/compute",
  23701. // "https://www.googleapis.com/auth/compute.readonly"
  23702. // ]
  23703. // }
  23704. }
  23705. // method id "compute.instances.insert":
  23706. type InstancesInsertCall struct {
  23707. s *Service
  23708. project string
  23709. zone string
  23710. instance *Instance
  23711. urlParams_ gensupport.URLParams
  23712. ctx_ context.Context
  23713. }
  23714. // Insert: Creates an instance resource in the specified project using
  23715. // the data included in the request.
  23716. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/insert
  23717. func (r *InstancesService) Insert(project string, zone string, instance *Instance) *InstancesInsertCall {
  23718. c := &InstancesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23719. c.project = project
  23720. c.zone = zone
  23721. c.instance = instance
  23722. return c
  23723. }
  23724. // Fields allows partial responses to be retrieved. See
  23725. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23726. // for more information.
  23727. func (c *InstancesInsertCall) Fields(s ...googleapi.Field) *InstancesInsertCall {
  23728. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23729. return c
  23730. }
  23731. // Context sets the context to be used in this call's Do method. Any
  23732. // pending HTTP request will be aborted if the provided context is
  23733. // canceled.
  23734. func (c *InstancesInsertCall) Context(ctx context.Context) *InstancesInsertCall {
  23735. c.ctx_ = ctx
  23736. return c
  23737. }
  23738. func (c *InstancesInsertCall) doRequest(alt string) (*http.Response, error) {
  23739. var body io.Reader = nil
  23740. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance)
  23741. if err != nil {
  23742. return nil, err
  23743. }
  23744. ctype := "application/json"
  23745. c.urlParams_.Set("alt", alt)
  23746. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances")
  23747. urls += "?" + c.urlParams_.Encode()
  23748. req, _ := http.NewRequest("POST", urls, body)
  23749. googleapi.Expand(req.URL, map[string]string{
  23750. "project": c.project,
  23751. "zone": c.zone,
  23752. })
  23753. req.Header.Set("Content-Type", ctype)
  23754. req.Header.Set("User-Agent", c.s.userAgent())
  23755. if c.ctx_ != nil {
  23756. return ctxhttp.Do(c.ctx_, c.s.client, req)
  23757. }
  23758. return c.s.client.Do(req)
  23759. }
  23760. // Do executes the "compute.instances.insert" call.
  23761. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  23762. // status code is an error. Response headers are in either
  23763. // *Operation.ServerResponse.Header or (if a response was returned at
  23764. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  23765. // to check whether the returned error was because
  23766. // http.StatusNotModified was returned.
  23767. func (c *InstancesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  23768. gensupport.SetOptions(c.urlParams_, opts...)
  23769. res, err := c.doRequest("json")
  23770. if res != nil && res.StatusCode == http.StatusNotModified {
  23771. if res.Body != nil {
  23772. res.Body.Close()
  23773. }
  23774. return nil, &googleapi.Error{
  23775. Code: res.StatusCode,
  23776. Header: res.Header,
  23777. }
  23778. }
  23779. if err != nil {
  23780. return nil, err
  23781. }
  23782. defer googleapi.CloseBody(res)
  23783. if err := googleapi.CheckResponse(res); err != nil {
  23784. return nil, err
  23785. }
  23786. ret := &Operation{
  23787. ServerResponse: googleapi.ServerResponse{
  23788. Header: res.Header,
  23789. HTTPStatusCode: res.StatusCode,
  23790. },
  23791. }
  23792. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  23793. return nil, err
  23794. }
  23795. return ret, nil
  23796. // {
  23797. // "description": "Creates an instance resource in the specified project using the data included in the request.",
  23798. // "httpMethod": "POST",
  23799. // "id": "compute.instances.insert",
  23800. // "parameterOrder": [
  23801. // "project",
  23802. // "zone"
  23803. // ],
  23804. // "parameters": {
  23805. // "project": {
  23806. // "description": "Project ID for this request.",
  23807. // "location": "path",
  23808. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  23809. // "required": true,
  23810. // "type": "string"
  23811. // },
  23812. // "zone": {
  23813. // "description": "The name of the zone for this request.",
  23814. // "location": "path",
  23815. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  23816. // "required": true,
  23817. // "type": "string"
  23818. // }
  23819. // },
  23820. // "path": "{project}/zones/{zone}/instances",
  23821. // "request": {
  23822. // "$ref": "Instance"
  23823. // },
  23824. // "response": {
  23825. // "$ref": "Operation"
  23826. // },
  23827. // "scopes": [
  23828. // "https://www.googleapis.com/auth/cloud-platform",
  23829. // "https://www.googleapis.com/auth/compute"
  23830. // ]
  23831. // }
  23832. }
  23833. // method id "compute.instances.list":
  23834. type InstancesListCall struct {
  23835. s *Service
  23836. project string
  23837. zone string
  23838. urlParams_ gensupport.URLParams
  23839. ifNoneMatch_ string
  23840. ctx_ context.Context
  23841. }
  23842. // List: Retrieves the list of instance resources contained within the
  23843. // specified zone.
  23844. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/list
  23845. func (r *InstancesService) List(project string, zone string) *InstancesListCall {
  23846. c := &InstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23847. c.project = project
  23848. c.zone = zone
  23849. return c
  23850. }
  23851. // Filter sets the optional parameter "filter": Sets a filter expression
  23852. // for filtering listed resources, in the form filter={expression}. Your
  23853. // {expression} must be in the format: field_name comparison_string
  23854. // literal_string.
  23855. //
  23856. // The field_name is the name of the field you want to compare. Only
  23857. // atomic field types are supported (string, number, boolean). The
  23858. // comparison_string must be either eq (equals) or ne (not equals). The
  23859. // literal_string is the string value to filter to. The literal value
  23860. // must be valid for the type of field you are filtering by (string,
  23861. // number, boolean). For string fields, the literal value is interpreted
  23862. // as a regular expression using RE2 syntax. The literal value must
  23863. // match the entire field.
  23864. //
  23865. // For example, filter=name ne example-instance.
  23866. //
  23867. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  23868. // you can also filter on nested fields. For example, you could filter
  23869. // on instances that have set the scheduling.automaticRestart field to
  23870. // true. In particular, use filtering on nested fields to take advantage
  23871. // of instance labels to organize and filter results based on label
  23872. // values.
  23873. //
  23874. // The Beta API also supports filtering on multiple expressions by
  23875. // providing each separate expression within parentheses. For example,
  23876. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  23877. // Multiple expressions are treated as AND expressions meaning that
  23878. // resources must match all expressions to pass the filters.
  23879. func (c *InstancesListCall) Filter(filter string) *InstancesListCall {
  23880. c.urlParams_.Set("filter", filter)
  23881. return c
  23882. }
  23883. // MaxResults sets the optional parameter "maxResults": The maximum
  23884. // number of results per page that Compute Engine should return. If the
  23885. // number of available results is larger than maxResults, Compute Engine
  23886. // returns a nextPageToken that can be used to get the next page of
  23887. // results in subsequent list requests.
  23888. func (c *InstancesListCall) MaxResults(maxResults int64) *InstancesListCall {
  23889. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  23890. return c
  23891. }
  23892. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  23893. // a certain order. By default, results are returned in alphanumerical
  23894. // order based on the resource name.
  23895. //
  23896. // You can also sort results in descending order based on the creation
  23897. // timestamp using orderBy="creationTimestamp desc". This sorts results
  23898. // based on the creationTimestamp field in reverse chronological order
  23899. // (newest result first). Use this to sort resources like operations so
  23900. // that the newest operation is returned first.
  23901. //
  23902. // Currently, only sorting by name or creationTimestamp desc is
  23903. // supported.
  23904. func (c *InstancesListCall) OrderBy(orderBy string) *InstancesListCall {
  23905. c.urlParams_.Set("orderBy", orderBy)
  23906. return c
  23907. }
  23908. // PageToken sets the optional parameter "pageToken": Specifies a page
  23909. // token to use. Set pageToken to the nextPageToken returned by a
  23910. // previous list request to get the next page of results.
  23911. func (c *InstancesListCall) PageToken(pageToken string) *InstancesListCall {
  23912. c.urlParams_.Set("pageToken", pageToken)
  23913. return c
  23914. }
  23915. // Fields allows partial responses to be retrieved. See
  23916. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23917. // for more information.
  23918. func (c *InstancesListCall) Fields(s ...googleapi.Field) *InstancesListCall {
  23919. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23920. return c
  23921. }
  23922. // IfNoneMatch sets the optional parameter which makes the operation
  23923. // fail if the object's ETag matches the given value. This is useful for
  23924. // getting updates only after the object has changed since the last
  23925. // request. Use googleapi.IsNotModified to check whether the response
  23926. // error from Do is the result of In-None-Match.
  23927. func (c *InstancesListCall) IfNoneMatch(entityTag string) *InstancesListCall {
  23928. c.ifNoneMatch_ = entityTag
  23929. return c
  23930. }
  23931. // Context sets the context to be used in this call's Do method. Any
  23932. // pending HTTP request will be aborted if the provided context is
  23933. // canceled.
  23934. func (c *InstancesListCall) Context(ctx context.Context) *InstancesListCall {
  23935. c.ctx_ = ctx
  23936. return c
  23937. }
  23938. func (c *InstancesListCall) doRequest(alt string) (*http.Response, error) {
  23939. var body io.Reader = nil
  23940. c.urlParams_.Set("alt", alt)
  23941. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances")
  23942. urls += "?" + c.urlParams_.Encode()
  23943. req, _ := http.NewRequest("GET", urls, body)
  23944. googleapi.Expand(req.URL, map[string]string{
  23945. "project": c.project,
  23946. "zone": c.zone,
  23947. })
  23948. req.Header.Set("User-Agent", c.s.userAgent())
  23949. if c.ifNoneMatch_ != "" {
  23950. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  23951. }
  23952. if c.ctx_ != nil {
  23953. return ctxhttp.Do(c.ctx_, c.s.client, req)
  23954. }
  23955. return c.s.client.Do(req)
  23956. }
  23957. // Do executes the "compute.instances.list" call.
  23958. // Exactly one of *InstanceList or error will be non-nil. Any non-2xx
  23959. // status code is an error. Response headers are in either
  23960. // *InstanceList.ServerResponse.Header or (if a response was returned at
  23961. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  23962. // to check whether the returned error was because
  23963. // http.StatusNotModified was returned.
  23964. func (c *InstancesListCall) Do(opts ...googleapi.CallOption) (*InstanceList, error) {
  23965. gensupport.SetOptions(c.urlParams_, opts...)
  23966. res, err := c.doRequest("json")
  23967. if res != nil && res.StatusCode == http.StatusNotModified {
  23968. if res.Body != nil {
  23969. res.Body.Close()
  23970. }
  23971. return nil, &googleapi.Error{
  23972. Code: res.StatusCode,
  23973. Header: res.Header,
  23974. }
  23975. }
  23976. if err != nil {
  23977. return nil, err
  23978. }
  23979. defer googleapi.CloseBody(res)
  23980. if err := googleapi.CheckResponse(res); err != nil {
  23981. return nil, err
  23982. }
  23983. ret := &InstanceList{
  23984. ServerResponse: googleapi.ServerResponse{
  23985. Header: res.Header,
  23986. HTTPStatusCode: res.StatusCode,
  23987. },
  23988. }
  23989. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  23990. return nil, err
  23991. }
  23992. return ret, nil
  23993. // {
  23994. // "description": "Retrieves the list of instance resources contained within the specified zone.",
  23995. // "httpMethod": "GET",
  23996. // "id": "compute.instances.list",
  23997. // "parameterOrder": [
  23998. // "project",
  23999. // "zone"
  24000. // ],
  24001. // "parameters": {
  24002. // "filter": {
  24003. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  24004. // "location": "query",
  24005. // "type": "string"
  24006. // },
  24007. // "maxResults": {
  24008. // "default": "500",
  24009. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  24010. // "format": "uint32",
  24011. // "location": "query",
  24012. // "maximum": "500",
  24013. // "minimum": "0",
  24014. // "type": "integer"
  24015. // },
  24016. // "orderBy": {
  24017. // "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.",
  24018. // "location": "query",
  24019. // "type": "string"
  24020. // },
  24021. // "pageToken": {
  24022. // "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.",
  24023. // "location": "query",
  24024. // "type": "string"
  24025. // },
  24026. // "project": {
  24027. // "description": "Project ID for this request.",
  24028. // "location": "path",
  24029. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  24030. // "required": true,
  24031. // "type": "string"
  24032. // },
  24033. // "zone": {
  24034. // "description": "The name of the zone for this request.",
  24035. // "location": "path",
  24036. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  24037. // "required": true,
  24038. // "type": "string"
  24039. // }
  24040. // },
  24041. // "path": "{project}/zones/{zone}/instances",
  24042. // "response": {
  24043. // "$ref": "InstanceList"
  24044. // },
  24045. // "scopes": [
  24046. // "https://www.googleapis.com/auth/cloud-platform",
  24047. // "https://www.googleapis.com/auth/compute",
  24048. // "https://www.googleapis.com/auth/compute.readonly"
  24049. // ]
  24050. // }
  24051. }
  24052. // Pages invokes f for each page of results.
  24053. // A non-nil error returned from f will halt the iteration.
  24054. // The provided context supersedes any context provided to the Context method.
  24055. func (c *InstancesListCall) Pages(ctx context.Context, f func(*InstanceList) error) error {
  24056. c.ctx_ = ctx
  24057. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  24058. for {
  24059. x, err := c.Do()
  24060. if err != nil {
  24061. return err
  24062. }
  24063. if err := f(x); err != nil {
  24064. return err
  24065. }
  24066. if x.NextPageToken == "" {
  24067. return nil
  24068. }
  24069. c.PageToken(x.NextPageToken)
  24070. }
  24071. }
  24072. // method id "compute.instances.reset":
  24073. type InstancesResetCall struct {
  24074. s *Service
  24075. project string
  24076. zone string
  24077. instance string
  24078. urlParams_ gensupport.URLParams
  24079. ctx_ context.Context
  24080. }
  24081. // Reset: Performs a hard reset on the instance.
  24082. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/reset
  24083. func (r *InstancesService) Reset(project string, zone string, instance string) *InstancesResetCall {
  24084. c := &InstancesResetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24085. c.project = project
  24086. c.zone = zone
  24087. c.instance = instance
  24088. return c
  24089. }
  24090. // Fields allows partial responses to be retrieved. See
  24091. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24092. // for more information.
  24093. func (c *InstancesResetCall) Fields(s ...googleapi.Field) *InstancesResetCall {
  24094. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24095. return c
  24096. }
  24097. // Context sets the context to be used in this call's Do method. Any
  24098. // pending HTTP request will be aborted if the provided context is
  24099. // canceled.
  24100. func (c *InstancesResetCall) Context(ctx context.Context) *InstancesResetCall {
  24101. c.ctx_ = ctx
  24102. return c
  24103. }
  24104. func (c *InstancesResetCall) doRequest(alt string) (*http.Response, error) {
  24105. var body io.Reader = nil
  24106. c.urlParams_.Set("alt", alt)
  24107. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/reset")
  24108. urls += "?" + c.urlParams_.Encode()
  24109. req, _ := http.NewRequest("POST", urls, body)
  24110. googleapi.Expand(req.URL, map[string]string{
  24111. "project": c.project,
  24112. "zone": c.zone,
  24113. "instance": c.instance,
  24114. })
  24115. req.Header.Set("User-Agent", c.s.userAgent())
  24116. if c.ctx_ != nil {
  24117. return ctxhttp.Do(c.ctx_, c.s.client, req)
  24118. }
  24119. return c.s.client.Do(req)
  24120. }
  24121. // Do executes the "compute.instances.reset" call.
  24122. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  24123. // status code is an error. Response headers are in either
  24124. // *Operation.ServerResponse.Header or (if a response was returned at
  24125. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  24126. // to check whether the returned error was because
  24127. // http.StatusNotModified was returned.
  24128. func (c *InstancesResetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  24129. gensupport.SetOptions(c.urlParams_, opts...)
  24130. res, err := c.doRequest("json")
  24131. if res != nil && res.StatusCode == http.StatusNotModified {
  24132. if res.Body != nil {
  24133. res.Body.Close()
  24134. }
  24135. return nil, &googleapi.Error{
  24136. Code: res.StatusCode,
  24137. Header: res.Header,
  24138. }
  24139. }
  24140. if err != nil {
  24141. return nil, err
  24142. }
  24143. defer googleapi.CloseBody(res)
  24144. if err := googleapi.CheckResponse(res); err != nil {
  24145. return nil, err
  24146. }
  24147. ret := &Operation{
  24148. ServerResponse: googleapi.ServerResponse{
  24149. Header: res.Header,
  24150. HTTPStatusCode: res.StatusCode,
  24151. },
  24152. }
  24153. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  24154. return nil, err
  24155. }
  24156. return ret, nil
  24157. // {
  24158. // "description": "Performs a hard reset on the instance.",
  24159. // "httpMethod": "POST",
  24160. // "id": "compute.instances.reset",
  24161. // "parameterOrder": [
  24162. // "project",
  24163. // "zone",
  24164. // "instance"
  24165. // ],
  24166. // "parameters": {
  24167. // "instance": {
  24168. // "description": "Name of the instance scoping this request.",
  24169. // "location": "path",
  24170. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  24171. // "required": true,
  24172. // "type": "string"
  24173. // },
  24174. // "project": {
  24175. // "description": "Project ID for this request.",
  24176. // "location": "path",
  24177. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  24178. // "required": true,
  24179. // "type": "string"
  24180. // },
  24181. // "zone": {
  24182. // "description": "The name of the zone for this request.",
  24183. // "location": "path",
  24184. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  24185. // "required": true,
  24186. // "type": "string"
  24187. // }
  24188. // },
  24189. // "path": "{project}/zones/{zone}/instances/{instance}/reset",
  24190. // "response": {
  24191. // "$ref": "Operation"
  24192. // },
  24193. // "scopes": [
  24194. // "https://www.googleapis.com/auth/cloud-platform",
  24195. // "https://www.googleapis.com/auth/compute"
  24196. // ]
  24197. // }
  24198. }
  24199. // method id "compute.instances.setDiskAutoDelete":
  24200. type InstancesSetDiskAutoDeleteCall struct {
  24201. s *Service
  24202. project string
  24203. zone string
  24204. instance string
  24205. urlParams_ gensupport.URLParams
  24206. ctx_ context.Context
  24207. }
  24208. // SetDiskAutoDelete: Sets the auto-delete flag for a disk attached to
  24209. // an instance.
  24210. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setDiskAutoDelete
  24211. func (r *InstancesService) SetDiskAutoDelete(project string, zone string, instance string, autoDelete bool, deviceName string) *InstancesSetDiskAutoDeleteCall {
  24212. c := &InstancesSetDiskAutoDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24213. c.project = project
  24214. c.zone = zone
  24215. c.instance = instance
  24216. c.urlParams_.Set("autoDelete", fmt.Sprint(autoDelete))
  24217. c.urlParams_.Set("deviceName", deviceName)
  24218. return c
  24219. }
  24220. // Fields allows partial responses to be retrieved. See
  24221. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24222. // for more information.
  24223. func (c *InstancesSetDiskAutoDeleteCall) Fields(s ...googleapi.Field) *InstancesSetDiskAutoDeleteCall {
  24224. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24225. return c
  24226. }
  24227. // Context sets the context to be used in this call's Do method. Any
  24228. // pending HTTP request will be aborted if the provided context is
  24229. // canceled.
  24230. func (c *InstancesSetDiskAutoDeleteCall) Context(ctx context.Context) *InstancesSetDiskAutoDeleteCall {
  24231. c.ctx_ = ctx
  24232. return c
  24233. }
  24234. func (c *InstancesSetDiskAutoDeleteCall) doRequest(alt string) (*http.Response, error) {
  24235. var body io.Reader = nil
  24236. c.urlParams_.Set("alt", alt)
  24237. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete")
  24238. urls += "?" + c.urlParams_.Encode()
  24239. req, _ := http.NewRequest("POST", urls, body)
  24240. googleapi.Expand(req.URL, map[string]string{
  24241. "project": c.project,
  24242. "zone": c.zone,
  24243. "instance": c.instance,
  24244. })
  24245. req.Header.Set("User-Agent", c.s.userAgent())
  24246. if c.ctx_ != nil {
  24247. return ctxhttp.Do(c.ctx_, c.s.client, req)
  24248. }
  24249. return c.s.client.Do(req)
  24250. }
  24251. // Do executes the "compute.instances.setDiskAutoDelete" call.
  24252. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  24253. // status code is an error. Response headers are in either
  24254. // *Operation.ServerResponse.Header or (if a response was returned at
  24255. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  24256. // to check whether the returned error was because
  24257. // http.StatusNotModified was returned.
  24258. func (c *InstancesSetDiskAutoDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  24259. gensupport.SetOptions(c.urlParams_, opts...)
  24260. res, err := c.doRequest("json")
  24261. if res != nil && res.StatusCode == http.StatusNotModified {
  24262. if res.Body != nil {
  24263. res.Body.Close()
  24264. }
  24265. return nil, &googleapi.Error{
  24266. Code: res.StatusCode,
  24267. Header: res.Header,
  24268. }
  24269. }
  24270. if err != nil {
  24271. return nil, err
  24272. }
  24273. defer googleapi.CloseBody(res)
  24274. if err := googleapi.CheckResponse(res); err != nil {
  24275. return nil, err
  24276. }
  24277. ret := &Operation{
  24278. ServerResponse: googleapi.ServerResponse{
  24279. Header: res.Header,
  24280. HTTPStatusCode: res.StatusCode,
  24281. },
  24282. }
  24283. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  24284. return nil, err
  24285. }
  24286. return ret, nil
  24287. // {
  24288. // "description": "Sets the auto-delete flag for a disk attached to an instance.",
  24289. // "httpMethod": "POST",
  24290. // "id": "compute.instances.setDiskAutoDelete",
  24291. // "parameterOrder": [
  24292. // "project",
  24293. // "zone",
  24294. // "instance",
  24295. // "autoDelete",
  24296. // "deviceName"
  24297. // ],
  24298. // "parameters": {
  24299. // "autoDelete": {
  24300. // "description": "Whether to auto-delete the disk when the instance is deleted.",
  24301. // "location": "query",
  24302. // "required": true,
  24303. // "type": "boolean"
  24304. // },
  24305. // "deviceName": {
  24306. // "description": "The device name of the disk to modify.",
  24307. // "location": "query",
  24308. // "pattern": "\\w[\\w.-]{0,254}",
  24309. // "required": true,
  24310. // "type": "string"
  24311. // },
  24312. // "instance": {
  24313. // "description": "The instance name.",
  24314. // "location": "path",
  24315. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  24316. // "required": true,
  24317. // "type": "string"
  24318. // },
  24319. // "project": {
  24320. // "description": "Project ID for this request.",
  24321. // "location": "path",
  24322. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  24323. // "required": true,
  24324. // "type": "string"
  24325. // },
  24326. // "zone": {
  24327. // "description": "The name of the zone for this request.",
  24328. // "location": "path",
  24329. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  24330. // "required": true,
  24331. // "type": "string"
  24332. // }
  24333. // },
  24334. // "path": "{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete",
  24335. // "response": {
  24336. // "$ref": "Operation"
  24337. // },
  24338. // "scopes": [
  24339. // "https://www.googleapis.com/auth/cloud-platform",
  24340. // "https://www.googleapis.com/auth/compute"
  24341. // ]
  24342. // }
  24343. }
  24344. // method id "compute.instances.setLabels":
  24345. type InstancesSetLabelsCall struct {
  24346. s *Service
  24347. project string
  24348. zone string
  24349. instance string
  24350. instancessetlabelsrequest *InstancesSetLabelsRequest
  24351. urlParams_ gensupport.URLParams
  24352. ctx_ context.Context
  24353. }
  24354. // SetLabels: Sets labels for the specified instance to the data
  24355. // included in the request.
  24356. func (r *InstancesService) SetLabels(project string, zone string, instance string, instancessetlabelsrequest *InstancesSetLabelsRequest) *InstancesSetLabelsCall {
  24357. c := &InstancesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24358. c.project = project
  24359. c.zone = zone
  24360. c.instance = instance
  24361. c.instancessetlabelsrequest = instancessetlabelsrequest
  24362. return c
  24363. }
  24364. // Fields allows partial responses to be retrieved. See
  24365. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24366. // for more information.
  24367. func (c *InstancesSetLabelsCall) Fields(s ...googleapi.Field) *InstancesSetLabelsCall {
  24368. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24369. return c
  24370. }
  24371. // Context sets the context to be used in this call's Do method. Any
  24372. // pending HTTP request will be aborted if the provided context is
  24373. // canceled.
  24374. func (c *InstancesSetLabelsCall) Context(ctx context.Context) *InstancesSetLabelsCall {
  24375. c.ctx_ = ctx
  24376. return c
  24377. }
  24378. func (c *InstancesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  24379. var body io.Reader = nil
  24380. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetlabelsrequest)
  24381. if err != nil {
  24382. return nil, err
  24383. }
  24384. ctype := "application/json"
  24385. c.urlParams_.Set("alt", alt)
  24386. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setLabels")
  24387. urls += "?" + c.urlParams_.Encode()
  24388. req, _ := http.NewRequest("POST", urls, body)
  24389. googleapi.Expand(req.URL, map[string]string{
  24390. "project": c.project,
  24391. "zone": c.zone,
  24392. "instance": c.instance,
  24393. })
  24394. req.Header.Set("Content-Type", ctype)
  24395. req.Header.Set("User-Agent", c.s.userAgent())
  24396. if c.ctx_ != nil {
  24397. return ctxhttp.Do(c.ctx_, c.s.client, req)
  24398. }
  24399. return c.s.client.Do(req)
  24400. }
  24401. // Do executes the "compute.instances.setLabels" call.
  24402. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  24403. // status code is an error. Response headers are in either
  24404. // *Operation.ServerResponse.Header or (if a response was returned at
  24405. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  24406. // to check whether the returned error was because
  24407. // http.StatusNotModified was returned.
  24408. func (c *InstancesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  24409. gensupport.SetOptions(c.urlParams_, opts...)
  24410. res, err := c.doRequest("json")
  24411. if res != nil && res.StatusCode == http.StatusNotModified {
  24412. if res.Body != nil {
  24413. res.Body.Close()
  24414. }
  24415. return nil, &googleapi.Error{
  24416. Code: res.StatusCode,
  24417. Header: res.Header,
  24418. }
  24419. }
  24420. if err != nil {
  24421. return nil, err
  24422. }
  24423. defer googleapi.CloseBody(res)
  24424. if err := googleapi.CheckResponse(res); err != nil {
  24425. return nil, err
  24426. }
  24427. ret := &Operation{
  24428. ServerResponse: googleapi.ServerResponse{
  24429. Header: res.Header,
  24430. HTTPStatusCode: res.StatusCode,
  24431. },
  24432. }
  24433. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  24434. return nil, err
  24435. }
  24436. return ret, nil
  24437. // {
  24438. // "description": "Sets labels for the specified instance to the data included in the request.",
  24439. // "httpMethod": "POST",
  24440. // "id": "compute.instances.setLabels",
  24441. // "parameterOrder": [
  24442. // "project",
  24443. // "zone",
  24444. // "instance"
  24445. // ],
  24446. // "parameters": {
  24447. // "instance": {
  24448. // "description": "Name of the instance scoping this request.",
  24449. // "location": "path",
  24450. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  24451. // "required": true,
  24452. // "type": "string"
  24453. // },
  24454. // "project": {
  24455. // "description": "Project ID for this request.",
  24456. // "location": "path",
  24457. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  24458. // "required": true,
  24459. // "type": "string"
  24460. // },
  24461. // "zone": {
  24462. // "description": "The name of the zone for this request.",
  24463. // "location": "path",
  24464. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  24465. // "required": true,
  24466. // "type": "string"
  24467. // }
  24468. // },
  24469. // "path": "{project}/zones/{zone}/instances/{instance}/setLabels",
  24470. // "request": {
  24471. // "$ref": "InstancesSetLabelsRequest"
  24472. // },
  24473. // "response": {
  24474. // "$ref": "Operation"
  24475. // },
  24476. // "scopes": [
  24477. // "https://www.googleapis.com/auth/cloud-platform",
  24478. // "https://www.googleapis.com/auth/compute"
  24479. // ]
  24480. // }
  24481. }
  24482. // method id "compute.instances.setMachineType":
  24483. type InstancesSetMachineTypeCall struct {
  24484. s *Service
  24485. project string
  24486. zone string
  24487. instance string
  24488. instancessetmachinetyperequest *InstancesSetMachineTypeRequest
  24489. urlParams_ gensupport.URLParams
  24490. ctx_ context.Context
  24491. }
  24492. // SetMachineType: Changes the machine type for a stopped instance to
  24493. // the machine type specified in the request.
  24494. func (r *InstancesService) SetMachineType(project string, zone string, instance string, instancessetmachinetyperequest *InstancesSetMachineTypeRequest) *InstancesSetMachineTypeCall {
  24495. c := &InstancesSetMachineTypeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24496. c.project = project
  24497. c.zone = zone
  24498. c.instance = instance
  24499. c.instancessetmachinetyperequest = instancessetmachinetyperequest
  24500. return c
  24501. }
  24502. // Fields allows partial responses to be retrieved. See
  24503. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24504. // for more information.
  24505. func (c *InstancesSetMachineTypeCall) Fields(s ...googleapi.Field) *InstancesSetMachineTypeCall {
  24506. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24507. return c
  24508. }
  24509. // Context sets the context to be used in this call's Do method. Any
  24510. // pending HTTP request will be aborted if the provided context is
  24511. // canceled.
  24512. func (c *InstancesSetMachineTypeCall) Context(ctx context.Context) *InstancesSetMachineTypeCall {
  24513. c.ctx_ = ctx
  24514. return c
  24515. }
  24516. func (c *InstancesSetMachineTypeCall) doRequest(alt string) (*http.Response, error) {
  24517. var body io.Reader = nil
  24518. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmachinetyperequest)
  24519. if err != nil {
  24520. return nil, err
  24521. }
  24522. ctype := "application/json"
  24523. c.urlParams_.Set("alt", alt)
  24524. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMachineType")
  24525. urls += "?" + c.urlParams_.Encode()
  24526. req, _ := http.NewRequest("POST", urls, body)
  24527. googleapi.Expand(req.URL, map[string]string{
  24528. "project": c.project,
  24529. "zone": c.zone,
  24530. "instance": c.instance,
  24531. })
  24532. req.Header.Set("Content-Type", ctype)
  24533. req.Header.Set("User-Agent", c.s.userAgent())
  24534. if c.ctx_ != nil {
  24535. return ctxhttp.Do(c.ctx_, c.s.client, req)
  24536. }
  24537. return c.s.client.Do(req)
  24538. }
  24539. // Do executes the "compute.instances.setMachineType" call.
  24540. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  24541. // status code is an error. Response headers are in either
  24542. // *Operation.ServerResponse.Header or (if a response was returned at
  24543. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  24544. // to check whether the returned error was because
  24545. // http.StatusNotModified was returned.
  24546. func (c *InstancesSetMachineTypeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  24547. gensupport.SetOptions(c.urlParams_, opts...)
  24548. res, err := c.doRequest("json")
  24549. if res != nil && res.StatusCode == http.StatusNotModified {
  24550. if res.Body != nil {
  24551. res.Body.Close()
  24552. }
  24553. return nil, &googleapi.Error{
  24554. Code: res.StatusCode,
  24555. Header: res.Header,
  24556. }
  24557. }
  24558. if err != nil {
  24559. return nil, err
  24560. }
  24561. defer googleapi.CloseBody(res)
  24562. if err := googleapi.CheckResponse(res); err != nil {
  24563. return nil, err
  24564. }
  24565. ret := &Operation{
  24566. ServerResponse: googleapi.ServerResponse{
  24567. Header: res.Header,
  24568. HTTPStatusCode: res.StatusCode,
  24569. },
  24570. }
  24571. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  24572. return nil, err
  24573. }
  24574. return ret, nil
  24575. // {
  24576. // "description": "Changes the machine type for a stopped instance to the machine type specified in the request.",
  24577. // "httpMethod": "POST",
  24578. // "id": "compute.instances.setMachineType",
  24579. // "parameterOrder": [
  24580. // "project",
  24581. // "zone",
  24582. // "instance"
  24583. // ],
  24584. // "parameters": {
  24585. // "instance": {
  24586. // "description": "Name of the instance scoping this request.",
  24587. // "location": "path",
  24588. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  24589. // "required": true,
  24590. // "type": "string"
  24591. // },
  24592. // "project": {
  24593. // "description": "Project ID for this request.",
  24594. // "location": "path",
  24595. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  24596. // "required": true,
  24597. // "type": "string"
  24598. // },
  24599. // "zone": {
  24600. // "description": "The name of the zone for this request.",
  24601. // "location": "path",
  24602. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  24603. // "required": true,
  24604. // "type": "string"
  24605. // }
  24606. // },
  24607. // "path": "{project}/zones/{zone}/instances/{instance}/setMachineType",
  24608. // "request": {
  24609. // "$ref": "InstancesSetMachineTypeRequest"
  24610. // },
  24611. // "response": {
  24612. // "$ref": "Operation"
  24613. // },
  24614. // "scopes": [
  24615. // "https://www.googleapis.com/auth/cloud-platform",
  24616. // "https://www.googleapis.com/auth/compute"
  24617. // ]
  24618. // }
  24619. }
  24620. // method id "compute.instances.setMetadata":
  24621. type InstancesSetMetadataCall struct {
  24622. s *Service
  24623. project string
  24624. zone string
  24625. instance string
  24626. metadata *Metadata
  24627. urlParams_ gensupport.URLParams
  24628. ctx_ context.Context
  24629. }
  24630. // SetMetadata: Sets metadata for the specified instance to the data
  24631. // included in the request.
  24632. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setMetadata
  24633. func (r *InstancesService) SetMetadata(project string, zone string, instance string, metadata *Metadata) *InstancesSetMetadataCall {
  24634. c := &InstancesSetMetadataCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24635. c.project = project
  24636. c.zone = zone
  24637. c.instance = instance
  24638. c.metadata = metadata
  24639. return c
  24640. }
  24641. // Fields allows partial responses to be retrieved. See
  24642. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24643. // for more information.
  24644. func (c *InstancesSetMetadataCall) Fields(s ...googleapi.Field) *InstancesSetMetadataCall {
  24645. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24646. return c
  24647. }
  24648. // Context sets the context to be used in this call's Do method. Any
  24649. // pending HTTP request will be aborted if the provided context is
  24650. // canceled.
  24651. func (c *InstancesSetMetadataCall) Context(ctx context.Context) *InstancesSetMetadataCall {
  24652. c.ctx_ = ctx
  24653. return c
  24654. }
  24655. func (c *InstancesSetMetadataCall) doRequest(alt string) (*http.Response, error) {
  24656. var body io.Reader = nil
  24657. body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata)
  24658. if err != nil {
  24659. return nil, err
  24660. }
  24661. ctype := "application/json"
  24662. c.urlParams_.Set("alt", alt)
  24663. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMetadata")
  24664. urls += "?" + c.urlParams_.Encode()
  24665. req, _ := http.NewRequest("POST", urls, body)
  24666. googleapi.Expand(req.URL, map[string]string{
  24667. "project": c.project,
  24668. "zone": c.zone,
  24669. "instance": c.instance,
  24670. })
  24671. req.Header.Set("Content-Type", ctype)
  24672. req.Header.Set("User-Agent", c.s.userAgent())
  24673. if c.ctx_ != nil {
  24674. return ctxhttp.Do(c.ctx_, c.s.client, req)
  24675. }
  24676. return c.s.client.Do(req)
  24677. }
  24678. // Do executes the "compute.instances.setMetadata" call.
  24679. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  24680. // status code is an error. Response headers are in either
  24681. // *Operation.ServerResponse.Header or (if a response was returned at
  24682. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  24683. // to check whether the returned error was because
  24684. // http.StatusNotModified was returned.
  24685. func (c *InstancesSetMetadataCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  24686. gensupport.SetOptions(c.urlParams_, opts...)
  24687. res, err := c.doRequest("json")
  24688. if res != nil && res.StatusCode == http.StatusNotModified {
  24689. if res.Body != nil {
  24690. res.Body.Close()
  24691. }
  24692. return nil, &googleapi.Error{
  24693. Code: res.StatusCode,
  24694. Header: res.Header,
  24695. }
  24696. }
  24697. if err != nil {
  24698. return nil, err
  24699. }
  24700. defer googleapi.CloseBody(res)
  24701. if err := googleapi.CheckResponse(res); err != nil {
  24702. return nil, err
  24703. }
  24704. ret := &Operation{
  24705. ServerResponse: googleapi.ServerResponse{
  24706. Header: res.Header,
  24707. HTTPStatusCode: res.StatusCode,
  24708. },
  24709. }
  24710. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  24711. return nil, err
  24712. }
  24713. return ret, nil
  24714. // {
  24715. // "description": "Sets metadata for the specified instance to the data included in the request.",
  24716. // "httpMethod": "POST",
  24717. // "id": "compute.instances.setMetadata",
  24718. // "parameterOrder": [
  24719. // "project",
  24720. // "zone",
  24721. // "instance"
  24722. // ],
  24723. // "parameters": {
  24724. // "instance": {
  24725. // "description": "Name of the instance scoping this request.",
  24726. // "location": "path",
  24727. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  24728. // "required": true,
  24729. // "type": "string"
  24730. // },
  24731. // "project": {
  24732. // "description": "Project ID for this request.",
  24733. // "location": "path",
  24734. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  24735. // "required": true,
  24736. // "type": "string"
  24737. // },
  24738. // "zone": {
  24739. // "description": "The name of the zone for this request.",
  24740. // "location": "path",
  24741. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  24742. // "required": true,
  24743. // "type": "string"
  24744. // }
  24745. // },
  24746. // "path": "{project}/zones/{zone}/instances/{instance}/setMetadata",
  24747. // "request": {
  24748. // "$ref": "Metadata"
  24749. // },
  24750. // "response": {
  24751. // "$ref": "Operation"
  24752. // },
  24753. // "scopes": [
  24754. // "https://www.googleapis.com/auth/cloud-platform",
  24755. // "https://www.googleapis.com/auth/compute"
  24756. // ]
  24757. // }
  24758. }
  24759. // method id "compute.instances.setScheduling":
  24760. type InstancesSetSchedulingCall struct {
  24761. s *Service
  24762. project string
  24763. zone string
  24764. instance string
  24765. scheduling *Scheduling
  24766. urlParams_ gensupport.URLParams
  24767. ctx_ context.Context
  24768. }
  24769. // SetScheduling: Sets an instance's scheduling options.
  24770. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setScheduling
  24771. func (r *InstancesService) SetScheduling(project string, zone string, instance string, scheduling *Scheduling) *InstancesSetSchedulingCall {
  24772. c := &InstancesSetSchedulingCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24773. c.project = project
  24774. c.zone = zone
  24775. c.instance = instance
  24776. c.scheduling = scheduling
  24777. return c
  24778. }
  24779. // Fields allows partial responses to be retrieved. See
  24780. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24781. // for more information.
  24782. func (c *InstancesSetSchedulingCall) Fields(s ...googleapi.Field) *InstancesSetSchedulingCall {
  24783. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24784. return c
  24785. }
  24786. // Context sets the context to be used in this call's Do method. Any
  24787. // pending HTTP request will be aborted if the provided context is
  24788. // canceled.
  24789. func (c *InstancesSetSchedulingCall) Context(ctx context.Context) *InstancesSetSchedulingCall {
  24790. c.ctx_ = ctx
  24791. return c
  24792. }
  24793. func (c *InstancesSetSchedulingCall) doRequest(alt string) (*http.Response, error) {
  24794. var body io.Reader = nil
  24795. body, err := googleapi.WithoutDataWrapper.JSONReader(c.scheduling)
  24796. if err != nil {
  24797. return nil, err
  24798. }
  24799. ctype := "application/json"
  24800. c.urlParams_.Set("alt", alt)
  24801. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setScheduling")
  24802. urls += "?" + c.urlParams_.Encode()
  24803. req, _ := http.NewRequest("POST", urls, body)
  24804. googleapi.Expand(req.URL, map[string]string{
  24805. "project": c.project,
  24806. "zone": c.zone,
  24807. "instance": c.instance,
  24808. })
  24809. req.Header.Set("Content-Type", ctype)
  24810. req.Header.Set("User-Agent", c.s.userAgent())
  24811. if c.ctx_ != nil {
  24812. return ctxhttp.Do(c.ctx_, c.s.client, req)
  24813. }
  24814. return c.s.client.Do(req)
  24815. }
  24816. // Do executes the "compute.instances.setScheduling" call.
  24817. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  24818. // status code is an error. Response headers are in either
  24819. // *Operation.ServerResponse.Header or (if a response was returned at
  24820. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  24821. // to check whether the returned error was because
  24822. // http.StatusNotModified was returned.
  24823. func (c *InstancesSetSchedulingCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  24824. gensupport.SetOptions(c.urlParams_, opts...)
  24825. res, err := c.doRequest("json")
  24826. if res != nil && res.StatusCode == http.StatusNotModified {
  24827. if res.Body != nil {
  24828. res.Body.Close()
  24829. }
  24830. return nil, &googleapi.Error{
  24831. Code: res.StatusCode,
  24832. Header: res.Header,
  24833. }
  24834. }
  24835. if err != nil {
  24836. return nil, err
  24837. }
  24838. defer googleapi.CloseBody(res)
  24839. if err := googleapi.CheckResponse(res); err != nil {
  24840. return nil, err
  24841. }
  24842. ret := &Operation{
  24843. ServerResponse: googleapi.ServerResponse{
  24844. Header: res.Header,
  24845. HTTPStatusCode: res.StatusCode,
  24846. },
  24847. }
  24848. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  24849. return nil, err
  24850. }
  24851. return ret, nil
  24852. // {
  24853. // "description": "Sets an instance's scheduling options.",
  24854. // "httpMethod": "POST",
  24855. // "id": "compute.instances.setScheduling",
  24856. // "parameterOrder": [
  24857. // "project",
  24858. // "zone",
  24859. // "instance"
  24860. // ],
  24861. // "parameters": {
  24862. // "instance": {
  24863. // "description": "Instance name.",
  24864. // "location": "path",
  24865. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  24866. // "required": true,
  24867. // "type": "string"
  24868. // },
  24869. // "project": {
  24870. // "description": "Project ID for this request.",
  24871. // "location": "path",
  24872. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  24873. // "required": true,
  24874. // "type": "string"
  24875. // },
  24876. // "zone": {
  24877. // "description": "The name of the zone for this request.",
  24878. // "location": "path",
  24879. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  24880. // "required": true,
  24881. // "type": "string"
  24882. // }
  24883. // },
  24884. // "path": "{project}/zones/{zone}/instances/{instance}/setScheduling",
  24885. // "request": {
  24886. // "$ref": "Scheduling"
  24887. // },
  24888. // "response": {
  24889. // "$ref": "Operation"
  24890. // },
  24891. // "scopes": [
  24892. // "https://www.googleapis.com/auth/cloud-platform",
  24893. // "https://www.googleapis.com/auth/compute"
  24894. // ]
  24895. // }
  24896. }
  24897. // method id "compute.instances.setTags":
  24898. type InstancesSetTagsCall struct {
  24899. s *Service
  24900. project string
  24901. zone string
  24902. instance string
  24903. tags *Tags
  24904. urlParams_ gensupport.URLParams
  24905. ctx_ context.Context
  24906. }
  24907. // SetTags: Sets tags for the specified instance to the data included in
  24908. // the request.
  24909. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setTags
  24910. func (r *InstancesService) SetTags(project string, zone string, instance string, tags *Tags) *InstancesSetTagsCall {
  24911. c := &InstancesSetTagsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24912. c.project = project
  24913. c.zone = zone
  24914. c.instance = instance
  24915. c.tags = tags
  24916. return c
  24917. }
  24918. // Fields allows partial responses to be retrieved. See
  24919. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24920. // for more information.
  24921. func (c *InstancesSetTagsCall) Fields(s ...googleapi.Field) *InstancesSetTagsCall {
  24922. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24923. return c
  24924. }
  24925. // Context sets the context to be used in this call's Do method. Any
  24926. // pending HTTP request will be aborted if the provided context is
  24927. // canceled.
  24928. func (c *InstancesSetTagsCall) Context(ctx context.Context) *InstancesSetTagsCall {
  24929. c.ctx_ = ctx
  24930. return c
  24931. }
  24932. func (c *InstancesSetTagsCall) doRequest(alt string) (*http.Response, error) {
  24933. var body io.Reader = nil
  24934. body, err := googleapi.WithoutDataWrapper.JSONReader(c.tags)
  24935. if err != nil {
  24936. return nil, err
  24937. }
  24938. ctype := "application/json"
  24939. c.urlParams_.Set("alt", alt)
  24940. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setTags")
  24941. urls += "?" + c.urlParams_.Encode()
  24942. req, _ := http.NewRequest("POST", urls, body)
  24943. googleapi.Expand(req.URL, map[string]string{
  24944. "project": c.project,
  24945. "zone": c.zone,
  24946. "instance": c.instance,
  24947. })
  24948. req.Header.Set("Content-Type", ctype)
  24949. req.Header.Set("User-Agent", c.s.userAgent())
  24950. if c.ctx_ != nil {
  24951. return ctxhttp.Do(c.ctx_, c.s.client, req)
  24952. }
  24953. return c.s.client.Do(req)
  24954. }
  24955. // Do executes the "compute.instances.setTags" call.
  24956. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  24957. // status code is an error. Response headers are in either
  24958. // *Operation.ServerResponse.Header or (if a response was returned at
  24959. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  24960. // to check whether the returned error was because
  24961. // http.StatusNotModified was returned.
  24962. func (c *InstancesSetTagsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  24963. gensupport.SetOptions(c.urlParams_, opts...)
  24964. res, err := c.doRequest("json")
  24965. if res != nil && res.StatusCode == http.StatusNotModified {
  24966. if res.Body != nil {
  24967. res.Body.Close()
  24968. }
  24969. return nil, &googleapi.Error{
  24970. Code: res.StatusCode,
  24971. Header: res.Header,
  24972. }
  24973. }
  24974. if err != nil {
  24975. return nil, err
  24976. }
  24977. defer googleapi.CloseBody(res)
  24978. if err := googleapi.CheckResponse(res); err != nil {
  24979. return nil, err
  24980. }
  24981. ret := &Operation{
  24982. ServerResponse: googleapi.ServerResponse{
  24983. Header: res.Header,
  24984. HTTPStatusCode: res.StatusCode,
  24985. },
  24986. }
  24987. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  24988. return nil, err
  24989. }
  24990. return ret, nil
  24991. // {
  24992. // "description": "Sets tags for the specified instance to the data included in the request.",
  24993. // "httpMethod": "POST",
  24994. // "id": "compute.instances.setTags",
  24995. // "parameterOrder": [
  24996. // "project",
  24997. // "zone",
  24998. // "instance"
  24999. // ],
  25000. // "parameters": {
  25001. // "instance": {
  25002. // "description": "Name of the instance scoping this request.",
  25003. // "location": "path",
  25004. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  25005. // "required": true,
  25006. // "type": "string"
  25007. // },
  25008. // "project": {
  25009. // "description": "Project ID for this request.",
  25010. // "location": "path",
  25011. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  25012. // "required": true,
  25013. // "type": "string"
  25014. // },
  25015. // "zone": {
  25016. // "description": "The name of the zone for this request.",
  25017. // "location": "path",
  25018. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  25019. // "required": true,
  25020. // "type": "string"
  25021. // }
  25022. // },
  25023. // "path": "{project}/zones/{zone}/instances/{instance}/setTags",
  25024. // "request": {
  25025. // "$ref": "Tags"
  25026. // },
  25027. // "response": {
  25028. // "$ref": "Operation"
  25029. // },
  25030. // "scopes": [
  25031. // "https://www.googleapis.com/auth/cloud-platform",
  25032. // "https://www.googleapis.com/auth/compute"
  25033. // ]
  25034. // }
  25035. }
  25036. // method id "compute.instances.start":
  25037. type InstancesStartCall struct {
  25038. s *Service
  25039. project string
  25040. zone string
  25041. instance string
  25042. urlParams_ gensupport.URLParams
  25043. ctx_ context.Context
  25044. }
  25045. // Start: Starts an instance that was stopped using the using the
  25046. // instances().stop method. For more information, see Restart an
  25047. // instance.
  25048. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/start
  25049. func (r *InstancesService) Start(project string, zone string, instance string) *InstancesStartCall {
  25050. c := &InstancesStartCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25051. c.project = project
  25052. c.zone = zone
  25053. c.instance = instance
  25054. return c
  25055. }
  25056. // Fields allows partial responses to be retrieved. See
  25057. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25058. // for more information.
  25059. func (c *InstancesStartCall) Fields(s ...googleapi.Field) *InstancesStartCall {
  25060. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25061. return c
  25062. }
  25063. // Context sets the context to be used in this call's Do method. Any
  25064. // pending HTTP request will be aborted if the provided context is
  25065. // canceled.
  25066. func (c *InstancesStartCall) Context(ctx context.Context) *InstancesStartCall {
  25067. c.ctx_ = ctx
  25068. return c
  25069. }
  25070. func (c *InstancesStartCall) doRequest(alt string) (*http.Response, error) {
  25071. var body io.Reader = nil
  25072. c.urlParams_.Set("alt", alt)
  25073. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/start")
  25074. urls += "?" + c.urlParams_.Encode()
  25075. req, _ := http.NewRequest("POST", urls, body)
  25076. googleapi.Expand(req.URL, map[string]string{
  25077. "project": c.project,
  25078. "zone": c.zone,
  25079. "instance": c.instance,
  25080. })
  25081. req.Header.Set("User-Agent", c.s.userAgent())
  25082. if c.ctx_ != nil {
  25083. return ctxhttp.Do(c.ctx_, c.s.client, req)
  25084. }
  25085. return c.s.client.Do(req)
  25086. }
  25087. // Do executes the "compute.instances.start" call.
  25088. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  25089. // status code is an error. Response headers are in either
  25090. // *Operation.ServerResponse.Header or (if a response was returned at
  25091. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  25092. // to check whether the returned error was because
  25093. // http.StatusNotModified was returned.
  25094. func (c *InstancesStartCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  25095. gensupport.SetOptions(c.urlParams_, opts...)
  25096. res, err := c.doRequest("json")
  25097. if res != nil && res.StatusCode == http.StatusNotModified {
  25098. if res.Body != nil {
  25099. res.Body.Close()
  25100. }
  25101. return nil, &googleapi.Error{
  25102. Code: res.StatusCode,
  25103. Header: res.Header,
  25104. }
  25105. }
  25106. if err != nil {
  25107. return nil, err
  25108. }
  25109. defer googleapi.CloseBody(res)
  25110. if err := googleapi.CheckResponse(res); err != nil {
  25111. return nil, err
  25112. }
  25113. ret := &Operation{
  25114. ServerResponse: googleapi.ServerResponse{
  25115. Header: res.Header,
  25116. HTTPStatusCode: res.StatusCode,
  25117. },
  25118. }
  25119. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  25120. return nil, err
  25121. }
  25122. return ret, nil
  25123. // {
  25124. // "description": "Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance.",
  25125. // "httpMethod": "POST",
  25126. // "id": "compute.instances.start",
  25127. // "parameterOrder": [
  25128. // "project",
  25129. // "zone",
  25130. // "instance"
  25131. // ],
  25132. // "parameters": {
  25133. // "instance": {
  25134. // "description": "Name of the instance resource to start.",
  25135. // "location": "path",
  25136. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  25137. // "required": true,
  25138. // "type": "string"
  25139. // },
  25140. // "project": {
  25141. // "description": "Project ID for this request.",
  25142. // "location": "path",
  25143. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  25144. // "required": true,
  25145. // "type": "string"
  25146. // },
  25147. // "zone": {
  25148. // "description": "The name of the zone for this request.",
  25149. // "location": "path",
  25150. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  25151. // "required": true,
  25152. // "type": "string"
  25153. // }
  25154. // },
  25155. // "path": "{project}/zones/{zone}/instances/{instance}/start",
  25156. // "response": {
  25157. // "$ref": "Operation"
  25158. // },
  25159. // "scopes": [
  25160. // "https://www.googleapis.com/auth/cloud-platform",
  25161. // "https://www.googleapis.com/auth/compute"
  25162. // ]
  25163. // }
  25164. }
  25165. // method id "compute.instances.stop":
  25166. type InstancesStopCall struct {
  25167. s *Service
  25168. project string
  25169. zone string
  25170. instance string
  25171. urlParams_ gensupport.URLParams
  25172. ctx_ context.Context
  25173. }
  25174. // Stop: Stops a running instance, shutting it down cleanly, and allows
  25175. // you to restart the instance at a later time. Stopped instances do not
  25176. // incur per-minute, virtual machine usage charges while they are
  25177. // stopped, but any resources that the virtual machine is using, such as
  25178. // persistent disks and static IP addresses, will continue to be charged
  25179. // until they are deleted. For more information, see Stopping an
  25180. // instance.
  25181. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/stop
  25182. func (r *InstancesService) Stop(project string, zone string, instance string) *InstancesStopCall {
  25183. c := &InstancesStopCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25184. c.project = project
  25185. c.zone = zone
  25186. c.instance = instance
  25187. return c
  25188. }
  25189. // Fields allows partial responses to be retrieved. See
  25190. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25191. // for more information.
  25192. func (c *InstancesStopCall) Fields(s ...googleapi.Field) *InstancesStopCall {
  25193. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25194. return c
  25195. }
  25196. // Context sets the context to be used in this call's Do method. Any
  25197. // pending HTTP request will be aborted if the provided context is
  25198. // canceled.
  25199. func (c *InstancesStopCall) Context(ctx context.Context) *InstancesStopCall {
  25200. c.ctx_ = ctx
  25201. return c
  25202. }
  25203. func (c *InstancesStopCall) doRequest(alt string) (*http.Response, error) {
  25204. var body io.Reader = nil
  25205. c.urlParams_.Set("alt", alt)
  25206. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/stop")
  25207. urls += "?" + c.urlParams_.Encode()
  25208. req, _ := http.NewRequest("POST", urls, body)
  25209. googleapi.Expand(req.URL, map[string]string{
  25210. "project": c.project,
  25211. "zone": c.zone,
  25212. "instance": c.instance,
  25213. })
  25214. req.Header.Set("User-Agent", c.s.userAgent())
  25215. if c.ctx_ != nil {
  25216. return ctxhttp.Do(c.ctx_, c.s.client, req)
  25217. }
  25218. return c.s.client.Do(req)
  25219. }
  25220. // Do executes the "compute.instances.stop" call.
  25221. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  25222. // status code is an error. Response headers are in either
  25223. // *Operation.ServerResponse.Header or (if a response was returned at
  25224. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  25225. // to check whether the returned error was because
  25226. // http.StatusNotModified was returned.
  25227. func (c *InstancesStopCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  25228. gensupport.SetOptions(c.urlParams_, opts...)
  25229. res, err := c.doRequest("json")
  25230. if res != nil && res.StatusCode == http.StatusNotModified {
  25231. if res.Body != nil {
  25232. res.Body.Close()
  25233. }
  25234. return nil, &googleapi.Error{
  25235. Code: res.StatusCode,
  25236. Header: res.Header,
  25237. }
  25238. }
  25239. if err != nil {
  25240. return nil, err
  25241. }
  25242. defer googleapi.CloseBody(res)
  25243. if err := googleapi.CheckResponse(res); err != nil {
  25244. return nil, err
  25245. }
  25246. ret := &Operation{
  25247. ServerResponse: googleapi.ServerResponse{
  25248. Header: res.Header,
  25249. HTTPStatusCode: res.StatusCode,
  25250. },
  25251. }
  25252. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  25253. return nil, err
  25254. }
  25255. return ret, nil
  25256. // {
  25257. // "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.",
  25258. // "httpMethod": "POST",
  25259. // "id": "compute.instances.stop",
  25260. // "parameterOrder": [
  25261. // "project",
  25262. // "zone",
  25263. // "instance"
  25264. // ],
  25265. // "parameters": {
  25266. // "instance": {
  25267. // "description": "Name of the instance resource to stop.",
  25268. // "location": "path",
  25269. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  25270. // "required": true,
  25271. // "type": "string"
  25272. // },
  25273. // "project": {
  25274. // "description": "Project ID for this request.",
  25275. // "location": "path",
  25276. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  25277. // "required": true,
  25278. // "type": "string"
  25279. // },
  25280. // "zone": {
  25281. // "description": "The name of the zone for this request.",
  25282. // "location": "path",
  25283. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  25284. // "required": true,
  25285. // "type": "string"
  25286. // }
  25287. // },
  25288. // "path": "{project}/zones/{zone}/instances/{instance}/stop",
  25289. // "response": {
  25290. // "$ref": "Operation"
  25291. // },
  25292. // "scopes": [
  25293. // "https://www.googleapis.com/auth/cloud-platform",
  25294. // "https://www.googleapis.com/auth/compute"
  25295. // ]
  25296. // }
  25297. }
  25298. // method id "compute.licenses.get":
  25299. type LicensesGetCall struct {
  25300. s *Service
  25301. project string
  25302. license string
  25303. urlParams_ gensupport.URLParams
  25304. ifNoneMatch_ string
  25305. ctx_ context.Context
  25306. }
  25307. // Get: Returns the specified license resource.
  25308. // For details, see https://cloud.google.com/compute/docs/reference/latest/licenses/get
  25309. func (r *LicensesService) Get(project string, license string) *LicensesGetCall {
  25310. c := &LicensesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25311. c.project = project
  25312. c.license = license
  25313. return c
  25314. }
  25315. // Fields allows partial responses to be retrieved. See
  25316. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25317. // for more information.
  25318. func (c *LicensesGetCall) Fields(s ...googleapi.Field) *LicensesGetCall {
  25319. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25320. return c
  25321. }
  25322. // IfNoneMatch sets the optional parameter which makes the operation
  25323. // fail if the object's ETag matches the given value. This is useful for
  25324. // getting updates only after the object has changed since the last
  25325. // request. Use googleapi.IsNotModified to check whether the response
  25326. // error from Do is the result of In-None-Match.
  25327. func (c *LicensesGetCall) IfNoneMatch(entityTag string) *LicensesGetCall {
  25328. c.ifNoneMatch_ = entityTag
  25329. return c
  25330. }
  25331. // Context sets the context to be used in this call's Do method. Any
  25332. // pending HTTP request will be aborted if the provided context is
  25333. // canceled.
  25334. func (c *LicensesGetCall) Context(ctx context.Context) *LicensesGetCall {
  25335. c.ctx_ = ctx
  25336. return c
  25337. }
  25338. func (c *LicensesGetCall) doRequest(alt string) (*http.Response, error) {
  25339. var body io.Reader = nil
  25340. c.urlParams_.Set("alt", alt)
  25341. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{license}")
  25342. urls += "?" + c.urlParams_.Encode()
  25343. req, _ := http.NewRequest("GET", urls, body)
  25344. googleapi.Expand(req.URL, map[string]string{
  25345. "project": c.project,
  25346. "license": c.license,
  25347. })
  25348. req.Header.Set("User-Agent", c.s.userAgent())
  25349. if c.ifNoneMatch_ != "" {
  25350. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  25351. }
  25352. if c.ctx_ != nil {
  25353. return ctxhttp.Do(c.ctx_, c.s.client, req)
  25354. }
  25355. return c.s.client.Do(req)
  25356. }
  25357. // Do executes the "compute.licenses.get" call.
  25358. // Exactly one of *License or error will be non-nil. Any non-2xx status
  25359. // code is an error. Response headers are in either
  25360. // *License.ServerResponse.Header or (if a response was returned at all)
  25361. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  25362. // check whether the returned error was because http.StatusNotModified
  25363. // was returned.
  25364. func (c *LicensesGetCall) Do(opts ...googleapi.CallOption) (*License, error) {
  25365. gensupport.SetOptions(c.urlParams_, opts...)
  25366. res, err := c.doRequest("json")
  25367. if res != nil && res.StatusCode == http.StatusNotModified {
  25368. if res.Body != nil {
  25369. res.Body.Close()
  25370. }
  25371. return nil, &googleapi.Error{
  25372. Code: res.StatusCode,
  25373. Header: res.Header,
  25374. }
  25375. }
  25376. if err != nil {
  25377. return nil, err
  25378. }
  25379. defer googleapi.CloseBody(res)
  25380. if err := googleapi.CheckResponse(res); err != nil {
  25381. return nil, err
  25382. }
  25383. ret := &License{
  25384. ServerResponse: googleapi.ServerResponse{
  25385. Header: res.Header,
  25386. HTTPStatusCode: res.StatusCode,
  25387. },
  25388. }
  25389. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  25390. return nil, err
  25391. }
  25392. return ret, nil
  25393. // {
  25394. // "description": "Returns the specified license resource.",
  25395. // "httpMethod": "GET",
  25396. // "id": "compute.licenses.get",
  25397. // "parameterOrder": [
  25398. // "project",
  25399. // "license"
  25400. // ],
  25401. // "parameters": {
  25402. // "license": {
  25403. // "description": "Name of the license resource to return.",
  25404. // "location": "path",
  25405. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  25406. // "required": true,
  25407. // "type": "string"
  25408. // },
  25409. // "project": {
  25410. // "description": "Project ID for this request.",
  25411. // "location": "path",
  25412. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  25413. // "required": true,
  25414. // "type": "string"
  25415. // }
  25416. // },
  25417. // "path": "{project}/global/licenses/{license}",
  25418. // "response": {
  25419. // "$ref": "License"
  25420. // },
  25421. // "scopes": [
  25422. // "https://www.googleapis.com/auth/cloud-platform",
  25423. // "https://www.googleapis.com/auth/compute",
  25424. // "https://www.googleapis.com/auth/compute.readonly"
  25425. // ]
  25426. // }
  25427. }
  25428. // method id "compute.machineTypes.aggregatedList":
  25429. type MachineTypesAggregatedListCall struct {
  25430. s *Service
  25431. project string
  25432. urlParams_ gensupport.URLParams
  25433. ifNoneMatch_ string
  25434. ctx_ context.Context
  25435. }
  25436. // AggregatedList: Retrieves an aggregated list of machine type
  25437. // resources.
  25438. // For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/aggregatedList
  25439. func (r *MachineTypesService) AggregatedList(project string) *MachineTypesAggregatedListCall {
  25440. c := &MachineTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25441. c.project = project
  25442. return c
  25443. }
  25444. // Filter sets the optional parameter "filter": Sets a filter expression
  25445. // for filtering listed resources, in the form filter={expression}. Your
  25446. // {expression} must be in the format: field_name comparison_string
  25447. // literal_string.
  25448. //
  25449. // The field_name is the name of the field you want to compare. Only
  25450. // atomic field types are supported (string, number, boolean). The
  25451. // comparison_string must be either eq (equals) or ne (not equals). The
  25452. // literal_string is the string value to filter to. The literal value
  25453. // must be valid for the type of field you are filtering by (string,
  25454. // number, boolean). For string fields, the literal value is interpreted
  25455. // as a regular expression using RE2 syntax. The literal value must
  25456. // match the entire field.
  25457. //
  25458. // For example, filter=name ne example-instance.
  25459. //
  25460. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  25461. // you can also filter on nested fields. For example, you could filter
  25462. // on instances that have set the scheduling.automaticRestart field to
  25463. // true. In particular, use filtering on nested fields to take advantage
  25464. // of instance labels to organize and filter results based on label
  25465. // values.
  25466. //
  25467. // The Beta API also supports filtering on multiple expressions by
  25468. // providing each separate expression within parentheses. For example,
  25469. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  25470. // Multiple expressions are treated as AND expressions meaning that
  25471. // resources must match all expressions to pass the filters.
  25472. func (c *MachineTypesAggregatedListCall) Filter(filter string) *MachineTypesAggregatedListCall {
  25473. c.urlParams_.Set("filter", filter)
  25474. return c
  25475. }
  25476. // MaxResults sets the optional parameter "maxResults": The maximum
  25477. // number of results per page that Compute Engine should return. If the
  25478. // number of available results is larger than maxResults, Compute Engine
  25479. // returns a nextPageToken that can be used to get the next page of
  25480. // results in subsequent list requests.
  25481. func (c *MachineTypesAggregatedListCall) MaxResults(maxResults int64) *MachineTypesAggregatedListCall {
  25482. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  25483. return c
  25484. }
  25485. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  25486. // a certain order. By default, results are returned in alphanumerical
  25487. // order based on the resource name.
  25488. //
  25489. // You can also sort results in descending order based on the creation
  25490. // timestamp using orderBy="creationTimestamp desc". This sorts results
  25491. // based on the creationTimestamp field in reverse chronological order
  25492. // (newest result first). Use this to sort resources like operations so
  25493. // that the newest operation is returned first.
  25494. //
  25495. // Currently, only sorting by name or creationTimestamp desc is
  25496. // supported.
  25497. func (c *MachineTypesAggregatedListCall) OrderBy(orderBy string) *MachineTypesAggregatedListCall {
  25498. c.urlParams_.Set("orderBy", orderBy)
  25499. return c
  25500. }
  25501. // PageToken sets the optional parameter "pageToken": Specifies a page
  25502. // token to use. Set pageToken to the nextPageToken returned by a
  25503. // previous list request to get the next page of results.
  25504. func (c *MachineTypesAggregatedListCall) PageToken(pageToken string) *MachineTypesAggregatedListCall {
  25505. c.urlParams_.Set("pageToken", pageToken)
  25506. return c
  25507. }
  25508. // Fields allows partial responses to be retrieved. See
  25509. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25510. // for more information.
  25511. func (c *MachineTypesAggregatedListCall) Fields(s ...googleapi.Field) *MachineTypesAggregatedListCall {
  25512. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25513. return c
  25514. }
  25515. // IfNoneMatch sets the optional parameter which makes the operation
  25516. // fail if the object's ETag matches the given value. This is useful for
  25517. // getting updates only after the object has changed since the last
  25518. // request. Use googleapi.IsNotModified to check whether the response
  25519. // error from Do is the result of In-None-Match.
  25520. func (c *MachineTypesAggregatedListCall) IfNoneMatch(entityTag string) *MachineTypesAggregatedListCall {
  25521. c.ifNoneMatch_ = entityTag
  25522. return c
  25523. }
  25524. // Context sets the context to be used in this call's Do method. Any
  25525. // pending HTTP request will be aborted if the provided context is
  25526. // canceled.
  25527. func (c *MachineTypesAggregatedListCall) Context(ctx context.Context) *MachineTypesAggregatedListCall {
  25528. c.ctx_ = ctx
  25529. return c
  25530. }
  25531. func (c *MachineTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  25532. var body io.Reader = nil
  25533. c.urlParams_.Set("alt", alt)
  25534. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/machineTypes")
  25535. urls += "?" + c.urlParams_.Encode()
  25536. req, _ := http.NewRequest("GET", urls, body)
  25537. googleapi.Expand(req.URL, map[string]string{
  25538. "project": c.project,
  25539. })
  25540. req.Header.Set("User-Agent", c.s.userAgent())
  25541. if c.ifNoneMatch_ != "" {
  25542. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  25543. }
  25544. if c.ctx_ != nil {
  25545. return ctxhttp.Do(c.ctx_, c.s.client, req)
  25546. }
  25547. return c.s.client.Do(req)
  25548. }
  25549. // Do executes the "compute.machineTypes.aggregatedList" call.
  25550. // Exactly one of *MachineTypeAggregatedList or error will be non-nil.
  25551. // Any non-2xx status code is an error. Response headers are in either
  25552. // *MachineTypeAggregatedList.ServerResponse.Header or (if a response
  25553. // was returned at all) in error.(*googleapi.Error).Header. Use
  25554. // googleapi.IsNotModified to check whether the returned error was
  25555. // because http.StatusNotModified was returned.
  25556. func (c *MachineTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*MachineTypeAggregatedList, error) {
  25557. gensupport.SetOptions(c.urlParams_, opts...)
  25558. res, err := c.doRequest("json")
  25559. if res != nil && res.StatusCode == http.StatusNotModified {
  25560. if res.Body != nil {
  25561. res.Body.Close()
  25562. }
  25563. return nil, &googleapi.Error{
  25564. Code: res.StatusCode,
  25565. Header: res.Header,
  25566. }
  25567. }
  25568. if err != nil {
  25569. return nil, err
  25570. }
  25571. defer googleapi.CloseBody(res)
  25572. if err := googleapi.CheckResponse(res); err != nil {
  25573. return nil, err
  25574. }
  25575. ret := &MachineTypeAggregatedList{
  25576. ServerResponse: googleapi.ServerResponse{
  25577. Header: res.Header,
  25578. HTTPStatusCode: res.StatusCode,
  25579. },
  25580. }
  25581. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  25582. return nil, err
  25583. }
  25584. return ret, nil
  25585. // {
  25586. // "description": "Retrieves an aggregated list of machine type resources.",
  25587. // "httpMethod": "GET",
  25588. // "id": "compute.machineTypes.aggregatedList",
  25589. // "parameterOrder": [
  25590. // "project"
  25591. // ],
  25592. // "parameters": {
  25593. // "filter": {
  25594. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  25595. // "location": "query",
  25596. // "type": "string"
  25597. // },
  25598. // "maxResults": {
  25599. // "default": "500",
  25600. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  25601. // "format": "uint32",
  25602. // "location": "query",
  25603. // "maximum": "500",
  25604. // "minimum": "0",
  25605. // "type": "integer"
  25606. // },
  25607. // "orderBy": {
  25608. // "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.",
  25609. // "location": "query",
  25610. // "type": "string"
  25611. // },
  25612. // "pageToken": {
  25613. // "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.",
  25614. // "location": "query",
  25615. // "type": "string"
  25616. // },
  25617. // "project": {
  25618. // "description": "Project ID for this request.",
  25619. // "location": "path",
  25620. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  25621. // "required": true,
  25622. // "type": "string"
  25623. // }
  25624. // },
  25625. // "path": "{project}/aggregated/machineTypes",
  25626. // "response": {
  25627. // "$ref": "MachineTypeAggregatedList"
  25628. // },
  25629. // "scopes": [
  25630. // "https://www.googleapis.com/auth/cloud-platform",
  25631. // "https://www.googleapis.com/auth/compute",
  25632. // "https://www.googleapis.com/auth/compute.readonly"
  25633. // ]
  25634. // }
  25635. }
  25636. // Pages invokes f for each page of results.
  25637. // A non-nil error returned from f will halt the iteration.
  25638. // The provided context supersedes any context provided to the Context method.
  25639. func (c *MachineTypesAggregatedListCall) Pages(ctx context.Context, f func(*MachineTypeAggregatedList) error) error {
  25640. c.ctx_ = ctx
  25641. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  25642. for {
  25643. x, err := c.Do()
  25644. if err != nil {
  25645. return err
  25646. }
  25647. if err := f(x); err != nil {
  25648. return err
  25649. }
  25650. if x.NextPageToken == "" {
  25651. return nil
  25652. }
  25653. c.PageToken(x.NextPageToken)
  25654. }
  25655. }
  25656. // method id "compute.machineTypes.get":
  25657. type MachineTypesGetCall struct {
  25658. s *Service
  25659. project string
  25660. zone string
  25661. machineType string
  25662. urlParams_ gensupport.URLParams
  25663. ifNoneMatch_ string
  25664. ctx_ context.Context
  25665. }
  25666. // Get: Returns the specified machine type resource.
  25667. // For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/get
  25668. func (r *MachineTypesService) Get(project string, zone string, machineType string) *MachineTypesGetCall {
  25669. c := &MachineTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25670. c.project = project
  25671. c.zone = zone
  25672. c.machineType = machineType
  25673. return c
  25674. }
  25675. // Fields allows partial responses to be retrieved. See
  25676. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25677. // for more information.
  25678. func (c *MachineTypesGetCall) Fields(s ...googleapi.Field) *MachineTypesGetCall {
  25679. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25680. return c
  25681. }
  25682. // IfNoneMatch sets the optional parameter which makes the operation
  25683. // fail if the object's ETag matches the given value. This is useful for
  25684. // getting updates only after the object has changed since the last
  25685. // request. Use googleapi.IsNotModified to check whether the response
  25686. // error from Do is the result of In-None-Match.
  25687. func (c *MachineTypesGetCall) IfNoneMatch(entityTag string) *MachineTypesGetCall {
  25688. c.ifNoneMatch_ = entityTag
  25689. return c
  25690. }
  25691. // Context sets the context to be used in this call's Do method. Any
  25692. // pending HTTP request will be aborted if the provided context is
  25693. // canceled.
  25694. func (c *MachineTypesGetCall) Context(ctx context.Context) *MachineTypesGetCall {
  25695. c.ctx_ = ctx
  25696. return c
  25697. }
  25698. func (c *MachineTypesGetCall) doRequest(alt string) (*http.Response, error) {
  25699. var body io.Reader = nil
  25700. c.urlParams_.Set("alt", alt)
  25701. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/machineTypes/{machineType}")
  25702. urls += "?" + c.urlParams_.Encode()
  25703. req, _ := http.NewRequest("GET", urls, body)
  25704. googleapi.Expand(req.URL, map[string]string{
  25705. "project": c.project,
  25706. "zone": c.zone,
  25707. "machineType": c.machineType,
  25708. })
  25709. req.Header.Set("User-Agent", c.s.userAgent())
  25710. if c.ifNoneMatch_ != "" {
  25711. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  25712. }
  25713. if c.ctx_ != nil {
  25714. return ctxhttp.Do(c.ctx_, c.s.client, req)
  25715. }
  25716. return c.s.client.Do(req)
  25717. }
  25718. // Do executes the "compute.machineTypes.get" call.
  25719. // Exactly one of *MachineType or error will be non-nil. Any non-2xx
  25720. // status code is an error. Response headers are in either
  25721. // *MachineType.ServerResponse.Header or (if a response was returned at
  25722. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  25723. // to check whether the returned error was because
  25724. // http.StatusNotModified was returned.
  25725. func (c *MachineTypesGetCall) Do(opts ...googleapi.CallOption) (*MachineType, error) {
  25726. gensupport.SetOptions(c.urlParams_, opts...)
  25727. res, err := c.doRequest("json")
  25728. if res != nil && res.StatusCode == http.StatusNotModified {
  25729. if res.Body != nil {
  25730. res.Body.Close()
  25731. }
  25732. return nil, &googleapi.Error{
  25733. Code: res.StatusCode,
  25734. Header: res.Header,
  25735. }
  25736. }
  25737. if err != nil {
  25738. return nil, err
  25739. }
  25740. defer googleapi.CloseBody(res)
  25741. if err := googleapi.CheckResponse(res); err != nil {
  25742. return nil, err
  25743. }
  25744. ret := &MachineType{
  25745. ServerResponse: googleapi.ServerResponse{
  25746. Header: res.Header,
  25747. HTTPStatusCode: res.StatusCode,
  25748. },
  25749. }
  25750. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  25751. return nil, err
  25752. }
  25753. return ret, nil
  25754. // {
  25755. // "description": "Returns the specified machine type resource.",
  25756. // "httpMethod": "GET",
  25757. // "id": "compute.machineTypes.get",
  25758. // "parameterOrder": [
  25759. // "project",
  25760. // "zone",
  25761. // "machineType"
  25762. // ],
  25763. // "parameters": {
  25764. // "machineType": {
  25765. // "description": "Name of the machine type resource to return.",
  25766. // "location": "path",
  25767. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  25768. // "required": true,
  25769. // "type": "string"
  25770. // },
  25771. // "project": {
  25772. // "description": "Project ID for this request.",
  25773. // "location": "path",
  25774. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  25775. // "required": true,
  25776. // "type": "string"
  25777. // },
  25778. // "zone": {
  25779. // "description": "The name of the zone for this request.",
  25780. // "location": "path",
  25781. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  25782. // "required": true,
  25783. // "type": "string"
  25784. // }
  25785. // },
  25786. // "path": "{project}/zones/{zone}/machineTypes/{machineType}",
  25787. // "response": {
  25788. // "$ref": "MachineType"
  25789. // },
  25790. // "scopes": [
  25791. // "https://www.googleapis.com/auth/cloud-platform",
  25792. // "https://www.googleapis.com/auth/compute",
  25793. // "https://www.googleapis.com/auth/compute.readonly"
  25794. // ]
  25795. // }
  25796. }
  25797. // method id "compute.machineTypes.list":
  25798. type MachineTypesListCall struct {
  25799. s *Service
  25800. project string
  25801. zone string
  25802. urlParams_ gensupport.URLParams
  25803. ifNoneMatch_ string
  25804. ctx_ context.Context
  25805. }
  25806. // List: Retrieves a list of machine type resources available to the
  25807. // specified project.
  25808. // For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/list
  25809. func (r *MachineTypesService) List(project string, zone string) *MachineTypesListCall {
  25810. c := &MachineTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25811. c.project = project
  25812. c.zone = zone
  25813. return c
  25814. }
  25815. // Filter sets the optional parameter "filter": Sets a filter expression
  25816. // for filtering listed resources, in the form filter={expression}. Your
  25817. // {expression} must be in the format: field_name comparison_string
  25818. // literal_string.
  25819. //
  25820. // The field_name is the name of the field you want to compare. Only
  25821. // atomic field types are supported (string, number, boolean). The
  25822. // comparison_string must be either eq (equals) or ne (not equals). The
  25823. // literal_string is the string value to filter to. The literal value
  25824. // must be valid for the type of field you are filtering by (string,
  25825. // number, boolean). For string fields, the literal value is interpreted
  25826. // as a regular expression using RE2 syntax. The literal value must
  25827. // match the entire field.
  25828. //
  25829. // For example, filter=name ne example-instance.
  25830. //
  25831. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  25832. // you can also filter on nested fields. For example, you could filter
  25833. // on instances that have set the scheduling.automaticRestart field to
  25834. // true. In particular, use filtering on nested fields to take advantage
  25835. // of instance labels to organize and filter results based on label
  25836. // values.
  25837. //
  25838. // The Beta API also supports filtering on multiple expressions by
  25839. // providing each separate expression within parentheses. For example,
  25840. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  25841. // Multiple expressions are treated as AND expressions meaning that
  25842. // resources must match all expressions to pass the filters.
  25843. func (c *MachineTypesListCall) Filter(filter string) *MachineTypesListCall {
  25844. c.urlParams_.Set("filter", filter)
  25845. return c
  25846. }
  25847. // MaxResults sets the optional parameter "maxResults": The maximum
  25848. // number of results per page that Compute Engine should return. If the
  25849. // number of available results is larger than maxResults, Compute Engine
  25850. // returns a nextPageToken that can be used to get the next page of
  25851. // results in subsequent list requests.
  25852. func (c *MachineTypesListCall) MaxResults(maxResults int64) *MachineTypesListCall {
  25853. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  25854. return c
  25855. }
  25856. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  25857. // a certain order. By default, results are returned in alphanumerical
  25858. // order based on the resource name.
  25859. //
  25860. // You can also sort results in descending order based on the creation
  25861. // timestamp using orderBy="creationTimestamp desc". This sorts results
  25862. // based on the creationTimestamp field in reverse chronological order
  25863. // (newest result first). Use this to sort resources like operations so
  25864. // that the newest operation is returned first.
  25865. //
  25866. // Currently, only sorting by name or creationTimestamp desc is
  25867. // supported.
  25868. func (c *MachineTypesListCall) OrderBy(orderBy string) *MachineTypesListCall {
  25869. c.urlParams_.Set("orderBy", orderBy)
  25870. return c
  25871. }
  25872. // PageToken sets the optional parameter "pageToken": Specifies a page
  25873. // token to use. Set pageToken to the nextPageToken returned by a
  25874. // previous list request to get the next page of results.
  25875. func (c *MachineTypesListCall) PageToken(pageToken string) *MachineTypesListCall {
  25876. c.urlParams_.Set("pageToken", pageToken)
  25877. return c
  25878. }
  25879. // Fields allows partial responses to be retrieved. See
  25880. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25881. // for more information.
  25882. func (c *MachineTypesListCall) Fields(s ...googleapi.Field) *MachineTypesListCall {
  25883. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25884. return c
  25885. }
  25886. // IfNoneMatch sets the optional parameter which makes the operation
  25887. // fail if the object's ETag matches the given value. This is useful for
  25888. // getting updates only after the object has changed since the last
  25889. // request. Use googleapi.IsNotModified to check whether the response
  25890. // error from Do is the result of In-None-Match.
  25891. func (c *MachineTypesListCall) IfNoneMatch(entityTag string) *MachineTypesListCall {
  25892. c.ifNoneMatch_ = entityTag
  25893. return c
  25894. }
  25895. // Context sets the context to be used in this call's Do method. Any
  25896. // pending HTTP request will be aborted if the provided context is
  25897. // canceled.
  25898. func (c *MachineTypesListCall) Context(ctx context.Context) *MachineTypesListCall {
  25899. c.ctx_ = ctx
  25900. return c
  25901. }
  25902. func (c *MachineTypesListCall) doRequest(alt string) (*http.Response, error) {
  25903. var body io.Reader = nil
  25904. c.urlParams_.Set("alt", alt)
  25905. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/machineTypes")
  25906. urls += "?" + c.urlParams_.Encode()
  25907. req, _ := http.NewRequest("GET", urls, body)
  25908. googleapi.Expand(req.URL, map[string]string{
  25909. "project": c.project,
  25910. "zone": c.zone,
  25911. })
  25912. req.Header.Set("User-Agent", c.s.userAgent())
  25913. if c.ifNoneMatch_ != "" {
  25914. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  25915. }
  25916. if c.ctx_ != nil {
  25917. return ctxhttp.Do(c.ctx_, c.s.client, req)
  25918. }
  25919. return c.s.client.Do(req)
  25920. }
  25921. // Do executes the "compute.machineTypes.list" call.
  25922. // Exactly one of *MachineTypeList or error will be non-nil. Any non-2xx
  25923. // status code is an error. Response headers are in either
  25924. // *MachineTypeList.ServerResponse.Header or (if a response was returned
  25925. // at all) in error.(*googleapi.Error).Header. Use
  25926. // googleapi.IsNotModified to check whether the returned error was
  25927. // because http.StatusNotModified was returned.
  25928. func (c *MachineTypesListCall) Do(opts ...googleapi.CallOption) (*MachineTypeList, error) {
  25929. gensupport.SetOptions(c.urlParams_, opts...)
  25930. res, err := c.doRequest("json")
  25931. if res != nil && res.StatusCode == http.StatusNotModified {
  25932. if res.Body != nil {
  25933. res.Body.Close()
  25934. }
  25935. return nil, &googleapi.Error{
  25936. Code: res.StatusCode,
  25937. Header: res.Header,
  25938. }
  25939. }
  25940. if err != nil {
  25941. return nil, err
  25942. }
  25943. defer googleapi.CloseBody(res)
  25944. if err := googleapi.CheckResponse(res); err != nil {
  25945. return nil, err
  25946. }
  25947. ret := &MachineTypeList{
  25948. ServerResponse: googleapi.ServerResponse{
  25949. Header: res.Header,
  25950. HTTPStatusCode: res.StatusCode,
  25951. },
  25952. }
  25953. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  25954. return nil, err
  25955. }
  25956. return ret, nil
  25957. // {
  25958. // "description": "Retrieves a list of machine type resources available to the specified project.",
  25959. // "httpMethod": "GET",
  25960. // "id": "compute.machineTypes.list",
  25961. // "parameterOrder": [
  25962. // "project",
  25963. // "zone"
  25964. // ],
  25965. // "parameters": {
  25966. // "filter": {
  25967. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  25968. // "location": "query",
  25969. // "type": "string"
  25970. // },
  25971. // "maxResults": {
  25972. // "default": "500",
  25973. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  25974. // "format": "uint32",
  25975. // "location": "query",
  25976. // "maximum": "500",
  25977. // "minimum": "0",
  25978. // "type": "integer"
  25979. // },
  25980. // "orderBy": {
  25981. // "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.",
  25982. // "location": "query",
  25983. // "type": "string"
  25984. // },
  25985. // "pageToken": {
  25986. // "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.",
  25987. // "location": "query",
  25988. // "type": "string"
  25989. // },
  25990. // "project": {
  25991. // "description": "Project ID for this request.",
  25992. // "location": "path",
  25993. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  25994. // "required": true,
  25995. // "type": "string"
  25996. // },
  25997. // "zone": {
  25998. // "description": "The name of the zone for this request.",
  25999. // "location": "path",
  26000. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  26001. // "required": true,
  26002. // "type": "string"
  26003. // }
  26004. // },
  26005. // "path": "{project}/zones/{zone}/machineTypes",
  26006. // "response": {
  26007. // "$ref": "MachineTypeList"
  26008. // },
  26009. // "scopes": [
  26010. // "https://www.googleapis.com/auth/cloud-platform",
  26011. // "https://www.googleapis.com/auth/compute",
  26012. // "https://www.googleapis.com/auth/compute.readonly"
  26013. // ]
  26014. // }
  26015. }
  26016. // Pages invokes f for each page of results.
  26017. // A non-nil error returned from f will halt the iteration.
  26018. // The provided context supersedes any context provided to the Context method.
  26019. func (c *MachineTypesListCall) Pages(ctx context.Context, f func(*MachineTypeList) error) error {
  26020. c.ctx_ = ctx
  26021. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  26022. for {
  26023. x, err := c.Do()
  26024. if err != nil {
  26025. return err
  26026. }
  26027. if err := f(x); err != nil {
  26028. return err
  26029. }
  26030. if x.NextPageToken == "" {
  26031. return nil
  26032. }
  26033. c.PageToken(x.NextPageToken)
  26034. }
  26035. }
  26036. // method id "compute.networks.delete":
  26037. type NetworksDeleteCall struct {
  26038. s *Service
  26039. project string
  26040. network string
  26041. urlParams_ gensupport.URLParams
  26042. ctx_ context.Context
  26043. }
  26044. // Delete: Deletes the specified network resource.
  26045. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/delete
  26046. func (r *NetworksService) Delete(project string, network string) *NetworksDeleteCall {
  26047. c := &NetworksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26048. c.project = project
  26049. c.network = network
  26050. return c
  26051. }
  26052. // Fields allows partial responses to be retrieved. See
  26053. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26054. // for more information.
  26055. func (c *NetworksDeleteCall) Fields(s ...googleapi.Field) *NetworksDeleteCall {
  26056. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26057. return c
  26058. }
  26059. // Context sets the context to be used in this call's Do method. Any
  26060. // pending HTTP request will be aborted if the provided context is
  26061. // canceled.
  26062. func (c *NetworksDeleteCall) Context(ctx context.Context) *NetworksDeleteCall {
  26063. c.ctx_ = ctx
  26064. return c
  26065. }
  26066. func (c *NetworksDeleteCall) doRequest(alt string) (*http.Response, error) {
  26067. var body io.Reader = nil
  26068. c.urlParams_.Set("alt", alt)
  26069. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}")
  26070. urls += "?" + c.urlParams_.Encode()
  26071. req, _ := http.NewRequest("DELETE", urls, body)
  26072. googleapi.Expand(req.URL, map[string]string{
  26073. "project": c.project,
  26074. "network": c.network,
  26075. })
  26076. req.Header.Set("User-Agent", c.s.userAgent())
  26077. if c.ctx_ != nil {
  26078. return ctxhttp.Do(c.ctx_, c.s.client, req)
  26079. }
  26080. return c.s.client.Do(req)
  26081. }
  26082. // Do executes the "compute.networks.delete" call.
  26083. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  26084. // status code is an error. Response headers are in either
  26085. // *Operation.ServerResponse.Header or (if a response was returned at
  26086. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  26087. // to check whether the returned error was because
  26088. // http.StatusNotModified was returned.
  26089. func (c *NetworksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  26090. gensupport.SetOptions(c.urlParams_, opts...)
  26091. res, err := c.doRequest("json")
  26092. if res != nil && res.StatusCode == http.StatusNotModified {
  26093. if res.Body != nil {
  26094. res.Body.Close()
  26095. }
  26096. return nil, &googleapi.Error{
  26097. Code: res.StatusCode,
  26098. Header: res.Header,
  26099. }
  26100. }
  26101. if err != nil {
  26102. return nil, err
  26103. }
  26104. defer googleapi.CloseBody(res)
  26105. if err := googleapi.CheckResponse(res); err != nil {
  26106. return nil, err
  26107. }
  26108. ret := &Operation{
  26109. ServerResponse: googleapi.ServerResponse{
  26110. Header: res.Header,
  26111. HTTPStatusCode: res.StatusCode,
  26112. },
  26113. }
  26114. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  26115. return nil, err
  26116. }
  26117. return ret, nil
  26118. // {
  26119. // "description": "Deletes the specified network resource.",
  26120. // "httpMethod": "DELETE",
  26121. // "id": "compute.networks.delete",
  26122. // "parameterOrder": [
  26123. // "project",
  26124. // "network"
  26125. // ],
  26126. // "parameters": {
  26127. // "network": {
  26128. // "description": "Name of the network resource to delete.",
  26129. // "location": "path",
  26130. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  26131. // "required": true,
  26132. // "type": "string"
  26133. // },
  26134. // "project": {
  26135. // "description": "Project ID for this request.",
  26136. // "location": "path",
  26137. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  26138. // "required": true,
  26139. // "type": "string"
  26140. // }
  26141. // },
  26142. // "path": "{project}/global/networks/{network}",
  26143. // "response": {
  26144. // "$ref": "Operation"
  26145. // },
  26146. // "scopes": [
  26147. // "https://www.googleapis.com/auth/cloud-platform",
  26148. // "https://www.googleapis.com/auth/compute"
  26149. // ]
  26150. // }
  26151. }
  26152. // method id "compute.networks.get":
  26153. type NetworksGetCall struct {
  26154. s *Service
  26155. project string
  26156. network string
  26157. urlParams_ gensupport.URLParams
  26158. ifNoneMatch_ string
  26159. ctx_ context.Context
  26160. }
  26161. // Get: Returns the specified network resource.
  26162. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/get
  26163. func (r *NetworksService) Get(project string, network string) *NetworksGetCall {
  26164. c := &NetworksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26165. c.project = project
  26166. c.network = network
  26167. return c
  26168. }
  26169. // Fields allows partial responses to be retrieved. See
  26170. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26171. // for more information.
  26172. func (c *NetworksGetCall) Fields(s ...googleapi.Field) *NetworksGetCall {
  26173. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26174. return c
  26175. }
  26176. // IfNoneMatch sets the optional parameter which makes the operation
  26177. // fail if the object's ETag matches the given value. This is useful for
  26178. // getting updates only after the object has changed since the last
  26179. // request. Use googleapi.IsNotModified to check whether the response
  26180. // error from Do is the result of In-None-Match.
  26181. func (c *NetworksGetCall) IfNoneMatch(entityTag string) *NetworksGetCall {
  26182. c.ifNoneMatch_ = entityTag
  26183. return c
  26184. }
  26185. // Context sets the context to be used in this call's Do method. Any
  26186. // pending HTTP request will be aborted if the provided context is
  26187. // canceled.
  26188. func (c *NetworksGetCall) Context(ctx context.Context) *NetworksGetCall {
  26189. c.ctx_ = ctx
  26190. return c
  26191. }
  26192. func (c *NetworksGetCall) doRequest(alt string) (*http.Response, error) {
  26193. var body io.Reader = nil
  26194. c.urlParams_.Set("alt", alt)
  26195. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}")
  26196. urls += "?" + c.urlParams_.Encode()
  26197. req, _ := http.NewRequest("GET", urls, body)
  26198. googleapi.Expand(req.URL, map[string]string{
  26199. "project": c.project,
  26200. "network": c.network,
  26201. })
  26202. req.Header.Set("User-Agent", c.s.userAgent())
  26203. if c.ifNoneMatch_ != "" {
  26204. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  26205. }
  26206. if c.ctx_ != nil {
  26207. return ctxhttp.Do(c.ctx_, c.s.client, req)
  26208. }
  26209. return c.s.client.Do(req)
  26210. }
  26211. // Do executes the "compute.networks.get" call.
  26212. // Exactly one of *Network or error will be non-nil. Any non-2xx status
  26213. // code is an error. Response headers are in either
  26214. // *Network.ServerResponse.Header or (if a response was returned at all)
  26215. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  26216. // check whether the returned error was because http.StatusNotModified
  26217. // was returned.
  26218. func (c *NetworksGetCall) Do(opts ...googleapi.CallOption) (*Network, error) {
  26219. gensupport.SetOptions(c.urlParams_, opts...)
  26220. res, err := c.doRequest("json")
  26221. if res != nil && res.StatusCode == http.StatusNotModified {
  26222. if res.Body != nil {
  26223. res.Body.Close()
  26224. }
  26225. return nil, &googleapi.Error{
  26226. Code: res.StatusCode,
  26227. Header: res.Header,
  26228. }
  26229. }
  26230. if err != nil {
  26231. return nil, err
  26232. }
  26233. defer googleapi.CloseBody(res)
  26234. if err := googleapi.CheckResponse(res); err != nil {
  26235. return nil, err
  26236. }
  26237. ret := &Network{
  26238. ServerResponse: googleapi.ServerResponse{
  26239. Header: res.Header,
  26240. HTTPStatusCode: res.StatusCode,
  26241. },
  26242. }
  26243. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  26244. return nil, err
  26245. }
  26246. return ret, nil
  26247. // {
  26248. // "description": "Returns the specified network resource.",
  26249. // "httpMethod": "GET",
  26250. // "id": "compute.networks.get",
  26251. // "parameterOrder": [
  26252. // "project",
  26253. // "network"
  26254. // ],
  26255. // "parameters": {
  26256. // "network": {
  26257. // "description": "Name of the network resource to return.",
  26258. // "location": "path",
  26259. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  26260. // "required": true,
  26261. // "type": "string"
  26262. // },
  26263. // "project": {
  26264. // "description": "Project ID for this request.",
  26265. // "location": "path",
  26266. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  26267. // "required": true,
  26268. // "type": "string"
  26269. // }
  26270. // },
  26271. // "path": "{project}/global/networks/{network}",
  26272. // "response": {
  26273. // "$ref": "Network"
  26274. // },
  26275. // "scopes": [
  26276. // "https://www.googleapis.com/auth/cloud-platform",
  26277. // "https://www.googleapis.com/auth/compute",
  26278. // "https://www.googleapis.com/auth/compute.readonly"
  26279. // ]
  26280. // }
  26281. }
  26282. // method id "compute.networks.insert":
  26283. type NetworksInsertCall struct {
  26284. s *Service
  26285. project string
  26286. network *Network
  26287. urlParams_ gensupport.URLParams
  26288. ctx_ context.Context
  26289. }
  26290. // Insert: Creates a network resource in the specified project using the
  26291. // data included in the request.
  26292. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/insert
  26293. func (r *NetworksService) Insert(project string, network *Network) *NetworksInsertCall {
  26294. c := &NetworksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26295. c.project = project
  26296. c.network = network
  26297. return c
  26298. }
  26299. // Fields allows partial responses to be retrieved. See
  26300. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26301. // for more information.
  26302. func (c *NetworksInsertCall) Fields(s ...googleapi.Field) *NetworksInsertCall {
  26303. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26304. return c
  26305. }
  26306. // Context sets the context to be used in this call's Do method. Any
  26307. // pending HTTP request will be aborted if the provided context is
  26308. // canceled.
  26309. func (c *NetworksInsertCall) Context(ctx context.Context) *NetworksInsertCall {
  26310. c.ctx_ = ctx
  26311. return c
  26312. }
  26313. func (c *NetworksInsertCall) doRequest(alt string) (*http.Response, error) {
  26314. var body io.Reader = nil
  26315. body, err := googleapi.WithoutDataWrapper.JSONReader(c.network)
  26316. if err != nil {
  26317. return nil, err
  26318. }
  26319. ctype := "application/json"
  26320. c.urlParams_.Set("alt", alt)
  26321. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks")
  26322. urls += "?" + c.urlParams_.Encode()
  26323. req, _ := http.NewRequest("POST", urls, body)
  26324. googleapi.Expand(req.URL, map[string]string{
  26325. "project": c.project,
  26326. })
  26327. req.Header.Set("Content-Type", ctype)
  26328. req.Header.Set("User-Agent", c.s.userAgent())
  26329. if c.ctx_ != nil {
  26330. return ctxhttp.Do(c.ctx_, c.s.client, req)
  26331. }
  26332. return c.s.client.Do(req)
  26333. }
  26334. // Do executes the "compute.networks.insert" call.
  26335. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  26336. // status code is an error. Response headers are in either
  26337. // *Operation.ServerResponse.Header or (if a response was returned at
  26338. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  26339. // to check whether the returned error was because
  26340. // http.StatusNotModified was returned.
  26341. func (c *NetworksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  26342. gensupport.SetOptions(c.urlParams_, opts...)
  26343. res, err := c.doRequest("json")
  26344. if res != nil && res.StatusCode == http.StatusNotModified {
  26345. if res.Body != nil {
  26346. res.Body.Close()
  26347. }
  26348. return nil, &googleapi.Error{
  26349. Code: res.StatusCode,
  26350. Header: res.Header,
  26351. }
  26352. }
  26353. if err != nil {
  26354. return nil, err
  26355. }
  26356. defer googleapi.CloseBody(res)
  26357. if err := googleapi.CheckResponse(res); err != nil {
  26358. return nil, err
  26359. }
  26360. ret := &Operation{
  26361. ServerResponse: googleapi.ServerResponse{
  26362. Header: res.Header,
  26363. HTTPStatusCode: res.StatusCode,
  26364. },
  26365. }
  26366. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  26367. return nil, err
  26368. }
  26369. return ret, nil
  26370. // {
  26371. // "description": "Creates a network resource in the specified project using the data included in the request.",
  26372. // "httpMethod": "POST",
  26373. // "id": "compute.networks.insert",
  26374. // "parameterOrder": [
  26375. // "project"
  26376. // ],
  26377. // "parameters": {
  26378. // "project": {
  26379. // "description": "Project ID for this request.",
  26380. // "location": "path",
  26381. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  26382. // "required": true,
  26383. // "type": "string"
  26384. // }
  26385. // },
  26386. // "path": "{project}/global/networks",
  26387. // "request": {
  26388. // "$ref": "Network"
  26389. // },
  26390. // "response": {
  26391. // "$ref": "Operation"
  26392. // },
  26393. // "scopes": [
  26394. // "https://www.googleapis.com/auth/cloud-platform",
  26395. // "https://www.googleapis.com/auth/compute"
  26396. // ]
  26397. // }
  26398. }
  26399. // method id "compute.networks.list":
  26400. type NetworksListCall struct {
  26401. s *Service
  26402. project string
  26403. urlParams_ gensupport.URLParams
  26404. ifNoneMatch_ string
  26405. ctx_ context.Context
  26406. }
  26407. // List: Retrieves the list of network resources available to the
  26408. // specified project.
  26409. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/list
  26410. func (r *NetworksService) List(project string) *NetworksListCall {
  26411. c := &NetworksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26412. c.project = project
  26413. return c
  26414. }
  26415. // Filter sets the optional parameter "filter": Sets a filter expression
  26416. // for filtering listed resources, in the form filter={expression}. Your
  26417. // {expression} must be in the format: field_name comparison_string
  26418. // literal_string.
  26419. //
  26420. // The field_name is the name of the field you want to compare. Only
  26421. // atomic field types are supported (string, number, boolean). The
  26422. // comparison_string must be either eq (equals) or ne (not equals). The
  26423. // literal_string is the string value to filter to. The literal value
  26424. // must be valid for the type of field you are filtering by (string,
  26425. // number, boolean). For string fields, the literal value is interpreted
  26426. // as a regular expression using RE2 syntax. The literal value must
  26427. // match the entire field.
  26428. //
  26429. // For example, filter=name ne example-instance.
  26430. //
  26431. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  26432. // you can also filter on nested fields. For example, you could filter
  26433. // on instances that have set the scheduling.automaticRestart field to
  26434. // true. In particular, use filtering on nested fields to take advantage
  26435. // of instance labels to organize and filter results based on label
  26436. // values.
  26437. //
  26438. // The Beta API also supports filtering on multiple expressions by
  26439. // providing each separate expression within parentheses. For example,
  26440. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  26441. // Multiple expressions are treated as AND expressions meaning that
  26442. // resources must match all expressions to pass the filters.
  26443. func (c *NetworksListCall) Filter(filter string) *NetworksListCall {
  26444. c.urlParams_.Set("filter", filter)
  26445. return c
  26446. }
  26447. // MaxResults sets the optional parameter "maxResults": The maximum
  26448. // number of results per page that Compute Engine should return. If the
  26449. // number of available results is larger than maxResults, Compute Engine
  26450. // returns a nextPageToken that can be used to get the next page of
  26451. // results in subsequent list requests.
  26452. func (c *NetworksListCall) MaxResults(maxResults int64) *NetworksListCall {
  26453. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  26454. return c
  26455. }
  26456. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  26457. // a certain order. By default, results are returned in alphanumerical
  26458. // order based on the resource name.
  26459. //
  26460. // You can also sort results in descending order based on the creation
  26461. // timestamp using orderBy="creationTimestamp desc". This sorts results
  26462. // based on the creationTimestamp field in reverse chronological order
  26463. // (newest result first). Use this to sort resources like operations so
  26464. // that the newest operation is returned first.
  26465. //
  26466. // Currently, only sorting by name or creationTimestamp desc is
  26467. // supported.
  26468. func (c *NetworksListCall) OrderBy(orderBy string) *NetworksListCall {
  26469. c.urlParams_.Set("orderBy", orderBy)
  26470. return c
  26471. }
  26472. // PageToken sets the optional parameter "pageToken": Specifies a page
  26473. // token to use. Set pageToken to the nextPageToken returned by a
  26474. // previous list request to get the next page of results.
  26475. func (c *NetworksListCall) PageToken(pageToken string) *NetworksListCall {
  26476. c.urlParams_.Set("pageToken", pageToken)
  26477. return c
  26478. }
  26479. // Fields allows partial responses to be retrieved. See
  26480. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26481. // for more information.
  26482. func (c *NetworksListCall) Fields(s ...googleapi.Field) *NetworksListCall {
  26483. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26484. return c
  26485. }
  26486. // IfNoneMatch sets the optional parameter which makes the operation
  26487. // fail if the object's ETag matches the given value. This is useful for
  26488. // getting updates only after the object has changed since the last
  26489. // request. Use googleapi.IsNotModified to check whether the response
  26490. // error from Do is the result of In-None-Match.
  26491. func (c *NetworksListCall) IfNoneMatch(entityTag string) *NetworksListCall {
  26492. c.ifNoneMatch_ = entityTag
  26493. return c
  26494. }
  26495. // Context sets the context to be used in this call's Do method. Any
  26496. // pending HTTP request will be aborted if the provided context is
  26497. // canceled.
  26498. func (c *NetworksListCall) Context(ctx context.Context) *NetworksListCall {
  26499. c.ctx_ = ctx
  26500. return c
  26501. }
  26502. func (c *NetworksListCall) doRequest(alt string) (*http.Response, error) {
  26503. var body io.Reader = nil
  26504. c.urlParams_.Set("alt", alt)
  26505. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks")
  26506. urls += "?" + c.urlParams_.Encode()
  26507. req, _ := http.NewRequest("GET", urls, body)
  26508. googleapi.Expand(req.URL, map[string]string{
  26509. "project": c.project,
  26510. })
  26511. req.Header.Set("User-Agent", c.s.userAgent())
  26512. if c.ifNoneMatch_ != "" {
  26513. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  26514. }
  26515. if c.ctx_ != nil {
  26516. return ctxhttp.Do(c.ctx_, c.s.client, req)
  26517. }
  26518. return c.s.client.Do(req)
  26519. }
  26520. // Do executes the "compute.networks.list" call.
  26521. // Exactly one of *NetworkList or error will be non-nil. Any non-2xx
  26522. // status code is an error. Response headers are in either
  26523. // *NetworkList.ServerResponse.Header or (if a response was returned at
  26524. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  26525. // to check whether the returned error was because
  26526. // http.StatusNotModified was returned.
  26527. func (c *NetworksListCall) Do(opts ...googleapi.CallOption) (*NetworkList, error) {
  26528. gensupport.SetOptions(c.urlParams_, opts...)
  26529. res, err := c.doRequest("json")
  26530. if res != nil && res.StatusCode == http.StatusNotModified {
  26531. if res.Body != nil {
  26532. res.Body.Close()
  26533. }
  26534. return nil, &googleapi.Error{
  26535. Code: res.StatusCode,
  26536. Header: res.Header,
  26537. }
  26538. }
  26539. if err != nil {
  26540. return nil, err
  26541. }
  26542. defer googleapi.CloseBody(res)
  26543. if err := googleapi.CheckResponse(res); err != nil {
  26544. return nil, err
  26545. }
  26546. ret := &NetworkList{
  26547. ServerResponse: googleapi.ServerResponse{
  26548. Header: res.Header,
  26549. HTTPStatusCode: res.StatusCode,
  26550. },
  26551. }
  26552. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  26553. return nil, err
  26554. }
  26555. return ret, nil
  26556. // {
  26557. // "description": "Retrieves the list of network resources available to the specified project.",
  26558. // "httpMethod": "GET",
  26559. // "id": "compute.networks.list",
  26560. // "parameterOrder": [
  26561. // "project"
  26562. // ],
  26563. // "parameters": {
  26564. // "filter": {
  26565. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  26566. // "location": "query",
  26567. // "type": "string"
  26568. // },
  26569. // "maxResults": {
  26570. // "default": "500",
  26571. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  26572. // "format": "uint32",
  26573. // "location": "query",
  26574. // "maximum": "500",
  26575. // "minimum": "0",
  26576. // "type": "integer"
  26577. // },
  26578. // "orderBy": {
  26579. // "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.",
  26580. // "location": "query",
  26581. // "type": "string"
  26582. // },
  26583. // "pageToken": {
  26584. // "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.",
  26585. // "location": "query",
  26586. // "type": "string"
  26587. // },
  26588. // "project": {
  26589. // "description": "Project ID for this request.",
  26590. // "location": "path",
  26591. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  26592. // "required": true,
  26593. // "type": "string"
  26594. // }
  26595. // },
  26596. // "path": "{project}/global/networks",
  26597. // "response": {
  26598. // "$ref": "NetworkList"
  26599. // },
  26600. // "scopes": [
  26601. // "https://www.googleapis.com/auth/cloud-platform",
  26602. // "https://www.googleapis.com/auth/compute",
  26603. // "https://www.googleapis.com/auth/compute.readonly"
  26604. // ]
  26605. // }
  26606. }
  26607. // Pages invokes f for each page of results.
  26608. // A non-nil error returned from f will halt the iteration.
  26609. // The provided context supersedes any context provided to the Context method.
  26610. func (c *NetworksListCall) Pages(ctx context.Context, f func(*NetworkList) error) error {
  26611. c.ctx_ = ctx
  26612. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  26613. for {
  26614. x, err := c.Do()
  26615. if err != nil {
  26616. return err
  26617. }
  26618. if err := f(x); err != nil {
  26619. return err
  26620. }
  26621. if x.NextPageToken == "" {
  26622. return nil
  26623. }
  26624. c.PageToken(x.NextPageToken)
  26625. }
  26626. }
  26627. // method id "compute.projects.get":
  26628. type ProjectsGetCall struct {
  26629. s *Service
  26630. project string
  26631. urlParams_ gensupport.URLParams
  26632. ifNoneMatch_ string
  26633. ctx_ context.Context
  26634. }
  26635. // Get: Returns the specified project resource.
  26636. // For details, see https://cloud.google.com/compute/docs/reference/latest/projects/get
  26637. func (r *ProjectsService) Get(project string) *ProjectsGetCall {
  26638. c := &ProjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26639. c.project = project
  26640. return c
  26641. }
  26642. // Fields allows partial responses to be retrieved. See
  26643. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26644. // for more information.
  26645. func (c *ProjectsGetCall) Fields(s ...googleapi.Field) *ProjectsGetCall {
  26646. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26647. return c
  26648. }
  26649. // IfNoneMatch sets the optional parameter which makes the operation
  26650. // fail if the object's ETag matches the given value. This is useful for
  26651. // getting updates only after the object has changed since the last
  26652. // request. Use googleapi.IsNotModified to check whether the response
  26653. // error from Do is the result of In-None-Match.
  26654. func (c *ProjectsGetCall) IfNoneMatch(entityTag string) *ProjectsGetCall {
  26655. c.ifNoneMatch_ = entityTag
  26656. return c
  26657. }
  26658. // Context sets the context to be used in this call's Do method. Any
  26659. // pending HTTP request will be aborted if the provided context is
  26660. // canceled.
  26661. func (c *ProjectsGetCall) Context(ctx context.Context) *ProjectsGetCall {
  26662. c.ctx_ = ctx
  26663. return c
  26664. }
  26665. func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) {
  26666. var body io.Reader = nil
  26667. c.urlParams_.Set("alt", alt)
  26668. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}")
  26669. urls += "?" + c.urlParams_.Encode()
  26670. req, _ := http.NewRequest("GET", urls, body)
  26671. googleapi.Expand(req.URL, map[string]string{
  26672. "project": c.project,
  26673. })
  26674. req.Header.Set("User-Agent", c.s.userAgent())
  26675. if c.ifNoneMatch_ != "" {
  26676. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  26677. }
  26678. if c.ctx_ != nil {
  26679. return ctxhttp.Do(c.ctx_, c.s.client, req)
  26680. }
  26681. return c.s.client.Do(req)
  26682. }
  26683. // Do executes the "compute.projects.get" call.
  26684. // Exactly one of *Project or error will be non-nil. Any non-2xx status
  26685. // code is an error. Response headers are in either
  26686. // *Project.ServerResponse.Header or (if a response was returned at all)
  26687. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  26688. // check whether the returned error was because http.StatusNotModified
  26689. // was returned.
  26690. func (c *ProjectsGetCall) Do(opts ...googleapi.CallOption) (*Project, error) {
  26691. gensupport.SetOptions(c.urlParams_, opts...)
  26692. res, err := c.doRequest("json")
  26693. if res != nil && res.StatusCode == http.StatusNotModified {
  26694. if res.Body != nil {
  26695. res.Body.Close()
  26696. }
  26697. return nil, &googleapi.Error{
  26698. Code: res.StatusCode,
  26699. Header: res.Header,
  26700. }
  26701. }
  26702. if err != nil {
  26703. return nil, err
  26704. }
  26705. defer googleapi.CloseBody(res)
  26706. if err := googleapi.CheckResponse(res); err != nil {
  26707. return nil, err
  26708. }
  26709. ret := &Project{
  26710. ServerResponse: googleapi.ServerResponse{
  26711. Header: res.Header,
  26712. HTTPStatusCode: res.StatusCode,
  26713. },
  26714. }
  26715. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  26716. return nil, err
  26717. }
  26718. return ret, nil
  26719. // {
  26720. // "description": "Returns the specified project resource.",
  26721. // "httpMethod": "GET",
  26722. // "id": "compute.projects.get",
  26723. // "parameterOrder": [
  26724. // "project"
  26725. // ],
  26726. // "parameters": {
  26727. // "project": {
  26728. // "description": "Project ID for this request.",
  26729. // "location": "path",
  26730. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  26731. // "required": true,
  26732. // "type": "string"
  26733. // }
  26734. // },
  26735. // "path": "{project}",
  26736. // "response": {
  26737. // "$ref": "Project"
  26738. // },
  26739. // "scopes": [
  26740. // "https://www.googleapis.com/auth/cloud-platform",
  26741. // "https://www.googleapis.com/auth/compute",
  26742. // "https://www.googleapis.com/auth/compute.readonly"
  26743. // ]
  26744. // }
  26745. }
  26746. // method id "compute.projects.setCommonInstanceMetadata":
  26747. type ProjectsSetCommonInstanceMetadataCall struct {
  26748. s *Service
  26749. project string
  26750. metadata *Metadata
  26751. urlParams_ gensupport.URLParams
  26752. ctx_ context.Context
  26753. }
  26754. // SetCommonInstanceMetadata: Sets metadata common to all instances
  26755. // within the specified project using the data included in the request.
  26756. // For details, see https://cloud.google.com/compute/docs/reference/latest/projects/setCommonInstanceMetadata
  26757. func (r *ProjectsService) SetCommonInstanceMetadata(project string, metadata *Metadata) *ProjectsSetCommonInstanceMetadataCall {
  26758. c := &ProjectsSetCommonInstanceMetadataCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26759. c.project = project
  26760. c.metadata = metadata
  26761. return c
  26762. }
  26763. // Fields allows partial responses to be retrieved. See
  26764. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26765. // for more information.
  26766. func (c *ProjectsSetCommonInstanceMetadataCall) Fields(s ...googleapi.Field) *ProjectsSetCommonInstanceMetadataCall {
  26767. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26768. return c
  26769. }
  26770. // Context sets the context to be used in this call's Do method. Any
  26771. // pending HTTP request will be aborted if the provided context is
  26772. // canceled.
  26773. func (c *ProjectsSetCommonInstanceMetadataCall) Context(ctx context.Context) *ProjectsSetCommonInstanceMetadataCall {
  26774. c.ctx_ = ctx
  26775. return c
  26776. }
  26777. func (c *ProjectsSetCommonInstanceMetadataCall) doRequest(alt string) (*http.Response, error) {
  26778. var body io.Reader = nil
  26779. body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata)
  26780. if err != nil {
  26781. return nil, err
  26782. }
  26783. ctype := "application/json"
  26784. c.urlParams_.Set("alt", alt)
  26785. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setCommonInstanceMetadata")
  26786. urls += "?" + c.urlParams_.Encode()
  26787. req, _ := http.NewRequest("POST", urls, body)
  26788. googleapi.Expand(req.URL, map[string]string{
  26789. "project": c.project,
  26790. })
  26791. req.Header.Set("Content-Type", ctype)
  26792. req.Header.Set("User-Agent", c.s.userAgent())
  26793. if c.ctx_ != nil {
  26794. return ctxhttp.Do(c.ctx_, c.s.client, req)
  26795. }
  26796. return c.s.client.Do(req)
  26797. }
  26798. // Do executes the "compute.projects.setCommonInstanceMetadata" call.
  26799. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  26800. // status code is an error. Response headers are in either
  26801. // *Operation.ServerResponse.Header or (if a response was returned at
  26802. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  26803. // to check whether the returned error was because
  26804. // http.StatusNotModified was returned.
  26805. func (c *ProjectsSetCommonInstanceMetadataCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  26806. gensupport.SetOptions(c.urlParams_, opts...)
  26807. res, err := c.doRequest("json")
  26808. if res != nil && res.StatusCode == http.StatusNotModified {
  26809. if res.Body != nil {
  26810. res.Body.Close()
  26811. }
  26812. return nil, &googleapi.Error{
  26813. Code: res.StatusCode,
  26814. Header: res.Header,
  26815. }
  26816. }
  26817. if err != nil {
  26818. return nil, err
  26819. }
  26820. defer googleapi.CloseBody(res)
  26821. if err := googleapi.CheckResponse(res); err != nil {
  26822. return nil, err
  26823. }
  26824. ret := &Operation{
  26825. ServerResponse: googleapi.ServerResponse{
  26826. Header: res.Header,
  26827. HTTPStatusCode: res.StatusCode,
  26828. },
  26829. }
  26830. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  26831. return nil, err
  26832. }
  26833. return ret, nil
  26834. // {
  26835. // "description": "Sets metadata common to all instances within the specified project using the data included in the request.",
  26836. // "httpMethod": "POST",
  26837. // "id": "compute.projects.setCommonInstanceMetadata",
  26838. // "parameterOrder": [
  26839. // "project"
  26840. // ],
  26841. // "parameters": {
  26842. // "project": {
  26843. // "description": "Project ID for this request.",
  26844. // "location": "path",
  26845. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  26846. // "required": true,
  26847. // "type": "string"
  26848. // }
  26849. // },
  26850. // "path": "{project}/setCommonInstanceMetadata",
  26851. // "request": {
  26852. // "$ref": "Metadata"
  26853. // },
  26854. // "response": {
  26855. // "$ref": "Operation"
  26856. // },
  26857. // "scopes": [
  26858. // "https://www.googleapis.com/auth/cloud-platform",
  26859. // "https://www.googleapis.com/auth/compute"
  26860. // ]
  26861. // }
  26862. }
  26863. // method id "compute.projects.setUsageExportBucket":
  26864. type ProjectsSetUsageExportBucketCall struct {
  26865. s *Service
  26866. project string
  26867. usageexportlocation *UsageExportLocation
  26868. urlParams_ gensupport.URLParams
  26869. ctx_ context.Context
  26870. }
  26871. // SetUsageExportBucket: Enables the usage export feature and sets the
  26872. // usage export bucket where reports are stored. If you provide an empty
  26873. // request body using this method, the usage export feature will be
  26874. // disabled.
  26875. // For details, see https://cloud.google.com/compute/docs/reference/latest/projects/setUsageExportBucket
  26876. func (r *ProjectsService) SetUsageExportBucket(project string, usageexportlocation *UsageExportLocation) *ProjectsSetUsageExportBucketCall {
  26877. c := &ProjectsSetUsageExportBucketCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26878. c.project = project
  26879. c.usageexportlocation = usageexportlocation
  26880. return c
  26881. }
  26882. // Fields allows partial responses to be retrieved. See
  26883. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26884. // for more information.
  26885. func (c *ProjectsSetUsageExportBucketCall) Fields(s ...googleapi.Field) *ProjectsSetUsageExportBucketCall {
  26886. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26887. return c
  26888. }
  26889. // Context sets the context to be used in this call's Do method. Any
  26890. // pending HTTP request will be aborted if the provided context is
  26891. // canceled.
  26892. func (c *ProjectsSetUsageExportBucketCall) Context(ctx context.Context) *ProjectsSetUsageExportBucketCall {
  26893. c.ctx_ = ctx
  26894. return c
  26895. }
  26896. func (c *ProjectsSetUsageExportBucketCall) doRequest(alt string) (*http.Response, error) {
  26897. var body io.Reader = nil
  26898. body, err := googleapi.WithoutDataWrapper.JSONReader(c.usageexportlocation)
  26899. if err != nil {
  26900. return nil, err
  26901. }
  26902. ctype := "application/json"
  26903. c.urlParams_.Set("alt", alt)
  26904. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setUsageExportBucket")
  26905. urls += "?" + c.urlParams_.Encode()
  26906. req, _ := http.NewRequest("POST", urls, body)
  26907. googleapi.Expand(req.URL, map[string]string{
  26908. "project": c.project,
  26909. })
  26910. req.Header.Set("Content-Type", ctype)
  26911. req.Header.Set("User-Agent", c.s.userAgent())
  26912. if c.ctx_ != nil {
  26913. return ctxhttp.Do(c.ctx_, c.s.client, req)
  26914. }
  26915. return c.s.client.Do(req)
  26916. }
  26917. // Do executes the "compute.projects.setUsageExportBucket" call.
  26918. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  26919. // status code is an error. Response headers are in either
  26920. // *Operation.ServerResponse.Header or (if a response was returned at
  26921. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  26922. // to check whether the returned error was because
  26923. // http.StatusNotModified was returned.
  26924. func (c *ProjectsSetUsageExportBucketCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  26925. gensupport.SetOptions(c.urlParams_, opts...)
  26926. res, err := c.doRequest("json")
  26927. if res != nil && res.StatusCode == http.StatusNotModified {
  26928. if res.Body != nil {
  26929. res.Body.Close()
  26930. }
  26931. return nil, &googleapi.Error{
  26932. Code: res.StatusCode,
  26933. Header: res.Header,
  26934. }
  26935. }
  26936. if err != nil {
  26937. return nil, err
  26938. }
  26939. defer googleapi.CloseBody(res)
  26940. if err := googleapi.CheckResponse(res); err != nil {
  26941. return nil, err
  26942. }
  26943. ret := &Operation{
  26944. ServerResponse: googleapi.ServerResponse{
  26945. Header: res.Header,
  26946. HTTPStatusCode: res.StatusCode,
  26947. },
  26948. }
  26949. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  26950. return nil, err
  26951. }
  26952. return ret, nil
  26953. // {
  26954. // "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.",
  26955. // "httpMethod": "POST",
  26956. // "id": "compute.projects.setUsageExportBucket",
  26957. // "parameterOrder": [
  26958. // "project"
  26959. // ],
  26960. // "parameters": {
  26961. // "project": {
  26962. // "description": "Project ID for this request.",
  26963. // "location": "path",
  26964. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  26965. // "required": true,
  26966. // "type": "string"
  26967. // }
  26968. // },
  26969. // "path": "{project}/setUsageExportBucket",
  26970. // "request": {
  26971. // "$ref": "UsageExportLocation"
  26972. // },
  26973. // "response": {
  26974. // "$ref": "Operation"
  26975. // },
  26976. // "scopes": [
  26977. // "https://www.googleapis.com/auth/cloud-platform",
  26978. // "https://www.googleapis.com/auth/compute",
  26979. // "https://www.googleapis.com/auth/devstorage.full_control",
  26980. // "https://www.googleapis.com/auth/devstorage.read_only",
  26981. // "https://www.googleapis.com/auth/devstorage.read_write"
  26982. // ]
  26983. // }
  26984. }
  26985. // method id "compute.regionOperations.delete":
  26986. type RegionOperationsDeleteCall struct {
  26987. s *Service
  26988. project string
  26989. region string
  26990. operation string
  26991. urlParams_ gensupport.URLParams
  26992. ctx_ context.Context
  26993. }
  26994. // Delete: Deletes the specified region-specific Operations resource.
  26995. // For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/delete
  26996. func (r *RegionOperationsService) Delete(project string, region string, operation string) *RegionOperationsDeleteCall {
  26997. c := &RegionOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26998. c.project = project
  26999. c.region = region
  27000. c.operation = operation
  27001. return c
  27002. }
  27003. // Fields allows partial responses to be retrieved. See
  27004. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27005. // for more information.
  27006. func (c *RegionOperationsDeleteCall) Fields(s ...googleapi.Field) *RegionOperationsDeleteCall {
  27007. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27008. return c
  27009. }
  27010. // Context sets the context to be used in this call's Do method. Any
  27011. // pending HTTP request will be aborted if the provided context is
  27012. // canceled.
  27013. func (c *RegionOperationsDeleteCall) Context(ctx context.Context) *RegionOperationsDeleteCall {
  27014. c.ctx_ = ctx
  27015. return c
  27016. }
  27017. func (c *RegionOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  27018. var body io.Reader = nil
  27019. c.urlParams_.Set("alt", alt)
  27020. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations/{operation}")
  27021. urls += "?" + c.urlParams_.Encode()
  27022. req, _ := http.NewRequest("DELETE", urls, body)
  27023. googleapi.Expand(req.URL, map[string]string{
  27024. "project": c.project,
  27025. "region": c.region,
  27026. "operation": c.operation,
  27027. })
  27028. req.Header.Set("User-Agent", c.s.userAgent())
  27029. if c.ctx_ != nil {
  27030. return ctxhttp.Do(c.ctx_, c.s.client, req)
  27031. }
  27032. return c.s.client.Do(req)
  27033. }
  27034. // Do executes the "compute.regionOperations.delete" call.
  27035. func (c *RegionOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  27036. gensupport.SetOptions(c.urlParams_, opts...)
  27037. res, err := c.doRequest("json")
  27038. if err != nil {
  27039. return err
  27040. }
  27041. defer googleapi.CloseBody(res)
  27042. if err := googleapi.CheckResponse(res); err != nil {
  27043. return err
  27044. }
  27045. return nil
  27046. // {
  27047. // "description": "Deletes the specified region-specific Operations resource.",
  27048. // "httpMethod": "DELETE",
  27049. // "id": "compute.regionOperations.delete",
  27050. // "parameterOrder": [
  27051. // "project",
  27052. // "region",
  27053. // "operation"
  27054. // ],
  27055. // "parameters": {
  27056. // "operation": {
  27057. // "description": "Name of the Operations resource to delete.",
  27058. // "location": "path",
  27059. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  27060. // "required": true,
  27061. // "type": "string"
  27062. // },
  27063. // "project": {
  27064. // "description": "Project ID for this request.",
  27065. // "location": "path",
  27066. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  27067. // "required": true,
  27068. // "type": "string"
  27069. // },
  27070. // "region": {
  27071. // "description": "Name of the region scoping this request.",
  27072. // "location": "path",
  27073. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  27074. // "required": true,
  27075. // "type": "string"
  27076. // }
  27077. // },
  27078. // "path": "{project}/regions/{region}/operations/{operation}",
  27079. // "scopes": [
  27080. // "https://www.googleapis.com/auth/cloud-platform",
  27081. // "https://www.googleapis.com/auth/compute"
  27082. // ]
  27083. // }
  27084. }
  27085. // method id "compute.regionOperations.get":
  27086. type RegionOperationsGetCall struct {
  27087. s *Service
  27088. project string
  27089. region string
  27090. operation string
  27091. urlParams_ gensupport.URLParams
  27092. ifNoneMatch_ string
  27093. ctx_ context.Context
  27094. }
  27095. // Get: Retrieves the specified region-specific Operations resource.
  27096. // For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/get
  27097. func (r *RegionOperationsService) Get(project string, region string, operation string) *RegionOperationsGetCall {
  27098. c := &RegionOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27099. c.project = project
  27100. c.region = region
  27101. c.operation = operation
  27102. return c
  27103. }
  27104. // Fields allows partial responses to be retrieved. See
  27105. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27106. // for more information.
  27107. func (c *RegionOperationsGetCall) Fields(s ...googleapi.Field) *RegionOperationsGetCall {
  27108. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27109. return c
  27110. }
  27111. // IfNoneMatch sets the optional parameter which makes the operation
  27112. // fail if the object's ETag matches the given value. This is useful for
  27113. // getting updates only after the object has changed since the last
  27114. // request. Use googleapi.IsNotModified to check whether the response
  27115. // error from Do is the result of In-None-Match.
  27116. func (c *RegionOperationsGetCall) IfNoneMatch(entityTag string) *RegionOperationsGetCall {
  27117. c.ifNoneMatch_ = entityTag
  27118. return c
  27119. }
  27120. // Context sets the context to be used in this call's Do method. Any
  27121. // pending HTTP request will be aborted if the provided context is
  27122. // canceled.
  27123. func (c *RegionOperationsGetCall) Context(ctx context.Context) *RegionOperationsGetCall {
  27124. c.ctx_ = ctx
  27125. return c
  27126. }
  27127. func (c *RegionOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  27128. var body io.Reader = nil
  27129. c.urlParams_.Set("alt", alt)
  27130. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations/{operation}")
  27131. urls += "?" + c.urlParams_.Encode()
  27132. req, _ := http.NewRequest("GET", urls, body)
  27133. googleapi.Expand(req.URL, map[string]string{
  27134. "project": c.project,
  27135. "region": c.region,
  27136. "operation": c.operation,
  27137. })
  27138. req.Header.Set("User-Agent", c.s.userAgent())
  27139. if c.ifNoneMatch_ != "" {
  27140. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  27141. }
  27142. if c.ctx_ != nil {
  27143. return ctxhttp.Do(c.ctx_, c.s.client, req)
  27144. }
  27145. return c.s.client.Do(req)
  27146. }
  27147. // Do executes the "compute.regionOperations.get" call.
  27148. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  27149. // status code is an error. Response headers are in either
  27150. // *Operation.ServerResponse.Header or (if a response was returned at
  27151. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  27152. // to check whether the returned error was because
  27153. // http.StatusNotModified was returned.
  27154. func (c *RegionOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  27155. gensupport.SetOptions(c.urlParams_, opts...)
  27156. res, err := c.doRequest("json")
  27157. if res != nil && res.StatusCode == http.StatusNotModified {
  27158. if res.Body != nil {
  27159. res.Body.Close()
  27160. }
  27161. return nil, &googleapi.Error{
  27162. Code: res.StatusCode,
  27163. Header: res.Header,
  27164. }
  27165. }
  27166. if err != nil {
  27167. return nil, err
  27168. }
  27169. defer googleapi.CloseBody(res)
  27170. if err := googleapi.CheckResponse(res); err != nil {
  27171. return nil, err
  27172. }
  27173. ret := &Operation{
  27174. ServerResponse: googleapi.ServerResponse{
  27175. Header: res.Header,
  27176. HTTPStatusCode: res.StatusCode,
  27177. },
  27178. }
  27179. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  27180. return nil, err
  27181. }
  27182. return ret, nil
  27183. // {
  27184. // "description": "Retrieves the specified region-specific Operations resource.",
  27185. // "httpMethod": "GET",
  27186. // "id": "compute.regionOperations.get",
  27187. // "parameterOrder": [
  27188. // "project",
  27189. // "region",
  27190. // "operation"
  27191. // ],
  27192. // "parameters": {
  27193. // "operation": {
  27194. // "description": "Name of the Operations resource to return.",
  27195. // "location": "path",
  27196. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  27197. // "required": true,
  27198. // "type": "string"
  27199. // },
  27200. // "project": {
  27201. // "description": "Project ID for this request.",
  27202. // "location": "path",
  27203. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  27204. // "required": true,
  27205. // "type": "string"
  27206. // },
  27207. // "region": {
  27208. // "description": "Name of the region scoping this request.",
  27209. // "location": "path",
  27210. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  27211. // "required": true,
  27212. // "type": "string"
  27213. // }
  27214. // },
  27215. // "path": "{project}/regions/{region}/operations/{operation}",
  27216. // "response": {
  27217. // "$ref": "Operation"
  27218. // },
  27219. // "scopes": [
  27220. // "https://www.googleapis.com/auth/cloud-platform",
  27221. // "https://www.googleapis.com/auth/compute",
  27222. // "https://www.googleapis.com/auth/compute.readonly"
  27223. // ]
  27224. // }
  27225. }
  27226. // method id "compute.regionOperations.list":
  27227. type RegionOperationsListCall struct {
  27228. s *Service
  27229. project string
  27230. region string
  27231. urlParams_ gensupport.URLParams
  27232. ifNoneMatch_ string
  27233. ctx_ context.Context
  27234. }
  27235. // List: Retrieves a list of Operation resources contained within the
  27236. // specified region.
  27237. // For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/list
  27238. func (r *RegionOperationsService) List(project string, region string) *RegionOperationsListCall {
  27239. c := &RegionOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27240. c.project = project
  27241. c.region = region
  27242. return c
  27243. }
  27244. // Filter sets the optional parameter "filter": Sets a filter expression
  27245. // for filtering listed resources, in the form filter={expression}. Your
  27246. // {expression} must be in the format: field_name comparison_string
  27247. // literal_string.
  27248. //
  27249. // The field_name is the name of the field you want to compare. Only
  27250. // atomic field types are supported (string, number, boolean). The
  27251. // comparison_string must be either eq (equals) or ne (not equals). The
  27252. // literal_string is the string value to filter to. The literal value
  27253. // must be valid for the type of field you are filtering by (string,
  27254. // number, boolean). For string fields, the literal value is interpreted
  27255. // as a regular expression using RE2 syntax. The literal value must
  27256. // match the entire field.
  27257. //
  27258. // For example, filter=name ne example-instance.
  27259. //
  27260. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  27261. // you can also filter on nested fields. For example, you could filter
  27262. // on instances that have set the scheduling.automaticRestart field to
  27263. // true. In particular, use filtering on nested fields to take advantage
  27264. // of instance labels to organize and filter results based on label
  27265. // values.
  27266. //
  27267. // The Beta API also supports filtering on multiple expressions by
  27268. // providing each separate expression within parentheses. For example,
  27269. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  27270. // Multiple expressions are treated as AND expressions meaning that
  27271. // resources must match all expressions to pass the filters.
  27272. func (c *RegionOperationsListCall) Filter(filter string) *RegionOperationsListCall {
  27273. c.urlParams_.Set("filter", filter)
  27274. return c
  27275. }
  27276. // MaxResults sets the optional parameter "maxResults": The maximum
  27277. // number of results per page that Compute Engine should return. If the
  27278. // number of available results is larger than maxResults, Compute Engine
  27279. // returns a nextPageToken that can be used to get the next page of
  27280. // results in subsequent list requests.
  27281. func (c *RegionOperationsListCall) MaxResults(maxResults int64) *RegionOperationsListCall {
  27282. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  27283. return c
  27284. }
  27285. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  27286. // a certain order. By default, results are returned in alphanumerical
  27287. // order based on the resource name.
  27288. //
  27289. // You can also sort results in descending order based on the creation
  27290. // timestamp using orderBy="creationTimestamp desc". This sorts results
  27291. // based on the creationTimestamp field in reverse chronological order
  27292. // (newest result first). Use this to sort resources like operations so
  27293. // that the newest operation is returned first.
  27294. //
  27295. // Currently, only sorting by name or creationTimestamp desc is
  27296. // supported.
  27297. func (c *RegionOperationsListCall) OrderBy(orderBy string) *RegionOperationsListCall {
  27298. c.urlParams_.Set("orderBy", orderBy)
  27299. return c
  27300. }
  27301. // PageToken sets the optional parameter "pageToken": Specifies a page
  27302. // token to use. Set pageToken to the nextPageToken returned by a
  27303. // previous list request to get the next page of results.
  27304. func (c *RegionOperationsListCall) PageToken(pageToken string) *RegionOperationsListCall {
  27305. c.urlParams_.Set("pageToken", pageToken)
  27306. return c
  27307. }
  27308. // Fields allows partial responses to be retrieved. See
  27309. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27310. // for more information.
  27311. func (c *RegionOperationsListCall) Fields(s ...googleapi.Field) *RegionOperationsListCall {
  27312. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27313. return c
  27314. }
  27315. // IfNoneMatch sets the optional parameter which makes the operation
  27316. // fail if the object's ETag matches the given value. This is useful for
  27317. // getting updates only after the object has changed since the last
  27318. // request. Use googleapi.IsNotModified to check whether the response
  27319. // error from Do is the result of In-None-Match.
  27320. func (c *RegionOperationsListCall) IfNoneMatch(entityTag string) *RegionOperationsListCall {
  27321. c.ifNoneMatch_ = entityTag
  27322. return c
  27323. }
  27324. // Context sets the context to be used in this call's Do method. Any
  27325. // pending HTTP request will be aborted if the provided context is
  27326. // canceled.
  27327. func (c *RegionOperationsListCall) Context(ctx context.Context) *RegionOperationsListCall {
  27328. c.ctx_ = ctx
  27329. return c
  27330. }
  27331. func (c *RegionOperationsListCall) doRequest(alt string) (*http.Response, error) {
  27332. var body io.Reader = nil
  27333. c.urlParams_.Set("alt", alt)
  27334. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations")
  27335. urls += "?" + c.urlParams_.Encode()
  27336. req, _ := http.NewRequest("GET", urls, body)
  27337. googleapi.Expand(req.URL, map[string]string{
  27338. "project": c.project,
  27339. "region": c.region,
  27340. })
  27341. req.Header.Set("User-Agent", c.s.userAgent())
  27342. if c.ifNoneMatch_ != "" {
  27343. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  27344. }
  27345. if c.ctx_ != nil {
  27346. return ctxhttp.Do(c.ctx_, c.s.client, req)
  27347. }
  27348. return c.s.client.Do(req)
  27349. }
  27350. // Do executes the "compute.regionOperations.list" call.
  27351. // Exactly one of *OperationList or error will be non-nil. Any non-2xx
  27352. // status code is an error. Response headers are in either
  27353. // *OperationList.ServerResponse.Header or (if a response was returned
  27354. // at all) in error.(*googleapi.Error).Header. Use
  27355. // googleapi.IsNotModified to check whether the returned error was
  27356. // because http.StatusNotModified was returned.
  27357. func (c *RegionOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, error) {
  27358. gensupport.SetOptions(c.urlParams_, opts...)
  27359. res, err := c.doRequest("json")
  27360. if res != nil && res.StatusCode == http.StatusNotModified {
  27361. if res.Body != nil {
  27362. res.Body.Close()
  27363. }
  27364. return nil, &googleapi.Error{
  27365. Code: res.StatusCode,
  27366. Header: res.Header,
  27367. }
  27368. }
  27369. if err != nil {
  27370. return nil, err
  27371. }
  27372. defer googleapi.CloseBody(res)
  27373. if err := googleapi.CheckResponse(res); err != nil {
  27374. return nil, err
  27375. }
  27376. ret := &OperationList{
  27377. ServerResponse: googleapi.ServerResponse{
  27378. Header: res.Header,
  27379. HTTPStatusCode: res.StatusCode,
  27380. },
  27381. }
  27382. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  27383. return nil, err
  27384. }
  27385. return ret, nil
  27386. // {
  27387. // "description": "Retrieves a list of Operation resources contained within the specified region.",
  27388. // "httpMethod": "GET",
  27389. // "id": "compute.regionOperations.list",
  27390. // "parameterOrder": [
  27391. // "project",
  27392. // "region"
  27393. // ],
  27394. // "parameters": {
  27395. // "filter": {
  27396. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  27397. // "location": "query",
  27398. // "type": "string"
  27399. // },
  27400. // "maxResults": {
  27401. // "default": "500",
  27402. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  27403. // "format": "uint32",
  27404. // "location": "query",
  27405. // "maximum": "500",
  27406. // "minimum": "0",
  27407. // "type": "integer"
  27408. // },
  27409. // "orderBy": {
  27410. // "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.",
  27411. // "location": "query",
  27412. // "type": "string"
  27413. // },
  27414. // "pageToken": {
  27415. // "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.",
  27416. // "location": "query",
  27417. // "type": "string"
  27418. // },
  27419. // "project": {
  27420. // "description": "Project ID for this request.",
  27421. // "location": "path",
  27422. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  27423. // "required": true,
  27424. // "type": "string"
  27425. // },
  27426. // "region": {
  27427. // "description": "Name of the region scoping this request.",
  27428. // "location": "path",
  27429. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  27430. // "required": true,
  27431. // "type": "string"
  27432. // }
  27433. // },
  27434. // "path": "{project}/regions/{region}/operations",
  27435. // "response": {
  27436. // "$ref": "OperationList"
  27437. // },
  27438. // "scopes": [
  27439. // "https://www.googleapis.com/auth/cloud-platform",
  27440. // "https://www.googleapis.com/auth/compute",
  27441. // "https://www.googleapis.com/auth/compute.readonly"
  27442. // ]
  27443. // }
  27444. }
  27445. // Pages invokes f for each page of results.
  27446. // A non-nil error returned from f will halt the iteration.
  27447. // The provided context supersedes any context provided to the Context method.
  27448. func (c *RegionOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
  27449. c.ctx_ = ctx
  27450. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  27451. for {
  27452. x, err := c.Do()
  27453. if err != nil {
  27454. return err
  27455. }
  27456. if err := f(x); err != nil {
  27457. return err
  27458. }
  27459. if x.NextPageToken == "" {
  27460. return nil
  27461. }
  27462. c.PageToken(x.NextPageToken)
  27463. }
  27464. }
  27465. // method id "compute.regions.get":
  27466. type RegionsGetCall struct {
  27467. s *Service
  27468. project string
  27469. region string
  27470. urlParams_ gensupport.URLParams
  27471. ifNoneMatch_ string
  27472. ctx_ context.Context
  27473. }
  27474. // Get: Returns the specified region resource.
  27475. // For details, see https://cloud.google.com/compute/docs/reference/latest/regions/get
  27476. func (r *RegionsService) Get(project string, region string) *RegionsGetCall {
  27477. c := &RegionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27478. c.project = project
  27479. c.region = region
  27480. return c
  27481. }
  27482. // Fields allows partial responses to be retrieved. See
  27483. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27484. // for more information.
  27485. func (c *RegionsGetCall) Fields(s ...googleapi.Field) *RegionsGetCall {
  27486. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27487. return c
  27488. }
  27489. // IfNoneMatch sets the optional parameter which makes the operation
  27490. // fail if the object's ETag matches the given value. This is useful for
  27491. // getting updates only after the object has changed since the last
  27492. // request. Use googleapi.IsNotModified to check whether the response
  27493. // error from Do is the result of In-None-Match.
  27494. func (c *RegionsGetCall) IfNoneMatch(entityTag string) *RegionsGetCall {
  27495. c.ifNoneMatch_ = entityTag
  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 *RegionsGetCall) Context(ctx context.Context) *RegionsGetCall {
  27502. c.ctx_ = ctx
  27503. return c
  27504. }
  27505. func (c *RegionsGetCall) doRequest(alt string) (*http.Response, error) {
  27506. var body io.Reader = nil
  27507. c.urlParams_.Set("alt", alt)
  27508. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}")
  27509. urls += "?" + c.urlParams_.Encode()
  27510. req, _ := http.NewRequest("GET", urls, body)
  27511. googleapi.Expand(req.URL, map[string]string{
  27512. "project": c.project,
  27513. "region": c.region,
  27514. })
  27515. req.Header.Set("User-Agent", c.s.userAgent())
  27516. if c.ifNoneMatch_ != "" {
  27517. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  27518. }
  27519. if c.ctx_ != nil {
  27520. return ctxhttp.Do(c.ctx_, c.s.client, req)
  27521. }
  27522. return c.s.client.Do(req)
  27523. }
  27524. // Do executes the "compute.regions.get" call.
  27525. // Exactly one of *Region or error will be non-nil. Any non-2xx status
  27526. // code is an error. Response headers are in either
  27527. // *Region.ServerResponse.Header or (if a response was returned at all)
  27528. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  27529. // check whether the returned error was because http.StatusNotModified
  27530. // was returned.
  27531. func (c *RegionsGetCall) Do(opts ...googleapi.CallOption) (*Region, error) {
  27532. gensupport.SetOptions(c.urlParams_, opts...)
  27533. res, err := c.doRequest("json")
  27534. if res != nil && res.StatusCode == http.StatusNotModified {
  27535. if res.Body != nil {
  27536. res.Body.Close()
  27537. }
  27538. return nil, &googleapi.Error{
  27539. Code: res.StatusCode,
  27540. Header: res.Header,
  27541. }
  27542. }
  27543. if err != nil {
  27544. return nil, err
  27545. }
  27546. defer googleapi.CloseBody(res)
  27547. if err := googleapi.CheckResponse(res); err != nil {
  27548. return nil, err
  27549. }
  27550. ret := &Region{
  27551. ServerResponse: googleapi.ServerResponse{
  27552. Header: res.Header,
  27553. HTTPStatusCode: res.StatusCode,
  27554. },
  27555. }
  27556. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  27557. return nil, err
  27558. }
  27559. return ret, nil
  27560. // {
  27561. // "description": "Returns the specified region resource.",
  27562. // "httpMethod": "GET",
  27563. // "id": "compute.regions.get",
  27564. // "parameterOrder": [
  27565. // "project",
  27566. // "region"
  27567. // ],
  27568. // "parameters": {
  27569. // "project": {
  27570. // "description": "Project ID for this request.",
  27571. // "location": "path",
  27572. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  27573. // "required": true,
  27574. // "type": "string"
  27575. // },
  27576. // "region": {
  27577. // "description": "Name of the region resource to return.",
  27578. // "location": "path",
  27579. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  27580. // "required": true,
  27581. // "type": "string"
  27582. // }
  27583. // },
  27584. // "path": "{project}/regions/{region}",
  27585. // "response": {
  27586. // "$ref": "Region"
  27587. // },
  27588. // "scopes": [
  27589. // "https://www.googleapis.com/auth/cloud-platform",
  27590. // "https://www.googleapis.com/auth/compute",
  27591. // "https://www.googleapis.com/auth/compute.readonly"
  27592. // ]
  27593. // }
  27594. }
  27595. // method id "compute.regions.list":
  27596. type RegionsListCall struct {
  27597. s *Service
  27598. project string
  27599. urlParams_ gensupport.URLParams
  27600. ifNoneMatch_ string
  27601. ctx_ context.Context
  27602. }
  27603. // List: Retrieves the list of region resources available to the
  27604. // specified project.
  27605. // For details, see https://cloud.google.com/compute/docs/reference/latest/regions/list
  27606. func (r *RegionsService) List(project string) *RegionsListCall {
  27607. c := &RegionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27608. c.project = project
  27609. return c
  27610. }
  27611. // Filter sets the optional parameter "filter": Sets a filter expression
  27612. // for filtering listed resources, in the form filter={expression}. Your
  27613. // {expression} must be in the format: field_name comparison_string
  27614. // literal_string.
  27615. //
  27616. // The field_name is the name of the field you want to compare. Only
  27617. // atomic field types are supported (string, number, boolean). The
  27618. // comparison_string must be either eq (equals) or ne (not equals). The
  27619. // literal_string is the string value to filter to. The literal value
  27620. // must be valid for the type of field you are filtering by (string,
  27621. // number, boolean). For string fields, the literal value is interpreted
  27622. // as a regular expression using RE2 syntax. The literal value must
  27623. // match the entire field.
  27624. //
  27625. // For example, filter=name ne example-instance.
  27626. //
  27627. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  27628. // you can also filter on nested fields. For example, you could filter
  27629. // on instances that have set the scheduling.automaticRestart field to
  27630. // true. In particular, use filtering on nested fields to take advantage
  27631. // of instance labels to organize and filter results based on label
  27632. // values.
  27633. //
  27634. // The Beta API also supports filtering on multiple expressions by
  27635. // providing each separate expression within parentheses. For example,
  27636. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  27637. // Multiple expressions are treated as AND expressions meaning that
  27638. // resources must match all expressions to pass the filters.
  27639. func (c *RegionsListCall) Filter(filter string) *RegionsListCall {
  27640. c.urlParams_.Set("filter", filter)
  27641. return c
  27642. }
  27643. // MaxResults sets the optional parameter "maxResults": The maximum
  27644. // number of results per page that Compute Engine should return. If the
  27645. // number of available results is larger than maxResults, Compute Engine
  27646. // returns a nextPageToken that can be used to get the next page of
  27647. // results in subsequent list requests.
  27648. func (c *RegionsListCall) MaxResults(maxResults int64) *RegionsListCall {
  27649. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  27650. return c
  27651. }
  27652. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  27653. // a certain order. By default, results are returned in alphanumerical
  27654. // order based on the resource name.
  27655. //
  27656. // You can also sort results in descending order based on the creation
  27657. // timestamp using orderBy="creationTimestamp desc". This sorts results
  27658. // based on the creationTimestamp field in reverse chronological order
  27659. // (newest result first). Use this to sort resources like operations so
  27660. // that the newest operation is returned first.
  27661. //
  27662. // Currently, only sorting by name or creationTimestamp desc is
  27663. // supported.
  27664. func (c *RegionsListCall) OrderBy(orderBy string) *RegionsListCall {
  27665. c.urlParams_.Set("orderBy", orderBy)
  27666. return c
  27667. }
  27668. // PageToken sets the optional parameter "pageToken": Specifies a page
  27669. // token to use. Set pageToken to the nextPageToken returned by a
  27670. // previous list request to get the next page of results.
  27671. func (c *RegionsListCall) PageToken(pageToken string) *RegionsListCall {
  27672. c.urlParams_.Set("pageToken", pageToken)
  27673. return c
  27674. }
  27675. // Fields allows partial responses to be retrieved. See
  27676. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27677. // for more information.
  27678. func (c *RegionsListCall) Fields(s ...googleapi.Field) *RegionsListCall {
  27679. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27680. return c
  27681. }
  27682. // IfNoneMatch sets the optional parameter which makes the operation
  27683. // fail if the object's ETag matches the given value. This is useful for
  27684. // getting updates only after the object has changed since the last
  27685. // request. Use googleapi.IsNotModified to check whether the response
  27686. // error from Do is the result of In-None-Match.
  27687. func (c *RegionsListCall) IfNoneMatch(entityTag string) *RegionsListCall {
  27688. c.ifNoneMatch_ = entityTag
  27689. return c
  27690. }
  27691. // Context sets the context to be used in this call's Do method. Any
  27692. // pending HTTP request will be aborted if the provided context is
  27693. // canceled.
  27694. func (c *RegionsListCall) Context(ctx context.Context) *RegionsListCall {
  27695. c.ctx_ = ctx
  27696. return c
  27697. }
  27698. func (c *RegionsListCall) doRequest(alt string) (*http.Response, error) {
  27699. var body io.Reader = nil
  27700. c.urlParams_.Set("alt", alt)
  27701. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions")
  27702. urls += "?" + c.urlParams_.Encode()
  27703. req, _ := http.NewRequest("GET", urls, body)
  27704. googleapi.Expand(req.URL, map[string]string{
  27705. "project": c.project,
  27706. })
  27707. req.Header.Set("User-Agent", c.s.userAgent())
  27708. if c.ifNoneMatch_ != "" {
  27709. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  27710. }
  27711. if c.ctx_ != nil {
  27712. return ctxhttp.Do(c.ctx_, c.s.client, req)
  27713. }
  27714. return c.s.client.Do(req)
  27715. }
  27716. // Do executes the "compute.regions.list" call.
  27717. // Exactly one of *RegionList or error will be non-nil. Any non-2xx
  27718. // status code is an error. Response headers are in either
  27719. // *RegionList.ServerResponse.Header or (if a response was returned at
  27720. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  27721. // to check whether the returned error was because
  27722. // http.StatusNotModified was returned.
  27723. func (c *RegionsListCall) Do(opts ...googleapi.CallOption) (*RegionList, error) {
  27724. gensupport.SetOptions(c.urlParams_, opts...)
  27725. res, err := c.doRequest("json")
  27726. if res != nil && res.StatusCode == http.StatusNotModified {
  27727. if res.Body != nil {
  27728. res.Body.Close()
  27729. }
  27730. return nil, &googleapi.Error{
  27731. Code: res.StatusCode,
  27732. Header: res.Header,
  27733. }
  27734. }
  27735. if err != nil {
  27736. return nil, err
  27737. }
  27738. defer googleapi.CloseBody(res)
  27739. if err := googleapi.CheckResponse(res); err != nil {
  27740. return nil, err
  27741. }
  27742. ret := &RegionList{
  27743. ServerResponse: googleapi.ServerResponse{
  27744. Header: res.Header,
  27745. HTTPStatusCode: res.StatusCode,
  27746. },
  27747. }
  27748. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  27749. return nil, err
  27750. }
  27751. return ret, nil
  27752. // {
  27753. // "description": "Retrieves the list of region resources available to the specified project.",
  27754. // "httpMethod": "GET",
  27755. // "id": "compute.regions.list",
  27756. // "parameterOrder": [
  27757. // "project"
  27758. // ],
  27759. // "parameters": {
  27760. // "filter": {
  27761. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  27762. // "location": "query",
  27763. // "type": "string"
  27764. // },
  27765. // "maxResults": {
  27766. // "default": "500",
  27767. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  27768. // "format": "uint32",
  27769. // "location": "query",
  27770. // "maximum": "500",
  27771. // "minimum": "0",
  27772. // "type": "integer"
  27773. // },
  27774. // "orderBy": {
  27775. // "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.",
  27776. // "location": "query",
  27777. // "type": "string"
  27778. // },
  27779. // "pageToken": {
  27780. // "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.",
  27781. // "location": "query",
  27782. // "type": "string"
  27783. // },
  27784. // "project": {
  27785. // "description": "Project ID for this request.",
  27786. // "location": "path",
  27787. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  27788. // "required": true,
  27789. // "type": "string"
  27790. // }
  27791. // },
  27792. // "path": "{project}/regions",
  27793. // "response": {
  27794. // "$ref": "RegionList"
  27795. // },
  27796. // "scopes": [
  27797. // "https://www.googleapis.com/auth/cloud-platform",
  27798. // "https://www.googleapis.com/auth/compute",
  27799. // "https://www.googleapis.com/auth/compute.readonly"
  27800. // ]
  27801. // }
  27802. }
  27803. // Pages invokes f for each page of results.
  27804. // A non-nil error returned from f will halt the iteration.
  27805. // The provided context supersedes any context provided to the Context method.
  27806. func (c *RegionsListCall) Pages(ctx context.Context, f func(*RegionList) error) error {
  27807. c.ctx_ = ctx
  27808. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  27809. for {
  27810. x, err := c.Do()
  27811. if err != nil {
  27812. return err
  27813. }
  27814. if err := f(x); err != nil {
  27815. return err
  27816. }
  27817. if x.NextPageToken == "" {
  27818. return nil
  27819. }
  27820. c.PageToken(x.NextPageToken)
  27821. }
  27822. }
  27823. // method id "compute.routes.delete":
  27824. type RoutesDeleteCall struct {
  27825. s *Service
  27826. project string
  27827. route string
  27828. urlParams_ gensupport.URLParams
  27829. ctx_ context.Context
  27830. }
  27831. // Delete: Deletes the specified route resource.
  27832. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/delete
  27833. func (r *RoutesService) Delete(project string, route string) *RoutesDeleteCall {
  27834. c := &RoutesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27835. c.project = project
  27836. c.route = route
  27837. return c
  27838. }
  27839. // Fields allows partial responses to be retrieved. See
  27840. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27841. // for more information.
  27842. func (c *RoutesDeleteCall) Fields(s ...googleapi.Field) *RoutesDeleteCall {
  27843. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27844. return c
  27845. }
  27846. // Context sets the context to be used in this call's Do method. Any
  27847. // pending HTTP request will be aborted if the provided context is
  27848. // canceled.
  27849. func (c *RoutesDeleteCall) Context(ctx context.Context) *RoutesDeleteCall {
  27850. c.ctx_ = ctx
  27851. return c
  27852. }
  27853. func (c *RoutesDeleteCall) doRequest(alt string) (*http.Response, error) {
  27854. var body io.Reader = nil
  27855. c.urlParams_.Set("alt", alt)
  27856. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes/{route}")
  27857. urls += "?" + c.urlParams_.Encode()
  27858. req, _ := http.NewRequest("DELETE", urls, body)
  27859. googleapi.Expand(req.URL, map[string]string{
  27860. "project": c.project,
  27861. "route": c.route,
  27862. })
  27863. req.Header.Set("User-Agent", c.s.userAgent())
  27864. if c.ctx_ != nil {
  27865. return ctxhttp.Do(c.ctx_, c.s.client, req)
  27866. }
  27867. return c.s.client.Do(req)
  27868. }
  27869. // Do executes the "compute.routes.delete" call.
  27870. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  27871. // status code is an error. Response headers are in either
  27872. // *Operation.ServerResponse.Header or (if a response was returned at
  27873. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  27874. // to check whether the returned error was because
  27875. // http.StatusNotModified was returned.
  27876. func (c *RoutesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  27877. gensupport.SetOptions(c.urlParams_, opts...)
  27878. res, err := c.doRequest("json")
  27879. if res != nil && res.StatusCode == http.StatusNotModified {
  27880. if res.Body != nil {
  27881. res.Body.Close()
  27882. }
  27883. return nil, &googleapi.Error{
  27884. Code: res.StatusCode,
  27885. Header: res.Header,
  27886. }
  27887. }
  27888. if err != nil {
  27889. return nil, err
  27890. }
  27891. defer googleapi.CloseBody(res)
  27892. if err := googleapi.CheckResponse(res); err != nil {
  27893. return nil, err
  27894. }
  27895. ret := &Operation{
  27896. ServerResponse: googleapi.ServerResponse{
  27897. Header: res.Header,
  27898. HTTPStatusCode: res.StatusCode,
  27899. },
  27900. }
  27901. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  27902. return nil, err
  27903. }
  27904. return ret, nil
  27905. // {
  27906. // "description": "Deletes the specified route resource.",
  27907. // "httpMethod": "DELETE",
  27908. // "id": "compute.routes.delete",
  27909. // "parameterOrder": [
  27910. // "project",
  27911. // "route"
  27912. // ],
  27913. // "parameters": {
  27914. // "project": {
  27915. // "description": "Project ID for this request.",
  27916. // "location": "path",
  27917. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  27918. // "required": true,
  27919. // "type": "string"
  27920. // },
  27921. // "route": {
  27922. // "description": "Name of the route resource to delete.",
  27923. // "location": "path",
  27924. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  27925. // "required": true,
  27926. // "type": "string"
  27927. // }
  27928. // },
  27929. // "path": "{project}/global/routes/{route}",
  27930. // "response": {
  27931. // "$ref": "Operation"
  27932. // },
  27933. // "scopes": [
  27934. // "https://www.googleapis.com/auth/cloud-platform",
  27935. // "https://www.googleapis.com/auth/compute"
  27936. // ]
  27937. // }
  27938. }
  27939. // method id "compute.routes.get":
  27940. type RoutesGetCall struct {
  27941. s *Service
  27942. project string
  27943. route string
  27944. urlParams_ gensupport.URLParams
  27945. ifNoneMatch_ string
  27946. ctx_ context.Context
  27947. }
  27948. // Get: Returns the specified route resource.
  27949. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/get
  27950. func (r *RoutesService) Get(project string, route string) *RoutesGetCall {
  27951. c := &RoutesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27952. c.project = project
  27953. c.route = route
  27954. return c
  27955. }
  27956. // Fields allows partial responses to be retrieved. See
  27957. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27958. // for more information.
  27959. func (c *RoutesGetCall) Fields(s ...googleapi.Field) *RoutesGetCall {
  27960. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27961. return c
  27962. }
  27963. // IfNoneMatch sets the optional parameter which makes the operation
  27964. // fail if the object's ETag matches the given value. This is useful for
  27965. // getting updates only after the object has changed since the last
  27966. // request. Use googleapi.IsNotModified to check whether the response
  27967. // error from Do is the result of In-None-Match.
  27968. func (c *RoutesGetCall) IfNoneMatch(entityTag string) *RoutesGetCall {
  27969. c.ifNoneMatch_ = entityTag
  27970. return c
  27971. }
  27972. // Context sets the context to be used in this call's Do method. Any
  27973. // pending HTTP request will be aborted if the provided context is
  27974. // canceled.
  27975. func (c *RoutesGetCall) Context(ctx context.Context) *RoutesGetCall {
  27976. c.ctx_ = ctx
  27977. return c
  27978. }
  27979. func (c *RoutesGetCall) doRequest(alt string) (*http.Response, error) {
  27980. var body io.Reader = nil
  27981. c.urlParams_.Set("alt", alt)
  27982. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes/{route}")
  27983. urls += "?" + c.urlParams_.Encode()
  27984. req, _ := http.NewRequest("GET", urls, body)
  27985. googleapi.Expand(req.URL, map[string]string{
  27986. "project": c.project,
  27987. "route": c.route,
  27988. })
  27989. req.Header.Set("User-Agent", c.s.userAgent())
  27990. if c.ifNoneMatch_ != "" {
  27991. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  27992. }
  27993. if c.ctx_ != nil {
  27994. return ctxhttp.Do(c.ctx_, c.s.client, req)
  27995. }
  27996. return c.s.client.Do(req)
  27997. }
  27998. // Do executes the "compute.routes.get" call.
  27999. // Exactly one of *Route or error will be non-nil. Any non-2xx status
  28000. // code is an error. Response headers are in either
  28001. // *Route.ServerResponse.Header or (if a response was returned at all)
  28002. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  28003. // check whether the returned error was because http.StatusNotModified
  28004. // was returned.
  28005. func (c *RoutesGetCall) Do(opts ...googleapi.CallOption) (*Route, error) {
  28006. gensupport.SetOptions(c.urlParams_, opts...)
  28007. res, err := c.doRequest("json")
  28008. if res != nil && res.StatusCode == http.StatusNotModified {
  28009. if res.Body != nil {
  28010. res.Body.Close()
  28011. }
  28012. return nil, &googleapi.Error{
  28013. Code: res.StatusCode,
  28014. Header: res.Header,
  28015. }
  28016. }
  28017. if err != nil {
  28018. return nil, err
  28019. }
  28020. defer googleapi.CloseBody(res)
  28021. if err := googleapi.CheckResponse(res); err != nil {
  28022. return nil, err
  28023. }
  28024. ret := &Route{
  28025. ServerResponse: googleapi.ServerResponse{
  28026. Header: res.Header,
  28027. HTTPStatusCode: res.StatusCode,
  28028. },
  28029. }
  28030. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  28031. return nil, err
  28032. }
  28033. return ret, nil
  28034. // {
  28035. // "description": "Returns the specified route resource.",
  28036. // "httpMethod": "GET",
  28037. // "id": "compute.routes.get",
  28038. // "parameterOrder": [
  28039. // "project",
  28040. // "route"
  28041. // ],
  28042. // "parameters": {
  28043. // "project": {
  28044. // "description": "Project ID for this request.",
  28045. // "location": "path",
  28046. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  28047. // "required": true,
  28048. // "type": "string"
  28049. // },
  28050. // "route": {
  28051. // "description": "Name of the route resource to return.",
  28052. // "location": "path",
  28053. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  28054. // "required": true,
  28055. // "type": "string"
  28056. // }
  28057. // },
  28058. // "path": "{project}/global/routes/{route}",
  28059. // "response": {
  28060. // "$ref": "Route"
  28061. // },
  28062. // "scopes": [
  28063. // "https://www.googleapis.com/auth/cloud-platform",
  28064. // "https://www.googleapis.com/auth/compute",
  28065. // "https://www.googleapis.com/auth/compute.readonly"
  28066. // ]
  28067. // }
  28068. }
  28069. // method id "compute.routes.insert":
  28070. type RoutesInsertCall struct {
  28071. s *Service
  28072. project string
  28073. route *Route
  28074. urlParams_ gensupport.URLParams
  28075. ctx_ context.Context
  28076. }
  28077. // Insert: Creates a route resource in the specified project using the
  28078. // data included in the request.
  28079. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/insert
  28080. func (r *RoutesService) Insert(project string, route *Route) *RoutesInsertCall {
  28081. c := &RoutesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28082. c.project = project
  28083. c.route = route
  28084. return c
  28085. }
  28086. // Fields allows partial responses to be retrieved. See
  28087. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28088. // for more information.
  28089. func (c *RoutesInsertCall) Fields(s ...googleapi.Field) *RoutesInsertCall {
  28090. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28091. return c
  28092. }
  28093. // Context sets the context to be used in this call's Do method. Any
  28094. // pending HTTP request will be aborted if the provided context is
  28095. // canceled.
  28096. func (c *RoutesInsertCall) Context(ctx context.Context) *RoutesInsertCall {
  28097. c.ctx_ = ctx
  28098. return c
  28099. }
  28100. func (c *RoutesInsertCall) doRequest(alt string) (*http.Response, error) {
  28101. var body io.Reader = nil
  28102. body, err := googleapi.WithoutDataWrapper.JSONReader(c.route)
  28103. if err != nil {
  28104. return nil, err
  28105. }
  28106. ctype := "application/json"
  28107. c.urlParams_.Set("alt", alt)
  28108. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes")
  28109. urls += "?" + c.urlParams_.Encode()
  28110. req, _ := http.NewRequest("POST", urls, body)
  28111. googleapi.Expand(req.URL, map[string]string{
  28112. "project": c.project,
  28113. })
  28114. req.Header.Set("Content-Type", ctype)
  28115. req.Header.Set("User-Agent", c.s.userAgent())
  28116. if c.ctx_ != nil {
  28117. return ctxhttp.Do(c.ctx_, c.s.client, req)
  28118. }
  28119. return c.s.client.Do(req)
  28120. }
  28121. // Do executes the "compute.routes.insert" call.
  28122. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  28123. // status code is an error. Response headers are in either
  28124. // *Operation.ServerResponse.Header or (if a response was returned at
  28125. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  28126. // to check whether the returned error was because
  28127. // http.StatusNotModified was returned.
  28128. func (c *RoutesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  28129. gensupport.SetOptions(c.urlParams_, opts...)
  28130. res, err := c.doRequest("json")
  28131. if res != nil && res.StatusCode == http.StatusNotModified {
  28132. if res.Body != nil {
  28133. res.Body.Close()
  28134. }
  28135. return nil, &googleapi.Error{
  28136. Code: res.StatusCode,
  28137. Header: res.Header,
  28138. }
  28139. }
  28140. if err != nil {
  28141. return nil, err
  28142. }
  28143. defer googleapi.CloseBody(res)
  28144. if err := googleapi.CheckResponse(res); err != nil {
  28145. return nil, err
  28146. }
  28147. ret := &Operation{
  28148. ServerResponse: googleapi.ServerResponse{
  28149. Header: res.Header,
  28150. HTTPStatusCode: res.StatusCode,
  28151. },
  28152. }
  28153. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  28154. return nil, err
  28155. }
  28156. return ret, nil
  28157. // {
  28158. // "description": "Creates a route resource in the specified project using the data included in the request.",
  28159. // "httpMethod": "POST",
  28160. // "id": "compute.routes.insert",
  28161. // "parameterOrder": [
  28162. // "project"
  28163. // ],
  28164. // "parameters": {
  28165. // "project": {
  28166. // "description": "Project ID for this request.",
  28167. // "location": "path",
  28168. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  28169. // "required": true,
  28170. // "type": "string"
  28171. // }
  28172. // },
  28173. // "path": "{project}/global/routes",
  28174. // "request": {
  28175. // "$ref": "Route"
  28176. // },
  28177. // "response": {
  28178. // "$ref": "Operation"
  28179. // },
  28180. // "scopes": [
  28181. // "https://www.googleapis.com/auth/cloud-platform",
  28182. // "https://www.googleapis.com/auth/compute"
  28183. // ]
  28184. // }
  28185. }
  28186. // method id "compute.routes.list":
  28187. type RoutesListCall struct {
  28188. s *Service
  28189. project string
  28190. urlParams_ gensupport.URLParams
  28191. ifNoneMatch_ string
  28192. ctx_ context.Context
  28193. }
  28194. // List: Retrieves the list of route resources available to the
  28195. // specified project.
  28196. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/list
  28197. func (r *RoutesService) List(project string) *RoutesListCall {
  28198. c := &RoutesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28199. c.project = project
  28200. return c
  28201. }
  28202. // Filter sets the optional parameter "filter": Sets a filter expression
  28203. // for filtering listed resources, in the form filter={expression}. Your
  28204. // {expression} must be in the format: field_name comparison_string
  28205. // literal_string.
  28206. //
  28207. // The field_name is the name of the field you want to compare. Only
  28208. // atomic field types are supported (string, number, boolean). The
  28209. // comparison_string must be either eq (equals) or ne (not equals). The
  28210. // literal_string is the string value to filter to. The literal value
  28211. // must be valid for the type of field you are filtering by (string,
  28212. // number, boolean). For string fields, the literal value is interpreted
  28213. // as a regular expression using RE2 syntax. The literal value must
  28214. // match the entire field.
  28215. //
  28216. // For example, filter=name ne example-instance.
  28217. //
  28218. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  28219. // you can also filter on nested fields. For example, you could filter
  28220. // on instances that have set the scheduling.automaticRestart field to
  28221. // true. In particular, use filtering on nested fields to take advantage
  28222. // of instance labels to organize and filter results based on label
  28223. // values.
  28224. //
  28225. // The Beta API also supports filtering on multiple expressions by
  28226. // providing each separate expression within parentheses. For example,
  28227. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  28228. // Multiple expressions are treated as AND expressions meaning that
  28229. // resources must match all expressions to pass the filters.
  28230. func (c *RoutesListCall) Filter(filter string) *RoutesListCall {
  28231. c.urlParams_.Set("filter", filter)
  28232. return c
  28233. }
  28234. // MaxResults sets the optional parameter "maxResults": The maximum
  28235. // number of results per page that Compute Engine should return. If the
  28236. // number of available results is larger than maxResults, Compute Engine
  28237. // returns a nextPageToken that can be used to get the next page of
  28238. // results in subsequent list requests.
  28239. func (c *RoutesListCall) MaxResults(maxResults int64) *RoutesListCall {
  28240. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  28241. return c
  28242. }
  28243. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  28244. // a certain order. By default, results are returned in alphanumerical
  28245. // order based on the resource name.
  28246. //
  28247. // You can also sort results in descending order based on the creation
  28248. // timestamp using orderBy="creationTimestamp desc". This sorts results
  28249. // based on the creationTimestamp field in reverse chronological order
  28250. // (newest result first). Use this to sort resources like operations so
  28251. // that the newest operation is returned first.
  28252. //
  28253. // Currently, only sorting by name or creationTimestamp desc is
  28254. // supported.
  28255. func (c *RoutesListCall) OrderBy(orderBy string) *RoutesListCall {
  28256. c.urlParams_.Set("orderBy", orderBy)
  28257. return c
  28258. }
  28259. // PageToken sets the optional parameter "pageToken": Specifies a page
  28260. // token to use. Set pageToken to the nextPageToken returned by a
  28261. // previous list request to get the next page of results.
  28262. func (c *RoutesListCall) PageToken(pageToken string) *RoutesListCall {
  28263. c.urlParams_.Set("pageToken", pageToken)
  28264. return c
  28265. }
  28266. // Fields allows partial responses to be retrieved. See
  28267. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28268. // for more information.
  28269. func (c *RoutesListCall) Fields(s ...googleapi.Field) *RoutesListCall {
  28270. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28271. return c
  28272. }
  28273. // IfNoneMatch sets the optional parameter which makes the operation
  28274. // fail if the object's ETag matches the given value. This is useful for
  28275. // getting updates only after the object has changed since the last
  28276. // request. Use googleapi.IsNotModified to check whether the response
  28277. // error from Do is the result of In-None-Match.
  28278. func (c *RoutesListCall) IfNoneMatch(entityTag string) *RoutesListCall {
  28279. c.ifNoneMatch_ = entityTag
  28280. return c
  28281. }
  28282. // Context sets the context to be used in this call's Do method. Any
  28283. // pending HTTP request will be aborted if the provided context is
  28284. // canceled.
  28285. func (c *RoutesListCall) Context(ctx context.Context) *RoutesListCall {
  28286. c.ctx_ = ctx
  28287. return c
  28288. }
  28289. func (c *RoutesListCall) doRequest(alt string) (*http.Response, error) {
  28290. var body io.Reader = nil
  28291. c.urlParams_.Set("alt", alt)
  28292. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes")
  28293. urls += "?" + c.urlParams_.Encode()
  28294. req, _ := http.NewRequest("GET", urls, body)
  28295. googleapi.Expand(req.URL, map[string]string{
  28296. "project": c.project,
  28297. })
  28298. req.Header.Set("User-Agent", c.s.userAgent())
  28299. if c.ifNoneMatch_ != "" {
  28300. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  28301. }
  28302. if c.ctx_ != nil {
  28303. return ctxhttp.Do(c.ctx_, c.s.client, req)
  28304. }
  28305. return c.s.client.Do(req)
  28306. }
  28307. // Do executes the "compute.routes.list" call.
  28308. // Exactly one of *RouteList or error will be non-nil. Any non-2xx
  28309. // status code is an error. Response headers are in either
  28310. // *RouteList.ServerResponse.Header or (if a response was returned at
  28311. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  28312. // to check whether the returned error was because
  28313. // http.StatusNotModified was returned.
  28314. func (c *RoutesListCall) Do(opts ...googleapi.CallOption) (*RouteList, error) {
  28315. gensupport.SetOptions(c.urlParams_, opts...)
  28316. res, err := c.doRequest("json")
  28317. if res != nil && res.StatusCode == http.StatusNotModified {
  28318. if res.Body != nil {
  28319. res.Body.Close()
  28320. }
  28321. return nil, &googleapi.Error{
  28322. Code: res.StatusCode,
  28323. Header: res.Header,
  28324. }
  28325. }
  28326. if err != nil {
  28327. return nil, err
  28328. }
  28329. defer googleapi.CloseBody(res)
  28330. if err := googleapi.CheckResponse(res); err != nil {
  28331. return nil, err
  28332. }
  28333. ret := &RouteList{
  28334. ServerResponse: googleapi.ServerResponse{
  28335. Header: res.Header,
  28336. HTTPStatusCode: res.StatusCode,
  28337. },
  28338. }
  28339. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  28340. return nil, err
  28341. }
  28342. return ret, nil
  28343. // {
  28344. // "description": "Retrieves the list of route resources available to the specified project.",
  28345. // "httpMethod": "GET",
  28346. // "id": "compute.routes.list",
  28347. // "parameterOrder": [
  28348. // "project"
  28349. // ],
  28350. // "parameters": {
  28351. // "filter": {
  28352. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  28353. // "location": "query",
  28354. // "type": "string"
  28355. // },
  28356. // "maxResults": {
  28357. // "default": "500",
  28358. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  28359. // "format": "uint32",
  28360. // "location": "query",
  28361. // "maximum": "500",
  28362. // "minimum": "0",
  28363. // "type": "integer"
  28364. // },
  28365. // "orderBy": {
  28366. // "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.",
  28367. // "location": "query",
  28368. // "type": "string"
  28369. // },
  28370. // "pageToken": {
  28371. // "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.",
  28372. // "location": "query",
  28373. // "type": "string"
  28374. // },
  28375. // "project": {
  28376. // "description": "Project ID for this request.",
  28377. // "location": "path",
  28378. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  28379. // "required": true,
  28380. // "type": "string"
  28381. // }
  28382. // },
  28383. // "path": "{project}/global/routes",
  28384. // "response": {
  28385. // "$ref": "RouteList"
  28386. // },
  28387. // "scopes": [
  28388. // "https://www.googleapis.com/auth/cloud-platform",
  28389. // "https://www.googleapis.com/auth/compute",
  28390. // "https://www.googleapis.com/auth/compute.readonly"
  28391. // ]
  28392. // }
  28393. }
  28394. // Pages invokes f for each page of results.
  28395. // A non-nil error returned from f will halt the iteration.
  28396. // The provided context supersedes any context provided to the Context method.
  28397. func (c *RoutesListCall) Pages(ctx context.Context, f func(*RouteList) error) error {
  28398. c.ctx_ = ctx
  28399. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  28400. for {
  28401. x, err := c.Do()
  28402. if err != nil {
  28403. return err
  28404. }
  28405. if err := f(x); err != nil {
  28406. return err
  28407. }
  28408. if x.NextPageToken == "" {
  28409. return nil
  28410. }
  28411. c.PageToken(x.NextPageToken)
  28412. }
  28413. }
  28414. // method id "compute.snapshots.delete":
  28415. type SnapshotsDeleteCall struct {
  28416. s *Service
  28417. project string
  28418. snapshot string
  28419. urlParams_ gensupport.URLParams
  28420. ctx_ context.Context
  28421. }
  28422. // Delete: Deletes the specified Snapshot resource. Keep in mind that
  28423. // deleting a single snapshot might not necessarily delete all the data
  28424. // on that snapshot. If any data on the snapshot that is marked for
  28425. // deletion is needed for subsequent snapshots, the data will be moved
  28426. // to the next corresponding snapshot.
  28427. //
  28428. // For more information, see Deleting snaphots.
  28429. // For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/delete
  28430. func (r *SnapshotsService) Delete(project string, snapshot string) *SnapshotsDeleteCall {
  28431. c := &SnapshotsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28432. c.project = project
  28433. c.snapshot = snapshot
  28434. return c
  28435. }
  28436. // Fields allows partial responses to be retrieved. See
  28437. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28438. // for more information.
  28439. func (c *SnapshotsDeleteCall) Fields(s ...googleapi.Field) *SnapshotsDeleteCall {
  28440. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28441. return c
  28442. }
  28443. // Context sets the context to be used in this call's Do method. Any
  28444. // pending HTTP request will be aborted if the provided context is
  28445. // canceled.
  28446. func (c *SnapshotsDeleteCall) Context(ctx context.Context) *SnapshotsDeleteCall {
  28447. c.ctx_ = ctx
  28448. return c
  28449. }
  28450. func (c *SnapshotsDeleteCall) doRequest(alt string) (*http.Response, error) {
  28451. var body io.Reader = nil
  28452. c.urlParams_.Set("alt", alt)
  28453. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{snapshot}")
  28454. urls += "?" + c.urlParams_.Encode()
  28455. req, _ := http.NewRequest("DELETE", urls, body)
  28456. googleapi.Expand(req.URL, map[string]string{
  28457. "project": c.project,
  28458. "snapshot": c.snapshot,
  28459. })
  28460. req.Header.Set("User-Agent", c.s.userAgent())
  28461. if c.ctx_ != nil {
  28462. return ctxhttp.Do(c.ctx_, c.s.client, req)
  28463. }
  28464. return c.s.client.Do(req)
  28465. }
  28466. // Do executes the "compute.snapshots.delete" call.
  28467. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  28468. // status code is an error. Response headers are in either
  28469. // *Operation.ServerResponse.Header or (if a response was returned at
  28470. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  28471. // to check whether the returned error was because
  28472. // http.StatusNotModified was returned.
  28473. func (c *SnapshotsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  28474. gensupport.SetOptions(c.urlParams_, opts...)
  28475. res, err := c.doRequest("json")
  28476. if res != nil && res.StatusCode == http.StatusNotModified {
  28477. if res.Body != nil {
  28478. res.Body.Close()
  28479. }
  28480. return nil, &googleapi.Error{
  28481. Code: res.StatusCode,
  28482. Header: res.Header,
  28483. }
  28484. }
  28485. if err != nil {
  28486. return nil, err
  28487. }
  28488. defer googleapi.CloseBody(res)
  28489. if err := googleapi.CheckResponse(res); err != nil {
  28490. return nil, err
  28491. }
  28492. ret := &Operation{
  28493. ServerResponse: googleapi.ServerResponse{
  28494. Header: res.Header,
  28495. HTTPStatusCode: res.StatusCode,
  28496. },
  28497. }
  28498. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  28499. return nil, err
  28500. }
  28501. return ret, nil
  28502. // {
  28503. // "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.",
  28504. // "httpMethod": "DELETE",
  28505. // "id": "compute.snapshots.delete",
  28506. // "parameterOrder": [
  28507. // "project",
  28508. // "snapshot"
  28509. // ],
  28510. // "parameters": {
  28511. // "project": {
  28512. // "description": "Project ID for this request.",
  28513. // "location": "path",
  28514. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  28515. // "required": true,
  28516. // "type": "string"
  28517. // },
  28518. // "snapshot": {
  28519. // "description": "Name of the Snapshot resource to delete.",
  28520. // "location": "path",
  28521. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  28522. // "required": true,
  28523. // "type": "string"
  28524. // }
  28525. // },
  28526. // "path": "{project}/global/snapshots/{snapshot}",
  28527. // "response": {
  28528. // "$ref": "Operation"
  28529. // },
  28530. // "scopes": [
  28531. // "https://www.googleapis.com/auth/cloud-platform",
  28532. // "https://www.googleapis.com/auth/compute"
  28533. // ]
  28534. // }
  28535. }
  28536. // method id "compute.snapshots.get":
  28537. type SnapshotsGetCall struct {
  28538. s *Service
  28539. project string
  28540. snapshot string
  28541. urlParams_ gensupport.URLParams
  28542. ifNoneMatch_ string
  28543. ctx_ context.Context
  28544. }
  28545. // Get: Returns the specified Snapshot resource.
  28546. // For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/get
  28547. func (r *SnapshotsService) Get(project string, snapshot string) *SnapshotsGetCall {
  28548. c := &SnapshotsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28549. c.project = project
  28550. c.snapshot = snapshot
  28551. return c
  28552. }
  28553. // Fields allows partial responses to be retrieved. See
  28554. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28555. // for more information.
  28556. func (c *SnapshotsGetCall) Fields(s ...googleapi.Field) *SnapshotsGetCall {
  28557. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28558. return c
  28559. }
  28560. // IfNoneMatch sets the optional parameter which makes the operation
  28561. // fail if the object's ETag matches the given value. This is useful for
  28562. // getting updates only after the object has changed since the last
  28563. // request. Use googleapi.IsNotModified to check whether the response
  28564. // error from Do is the result of In-None-Match.
  28565. func (c *SnapshotsGetCall) IfNoneMatch(entityTag string) *SnapshotsGetCall {
  28566. c.ifNoneMatch_ = entityTag
  28567. return c
  28568. }
  28569. // Context sets the context to be used in this call's Do method. Any
  28570. // pending HTTP request will be aborted if the provided context is
  28571. // canceled.
  28572. func (c *SnapshotsGetCall) Context(ctx context.Context) *SnapshotsGetCall {
  28573. c.ctx_ = ctx
  28574. return c
  28575. }
  28576. func (c *SnapshotsGetCall) doRequest(alt string) (*http.Response, error) {
  28577. var body io.Reader = nil
  28578. c.urlParams_.Set("alt", alt)
  28579. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{snapshot}")
  28580. urls += "?" + c.urlParams_.Encode()
  28581. req, _ := http.NewRequest("GET", urls, body)
  28582. googleapi.Expand(req.URL, map[string]string{
  28583. "project": c.project,
  28584. "snapshot": c.snapshot,
  28585. })
  28586. req.Header.Set("User-Agent", c.s.userAgent())
  28587. if c.ifNoneMatch_ != "" {
  28588. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  28589. }
  28590. if c.ctx_ != nil {
  28591. return ctxhttp.Do(c.ctx_, c.s.client, req)
  28592. }
  28593. return c.s.client.Do(req)
  28594. }
  28595. // Do executes the "compute.snapshots.get" call.
  28596. // Exactly one of *Snapshot or error will be non-nil. Any non-2xx status
  28597. // code is an error. Response headers are in either
  28598. // *Snapshot.ServerResponse.Header or (if a response was returned at
  28599. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  28600. // to check whether the returned error was because
  28601. // http.StatusNotModified was returned.
  28602. func (c *SnapshotsGetCall) Do(opts ...googleapi.CallOption) (*Snapshot, error) {
  28603. gensupport.SetOptions(c.urlParams_, opts...)
  28604. res, err := c.doRequest("json")
  28605. if res != nil && res.StatusCode == http.StatusNotModified {
  28606. if res.Body != nil {
  28607. res.Body.Close()
  28608. }
  28609. return nil, &googleapi.Error{
  28610. Code: res.StatusCode,
  28611. Header: res.Header,
  28612. }
  28613. }
  28614. if err != nil {
  28615. return nil, err
  28616. }
  28617. defer googleapi.CloseBody(res)
  28618. if err := googleapi.CheckResponse(res); err != nil {
  28619. return nil, err
  28620. }
  28621. ret := &Snapshot{
  28622. ServerResponse: googleapi.ServerResponse{
  28623. Header: res.Header,
  28624. HTTPStatusCode: res.StatusCode,
  28625. },
  28626. }
  28627. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  28628. return nil, err
  28629. }
  28630. return ret, nil
  28631. // {
  28632. // "description": "Returns the specified Snapshot resource.",
  28633. // "httpMethod": "GET",
  28634. // "id": "compute.snapshots.get",
  28635. // "parameterOrder": [
  28636. // "project",
  28637. // "snapshot"
  28638. // ],
  28639. // "parameters": {
  28640. // "project": {
  28641. // "description": "Project ID for this request.",
  28642. // "location": "path",
  28643. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  28644. // "required": true,
  28645. // "type": "string"
  28646. // },
  28647. // "snapshot": {
  28648. // "description": "Name of the Snapshot resource to return.",
  28649. // "location": "path",
  28650. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  28651. // "required": true,
  28652. // "type": "string"
  28653. // }
  28654. // },
  28655. // "path": "{project}/global/snapshots/{snapshot}",
  28656. // "response": {
  28657. // "$ref": "Snapshot"
  28658. // },
  28659. // "scopes": [
  28660. // "https://www.googleapis.com/auth/cloud-platform",
  28661. // "https://www.googleapis.com/auth/compute",
  28662. // "https://www.googleapis.com/auth/compute.readonly"
  28663. // ]
  28664. // }
  28665. }
  28666. // method id "compute.snapshots.list":
  28667. type SnapshotsListCall struct {
  28668. s *Service
  28669. project string
  28670. urlParams_ gensupport.URLParams
  28671. ifNoneMatch_ string
  28672. ctx_ context.Context
  28673. }
  28674. // List: Retrieves the list of Snapshot resources contained within the
  28675. // specified project.
  28676. // For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/list
  28677. func (r *SnapshotsService) List(project string) *SnapshotsListCall {
  28678. c := &SnapshotsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28679. c.project = project
  28680. return c
  28681. }
  28682. // Filter sets the optional parameter "filter": Sets a filter expression
  28683. // for filtering listed resources, in the form filter={expression}. Your
  28684. // {expression} must be in the format: field_name comparison_string
  28685. // literal_string.
  28686. //
  28687. // The field_name is the name of the field you want to compare. Only
  28688. // atomic field types are supported (string, number, boolean). The
  28689. // comparison_string must be either eq (equals) or ne (not equals). The
  28690. // literal_string is the string value to filter to. The literal value
  28691. // must be valid for the type of field you are filtering by (string,
  28692. // number, boolean). For string fields, the literal value is interpreted
  28693. // as a regular expression using RE2 syntax. The literal value must
  28694. // match the entire field.
  28695. //
  28696. // For example, filter=name ne example-instance.
  28697. //
  28698. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  28699. // you can also filter on nested fields. For example, you could filter
  28700. // on instances that have set the scheduling.automaticRestart field to
  28701. // true. In particular, use filtering on nested fields to take advantage
  28702. // of instance labels to organize and filter results based on label
  28703. // values.
  28704. //
  28705. // The Beta API also supports filtering on multiple expressions by
  28706. // providing each separate expression within parentheses. For example,
  28707. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  28708. // Multiple expressions are treated as AND expressions meaning that
  28709. // resources must match all expressions to pass the filters.
  28710. func (c *SnapshotsListCall) Filter(filter string) *SnapshotsListCall {
  28711. c.urlParams_.Set("filter", filter)
  28712. return c
  28713. }
  28714. // MaxResults sets the optional parameter "maxResults": The maximum
  28715. // number of results per page that Compute Engine should return. If the
  28716. // number of available results is larger than maxResults, Compute Engine
  28717. // returns a nextPageToken that can be used to get the next page of
  28718. // results in subsequent list requests.
  28719. func (c *SnapshotsListCall) MaxResults(maxResults int64) *SnapshotsListCall {
  28720. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  28721. return c
  28722. }
  28723. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  28724. // a certain order. By default, results are returned in alphanumerical
  28725. // order based on the resource name.
  28726. //
  28727. // You can also sort results in descending order based on the creation
  28728. // timestamp using orderBy="creationTimestamp desc". This sorts results
  28729. // based on the creationTimestamp field in reverse chronological order
  28730. // (newest result first). Use this to sort resources like operations so
  28731. // that the newest operation is returned first.
  28732. //
  28733. // Currently, only sorting by name or creationTimestamp desc is
  28734. // supported.
  28735. func (c *SnapshotsListCall) OrderBy(orderBy string) *SnapshotsListCall {
  28736. c.urlParams_.Set("orderBy", orderBy)
  28737. return c
  28738. }
  28739. // PageToken sets the optional parameter "pageToken": Specifies a page
  28740. // token to use. Set pageToken to the nextPageToken returned by a
  28741. // previous list request to get the next page of results.
  28742. func (c *SnapshotsListCall) PageToken(pageToken string) *SnapshotsListCall {
  28743. c.urlParams_.Set("pageToken", pageToken)
  28744. return c
  28745. }
  28746. // Fields allows partial responses to be retrieved. See
  28747. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28748. // for more information.
  28749. func (c *SnapshotsListCall) Fields(s ...googleapi.Field) *SnapshotsListCall {
  28750. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28751. return c
  28752. }
  28753. // IfNoneMatch sets the optional parameter which makes the operation
  28754. // fail if the object's ETag matches the given value. This is useful for
  28755. // getting updates only after the object has changed since the last
  28756. // request. Use googleapi.IsNotModified to check whether the response
  28757. // error from Do is the result of In-None-Match.
  28758. func (c *SnapshotsListCall) IfNoneMatch(entityTag string) *SnapshotsListCall {
  28759. c.ifNoneMatch_ = entityTag
  28760. return c
  28761. }
  28762. // Context sets the context to be used in this call's Do method. Any
  28763. // pending HTTP request will be aborted if the provided context is
  28764. // canceled.
  28765. func (c *SnapshotsListCall) Context(ctx context.Context) *SnapshotsListCall {
  28766. c.ctx_ = ctx
  28767. return c
  28768. }
  28769. func (c *SnapshotsListCall) doRequest(alt string) (*http.Response, error) {
  28770. var body io.Reader = nil
  28771. c.urlParams_.Set("alt", alt)
  28772. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots")
  28773. urls += "?" + c.urlParams_.Encode()
  28774. req, _ := http.NewRequest("GET", urls, body)
  28775. googleapi.Expand(req.URL, map[string]string{
  28776. "project": c.project,
  28777. })
  28778. req.Header.Set("User-Agent", c.s.userAgent())
  28779. if c.ifNoneMatch_ != "" {
  28780. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  28781. }
  28782. if c.ctx_ != nil {
  28783. return ctxhttp.Do(c.ctx_, c.s.client, req)
  28784. }
  28785. return c.s.client.Do(req)
  28786. }
  28787. // Do executes the "compute.snapshots.list" call.
  28788. // Exactly one of *SnapshotList or error will be non-nil. Any non-2xx
  28789. // status code is an error. Response headers are in either
  28790. // *SnapshotList.ServerResponse.Header or (if a response was returned at
  28791. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  28792. // to check whether the returned error was because
  28793. // http.StatusNotModified was returned.
  28794. func (c *SnapshotsListCall) Do(opts ...googleapi.CallOption) (*SnapshotList, error) {
  28795. gensupport.SetOptions(c.urlParams_, opts...)
  28796. res, err := c.doRequest("json")
  28797. if res != nil && res.StatusCode == http.StatusNotModified {
  28798. if res.Body != nil {
  28799. res.Body.Close()
  28800. }
  28801. return nil, &googleapi.Error{
  28802. Code: res.StatusCode,
  28803. Header: res.Header,
  28804. }
  28805. }
  28806. if err != nil {
  28807. return nil, err
  28808. }
  28809. defer googleapi.CloseBody(res)
  28810. if err := googleapi.CheckResponse(res); err != nil {
  28811. return nil, err
  28812. }
  28813. ret := &SnapshotList{
  28814. ServerResponse: googleapi.ServerResponse{
  28815. Header: res.Header,
  28816. HTTPStatusCode: res.StatusCode,
  28817. },
  28818. }
  28819. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  28820. return nil, err
  28821. }
  28822. return ret, nil
  28823. // {
  28824. // "description": "Retrieves the list of Snapshot resources contained within the specified project.",
  28825. // "httpMethod": "GET",
  28826. // "id": "compute.snapshots.list",
  28827. // "parameterOrder": [
  28828. // "project"
  28829. // ],
  28830. // "parameters": {
  28831. // "filter": {
  28832. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  28833. // "location": "query",
  28834. // "type": "string"
  28835. // },
  28836. // "maxResults": {
  28837. // "default": "500",
  28838. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  28839. // "format": "uint32",
  28840. // "location": "query",
  28841. // "maximum": "500",
  28842. // "minimum": "0",
  28843. // "type": "integer"
  28844. // },
  28845. // "orderBy": {
  28846. // "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.",
  28847. // "location": "query",
  28848. // "type": "string"
  28849. // },
  28850. // "pageToken": {
  28851. // "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.",
  28852. // "location": "query",
  28853. // "type": "string"
  28854. // },
  28855. // "project": {
  28856. // "description": "Project ID for this request.",
  28857. // "location": "path",
  28858. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  28859. // "required": true,
  28860. // "type": "string"
  28861. // }
  28862. // },
  28863. // "path": "{project}/global/snapshots",
  28864. // "response": {
  28865. // "$ref": "SnapshotList"
  28866. // },
  28867. // "scopes": [
  28868. // "https://www.googleapis.com/auth/cloud-platform",
  28869. // "https://www.googleapis.com/auth/compute",
  28870. // "https://www.googleapis.com/auth/compute.readonly"
  28871. // ]
  28872. // }
  28873. }
  28874. // Pages invokes f for each page of results.
  28875. // A non-nil error returned from f will halt the iteration.
  28876. // The provided context supersedes any context provided to the Context method.
  28877. func (c *SnapshotsListCall) Pages(ctx context.Context, f func(*SnapshotList) error) error {
  28878. c.ctx_ = ctx
  28879. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  28880. for {
  28881. x, err := c.Do()
  28882. if err != nil {
  28883. return err
  28884. }
  28885. if err := f(x); err != nil {
  28886. return err
  28887. }
  28888. if x.NextPageToken == "" {
  28889. return nil
  28890. }
  28891. c.PageToken(x.NextPageToken)
  28892. }
  28893. }
  28894. // method id "compute.sslCertificates.delete":
  28895. type SslCertificatesDeleteCall struct {
  28896. s *Service
  28897. project string
  28898. sslCertificate string
  28899. urlParams_ gensupport.URLParams
  28900. ctx_ context.Context
  28901. }
  28902. // Delete: Deletes the specified SslCertificate resource.
  28903. func (r *SslCertificatesService) Delete(project string, sslCertificate string) *SslCertificatesDeleteCall {
  28904. c := &SslCertificatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28905. c.project = project
  28906. c.sslCertificate = sslCertificate
  28907. return c
  28908. }
  28909. // Fields allows partial responses to be retrieved. See
  28910. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28911. // for more information.
  28912. func (c *SslCertificatesDeleteCall) Fields(s ...googleapi.Field) *SslCertificatesDeleteCall {
  28913. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28914. return c
  28915. }
  28916. // Context sets the context to be used in this call's Do method. Any
  28917. // pending HTTP request will be aborted if the provided context is
  28918. // canceled.
  28919. func (c *SslCertificatesDeleteCall) Context(ctx context.Context) *SslCertificatesDeleteCall {
  28920. c.ctx_ = ctx
  28921. return c
  28922. }
  28923. func (c *SslCertificatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  28924. var body io.Reader = nil
  28925. c.urlParams_.Set("alt", alt)
  28926. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates/{sslCertificate}")
  28927. urls += "?" + c.urlParams_.Encode()
  28928. req, _ := http.NewRequest("DELETE", urls, body)
  28929. googleapi.Expand(req.URL, map[string]string{
  28930. "project": c.project,
  28931. "sslCertificate": c.sslCertificate,
  28932. })
  28933. req.Header.Set("User-Agent", c.s.userAgent())
  28934. if c.ctx_ != nil {
  28935. return ctxhttp.Do(c.ctx_, c.s.client, req)
  28936. }
  28937. return c.s.client.Do(req)
  28938. }
  28939. // Do executes the "compute.sslCertificates.delete" call.
  28940. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  28941. // status code is an error. Response headers are in either
  28942. // *Operation.ServerResponse.Header or (if a response was returned at
  28943. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  28944. // to check whether the returned error was because
  28945. // http.StatusNotModified was returned.
  28946. func (c *SslCertificatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  28947. gensupport.SetOptions(c.urlParams_, opts...)
  28948. res, err := c.doRequest("json")
  28949. if res != nil && res.StatusCode == http.StatusNotModified {
  28950. if res.Body != nil {
  28951. res.Body.Close()
  28952. }
  28953. return nil, &googleapi.Error{
  28954. Code: res.StatusCode,
  28955. Header: res.Header,
  28956. }
  28957. }
  28958. if err != nil {
  28959. return nil, err
  28960. }
  28961. defer googleapi.CloseBody(res)
  28962. if err := googleapi.CheckResponse(res); err != nil {
  28963. return nil, err
  28964. }
  28965. ret := &Operation{
  28966. ServerResponse: googleapi.ServerResponse{
  28967. Header: res.Header,
  28968. HTTPStatusCode: res.StatusCode,
  28969. },
  28970. }
  28971. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  28972. return nil, err
  28973. }
  28974. return ret, nil
  28975. // {
  28976. // "description": "Deletes the specified SslCertificate resource.",
  28977. // "httpMethod": "DELETE",
  28978. // "id": "compute.sslCertificates.delete",
  28979. // "parameterOrder": [
  28980. // "project",
  28981. // "sslCertificate"
  28982. // ],
  28983. // "parameters": {
  28984. // "project": {
  28985. // "description": "Project ID for this request.",
  28986. // "location": "path",
  28987. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  28988. // "required": true,
  28989. // "type": "string"
  28990. // },
  28991. // "sslCertificate": {
  28992. // "description": "Name of the SslCertificate resource to delete.",
  28993. // "location": "path",
  28994. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  28995. // "required": true,
  28996. // "type": "string"
  28997. // }
  28998. // },
  28999. // "path": "{project}/global/sslCertificates/{sslCertificate}",
  29000. // "response": {
  29001. // "$ref": "Operation"
  29002. // },
  29003. // "scopes": [
  29004. // "https://www.googleapis.com/auth/cloud-platform",
  29005. // "https://www.googleapis.com/auth/compute"
  29006. // ]
  29007. // }
  29008. }
  29009. // method id "compute.sslCertificates.get":
  29010. type SslCertificatesGetCall struct {
  29011. s *Service
  29012. project string
  29013. sslCertificate string
  29014. urlParams_ gensupport.URLParams
  29015. ifNoneMatch_ string
  29016. ctx_ context.Context
  29017. }
  29018. // Get: Returns the specified SslCertificate resource.
  29019. func (r *SslCertificatesService) Get(project string, sslCertificate string) *SslCertificatesGetCall {
  29020. c := &SslCertificatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29021. c.project = project
  29022. c.sslCertificate = sslCertificate
  29023. return c
  29024. }
  29025. // Fields allows partial responses to be retrieved. See
  29026. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29027. // for more information.
  29028. func (c *SslCertificatesGetCall) Fields(s ...googleapi.Field) *SslCertificatesGetCall {
  29029. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29030. return c
  29031. }
  29032. // IfNoneMatch sets the optional parameter which makes the operation
  29033. // fail if the object's ETag matches the given value. This is useful for
  29034. // getting updates only after the object has changed since the last
  29035. // request. Use googleapi.IsNotModified to check whether the response
  29036. // error from Do is the result of In-None-Match.
  29037. func (c *SslCertificatesGetCall) IfNoneMatch(entityTag string) *SslCertificatesGetCall {
  29038. c.ifNoneMatch_ = entityTag
  29039. return c
  29040. }
  29041. // Context sets the context to be used in this call's Do method. Any
  29042. // pending HTTP request will be aborted if the provided context is
  29043. // canceled.
  29044. func (c *SslCertificatesGetCall) Context(ctx context.Context) *SslCertificatesGetCall {
  29045. c.ctx_ = ctx
  29046. return c
  29047. }
  29048. func (c *SslCertificatesGetCall) doRequest(alt string) (*http.Response, error) {
  29049. var body io.Reader = nil
  29050. c.urlParams_.Set("alt", alt)
  29051. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates/{sslCertificate}")
  29052. urls += "?" + c.urlParams_.Encode()
  29053. req, _ := http.NewRequest("GET", urls, body)
  29054. googleapi.Expand(req.URL, map[string]string{
  29055. "project": c.project,
  29056. "sslCertificate": c.sslCertificate,
  29057. })
  29058. req.Header.Set("User-Agent", c.s.userAgent())
  29059. if c.ifNoneMatch_ != "" {
  29060. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  29061. }
  29062. if c.ctx_ != nil {
  29063. return ctxhttp.Do(c.ctx_, c.s.client, req)
  29064. }
  29065. return c.s.client.Do(req)
  29066. }
  29067. // Do executes the "compute.sslCertificates.get" call.
  29068. // Exactly one of *SslCertificate or error will be non-nil. Any non-2xx
  29069. // status code is an error. Response headers are in either
  29070. // *SslCertificate.ServerResponse.Header or (if a response was returned
  29071. // at all) in error.(*googleapi.Error).Header. Use
  29072. // googleapi.IsNotModified to check whether the returned error was
  29073. // because http.StatusNotModified was returned.
  29074. func (c *SslCertificatesGetCall) Do(opts ...googleapi.CallOption) (*SslCertificate, error) {
  29075. gensupport.SetOptions(c.urlParams_, opts...)
  29076. res, err := c.doRequest("json")
  29077. if res != nil && res.StatusCode == http.StatusNotModified {
  29078. if res.Body != nil {
  29079. res.Body.Close()
  29080. }
  29081. return nil, &googleapi.Error{
  29082. Code: res.StatusCode,
  29083. Header: res.Header,
  29084. }
  29085. }
  29086. if err != nil {
  29087. return nil, err
  29088. }
  29089. defer googleapi.CloseBody(res)
  29090. if err := googleapi.CheckResponse(res); err != nil {
  29091. return nil, err
  29092. }
  29093. ret := &SslCertificate{
  29094. ServerResponse: googleapi.ServerResponse{
  29095. Header: res.Header,
  29096. HTTPStatusCode: res.StatusCode,
  29097. },
  29098. }
  29099. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  29100. return nil, err
  29101. }
  29102. return ret, nil
  29103. // {
  29104. // "description": "Returns the specified SslCertificate resource.",
  29105. // "httpMethod": "GET",
  29106. // "id": "compute.sslCertificates.get",
  29107. // "parameterOrder": [
  29108. // "project",
  29109. // "sslCertificate"
  29110. // ],
  29111. // "parameters": {
  29112. // "project": {
  29113. // "description": "Project ID for this request.",
  29114. // "location": "path",
  29115. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  29116. // "required": true,
  29117. // "type": "string"
  29118. // },
  29119. // "sslCertificate": {
  29120. // "description": "Name of the SslCertificate resource to return.",
  29121. // "location": "path",
  29122. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  29123. // "required": true,
  29124. // "type": "string"
  29125. // }
  29126. // },
  29127. // "path": "{project}/global/sslCertificates/{sslCertificate}",
  29128. // "response": {
  29129. // "$ref": "SslCertificate"
  29130. // },
  29131. // "scopes": [
  29132. // "https://www.googleapis.com/auth/cloud-platform",
  29133. // "https://www.googleapis.com/auth/compute",
  29134. // "https://www.googleapis.com/auth/compute.readonly"
  29135. // ]
  29136. // }
  29137. }
  29138. // method id "compute.sslCertificates.insert":
  29139. type SslCertificatesInsertCall struct {
  29140. s *Service
  29141. project string
  29142. sslcertificate *SslCertificate
  29143. urlParams_ gensupport.URLParams
  29144. ctx_ context.Context
  29145. }
  29146. // Insert: Creates a SslCertificate resource in the specified project
  29147. // using the data included in the request.
  29148. func (r *SslCertificatesService) Insert(project string, sslcertificate *SslCertificate) *SslCertificatesInsertCall {
  29149. c := &SslCertificatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29150. c.project = project
  29151. c.sslcertificate = sslcertificate
  29152. return c
  29153. }
  29154. // Fields allows partial responses to be retrieved. See
  29155. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29156. // for more information.
  29157. func (c *SslCertificatesInsertCall) Fields(s ...googleapi.Field) *SslCertificatesInsertCall {
  29158. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29159. return c
  29160. }
  29161. // Context sets the context to be used in this call's Do method. Any
  29162. // pending HTTP request will be aborted if the provided context is
  29163. // canceled.
  29164. func (c *SslCertificatesInsertCall) Context(ctx context.Context) *SslCertificatesInsertCall {
  29165. c.ctx_ = ctx
  29166. return c
  29167. }
  29168. func (c *SslCertificatesInsertCall) doRequest(alt string) (*http.Response, error) {
  29169. var body io.Reader = nil
  29170. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertificate)
  29171. if err != nil {
  29172. return nil, err
  29173. }
  29174. ctype := "application/json"
  29175. c.urlParams_.Set("alt", alt)
  29176. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates")
  29177. urls += "?" + c.urlParams_.Encode()
  29178. req, _ := http.NewRequest("POST", urls, body)
  29179. googleapi.Expand(req.URL, map[string]string{
  29180. "project": c.project,
  29181. })
  29182. req.Header.Set("Content-Type", ctype)
  29183. req.Header.Set("User-Agent", c.s.userAgent())
  29184. if c.ctx_ != nil {
  29185. return ctxhttp.Do(c.ctx_, c.s.client, req)
  29186. }
  29187. return c.s.client.Do(req)
  29188. }
  29189. // Do executes the "compute.sslCertificates.insert" call.
  29190. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  29191. // status code is an error. Response headers are in either
  29192. // *Operation.ServerResponse.Header or (if a response was returned at
  29193. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  29194. // to check whether the returned error was because
  29195. // http.StatusNotModified was returned.
  29196. func (c *SslCertificatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  29197. gensupport.SetOptions(c.urlParams_, opts...)
  29198. res, err := c.doRequest("json")
  29199. if res != nil && res.StatusCode == http.StatusNotModified {
  29200. if res.Body != nil {
  29201. res.Body.Close()
  29202. }
  29203. return nil, &googleapi.Error{
  29204. Code: res.StatusCode,
  29205. Header: res.Header,
  29206. }
  29207. }
  29208. if err != nil {
  29209. return nil, err
  29210. }
  29211. defer googleapi.CloseBody(res)
  29212. if err := googleapi.CheckResponse(res); err != nil {
  29213. return nil, err
  29214. }
  29215. ret := &Operation{
  29216. ServerResponse: googleapi.ServerResponse{
  29217. Header: res.Header,
  29218. HTTPStatusCode: res.StatusCode,
  29219. },
  29220. }
  29221. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  29222. return nil, err
  29223. }
  29224. return ret, nil
  29225. // {
  29226. // "description": "Creates a SslCertificate resource in the specified project using the data included in the request.",
  29227. // "httpMethod": "POST",
  29228. // "id": "compute.sslCertificates.insert",
  29229. // "parameterOrder": [
  29230. // "project"
  29231. // ],
  29232. // "parameters": {
  29233. // "project": {
  29234. // "description": "Project ID for this request.",
  29235. // "location": "path",
  29236. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  29237. // "required": true,
  29238. // "type": "string"
  29239. // }
  29240. // },
  29241. // "path": "{project}/global/sslCertificates",
  29242. // "request": {
  29243. // "$ref": "SslCertificate"
  29244. // },
  29245. // "response": {
  29246. // "$ref": "Operation"
  29247. // },
  29248. // "scopes": [
  29249. // "https://www.googleapis.com/auth/cloud-platform",
  29250. // "https://www.googleapis.com/auth/compute"
  29251. // ]
  29252. // }
  29253. }
  29254. // method id "compute.sslCertificates.list":
  29255. type SslCertificatesListCall struct {
  29256. s *Service
  29257. project string
  29258. urlParams_ gensupport.URLParams
  29259. ifNoneMatch_ string
  29260. ctx_ context.Context
  29261. }
  29262. // List: Retrieves the list of SslCertificate resources available to the
  29263. // specified project.
  29264. func (r *SslCertificatesService) List(project string) *SslCertificatesListCall {
  29265. c := &SslCertificatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29266. c.project = project
  29267. return c
  29268. }
  29269. // Filter sets the optional parameter "filter": Sets a filter expression
  29270. // for filtering listed resources, in the form filter={expression}. Your
  29271. // {expression} must be in the format: field_name comparison_string
  29272. // literal_string.
  29273. //
  29274. // The field_name is the name of the field you want to compare. Only
  29275. // atomic field types are supported (string, number, boolean). The
  29276. // comparison_string must be either eq (equals) or ne (not equals). The
  29277. // literal_string is the string value to filter to. The literal value
  29278. // must be valid for the type of field you are filtering by (string,
  29279. // number, boolean). For string fields, the literal value is interpreted
  29280. // as a regular expression using RE2 syntax. The literal value must
  29281. // match the entire field.
  29282. //
  29283. // For example, filter=name ne example-instance.
  29284. //
  29285. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  29286. // you can also filter on nested fields. For example, you could filter
  29287. // on instances that have set the scheduling.automaticRestart field to
  29288. // true. In particular, use filtering on nested fields to take advantage
  29289. // of instance labels to organize and filter results based on label
  29290. // values.
  29291. //
  29292. // The Beta API also supports filtering on multiple expressions by
  29293. // providing each separate expression within parentheses. For example,
  29294. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  29295. // Multiple expressions are treated as AND expressions meaning that
  29296. // resources must match all expressions to pass the filters.
  29297. func (c *SslCertificatesListCall) Filter(filter string) *SslCertificatesListCall {
  29298. c.urlParams_.Set("filter", filter)
  29299. return c
  29300. }
  29301. // MaxResults sets the optional parameter "maxResults": The maximum
  29302. // number of results per page that Compute Engine should return. If the
  29303. // number of available results is larger than maxResults, Compute Engine
  29304. // returns a nextPageToken that can be used to get the next page of
  29305. // results in subsequent list requests.
  29306. func (c *SslCertificatesListCall) MaxResults(maxResults int64) *SslCertificatesListCall {
  29307. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  29308. return c
  29309. }
  29310. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  29311. // a certain order. By default, results are returned in alphanumerical
  29312. // order based on the resource name.
  29313. //
  29314. // You can also sort results in descending order based on the creation
  29315. // timestamp using orderBy="creationTimestamp desc". This sorts results
  29316. // based on the creationTimestamp field in reverse chronological order
  29317. // (newest result first). Use this to sort resources like operations so
  29318. // that the newest operation is returned first.
  29319. //
  29320. // Currently, only sorting by name or creationTimestamp desc is
  29321. // supported.
  29322. func (c *SslCertificatesListCall) OrderBy(orderBy string) *SslCertificatesListCall {
  29323. c.urlParams_.Set("orderBy", orderBy)
  29324. return c
  29325. }
  29326. // PageToken sets the optional parameter "pageToken": Specifies a page
  29327. // token to use. Set pageToken to the nextPageToken returned by a
  29328. // previous list request to get the next page of results.
  29329. func (c *SslCertificatesListCall) PageToken(pageToken string) *SslCertificatesListCall {
  29330. c.urlParams_.Set("pageToken", pageToken)
  29331. return c
  29332. }
  29333. // Fields allows partial responses to be retrieved. See
  29334. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29335. // for more information.
  29336. func (c *SslCertificatesListCall) Fields(s ...googleapi.Field) *SslCertificatesListCall {
  29337. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29338. return c
  29339. }
  29340. // IfNoneMatch sets the optional parameter which makes the operation
  29341. // fail if the object's ETag matches the given value. This is useful for
  29342. // getting updates only after the object has changed since the last
  29343. // request. Use googleapi.IsNotModified to check whether the response
  29344. // error from Do is the result of In-None-Match.
  29345. func (c *SslCertificatesListCall) IfNoneMatch(entityTag string) *SslCertificatesListCall {
  29346. c.ifNoneMatch_ = entityTag
  29347. return c
  29348. }
  29349. // Context sets the context to be used in this call's Do method. Any
  29350. // pending HTTP request will be aborted if the provided context is
  29351. // canceled.
  29352. func (c *SslCertificatesListCall) Context(ctx context.Context) *SslCertificatesListCall {
  29353. c.ctx_ = ctx
  29354. return c
  29355. }
  29356. func (c *SslCertificatesListCall) doRequest(alt string) (*http.Response, error) {
  29357. var body io.Reader = nil
  29358. c.urlParams_.Set("alt", alt)
  29359. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates")
  29360. urls += "?" + c.urlParams_.Encode()
  29361. req, _ := http.NewRequest("GET", urls, body)
  29362. googleapi.Expand(req.URL, map[string]string{
  29363. "project": c.project,
  29364. })
  29365. req.Header.Set("User-Agent", c.s.userAgent())
  29366. if c.ifNoneMatch_ != "" {
  29367. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  29368. }
  29369. if c.ctx_ != nil {
  29370. return ctxhttp.Do(c.ctx_, c.s.client, req)
  29371. }
  29372. return c.s.client.Do(req)
  29373. }
  29374. // Do executes the "compute.sslCertificates.list" call.
  29375. // Exactly one of *SslCertificateList or error will be non-nil. Any
  29376. // non-2xx status code is an error. Response headers are in either
  29377. // *SslCertificateList.ServerResponse.Header or (if a response was
  29378. // returned at all) in error.(*googleapi.Error).Header. Use
  29379. // googleapi.IsNotModified to check whether the returned error was
  29380. // because http.StatusNotModified was returned.
  29381. func (c *SslCertificatesListCall) Do(opts ...googleapi.CallOption) (*SslCertificateList, error) {
  29382. gensupport.SetOptions(c.urlParams_, opts...)
  29383. res, err := c.doRequest("json")
  29384. if res != nil && res.StatusCode == http.StatusNotModified {
  29385. if res.Body != nil {
  29386. res.Body.Close()
  29387. }
  29388. return nil, &googleapi.Error{
  29389. Code: res.StatusCode,
  29390. Header: res.Header,
  29391. }
  29392. }
  29393. if err != nil {
  29394. return nil, err
  29395. }
  29396. defer googleapi.CloseBody(res)
  29397. if err := googleapi.CheckResponse(res); err != nil {
  29398. return nil, err
  29399. }
  29400. ret := &SslCertificateList{
  29401. ServerResponse: googleapi.ServerResponse{
  29402. Header: res.Header,
  29403. HTTPStatusCode: res.StatusCode,
  29404. },
  29405. }
  29406. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  29407. return nil, err
  29408. }
  29409. return ret, nil
  29410. // {
  29411. // "description": "Retrieves the list of SslCertificate resources available to the specified project.",
  29412. // "httpMethod": "GET",
  29413. // "id": "compute.sslCertificates.list",
  29414. // "parameterOrder": [
  29415. // "project"
  29416. // ],
  29417. // "parameters": {
  29418. // "filter": {
  29419. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  29420. // "location": "query",
  29421. // "type": "string"
  29422. // },
  29423. // "maxResults": {
  29424. // "default": "500",
  29425. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  29426. // "format": "uint32",
  29427. // "location": "query",
  29428. // "maximum": "500",
  29429. // "minimum": "0",
  29430. // "type": "integer"
  29431. // },
  29432. // "orderBy": {
  29433. // "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.",
  29434. // "location": "query",
  29435. // "type": "string"
  29436. // },
  29437. // "pageToken": {
  29438. // "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.",
  29439. // "location": "query",
  29440. // "type": "string"
  29441. // },
  29442. // "project": {
  29443. // "description": "Project ID for this request.",
  29444. // "location": "path",
  29445. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  29446. // "required": true,
  29447. // "type": "string"
  29448. // }
  29449. // },
  29450. // "path": "{project}/global/sslCertificates",
  29451. // "response": {
  29452. // "$ref": "SslCertificateList"
  29453. // },
  29454. // "scopes": [
  29455. // "https://www.googleapis.com/auth/cloud-platform",
  29456. // "https://www.googleapis.com/auth/compute",
  29457. // "https://www.googleapis.com/auth/compute.readonly"
  29458. // ]
  29459. // }
  29460. }
  29461. // Pages invokes f for each page of results.
  29462. // A non-nil error returned from f will halt the iteration.
  29463. // The provided context supersedes any context provided to the Context method.
  29464. func (c *SslCertificatesListCall) Pages(ctx context.Context, f func(*SslCertificateList) error) error {
  29465. c.ctx_ = ctx
  29466. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  29467. for {
  29468. x, err := c.Do()
  29469. if err != nil {
  29470. return err
  29471. }
  29472. if err := f(x); err != nil {
  29473. return err
  29474. }
  29475. if x.NextPageToken == "" {
  29476. return nil
  29477. }
  29478. c.PageToken(x.NextPageToken)
  29479. }
  29480. }
  29481. // method id "compute.subnetworks.aggregatedList":
  29482. type SubnetworksAggregatedListCall struct {
  29483. s *Service
  29484. project string
  29485. urlParams_ gensupport.URLParams
  29486. ifNoneMatch_ string
  29487. ctx_ context.Context
  29488. }
  29489. // AggregatedList: Retrieves an aggregated list of subnetworks.
  29490. func (r *SubnetworksService) AggregatedList(project string) *SubnetworksAggregatedListCall {
  29491. c := &SubnetworksAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29492. c.project = project
  29493. return c
  29494. }
  29495. // Filter sets the optional parameter "filter": Sets a filter expression
  29496. // for filtering listed resources, in the form filter={expression}. Your
  29497. // {expression} must be in the format: field_name comparison_string
  29498. // literal_string.
  29499. //
  29500. // The field_name is the name of the field you want to compare. Only
  29501. // atomic field types are supported (string, number, boolean). The
  29502. // comparison_string must be either eq (equals) or ne (not equals). The
  29503. // literal_string is the string value to filter to. The literal value
  29504. // must be valid for the type of field you are filtering by (string,
  29505. // number, boolean). For string fields, the literal value is interpreted
  29506. // as a regular expression using RE2 syntax. The literal value must
  29507. // match the entire field.
  29508. //
  29509. // For example, filter=name ne example-instance.
  29510. //
  29511. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  29512. // you can also filter on nested fields. For example, you could filter
  29513. // on instances that have set the scheduling.automaticRestart field to
  29514. // true. In particular, use filtering on nested fields to take advantage
  29515. // of instance labels to organize and filter results based on label
  29516. // values.
  29517. //
  29518. // The Beta API also supports filtering on multiple expressions by
  29519. // providing each separate expression within parentheses. For example,
  29520. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  29521. // Multiple expressions are treated as AND expressions meaning that
  29522. // resources must match all expressions to pass the filters.
  29523. func (c *SubnetworksAggregatedListCall) Filter(filter string) *SubnetworksAggregatedListCall {
  29524. c.urlParams_.Set("filter", filter)
  29525. return c
  29526. }
  29527. // MaxResults sets the optional parameter "maxResults": The maximum
  29528. // number of results per page that Compute Engine should return. If the
  29529. // number of available results is larger than maxResults, Compute Engine
  29530. // returns a nextPageToken that can be used to get the next page of
  29531. // results in subsequent list requests.
  29532. func (c *SubnetworksAggregatedListCall) MaxResults(maxResults int64) *SubnetworksAggregatedListCall {
  29533. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  29534. return c
  29535. }
  29536. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  29537. // a certain order. By default, results are returned in alphanumerical
  29538. // order based on the resource name.
  29539. //
  29540. // You can also sort results in descending order based on the creation
  29541. // timestamp using orderBy="creationTimestamp desc". This sorts results
  29542. // based on the creationTimestamp field in reverse chronological order
  29543. // (newest result first). Use this to sort resources like operations so
  29544. // that the newest operation is returned first.
  29545. //
  29546. // Currently, only sorting by name or creationTimestamp desc is
  29547. // supported.
  29548. func (c *SubnetworksAggregatedListCall) OrderBy(orderBy string) *SubnetworksAggregatedListCall {
  29549. c.urlParams_.Set("orderBy", orderBy)
  29550. return c
  29551. }
  29552. // PageToken sets the optional parameter "pageToken": Specifies a page
  29553. // token to use. Set pageToken to the nextPageToken returned by a
  29554. // previous list request to get the next page of results.
  29555. func (c *SubnetworksAggregatedListCall) PageToken(pageToken string) *SubnetworksAggregatedListCall {
  29556. c.urlParams_.Set("pageToken", pageToken)
  29557. return c
  29558. }
  29559. // Fields allows partial responses to be retrieved. See
  29560. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29561. // for more information.
  29562. func (c *SubnetworksAggregatedListCall) Fields(s ...googleapi.Field) *SubnetworksAggregatedListCall {
  29563. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29564. return c
  29565. }
  29566. // IfNoneMatch sets the optional parameter which makes the operation
  29567. // fail if the object's ETag matches the given value. This is useful for
  29568. // getting updates only after the object has changed since the last
  29569. // request. Use googleapi.IsNotModified to check whether the response
  29570. // error from Do is the result of In-None-Match.
  29571. func (c *SubnetworksAggregatedListCall) IfNoneMatch(entityTag string) *SubnetworksAggregatedListCall {
  29572. c.ifNoneMatch_ = entityTag
  29573. return c
  29574. }
  29575. // Context sets the context to be used in this call's Do method. Any
  29576. // pending HTTP request will be aborted if the provided context is
  29577. // canceled.
  29578. func (c *SubnetworksAggregatedListCall) Context(ctx context.Context) *SubnetworksAggregatedListCall {
  29579. c.ctx_ = ctx
  29580. return c
  29581. }
  29582. func (c *SubnetworksAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  29583. var body io.Reader = nil
  29584. c.urlParams_.Set("alt", alt)
  29585. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/subnetworks")
  29586. urls += "?" + c.urlParams_.Encode()
  29587. req, _ := http.NewRequest("GET", urls, body)
  29588. googleapi.Expand(req.URL, map[string]string{
  29589. "project": c.project,
  29590. })
  29591. req.Header.Set("User-Agent", c.s.userAgent())
  29592. if c.ifNoneMatch_ != "" {
  29593. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  29594. }
  29595. if c.ctx_ != nil {
  29596. return ctxhttp.Do(c.ctx_, c.s.client, req)
  29597. }
  29598. return c.s.client.Do(req)
  29599. }
  29600. // Do executes the "compute.subnetworks.aggregatedList" call.
  29601. // Exactly one of *SubnetworkAggregatedList or error will be non-nil.
  29602. // Any non-2xx status code is an error. Response headers are in either
  29603. // *SubnetworkAggregatedList.ServerResponse.Header or (if a response was
  29604. // returned at all) in error.(*googleapi.Error).Header. Use
  29605. // googleapi.IsNotModified to check whether the returned error was
  29606. // because http.StatusNotModified was returned.
  29607. func (c *SubnetworksAggregatedListCall) Do(opts ...googleapi.CallOption) (*SubnetworkAggregatedList, error) {
  29608. gensupport.SetOptions(c.urlParams_, opts...)
  29609. res, err := c.doRequest("json")
  29610. if res != nil && res.StatusCode == http.StatusNotModified {
  29611. if res.Body != nil {
  29612. res.Body.Close()
  29613. }
  29614. return nil, &googleapi.Error{
  29615. Code: res.StatusCode,
  29616. Header: res.Header,
  29617. }
  29618. }
  29619. if err != nil {
  29620. return nil, err
  29621. }
  29622. defer googleapi.CloseBody(res)
  29623. if err := googleapi.CheckResponse(res); err != nil {
  29624. return nil, err
  29625. }
  29626. ret := &SubnetworkAggregatedList{
  29627. ServerResponse: googleapi.ServerResponse{
  29628. Header: res.Header,
  29629. HTTPStatusCode: res.StatusCode,
  29630. },
  29631. }
  29632. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  29633. return nil, err
  29634. }
  29635. return ret, nil
  29636. // {
  29637. // "description": "Retrieves an aggregated list of subnetworks.",
  29638. // "httpMethod": "GET",
  29639. // "id": "compute.subnetworks.aggregatedList",
  29640. // "parameterOrder": [
  29641. // "project"
  29642. // ],
  29643. // "parameters": {
  29644. // "filter": {
  29645. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  29646. // "location": "query",
  29647. // "type": "string"
  29648. // },
  29649. // "maxResults": {
  29650. // "default": "500",
  29651. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  29652. // "format": "uint32",
  29653. // "location": "query",
  29654. // "maximum": "500",
  29655. // "minimum": "0",
  29656. // "type": "integer"
  29657. // },
  29658. // "orderBy": {
  29659. // "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.",
  29660. // "location": "query",
  29661. // "type": "string"
  29662. // },
  29663. // "pageToken": {
  29664. // "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.",
  29665. // "location": "query",
  29666. // "type": "string"
  29667. // },
  29668. // "project": {
  29669. // "description": "Project ID for this request.",
  29670. // "location": "path",
  29671. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  29672. // "required": true,
  29673. // "type": "string"
  29674. // }
  29675. // },
  29676. // "path": "{project}/aggregated/subnetworks",
  29677. // "response": {
  29678. // "$ref": "SubnetworkAggregatedList"
  29679. // },
  29680. // "scopes": [
  29681. // "https://www.googleapis.com/auth/cloud-platform",
  29682. // "https://www.googleapis.com/auth/compute",
  29683. // "https://www.googleapis.com/auth/compute.readonly"
  29684. // ]
  29685. // }
  29686. }
  29687. // Pages invokes f for each page of results.
  29688. // A non-nil error returned from f will halt the iteration.
  29689. // The provided context supersedes any context provided to the Context method.
  29690. func (c *SubnetworksAggregatedListCall) Pages(ctx context.Context, f func(*SubnetworkAggregatedList) error) error {
  29691. c.ctx_ = ctx
  29692. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  29693. for {
  29694. x, err := c.Do()
  29695. if err != nil {
  29696. return err
  29697. }
  29698. if err := f(x); err != nil {
  29699. return err
  29700. }
  29701. if x.NextPageToken == "" {
  29702. return nil
  29703. }
  29704. c.PageToken(x.NextPageToken)
  29705. }
  29706. }
  29707. // method id "compute.subnetworks.delete":
  29708. type SubnetworksDeleteCall struct {
  29709. s *Service
  29710. project string
  29711. region string
  29712. subnetwork string
  29713. urlParams_ gensupport.URLParams
  29714. ctx_ context.Context
  29715. }
  29716. // Delete: Deletes the specified subnetwork.
  29717. func (r *SubnetworksService) Delete(project string, region string, subnetwork string) *SubnetworksDeleteCall {
  29718. c := &SubnetworksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29719. c.project = project
  29720. c.region = region
  29721. c.subnetwork = subnetwork
  29722. return c
  29723. }
  29724. // Fields allows partial responses to be retrieved. See
  29725. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29726. // for more information.
  29727. func (c *SubnetworksDeleteCall) Fields(s ...googleapi.Field) *SubnetworksDeleteCall {
  29728. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29729. return c
  29730. }
  29731. // Context sets the context to be used in this call's Do method. Any
  29732. // pending HTTP request will be aborted if the provided context is
  29733. // canceled.
  29734. func (c *SubnetworksDeleteCall) Context(ctx context.Context) *SubnetworksDeleteCall {
  29735. c.ctx_ = ctx
  29736. return c
  29737. }
  29738. func (c *SubnetworksDeleteCall) doRequest(alt string) (*http.Response, error) {
  29739. var body io.Reader = nil
  29740. c.urlParams_.Set("alt", alt)
  29741. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}")
  29742. urls += "?" + c.urlParams_.Encode()
  29743. req, _ := http.NewRequest("DELETE", urls, body)
  29744. googleapi.Expand(req.URL, map[string]string{
  29745. "project": c.project,
  29746. "region": c.region,
  29747. "subnetwork": c.subnetwork,
  29748. })
  29749. req.Header.Set("User-Agent", c.s.userAgent())
  29750. if c.ctx_ != nil {
  29751. return ctxhttp.Do(c.ctx_, c.s.client, req)
  29752. }
  29753. return c.s.client.Do(req)
  29754. }
  29755. // Do executes the "compute.subnetworks.delete" call.
  29756. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  29757. // status code is an error. Response headers are in either
  29758. // *Operation.ServerResponse.Header or (if a response was returned at
  29759. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  29760. // to check whether the returned error was because
  29761. // http.StatusNotModified was returned.
  29762. func (c *SubnetworksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  29763. gensupport.SetOptions(c.urlParams_, opts...)
  29764. res, err := c.doRequest("json")
  29765. if res != nil && res.StatusCode == http.StatusNotModified {
  29766. if res.Body != nil {
  29767. res.Body.Close()
  29768. }
  29769. return nil, &googleapi.Error{
  29770. Code: res.StatusCode,
  29771. Header: res.Header,
  29772. }
  29773. }
  29774. if err != nil {
  29775. return nil, err
  29776. }
  29777. defer googleapi.CloseBody(res)
  29778. if err := googleapi.CheckResponse(res); err != nil {
  29779. return nil, err
  29780. }
  29781. ret := &Operation{
  29782. ServerResponse: googleapi.ServerResponse{
  29783. Header: res.Header,
  29784. HTTPStatusCode: res.StatusCode,
  29785. },
  29786. }
  29787. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  29788. return nil, err
  29789. }
  29790. return ret, nil
  29791. // {
  29792. // "description": "Deletes the specified subnetwork.",
  29793. // "httpMethod": "DELETE",
  29794. // "id": "compute.subnetworks.delete",
  29795. // "parameterOrder": [
  29796. // "project",
  29797. // "region",
  29798. // "subnetwork"
  29799. // ],
  29800. // "parameters": {
  29801. // "project": {
  29802. // "description": "Project ID for this request.",
  29803. // "location": "path",
  29804. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  29805. // "required": true,
  29806. // "type": "string"
  29807. // },
  29808. // "region": {
  29809. // "description": "Name of the region scoping this request.",
  29810. // "location": "path",
  29811. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  29812. // "required": true,
  29813. // "type": "string"
  29814. // },
  29815. // "subnetwork": {
  29816. // "description": "Name of the Subnetwork resource to delete.",
  29817. // "location": "path",
  29818. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  29819. // "required": true,
  29820. // "type": "string"
  29821. // }
  29822. // },
  29823. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}",
  29824. // "response": {
  29825. // "$ref": "Operation"
  29826. // },
  29827. // "scopes": [
  29828. // "https://www.googleapis.com/auth/cloud-platform",
  29829. // "https://www.googleapis.com/auth/compute"
  29830. // ]
  29831. // }
  29832. }
  29833. // method id "compute.subnetworks.get":
  29834. type SubnetworksGetCall struct {
  29835. s *Service
  29836. project string
  29837. region string
  29838. subnetwork string
  29839. urlParams_ gensupport.URLParams
  29840. ifNoneMatch_ string
  29841. ctx_ context.Context
  29842. }
  29843. // Get: Returns the specified subnetwork.
  29844. func (r *SubnetworksService) Get(project string, region string, subnetwork string) *SubnetworksGetCall {
  29845. c := &SubnetworksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29846. c.project = project
  29847. c.region = region
  29848. c.subnetwork = subnetwork
  29849. return c
  29850. }
  29851. // Fields allows partial responses to be retrieved. See
  29852. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29853. // for more information.
  29854. func (c *SubnetworksGetCall) Fields(s ...googleapi.Field) *SubnetworksGetCall {
  29855. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29856. return c
  29857. }
  29858. // IfNoneMatch sets the optional parameter which makes the operation
  29859. // fail if the object's ETag matches the given value. This is useful for
  29860. // getting updates only after the object has changed since the last
  29861. // request. Use googleapi.IsNotModified to check whether the response
  29862. // error from Do is the result of In-None-Match.
  29863. func (c *SubnetworksGetCall) IfNoneMatch(entityTag string) *SubnetworksGetCall {
  29864. c.ifNoneMatch_ = entityTag
  29865. return c
  29866. }
  29867. // Context sets the context to be used in this call's Do method. Any
  29868. // pending HTTP request will be aborted if the provided context is
  29869. // canceled.
  29870. func (c *SubnetworksGetCall) Context(ctx context.Context) *SubnetworksGetCall {
  29871. c.ctx_ = ctx
  29872. return c
  29873. }
  29874. func (c *SubnetworksGetCall) doRequest(alt string) (*http.Response, error) {
  29875. var body io.Reader = nil
  29876. c.urlParams_.Set("alt", alt)
  29877. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}")
  29878. urls += "?" + c.urlParams_.Encode()
  29879. req, _ := http.NewRequest("GET", urls, body)
  29880. googleapi.Expand(req.URL, map[string]string{
  29881. "project": c.project,
  29882. "region": c.region,
  29883. "subnetwork": c.subnetwork,
  29884. })
  29885. req.Header.Set("User-Agent", c.s.userAgent())
  29886. if c.ifNoneMatch_ != "" {
  29887. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  29888. }
  29889. if c.ctx_ != nil {
  29890. return ctxhttp.Do(c.ctx_, c.s.client, req)
  29891. }
  29892. return c.s.client.Do(req)
  29893. }
  29894. // Do executes the "compute.subnetworks.get" call.
  29895. // Exactly one of *Subnetwork or error will be non-nil. Any non-2xx
  29896. // status code is an error. Response headers are in either
  29897. // *Subnetwork.ServerResponse.Header or (if a response was returned at
  29898. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  29899. // to check whether the returned error was because
  29900. // http.StatusNotModified was returned.
  29901. func (c *SubnetworksGetCall) Do(opts ...googleapi.CallOption) (*Subnetwork, error) {
  29902. gensupport.SetOptions(c.urlParams_, opts...)
  29903. res, err := c.doRequest("json")
  29904. if res != nil && res.StatusCode == http.StatusNotModified {
  29905. if res.Body != nil {
  29906. res.Body.Close()
  29907. }
  29908. return nil, &googleapi.Error{
  29909. Code: res.StatusCode,
  29910. Header: res.Header,
  29911. }
  29912. }
  29913. if err != nil {
  29914. return nil, err
  29915. }
  29916. defer googleapi.CloseBody(res)
  29917. if err := googleapi.CheckResponse(res); err != nil {
  29918. return nil, err
  29919. }
  29920. ret := &Subnetwork{
  29921. ServerResponse: googleapi.ServerResponse{
  29922. Header: res.Header,
  29923. HTTPStatusCode: res.StatusCode,
  29924. },
  29925. }
  29926. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  29927. return nil, err
  29928. }
  29929. return ret, nil
  29930. // {
  29931. // "description": "Returns the specified subnetwork.",
  29932. // "httpMethod": "GET",
  29933. // "id": "compute.subnetworks.get",
  29934. // "parameterOrder": [
  29935. // "project",
  29936. // "region",
  29937. // "subnetwork"
  29938. // ],
  29939. // "parameters": {
  29940. // "project": {
  29941. // "description": "Project ID for this request.",
  29942. // "location": "path",
  29943. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  29944. // "required": true,
  29945. // "type": "string"
  29946. // },
  29947. // "region": {
  29948. // "description": "Name of the region scoping this request.",
  29949. // "location": "path",
  29950. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  29951. // "required": true,
  29952. // "type": "string"
  29953. // },
  29954. // "subnetwork": {
  29955. // "description": "Name of the Subnetwork resource to return.",
  29956. // "location": "path",
  29957. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  29958. // "required": true,
  29959. // "type": "string"
  29960. // }
  29961. // },
  29962. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}",
  29963. // "response": {
  29964. // "$ref": "Subnetwork"
  29965. // },
  29966. // "scopes": [
  29967. // "https://www.googleapis.com/auth/cloud-platform",
  29968. // "https://www.googleapis.com/auth/compute",
  29969. // "https://www.googleapis.com/auth/compute.readonly"
  29970. // ]
  29971. // }
  29972. }
  29973. // method id "compute.subnetworks.insert":
  29974. type SubnetworksInsertCall struct {
  29975. s *Service
  29976. project string
  29977. region string
  29978. subnetwork *Subnetwork
  29979. urlParams_ gensupport.URLParams
  29980. ctx_ context.Context
  29981. }
  29982. // Insert: Creates a subnetwork in the specified project using the data
  29983. // included in the request.
  29984. func (r *SubnetworksService) Insert(project string, region string, subnetwork *Subnetwork) *SubnetworksInsertCall {
  29985. c := &SubnetworksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29986. c.project = project
  29987. c.region = region
  29988. c.subnetwork = subnetwork
  29989. return c
  29990. }
  29991. // Fields allows partial responses to be retrieved. See
  29992. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29993. // for more information.
  29994. func (c *SubnetworksInsertCall) Fields(s ...googleapi.Field) *SubnetworksInsertCall {
  29995. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29996. return c
  29997. }
  29998. // Context sets the context to be used in this call's Do method. Any
  29999. // pending HTTP request will be aborted if the provided context is
  30000. // canceled.
  30001. func (c *SubnetworksInsertCall) Context(ctx context.Context) *SubnetworksInsertCall {
  30002. c.ctx_ = ctx
  30003. return c
  30004. }
  30005. func (c *SubnetworksInsertCall) doRequest(alt string) (*http.Response, error) {
  30006. var body io.Reader = nil
  30007. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetwork)
  30008. if err != nil {
  30009. return nil, err
  30010. }
  30011. ctype := "application/json"
  30012. c.urlParams_.Set("alt", alt)
  30013. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks")
  30014. urls += "?" + c.urlParams_.Encode()
  30015. req, _ := http.NewRequest("POST", urls, body)
  30016. googleapi.Expand(req.URL, map[string]string{
  30017. "project": c.project,
  30018. "region": c.region,
  30019. })
  30020. req.Header.Set("Content-Type", ctype)
  30021. req.Header.Set("User-Agent", c.s.userAgent())
  30022. if c.ctx_ != nil {
  30023. return ctxhttp.Do(c.ctx_, c.s.client, req)
  30024. }
  30025. return c.s.client.Do(req)
  30026. }
  30027. // Do executes the "compute.subnetworks.insert" call.
  30028. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  30029. // status code is an error. Response headers are in either
  30030. // *Operation.ServerResponse.Header or (if a response was returned at
  30031. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  30032. // to check whether the returned error was because
  30033. // http.StatusNotModified was returned.
  30034. func (c *SubnetworksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  30035. gensupport.SetOptions(c.urlParams_, opts...)
  30036. res, err := c.doRequest("json")
  30037. if res != nil && res.StatusCode == http.StatusNotModified {
  30038. if res.Body != nil {
  30039. res.Body.Close()
  30040. }
  30041. return nil, &googleapi.Error{
  30042. Code: res.StatusCode,
  30043. Header: res.Header,
  30044. }
  30045. }
  30046. if err != nil {
  30047. return nil, err
  30048. }
  30049. defer googleapi.CloseBody(res)
  30050. if err := googleapi.CheckResponse(res); err != nil {
  30051. return nil, err
  30052. }
  30053. ret := &Operation{
  30054. ServerResponse: googleapi.ServerResponse{
  30055. Header: res.Header,
  30056. HTTPStatusCode: res.StatusCode,
  30057. },
  30058. }
  30059. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  30060. return nil, err
  30061. }
  30062. return ret, nil
  30063. // {
  30064. // "description": "Creates a subnetwork in the specified project using the data included in the request.",
  30065. // "httpMethod": "POST",
  30066. // "id": "compute.subnetworks.insert",
  30067. // "parameterOrder": [
  30068. // "project",
  30069. // "region"
  30070. // ],
  30071. // "parameters": {
  30072. // "project": {
  30073. // "description": "Project ID for this request.",
  30074. // "location": "path",
  30075. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  30076. // "required": true,
  30077. // "type": "string"
  30078. // },
  30079. // "region": {
  30080. // "description": "Name of the region scoping this request.",
  30081. // "location": "path",
  30082. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  30083. // "required": true,
  30084. // "type": "string"
  30085. // }
  30086. // },
  30087. // "path": "{project}/regions/{region}/subnetworks",
  30088. // "request": {
  30089. // "$ref": "Subnetwork"
  30090. // },
  30091. // "response": {
  30092. // "$ref": "Operation"
  30093. // },
  30094. // "scopes": [
  30095. // "https://www.googleapis.com/auth/cloud-platform",
  30096. // "https://www.googleapis.com/auth/compute"
  30097. // ]
  30098. // }
  30099. }
  30100. // method id "compute.subnetworks.list":
  30101. type SubnetworksListCall struct {
  30102. s *Service
  30103. project string
  30104. region string
  30105. urlParams_ gensupport.URLParams
  30106. ifNoneMatch_ string
  30107. ctx_ context.Context
  30108. }
  30109. // List: Retrieves a list of subnetworks available to the specified
  30110. // project.
  30111. func (r *SubnetworksService) List(project string, region string) *SubnetworksListCall {
  30112. c := &SubnetworksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30113. c.project = project
  30114. c.region = region
  30115. return c
  30116. }
  30117. // Filter sets the optional parameter "filter": Sets a filter expression
  30118. // for filtering listed resources, in the form filter={expression}. Your
  30119. // {expression} must be in the format: field_name comparison_string
  30120. // literal_string.
  30121. //
  30122. // The field_name is the name of the field you want to compare. Only
  30123. // atomic field types are supported (string, number, boolean). The
  30124. // comparison_string must be either eq (equals) or ne (not equals). The
  30125. // literal_string is the string value to filter to. The literal value
  30126. // must be valid for the type of field you are filtering by (string,
  30127. // number, boolean). For string fields, the literal value is interpreted
  30128. // as a regular expression using RE2 syntax. The literal value must
  30129. // match the entire field.
  30130. //
  30131. // For example, filter=name ne example-instance.
  30132. //
  30133. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  30134. // you can also filter on nested fields. For example, you could filter
  30135. // on instances that have set the scheduling.automaticRestart field to
  30136. // true. In particular, use filtering on nested fields to take advantage
  30137. // of instance labels to organize and filter results based on label
  30138. // values.
  30139. //
  30140. // The Beta API also supports filtering on multiple expressions by
  30141. // providing each separate expression within parentheses. For example,
  30142. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  30143. // Multiple expressions are treated as AND expressions meaning that
  30144. // resources must match all expressions to pass the filters.
  30145. func (c *SubnetworksListCall) Filter(filter string) *SubnetworksListCall {
  30146. c.urlParams_.Set("filter", filter)
  30147. return c
  30148. }
  30149. // MaxResults sets the optional parameter "maxResults": The maximum
  30150. // number of results per page that Compute Engine should return. If the
  30151. // number of available results is larger than maxResults, Compute Engine
  30152. // returns a nextPageToken that can be used to get the next page of
  30153. // results in subsequent list requests.
  30154. func (c *SubnetworksListCall) MaxResults(maxResults int64) *SubnetworksListCall {
  30155. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  30156. return c
  30157. }
  30158. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  30159. // a certain order. By default, results are returned in alphanumerical
  30160. // order based on the resource name.
  30161. //
  30162. // You can also sort results in descending order based on the creation
  30163. // timestamp using orderBy="creationTimestamp desc". This sorts results
  30164. // based on the creationTimestamp field in reverse chronological order
  30165. // (newest result first). Use this to sort resources like operations so
  30166. // that the newest operation is returned first.
  30167. //
  30168. // Currently, only sorting by name or creationTimestamp desc is
  30169. // supported.
  30170. func (c *SubnetworksListCall) OrderBy(orderBy string) *SubnetworksListCall {
  30171. c.urlParams_.Set("orderBy", orderBy)
  30172. return c
  30173. }
  30174. // PageToken sets the optional parameter "pageToken": Specifies a page
  30175. // token to use. Set pageToken to the nextPageToken returned by a
  30176. // previous list request to get the next page of results.
  30177. func (c *SubnetworksListCall) PageToken(pageToken string) *SubnetworksListCall {
  30178. c.urlParams_.Set("pageToken", pageToken)
  30179. return c
  30180. }
  30181. // Fields allows partial responses to be retrieved. See
  30182. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30183. // for more information.
  30184. func (c *SubnetworksListCall) Fields(s ...googleapi.Field) *SubnetworksListCall {
  30185. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30186. return c
  30187. }
  30188. // IfNoneMatch sets the optional parameter which makes the operation
  30189. // fail if the object's ETag matches the given value. This is useful for
  30190. // getting updates only after the object has changed since the last
  30191. // request. Use googleapi.IsNotModified to check whether the response
  30192. // error from Do is the result of In-None-Match.
  30193. func (c *SubnetworksListCall) IfNoneMatch(entityTag string) *SubnetworksListCall {
  30194. c.ifNoneMatch_ = entityTag
  30195. return c
  30196. }
  30197. // Context sets the context to be used in this call's Do method. Any
  30198. // pending HTTP request will be aborted if the provided context is
  30199. // canceled.
  30200. func (c *SubnetworksListCall) Context(ctx context.Context) *SubnetworksListCall {
  30201. c.ctx_ = ctx
  30202. return c
  30203. }
  30204. func (c *SubnetworksListCall) doRequest(alt string) (*http.Response, error) {
  30205. var body io.Reader = nil
  30206. c.urlParams_.Set("alt", alt)
  30207. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks")
  30208. urls += "?" + c.urlParams_.Encode()
  30209. req, _ := http.NewRequest("GET", urls, body)
  30210. googleapi.Expand(req.URL, map[string]string{
  30211. "project": c.project,
  30212. "region": c.region,
  30213. })
  30214. req.Header.Set("User-Agent", c.s.userAgent())
  30215. if c.ifNoneMatch_ != "" {
  30216. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  30217. }
  30218. if c.ctx_ != nil {
  30219. return ctxhttp.Do(c.ctx_, c.s.client, req)
  30220. }
  30221. return c.s.client.Do(req)
  30222. }
  30223. // Do executes the "compute.subnetworks.list" call.
  30224. // Exactly one of *SubnetworkList or error will be non-nil. Any non-2xx
  30225. // status code is an error. Response headers are in either
  30226. // *SubnetworkList.ServerResponse.Header or (if a response was returned
  30227. // at all) in error.(*googleapi.Error).Header. Use
  30228. // googleapi.IsNotModified to check whether the returned error was
  30229. // because http.StatusNotModified was returned.
  30230. func (c *SubnetworksListCall) Do(opts ...googleapi.CallOption) (*SubnetworkList, error) {
  30231. gensupport.SetOptions(c.urlParams_, opts...)
  30232. res, err := c.doRequest("json")
  30233. if res != nil && res.StatusCode == http.StatusNotModified {
  30234. if res.Body != nil {
  30235. res.Body.Close()
  30236. }
  30237. return nil, &googleapi.Error{
  30238. Code: res.StatusCode,
  30239. Header: res.Header,
  30240. }
  30241. }
  30242. if err != nil {
  30243. return nil, err
  30244. }
  30245. defer googleapi.CloseBody(res)
  30246. if err := googleapi.CheckResponse(res); err != nil {
  30247. return nil, err
  30248. }
  30249. ret := &SubnetworkList{
  30250. ServerResponse: googleapi.ServerResponse{
  30251. Header: res.Header,
  30252. HTTPStatusCode: res.StatusCode,
  30253. },
  30254. }
  30255. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  30256. return nil, err
  30257. }
  30258. return ret, nil
  30259. // {
  30260. // "description": "Retrieves a list of subnetworks available to the specified project.",
  30261. // "httpMethod": "GET",
  30262. // "id": "compute.subnetworks.list",
  30263. // "parameterOrder": [
  30264. // "project",
  30265. // "region"
  30266. // ],
  30267. // "parameters": {
  30268. // "filter": {
  30269. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  30270. // "location": "query",
  30271. // "type": "string"
  30272. // },
  30273. // "maxResults": {
  30274. // "default": "500",
  30275. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  30276. // "format": "uint32",
  30277. // "location": "query",
  30278. // "maximum": "500",
  30279. // "minimum": "0",
  30280. // "type": "integer"
  30281. // },
  30282. // "orderBy": {
  30283. // "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.",
  30284. // "location": "query",
  30285. // "type": "string"
  30286. // },
  30287. // "pageToken": {
  30288. // "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.",
  30289. // "location": "query",
  30290. // "type": "string"
  30291. // },
  30292. // "project": {
  30293. // "description": "Project ID for this request.",
  30294. // "location": "path",
  30295. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  30296. // "required": true,
  30297. // "type": "string"
  30298. // },
  30299. // "region": {
  30300. // "description": "Name of the region scoping this request.",
  30301. // "location": "path",
  30302. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  30303. // "required": true,
  30304. // "type": "string"
  30305. // }
  30306. // },
  30307. // "path": "{project}/regions/{region}/subnetworks",
  30308. // "response": {
  30309. // "$ref": "SubnetworkList"
  30310. // },
  30311. // "scopes": [
  30312. // "https://www.googleapis.com/auth/cloud-platform",
  30313. // "https://www.googleapis.com/auth/compute",
  30314. // "https://www.googleapis.com/auth/compute.readonly"
  30315. // ]
  30316. // }
  30317. }
  30318. // Pages invokes f for each page of results.
  30319. // A non-nil error returned from f will halt the iteration.
  30320. // The provided context supersedes any context provided to the Context method.
  30321. func (c *SubnetworksListCall) Pages(ctx context.Context, f func(*SubnetworkList) error) error {
  30322. c.ctx_ = ctx
  30323. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  30324. for {
  30325. x, err := c.Do()
  30326. if err != nil {
  30327. return err
  30328. }
  30329. if err := f(x); err != nil {
  30330. return err
  30331. }
  30332. if x.NextPageToken == "" {
  30333. return nil
  30334. }
  30335. c.PageToken(x.NextPageToken)
  30336. }
  30337. }
  30338. // method id "compute.targetHttpProxies.delete":
  30339. type TargetHttpProxiesDeleteCall struct {
  30340. s *Service
  30341. project string
  30342. targetHttpProxy string
  30343. urlParams_ gensupport.URLParams
  30344. ctx_ context.Context
  30345. }
  30346. // Delete: Deletes the specified TargetHttpProxy resource.
  30347. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/delete
  30348. func (r *TargetHttpProxiesService) Delete(project string, targetHttpProxy string) *TargetHttpProxiesDeleteCall {
  30349. c := &TargetHttpProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30350. c.project = project
  30351. c.targetHttpProxy = targetHttpProxy
  30352. return c
  30353. }
  30354. // Fields allows partial responses to be retrieved. See
  30355. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30356. // for more information.
  30357. func (c *TargetHttpProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetHttpProxiesDeleteCall {
  30358. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30359. return c
  30360. }
  30361. // Context sets the context to be used in this call's Do method. Any
  30362. // pending HTTP request will be aborted if the provided context is
  30363. // canceled.
  30364. func (c *TargetHttpProxiesDeleteCall) Context(ctx context.Context) *TargetHttpProxiesDeleteCall {
  30365. c.ctx_ = ctx
  30366. return c
  30367. }
  30368. func (c *TargetHttpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  30369. var body io.Reader = nil
  30370. c.urlParams_.Set("alt", alt)
  30371. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies/{targetHttpProxy}")
  30372. urls += "?" + c.urlParams_.Encode()
  30373. req, _ := http.NewRequest("DELETE", urls, body)
  30374. googleapi.Expand(req.URL, map[string]string{
  30375. "project": c.project,
  30376. "targetHttpProxy": c.targetHttpProxy,
  30377. })
  30378. req.Header.Set("User-Agent", c.s.userAgent())
  30379. if c.ctx_ != nil {
  30380. return ctxhttp.Do(c.ctx_, c.s.client, req)
  30381. }
  30382. return c.s.client.Do(req)
  30383. }
  30384. // Do executes the "compute.targetHttpProxies.delete" call.
  30385. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  30386. // status code is an error. Response headers are in either
  30387. // *Operation.ServerResponse.Header or (if a response was returned at
  30388. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  30389. // to check whether the returned error was because
  30390. // http.StatusNotModified was returned.
  30391. func (c *TargetHttpProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  30392. gensupport.SetOptions(c.urlParams_, opts...)
  30393. res, err := c.doRequest("json")
  30394. if res != nil && res.StatusCode == http.StatusNotModified {
  30395. if res.Body != nil {
  30396. res.Body.Close()
  30397. }
  30398. return nil, &googleapi.Error{
  30399. Code: res.StatusCode,
  30400. Header: res.Header,
  30401. }
  30402. }
  30403. if err != nil {
  30404. return nil, err
  30405. }
  30406. defer googleapi.CloseBody(res)
  30407. if err := googleapi.CheckResponse(res); err != nil {
  30408. return nil, err
  30409. }
  30410. ret := &Operation{
  30411. ServerResponse: googleapi.ServerResponse{
  30412. Header: res.Header,
  30413. HTTPStatusCode: res.StatusCode,
  30414. },
  30415. }
  30416. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  30417. return nil, err
  30418. }
  30419. return ret, nil
  30420. // {
  30421. // "description": "Deletes the specified TargetHttpProxy resource.",
  30422. // "httpMethod": "DELETE",
  30423. // "id": "compute.targetHttpProxies.delete",
  30424. // "parameterOrder": [
  30425. // "project",
  30426. // "targetHttpProxy"
  30427. // ],
  30428. // "parameters": {
  30429. // "project": {
  30430. // "description": "Project ID for this request.",
  30431. // "location": "path",
  30432. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  30433. // "required": true,
  30434. // "type": "string"
  30435. // },
  30436. // "targetHttpProxy": {
  30437. // "description": "Name of the TargetHttpProxy resource to delete.",
  30438. // "location": "path",
  30439. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  30440. // "required": true,
  30441. // "type": "string"
  30442. // }
  30443. // },
  30444. // "path": "{project}/global/targetHttpProxies/{targetHttpProxy}",
  30445. // "response": {
  30446. // "$ref": "Operation"
  30447. // },
  30448. // "scopes": [
  30449. // "https://www.googleapis.com/auth/cloud-platform",
  30450. // "https://www.googleapis.com/auth/compute"
  30451. // ]
  30452. // }
  30453. }
  30454. // method id "compute.targetHttpProxies.get":
  30455. type TargetHttpProxiesGetCall struct {
  30456. s *Service
  30457. project string
  30458. targetHttpProxy string
  30459. urlParams_ gensupport.URLParams
  30460. ifNoneMatch_ string
  30461. ctx_ context.Context
  30462. }
  30463. // Get: Returns the specified TargetHttpProxy resource.
  30464. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/get
  30465. func (r *TargetHttpProxiesService) Get(project string, targetHttpProxy string) *TargetHttpProxiesGetCall {
  30466. c := &TargetHttpProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30467. c.project = project
  30468. c.targetHttpProxy = targetHttpProxy
  30469. return c
  30470. }
  30471. // Fields allows partial responses to be retrieved. See
  30472. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30473. // for more information.
  30474. func (c *TargetHttpProxiesGetCall) Fields(s ...googleapi.Field) *TargetHttpProxiesGetCall {
  30475. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30476. return c
  30477. }
  30478. // IfNoneMatch sets the optional parameter which makes the operation
  30479. // fail if the object's ETag matches the given value. This is useful for
  30480. // getting updates only after the object has changed since the last
  30481. // request. Use googleapi.IsNotModified to check whether the response
  30482. // error from Do is the result of In-None-Match.
  30483. func (c *TargetHttpProxiesGetCall) IfNoneMatch(entityTag string) *TargetHttpProxiesGetCall {
  30484. c.ifNoneMatch_ = entityTag
  30485. return c
  30486. }
  30487. // Context sets the context to be used in this call's Do method. Any
  30488. // pending HTTP request will be aborted if the provided context is
  30489. // canceled.
  30490. func (c *TargetHttpProxiesGetCall) Context(ctx context.Context) *TargetHttpProxiesGetCall {
  30491. c.ctx_ = ctx
  30492. return c
  30493. }
  30494. func (c *TargetHttpProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  30495. var body io.Reader = nil
  30496. c.urlParams_.Set("alt", alt)
  30497. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies/{targetHttpProxy}")
  30498. urls += "?" + c.urlParams_.Encode()
  30499. req, _ := http.NewRequest("GET", urls, body)
  30500. googleapi.Expand(req.URL, map[string]string{
  30501. "project": c.project,
  30502. "targetHttpProxy": c.targetHttpProxy,
  30503. })
  30504. req.Header.Set("User-Agent", c.s.userAgent())
  30505. if c.ifNoneMatch_ != "" {
  30506. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  30507. }
  30508. if c.ctx_ != nil {
  30509. return ctxhttp.Do(c.ctx_, c.s.client, req)
  30510. }
  30511. return c.s.client.Do(req)
  30512. }
  30513. // Do executes the "compute.targetHttpProxies.get" call.
  30514. // Exactly one of *TargetHttpProxy or error will be non-nil. Any non-2xx
  30515. // status code is an error. Response headers are in either
  30516. // *TargetHttpProxy.ServerResponse.Header or (if a response was returned
  30517. // at all) in error.(*googleapi.Error).Header. Use
  30518. // googleapi.IsNotModified to check whether the returned error was
  30519. // because http.StatusNotModified was returned.
  30520. func (c *TargetHttpProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetHttpProxy, error) {
  30521. gensupport.SetOptions(c.urlParams_, opts...)
  30522. res, err := c.doRequest("json")
  30523. if res != nil && res.StatusCode == http.StatusNotModified {
  30524. if res.Body != nil {
  30525. res.Body.Close()
  30526. }
  30527. return nil, &googleapi.Error{
  30528. Code: res.StatusCode,
  30529. Header: res.Header,
  30530. }
  30531. }
  30532. if err != nil {
  30533. return nil, err
  30534. }
  30535. defer googleapi.CloseBody(res)
  30536. if err := googleapi.CheckResponse(res); err != nil {
  30537. return nil, err
  30538. }
  30539. ret := &TargetHttpProxy{
  30540. ServerResponse: googleapi.ServerResponse{
  30541. Header: res.Header,
  30542. HTTPStatusCode: res.StatusCode,
  30543. },
  30544. }
  30545. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  30546. return nil, err
  30547. }
  30548. return ret, nil
  30549. // {
  30550. // "description": "Returns the specified TargetHttpProxy resource.",
  30551. // "httpMethod": "GET",
  30552. // "id": "compute.targetHttpProxies.get",
  30553. // "parameterOrder": [
  30554. // "project",
  30555. // "targetHttpProxy"
  30556. // ],
  30557. // "parameters": {
  30558. // "project": {
  30559. // "description": "Project ID for this request.",
  30560. // "location": "path",
  30561. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  30562. // "required": true,
  30563. // "type": "string"
  30564. // },
  30565. // "targetHttpProxy": {
  30566. // "description": "Name of the TargetHttpProxy resource to return.",
  30567. // "location": "path",
  30568. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  30569. // "required": true,
  30570. // "type": "string"
  30571. // }
  30572. // },
  30573. // "path": "{project}/global/targetHttpProxies/{targetHttpProxy}",
  30574. // "response": {
  30575. // "$ref": "TargetHttpProxy"
  30576. // },
  30577. // "scopes": [
  30578. // "https://www.googleapis.com/auth/cloud-platform",
  30579. // "https://www.googleapis.com/auth/compute",
  30580. // "https://www.googleapis.com/auth/compute.readonly"
  30581. // ]
  30582. // }
  30583. }
  30584. // method id "compute.targetHttpProxies.insert":
  30585. type TargetHttpProxiesInsertCall struct {
  30586. s *Service
  30587. project string
  30588. targethttpproxy *TargetHttpProxy
  30589. urlParams_ gensupport.URLParams
  30590. ctx_ context.Context
  30591. }
  30592. // Insert: Creates a TargetHttpProxy resource in the specified project
  30593. // using the data included in the request.
  30594. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/insert
  30595. func (r *TargetHttpProxiesService) Insert(project string, targethttpproxy *TargetHttpProxy) *TargetHttpProxiesInsertCall {
  30596. c := &TargetHttpProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30597. c.project = project
  30598. c.targethttpproxy = targethttpproxy
  30599. return c
  30600. }
  30601. // Fields allows partial responses to be retrieved. See
  30602. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30603. // for more information.
  30604. func (c *TargetHttpProxiesInsertCall) Fields(s ...googleapi.Field) *TargetHttpProxiesInsertCall {
  30605. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30606. return c
  30607. }
  30608. // Context sets the context to be used in this call's Do method. Any
  30609. // pending HTTP request will be aborted if the provided context is
  30610. // canceled.
  30611. func (c *TargetHttpProxiesInsertCall) Context(ctx context.Context) *TargetHttpProxiesInsertCall {
  30612. c.ctx_ = ctx
  30613. return c
  30614. }
  30615. func (c *TargetHttpProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  30616. var body io.Reader = nil
  30617. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpproxy)
  30618. if err != nil {
  30619. return nil, err
  30620. }
  30621. ctype := "application/json"
  30622. c.urlParams_.Set("alt", alt)
  30623. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies")
  30624. urls += "?" + c.urlParams_.Encode()
  30625. req, _ := http.NewRequest("POST", urls, body)
  30626. googleapi.Expand(req.URL, map[string]string{
  30627. "project": c.project,
  30628. })
  30629. req.Header.Set("Content-Type", ctype)
  30630. req.Header.Set("User-Agent", c.s.userAgent())
  30631. if c.ctx_ != nil {
  30632. return ctxhttp.Do(c.ctx_, c.s.client, req)
  30633. }
  30634. return c.s.client.Do(req)
  30635. }
  30636. // Do executes the "compute.targetHttpProxies.insert" call.
  30637. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  30638. // status code is an error. Response headers are in either
  30639. // *Operation.ServerResponse.Header or (if a response was returned at
  30640. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  30641. // to check whether the returned error was because
  30642. // http.StatusNotModified was returned.
  30643. func (c *TargetHttpProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  30644. gensupport.SetOptions(c.urlParams_, opts...)
  30645. res, err := c.doRequest("json")
  30646. if res != nil && res.StatusCode == http.StatusNotModified {
  30647. if res.Body != nil {
  30648. res.Body.Close()
  30649. }
  30650. return nil, &googleapi.Error{
  30651. Code: res.StatusCode,
  30652. Header: res.Header,
  30653. }
  30654. }
  30655. if err != nil {
  30656. return nil, err
  30657. }
  30658. defer googleapi.CloseBody(res)
  30659. if err := googleapi.CheckResponse(res); err != nil {
  30660. return nil, err
  30661. }
  30662. ret := &Operation{
  30663. ServerResponse: googleapi.ServerResponse{
  30664. Header: res.Header,
  30665. HTTPStatusCode: res.StatusCode,
  30666. },
  30667. }
  30668. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  30669. return nil, err
  30670. }
  30671. return ret, nil
  30672. // {
  30673. // "description": "Creates a TargetHttpProxy resource in the specified project using the data included in the request.",
  30674. // "httpMethod": "POST",
  30675. // "id": "compute.targetHttpProxies.insert",
  30676. // "parameterOrder": [
  30677. // "project"
  30678. // ],
  30679. // "parameters": {
  30680. // "project": {
  30681. // "description": "Project ID for this request.",
  30682. // "location": "path",
  30683. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  30684. // "required": true,
  30685. // "type": "string"
  30686. // }
  30687. // },
  30688. // "path": "{project}/global/targetHttpProxies",
  30689. // "request": {
  30690. // "$ref": "TargetHttpProxy"
  30691. // },
  30692. // "response": {
  30693. // "$ref": "Operation"
  30694. // },
  30695. // "scopes": [
  30696. // "https://www.googleapis.com/auth/cloud-platform",
  30697. // "https://www.googleapis.com/auth/compute"
  30698. // ]
  30699. // }
  30700. }
  30701. // method id "compute.targetHttpProxies.list":
  30702. type TargetHttpProxiesListCall struct {
  30703. s *Service
  30704. project string
  30705. urlParams_ gensupport.URLParams
  30706. ifNoneMatch_ string
  30707. ctx_ context.Context
  30708. }
  30709. // List: Retrieves the list of TargetHttpProxy resources available to
  30710. // the specified project.
  30711. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/list
  30712. func (r *TargetHttpProxiesService) List(project string) *TargetHttpProxiesListCall {
  30713. c := &TargetHttpProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30714. c.project = project
  30715. return c
  30716. }
  30717. // Filter sets the optional parameter "filter": Sets a filter expression
  30718. // for filtering listed resources, in the form filter={expression}. Your
  30719. // {expression} must be in the format: field_name comparison_string
  30720. // literal_string.
  30721. //
  30722. // The field_name is the name of the field you want to compare. Only
  30723. // atomic field types are supported (string, number, boolean). The
  30724. // comparison_string must be either eq (equals) or ne (not equals). The
  30725. // literal_string is the string value to filter to. The literal value
  30726. // must be valid for the type of field you are filtering by (string,
  30727. // number, boolean). For string fields, the literal value is interpreted
  30728. // as a regular expression using RE2 syntax. The literal value must
  30729. // match the entire field.
  30730. //
  30731. // For example, filter=name ne example-instance.
  30732. //
  30733. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  30734. // you can also filter on nested fields. For example, you could filter
  30735. // on instances that have set the scheduling.automaticRestart field to
  30736. // true. In particular, use filtering on nested fields to take advantage
  30737. // of instance labels to organize and filter results based on label
  30738. // values.
  30739. //
  30740. // The Beta API also supports filtering on multiple expressions by
  30741. // providing each separate expression within parentheses. For example,
  30742. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  30743. // Multiple expressions are treated as AND expressions meaning that
  30744. // resources must match all expressions to pass the filters.
  30745. func (c *TargetHttpProxiesListCall) Filter(filter string) *TargetHttpProxiesListCall {
  30746. c.urlParams_.Set("filter", filter)
  30747. return c
  30748. }
  30749. // MaxResults sets the optional parameter "maxResults": The maximum
  30750. // number of results per page that Compute Engine should return. If the
  30751. // number of available results is larger than maxResults, Compute Engine
  30752. // returns a nextPageToken that can be used to get the next page of
  30753. // results in subsequent list requests.
  30754. func (c *TargetHttpProxiesListCall) MaxResults(maxResults int64) *TargetHttpProxiesListCall {
  30755. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  30756. return c
  30757. }
  30758. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  30759. // a certain order. By default, results are returned in alphanumerical
  30760. // order based on the resource name.
  30761. //
  30762. // You can also sort results in descending order based on the creation
  30763. // timestamp using orderBy="creationTimestamp desc". This sorts results
  30764. // based on the creationTimestamp field in reverse chronological order
  30765. // (newest result first). Use this to sort resources like operations so
  30766. // that the newest operation is returned first.
  30767. //
  30768. // Currently, only sorting by name or creationTimestamp desc is
  30769. // supported.
  30770. func (c *TargetHttpProxiesListCall) OrderBy(orderBy string) *TargetHttpProxiesListCall {
  30771. c.urlParams_.Set("orderBy", orderBy)
  30772. return c
  30773. }
  30774. // PageToken sets the optional parameter "pageToken": Specifies a page
  30775. // token to use. Set pageToken to the nextPageToken returned by a
  30776. // previous list request to get the next page of results.
  30777. func (c *TargetHttpProxiesListCall) PageToken(pageToken string) *TargetHttpProxiesListCall {
  30778. c.urlParams_.Set("pageToken", pageToken)
  30779. return c
  30780. }
  30781. // Fields allows partial responses to be retrieved. See
  30782. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30783. // for more information.
  30784. func (c *TargetHttpProxiesListCall) Fields(s ...googleapi.Field) *TargetHttpProxiesListCall {
  30785. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30786. return c
  30787. }
  30788. // IfNoneMatch sets the optional parameter which makes the operation
  30789. // fail if the object's ETag matches the given value. This is useful for
  30790. // getting updates only after the object has changed since the last
  30791. // request. Use googleapi.IsNotModified to check whether the response
  30792. // error from Do is the result of In-None-Match.
  30793. func (c *TargetHttpProxiesListCall) IfNoneMatch(entityTag string) *TargetHttpProxiesListCall {
  30794. c.ifNoneMatch_ = entityTag
  30795. return c
  30796. }
  30797. // Context sets the context to be used in this call's Do method. Any
  30798. // pending HTTP request will be aborted if the provided context is
  30799. // canceled.
  30800. func (c *TargetHttpProxiesListCall) Context(ctx context.Context) *TargetHttpProxiesListCall {
  30801. c.ctx_ = ctx
  30802. return c
  30803. }
  30804. func (c *TargetHttpProxiesListCall) doRequest(alt string) (*http.Response, error) {
  30805. var body io.Reader = nil
  30806. c.urlParams_.Set("alt", alt)
  30807. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies")
  30808. urls += "?" + c.urlParams_.Encode()
  30809. req, _ := http.NewRequest("GET", urls, body)
  30810. googleapi.Expand(req.URL, map[string]string{
  30811. "project": c.project,
  30812. })
  30813. req.Header.Set("User-Agent", c.s.userAgent())
  30814. if c.ifNoneMatch_ != "" {
  30815. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  30816. }
  30817. if c.ctx_ != nil {
  30818. return ctxhttp.Do(c.ctx_, c.s.client, req)
  30819. }
  30820. return c.s.client.Do(req)
  30821. }
  30822. // Do executes the "compute.targetHttpProxies.list" call.
  30823. // Exactly one of *TargetHttpProxyList or error will be non-nil. Any
  30824. // non-2xx status code is an error. Response headers are in either
  30825. // *TargetHttpProxyList.ServerResponse.Header or (if a response was
  30826. // returned at all) in error.(*googleapi.Error).Header. Use
  30827. // googleapi.IsNotModified to check whether the returned error was
  30828. // because http.StatusNotModified was returned.
  30829. func (c *TargetHttpProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetHttpProxyList, error) {
  30830. gensupport.SetOptions(c.urlParams_, opts...)
  30831. res, err := c.doRequest("json")
  30832. if res != nil && res.StatusCode == http.StatusNotModified {
  30833. if res.Body != nil {
  30834. res.Body.Close()
  30835. }
  30836. return nil, &googleapi.Error{
  30837. Code: res.StatusCode,
  30838. Header: res.Header,
  30839. }
  30840. }
  30841. if err != nil {
  30842. return nil, err
  30843. }
  30844. defer googleapi.CloseBody(res)
  30845. if err := googleapi.CheckResponse(res); err != nil {
  30846. return nil, err
  30847. }
  30848. ret := &TargetHttpProxyList{
  30849. ServerResponse: googleapi.ServerResponse{
  30850. Header: res.Header,
  30851. HTTPStatusCode: res.StatusCode,
  30852. },
  30853. }
  30854. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  30855. return nil, err
  30856. }
  30857. return ret, nil
  30858. // {
  30859. // "description": "Retrieves the list of TargetHttpProxy resources available to the specified project.",
  30860. // "httpMethod": "GET",
  30861. // "id": "compute.targetHttpProxies.list",
  30862. // "parameterOrder": [
  30863. // "project"
  30864. // ],
  30865. // "parameters": {
  30866. // "filter": {
  30867. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  30868. // "location": "query",
  30869. // "type": "string"
  30870. // },
  30871. // "maxResults": {
  30872. // "default": "500",
  30873. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  30874. // "format": "uint32",
  30875. // "location": "query",
  30876. // "maximum": "500",
  30877. // "minimum": "0",
  30878. // "type": "integer"
  30879. // },
  30880. // "orderBy": {
  30881. // "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.",
  30882. // "location": "query",
  30883. // "type": "string"
  30884. // },
  30885. // "pageToken": {
  30886. // "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.",
  30887. // "location": "query",
  30888. // "type": "string"
  30889. // },
  30890. // "project": {
  30891. // "description": "Project ID for this request.",
  30892. // "location": "path",
  30893. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  30894. // "required": true,
  30895. // "type": "string"
  30896. // }
  30897. // },
  30898. // "path": "{project}/global/targetHttpProxies",
  30899. // "response": {
  30900. // "$ref": "TargetHttpProxyList"
  30901. // },
  30902. // "scopes": [
  30903. // "https://www.googleapis.com/auth/cloud-platform",
  30904. // "https://www.googleapis.com/auth/compute",
  30905. // "https://www.googleapis.com/auth/compute.readonly"
  30906. // ]
  30907. // }
  30908. }
  30909. // Pages invokes f for each page of results.
  30910. // A non-nil error returned from f will halt the iteration.
  30911. // The provided context supersedes any context provided to the Context method.
  30912. func (c *TargetHttpProxiesListCall) Pages(ctx context.Context, f func(*TargetHttpProxyList) error) error {
  30913. c.ctx_ = ctx
  30914. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  30915. for {
  30916. x, err := c.Do()
  30917. if err != nil {
  30918. return err
  30919. }
  30920. if err := f(x); err != nil {
  30921. return err
  30922. }
  30923. if x.NextPageToken == "" {
  30924. return nil
  30925. }
  30926. c.PageToken(x.NextPageToken)
  30927. }
  30928. }
  30929. // method id "compute.targetHttpProxies.setUrlMap":
  30930. type TargetHttpProxiesSetUrlMapCall struct {
  30931. s *Service
  30932. project string
  30933. targetHttpProxy string
  30934. urlmapreference *UrlMapReference
  30935. urlParams_ gensupport.URLParams
  30936. ctx_ context.Context
  30937. }
  30938. // SetUrlMap: Changes the URL map for TargetHttpProxy.
  30939. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/setUrlMap
  30940. func (r *TargetHttpProxiesService) SetUrlMap(project string, targetHttpProxy string, urlmapreference *UrlMapReference) *TargetHttpProxiesSetUrlMapCall {
  30941. c := &TargetHttpProxiesSetUrlMapCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30942. c.project = project
  30943. c.targetHttpProxy = targetHttpProxy
  30944. c.urlmapreference = urlmapreference
  30945. return c
  30946. }
  30947. // Fields allows partial responses to be retrieved. See
  30948. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30949. // for more information.
  30950. func (c *TargetHttpProxiesSetUrlMapCall) Fields(s ...googleapi.Field) *TargetHttpProxiesSetUrlMapCall {
  30951. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30952. return c
  30953. }
  30954. // Context sets the context to be used in this call's Do method. Any
  30955. // pending HTTP request will be aborted if the provided context is
  30956. // canceled.
  30957. func (c *TargetHttpProxiesSetUrlMapCall) Context(ctx context.Context) *TargetHttpProxiesSetUrlMapCall {
  30958. c.ctx_ = ctx
  30959. return c
  30960. }
  30961. func (c *TargetHttpProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) {
  30962. var body io.Reader = nil
  30963. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference)
  30964. if err != nil {
  30965. return nil, err
  30966. }
  30967. ctype := "application/json"
  30968. c.urlParams_.Set("alt", alt)
  30969. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap")
  30970. urls += "?" + c.urlParams_.Encode()
  30971. req, _ := http.NewRequest("POST", urls, body)
  30972. googleapi.Expand(req.URL, map[string]string{
  30973. "project": c.project,
  30974. "targetHttpProxy": c.targetHttpProxy,
  30975. })
  30976. req.Header.Set("Content-Type", ctype)
  30977. req.Header.Set("User-Agent", c.s.userAgent())
  30978. if c.ctx_ != nil {
  30979. return ctxhttp.Do(c.ctx_, c.s.client, req)
  30980. }
  30981. return c.s.client.Do(req)
  30982. }
  30983. // Do executes the "compute.targetHttpProxies.setUrlMap" call.
  30984. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  30985. // status code is an error. Response headers are in either
  30986. // *Operation.ServerResponse.Header or (if a response was returned at
  30987. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  30988. // to check whether the returned error was because
  30989. // http.StatusNotModified was returned.
  30990. func (c *TargetHttpProxiesSetUrlMapCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  30991. gensupport.SetOptions(c.urlParams_, opts...)
  30992. res, err := c.doRequest("json")
  30993. if res != nil && res.StatusCode == http.StatusNotModified {
  30994. if res.Body != nil {
  30995. res.Body.Close()
  30996. }
  30997. return nil, &googleapi.Error{
  30998. Code: res.StatusCode,
  30999. Header: res.Header,
  31000. }
  31001. }
  31002. if err != nil {
  31003. return nil, err
  31004. }
  31005. defer googleapi.CloseBody(res)
  31006. if err := googleapi.CheckResponse(res); err != nil {
  31007. return nil, err
  31008. }
  31009. ret := &Operation{
  31010. ServerResponse: googleapi.ServerResponse{
  31011. Header: res.Header,
  31012. HTTPStatusCode: res.StatusCode,
  31013. },
  31014. }
  31015. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  31016. return nil, err
  31017. }
  31018. return ret, nil
  31019. // {
  31020. // "description": "Changes the URL map for TargetHttpProxy.",
  31021. // "httpMethod": "POST",
  31022. // "id": "compute.targetHttpProxies.setUrlMap",
  31023. // "parameterOrder": [
  31024. // "project",
  31025. // "targetHttpProxy"
  31026. // ],
  31027. // "parameters": {
  31028. // "project": {
  31029. // "description": "Project ID for this request.",
  31030. // "location": "path",
  31031. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31032. // "required": true,
  31033. // "type": "string"
  31034. // },
  31035. // "targetHttpProxy": {
  31036. // "description": "Name of the TargetHttpProxy resource whose URL map is to be set.",
  31037. // "location": "path",
  31038. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31039. // "required": true,
  31040. // "type": "string"
  31041. // }
  31042. // },
  31043. // "path": "{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap",
  31044. // "request": {
  31045. // "$ref": "UrlMapReference"
  31046. // },
  31047. // "response": {
  31048. // "$ref": "Operation"
  31049. // },
  31050. // "scopes": [
  31051. // "https://www.googleapis.com/auth/cloud-platform",
  31052. // "https://www.googleapis.com/auth/compute"
  31053. // ]
  31054. // }
  31055. }
  31056. // method id "compute.targetHttpsProxies.delete":
  31057. type TargetHttpsProxiesDeleteCall struct {
  31058. s *Service
  31059. project string
  31060. targetHttpsProxy string
  31061. urlParams_ gensupport.URLParams
  31062. ctx_ context.Context
  31063. }
  31064. // Delete: Deletes the specified TargetHttpsProxy resource.
  31065. func (r *TargetHttpsProxiesService) Delete(project string, targetHttpsProxy string) *TargetHttpsProxiesDeleteCall {
  31066. c := &TargetHttpsProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31067. c.project = project
  31068. c.targetHttpsProxy = targetHttpsProxy
  31069. return c
  31070. }
  31071. // Fields allows partial responses to be retrieved. See
  31072. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31073. // for more information.
  31074. func (c *TargetHttpsProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesDeleteCall {
  31075. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31076. return c
  31077. }
  31078. // Context sets the context to be used in this call's Do method. Any
  31079. // pending HTTP request will be aborted if the provided context is
  31080. // canceled.
  31081. func (c *TargetHttpsProxiesDeleteCall) Context(ctx context.Context) *TargetHttpsProxiesDeleteCall {
  31082. c.ctx_ = ctx
  31083. return c
  31084. }
  31085. func (c *TargetHttpsProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  31086. var body io.Reader = nil
  31087. c.urlParams_.Set("alt", alt)
  31088. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}")
  31089. urls += "?" + c.urlParams_.Encode()
  31090. req, _ := http.NewRequest("DELETE", urls, body)
  31091. googleapi.Expand(req.URL, map[string]string{
  31092. "project": c.project,
  31093. "targetHttpsProxy": c.targetHttpsProxy,
  31094. })
  31095. req.Header.Set("User-Agent", c.s.userAgent())
  31096. if c.ctx_ != nil {
  31097. return ctxhttp.Do(c.ctx_, c.s.client, req)
  31098. }
  31099. return c.s.client.Do(req)
  31100. }
  31101. // Do executes the "compute.targetHttpsProxies.delete" call.
  31102. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  31103. // status code is an error. Response headers are in either
  31104. // *Operation.ServerResponse.Header or (if a response was returned at
  31105. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  31106. // to check whether the returned error was because
  31107. // http.StatusNotModified was returned.
  31108. func (c *TargetHttpsProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  31109. gensupport.SetOptions(c.urlParams_, opts...)
  31110. res, err := c.doRequest("json")
  31111. if res != nil && res.StatusCode == http.StatusNotModified {
  31112. if res.Body != nil {
  31113. res.Body.Close()
  31114. }
  31115. return nil, &googleapi.Error{
  31116. Code: res.StatusCode,
  31117. Header: res.Header,
  31118. }
  31119. }
  31120. if err != nil {
  31121. return nil, err
  31122. }
  31123. defer googleapi.CloseBody(res)
  31124. if err := googleapi.CheckResponse(res); err != nil {
  31125. return nil, err
  31126. }
  31127. ret := &Operation{
  31128. ServerResponse: googleapi.ServerResponse{
  31129. Header: res.Header,
  31130. HTTPStatusCode: res.StatusCode,
  31131. },
  31132. }
  31133. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  31134. return nil, err
  31135. }
  31136. return ret, nil
  31137. // {
  31138. // "description": "Deletes the specified TargetHttpsProxy resource.",
  31139. // "httpMethod": "DELETE",
  31140. // "id": "compute.targetHttpsProxies.delete",
  31141. // "parameterOrder": [
  31142. // "project",
  31143. // "targetHttpsProxy"
  31144. // ],
  31145. // "parameters": {
  31146. // "project": {
  31147. // "description": "Project ID for this request.",
  31148. // "location": "path",
  31149. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31150. // "required": true,
  31151. // "type": "string"
  31152. // },
  31153. // "targetHttpsProxy": {
  31154. // "description": "Name of the TargetHttpsProxy resource to delete.",
  31155. // "location": "path",
  31156. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31157. // "required": true,
  31158. // "type": "string"
  31159. // }
  31160. // },
  31161. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}",
  31162. // "response": {
  31163. // "$ref": "Operation"
  31164. // },
  31165. // "scopes": [
  31166. // "https://www.googleapis.com/auth/cloud-platform",
  31167. // "https://www.googleapis.com/auth/compute"
  31168. // ]
  31169. // }
  31170. }
  31171. // method id "compute.targetHttpsProxies.get":
  31172. type TargetHttpsProxiesGetCall struct {
  31173. s *Service
  31174. project string
  31175. targetHttpsProxy string
  31176. urlParams_ gensupport.URLParams
  31177. ifNoneMatch_ string
  31178. ctx_ context.Context
  31179. }
  31180. // Get: Returns the specified TargetHttpsProxy resource.
  31181. func (r *TargetHttpsProxiesService) Get(project string, targetHttpsProxy string) *TargetHttpsProxiesGetCall {
  31182. c := &TargetHttpsProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31183. c.project = project
  31184. c.targetHttpsProxy = targetHttpsProxy
  31185. return c
  31186. }
  31187. // Fields allows partial responses to be retrieved. See
  31188. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31189. // for more information.
  31190. func (c *TargetHttpsProxiesGetCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesGetCall {
  31191. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31192. return c
  31193. }
  31194. // IfNoneMatch sets the optional parameter which makes the operation
  31195. // fail if the object's ETag matches the given value. This is useful for
  31196. // getting updates only after the object has changed since the last
  31197. // request. Use googleapi.IsNotModified to check whether the response
  31198. // error from Do is the result of In-None-Match.
  31199. func (c *TargetHttpsProxiesGetCall) IfNoneMatch(entityTag string) *TargetHttpsProxiesGetCall {
  31200. c.ifNoneMatch_ = entityTag
  31201. return c
  31202. }
  31203. // Context sets the context to be used in this call's Do method. Any
  31204. // pending HTTP request will be aborted if the provided context is
  31205. // canceled.
  31206. func (c *TargetHttpsProxiesGetCall) Context(ctx context.Context) *TargetHttpsProxiesGetCall {
  31207. c.ctx_ = ctx
  31208. return c
  31209. }
  31210. func (c *TargetHttpsProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  31211. var body io.Reader = nil
  31212. c.urlParams_.Set("alt", alt)
  31213. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}")
  31214. urls += "?" + c.urlParams_.Encode()
  31215. req, _ := http.NewRequest("GET", urls, body)
  31216. googleapi.Expand(req.URL, map[string]string{
  31217. "project": c.project,
  31218. "targetHttpsProxy": c.targetHttpsProxy,
  31219. })
  31220. req.Header.Set("User-Agent", c.s.userAgent())
  31221. if c.ifNoneMatch_ != "" {
  31222. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  31223. }
  31224. if c.ctx_ != nil {
  31225. return ctxhttp.Do(c.ctx_, c.s.client, req)
  31226. }
  31227. return c.s.client.Do(req)
  31228. }
  31229. // Do executes the "compute.targetHttpsProxies.get" call.
  31230. // Exactly one of *TargetHttpsProxy or error will be non-nil. Any
  31231. // non-2xx status code is an error. Response headers are in either
  31232. // *TargetHttpsProxy.ServerResponse.Header or (if a response was
  31233. // returned at all) in error.(*googleapi.Error).Header. Use
  31234. // googleapi.IsNotModified to check whether the returned error was
  31235. // because http.StatusNotModified was returned.
  31236. func (c *TargetHttpsProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetHttpsProxy, error) {
  31237. gensupport.SetOptions(c.urlParams_, opts...)
  31238. res, err := c.doRequest("json")
  31239. if res != nil && res.StatusCode == http.StatusNotModified {
  31240. if res.Body != nil {
  31241. res.Body.Close()
  31242. }
  31243. return nil, &googleapi.Error{
  31244. Code: res.StatusCode,
  31245. Header: res.Header,
  31246. }
  31247. }
  31248. if err != nil {
  31249. return nil, err
  31250. }
  31251. defer googleapi.CloseBody(res)
  31252. if err := googleapi.CheckResponse(res); err != nil {
  31253. return nil, err
  31254. }
  31255. ret := &TargetHttpsProxy{
  31256. ServerResponse: googleapi.ServerResponse{
  31257. Header: res.Header,
  31258. HTTPStatusCode: res.StatusCode,
  31259. },
  31260. }
  31261. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  31262. return nil, err
  31263. }
  31264. return ret, nil
  31265. // {
  31266. // "description": "Returns the specified TargetHttpsProxy resource.",
  31267. // "httpMethod": "GET",
  31268. // "id": "compute.targetHttpsProxies.get",
  31269. // "parameterOrder": [
  31270. // "project",
  31271. // "targetHttpsProxy"
  31272. // ],
  31273. // "parameters": {
  31274. // "project": {
  31275. // "description": "Project ID for this request.",
  31276. // "location": "path",
  31277. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31278. // "required": true,
  31279. // "type": "string"
  31280. // },
  31281. // "targetHttpsProxy": {
  31282. // "description": "Name of the TargetHttpsProxy resource to return.",
  31283. // "location": "path",
  31284. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31285. // "required": true,
  31286. // "type": "string"
  31287. // }
  31288. // },
  31289. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}",
  31290. // "response": {
  31291. // "$ref": "TargetHttpsProxy"
  31292. // },
  31293. // "scopes": [
  31294. // "https://www.googleapis.com/auth/cloud-platform",
  31295. // "https://www.googleapis.com/auth/compute",
  31296. // "https://www.googleapis.com/auth/compute.readonly"
  31297. // ]
  31298. // }
  31299. }
  31300. // method id "compute.targetHttpsProxies.insert":
  31301. type TargetHttpsProxiesInsertCall struct {
  31302. s *Service
  31303. project string
  31304. targethttpsproxy *TargetHttpsProxy
  31305. urlParams_ gensupport.URLParams
  31306. ctx_ context.Context
  31307. }
  31308. // Insert: Creates a TargetHttpsProxy resource in the specified project
  31309. // using the data included in the request.
  31310. func (r *TargetHttpsProxiesService) Insert(project string, targethttpsproxy *TargetHttpsProxy) *TargetHttpsProxiesInsertCall {
  31311. c := &TargetHttpsProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31312. c.project = project
  31313. c.targethttpsproxy = targethttpsproxy
  31314. return c
  31315. }
  31316. // Fields allows partial responses to be retrieved. See
  31317. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31318. // for more information.
  31319. func (c *TargetHttpsProxiesInsertCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesInsertCall {
  31320. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31321. return c
  31322. }
  31323. // Context sets the context to be used in this call's Do method. Any
  31324. // pending HTTP request will be aborted if the provided context is
  31325. // canceled.
  31326. func (c *TargetHttpsProxiesInsertCall) Context(ctx context.Context) *TargetHttpsProxiesInsertCall {
  31327. c.ctx_ = ctx
  31328. return c
  31329. }
  31330. func (c *TargetHttpsProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  31331. var body io.Reader = nil
  31332. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxy)
  31333. if err != nil {
  31334. return nil, err
  31335. }
  31336. ctype := "application/json"
  31337. c.urlParams_.Set("alt", alt)
  31338. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies")
  31339. urls += "?" + c.urlParams_.Encode()
  31340. req, _ := http.NewRequest("POST", urls, body)
  31341. googleapi.Expand(req.URL, map[string]string{
  31342. "project": c.project,
  31343. })
  31344. req.Header.Set("Content-Type", ctype)
  31345. req.Header.Set("User-Agent", c.s.userAgent())
  31346. if c.ctx_ != nil {
  31347. return ctxhttp.Do(c.ctx_, c.s.client, req)
  31348. }
  31349. return c.s.client.Do(req)
  31350. }
  31351. // Do executes the "compute.targetHttpsProxies.insert" call.
  31352. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  31353. // status code is an error. Response headers are in either
  31354. // *Operation.ServerResponse.Header or (if a response was returned at
  31355. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  31356. // to check whether the returned error was because
  31357. // http.StatusNotModified was returned.
  31358. func (c *TargetHttpsProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  31359. gensupport.SetOptions(c.urlParams_, opts...)
  31360. res, err := c.doRequest("json")
  31361. if res != nil && res.StatusCode == http.StatusNotModified {
  31362. if res.Body != nil {
  31363. res.Body.Close()
  31364. }
  31365. return nil, &googleapi.Error{
  31366. Code: res.StatusCode,
  31367. Header: res.Header,
  31368. }
  31369. }
  31370. if err != nil {
  31371. return nil, err
  31372. }
  31373. defer googleapi.CloseBody(res)
  31374. if err := googleapi.CheckResponse(res); err != nil {
  31375. return nil, err
  31376. }
  31377. ret := &Operation{
  31378. ServerResponse: googleapi.ServerResponse{
  31379. Header: res.Header,
  31380. HTTPStatusCode: res.StatusCode,
  31381. },
  31382. }
  31383. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  31384. return nil, err
  31385. }
  31386. return ret, nil
  31387. // {
  31388. // "description": "Creates a TargetHttpsProxy resource in the specified project using the data included in the request.",
  31389. // "httpMethod": "POST",
  31390. // "id": "compute.targetHttpsProxies.insert",
  31391. // "parameterOrder": [
  31392. // "project"
  31393. // ],
  31394. // "parameters": {
  31395. // "project": {
  31396. // "description": "Project ID for this request.",
  31397. // "location": "path",
  31398. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31399. // "required": true,
  31400. // "type": "string"
  31401. // }
  31402. // },
  31403. // "path": "{project}/global/targetHttpsProxies",
  31404. // "request": {
  31405. // "$ref": "TargetHttpsProxy"
  31406. // },
  31407. // "response": {
  31408. // "$ref": "Operation"
  31409. // },
  31410. // "scopes": [
  31411. // "https://www.googleapis.com/auth/cloud-platform",
  31412. // "https://www.googleapis.com/auth/compute"
  31413. // ]
  31414. // }
  31415. }
  31416. // method id "compute.targetHttpsProxies.list":
  31417. type TargetHttpsProxiesListCall struct {
  31418. s *Service
  31419. project string
  31420. urlParams_ gensupport.URLParams
  31421. ifNoneMatch_ string
  31422. ctx_ context.Context
  31423. }
  31424. // List: Retrieves the list of TargetHttpsProxy resources available to
  31425. // the specified project.
  31426. func (r *TargetHttpsProxiesService) List(project string) *TargetHttpsProxiesListCall {
  31427. c := &TargetHttpsProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31428. c.project = project
  31429. return c
  31430. }
  31431. // Filter sets the optional parameter "filter": Sets a filter expression
  31432. // for filtering listed resources, in the form filter={expression}. Your
  31433. // {expression} must be in the format: field_name comparison_string
  31434. // literal_string.
  31435. //
  31436. // The field_name is the name of the field you want to compare. Only
  31437. // atomic field types are supported (string, number, boolean). The
  31438. // comparison_string must be either eq (equals) or ne (not equals). The
  31439. // literal_string is the string value to filter to. The literal value
  31440. // must be valid for the type of field you are filtering by (string,
  31441. // number, boolean). For string fields, the literal value is interpreted
  31442. // as a regular expression using RE2 syntax. The literal value must
  31443. // match the entire field.
  31444. //
  31445. // For example, filter=name ne example-instance.
  31446. //
  31447. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  31448. // you can also filter on nested fields. For example, you could filter
  31449. // on instances that have set the scheduling.automaticRestart field to
  31450. // true. In particular, use filtering on nested fields to take advantage
  31451. // of instance labels to organize and filter results based on label
  31452. // values.
  31453. //
  31454. // The Beta API also supports filtering on multiple expressions by
  31455. // providing each separate expression within parentheses. For example,
  31456. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  31457. // Multiple expressions are treated as AND expressions meaning that
  31458. // resources must match all expressions to pass the filters.
  31459. func (c *TargetHttpsProxiesListCall) Filter(filter string) *TargetHttpsProxiesListCall {
  31460. c.urlParams_.Set("filter", filter)
  31461. return c
  31462. }
  31463. // MaxResults sets the optional parameter "maxResults": The maximum
  31464. // number of results per page that Compute Engine should return. If the
  31465. // number of available results is larger than maxResults, Compute Engine
  31466. // returns a nextPageToken that can be used to get the next page of
  31467. // results in subsequent list requests.
  31468. func (c *TargetHttpsProxiesListCall) MaxResults(maxResults int64) *TargetHttpsProxiesListCall {
  31469. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  31470. return c
  31471. }
  31472. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  31473. // a certain order. By default, results are returned in alphanumerical
  31474. // order based on the resource name.
  31475. //
  31476. // You can also sort results in descending order based on the creation
  31477. // timestamp using orderBy="creationTimestamp desc". This sorts results
  31478. // based on the creationTimestamp field in reverse chronological order
  31479. // (newest result first). Use this to sort resources like operations so
  31480. // that the newest operation is returned first.
  31481. //
  31482. // Currently, only sorting by name or creationTimestamp desc is
  31483. // supported.
  31484. func (c *TargetHttpsProxiesListCall) OrderBy(orderBy string) *TargetHttpsProxiesListCall {
  31485. c.urlParams_.Set("orderBy", orderBy)
  31486. return c
  31487. }
  31488. // PageToken sets the optional parameter "pageToken": Specifies a page
  31489. // token to use. Set pageToken to the nextPageToken returned by a
  31490. // previous list request to get the next page of results.
  31491. func (c *TargetHttpsProxiesListCall) PageToken(pageToken string) *TargetHttpsProxiesListCall {
  31492. c.urlParams_.Set("pageToken", pageToken)
  31493. return c
  31494. }
  31495. // Fields allows partial responses to be retrieved. See
  31496. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31497. // for more information.
  31498. func (c *TargetHttpsProxiesListCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesListCall {
  31499. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31500. return c
  31501. }
  31502. // IfNoneMatch sets the optional parameter which makes the operation
  31503. // fail if the object's ETag matches the given value. This is useful for
  31504. // getting updates only after the object has changed since the last
  31505. // request. Use googleapi.IsNotModified to check whether the response
  31506. // error from Do is the result of In-None-Match.
  31507. func (c *TargetHttpsProxiesListCall) IfNoneMatch(entityTag string) *TargetHttpsProxiesListCall {
  31508. c.ifNoneMatch_ = entityTag
  31509. return c
  31510. }
  31511. // Context sets the context to be used in this call's Do method. Any
  31512. // pending HTTP request will be aborted if the provided context is
  31513. // canceled.
  31514. func (c *TargetHttpsProxiesListCall) Context(ctx context.Context) *TargetHttpsProxiesListCall {
  31515. c.ctx_ = ctx
  31516. return c
  31517. }
  31518. func (c *TargetHttpsProxiesListCall) doRequest(alt string) (*http.Response, error) {
  31519. var body io.Reader = nil
  31520. c.urlParams_.Set("alt", alt)
  31521. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies")
  31522. urls += "?" + c.urlParams_.Encode()
  31523. req, _ := http.NewRequest("GET", urls, body)
  31524. googleapi.Expand(req.URL, map[string]string{
  31525. "project": c.project,
  31526. })
  31527. req.Header.Set("User-Agent", c.s.userAgent())
  31528. if c.ifNoneMatch_ != "" {
  31529. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  31530. }
  31531. if c.ctx_ != nil {
  31532. return ctxhttp.Do(c.ctx_, c.s.client, req)
  31533. }
  31534. return c.s.client.Do(req)
  31535. }
  31536. // Do executes the "compute.targetHttpsProxies.list" call.
  31537. // Exactly one of *TargetHttpsProxyList or error will be non-nil. Any
  31538. // non-2xx status code is an error. Response headers are in either
  31539. // *TargetHttpsProxyList.ServerResponse.Header or (if a response was
  31540. // returned at all) in error.(*googleapi.Error).Header. Use
  31541. // googleapi.IsNotModified to check whether the returned error was
  31542. // because http.StatusNotModified was returned.
  31543. func (c *TargetHttpsProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetHttpsProxyList, error) {
  31544. gensupport.SetOptions(c.urlParams_, opts...)
  31545. res, err := c.doRequest("json")
  31546. if res != nil && res.StatusCode == http.StatusNotModified {
  31547. if res.Body != nil {
  31548. res.Body.Close()
  31549. }
  31550. return nil, &googleapi.Error{
  31551. Code: res.StatusCode,
  31552. Header: res.Header,
  31553. }
  31554. }
  31555. if err != nil {
  31556. return nil, err
  31557. }
  31558. defer googleapi.CloseBody(res)
  31559. if err := googleapi.CheckResponse(res); err != nil {
  31560. return nil, err
  31561. }
  31562. ret := &TargetHttpsProxyList{
  31563. ServerResponse: googleapi.ServerResponse{
  31564. Header: res.Header,
  31565. HTTPStatusCode: res.StatusCode,
  31566. },
  31567. }
  31568. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  31569. return nil, err
  31570. }
  31571. return ret, nil
  31572. // {
  31573. // "description": "Retrieves the list of TargetHttpsProxy resources available to the specified project.",
  31574. // "httpMethod": "GET",
  31575. // "id": "compute.targetHttpsProxies.list",
  31576. // "parameterOrder": [
  31577. // "project"
  31578. // ],
  31579. // "parameters": {
  31580. // "filter": {
  31581. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  31582. // "location": "query",
  31583. // "type": "string"
  31584. // },
  31585. // "maxResults": {
  31586. // "default": "500",
  31587. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  31588. // "format": "uint32",
  31589. // "location": "query",
  31590. // "maximum": "500",
  31591. // "minimum": "0",
  31592. // "type": "integer"
  31593. // },
  31594. // "orderBy": {
  31595. // "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.",
  31596. // "location": "query",
  31597. // "type": "string"
  31598. // },
  31599. // "pageToken": {
  31600. // "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.",
  31601. // "location": "query",
  31602. // "type": "string"
  31603. // },
  31604. // "project": {
  31605. // "description": "Project ID for this request.",
  31606. // "location": "path",
  31607. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31608. // "required": true,
  31609. // "type": "string"
  31610. // }
  31611. // },
  31612. // "path": "{project}/global/targetHttpsProxies",
  31613. // "response": {
  31614. // "$ref": "TargetHttpsProxyList"
  31615. // },
  31616. // "scopes": [
  31617. // "https://www.googleapis.com/auth/cloud-platform",
  31618. // "https://www.googleapis.com/auth/compute",
  31619. // "https://www.googleapis.com/auth/compute.readonly"
  31620. // ]
  31621. // }
  31622. }
  31623. // Pages invokes f for each page of results.
  31624. // A non-nil error returned from f will halt the iteration.
  31625. // The provided context supersedes any context provided to the Context method.
  31626. func (c *TargetHttpsProxiesListCall) Pages(ctx context.Context, f func(*TargetHttpsProxyList) error) error {
  31627. c.ctx_ = ctx
  31628. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  31629. for {
  31630. x, err := c.Do()
  31631. if err != nil {
  31632. return err
  31633. }
  31634. if err := f(x); err != nil {
  31635. return err
  31636. }
  31637. if x.NextPageToken == "" {
  31638. return nil
  31639. }
  31640. c.PageToken(x.NextPageToken)
  31641. }
  31642. }
  31643. // method id "compute.targetHttpsProxies.setSslCertificates":
  31644. type TargetHttpsProxiesSetSslCertificatesCall struct {
  31645. s *Service
  31646. project string
  31647. targetHttpsProxy string
  31648. targethttpsproxiessetsslcertificatesrequest *TargetHttpsProxiesSetSslCertificatesRequest
  31649. urlParams_ gensupport.URLParams
  31650. ctx_ context.Context
  31651. }
  31652. // SetSslCertificates: Replaces SslCertificates for TargetHttpsProxy.
  31653. func (r *TargetHttpsProxiesService) SetSslCertificates(project string, targetHttpsProxy string, targethttpsproxiessetsslcertificatesrequest *TargetHttpsProxiesSetSslCertificatesRequest) *TargetHttpsProxiesSetSslCertificatesCall {
  31654. c := &TargetHttpsProxiesSetSslCertificatesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31655. c.project = project
  31656. c.targetHttpsProxy = targetHttpsProxy
  31657. c.targethttpsproxiessetsslcertificatesrequest = targethttpsproxiessetsslcertificatesrequest
  31658. return c
  31659. }
  31660. // Fields allows partial responses to be retrieved. See
  31661. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31662. // for more information.
  31663. func (c *TargetHttpsProxiesSetSslCertificatesCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetSslCertificatesCall {
  31664. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31665. return c
  31666. }
  31667. // Context sets the context to be used in this call's Do method. Any
  31668. // pending HTTP request will be aborted if the provided context is
  31669. // canceled.
  31670. func (c *TargetHttpsProxiesSetSslCertificatesCall) Context(ctx context.Context) *TargetHttpsProxiesSetSslCertificatesCall {
  31671. c.ctx_ = ctx
  31672. return c
  31673. }
  31674. func (c *TargetHttpsProxiesSetSslCertificatesCall) doRequest(alt string) (*http.Response, error) {
  31675. var body io.Reader = nil
  31676. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxiessetsslcertificatesrequest)
  31677. if err != nil {
  31678. return nil, err
  31679. }
  31680. ctype := "application/json"
  31681. c.urlParams_.Set("alt", alt)
  31682. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates")
  31683. urls += "?" + c.urlParams_.Encode()
  31684. req, _ := http.NewRequest("POST", urls, body)
  31685. googleapi.Expand(req.URL, map[string]string{
  31686. "project": c.project,
  31687. "targetHttpsProxy": c.targetHttpsProxy,
  31688. })
  31689. req.Header.Set("Content-Type", ctype)
  31690. req.Header.Set("User-Agent", c.s.userAgent())
  31691. if c.ctx_ != nil {
  31692. return ctxhttp.Do(c.ctx_, c.s.client, req)
  31693. }
  31694. return c.s.client.Do(req)
  31695. }
  31696. // Do executes the "compute.targetHttpsProxies.setSslCertificates" call.
  31697. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  31698. // status code is an error. Response headers are in either
  31699. // *Operation.ServerResponse.Header or (if a response was returned at
  31700. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  31701. // to check whether the returned error was because
  31702. // http.StatusNotModified was returned.
  31703. func (c *TargetHttpsProxiesSetSslCertificatesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  31704. gensupport.SetOptions(c.urlParams_, opts...)
  31705. res, err := c.doRequest("json")
  31706. if res != nil && res.StatusCode == http.StatusNotModified {
  31707. if res.Body != nil {
  31708. res.Body.Close()
  31709. }
  31710. return nil, &googleapi.Error{
  31711. Code: res.StatusCode,
  31712. Header: res.Header,
  31713. }
  31714. }
  31715. if err != nil {
  31716. return nil, err
  31717. }
  31718. defer googleapi.CloseBody(res)
  31719. if err := googleapi.CheckResponse(res); err != nil {
  31720. return nil, err
  31721. }
  31722. ret := &Operation{
  31723. ServerResponse: googleapi.ServerResponse{
  31724. Header: res.Header,
  31725. HTTPStatusCode: res.StatusCode,
  31726. },
  31727. }
  31728. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  31729. return nil, err
  31730. }
  31731. return ret, nil
  31732. // {
  31733. // "description": "Replaces SslCertificates for TargetHttpsProxy.",
  31734. // "httpMethod": "POST",
  31735. // "id": "compute.targetHttpsProxies.setSslCertificates",
  31736. // "parameterOrder": [
  31737. // "project",
  31738. // "targetHttpsProxy"
  31739. // ],
  31740. // "parameters": {
  31741. // "project": {
  31742. // "description": "Project ID for this request.",
  31743. // "location": "path",
  31744. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31745. // "required": true,
  31746. // "type": "string"
  31747. // },
  31748. // "targetHttpsProxy": {
  31749. // "description": "Name of the TargetHttpsProxy resource whose SSLCertificate is to be set.",
  31750. // "location": "path",
  31751. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31752. // "required": true,
  31753. // "type": "string"
  31754. // }
  31755. // },
  31756. // "path": "{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates",
  31757. // "request": {
  31758. // "$ref": "TargetHttpsProxiesSetSslCertificatesRequest"
  31759. // },
  31760. // "response": {
  31761. // "$ref": "Operation"
  31762. // },
  31763. // "scopes": [
  31764. // "https://www.googleapis.com/auth/cloud-platform",
  31765. // "https://www.googleapis.com/auth/compute"
  31766. // ]
  31767. // }
  31768. }
  31769. // method id "compute.targetHttpsProxies.setUrlMap":
  31770. type TargetHttpsProxiesSetUrlMapCall struct {
  31771. s *Service
  31772. project string
  31773. targetHttpsProxy string
  31774. urlmapreference *UrlMapReference
  31775. urlParams_ gensupport.URLParams
  31776. ctx_ context.Context
  31777. }
  31778. // SetUrlMap: Changes the URL map for TargetHttpsProxy.
  31779. func (r *TargetHttpsProxiesService) SetUrlMap(project string, targetHttpsProxy string, urlmapreference *UrlMapReference) *TargetHttpsProxiesSetUrlMapCall {
  31780. c := &TargetHttpsProxiesSetUrlMapCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31781. c.project = project
  31782. c.targetHttpsProxy = targetHttpsProxy
  31783. c.urlmapreference = urlmapreference
  31784. return c
  31785. }
  31786. // Fields allows partial responses to be retrieved. See
  31787. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31788. // for more information.
  31789. func (c *TargetHttpsProxiesSetUrlMapCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetUrlMapCall {
  31790. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31791. return c
  31792. }
  31793. // Context sets the context to be used in this call's Do method. Any
  31794. // pending HTTP request will be aborted if the provided context is
  31795. // canceled.
  31796. func (c *TargetHttpsProxiesSetUrlMapCall) Context(ctx context.Context) *TargetHttpsProxiesSetUrlMapCall {
  31797. c.ctx_ = ctx
  31798. return c
  31799. }
  31800. func (c *TargetHttpsProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) {
  31801. var body io.Reader = nil
  31802. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference)
  31803. if err != nil {
  31804. return nil, err
  31805. }
  31806. ctype := "application/json"
  31807. c.urlParams_.Set("alt", alt)
  31808. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap")
  31809. urls += "?" + c.urlParams_.Encode()
  31810. req, _ := http.NewRequest("POST", urls, body)
  31811. googleapi.Expand(req.URL, map[string]string{
  31812. "project": c.project,
  31813. "targetHttpsProxy": c.targetHttpsProxy,
  31814. })
  31815. req.Header.Set("Content-Type", ctype)
  31816. req.Header.Set("User-Agent", c.s.userAgent())
  31817. if c.ctx_ != nil {
  31818. return ctxhttp.Do(c.ctx_, c.s.client, req)
  31819. }
  31820. return c.s.client.Do(req)
  31821. }
  31822. // Do executes the "compute.targetHttpsProxies.setUrlMap" call.
  31823. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  31824. // status code is an error. Response headers are in either
  31825. // *Operation.ServerResponse.Header or (if a response was returned at
  31826. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  31827. // to check whether the returned error was because
  31828. // http.StatusNotModified was returned.
  31829. func (c *TargetHttpsProxiesSetUrlMapCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  31830. gensupport.SetOptions(c.urlParams_, opts...)
  31831. res, err := c.doRequest("json")
  31832. if res != nil && res.StatusCode == http.StatusNotModified {
  31833. if res.Body != nil {
  31834. res.Body.Close()
  31835. }
  31836. return nil, &googleapi.Error{
  31837. Code: res.StatusCode,
  31838. Header: res.Header,
  31839. }
  31840. }
  31841. if err != nil {
  31842. return nil, err
  31843. }
  31844. defer googleapi.CloseBody(res)
  31845. if err := googleapi.CheckResponse(res); err != nil {
  31846. return nil, err
  31847. }
  31848. ret := &Operation{
  31849. ServerResponse: googleapi.ServerResponse{
  31850. Header: res.Header,
  31851. HTTPStatusCode: res.StatusCode,
  31852. },
  31853. }
  31854. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  31855. return nil, err
  31856. }
  31857. return ret, nil
  31858. // {
  31859. // "description": "Changes the URL map for TargetHttpsProxy.",
  31860. // "httpMethod": "POST",
  31861. // "id": "compute.targetHttpsProxies.setUrlMap",
  31862. // "parameterOrder": [
  31863. // "project",
  31864. // "targetHttpsProxy"
  31865. // ],
  31866. // "parameters": {
  31867. // "project": {
  31868. // "description": "Project ID for this request.",
  31869. // "location": "path",
  31870. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31871. // "required": true,
  31872. // "type": "string"
  31873. // },
  31874. // "targetHttpsProxy": {
  31875. // "description": "Name of the TargetHttpsProxy resource whose URL map is to be set.",
  31876. // "location": "path",
  31877. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31878. // "required": true,
  31879. // "type": "string"
  31880. // }
  31881. // },
  31882. // "path": "{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap",
  31883. // "request": {
  31884. // "$ref": "UrlMapReference"
  31885. // },
  31886. // "response": {
  31887. // "$ref": "Operation"
  31888. // },
  31889. // "scopes": [
  31890. // "https://www.googleapis.com/auth/cloud-platform",
  31891. // "https://www.googleapis.com/auth/compute"
  31892. // ]
  31893. // }
  31894. }
  31895. // method id "compute.targetInstances.aggregatedList":
  31896. type TargetInstancesAggregatedListCall struct {
  31897. s *Service
  31898. project string
  31899. urlParams_ gensupport.URLParams
  31900. ifNoneMatch_ string
  31901. ctx_ context.Context
  31902. }
  31903. // AggregatedList: Retrieves an aggregated list of target instances.
  31904. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/aggregatedList
  31905. func (r *TargetInstancesService) AggregatedList(project string) *TargetInstancesAggregatedListCall {
  31906. c := &TargetInstancesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31907. c.project = project
  31908. return c
  31909. }
  31910. // Filter sets the optional parameter "filter": Sets a filter expression
  31911. // for filtering listed resources, in the form filter={expression}. Your
  31912. // {expression} must be in the format: field_name comparison_string
  31913. // literal_string.
  31914. //
  31915. // The field_name is the name of the field you want to compare. Only
  31916. // atomic field types are supported (string, number, boolean). The
  31917. // comparison_string must be either eq (equals) or ne (not equals). The
  31918. // literal_string is the string value to filter to. The literal value
  31919. // must be valid for the type of field you are filtering by (string,
  31920. // number, boolean). For string fields, the literal value is interpreted
  31921. // as a regular expression using RE2 syntax. The literal value must
  31922. // match the entire field.
  31923. //
  31924. // For example, filter=name ne example-instance.
  31925. //
  31926. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  31927. // you can also filter on nested fields. For example, you could filter
  31928. // on instances that have set the scheduling.automaticRestart field to
  31929. // true. In particular, use filtering on nested fields to take advantage
  31930. // of instance labels to organize and filter results based on label
  31931. // values.
  31932. //
  31933. // The Beta API also supports filtering on multiple expressions by
  31934. // providing each separate expression within parentheses. For example,
  31935. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  31936. // Multiple expressions are treated as AND expressions meaning that
  31937. // resources must match all expressions to pass the filters.
  31938. func (c *TargetInstancesAggregatedListCall) Filter(filter string) *TargetInstancesAggregatedListCall {
  31939. c.urlParams_.Set("filter", filter)
  31940. return c
  31941. }
  31942. // MaxResults sets the optional parameter "maxResults": The maximum
  31943. // number of results per page that Compute Engine should return. If the
  31944. // number of available results is larger than maxResults, Compute Engine
  31945. // returns a nextPageToken that can be used to get the next page of
  31946. // results in subsequent list requests.
  31947. func (c *TargetInstancesAggregatedListCall) MaxResults(maxResults int64) *TargetInstancesAggregatedListCall {
  31948. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  31949. return c
  31950. }
  31951. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  31952. // a certain order. By default, results are returned in alphanumerical
  31953. // order based on the resource name.
  31954. //
  31955. // You can also sort results in descending order based on the creation
  31956. // timestamp using orderBy="creationTimestamp desc". This sorts results
  31957. // based on the creationTimestamp field in reverse chronological order
  31958. // (newest result first). Use this to sort resources like operations so
  31959. // that the newest operation is returned first.
  31960. //
  31961. // Currently, only sorting by name or creationTimestamp desc is
  31962. // supported.
  31963. func (c *TargetInstancesAggregatedListCall) OrderBy(orderBy string) *TargetInstancesAggregatedListCall {
  31964. c.urlParams_.Set("orderBy", orderBy)
  31965. return c
  31966. }
  31967. // PageToken sets the optional parameter "pageToken": Specifies a page
  31968. // token to use. Set pageToken to the nextPageToken returned by a
  31969. // previous list request to get the next page of results.
  31970. func (c *TargetInstancesAggregatedListCall) PageToken(pageToken string) *TargetInstancesAggregatedListCall {
  31971. c.urlParams_.Set("pageToken", pageToken)
  31972. return c
  31973. }
  31974. // Fields allows partial responses to be retrieved. See
  31975. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31976. // for more information.
  31977. func (c *TargetInstancesAggregatedListCall) Fields(s ...googleapi.Field) *TargetInstancesAggregatedListCall {
  31978. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31979. return c
  31980. }
  31981. // IfNoneMatch sets the optional parameter which makes the operation
  31982. // fail if the object's ETag matches the given value. This is useful for
  31983. // getting updates only after the object has changed since the last
  31984. // request. Use googleapi.IsNotModified to check whether the response
  31985. // error from Do is the result of In-None-Match.
  31986. func (c *TargetInstancesAggregatedListCall) IfNoneMatch(entityTag string) *TargetInstancesAggregatedListCall {
  31987. c.ifNoneMatch_ = entityTag
  31988. return c
  31989. }
  31990. // Context sets the context to be used in this call's Do method. Any
  31991. // pending HTTP request will be aborted if the provided context is
  31992. // canceled.
  31993. func (c *TargetInstancesAggregatedListCall) Context(ctx context.Context) *TargetInstancesAggregatedListCall {
  31994. c.ctx_ = ctx
  31995. return c
  31996. }
  31997. func (c *TargetInstancesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  31998. var body io.Reader = nil
  31999. c.urlParams_.Set("alt", alt)
  32000. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetInstances")
  32001. urls += "?" + c.urlParams_.Encode()
  32002. req, _ := http.NewRequest("GET", urls, body)
  32003. googleapi.Expand(req.URL, map[string]string{
  32004. "project": c.project,
  32005. })
  32006. req.Header.Set("User-Agent", c.s.userAgent())
  32007. if c.ifNoneMatch_ != "" {
  32008. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  32009. }
  32010. if c.ctx_ != nil {
  32011. return ctxhttp.Do(c.ctx_, c.s.client, req)
  32012. }
  32013. return c.s.client.Do(req)
  32014. }
  32015. // Do executes the "compute.targetInstances.aggregatedList" call.
  32016. // Exactly one of *TargetInstanceAggregatedList or error will be
  32017. // non-nil. Any non-2xx status code is an error. Response headers are in
  32018. // either *TargetInstanceAggregatedList.ServerResponse.Header or (if a
  32019. // response was returned at all) in error.(*googleapi.Error).Header. Use
  32020. // googleapi.IsNotModified to check whether the returned error was
  32021. // because http.StatusNotModified was returned.
  32022. func (c *TargetInstancesAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetInstanceAggregatedList, error) {
  32023. gensupport.SetOptions(c.urlParams_, opts...)
  32024. res, err := c.doRequest("json")
  32025. if res != nil && res.StatusCode == http.StatusNotModified {
  32026. if res.Body != nil {
  32027. res.Body.Close()
  32028. }
  32029. return nil, &googleapi.Error{
  32030. Code: res.StatusCode,
  32031. Header: res.Header,
  32032. }
  32033. }
  32034. if err != nil {
  32035. return nil, err
  32036. }
  32037. defer googleapi.CloseBody(res)
  32038. if err := googleapi.CheckResponse(res); err != nil {
  32039. return nil, err
  32040. }
  32041. ret := &TargetInstanceAggregatedList{
  32042. ServerResponse: googleapi.ServerResponse{
  32043. Header: res.Header,
  32044. HTTPStatusCode: res.StatusCode,
  32045. },
  32046. }
  32047. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  32048. return nil, err
  32049. }
  32050. return ret, nil
  32051. // {
  32052. // "description": "Retrieves an aggregated list of target instances.",
  32053. // "httpMethod": "GET",
  32054. // "id": "compute.targetInstances.aggregatedList",
  32055. // "parameterOrder": [
  32056. // "project"
  32057. // ],
  32058. // "parameters": {
  32059. // "filter": {
  32060. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  32061. // "location": "query",
  32062. // "type": "string"
  32063. // },
  32064. // "maxResults": {
  32065. // "default": "500",
  32066. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  32067. // "format": "uint32",
  32068. // "location": "query",
  32069. // "maximum": "500",
  32070. // "minimum": "0",
  32071. // "type": "integer"
  32072. // },
  32073. // "orderBy": {
  32074. // "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.",
  32075. // "location": "query",
  32076. // "type": "string"
  32077. // },
  32078. // "pageToken": {
  32079. // "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.",
  32080. // "location": "query",
  32081. // "type": "string"
  32082. // },
  32083. // "project": {
  32084. // "description": "Project ID for this request.",
  32085. // "location": "path",
  32086. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32087. // "required": true,
  32088. // "type": "string"
  32089. // }
  32090. // },
  32091. // "path": "{project}/aggregated/targetInstances",
  32092. // "response": {
  32093. // "$ref": "TargetInstanceAggregatedList"
  32094. // },
  32095. // "scopes": [
  32096. // "https://www.googleapis.com/auth/cloud-platform",
  32097. // "https://www.googleapis.com/auth/compute",
  32098. // "https://www.googleapis.com/auth/compute.readonly"
  32099. // ]
  32100. // }
  32101. }
  32102. // Pages invokes f for each page of results.
  32103. // A non-nil error returned from f will halt the iteration.
  32104. // The provided context supersedes any context provided to the Context method.
  32105. func (c *TargetInstancesAggregatedListCall) Pages(ctx context.Context, f func(*TargetInstanceAggregatedList) error) error {
  32106. c.ctx_ = ctx
  32107. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  32108. for {
  32109. x, err := c.Do()
  32110. if err != nil {
  32111. return err
  32112. }
  32113. if err := f(x); err != nil {
  32114. return err
  32115. }
  32116. if x.NextPageToken == "" {
  32117. return nil
  32118. }
  32119. c.PageToken(x.NextPageToken)
  32120. }
  32121. }
  32122. // method id "compute.targetInstances.delete":
  32123. type TargetInstancesDeleteCall struct {
  32124. s *Service
  32125. project string
  32126. zone string
  32127. targetInstance string
  32128. urlParams_ gensupport.URLParams
  32129. ctx_ context.Context
  32130. }
  32131. // Delete: Deletes the specified TargetInstance resource.
  32132. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/delete
  32133. func (r *TargetInstancesService) Delete(project string, zone string, targetInstance string) *TargetInstancesDeleteCall {
  32134. c := &TargetInstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32135. c.project = project
  32136. c.zone = zone
  32137. c.targetInstance = targetInstance
  32138. return c
  32139. }
  32140. // Fields allows partial responses to be retrieved. See
  32141. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32142. // for more information.
  32143. func (c *TargetInstancesDeleteCall) Fields(s ...googleapi.Field) *TargetInstancesDeleteCall {
  32144. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32145. return c
  32146. }
  32147. // Context sets the context to be used in this call's Do method. Any
  32148. // pending HTTP request will be aborted if the provided context is
  32149. // canceled.
  32150. func (c *TargetInstancesDeleteCall) Context(ctx context.Context) *TargetInstancesDeleteCall {
  32151. c.ctx_ = ctx
  32152. return c
  32153. }
  32154. func (c *TargetInstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
  32155. var body io.Reader = nil
  32156. c.urlParams_.Set("alt", alt)
  32157. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances/{targetInstance}")
  32158. urls += "?" + c.urlParams_.Encode()
  32159. req, _ := http.NewRequest("DELETE", urls, body)
  32160. googleapi.Expand(req.URL, map[string]string{
  32161. "project": c.project,
  32162. "zone": c.zone,
  32163. "targetInstance": c.targetInstance,
  32164. })
  32165. req.Header.Set("User-Agent", c.s.userAgent())
  32166. if c.ctx_ != nil {
  32167. return ctxhttp.Do(c.ctx_, c.s.client, req)
  32168. }
  32169. return c.s.client.Do(req)
  32170. }
  32171. // Do executes the "compute.targetInstances.delete" call.
  32172. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  32173. // status code is an error. Response headers are in either
  32174. // *Operation.ServerResponse.Header or (if a response was returned at
  32175. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  32176. // to check whether the returned error was because
  32177. // http.StatusNotModified was returned.
  32178. func (c *TargetInstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  32179. gensupport.SetOptions(c.urlParams_, opts...)
  32180. res, err := c.doRequest("json")
  32181. if res != nil && res.StatusCode == http.StatusNotModified {
  32182. if res.Body != nil {
  32183. res.Body.Close()
  32184. }
  32185. return nil, &googleapi.Error{
  32186. Code: res.StatusCode,
  32187. Header: res.Header,
  32188. }
  32189. }
  32190. if err != nil {
  32191. return nil, err
  32192. }
  32193. defer googleapi.CloseBody(res)
  32194. if err := googleapi.CheckResponse(res); err != nil {
  32195. return nil, err
  32196. }
  32197. ret := &Operation{
  32198. ServerResponse: googleapi.ServerResponse{
  32199. Header: res.Header,
  32200. HTTPStatusCode: res.StatusCode,
  32201. },
  32202. }
  32203. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  32204. return nil, err
  32205. }
  32206. return ret, nil
  32207. // {
  32208. // "description": "Deletes the specified TargetInstance resource.",
  32209. // "httpMethod": "DELETE",
  32210. // "id": "compute.targetInstances.delete",
  32211. // "parameterOrder": [
  32212. // "project",
  32213. // "zone",
  32214. // "targetInstance"
  32215. // ],
  32216. // "parameters": {
  32217. // "project": {
  32218. // "description": "Project ID for this request.",
  32219. // "location": "path",
  32220. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32221. // "required": true,
  32222. // "type": "string"
  32223. // },
  32224. // "targetInstance": {
  32225. // "description": "Name of the TargetInstance resource to delete.",
  32226. // "location": "path",
  32227. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32228. // "required": true,
  32229. // "type": "string"
  32230. // },
  32231. // "zone": {
  32232. // "description": "Name of the zone scoping this request.",
  32233. // "location": "path",
  32234. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32235. // "required": true,
  32236. // "type": "string"
  32237. // }
  32238. // },
  32239. // "path": "{project}/zones/{zone}/targetInstances/{targetInstance}",
  32240. // "response": {
  32241. // "$ref": "Operation"
  32242. // },
  32243. // "scopes": [
  32244. // "https://www.googleapis.com/auth/cloud-platform",
  32245. // "https://www.googleapis.com/auth/compute"
  32246. // ]
  32247. // }
  32248. }
  32249. // method id "compute.targetInstances.get":
  32250. type TargetInstancesGetCall struct {
  32251. s *Service
  32252. project string
  32253. zone string
  32254. targetInstance string
  32255. urlParams_ gensupport.URLParams
  32256. ifNoneMatch_ string
  32257. ctx_ context.Context
  32258. }
  32259. // Get: Returns the specified TargetInstance resource.
  32260. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/get
  32261. func (r *TargetInstancesService) Get(project string, zone string, targetInstance string) *TargetInstancesGetCall {
  32262. c := &TargetInstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32263. c.project = project
  32264. c.zone = zone
  32265. c.targetInstance = targetInstance
  32266. return c
  32267. }
  32268. // Fields allows partial responses to be retrieved. See
  32269. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32270. // for more information.
  32271. func (c *TargetInstancesGetCall) Fields(s ...googleapi.Field) *TargetInstancesGetCall {
  32272. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32273. return c
  32274. }
  32275. // IfNoneMatch sets the optional parameter which makes the operation
  32276. // fail if the object's ETag matches the given value. This is useful for
  32277. // getting updates only after the object has changed since the last
  32278. // request. Use googleapi.IsNotModified to check whether the response
  32279. // error from Do is the result of In-None-Match.
  32280. func (c *TargetInstancesGetCall) IfNoneMatch(entityTag string) *TargetInstancesGetCall {
  32281. c.ifNoneMatch_ = entityTag
  32282. return c
  32283. }
  32284. // Context sets the context to be used in this call's Do method. Any
  32285. // pending HTTP request will be aborted if the provided context is
  32286. // canceled.
  32287. func (c *TargetInstancesGetCall) Context(ctx context.Context) *TargetInstancesGetCall {
  32288. c.ctx_ = ctx
  32289. return c
  32290. }
  32291. func (c *TargetInstancesGetCall) doRequest(alt string) (*http.Response, error) {
  32292. var body io.Reader = nil
  32293. c.urlParams_.Set("alt", alt)
  32294. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances/{targetInstance}")
  32295. urls += "?" + c.urlParams_.Encode()
  32296. req, _ := http.NewRequest("GET", urls, body)
  32297. googleapi.Expand(req.URL, map[string]string{
  32298. "project": c.project,
  32299. "zone": c.zone,
  32300. "targetInstance": c.targetInstance,
  32301. })
  32302. req.Header.Set("User-Agent", c.s.userAgent())
  32303. if c.ifNoneMatch_ != "" {
  32304. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  32305. }
  32306. if c.ctx_ != nil {
  32307. return ctxhttp.Do(c.ctx_, c.s.client, req)
  32308. }
  32309. return c.s.client.Do(req)
  32310. }
  32311. // Do executes the "compute.targetInstances.get" call.
  32312. // Exactly one of *TargetInstance or error will be non-nil. Any non-2xx
  32313. // status code is an error. Response headers are in either
  32314. // *TargetInstance.ServerResponse.Header or (if a response was returned
  32315. // at all) in error.(*googleapi.Error).Header. Use
  32316. // googleapi.IsNotModified to check whether the returned error was
  32317. // because http.StatusNotModified was returned.
  32318. func (c *TargetInstancesGetCall) Do(opts ...googleapi.CallOption) (*TargetInstance, error) {
  32319. gensupport.SetOptions(c.urlParams_, opts...)
  32320. res, err := c.doRequest("json")
  32321. if res != nil && res.StatusCode == http.StatusNotModified {
  32322. if res.Body != nil {
  32323. res.Body.Close()
  32324. }
  32325. return nil, &googleapi.Error{
  32326. Code: res.StatusCode,
  32327. Header: res.Header,
  32328. }
  32329. }
  32330. if err != nil {
  32331. return nil, err
  32332. }
  32333. defer googleapi.CloseBody(res)
  32334. if err := googleapi.CheckResponse(res); err != nil {
  32335. return nil, err
  32336. }
  32337. ret := &TargetInstance{
  32338. ServerResponse: googleapi.ServerResponse{
  32339. Header: res.Header,
  32340. HTTPStatusCode: res.StatusCode,
  32341. },
  32342. }
  32343. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  32344. return nil, err
  32345. }
  32346. return ret, nil
  32347. // {
  32348. // "description": "Returns the specified TargetInstance resource.",
  32349. // "httpMethod": "GET",
  32350. // "id": "compute.targetInstances.get",
  32351. // "parameterOrder": [
  32352. // "project",
  32353. // "zone",
  32354. // "targetInstance"
  32355. // ],
  32356. // "parameters": {
  32357. // "project": {
  32358. // "description": "Project ID for this request.",
  32359. // "location": "path",
  32360. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32361. // "required": true,
  32362. // "type": "string"
  32363. // },
  32364. // "targetInstance": {
  32365. // "description": "Name of the TargetInstance resource to return.",
  32366. // "location": "path",
  32367. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32368. // "required": true,
  32369. // "type": "string"
  32370. // },
  32371. // "zone": {
  32372. // "description": "Name of the zone scoping this request.",
  32373. // "location": "path",
  32374. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32375. // "required": true,
  32376. // "type": "string"
  32377. // }
  32378. // },
  32379. // "path": "{project}/zones/{zone}/targetInstances/{targetInstance}",
  32380. // "response": {
  32381. // "$ref": "TargetInstance"
  32382. // },
  32383. // "scopes": [
  32384. // "https://www.googleapis.com/auth/cloud-platform",
  32385. // "https://www.googleapis.com/auth/compute",
  32386. // "https://www.googleapis.com/auth/compute.readonly"
  32387. // ]
  32388. // }
  32389. }
  32390. // method id "compute.targetInstances.insert":
  32391. type TargetInstancesInsertCall struct {
  32392. s *Service
  32393. project string
  32394. zone string
  32395. targetinstance *TargetInstance
  32396. urlParams_ gensupport.URLParams
  32397. ctx_ context.Context
  32398. }
  32399. // Insert: Creates a TargetInstance resource in the specified project
  32400. // and zone using the data included in the request.
  32401. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/insert
  32402. func (r *TargetInstancesService) Insert(project string, zone string, targetinstance *TargetInstance) *TargetInstancesInsertCall {
  32403. c := &TargetInstancesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32404. c.project = project
  32405. c.zone = zone
  32406. c.targetinstance = targetinstance
  32407. return c
  32408. }
  32409. // Fields allows partial responses to be retrieved. See
  32410. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32411. // for more information.
  32412. func (c *TargetInstancesInsertCall) Fields(s ...googleapi.Field) *TargetInstancesInsertCall {
  32413. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32414. return c
  32415. }
  32416. // Context sets the context to be used in this call's Do method. Any
  32417. // pending HTTP request will be aborted if the provided context is
  32418. // canceled.
  32419. func (c *TargetInstancesInsertCall) Context(ctx context.Context) *TargetInstancesInsertCall {
  32420. c.ctx_ = ctx
  32421. return c
  32422. }
  32423. func (c *TargetInstancesInsertCall) doRequest(alt string) (*http.Response, error) {
  32424. var body io.Reader = nil
  32425. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetinstance)
  32426. if err != nil {
  32427. return nil, err
  32428. }
  32429. ctype := "application/json"
  32430. c.urlParams_.Set("alt", alt)
  32431. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances")
  32432. urls += "?" + c.urlParams_.Encode()
  32433. req, _ := http.NewRequest("POST", urls, body)
  32434. googleapi.Expand(req.URL, map[string]string{
  32435. "project": c.project,
  32436. "zone": c.zone,
  32437. })
  32438. req.Header.Set("Content-Type", ctype)
  32439. req.Header.Set("User-Agent", c.s.userAgent())
  32440. if c.ctx_ != nil {
  32441. return ctxhttp.Do(c.ctx_, c.s.client, req)
  32442. }
  32443. return c.s.client.Do(req)
  32444. }
  32445. // Do executes the "compute.targetInstances.insert" call.
  32446. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  32447. // status code is an error. Response headers are in either
  32448. // *Operation.ServerResponse.Header or (if a response was returned at
  32449. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  32450. // to check whether the returned error was because
  32451. // http.StatusNotModified was returned.
  32452. func (c *TargetInstancesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  32453. gensupport.SetOptions(c.urlParams_, opts...)
  32454. res, err := c.doRequest("json")
  32455. if res != nil && res.StatusCode == http.StatusNotModified {
  32456. if res.Body != nil {
  32457. res.Body.Close()
  32458. }
  32459. return nil, &googleapi.Error{
  32460. Code: res.StatusCode,
  32461. Header: res.Header,
  32462. }
  32463. }
  32464. if err != nil {
  32465. return nil, err
  32466. }
  32467. defer googleapi.CloseBody(res)
  32468. if err := googleapi.CheckResponse(res); err != nil {
  32469. return nil, err
  32470. }
  32471. ret := &Operation{
  32472. ServerResponse: googleapi.ServerResponse{
  32473. Header: res.Header,
  32474. HTTPStatusCode: res.StatusCode,
  32475. },
  32476. }
  32477. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  32478. return nil, err
  32479. }
  32480. return ret, nil
  32481. // {
  32482. // "description": "Creates a TargetInstance resource in the specified project and zone using the data included in the request.",
  32483. // "httpMethod": "POST",
  32484. // "id": "compute.targetInstances.insert",
  32485. // "parameterOrder": [
  32486. // "project",
  32487. // "zone"
  32488. // ],
  32489. // "parameters": {
  32490. // "project": {
  32491. // "description": "Project ID for this request.",
  32492. // "location": "path",
  32493. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32494. // "required": true,
  32495. // "type": "string"
  32496. // },
  32497. // "zone": {
  32498. // "description": "Name of the zone scoping this request.",
  32499. // "location": "path",
  32500. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32501. // "required": true,
  32502. // "type": "string"
  32503. // }
  32504. // },
  32505. // "path": "{project}/zones/{zone}/targetInstances",
  32506. // "request": {
  32507. // "$ref": "TargetInstance"
  32508. // },
  32509. // "response": {
  32510. // "$ref": "Operation"
  32511. // },
  32512. // "scopes": [
  32513. // "https://www.googleapis.com/auth/cloud-platform",
  32514. // "https://www.googleapis.com/auth/compute"
  32515. // ]
  32516. // }
  32517. }
  32518. // method id "compute.targetInstances.list":
  32519. type TargetInstancesListCall struct {
  32520. s *Service
  32521. project string
  32522. zone string
  32523. urlParams_ gensupport.URLParams
  32524. ifNoneMatch_ string
  32525. ctx_ context.Context
  32526. }
  32527. // List: Retrieves a list of TargetInstance resources available to the
  32528. // specified project and zone.
  32529. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/list
  32530. func (r *TargetInstancesService) List(project string, zone string) *TargetInstancesListCall {
  32531. c := &TargetInstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32532. c.project = project
  32533. c.zone = zone
  32534. return c
  32535. }
  32536. // Filter sets the optional parameter "filter": Sets a filter expression
  32537. // for filtering listed resources, in the form filter={expression}. Your
  32538. // {expression} must be in the format: field_name comparison_string
  32539. // literal_string.
  32540. //
  32541. // The field_name is the name of the field you want to compare. Only
  32542. // atomic field types are supported (string, number, boolean). The
  32543. // comparison_string must be either eq (equals) or ne (not equals). The
  32544. // literal_string is the string value to filter to. The literal value
  32545. // must be valid for the type of field you are filtering by (string,
  32546. // number, boolean). For string fields, the literal value is interpreted
  32547. // as a regular expression using RE2 syntax. The literal value must
  32548. // match the entire field.
  32549. //
  32550. // For example, filter=name ne example-instance.
  32551. //
  32552. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  32553. // you can also filter on nested fields. For example, you could filter
  32554. // on instances that have set the scheduling.automaticRestart field to
  32555. // true. In particular, use filtering on nested fields to take advantage
  32556. // of instance labels to organize and filter results based on label
  32557. // values.
  32558. //
  32559. // The Beta API also supports filtering on multiple expressions by
  32560. // providing each separate expression within parentheses. For example,
  32561. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  32562. // Multiple expressions are treated as AND expressions meaning that
  32563. // resources must match all expressions to pass the filters.
  32564. func (c *TargetInstancesListCall) Filter(filter string) *TargetInstancesListCall {
  32565. c.urlParams_.Set("filter", filter)
  32566. return c
  32567. }
  32568. // MaxResults sets the optional parameter "maxResults": The maximum
  32569. // number of results per page that Compute Engine should return. If the
  32570. // number of available results is larger than maxResults, Compute Engine
  32571. // returns a nextPageToken that can be used to get the next page of
  32572. // results in subsequent list requests.
  32573. func (c *TargetInstancesListCall) MaxResults(maxResults int64) *TargetInstancesListCall {
  32574. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  32575. return c
  32576. }
  32577. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  32578. // a certain order. By default, results are returned in alphanumerical
  32579. // order based on the resource name.
  32580. //
  32581. // You can also sort results in descending order based on the creation
  32582. // timestamp using orderBy="creationTimestamp desc". This sorts results
  32583. // based on the creationTimestamp field in reverse chronological order
  32584. // (newest result first). Use this to sort resources like operations so
  32585. // that the newest operation is returned first.
  32586. //
  32587. // Currently, only sorting by name or creationTimestamp desc is
  32588. // supported.
  32589. func (c *TargetInstancesListCall) OrderBy(orderBy string) *TargetInstancesListCall {
  32590. c.urlParams_.Set("orderBy", orderBy)
  32591. return c
  32592. }
  32593. // PageToken sets the optional parameter "pageToken": Specifies a page
  32594. // token to use. Set pageToken to the nextPageToken returned by a
  32595. // previous list request to get the next page of results.
  32596. func (c *TargetInstancesListCall) PageToken(pageToken string) *TargetInstancesListCall {
  32597. c.urlParams_.Set("pageToken", pageToken)
  32598. return c
  32599. }
  32600. // Fields allows partial responses to be retrieved. See
  32601. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32602. // for more information.
  32603. func (c *TargetInstancesListCall) Fields(s ...googleapi.Field) *TargetInstancesListCall {
  32604. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32605. return c
  32606. }
  32607. // IfNoneMatch sets the optional parameter which makes the operation
  32608. // fail if the object's ETag matches the given value. This is useful for
  32609. // getting updates only after the object has changed since the last
  32610. // request. Use googleapi.IsNotModified to check whether the response
  32611. // error from Do is the result of In-None-Match.
  32612. func (c *TargetInstancesListCall) IfNoneMatch(entityTag string) *TargetInstancesListCall {
  32613. c.ifNoneMatch_ = entityTag
  32614. return c
  32615. }
  32616. // Context sets the context to be used in this call's Do method. Any
  32617. // pending HTTP request will be aborted if the provided context is
  32618. // canceled.
  32619. func (c *TargetInstancesListCall) Context(ctx context.Context) *TargetInstancesListCall {
  32620. c.ctx_ = ctx
  32621. return c
  32622. }
  32623. func (c *TargetInstancesListCall) doRequest(alt string) (*http.Response, error) {
  32624. var body io.Reader = nil
  32625. c.urlParams_.Set("alt", alt)
  32626. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances")
  32627. urls += "?" + c.urlParams_.Encode()
  32628. req, _ := http.NewRequest("GET", urls, body)
  32629. googleapi.Expand(req.URL, map[string]string{
  32630. "project": c.project,
  32631. "zone": c.zone,
  32632. })
  32633. req.Header.Set("User-Agent", c.s.userAgent())
  32634. if c.ifNoneMatch_ != "" {
  32635. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  32636. }
  32637. if c.ctx_ != nil {
  32638. return ctxhttp.Do(c.ctx_, c.s.client, req)
  32639. }
  32640. return c.s.client.Do(req)
  32641. }
  32642. // Do executes the "compute.targetInstances.list" call.
  32643. // Exactly one of *TargetInstanceList or error will be non-nil. Any
  32644. // non-2xx status code is an error. Response headers are in either
  32645. // *TargetInstanceList.ServerResponse.Header or (if a response was
  32646. // returned at all) in error.(*googleapi.Error).Header. Use
  32647. // googleapi.IsNotModified to check whether the returned error was
  32648. // because http.StatusNotModified was returned.
  32649. func (c *TargetInstancesListCall) Do(opts ...googleapi.CallOption) (*TargetInstanceList, error) {
  32650. gensupport.SetOptions(c.urlParams_, opts...)
  32651. res, err := c.doRequest("json")
  32652. if res != nil && res.StatusCode == http.StatusNotModified {
  32653. if res.Body != nil {
  32654. res.Body.Close()
  32655. }
  32656. return nil, &googleapi.Error{
  32657. Code: res.StatusCode,
  32658. Header: res.Header,
  32659. }
  32660. }
  32661. if err != nil {
  32662. return nil, err
  32663. }
  32664. defer googleapi.CloseBody(res)
  32665. if err := googleapi.CheckResponse(res); err != nil {
  32666. return nil, err
  32667. }
  32668. ret := &TargetInstanceList{
  32669. ServerResponse: googleapi.ServerResponse{
  32670. Header: res.Header,
  32671. HTTPStatusCode: res.StatusCode,
  32672. },
  32673. }
  32674. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  32675. return nil, err
  32676. }
  32677. return ret, nil
  32678. // {
  32679. // "description": "Retrieves a list of TargetInstance resources available to the specified project and zone.",
  32680. // "httpMethod": "GET",
  32681. // "id": "compute.targetInstances.list",
  32682. // "parameterOrder": [
  32683. // "project",
  32684. // "zone"
  32685. // ],
  32686. // "parameters": {
  32687. // "filter": {
  32688. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  32689. // "location": "query",
  32690. // "type": "string"
  32691. // },
  32692. // "maxResults": {
  32693. // "default": "500",
  32694. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  32695. // "format": "uint32",
  32696. // "location": "query",
  32697. // "maximum": "500",
  32698. // "minimum": "0",
  32699. // "type": "integer"
  32700. // },
  32701. // "orderBy": {
  32702. // "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.",
  32703. // "location": "query",
  32704. // "type": "string"
  32705. // },
  32706. // "pageToken": {
  32707. // "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.",
  32708. // "location": "query",
  32709. // "type": "string"
  32710. // },
  32711. // "project": {
  32712. // "description": "Project ID for this request.",
  32713. // "location": "path",
  32714. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32715. // "required": true,
  32716. // "type": "string"
  32717. // },
  32718. // "zone": {
  32719. // "description": "Name of the zone scoping this request.",
  32720. // "location": "path",
  32721. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32722. // "required": true,
  32723. // "type": "string"
  32724. // }
  32725. // },
  32726. // "path": "{project}/zones/{zone}/targetInstances",
  32727. // "response": {
  32728. // "$ref": "TargetInstanceList"
  32729. // },
  32730. // "scopes": [
  32731. // "https://www.googleapis.com/auth/cloud-platform",
  32732. // "https://www.googleapis.com/auth/compute",
  32733. // "https://www.googleapis.com/auth/compute.readonly"
  32734. // ]
  32735. // }
  32736. }
  32737. // Pages invokes f for each page of results.
  32738. // A non-nil error returned from f will halt the iteration.
  32739. // The provided context supersedes any context provided to the Context method.
  32740. func (c *TargetInstancesListCall) Pages(ctx context.Context, f func(*TargetInstanceList) error) error {
  32741. c.ctx_ = ctx
  32742. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  32743. for {
  32744. x, err := c.Do()
  32745. if err != nil {
  32746. return err
  32747. }
  32748. if err := f(x); err != nil {
  32749. return err
  32750. }
  32751. if x.NextPageToken == "" {
  32752. return nil
  32753. }
  32754. c.PageToken(x.NextPageToken)
  32755. }
  32756. }
  32757. // method id "compute.targetPools.addHealthCheck":
  32758. type TargetPoolsAddHealthCheckCall struct {
  32759. s *Service
  32760. project string
  32761. region string
  32762. targetPool string
  32763. targetpoolsaddhealthcheckrequest *TargetPoolsAddHealthCheckRequest
  32764. urlParams_ gensupport.URLParams
  32765. ctx_ context.Context
  32766. }
  32767. // AddHealthCheck: Adds health check URL to targetPool.
  32768. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/addHealthCheck
  32769. func (r *TargetPoolsService) AddHealthCheck(project string, region string, targetPool string, targetpoolsaddhealthcheckrequest *TargetPoolsAddHealthCheckRequest) *TargetPoolsAddHealthCheckCall {
  32770. c := &TargetPoolsAddHealthCheckCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32771. c.project = project
  32772. c.region = region
  32773. c.targetPool = targetPool
  32774. c.targetpoolsaddhealthcheckrequest = targetpoolsaddhealthcheckrequest
  32775. return c
  32776. }
  32777. // Fields allows partial responses to be retrieved. See
  32778. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32779. // for more information.
  32780. func (c *TargetPoolsAddHealthCheckCall) Fields(s ...googleapi.Field) *TargetPoolsAddHealthCheckCall {
  32781. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32782. return c
  32783. }
  32784. // Context sets the context to be used in this call's Do method. Any
  32785. // pending HTTP request will be aborted if the provided context is
  32786. // canceled.
  32787. func (c *TargetPoolsAddHealthCheckCall) Context(ctx context.Context) *TargetPoolsAddHealthCheckCall {
  32788. c.ctx_ = ctx
  32789. return c
  32790. }
  32791. func (c *TargetPoolsAddHealthCheckCall) doRequest(alt string) (*http.Response, error) {
  32792. var body io.Reader = nil
  32793. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsaddhealthcheckrequest)
  32794. if err != nil {
  32795. return nil, err
  32796. }
  32797. ctype := "application/json"
  32798. c.urlParams_.Set("alt", alt)
  32799. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck")
  32800. urls += "?" + c.urlParams_.Encode()
  32801. req, _ := http.NewRequest("POST", urls, body)
  32802. googleapi.Expand(req.URL, map[string]string{
  32803. "project": c.project,
  32804. "region": c.region,
  32805. "targetPool": c.targetPool,
  32806. })
  32807. req.Header.Set("Content-Type", ctype)
  32808. req.Header.Set("User-Agent", c.s.userAgent())
  32809. if c.ctx_ != nil {
  32810. return ctxhttp.Do(c.ctx_, c.s.client, req)
  32811. }
  32812. return c.s.client.Do(req)
  32813. }
  32814. // Do executes the "compute.targetPools.addHealthCheck" call.
  32815. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  32816. // status code is an error. Response headers are in either
  32817. // *Operation.ServerResponse.Header or (if a response was returned at
  32818. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  32819. // to check whether the returned error was because
  32820. // http.StatusNotModified was returned.
  32821. func (c *TargetPoolsAddHealthCheckCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  32822. gensupport.SetOptions(c.urlParams_, opts...)
  32823. res, err := c.doRequest("json")
  32824. if res != nil && res.StatusCode == http.StatusNotModified {
  32825. if res.Body != nil {
  32826. res.Body.Close()
  32827. }
  32828. return nil, &googleapi.Error{
  32829. Code: res.StatusCode,
  32830. Header: res.Header,
  32831. }
  32832. }
  32833. if err != nil {
  32834. return nil, err
  32835. }
  32836. defer googleapi.CloseBody(res)
  32837. if err := googleapi.CheckResponse(res); err != nil {
  32838. return nil, err
  32839. }
  32840. ret := &Operation{
  32841. ServerResponse: googleapi.ServerResponse{
  32842. Header: res.Header,
  32843. HTTPStatusCode: res.StatusCode,
  32844. },
  32845. }
  32846. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  32847. return nil, err
  32848. }
  32849. return ret, nil
  32850. // {
  32851. // "description": "Adds health check URL to targetPool.",
  32852. // "httpMethod": "POST",
  32853. // "id": "compute.targetPools.addHealthCheck",
  32854. // "parameterOrder": [
  32855. // "project",
  32856. // "region",
  32857. // "targetPool"
  32858. // ],
  32859. // "parameters": {
  32860. // "project": {
  32861. // "location": "path",
  32862. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32863. // "required": true,
  32864. // "type": "string"
  32865. // },
  32866. // "region": {
  32867. // "description": "Name of the region scoping this request.",
  32868. // "location": "path",
  32869. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32870. // "required": true,
  32871. // "type": "string"
  32872. // },
  32873. // "targetPool": {
  32874. // "description": "Name of the TargetPool resource to which health_check_url is to be added.",
  32875. // "location": "path",
  32876. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32877. // "required": true,
  32878. // "type": "string"
  32879. // }
  32880. // },
  32881. // "path": "{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck",
  32882. // "request": {
  32883. // "$ref": "TargetPoolsAddHealthCheckRequest"
  32884. // },
  32885. // "response": {
  32886. // "$ref": "Operation"
  32887. // },
  32888. // "scopes": [
  32889. // "https://www.googleapis.com/auth/cloud-platform",
  32890. // "https://www.googleapis.com/auth/compute"
  32891. // ]
  32892. // }
  32893. }
  32894. // method id "compute.targetPools.addInstance":
  32895. type TargetPoolsAddInstanceCall struct {
  32896. s *Service
  32897. project string
  32898. region string
  32899. targetPool string
  32900. targetpoolsaddinstancerequest *TargetPoolsAddInstanceRequest
  32901. urlParams_ gensupport.URLParams
  32902. ctx_ context.Context
  32903. }
  32904. // AddInstance: Adds instance URL to targetPool.
  32905. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/addInstance
  32906. func (r *TargetPoolsService) AddInstance(project string, region string, targetPool string, targetpoolsaddinstancerequest *TargetPoolsAddInstanceRequest) *TargetPoolsAddInstanceCall {
  32907. c := &TargetPoolsAddInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32908. c.project = project
  32909. c.region = region
  32910. c.targetPool = targetPool
  32911. c.targetpoolsaddinstancerequest = targetpoolsaddinstancerequest
  32912. return c
  32913. }
  32914. // Fields allows partial responses to be retrieved. See
  32915. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32916. // for more information.
  32917. func (c *TargetPoolsAddInstanceCall) Fields(s ...googleapi.Field) *TargetPoolsAddInstanceCall {
  32918. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32919. return c
  32920. }
  32921. // Context sets the context to be used in this call's Do method. Any
  32922. // pending HTTP request will be aborted if the provided context is
  32923. // canceled.
  32924. func (c *TargetPoolsAddInstanceCall) Context(ctx context.Context) *TargetPoolsAddInstanceCall {
  32925. c.ctx_ = ctx
  32926. return c
  32927. }
  32928. func (c *TargetPoolsAddInstanceCall) doRequest(alt string) (*http.Response, error) {
  32929. var body io.Reader = nil
  32930. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsaddinstancerequest)
  32931. if err != nil {
  32932. return nil, err
  32933. }
  32934. ctype := "application/json"
  32935. c.urlParams_.Set("alt", alt)
  32936. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/addInstance")
  32937. urls += "?" + c.urlParams_.Encode()
  32938. req, _ := http.NewRequest("POST", urls, body)
  32939. googleapi.Expand(req.URL, map[string]string{
  32940. "project": c.project,
  32941. "region": c.region,
  32942. "targetPool": c.targetPool,
  32943. })
  32944. req.Header.Set("Content-Type", ctype)
  32945. req.Header.Set("User-Agent", c.s.userAgent())
  32946. if c.ctx_ != nil {
  32947. return ctxhttp.Do(c.ctx_, c.s.client, req)
  32948. }
  32949. return c.s.client.Do(req)
  32950. }
  32951. // Do executes the "compute.targetPools.addInstance" call.
  32952. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  32953. // status code is an error. Response headers are in either
  32954. // *Operation.ServerResponse.Header or (if a response was returned at
  32955. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  32956. // to check whether the returned error was because
  32957. // http.StatusNotModified was returned.
  32958. func (c *TargetPoolsAddInstanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  32959. gensupport.SetOptions(c.urlParams_, opts...)
  32960. res, err := c.doRequest("json")
  32961. if res != nil && res.StatusCode == http.StatusNotModified {
  32962. if res.Body != nil {
  32963. res.Body.Close()
  32964. }
  32965. return nil, &googleapi.Error{
  32966. Code: res.StatusCode,
  32967. Header: res.Header,
  32968. }
  32969. }
  32970. if err != nil {
  32971. return nil, err
  32972. }
  32973. defer googleapi.CloseBody(res)
  32974. if err := googleapi.CheckResponse(res); err != nil {
  32975. return nil, err
  32976. }
  32977. ret := &Operation{
  32978. ServerResponse: googleapi.ServerResponse{
  32979. Header: res.Header,
  32980. HTTPStatusCode: res.StatusCode,
  32981. },
  32982. }
  32983. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  32984. return nil, err
  32985. }
  32986. return ret, nil
  32987. // {
  32988. // "description": "Adds instance URL to targetPool.",
  32989. // "httpMethod": "POST",
  32990. // "id": "compute.targetPools.addInstance",
  32991. // "parameterOrder": [
  32992. // "project",
  32993. // "region",
  32994. // "targetPool"
  32995. // ],
  32996. // "parameters": {
  32997. // "project": {
  32998. // "location": "path",
  32999. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33000. // "required": true,
  33001. // "type": "string"
  33002. // },
  33003. // "region": {
  33004. // "description": "Name of the region scoping this request.",
  33005. // "location": "path",
  33006. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33007. // "required": true,
  33008. // "type": "string"
  33009. // },
  33010. // "targetPool": {
  33011. // "description": "Name of the TargetPool resource to which instance_url is to be added.",
  33012. // "location": "path",
  33013. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33014. // "required": true,
  33015. // "type": "string"
  33016. // }
  33017. // },
  33018. // "path": "{project}/regions/{region}/targetPools/{targetPool}/addInstance",
  33019. // "request": {
  33020. // "$ref": "TargetPoolsAddInstanceRequest"
  33021. // },
  33022. // "response": {
  33023. // "$ref": "Operation"
  33024. // },
  33025. // "scopes": [
  33026. // "https://www.googleapis.com/auth/cloud-platform",
  33027. // "https://www.googleapis.com/auth/compute"
  33028. // ]
  33029. // }
  33030. }
  33031. // method id "compute.targetPools.aggregatedList":
  33032. type TargetPoolsAggregatedListCall struct {
  33033. s *Service
  33034. project string
  33035. urlParams_ gensupport.URLParams
  33036. ifNoneMatch_ string
  33037. ctx_ context.Context
  33038. }
  33039. // AggregatedList: Retrieves an aggregated list of target pools.
  33040. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/aggregatedList
  33041. func (r *TargetPoolsService) AggregatedList(project string) *TargetPoolsAggregatedListCall {
  33042. c := &TargetPoolsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33043. c.project = project
  33044. return c
  33045. }
  33046. // Filter sets the optional parameter "filter": Sets a filter expression
  33047. // for filtering listed resources, in the form filter={expression}. Your
  33048. // {expression} must be in the format: field_name comparison_string
  33049. // literal_string.
  33050. //
  33051. // The field_name is the name of the field you want to compare. Only
  33052. // atomic field types are supported (string, number, boolean). The
  33053. // comparison_string must be either eq (equals) or ne (not equals). The
  33054. // literal_string is the string value to filter to. The literal value
  33055. // must be valid for the type of field you are filtering by (string,
  33056. // number, boolean). For string fields, the literal value is interpreted
  33057. // as a regular expression using RE2 syntax. The literal value must
  33058. // match the entire field.
  33059. //
  33060. // For example, filter=name ne example-instance.
  33061. //
  33062. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  33063. // you can also filter on nested fields. For example, you could filter
  33064. // on instances that have set the scheduling.automaticRestart field to
  33065. // true. In particular, use filtering on nested fields to take advantage
  33066. // of instance labels to organize and filter results based on label
  33067. // values.
  33068. //
  33069. // The Beta API also supports filtering on multiple expressions by
  33070. // providing each separate expression within parentheses. For example,
  33071. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  33072. // Multiple expressions are treated as AND expressions meaning that
  33073. // resources must match all expressions to pass the filters.
  33074. func (c *TargetPoolsAggregatedListCall) Filter(filter string) *TargetPoolsAggregatedListCall {
  33075. c.urlParams_.Set("filter", filter)
  33076. return c
  33077. }
  33078. // MaxResults sets the optional parameter "maxResults": The maximum
  33079. // number of results per page that Compute Engine should return. If the
  33080. // number of available results is larger than maxResults, Compute Engine
  33081. // returns a nextPageToken that can be used to get the next page of
  33082. // results in subsequent list requests.
  33083. func (c *TargetPoolsAggregatedListCall) MaxResults(maxResults int64) *TargetPoolsAggregatedListCall {
  33084. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  33085. return c
  33086. }
  33087. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  33088. // a certain order. By default, results are returned in alphanumerical
  33089. // order based on the resource name.
  33090. //
  33091. // You can also sort results in descending order based on the creation
  33092. // timestamp using orderBy="creationTimestamp desc". This sorts results
  33093. // based on the creationTimestamp field in reverse chronological order
  33094. // (newest result first). Use this to sort resources like operations so
  33095. // that the newest operation is returned first.
  33096. //
  33097. // Currently, only sorting by name or creationTimestamp desc is
  33098. // supported.
  33099. func (c *TargetPoolsAggregatedListCall) OrderBy(orderBy string) *TargetPoolsAggregatedListCall {
  33100. c.urlParams_.Set("orderBy", orderBy)
  33101. return c
  33102. }
  33103. // PageToken sets the optional parameter "pageToken": Specifies a page
  33104. // token to use. Set pageToken to the nextPageToken returned by a
  33105. // previous list request to get the next page of results.
  33106. func (c *TargetPoolsAggregatedListCall) PageToken(pageToken string) *TargetPoolsAggregatedListCall {
  33107. c.urlParams_.Set("pageToken", pageToken)
  33108. return c
  33109. }
  33110. // Fields allows partial responses to be retrieved. See
  33111. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33112. // for more information.
  33113. func (c *TargetPoolsAggregatedListCall) Fields(s ...googleapi.Field) *TargetPoolsAggregatedListCall {
  33114. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33115. return c
  33116. }
  33117. // IfNoneMatch sets the optional parameter which makes the operation
  33118. // fail if the object's ETag matches the given value. This is useful for
  33119. // getting updates only after the object has changed since the last
  33120. // request. Use googleapi.IsNotModified to check whether the response
  33121. // error from Do is the result of In-None-Match.
  33122. func (c *TargetPoolsAggregatedListCall) IfNoneMatch(entityTag string) *TargetPoolsAggregatedListCall {
  33123. c.ifNoneMatch_ = entityTag
  33124. return c
  33125. }
  33126. // Context sets the context to be used in this call's Do method. Any
  33127. // pending HTTP request will be aborted if the provided context is
  33128. // canceled.
  33129. func (c *TargetPoolsAggregatedListCall) Context(ctx context.Context) *TargetPoolsAggregatedListCall {
  33130. c.ctx_ = ctx
  33131. return c
  33132. }
  33133. func (c *TargetPoolsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  33134. var body io.Reader = nil
  33135. c.urlParams_.Set("alt", alt)
  33136. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetPools")
  33137. urls += "?" + c.urlParams_.Encode()
  33138. req, _ := http.NewRequest("GET", urls, body)
  33139. googleapi.Expand(req.URL, map[string]string{
  33140. "project": c.project,
  33141. })
  33142. req.Header.Set("User-Agent", c.s.userAgent())
  33143. if c.ifNoneMatch_ != "" {
  33144. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  33145. }
  33146. if c.ctx_ != nil {
  33147. return ctxhttp.Do(c.ctx_, c.s.client, req)
  33148. }
  33149. return c.s.client.Do(req)
  33150. }
  33151. // Do executes the "compute.targetPools.aggregatedList" call.
  33152. // Exactly one of *TargetPoolAggregatedList or error will be non-nil.
  33153. // Any non-2xx status code is an error. Response headers are in either
  33154. // *TargetPoolAggregatedList.ServerResponse.Header or (if a response was
  33155. // returned at all) in error.(*googleapi.Error).Header. Use
  33156. // googleapi.IsNotModified to check whether the returned error was
  33157. // because http.StatusNotModified was returned.
  33158. func (c *TargetPoolsAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetPoolAggregatedList, error) {
  33159. gensupport.SetOptions(c.urlParams_, opts...)
  33160. res, err := c.doRequest("json")
  33161. if res != nil && res.StatusCode == http.StatusNotModified {
  33162. if res.Body != nil {
  33163. res.Body.Close()
  33164. }
  33165. return nil, &googleapi.Error{
  33166. Code: res.StatusCode,
  33167. Header: res.Header,
  33168. }
  33169. }
  33170. if err != nil {
  33171. return nil, err
  33172. }
  33173. defer googleapi.CloseBody(res)
  33174. if err := googleapi.CheckResponse(res); err != nil {
  33175. return nil, err
  33176. }
  33177. ret := &TargetPoolAggregatedList{
  33178. ServerResponse: googleapi.ServerResponse{
  33179. Header: res.Header,
  33180. HTTPStatusCode: res.StatusCode,
  33181. },
  33182. }
  33183. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  33184. return nil, err
  33185. }
  33186. return ret, nil
  33187. // {
  33188. // "description": "Retrieves an aggregated list of target pools.",
  33189. // "httpMethod": "GET",
  33190. // "id": "compute.targetPools.aggregatedList",
  33191. // "parameterOrder": [
  33192. // "project"
  33193. // ],
  33194. // "parameters": {
  33195. // "filter": {
  33196. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  33197. // "location": "query",
  33198. // "type": "string"
  33199. // },
  33200. // "maxResults": {
  33201. // "default": "500",
  33202. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  33203. // "format": "uint32",
  33204. // "location": "query",
  33205. // "maximum": "500",
  33206. // "minimum": "0",
  33207. // "type": "integer"
  33208. // },
  33209. // "orderBy": {
  33210. // "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.",
  33211. // "location": "query",
  33212. // "type": "string"
  33213. // },
  33214. // "pageToken": {
  33215. // "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.",
  33216. // "location": "query",
  33217. // "type": "string"
  33218. // },
  33219. // "project": {
  33220. // "description": "Project ID for this request.",
  33221. // "location": "path",
  33222. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33223. // "required": true,
  33224. // "type": "string"
  33225. // }
  33226. // },
  33227. // "path": "{project}/aggregated/targetPools",
  33228. // "response": {
  33229. // "$ref": "TargetPoolAggregatedList"
  33230. // },
  33231. // "scopes": [
  33232. // "https://www.googleapis.com/auth/cloud-platform",
  33233. // "https://www.googleapis.com/auth/compute",
  33234. // "https://www.googleapis.com/auth/compute.readonly"
  33235. // ]
  33236. // }
  33237. }
  33238. // Pages invokes f for each page of results.
  33239. // A non-nil error returned from f will halt the iteration.
  33240. // The provided context supersedes any context provided to the Context method.
  33241. func (c *TargetPoolsAggregatedListCall) Pages(ctx context.Context, f func(*TargetPoolAggregatedList) error) error {
  33242. c.ctx_ = ctx
  33243. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  33244. for {
  33245. x, err := c.Do()
  33246. if err != nil {
  33247. return err
  33248. }
  33249. if err := f(x); err != nil {
  33250. return err
  33251. }
  33252. if x.NextPageToken == "" {
  33253. return nil
  33254. }
  33255. c.PageToken(x.NextPageToken)
  33256. }
  33257. }
  33258. // method id "compute.targetPools.delete":
  33259. type TargetPoolsDeleteCall struct {
  33260. s *Service
  33261. project string
  33262. region string
  33263. targetPool string
  33264. urlParams_ gensupport.URLParams
  33265. ctx_ context.Context
  33266. }
  33267. // Delete: Deletes the specified TargetPool resource.
  33268. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/delete
  33269. func (r *TargetPoolsService) Delete(project string, region string, targetPool string) *TargetPoolsDeleteCall {
  33270. c := &TargetPoolsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33271. c.project = project
  33272. c.region = region
  33273. c.targetPool = targetPool
  33274. return c
  33275. }
  33276. // Fields allows partial responses to be retrieved. See
  33277. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33278. // for more information.
  33279. func (c *TargetPoolsDeleteCall) Fields(s ...googleapi.Field) *TargetPoolsDeleteCall {
  33280. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33281. return c
  33282. }
  33283. // Context sets the context to be used in this call's Do method. Any
  33284. // pending HTTP request will be aborted if the provided context is
  33285. // canceled.
  33286. func (c *TargetPoolsDeleteCall) Context(ctx context.Context) *TargetPoolsDeleteCall {
  33287. c.ctx_ = ctx
  33288. return c
  33289. }
  33290. func (c *TargetPoolsDeleteCall) doRequest(alt string) (*http.Response, error) {
  33291. var body io.Reader = nil
  33292. c.urlParams_.Set("alt", alt)
  33293. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}")
  33294. urls += "?" + c.urlParams_.Encode()
  33295. req, _ := http.NewRequest("DELETE", urls, body)
  33296. googleapi.Expand(req.URL, map[string]string{
  33297. "project": c.project,
  33298. "region": c.region,
  33299. "targetPool": c.targetPool,
  33300. })
  33301. req.Header.Set("User-Agent", c.s.userAgent())
  33302. if c.ctx_ != nil {
  33303. return ctxhttp.Do(c.ctx_, c.s.client, req)
  33304. }
  33305. return c.s.client.Do(req)
  33306. }
  33307. // Do executes the "compute.targetPools.delete" call.
  33308. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  33309. // status code is an error. Response headers are in either
  33310. // *Operation.ServerResponse.Header or (if a response was returned at
  33311. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  33312. // to check whether the returned error was because
  33313. // http.StatusNotModified was returned.
  33314. func (c *TargetPoolsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  33315. gensupport.SetOptions(c.urlParams_, opts...)
  33316. res, err := c.doRequest("json")
  33317. if res != nil && res.StatusCode == http.StatusNotModified {
  33318. if res.Body != nil {
  33319. res.Body.Close()
  33320. }
  33321. return nil, &googleapi.Error{
  33322. Code: res.StatusCode,
  33323. Header: res.Header,
  33324. }
  33325. }
  33326. if err != nil {
  33327. return nil, err
  33328. }
  33329. defer googleapi.CloseBody(res)
  33330. if err := googleapi.CheckResponse(res); err != nil {
  33331. return nil, err
  33332. }
  33333. ret := &Operation{
  33334. ServerResponse: googleapi.ServerResponse{
  33335. Header: res.Header,
  33336. HTTPStatusCode: res.StatusCode,
  33337. },
  33338. }
  33339. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  33340. return nil, err
  33341. }
  33342. return ret, nil
  33343. // {
  33344. // "description": "Deletes the specified TargetPool resource.",
  33345. // "httpMethod": "DELETE",
  33346. // "id": "compute.targetPools.delete",
  33347. // "parameterOrder": [
  33348. // "project",
  33349. // "region",
  33350. // "targetPool"
  33351. // ],
  33352. // "parameters": {
  33353. // "project": {
  33354. // "description": "Project ID for this request.",
  33355. // "location": "path",
  33356. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33357. // "required": true,
  33358. // "type": "string"
  33359. // },
  33360. // "region": {
  33361. // "description": "Name of the region scoping this request.",
  33362. // "location": "path",
  33363. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33364. // "required": true,
  33365. // "type": "string"
  33366. // },
  33367. // "targetPool": {
  33368. // "description": "Name of the TargetPool resource to delete.",
  33369. // "location": "path",
  33370. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33371. // "required": true,
  33372. // "type": "string"
  33373. // }
  33374. // },
  33375. // "path": "{project}/regions/{region}/targetPools/{targetPool}",
  33376. // "response": {
  33377. // "$ref": "Operation"
  33378. // },
  33379. // "scopes": [
  33380. // "https://www.googleapis.com/auth/cloud-platform",
  33381. // "https://www.googleapis.com/auth/compute"
  33382. // ]
  33383. // }
  33384. }
  33385. // method id "compute.targetPools.get":
  33386. type TargetPoolsGetCall struct {
  33387. s *Service
  33388. project string
  33389. region string
  33390. targetPool string
  33391. urlParams_ gensupport.URLParams
  33392. ifNoneMatch_ string
  33393. ctx_ context.Context
  33394. }
  33395. // Get: Returns the specified TargetPool resource.
  33396. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/get
  33397. func (r *TargetPoolsService) Get(project string, region string, targetPool string) *TargetPoolsGetCall {
  33398. c := &TargetPoolsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33399. c.project = project
  33400. c.region = region
  33401. c.targetPool = targetPool
  33402. return c
  33403. }
  33404. // Fields allows partial responses to be retrieved. See
  33405. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33406. // for more information.
  33407. func (c *TargetPoolsGetCall) Fields(s ...googleapi.Field) *TargetPoolsGetCall {
  33408. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33409. return c
  33410. }
  33411. // IfNoneMatch sets the optional parameter which makes the operation
  33412. // fail if the object's ETag matches the given value. This is useful for
  33413. // getting updates only after the object has changed since the last
  33414. // request. Use googleapi.IsNotModified to check whether the response
  33415. // error from Do is the result of In-None-Match.
  33416. func (c *TargetPoolsGetCall) IfNoneMatch(entityTag string) *TargetPoolsGetCall {
  33417. c.ifNoneMatch_ = entityTag
  33418. return c
  33419. }
  33420. // Context sets the context to be used in this call's Do method. Any
  33421. // pending HTTP request will be aborted if the provided context is
  33422. // canceled.
  33423. func (c *TargetPoolsGetCall) Context(ctx context.Context) *TargetPoolsGetCall {
  33424. c.ctx_ = ctx
  33425. return c
  33426. }
  33427. func (c *TargetPoolsGetCall) doRequest(alt string) (*http.Response, error) {
  33428. var body io.Reader = nil
  33429. c.urlParams_.Set("alt", alt)
  33430. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}")
  33431. urls += "?" + c.urlParams_.Encode()
  33432. req, _ := http.NewRequest("GET", urls, body)
  33433. googleapi.Expand(req.URL, map[string]string{
  33434. "project": c.project,
  33435. "region": c.region,
  33436. "targetPool": c.targetPool,
  33437. })
  33438. req.Header.Set("User-Agent", c.s.userAgent())
  33439. if c.ifNoneMatch_ != "" {
  33440. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  33441. }
  33442. if c.ctx_ != nil {
  33443. return ctxhttp.Do(c.ctx_, c.s.client, req)
  33444. }
  33445. return c.s.client.Do(req)
  33446. }
  33447. // Do executes the "compute.targetPools.get" call.
  33448. // Exactly one of *TargetPool or error will be non-nil. Any non-2xx
  33449. // status code is an error. Response headers are in either
  33450. // *TargetPool.ServerResponse.Header or (if a response was returned at
  33451. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  33452. // to check whether the returned error was because
  33453. // http.StatusNotModified was returned.
  33454. func (c *TargetPoolsGetCall) Do(opts ...googleapi.CallOption) (*TargetPool, error) {
  33455. gensupport.SetOptions(c.urlParams_, opts...)
  33456. res, err := c.doRequest("json")
  33457. if res != nil && res.StatusCode == http.StatusNotModified {
  33458. if res.Body != nil {
  33459. res.Body.Close()
  33460. }
  33461. return nil, &googleapi.Error{
  33462. Code: res.StatusCode,
  33463. Header: res.Header,
  33464. }
  33465. }
  33466. if err != nil {
  33467. return nil, err
  33468. }
  33469. defer googleapi.CloseBody(res)
  33470. if err := googleapi.CheckResponse(res); err != nil {
  33471. return nil, err
  33472. }
  33473. ret := &TargetPool{
  33474. ServerResponse: googleapi.ServerResponse{
  33475. Header: res.Header,
  33476. HTTPStatusCode: res.StatusCode,
  33477. },
  33478. }
  33479. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  33480. return nil, err
  33481. }
  33482. return ret, nil
  33483. // {
  33484. // "description": "Returns the specified TargetPool resource.",
  33485. // "httpMethod": "GET",
  33486. // "id": "compute.targetPools.get",
  33487. // "parameterOrder": [
  33488. // "project",
  33489. // "region",
  33490. // "targetPool"
  33491. // ],
  33492. // "parameters": {
  33493. // "project": {
  33494. // "description": "Project ID for this request.",
  33495. // "location": "path",
  33496. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33497. // "required": true,
  33498. // "type": "string"
  33499. // },
  33500. // "region": {
  33501. // "description": "Name of the region scoping this request.",
  33502. // "location": "path",
  33503. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33504. // "required": true,
  33505. // "type": "string"
  33506. // },
  33507. // "targetPool": {
  33508. // "description": "Name of the TargetPool resource to return.",
  33509. // "location": "path",
  33510. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33511. // "required": true,
  33512. // "type": "string"
  33513. // }
  33514. // },
  33515. // "path": "{project}/regions/{region}/targetPools/{targetPool}",
  33516. // "response": {
  33517. // "$ref": "TargetPool"
  33518. // },
  33519. // "scopes": [
  33520. // "https://www.googleapis.com/auth/cloud-platform",
  33521. // "https://www.googleapis.com/auth/compute",
  33522. // "https://www.googleapis.com/auth/compute.readonly"
  33523. // ]
  33524. // }
  33525. }
  33526. // method id "compute.targetPools.getHealth":
  33527. type TargetPoolsGetHealthCall struct {
  33528. s *Service
  33529. project string
  33530. region string
  33531. targetPool string
  33532. instancereference *InstanceReference
  33533. urlParams_ gensupport.URLParams
  33534. ctx_ context.Context
  33535. }
  33536. // GetHealth: Gets the most recent health check results for each IP for
  33537. // the given instance that is referenced by the given TargetPool.
  33538. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/getHealth
  33539. func (r *TargetPoolsService) GetHealth(project string, region string, targetPool string, instancereference *InstanceReference) *TargetPoolsGetHealthCall {
  33540. c := &TargetPoolsGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33541. c.project = project
  33542. c.region = region
  33543. c.targetPool = targetPool
  33544. c.instancereference = instancereference
  33545. return c
  33546. }
  33547. // Fields allows partial responses to be retrieved. See
  33548. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33549. // for more information.
  33550. func (c *TargetPoolsGetHealthCall) Fields(s ...googleapi.Field) *TargetPoolsGetHealthCall {
  33551. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33552. return c
  33553. }
  33554. // Context sets the context to be used in this call's Do method. Any
  33555. // pending HTTP request will be aborted if the provided context is
  33556. // canceled.
  33557. func (c *TargetPoolsGetHealthCall) Context(ctx context.Context) *TargetPoolsGetHealthCall {
  33558. c.ctx_ = ctx
  33559. return c
  33560. }
  33561. func (c *TargetPoolsGetHealthCall) doRequest(alt string) (*http.Response, error) {
  33562. var body io.Reader = nil
  33563. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancereference)
  33564. if err != nil {
  33565. return nil, err
  33566. }
  33567. ctype := "application/json"
  33568. c.urlParams_.Set("alt", alt)
  33569. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/getHealth")
  33570. urls += "?" + c.urlParams_.Encode()
  33571. req, _ := http.NewRequest("POST", urls, body)
  33572. googleapi.Expand(req.URL, map[string]string{
  33573. "project": c.project,
  33574. "region": c.region,
  33575. "targetPool": c.targetPool,
  33576. })
  33577. req.Header.Set("Content-Type", ctype)
  33578. req.Header.Set("User-Agent", c.s.userAgent())
  33579. if c.ctx_ != nil {
  33580. return ctxhttp.Do(c.ctx_, c.s.client, req)
  33581. }
  33582. return c.s.client.Do(req)
  33583. }
  33584. // Do executes the "compute.targetPools.getHealth" call.
  33585. // Exactly one of *TargetPoolInstanceHealth or error will be non-nil.
  33586. // Any non-2xx status code is an error. Response headers are in either
  33587. // *TargetPoolInstanceHealth.ServerResponse.Header or (if a response was
  33588. // returned at all) in error.(*googleapi.Error).Header. Use
  33589. // googleapi.IsNotModified to check whether the returned error was
  33590. // because http.StatusNotModified was returned.
  33591. func (c *TargetPoolsGetHealthCall) Do(opts ...googleapi.CallOption) (*TargetPoolInstanceHealth, error) {
  33592. gensupport.SetOptions(c.urlParams_, opts...)
  33593. res, err := c.doRequest("json")
  33594. if res != nil && res.StatusCode == http.StatusNotModified {
  33595. if res.Body != nil {
  33596. res.Body.Close()
  33597. }
  33598. return nil, &googleapi.Error{
  33599. Code: res.StatusCode,
  33600. Header: res.Header,
  33601. }
  33602. }
  33603. if err != nil {
  33604. return nil, err
  33605. }
  33606. defer googleapi.CloseBody(res)
  33607. if err := googleapi.CheckResponse(res); err != nil {
  33608. return nil, err
  33609. }
  33610. ret := &TargetPoolInstanceHealth{
  33611. ServerResponse: googleapi.ServerResponse{
  33612. Header: res.Header,
  33613. HTTPStatusCode: res.StatusCode,
  33614. },
  33615. }
  33616. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  33617. return nil, err
  33618. }
  33619. return ret, nil
  33620. // {
  33621. // "description": "Gets the most recent health check results for each IP for the given instance that is referenced by the given TargetPool.",
  33622. // "httpMethod": "POST",
  33623. // "id": "compute.targetPools.getHealth",
  33624. // "parameterOrder": [
  33625. // "project",
  33626. // "region",
  33627. // "targetPool"
  33628. // ],
  33629. // "parameters": {
  33630. // "project": {
  33631. // "location": "path",
  33632. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33633. // "required": true,
  33634. // "type": "string"
  33635. // },
  33636. // "region": {
  33637. // "description": "Name of the region scoping this request.",
  33638. // "location": "path",
  33639. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33640. // "required": true,
  33641. // "type": "string"
  33642. // },
  33643. // "targetPool": {
  33644. // "description": "Name of the TargetPool resource to which the queried instance belongs.",
  33645. // "location": "path",
  33646. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33647. // "required": true,
  33648. // "type": "string"
  33649. // }
  33650. // },
  33651. // "path": "{project}/regions/{region}/targetPools/{targetPool}/getHealth",
  33652. // "request": {
  33653. // "$ref": "InstanceReference"
  33654. // },
  33655. // "response": {
  33656. // "$ref": "TargetPoolInstanceHealth"
  33657. // },
  33658. // "scopes": [
  33659. // "https://www.googleapis.com/auth/cloud-platform",
  33660. // "https://www.googleapis.com/auth/compute",
  33661. // "https://www.googleapis.com/auth/compute.readonly"
  33662. // ]
  33663. // }
  33664. }
  33665. // method id "compute.targetPools.insert":
  33666. type TargetPoolsInsertCall struct {
  33667. s *Service
  33668. project string
  33669. region string
  33670. targetpool *TargetPool
  33671. urlParams_ gensupport.URLParams
  33672. ctx_ context.Context
  33673. }
  33674. // Insert: Creates a TargetPool resource in the specified project and
  33675. // region using the data included in the request.
  33676. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/insert
  33677. func (r *TargetPoolsService) Insert(project string, region string, targetpool *TargetPool) *TargetPoolsInsertCall {
  33678. c := &TargetPoolsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33679. c.project = project
  33680. c.region = region
  33681. c.targetpool = targetpool
  33682. return c
  33683. }
  33684. // Fields allows partial responses to be retrieved. See
  33685. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33686. // for more information.
  33687. func (c *TargetPoolsInsertCall) Fields(s ...googleapi.Field) *TargetPoolsInsertCall {
  33688. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33689. return c
  33690. }
  33691. // Context sets the context to be used in this call's Do method. Any
  33692. // pending HTTP request will be aborted if the provided context is
  33693. // canceled.
  33694. func (c *TargetPoolsInsertCall) Context(ctx context.Context) *TargetPoolsInsertCall {
  33695. c.ctx_ = ctx
  33696. return c
  33697. }
  33698. func (c *TargetPoolsInsertCall) doRequest(alt string) (*http.Response, error) {
  33699. var body io.Reader = nil
  33700. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpool)
  33701. if err != nil {
  33702. return nil, err
  33703. }
  33704. ctype := "application/json"
  33705. c.urlParams_.Set("alt", alt)
  33706. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools")
  33707. urls += "?" + c.urlParams_.Encode()
  33708. req, _ := http.NewRequest("POST", urls, body)
  33709. googleapi.Expand(req.URL, map[string]string{
  33710. "project": c.project,
  33711. "region": c.region,
  33712. })
  33713. req.Header.Set("Content-Type", ctype)
  33714. req.Header.Set("User-Agent", c.s.userAgent())
  33715. if c.ctx_ != nil {
  33716. return ctxhttp.Do(c.ctx_, c.s.client, req)
  33717. }
  33718. return c.s.client.Do(req)
  33719. }
  33720. // Do executes the "compute.targetPools.insert" call.
  33721. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  33722. // status code is an error. Response headers are in either
  33723. // *Operation.ServerResponse.Header or (if a response was returned at
  33724. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  33725. // to check whether the returned error was because
  33726. // http.StatusNotModified was returned.
  33727. func (c *TargetPoolsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  33728. gensupport.SetOptions(c.urlParams_, opts...)
  33729. res, err := c.doRequest("json")
  33730. if res != nil && res.StatusCode == http.StatusNotModified {
  33731. if res.Body != nil {
  33732. res.Body.Close()
  33733. }
  33734. return nil, &googleapi.Error{
  33735. Code: res.StatusCode,
  33736. Header: res.Header,
  33737. }
  33738. }
  33739. if err != nil {
  33740. return nil, err
  33741. }
  33742. defer googleapi.CloseBody(res)
  33743. if err := googleapi.CheckResponse(res); err != nil {
  33744. return nil, err
  33745. }
  33746. ret := &Operation{
  33747. ServerResponse: googleapi.ServerResponse{
  33748. Header: res.Header,
  33749. HTTPStatusCode: res.StatusCode,
  33750. },
  33751. }
  33752. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  33753. return nil, err
  33754. }
  33755. return ret, nil
  33756. // {
  33757. // "description": "Creates a TargetPool resource in the specified project and region using the data included in the request.",
  33758. // "httpMethod": "POST",
  33759. // "id": "compute.targetPools.insert",
  33760. // "parameterOrder": [
  33761. // "project",
  33762. // "region"
  33763. // ],
  33764. // "parameters": {
  33765. // "project": {
  33766. // "description": "Project ID for this request.",
  33767. // "location": "path",
  33768. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33769. // "required": true,
  33770. // "type": "string"
  33771. // },
  33772. // "region": {
  33773. // "description": "Name of the region scoping this request.",
  33774. // "location": "path",
  33775. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33776. // "required": true,
  33777. // "type": "string"
  33778. // }
  33779. // },
  33780. // "path": "{project}/regions/{region}/targetPools",
  33781. // "request": {
  33782. // "$ref": "TargetPool"
  33783. // },
  33784. // "response": {
  33785. // "$ref": "Operation"
  33786. // },
  33787. // "scopes": [
  33788. // "https://www.googleapis.com/auth/cloud-platform",
  33789. // "https://www.googleapis.com/auth/compute"
  33790. // ]
  33791. // }
  33792. }
  33793. // method id "compute.targetPools.list":
  33794. type TargetPoolsListCall struct {
  33795. s *Service
  33796. project string
  33797. region string
  33798. urlParams_ gensupport.URLParams
  33799. ifNoneMatch_ string
  33800. ctx_ context.Context
  33801. }
  33802. // List: Retrieves a list of TargetPool resources available to the
  33803. // specified project and region.
  33804. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/list
  33805. func (r *TargetPoolsService) List(project string, region string) *TargetPoolsListCall {
  33806. c := &TargetPoolsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33807. c.project = project
  33808. c.region = region
  33809. return c
  33810. }
  33811. // Filter sets the optional parameter "filter": Sets a filter expression
  33812. // for filtering listed resources, in the form filter={expression}. Your
  33813. // {expression} must be in the format: field_name comparison_string
  33814. // literal_string.
  33815. //
  33816. // The field_name is the name of the field you want to compare. Only
  33817. // atomic field types are supported (string, number, boolean). The
  33818. // comparison_string must be either eq (equals) or ne (not equals). The
  33819. // literal_string is the string value to filter to. The literal value
  33820. // must be valid for the type of field you are filtering by (string,
  33821. // number, boolean). For string fields, the literal value is interpreted
  33822. // as a regular expression using RE2 syntax. The literal value must
  33823. // match the entire field.
  33824. //
  33825. // For example, filter=name ne example-instance.
  33826. //
  33827. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  33828. // you can also filter on nested fields. For example, you could filter
  33829. // on instances that have set the scheduling.automaticRestart field to
  33830. // true. In particular, use filtering on nested fields to take advantage
  33831. // of instance labels to organize and filter results based on label
  33832. // values.
  33833. //
  33834. // The Beta API also supports filtering on multiple expressions by
  33835. // providing each separate expression within parentheses. For example,
  33836. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  33837. // Multiple expressions are treated as AND expressions meaning that
  33838. // resources must match all expressions to pass the filters.
  33839. func (c *TargetPoolsListCall) Filter(filter string) *TargetPoolsListCall {
  33840. c.urlParams_.Set("filter", filter)
  33841. return c
  33842. }
  33843. // MaxResults sets the optional parameter "maxResults": The maximum
  33844. // number of results per page that Compute Engine should return. If the
  33845. // number of available results is larger than maxResults, Compute Engine
  33846. // returns a nextPageToken that can be used to get the next page of
  33847. // results in subsequent list requests.
  33848. func (c *TargetPoolsListCall) MaxResults(maxResults int64) *TargetPoolsListCall {
  33849. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  33850. return c
  33851. }
  33852. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  33853. // a certain order. By default, results are returned in alphanumerical
  33854. // order based on the resource name.
  33855. //
  33856. // You can also sort results in descending order based on the creation
  33857. // timestamp using orderBy="creationTimestamp desc". This sorts results
  33858. // based on the creationTimestamp field in reverse chronological order
  33859. // (newest result first). Use this to sort resources like operations so
  33860. // that the newest operation is returned first.
  33861. //
  33862. // Currently, only sorting by name or creationTimestamp desc is
  33863. // supported.
  33864. func (c *TargetPoolsListCall) OrderBy(orderBy string) *TargetPoolsListCall {
  33865. c.urlParams_.Set("orderBy", orderBy)
  33866. return c
  33867. }
  33868. // PageToken sets the optional parameter "pageToken": Specifies a page
  33869. // token to use. Set pageToken to the nextPageToken returned by a
  33870. // previous list request to get the next page of results.
  33871. func (c *TargetPoolsListCall) PageToken(pageToken string) *TargetPoolsListCall {
  33872. c.urlParams_.Set("pageToken", pageToken)
  33873. return c
  33874. }
  33875. // Fields allows partial responses to be retrieved. See
  33876. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33877. // for more information.
  33878. func (c *TargetPoolsListCall) Fields(s ...googleapi.Field) *TargetPoolsListCall {
  33879. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33880. return c
  33881. }
  33882. // IfNoneMatch sets the optional parameter which makes the operation
  33883. // fail if the object's ETag matches the given value. This is useful for
  33884. // getting updates only after the object has changed since the last
  33885. // request. Use googleapi.IsNotModified to check whether the response
  33886. // error from Do is the result of In-None-Match.
  33887. func (c *TargetPoolsListCall) IfNoneMatch(entityTag string) *TargetPoolsListCall {
  33888. c.ifNoneMatch_ = entityTag
  33889. return c
  33890. }
  33891. // Context sets the context to be used in this call's Do method. Any
  33892. // pending HTTP request will be aborted if the provided context is
  33893. // canceled.
  33894. func (c *TargetPoolsListCall) Context(ctx context.Context) *TargetPoolsListCall {
  33895. c.ctx_ = ctx
  33896. return c
  33897. }
  33898. func (c *TargetPoolsListCall) doRequest(alt string) (*http.Response, error) {
  33899. var body io.Reader = nil
  33900. c.urlParams_.Set("alt", alt)
  33901. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools")
  33902. urls += "?" + c.urlParams_.Encode()
  33903. req, _ := http.NewRequest("GET", urls, body)
  33904. googleapi.Expand(req.URL, map[string]string{
  33905. "project": c.project,
  33906. "region": c.region,
  33907. })
  33908. req.Header.Set("User-Agent", c.s.userAgent())
  33909. if c.ifNoneMatch_ != "" {
  33910. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  33911. }
  33912. if c.ctx_ != nil {
  33913. return ctxhttp.Do(c.ctx_, c.s.client, req)
  33914. }
  33915. return c.s.client.Do(req)
  33916. }
  33917. // Do executes the "compute.targetPools.list" call.
  33918. // Exactly one of *TargetPoolList or error will be non-nil. Any non-2xx
  33919. // status code is an error. Response headers are in either
  33920. // *TargetPoolList.ServerResponse.Header or (if a response was returned
  33921. // at all) in error.(*googleapi.Error).Header. Use
  33922. // googleapi.IsNotModified to check whether the returned error was
  33923. // because http.StatusNotModified was returned.
  33924. func (c *TargetPoolsListCall) Do(opts ...googleapi.CallOption) (*TargetPoolList, 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 := &TargetPoolList{
  33944. ServerResponse: googleapi.ServerResponse{
  33945. Header: res.Header,
  33946. HTTPStatusCode: res.StatusCode,
  33947. },
  33948. }
  33949. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  33950. return nil, err
  33951. }
  33952. return ret, nil
  33953. // {
  33954. // "description": "Retrieves a list of TargetPool resources available to the specified project and region.",
  33955. // "httpMethod": "GET",
  33956. // "id": "compute.targetPools.list",
  33957. // "parameterOrder": [
  33958. // "project",
  33959. // "region"
  33960. // ],
  33961. // "parameters": {
  33962. // "filter": {
  33963. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  33964. // "location": "query",
  33965. // "type": "string"
  33966. // },
  33967. // "maxResults": {
  33968. // "default": "500",
  33969. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  33970. // "format": "uint32",
  33971. // "location": "query",
  33972. // "maximum": "500",
  33973. // "minimum": "0",
  33974. // "type": "integer"
  33975. // },
  33976. // "orderBy": {
  33977. // "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.",
  33978. // "location": "query",
  33979. // "type": "string"
  33980. // },
  33981. // "pageToken": {
  33982. // "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.",
  33983. // "location": "query",
  33984. // "type": "string"
  33985. // },
  33986. // "project": {
  33987. // "description": "Project ID for this request.",
  33988. // "location": "path",
  33989. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33990. // "required": true,
  33991. // "type": "string"
  33992. // },
  33993. // "region": {
  33994. // "description": "Name of the region scoping this request.",
  33995. // "location": "path",
  33996. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33997. // "required": true,
  33998. // "type": "string"
  33999. // }
  34000. // },
  34001. // "path": "{project}/regions/{region}/targetPools",
  34002. // "response": {
  34003. // "$ref": "TargetPoolList"
  34004. // },
  34005. // "scopes": [
  34006. // "https://www.googleapis.com/auth/cloud-platform",
  34007. // "https://www.googleapis.com/auth/compute",
  34008. // "https://www.googleapis.com/auth/compute.readonly"
  34009. // ]
  34010. // }
  34011. }
  34012. // Pages invokes f for each page of results.
  34013. // A non-nil error returned from f will halt the iteration.
  34014. // The provided context supersedes any context provided to the Context method.
  34015. func (c *TargetPoolsListCall) Pages(ctx context.Context, f func(*TargetPoolList) error) error {
  34016. c.ctx_ = ctx
  34017. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  34018. for {
  34019. x, err := c.Do()
  34020. if err != nil {
  34021. return err
  34022. }
  34023. if err := f(x); err != nil {
  34024. return err
  34025. }
  34026. if x.NextPageToken == "" {
  34027. return nil
  34028. }
  34029. c.PageToken(x.NextPageToken)
  34030. }
  34031. }
  34032. // method id "compute.targetPools.removeHealthCheck":
  34033. type TargetPoolsRemoveHealthCheckCall struct {
  34034. s *Service
  34035. project string
  34036. region string
  34037. targetPool string
  34038. targetpoolsremovehealthcheckrequest *TargetPoolsRemoveHealthCheckRequest
  34039. urlParams_ gensupport.URLParams
  34040. ctx_ context.Context
  34041. }
  34042. // RemoveHealthCheck: Removes health check URL from targetPool.
  34043. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/removeHealthCheck
  34044. func (r *TargetPoolsService) RemoveHealthCheck(project string, region string, targetPool string, targetpoolsremovehealthcheckrequest *TargetPoolsRemoveHealthCheckRequest) *TargetPoolsRemoveHealthCheckCall {
  34045. c := &TargetPoolsRemoveHealthCheckCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34046. c.project = project
  34047. c.region = region
  34048. c.targetPool = targetPool
  34049. c.targetpoolsremovehealthcheckrequest = targetpoolsremovehealthcheckrequest
  34050. return c
  34051. }
  34052. // Fields allows partial responses to be retrieved. See
  34053. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34054. // for more information.
  34055. func (c *TargetPoolsRemoveHealthCheckCall) Fields(s ...googleapi.Field) *TargetPoolsRemoveHealthCheckCall {
  34056. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34057. return c
  34058. }
  34059. // Context sets the context to be used in this call's Do method. Any
  34060. // pending HTTP request will be aborted if the provided context is
  34061. // canceled.
  34062. func (c *TargetPoolsRemoveHealthCheckCall) Context(ctx context.Context) *TargetPoolsRemoveHealthCheckCall {
  34063. c.ctx_ = ctx
  34064. return c
  34065. }
  34066. func (c *TargetPoolsRemoveHealthCheckCall) doRequest(alt string) (*http.Response, error) {
  34067. var body io.Reader = nil
  34068. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsremovehealthcheckrequest)
  34069. if err != nil {
  34070. return nil, err
  34071. }
  34072. ctype := "application/json"
  34073. c.urlParams_.Set("alt", alt)
  34074. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck")
  34075. urls += "?" + c.urlParams_.Encode()
  34076. req, _ := http.NewRequest("POST", urls, body)
  34077. googleapi.Expand(req.URL, map[string]string{
  34078. "project": c.project,
  34079. "region": c.region,
  34080. "targetPool": c.targetPool,
  34081. })
  34082. req.Header.Set("Content-Type", ctype)
  34083. req.Header.Set("User-Agent", c.s.userAgent())
  34084. if c.ctx_ != nil {
  34085. return ctxhttp.Do(c.ctx_, c.s.client, req)
  34086. }
  34087. return c.s.client.Do(req)
  34088. }
  34089. // Do executes the "compute.targetPools.removeHealthCheck" call.
  34090. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  34091. // status code is an error. Response headers are in either
  34092. // *Operation.ServerResponse.Header or (if a response was returned at
  34093. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  34094. // to check whether the returned error was because
  34095. // http.StatusNotModified was returned.
  34096. func (c *TargetPoolsRemoveHealthCheckCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  34097. gensupport.SetOptions(c.urlParams_, opts...)
  34098. res, err := c.doRequest("json")
  34099. if res != nil && res.StatusCode == http.StatusNotModified {
  34100. if res.Body != nil {
  34101. res.Body.Close()
  34102. }
  34103. return nil, &googleapi.Error{
  34104. Code: res.StatusCode,
  34105. Header: res.Header,
  34106. }
  34107. }
  34108. if err != nil {
  34109. return nil, err
  34110. }
  34111. defer googleapi.CloseBody(res)
  34112. if err := googleapi.CheckResponse(res); err != nil {
  34113. return nil, err
  34114. }
  34115. ret := &Operation{
  34116. ServerResponse: googleapi.ServerResponse{
  34117. Header: res.Header,
  34118. HTTPStatusCode: res.StatusCode,
  34119. },
  34120. }
  34121. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  34122. return nil, err
  34123. }
  34124. return ret, nil
  34125. // {
  34126. // "description": "Removes health check URL from targetPool.",
  34127. // "httpMethod": "POST",
  34128. // "id": "compute.targetPools.removeHealthCheck",
  34129. // "parameterOrder": [
  34130. // "project",
  34131. // "region",
  34132. // "targetPool"
  34133. // ],
  34134. // "parameters": {
  34135. // "project": {
  34136. // "location": "path",
  34137. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34138. // "required": true,
  34139. // "type": "string"
  34140. // },
  34141. // "region": {
  34142. // "description": "Name of the region scoping this request.",
  34143. // "location": "path",
  34144. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34145. // "required": true,
  34146. // "type": "string"
  34147. // },
  34148. // "targetPool": {
  34149. // "description": "Name of the TargetPool resource to which health_check_url is to be removed.",
  34150. // "location": "path",
  34151. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34152. // "required": true,
  34153. // "type": "string"
  34154. // }
  34155. // },
  34156. // "path": "{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck",
  34157. // "request": {
  34158. // "$ref": "TargetPoolsRemoveHealthCheckRequest"
  34159. // },
  34160. // "response": {
  34161. // "$ref": "Operation"
  34162. // },
  34163. // "scopes": [
  34164. // "https://www.googleapis.com/auth/cloud-platform",
  34165. // "https://www.googleapis.com/auth/compute"
  34166. // ]
  34167. // }
  34168. }
  34169. // method id "compute.targetPools.removeInstance":
  34170. type TargetPoolsRemoveInstanceCall struct {
  34171. s *Service
  34172. project string
  34173. region string
  34174. targetPool string
  34175. targetpoolsremoveinstancerequest *TargetPoolsRemoveInstanceRequest
  34176. urlParams_ gensupport.URLParams
  34177. ctx_ context.Context
  34178. }
  34179. // RemoveInstance: Removes instance URL from targetPool.
  34180. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/removeInstance
  34181. func (r *TargetPoolsService) RemoveInstance(project string, region string, targetPool string, targetpoolsremoveinstancerequest *TargetPoolsRemoveInstanceRequest) *TargetPoolsRemoveInstanceCall {
  34182. c := &TargetPoolsRemoveInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34183. c.project = project
  34184. c.region = region
  34185. c.targetPool = targetPool
  34186. c.targetpoolsremoveinstancerequest = targetpoolsremoveinstancerequest
  34187. return c
  34188. }
  34189. // Fields allows partial responses to be retrieved. See
  34190. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34191. // for more information.
  34192. func (c *TargetPoolsRemoveInstanceCall) Fields(s ...googleapi.Field) *TargetPoolsRemoveInstanceCall {
  34193. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34194. return c
  34195. }
  34196. // Context sets the context to be used in this call's Do method. Any
  34197. // pending HTTP request will be aborted if the provided context is
  34198. // canceled.
  34199. func (c *TargetPoolsRemoveInstanceCall) Context(ctx context.Context) *TargetPoolsRemoveInstanceCall {
  34200. c.ctx_ = ctx
  34201. return c
  34202. }
  34203. func (c *TargetPoolsRemoveInstanceCall) doRequest(alt string) (*http.Response, error) {
  34204. var body io.Reader = nil
  34205. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsremoveinstancerequest)
  34206. if err != nil {
  34207. return nil, err
  34208. }
  34209. ctype := "application/json"
  34210. c.urlParams_.Set("alt", alt)
  34211. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/removeInstance")
  34212. urls += "?" + c.urlParams_.Encode()
  34213. req, _ := http.NewRequest("POST", urls, body)
  34214. googleapi.Expand(req.URL, map[string]string{
  34215. "project": c.project,
  34216. "region": c.region,
  34217. "targetPool": c.targetPool,
  34218. })
  34219. req.Header.Set("Content-Type", ctype)
  34220. req.Header.Set("User-Agent", c.s.userAgent())
  34221. if c.ctx_ != nil {
  34222. return ctxhttp.Do(c.ctx_, c.s.client, req)
  34223. }
  34224. return c.s.client.Do(req)
  34225. }
  34226. // Do executes the "compute.targetPools.removeInstance" call.
  34227. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  34228. // status code is an error. Response headers are in either
  34229. // *Operation.ServerResponse.Header or (if a response was returned at
  34230. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  34231. // to check whether the returned error was because
  34232. // http.StatusNotModified was returned.
  34233. func (c *TargetPoolsRemoveInstanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  34234. gensupport.SetOptions(c.urlParams_, opts...)
  34235. res, err := c.doRequest("json")
  34236. if res != nil && res.StatusCode == http.StatusNotModified {
  34237. if res.Body != nil {
  34238. res.Body.Close()
  34239. }
  34240. return nil, &googleapi.Error{
  34241. Code: res.StatusCode,
  34242. Header: res.Header,
  34243. }
  34244. }
  34245. if err != nil {
  34246. return nil, err
  34247. }
  34248. defer googleapi.CloseBody(res)
  34249. if err := googleapi.CheckResponse(res); err != nil {
  34250. return nil, err
  34251. }
  34252. ret := &Operation{
  34253. ServerResponse: googleapi.ServerResponse{
  34254. Header: res.Header,
  34255. HTTPStatusCode: res.StatusCode,
  34256. },
  34257. }
  34258. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  34259. return nil, err
  34260. }
  34261. return ret, nil
  34262. // {
  34263. // "description": "Removes instance URL from targetPool.",
  34264. // "httpMethod": "POST",
  34265. // "id": "compute.targetPools.removeInstance",
  34266. // "parameterOrder": [
  34267. // "project",
  34268. // "region",
  34269. // "targetPool"
  34270. // ],
  34271. // "parameters": {
  34272. // "project": {
  34273. // "location": "path",
  34274. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34275. // "required": true,
  34276. // "type": "string"
  34277. // },
  34278. // "region": {
  34279. // "description": "Name of the region scoping this request.",
  34280. // "location": "path",
  34281. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34282. // "required": true,
  34283. // "type": "string"
  34284. // },
  34285. // "targetPool": {
  34286. // "description": "Name of the TargetPool resource to which instance_url is to be removed.",
  34287. // "location": "path",
  34288. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34289. // "required": true,
  34290. // "type": "string"
  34291. // }
  34292. // },
  34293. // "path": "{project}/regions/{region}/targetPools/{targetPool}/removeInstance",
  34294. // "request": {
  34295. // "$ref": "TargetPoolsRemoveInstanceRequest"
  34296. // },
  34297. // "response": {
  34298. // "$ref": "Operation"
  34299. // },
  34300. // "scopes": [
  34301. // "https://www.googleapis.com/auth/cloud-platform",
  34302. // "https://www.googleapis.com/auth/compute"
  34303. // ]
  34304. // }
  34305. }
  34306. // method id "compute.targetPools.setBackup":
  34307. type TargetPoolsSetBackupCall struct {
  34308. s *Service
  34309. project string
  34310. region string
  34311. targetPool string
  34312. targetreference *TargetReference
  34313. urlParams_ gensupport.URLParams
  34314. ctx_ context.Context
  34315. }
  34316. // SetBackup: Changes backup pool configurations.
  34317. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/setBackup
  34318. func (r *TargetPoolsService) SetBackup(project string, region string, targetPool string, targetreference *TargetReference) *TargetPoolsSetBackupCall {
  34319. c := &TargetPoolsSetBackupCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34320. c.project = project
  34321. c.region = region
  34322. c.targetPool = targetPool
  34323. c.targetreference = targetreference
  34324. return c
  34325. }
  34326. // FailoverRatio sets the optional parameter "failoverRatio": New
  34327. // failoverRatio value for the containing target pool.
  34328. func (c *TargetPoolsSetBackupCall) FailoverRatio(failoverRatio float64) *TargetPoolsSetBackupCall {
  34329. c.urlParams_.Set("failoverRatio", fmt.Sprint(failoverRatio))
  34330. return c
  34331. }
  34332. // Fields allows partial responses to be retrieved. See
  34333. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34334. // for more information.
  34335. func (c *TargetPoolsSetBackupCall) Fields(s ...googleapi.Field) *TargetPoolsSetBackupCall {
  34336. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34337. return c
  34338. }
  34339. // Context sets the context to be used in this call's Do method. Any
  34340. // pending HTTP request will be aborted if the provided context is
  34341. // canceled.
  34342. func (c *TargetPoolsSetBackupCall) Context(ctx context.Context) *TargetPoolsSetBackupCall {
  34343. c.ctx_ = ctx
  34344. return c
  34345. }
  34346. func (c *TargetPoolsSetBackupCall) doRequest(alt string) (*http.Response, error) {
  34347. var body io.Reader = nil
  34348. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference)
  34349. if err != nil {
  34350. return nil, err
  34351. }
  34352. ctype := "application/json"
  34353. c.urlParams_.Set("alt", alt)
  34354. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/setBackup")
  34355. urls += "?" + c.urlParams_.Encode()
  34356. req, _ := http.NewRequest("POST", urls, body)
  34357. googleapi.Expand(req.URL, map[string]string{
  34358. "project": c.project,
  34359. "region": c.region,
  34360. "targetPool": c.targetPool,
  34361. })
  34362. req.Header.Set("Content-Type", ctype)
  34363. req.Header.Set("User-Agent", c.s.userAgent())
  34364. if c.ctx_ != nil {
  34365. return ctxhttp.Do(c.ctx_, c.s.client, req)
  34366. }
  34367. return c.s.client.Do(req)
  34368. }
  34369. // Do executes the "compute.targetPools.setBackup" call.
  34370. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  34371. // status code is an error. Response headers are in either
  34372. // *Operation.ServerResponse.Header or (if a response was returned at
  34373. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  34374. // to check whether the returned error was because
  34375. // http.StatusNotModified was returned.
  34376. func (c *TargetPoolsSetBackupCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  34377. gensupport.SetOptions(c.urlParams_, opts...)
  34378. res, err := c.doRequest("json")
  34379. if res != nil && res.StatusCode == http.StatusNotModified {
  34380. if res.Body != nil {
  34381. res.Body.Close()
  34382. }
  34383. return nil, &googleapi.Error{
  34384. Code: res.StatusCode,
  34385. Header: res.Header,
  34386. }
  34387. }
  34388. if err != nil {
  34389. return nil, err
  34390. }
  34391. defer googleapi.CloseBody(res)
  34392. if err := googleapi.CheckResponse(res); err != nil {
  34393. return nil, err
  34394. }
  34395. ret := &Operation{
  34396. ServerResponse: googleapi.ServerResponse{
  34397. Header: res.Header,
  34398. HTTPStatusCode: res.StatusCode,
  34399. },
  34400. }
  34401. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  34402. return nil, err
  34403. }
  34404. return ret, nil
  34405. // {
  34406. // "description": "Changes backup pool configurations.",
  34407. // "httpMethod": "POST",
  34408. // "id": "compute.targetPools.setBackup",
  34409. // "parameterOrder": [
  34410. // "project",
  34411. // "region",
  34412. // "targetPool"
  34413. // ],
  34414. // "parameters": {
  34415. // "failoverRatio": {
  34416. // "description": "New failoverRatio value for the containing target pool.",
  34417. // "format": "float",
  34418. // "location": "query",
  34419. // "type": "number"
  34420. // },
  34421. // "project": {
  34422. // "description": "Project ID for this request.",
  34423. // "location": "path",
  34424. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34425. // "required": true,
  34426. // "type": "string"
  34427. // },
  34428. // "region": {
  34429. // "description": "Name of the region scoping this request.",
  34430. // "location": "path",
  34431. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34432. // "required": true,
  34433. // "type": "string"
  34434. // },
  34435. // "targetPool": {
  34436. // "description": "Name of the TargetPool resource for which the backup is to be set.",
  34437. // "location": "path",
  34438. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34439. // "required": true,
  34440. // "type": "string"
  34441. // }
  34442. // },
  34443. // "path": "{project}/regions/{region}/targetPools/{targetPool}/setBackup",
  34444. // "request": {
  34445. // "$ref": "TargetReference"
  34446. // },
  34447. // "response": {
  34448. // "$ref": "Operation"
  34449. // },
  34450. // "scopes": [
  34451. // "https://www.googleapis.com/auth/cloud-platform",
  34452. // "https://www.googleapis.com/auth/compute"
  34453. // ]
  34454. // }
  34455. }
  34456. // method id "compute.targetVpnGateways.aggregatedList":
  34457. type TargetVpnGatewaysAggregatedListCall struct {
  34458. s *Service
  34459. project string
  34460. urlParams_ gensupport.URLParams
  34461. ifNoneMatch_ string
  34462. ctx_ context.Context
  34463. }
  34464. // AggregatedList: Retrieves an aggregated list of target VPN gateways .
  34465. func (r *TargetVpnGatewaysService) AggregatedList(project string) *TargetVpnGatewaysAggregatedListCall {
  34466. c := &TargetVpnGatewaysAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34467. c.project = project
  34468. return c
  34469. }
  34470. // Filter sets the optional parameter "filter": Sets a filter expression
  34471. // for filtering listed resources, in the form filter={expression}. Your
  34472. // {expression} must be in the format: field_name comparison_string
  34473. // literal_string.
  34474. //
  34475. // The field_name is the name of the field you want to compare. Only
  34476. // atomic field types are supported (string, number, boolean). The
  34477. // comparison_string must be either eq (equals) or ne (not equals). The
  34478. // literal_string is the string value to filter to. The literal value
  34479. // must be valid for the type of field you are filtering by (string,
  34480. // number, boolean). For string fields, the literal value is interpreted
  34481. // as a regular expression using RE2 syntax. The literal value must
  34482. // match the entire field.
  34483. //
  34484. // For example, filter=name ne example-instance.
  34485. //
  34486. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  34487. // you can also filter on nested fields. For example, you could filter
  34488. // on instances that have set the scheduling.automaticRestart field to
  34489. // true. In particular, use filtering on nested fields to take advantage
  34490. // of instance labels to organize and filter results based on label
  34491. // values.
  34492. //
  34493. // The Beta API also supports filtering on multiple expressions by
  34494. // providing each separate expression within parentheses. For example,
  34495. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  34496. // Multiple expressions are treated as AND expressions meaning that
  34497. // resources must match all expressions to pass the filters.
  34498. func (c *TargetVpnGatewaysAggregatedListCall) Filter(filter string) *TargetVpnGatewaysAggregatedListCall {
  34499. c.urlParams_.Set("filter", filter)
  34500. return c
  34501. }
  34502. // MaxResults sets the optional parameter "maxResults": The maximum
  34503. // number of results per page that Compute Engine should return. If the
  34504. // number of available results is larger than maxResults, Compute Engine
  34505. // returns a nextPageToken that can be used to get the next page of
  34506. // results in subsequent list requests.
  34507. func (c *TargetVpnGatewaysAggregatedListCall) MaxResults(maxResults int64) *TargetVpnGatewaysAggregatedListCall {
  34508. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  34509. return c
  34510. }
  34511. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  34512. // a certain order. By default, results are returned in alphanumerical
  34513. // order based on the resource name.
  34514. //
  34515. // You can also sort results in descending order based on the creation
  34516. // timestamp using orderBy="creationTimestamp desc". This sorts results
  34517. // based on the creationTimestamp field in reverse chronological order
  34518. // (newest result first). Use this to sort resources like operations so
  34519. // that the newest operation is returned first.
  34520. //
  34521. // Currently, only sorting by name or creationTimestamp desc is
  34522. // supported.
  34523. func (c *TargetVpnGatewaysAggregatedListCall) OrderBy(orderBy string) *TargetVpnGatewaysAggregatedListCall {
  34524. c.urlParams_.Set("orderBy", orderBy)
  34525. return c
  34526. }
  34527. // PageToken sets the optional parameter "pageToken": Specifies a page
  34528. // token to use. Set pageToken to the nextPageToken returned by a
  34529. // previous list request to get the next page of results.
  34530. func (c *TargetVpnGatewaysAggregatedListCall) PageToken(pageToken string) *TargetVpnGatewaysAggregatedListCall {
  34531. c.urlParams_.Set("pageToken", pageToken)
  34532. return c
  34533. }
  34534. // Fields allows partial responses to be retrieved. See
  34535. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34536. // for more information.
  34537. func (c *TargetVpnGatewaysAggregatedListCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysAggregatedListCall {
  34538. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34539. return c
  34540. }
  34541. // IfNoneMatch sets the optional parameter which makes the operation
  34542. // fail if the object's ETag matches the given value. This is useful for
  34543. // getting updates only after the object has changed since the last
  34544. // request. Use googleapi.IsNotModified to check whether the response
  34545. // error from Do is the result of In-None-Match.
  34546. func (c *TargetVpnGatewaysAggregatedListCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysAggregatedListCall {
  34547. c.ifNoneMatch_ = entityTag
  34548. return c
  34549. }
  34550. // Context sets the context to be used in this call's Do method. Any
  34551. // pending HTTP request will be aborted if the provided context is
  34552. // canceled.
  34553. func (c *TargetVpnGatewaysAggregatedListCall) Context(ctx context.Context) *TargetVpnGatewaysAggregatedListCall {
  34554. c.ctx_ = ctx
  34555. return c
  34556. }
  34557. func (c *TargetVpnGatewaysAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  34558. var body io.Reader = nil
  34559. c.urlParams_.Set("alt", alt)
  34560. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetVpnGateways")
  34561. urls += "?" + c.urlParams_.Encode()
  34562. req, _ := http.NewRequest("GET", urls, body)
  34563. googleapi.Expand(req.URL, map[string]string{
  34564. "project": c.project,
  34565. })
  34566. req.Header.Set("User-Agent", c.s.userAgent())
  34567. if c.ifNoneMatch_ != "" {
  34568. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  34569. }
  34570. if c.ctx_ != nil {
  34571. return ctxhttp.Do(c.ctx_, c.s.client, req)
  34572. }
  34573. return c.s.client.Do(req)
  34574. }
  34575. // Do executes the "compute.targetVpnGateways.aggregatedList" call.
  34576. // Exactly one of *TargetVpnGatewayAggregatedList or error will be
  34577. // non-nil. Any non-2xx status code is an error. Response headers are in
  34578. // either *TargetVpnGatewayAggregatedList.ServerResponse.Header or (if a
  34579. // response was returned at all) in error.(*googleapi.Error).Header. Use
  34580. // googleapi.IsNotModified to check whether the returned error was
  34581. // because http.StatusNotModified was returned.
  34582. func (c *TargetVpnGatewaysAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetVpnGatewayAggregatedList, error) {
  34583. gensupport.SetOptions(c.urlParams_, opts...)
  34584. res, err := c.doRequest("json")
  34585. if res != nil && res.StatusCode == http.StatusNotModified {
  34586. if res.Body != nil {
  34587. res.Body.Close()
  34588. }
  34589. return nil, &googleapi.Error{
  34590. Code: res.StatusCode,
  34591. Header: res.Header,
  34592. }
  34593. }
  34594. if err != nil {
  34595. return nil, err
  34596. }
  34597. defer googleapi.CloseBody(res)
  34598. if err := googleapi.CheckResponse(res); err != nil {
  34599. return nil, err
  34600. }
  34601. ret := &TargetVpnGatewayAggregatedList{
  34602. ServerResponse: googleapi.ServerResponse{
  34603. Header: res.Header,
  34604. HTTPStatusCode: res.StatusCode,
  34605. },
  34606. }
  34607. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  34608. return nil, err
  34609. }
  34610. return ret, nil
  34611. // {
  34612. // "description": "Retrieves an aggregated list of target VPN gateways .",
  34613. // "httpMethod": "GET",
  34614. // "id": "compute.targetVpnGateways.aggregatedList",
  34615. // "parameterOrder": [
  34616. // "project"
  34617. // ],
  34618. // "parameters": {
  34619. // "filter": {
  34620. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  34621. // "location": "query",
  34622. // "type": "string"
  34623. // },
  34624. // "maxResults": {
  34625. // "default": "500",
  34626. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  34627. // "format": "uint32",
  34628. // "location": "query",
  34629. // "maximum": "500",
  34630. // "minimum": "0",
  34631. // "type": "integer"
  34632. // },
  34633. // "orderBy": {
  34634. // "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.",
  34635. // "location": "query",
  34636. // "type": "string"
  34637. // },
  34638. // "pageToken": {
  34639. // "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.",
  34640. // "location": "query",
  34641. // "type": "string"
  34642. // },
  34643. // "project": {
  34644. // "description": "Project ID for this request.",
  34645. // "location": "path",
  34646. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34647. // "required": true,
  34648. // "type": "string"
  34649. // }
  34650. // },
  34651. // "path": "{project}/aggregated/targetVpnGateways",
  34652. // "response": {
  34653. // "$ref": "TargetVpnGatewayAggregatedList"
  34654. // },
  34655. // "scopes": [
  34656. // "https://www.googleapis.com/auth/cloud-platform",
  34657. // "https://www.googleapis.com/auth/compute",
  34658. // "https://www.googleapis.com/auth/compute.readonly"
  34659. // ]
  34660. // }
  34661. }
  34662. // Pages invokes f for each page of results.
  34663. // A non-nil error returned from f will halt the iteration.
  34664. // The provided context supersedes any context provided to the Context method.
  34665. func (c *TargetVpnGatewaysAggregatedListCall) Pages(ctx context.Context, f func(*TargetVpnGatewayAggregatedList) error) error {
  34666. c.ctx_ = ctx
  34667. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  34668. for {
  34669. x, err := c.Do()
  34670. if err != nil {
  34671. return err
  34672. }
  34673. if err := f(x); err != nil {
  34674. return err
  34675. }
  34676. if x.NextPageToken == "" {
  34677. return nil
  34678. }
  34679. c.PageToken(x.NextPageToken)
  34680. }
  34681. }
  34682. // method id "compute.targetVpnGateways.delete":
  34683. type TargetVpnGatewaysDeleteCall struct {
  34684. s *Service
  34685. project string
  34686. region string
  34687. targetVpnGateway string
  34688. urlParams_ gensupport.URLParams
  34689. ctx_ context.Context
  34690. }
  34691. // Delete: Deletes the specified TargetVpnGateway resource.
  34692. func (r *TargetVpnGatewaysService) Delete(project string, region string, targetVpnGateway string) *TargetVpnGatewaysDeleteCall {
  34693. c := &TargetVpnGatewaysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34694. c.project = project
  34695. c.region = region
  34696. c.targetVpnGateway = targetVpnGateway
  34697. return c
  34698. }
  34699. // Fields allows partial responses to be retrieved. See
  34700. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34701. // for more information.
  34702. func (c *TargetVpnGatewaysDeleteCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysDeleteCall {
  34703. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34704. return c
  34705. }
  34706. // Context sets the context to be used in this call's Do method. Any
  34707. // pending HTTP request will be aborted if the provided context is
  34708. // canceled.
  34709. func (c *TargetVpnGatewaysDeleteCall) Context(ctx context.Context) *TargetVpnGatewaysDeleteCall {
  34710. c.ctx_ = ctx
  34711. return c
  34712. }
  34713. func (c *TargetVpnGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) {
  34714. var body io.Reader = nil
  34715. c.urlParams_.Set("alt", alt)
  34716. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}")
  34717. urls += "?" + c.urlParams_.Encode()
  34718. req, _ := http.NewRequest("DELETE", urls, body)
  34719. googleapi.Expand(req.URL, map[string]string{
  34720. "project": c.project,
  34721. "region": c.region,
  34722. "targetVpnGateway": c.targetVpnGateway,
  34723. })
  34724. req.Header.Set("User-Agent", c.s.userAgent())
  34725. if c.ctx_ != nil {
  34726. return ctxhttp.Do(c.ctx_, c.s.client, req)
  34727. }
  34728. return c.s.client.Do(req)
  34729. }
  34730. // Do executes the "compute.targetVpnGateways.delete" call.
  34731. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  34732. // status code is an error. Response headers are in either
  34733. // *Operation.ServerResponse.Header or (if a response was returned at
  34734. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  34735. // to check whether the returned error was because
  34736. // http.StatusNotModified was returned.
  34737. func (c *TargetVpnGatewaysDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  34738. gensupport.SetOptions(c.urlParams_, opts...)
  34739. res, err := c.doRequest("json")
  34740. if res != nil && res.StatusCode == http.StatusNotModified {
  34741. if res.Body != nil {
  34742. res.Body.Close()
  34743. }
  34744. return nil, &googleapi.Error{
  34745. Code: res.StatusCode,
  34746. Header: res.Header,
  34747. }
  34748. }
  34749. if err != nil {
  34750. return nil, err
  34751. }
  34752. defer googleapi.CloseBody(res)
  34753. if err := googleapi.CheckResponse(res); err != nil {
  34754. return nil, err
  34755. }
  34756. ret := &Operation{
  34757. ServerResponse: googleapi.ServerResponse{
  34758. Header: res.Header,
  34759. HTTPStatusCode: res.StatusCode,
  34760. },
  34761. }
  34762. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  34763. return nil, err
  34764. }
  34765. return ret, nil
  34766. // {
  34767. // "description": "Deletes the specified TargetVpnGateway resource.",
  34768. // "httpMethod": "DELETE",
  34769. // "id": "compute.targetVpnGateways.delete",
  34770. // "parameterOrder": [
  34771. // "project",
  34772. // "region",
  34773. // "targetVpnGateway"
  34774. // ],
  34775. // "parameters": {
  34776. // "project": {
  34777. // "description": "Project ID for this request.",
  34778. // "location": "path",
  34779. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34780. // "required": true,
  34781. // "type": "string"
  34782. // },
  34783. // "region": {
  34784. // "description": "The name of the region for this request.",
  34785. // "location": "path",
  34786. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34787. // "required": true,
  34788. // "type": "string"
  34789. // },
  34790. // "targetVpnGateway": {
  34791. // "description": "Name of the TargetVpnGateway resource to delete.",
  34792. // "location": "path",
  34793. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34794. // "required": true,
  34795. // "type": "string"
  34796. // }
  34797. // },
  34798. // "path": "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}",
  34799. // "response": {
  34800. // "$ref": "Operation"
  34801. // },
  34802. // "scopes": [
  34803. // "https://www.googleapis.com/auth/cloud-platform",
  34804. // "https://www.googleapis.com/auth/compute"
  34805. // ]
  34806. // }
  34807. }
  34808. // method id "compute.targetVpnGateways.get":
  34809. type TargetVpnGatewaysGetCall struct {
  34810. s *Service
  34811. project string
  34812. region string
  34813. targetVpnGateway string
  34814. urlParams_ gensupport.URLParams
  34815. ifNoneMatch_ string
  34816. ctx_ context.Context
  34817. }
  34818. // Get: Returns the specified TargetVpnGateway resource.
  34819. func (r *TargetVpnGatewaysService) Get(project string, region string, targetVpnGateway string) *TargetVpnGatewaysGetCall {
  34820. c := &TargetVpnGatewaysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34821. c.project = project
  34822. c.region = region
  34823. c.targetVpnGateway = targetVpnGateway
  34824. return c
  34825. }
  34826. // Fields allows partial responses to be retrieved. See
  34827. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34828. // for more information.
  34829. func (c *TargetVpnGatewaysGetCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysGetCall {
  34830. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34831. return c
  34832. }
  34833. // IfNoneMatch sets the optional parameter which makes the operation
  34834. // fail if the object's ETag matches the given value. This is useful for
  34835. // getting updates only after the object has changed since the last
  34836. // request. Use googleapi.IsNotModified to check whether the response
  34837. // error from Do is the result of In-None-Match.
  34838. func (c *TargetVpnGatewaysGetCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysGetCall {
  34839. c.ifNoneMatch_ = entityTag
  34840. return c
  34841. }
  34842. // Context sets the context to be used in this call's Do method. Any
  34843. // pending HTTP request will be aborted if the provided context is
  34844. // canceled.
  34845. func (c *TargetVpnGatewaysGetCall) Context(ctx context.Context) *TargetVpnGatewaysGetCall {
  34846. c.ctx_ = ctx
  34847. return c
  34848. }
  34849. func (c *TargetVpnGatewaysGetCall) doRequest(alt string) (*http.Response, error) {
  34850. var body io.Reader = nil
  34851. c.urlParams_.Set("alt", alt)
  34852. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}")
  34853. urls += "?" + c.urlParams_.Encode()
  34854. req, _ := http.NewRequest("GET", urls, body)
  34855. googleapi.Expand(req.URL, map[string]string{
  34856. "project": c.project,
  34857. "region": c.region,
  34858. "targetVpnGateway": c.targetVpnGateway,
  34859. })
  34860. req.Header.Set("User-Agent", c.s.userAgent())
  34861. if c.ifNoneMatch_ != "" {
  34862. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  34863. }
  34864. if c.ctx_ != nil {
  34865. return ctxhttp.Do(c.ctx_, c.s.client, req)
  34866. }
  34867. return c.s.client.Do(req)
  34868. }
  34869. // Do executes the "compute.targetVpnGateways.get" call.
  34870. // Exactly one of *TargetVpnGateway or error will be non-nil. Any
  34871. // non-2xx status code is an error. Response headers are in either
  34872. // *TargetVpnGateway.ServerResponse.Header or (if a response was
  34873. // returned at all) in error.(*googleapi.Error).Header. Use
  34874. // googleapi.IsNotModified to check whether the returned error was
  34875. // because http.StatusNotModified was returned.
  34876. func (c *TargetVpnGatewaysGetCall) Do(opts ...googleapi.CallOption) (*TargetVpnGateway, error) {
  34877. gensupport.SetOptions(c.urlParams_, opts...)
  34878. res, err := c.doRequest("json")
  34879. if res != nil && res.StatusCode == http.StatusNotModified {
  34880. if res.Body != nil {
  34881. res.Body.Close()
  34882. }
  34883. return nil, &googleapi.Error{
  34884. Code: res.StatusCode,
  34885. Header: res.Header,
  34886. }
  34887. }
  34888. if err != nil {
  34889. return nil, err
  34890. }
  34891. defer googleapi.CloseBody(res)
  34892. if err := googleapi.CheckResponse(res); err != nil {
  34893. return nil, err
  34894. }
  34895. ret := &TargetVpnGateway{
  34896. ServerResponse: googleapi.ServerResponse{
  34897. Header: res.Header,
  34898. HTTPStatusCode: res.StatusCode,
  34899. },
  34900. }
  34901. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  34902. return nil, err
  34903. }
  34904. return ret, nil
  34905. // {
  34906. // "description": "Returns the specified TargetVpnGateway resource.",
  34907. // "httpMethod": "GET",
  34908. // "id": "compute.targetVpnGateways.get",
  34909. // "parameterOrder": [
  34910. // "project",
  34911. // "region",
  34912. // "targetVpnGateway"
  34913. // ],
  34914. // "parameters": {
  34915. // "project": {
  34916. // "description": "Project ID for this request.",
  34917. // "location": "path",
  34918. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34919. // "required": true,
  34920. // "type": "string"
  34921. // },
  34922. // "region": {
  34923. // "description": "The name of the region for this request.",
  34924. // "location": "path",
  34925. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34926. // "required": true,
  34927. // "type": "string"
  34928. // },
  34929. // "targetVpnGateway": {
  34930. // "description": "Name of the TargetVpnGateway resource to return.",
  34931. // "location": "path",
  34932. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34933. // "required": true,
  34934. // "type": "string"
  34935. // }
  34936. // },
  34937. // "path": "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}",
  34938. // "response": {
  34939. // "$ref": "TargetVpnGateway"
  34940. // },
  34941. // "scopes": [
  34942. // "https://www.googleapis.com/auth/cloud-platform",
  34943. // "https://www.googleapis.com/auth/compute",
  34944. // "https://www.googleapis.com/auth/compute.readonly"
  34945. // ]
  34946. // }
  34947. }
  34948. // method id "compute.targetVpnGateways.insert":
  34949. type TargetVpnGatewaysInsertCall struct {
  34950. s *Service
  34951. project string
  34952. region string
  34953. targetvpngateway *TargetVpnGateway
  34954. urlParams_ gensupport.URLParams
  34955. ctx_ context.Context
  34956. }
  34957. // Insert: Creates a TargetVpnGateway resource in the specified project
  34958. // and region using the data included in the request.
  34959. func (r *TargetVpnGatewaysService) Insert(project string, region string, targetvpngateway *TargetVpnGateway) *TargetVpnGatewaysInsertCall {
  34960. c := &TargetVpnGatewaysInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34961. c.project = project
  34962. c.region = region
  34963. c.targetvpngateway = targetvpngateway
  34964. return c
  34965. }
  34966. // Fields allows partial responses to be retrieved. See
  34967. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34968. // for more information.
  34969. func (c *TargetVpnGatewaysInsertCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysInsertCall {
  34970. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34971. return c
  34972. }
  34973. // Context sets the context to be used in this call's Do method. Any
  34974. // pending HTTP request will be aborted if the provided context is
  34975. // canceled.
  34976. func (c *TargetVpnGatewaysInsertCall) Context(ctx context.Context) *TargetVpnGatewaysInsertCall {
  34977. c.ctx_ = ctx
  34978. return c
  34979. }
  34980. func (c *TargetVpnGatewaysInsertCall) doRequest(alt string) (*http.Response, error) {
  34981. var body io.Reader = nil
  34982. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetvpngateway)
  34983. if err != nil {
  34984. return nil, err
  34985. }
  34986. ctype := "application/json"
  34987. c.urlParams_.Set("alt", alt)
  34988. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways")
  34989. urls += "?" + c.urlParams_.Encode()
  34990. req, _ := http.NewRequest("POST", urls, body)
  34991. googleapi.Expand(req.URL, map[string]string{
  34992. "project": c.project,
  34993. "region": c.region,
  34994. })
  34995. req.Header.Set("Content-Type", ctype)
  34996. req.Header.Set("User-Agent", c.s.userAgent())
  34997. if c.ctx_ != nil {
  34998. return ctxhttp.Do(c.ctx_, c.s.client, req)
  34999. }
  35000. return c.s.client.Do(req)
  35001. }
  35002. // Do executes the "compute.targetVpnGateways.insert" call.
  35003. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  35004. // status code is an error. Response headers are in either
  35005. // *Operation.ServerResponse.Header or (if a response was returned at
  35006. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35007. // to check whether the returned error was because
  35008. // http.StatusNotModified was returned.
  35009. func (c *TargetVpnGatewaysInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  35010. gensupport.SetOptions(c.urlParams_, opts...)
  35011. res, err := c.doRequest("json")
  35012. if res != nil && res.StatusCode == http.StatusNotModified {
  35013. if res.Body != nil {
  35014. res.Body.Close()
  35015. }
  35016. return nil, &googleapi.Error{
  35017. Code: res.StatusCode,
  35018. Header: res.Header,
  35019. }
  35020. }
  35021. if err != nil {
  35022. return nil, err
  35023. }
  35024. defer googleapi.CloseBody(res)
  35025. if err := googleapi.CheckResponse(res); err != nil {
  35026. return nil, err
  35027. }
  35028. ret := &Operation{
  35029. ServerResponse: googleapi.ServerResponse{
  35030. Header: res.Header,
  35031. HTTPStatusCode: res.StatusCode,
  35032. },
  35033. }
  35034. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  35035. return nil, err
  35036. }
  35037. return ret, nil
  35038. // {
  35039. // "description": "Creates a TargetVpnGateway resource in the specified project and region using the data included in the request.",
  35040. // "httpMethod": "POST",
  35041. // "id": "compute.targetVpnGateways.insert",
  35042. // "parameterOrder": [
  35043. // "project",
  35044. // "region"
  35045. // ],
  35046. // "parameters": {
  35047. // "project": {
  35048. // "description": "Project ID for this request.",
  35049. // "location": "path",
  35050. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35051. // "required": true,
  35052. // "type": "string"
  35053. // },
  35054. // "region": {
  35055. // "description": "The name of the region for this request.",
  35056. // "location": "path",
  35057. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  35058. // "required": true,
  35059. // "type": "string"
  35060. // }
  35061. // },
  35062. // "path": "{project}/regions/{region}/targetVpnGateways",
  35063. // "request": {
  35064. // "$ref": "TargetVpnGateway"
  35065. // },
  35066. // "response": {
  35067. // "$ref": "Operation"
  35068. // },
  35069. // "scopes": [
  35070. // "https://www.googleapis.com/auth/cloud-platform",
  35071. // "https://www.googleapis.com/auth/compute"
  35072. // ]
  35073. // }
  35074. }
  35075. // method id "compute.targetVpnGateways.list":
  35076. type TargetVpnGatewaysListCall struct {
  35077. s *Service
  35078. project string
  35079. region string
  35080. urlParams_ gensupport.URLParams
  35081. ifNoneMatch_ string
  35082. ctx_ context.Context
  35083. }
  35084. // List: Retrieves a list of TargetVpnGateway resources available to the
  35085. // specified project and region.
  35086. func (r *TargetVpnGatewaysService) List(project string, region string) *TargetVpnGatewaysListCall {
  35087. c := &TargetVpnGatewaysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35088. c.project = project
  35089. c.region = region
  35090. return c
  35091. }
  35092. // Filter sets the optional parameter "filter": Sets a filter expression
  35093. // for filtering listed resources, in the form filter={expression}. Your
  35094. // {expression} must be in the format: field_name comparison_string
  35095. // literal_string.
  35096. //
  35097. // The field_name is the name of the field you want to compare. Only
  35098. // atomic field types are supported (string, number, boolean). The
  35099. // comparison_string must be either eq (equals) or ne (not equals). The
  35100. // literal_string is the string value to filter to. The literal value
  35101. // must be valid for the type of field you are filtering by (string,
  35102. // number, boolean). For string fields, the literal value is interpreted
  35103. // as a regular expression using RE2 syntax. The literal value must
  35104. // match the entire field.
  35105. //
  35106. // For example, filter=name ne example-instance.
  35107. //
  35108. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  35109. // you can also filter on nested fields. For example, you could filter
  35110. // on instances that have set the scheduling.automaticRestart field to
  35111. // true. In particular, use filtering on nested fields to take advantage
  35112. // of instance labels to organize and filter results based on label
  35113. // values.
  35114. //
  35115. // The Beta API also supports filtering on multiple expressions by
  35116. // providing each separate expression within parentheses. For example,
  35117. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  35118. // Multiple expressions are treated as AND expressions meaning that
  35119. // resources must match all expressions to pass the filters.
  35120. func (c *TargetVpnGatewaysListCall) Filter(filter string) *TargetVpnGatewaysListCall {
  35121. c.urlParams_.Set("filter", filter)
  35122. return c
  35123. }
  35124. // MaxResults sets the optional parameter "maxResults": The maximum
  35125. // number of results per page that Compute Engine should return. If the
  35126. // number of available results is larger than maxResults, Compute Engine
  35127. // returns a nextPageToken that can be used to get the next page of
  35128. // results in subsequent list requests.
  35129. func (c *TargetVpnGatewaysListCall) MaxResults(maxResults int64) *TargetVpnGatewaysListCall {
  35130. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  35131. return c
  35132. }
  35133. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  35134. // a certain order. By default, results are returned in alphanumerical
  35135. // order based on the resource name.
  35136. //
  35137. // You can also sort results in descending order based on the creation
  35138. // timestamp using orderBy="creationTimestamp desc". This sorts results
  35139. // based on the creationTimestamp field in reverse chronological order
  35140. // (newest result first). Use this to sort resources like operations so
  35141. // that the newest operation is returned first.
  35142. //
  35143. // Currently, only sorting by name or creationTimestamp desc is
  35144. // supported.
  35145. func (c *TargetVpnGatewaysListCall) OrderBy(orderBy string) *TargetVpnGatewaysListCall {
  35146. c.urlParams_.Set("orderBy", orderBy)
  35147. return c
  35148. }
  35149. // PageToken sets the optional parameter "pageToken": Specifies a page
  35150. // token to use. Set pageToken to the nextPageToken returned by a
  35151. // previous list request to get the next page of results.
  35152. func (c *TargetVpnGatewaysListCall) PageToken(pageToken string) *TargetVpnGatewaysListCall {
  35153. c.urlParams_.Set("pageToken", pageToken)
  35154. return c
  35155. }
  35156. // Fields allows partial responses to be retrieved. See
  35157. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35158. // for more information.
  35159. func (c *TargetVpnGatewaysListCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysListCall {
  35160. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35161. return c
  35162. }
  35163. // IfNoneMatch sets the optional parameter which makes the operation
  35164. // fail if the object's ETag matches the given value. This is useful for
  35165. // getting updates only after the object has changed since the last
  35166. // request. Use googleapi.IsNotModified to check whether the response
  35167. // error from Do is the result of In-None-Match.
  35168. func (c *TargetVpnGatewaysListCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysListCall {
  35169. c.ifNoneMatch_ = entityTag
  35170. return c
  35171. }
  35172. // Context sets the context to be used in this call's Do method. Any
  35173. // pending HTTP request will be aborted if the provided context is
  35174. // canceled.
  35175. func (c *TargetVpnGatewaysListCall) Context(ctx context.Context) *TargetVpnGatewaysListCall {
  35176. c.ctx_ = ctx
  35177. return c
  35178. }
  35179. func (c *TargetVpnGatewaysListCall) doRequest(alt string) (*http.Response, error) {
  35180. var body io.Reader = nil
  35181. c.urlParams_.Set("alt", alt)
  35182. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways")
  35183. urls += "?" + c.urlParams_.Encode()
  35184. req, _ := http.NewRequest("GET", urls, body)
  35185. googleapi.Expand(req.URL, map[string]string{
  35186. "project": c.project,
  35187. "region": c.region,
  35188. })
  35189. req.Header.Set("User-Agent", c.s.userAgent())
  35190. if c.ifNoneMatch_ != "" {
  35191. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  35192. }
  35193. if c.ctx_ != nil {
  35194. return ctxhttp.Do(c.ctx_, c.s.client, req)
  35195. }
  35196. return c.s.client.Do(req)
  35197. }
  35198. // Do executes the "compute.targetVpnGateways.list" call.
  35199. // Exactly one of *TargetVpnGatewayList or error will be non-nil. Any
  35200. // non-2xx status code is an error. Response headers are in either
  35201. // *TargetVpnGatewayList.ServerResponse.Header or (if a response was
  35202. // returned at all) in error.(*googleapi.Error).Header. Use
  35203. // googleapi.IsNotModified to check whether the returned error was
  35204. // because http.StatusNotModified was returned.
  35205. func (c *TargetVpnGatewaysListCall) Do(opts ...googleapi.CallOption) (*TargetVpnGatewayList, error) {
  35206. gensupport.SetOptions(c.urlParams_, opts...)
  35207. res, err := c.doRequest("json")
  35208. if res != nil && res.StatusCode == http.StatusNotModified {
  35209. if res.Body != nil {
  35210. res.Body.Close()
  35211. }
  35212. return nil, &googleapi.Error{
  35213. Code: res.StatusCode,
  35214. Header: res.Header,
  35215. }
  35216. }
  35217. if err != nil {
  35218. return nil, err
  35219. }
  35220. defer googleapi.CloseBody(res)
  35221. if err := googleapi.CheckResponse(res); err != nil {
  35222. return nil, err
  35223. }
  35224. ret := &TargetVpnGatewayList{
  35225. ServerResponse: googleapi.ServerResponse{
  35226. Header: res.Header,
  35227. HTTPStatusCode: res.StatusCode,
  35228. },
  35229. }
  35230. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  35231. return nil, err
  35232. }
  35233. return ret, nil
  35234. // {
  35235. // "description": "Retrieves a list of TargetVpnGateway resources available to the specified project and region.",
  35236. // "httpMethod": "GET",
  35237. // "id": "compute.targetVpnGateways.list",
  35238. // "parameterOrder": [
  35239. // "project",
  35240. // "region"
  35241. // ],
  35242. // "parameters": {
  35243. // "filter": {
  35244. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  35245. // "location": "query",
  35246. // "type": "string"
  35247. // },
  35248. // "maxResults": {
  35249. // "default": "500",
  35250. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  35251. // "format": "uint32",
  35252. // "location": "query",
  35253. // "maximum": "500",
  35254. // "minimum": "0",
  35255. // "type": "integer"
  35256. // },
  35257. // "orderBy": {
  35258. // "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.",
  35259. // "location": "query",
  35260. // "type": "string"
  35261. // },
  35262. // "pageToken": {
  35263. // "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.",
  35264. // "location": "query",
  35265. // "type": "string"
  35266. // },
  35267. // "project": {
  35268. // "description": "Project ID for this request.",
  35269. // "location": "path",
  35270. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35271. // "required": true,
  35272. // "type": "string"
  35273. // },
  35274. // "region": {
  35275. // "description": "The name of the region for this request.",
  35276. // "location": "path",
  35277. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  35278. // "required": true,
  35279. // "type": "string"
  35280. // }
  35281. // },
  35282. // "path": "{project}/regions/{region}/targetVpnGateways",
  35283. // "response": {
  35284. // "$ref": "TargetVpnGatewayList"
  35285. // },
  35286. // "scopes": [
  35287. // "https://www.googleapis.com/auth/cloud-platform",
  35288. // "https://www.googleapis.com/auth/compute",
  35289. // "https://www.googleapis.com/auth/compute.readonly"
  35290. // ]
  35291. // }
  35292. }
  35293. // Pages invokes f for each page of results.
  35294. // A non-nil error returned from f will halt the iteration.
  35295. // The provided context supersedes any context provided to the Context method.
  35296. func (c *TargetVpnGatewaysListCall) Pages(ctx context.Context, f func(*TargetVpnGatewayList) error) error {
  35297. c.ctx_ = ctx
  35298. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  35299. for {
  35300. x, err := c.Do()
  35301. if err != nil {
  35302. return err
  35303. }
  35304. if err := f(x); err != nil {
  35305. return err
  35306. }
  35307. if x.NextPageToken == "" {
  35308. return nil
  35309. }
  35310. c.PageToken(x.NextPageToken)
  35311. }
  35312. }
  35313. // method id "compute.urlMaps.delete":
  35314. type UrlMapsDeleteCall struct {
  35315. s *Service
  35316. project string
  35317. urlMap string
  35318. urlParams_ gensupport.URLParams
  35319. ctx_ context.Context
  35320. }
  35321. // Delete: Deletes the specified UrlMap resource.
  35322. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/delete
  35323. func (r *UrlMapsService) Delete(project string, urlMap string) *UrlMapsDeleteCall {
  35324. c := &UrlMapsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35325. c.project = project
  35326. c.urlMap = urlMap
  35327. return c
  35328. }
  35329. // Fields allows partial responses to be retrieved. See
  35330. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35331. // for more information.
  35332. func (c *UrlMapsDeleteCall) Fields(s ...googleapi.Field) *UrlMapsDeleteCall {
  35333. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35334. return c
  35335. }
  35336. // Context sets the context to be used in this call's Do method. Any
  35337. // pending HTTP request will be aborted if the provided context is
  35338. // canceled.
  35339. func (c *UrlMapsDeleteCall) Context(ctx context.Context) *UrlMapsDeleteCall {
  35340. c.ctx_ = ctx
  35341. return c
  35342. }
  35343. func (c *UrlMapsDeleteCall) doRequest(alt string) (*http.Response, error) {
  35344. var body io.Reader = nil
  35345. c.urlParams_.Set("alt", alt)
  35346. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  35347. urls += "?" + c.urlParams_.Encode()
  35348. req, _ := http.NewRequest("DELETE", urls, body)
  35349. googleapi.Expand(req.URL, map[string]string{
  35350. "project": c.project,
  35351. "urlMap": c.urlMap,
  35352. })
  35353. req.Header.Set("User-Agent", c.s.userAgent())
  35354. if c.ctx_ != nil {
  35355. return ctxhttp.Do(c.ctx_, c.s.client, req)
  35356. }
  35357. return c.s.client.Do(req)
  35358. }
  35359. // Do executes the "compute.urlMaps.delete" call.
  35360. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  35361. // status code is an error. Response headers are in either
  35362. // *Operation.ServerResponse.Header or (if a response was returned at
  35363. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35364. // to check whether the returned error was because
  35365. // http.StatusNotModified was returned.
  35366. func (c *UrlMapsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  35367. gensupport.SetOptions(c.urlParams_, opts...)
  35368. res, err := c.doRequest("json")
  35369. if res != nil && res.StatusCode == http.StatusNotModified {
  35370. if res.Body != nil {
  35371. res.Body.Close()
  35372. }
  35373. return nil, &googleapi.Error{
  35374. Code: res.StatusCode,
  35375. Header: res.Header,
  35376. }
  35377. }
  35378. if err != nil {
  35379. return nil, err
  35380. }
  35381. defer googleapi.CloseBody(res)
  35382. if err := googleapi.CheckResponse(res); err != nil {
  35383. return nil, err
  35384. }
  35385. ret := &Operation{
  35386. ServerResponse: googleapi.ServerResponse{
  35387. Header: res.Header,
  35388. HTTPStatusCode: res.StatusCode,
  35389. },
  35390. }
  35391. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  35392. return nil, err
  35393. }
  35394. return ret, nil
  35395. // {
  35396. // "description": "Deletes the specified UrlMap resource.",
  35397. // "httpMethod": "DELETE",
  35398. // "id": "compute.urlMaps.delete",
  35399. // "parameterOrder": [
  35400. // "project",
  35401. // "urlMap"
  35402. // ],
  35403. // "parameters": {
  35404. // "project": {
  35405. // "description": "Project ID for this request.",
  35406. // "location": "path",
  35407. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35408. // "required": true,
  35409. // "type": "string"
  35410. // },
  35411. // "urlMap": {
  35412. // "description": "Name of the UrlMap resource to delete.",
  35413. // "location": "path",
  35414. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  35415. // "required": true,
  35416. // "type": "string"
  35417. // }
  35418. // },
  35419. // "path": "{project}/global/urlMaps/{urlMap}",
  35420. // "response": {
  35421. // "$ref": "Operation"
  35422. // },
  35423. // "scopes": [
  35424. // "https://www.googleapis.com/auth/cloud-platform",
  35425. // "https://www.googleapis.com/auth/compute"
  35426. // ]
  35427. // }
  35428. }
  35429. // method id "compute.urlMaps.get":
  35430. type UrlMapsGetCall struct {
  35431. s *Service
  35432. project string
  35433. urlMap string
  35434. urlParams_ gensupport.URLParams
  35435. ifNoneMatch_ string
  35436. ctx_ context.Context
  35437. }
  35438. // Get: Returns the specified UrlMap resource.
  35439. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/get
  35440. func (r *UrlMapsService) Get(project string, urlMap string) *UrlMapsGetCall {
  35441. c := &UrlMapsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35442. c.project = project
  35443. c.urlMap = urlMap
  35444. return c
  35445. }
  35446. // Fields allows partial responses to be retrieved. See
  35447. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35448. // for more information.
  35449. func (c *UrlMapsGetCall) Fields(s ...googleapi.Field) *UrlMapsGetCall {
  35450. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35451. return c
  35452. }
  35453. // IfNoneMatch sets the optional parameter which makes the operation
  35454. // fail if the object's ETag matches the given value. This is useful for
  35455. // getting updates only after the object has changed since the last
  35456. // request. Use googleapi.IsNotModified to check whether the response
  35457. // error from Do is the result of In-None-Match.
  35458. func (c *UrlMapsGetCall) IfNoneMatch(entityTag string) *UrlMapsGetCall {
  35459. c.ifNoneMatch_ = entityTag
  35460. return c
  35461. }
  35462. // Context sets the context to be used in this call's Do method. Any
  35463. // pending HTTP request will be aborted if the provided context is
  35464. // canceled.
  35465. func (c *UrlMapsGetCall) Context(ctx context.Context) *UrlMapsGetCall {
  35466. c.ctx_ = ctx
  35467. return c
  35468. }
  35469. func (c *UrlMapsGetCall) doRequest(alt string) (*http.Response, error) {
  35470. var body io.Reader = nil
  35471. c.urlParams_.Set("alt", alt)
  35472. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  35473. urls += "?" + c.urlParams_.Encode()
  35474. req, _ := http.NewRequest("GET", urls, body)
  35475. googleapi.Expand(req.URL, map[string]string{
  35476. "project": c.project,
  35477. "urlMap": c.urlMap,
  35478. })
  35479. req.Header.Set("User-Agent", c.s.userAgent())
  35480. if c.ifNoneMatch_ != "" {
  35481. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  35482. }
  35483. if c.ctx_ != nil {
  35484. return ctxhttp.Do(c.ctx_, c.s.client, req)
  35485. }
  35486. return c.s.client.Do(req)
  35487. }
  35488. // Do executes the "compute.urlMaps.get" call.
  35489. // Exactly one of *UrlMap or error will be non-nil. Any non-2xx status
  35490. // code is an error. Response headers are in either
  35491. // *UrlMap.ServerResponse.Header or (if a response was returned at all)
  35492. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  35493. // check whether the returned error was because http.StatusNotModified
  35494. // was returned.
  35495. func (c *UrlMapsGetCall) Do(opts ...googleapi.CallOption) (*UrlMap, error) {
  35496. gensupport.SetOptions(c.urlParams_, opts...)
  35497. res, err := c.doRequest("json")
  35498. if res != nil && res.StatusCode == http.StatusNotModified {
  35499. if res.Body != nil {
  35500. res.Body.Close()
  35501. }
  35502. return nil, &googleapi.Error{
  35503. Code: res.StatusCode,
  35504. Header: res.Header,
  35505. }
  35506. }
  35507. if err != nil {
  35508. return nil, err
  35509. }
  35510. defer googleapi.CloseBody(res)
  35511. if err := googleapi.CheckResponse(res); err != nil {
  35512. return nil, err
  35513. }
  35514. ret := &UrlMap{
  35515. ServerResponse: googleapi.ServerResponse{
  35516. Header: res.Header,
  35517. HTTPStatusCode: res.StatusCode,
  35518. },
  35519. }
  35520. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  35521. return nil, err
  35522. }
  35523. return ret, nil
  35524. // {
  35525. // "description": "Returns the specified UrlMap resource.",
  35526. // "httpMethod": "GET",
  35527. // "id": "compute.urlMaps.get",
  35528. // "parameterOrder": [
  35529. // "project",
  35530. // "urlMap"
  35531. // ],
  35532. // "parameters": {
  35533. // "project": {
  35534. // "description": "Project ID for this request.",
  35535. // "location": "path",
  35536. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35537. // "required": true,
  35538. // "type": "string"
  35539. // },
  35540. // "urlMap": {
  35541. // "description": "Name of the UrlMap resource to return.",
  35542. // "location": "path",
  35543. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  35544. // "required": true,
  35545. // "type": "string"
  35546. // }
  35547. // },
  35548. // "path": "{project}/global/urlMaps/{urlMap}",
  35549. // "response": {
  35550. // "$ref": "UrlMap"
  35551. // },
  35552. // "scopes": [
  35553. // "https://www.googleapis.com/auth/cloud-platform",
  35554. // "https://www.googleapis.com/auth/compute",
  35555. // "https://www.googleapis.com/auth/compute.readonly"
  35556. // ]
  35557. // }
  35558. }
  35559. // method id "compute.urlMaps.insert":
  35560. type UrlMapsInsertCall struct {
  35561. s *Service
  35562. project string
  35563. urlmap *UrlMap
  35564. urlParams_ gensupport.URLParams
  35565. ctx_ context.Context
  35566. }
  35567. // Insert: Creates a UrlMap resource in the specified project using the
  35568. // data included in the request.
  35569. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/insert
  35570. func (r *UrlMapsService) Insert(project string, urlmap *UrlMap) *UrlMapsInsertCall {
  35571. c := &UrlMapsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35572. c.project = project
  35573. c.urlmap = urlmap
  35574. return c
  35575. }
  35576. // Fields allows partial responses to be retrieved. See
  35577. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35578. // for more information.
  35579. func (c *UrlMapsInsertCall) Fields(s ...googleapi.Field) *UrlMapsInsertCall {
  35580. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35581. return c
  35582. }
  35583. // Context sets the context to be used in this call's Do method. Any
  35584. // pending HTTP request will be aborted if the provided context is
  35585. // canceled.
  35586. func (c *UrlMapsInsertCall) Context(ctx context.Context) *UrlMapsInsertCall {
  35587. c.ctx_ = ctx
  35588. return c
  35589. }
  35590. func (c *UrlMapsInsertCall) doRequest(alt string) (*http.Response, error) {
  35591. var body io.Reader = nil
  35592. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  35593. if err != nil {
  35594. return nil, err
  35595. }
  35596. ctype := "application/json"
  35597. c.urlParams_.Set("alt", alt)
  35598. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps")
  35599. urls += "?" + c.urlParams_.Encode()
  35600. req, _ := http.NewRequest("POST", urls, body)
  35601. googleapi.Expand(req.URL, map[string]string{
  35602. "project": c.project,
  35603. })
  35604. req.Header.Set("Content-Type", ctype)
  35605. req.Header.Set("User-Agent", c.s.userAgent())
  35606. if c.ctx_ != nil {
  35607. return ctxhttp.Do(c.ctx_, c.s.client, req)
  35608. }
  35609. return c.s.client.Do(req)
  35610. }
  35611. // Do executes the "compute.urlMaps.insert" call.
  35612. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  35613. // status code is an error. Response headers are in either
  35614. // *Operation.ServerResponse.Header or (if a response was returned at
  35615. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35616. // to check whether the returned error was because
  35617. // http.StatusNotModified was returned.
  35618. func (c *UrlMapsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  35619. gensupport.SetOptions(c.urlParams_, opts...)
  35620. res, err := c.doRequest("json")
  35621. if res != nil && res.StatusCode == http.StatusNotModified {
  35622. if res.Body != nil {
  35623. res.Body.Close()
  35624. }
  35625. return nil, &googleapi.Error{
  35626. Code: res.StatusCode,
  35627. Header: res.Header,
  35628. }
  35629. }
  35630. if err != nil {
  35631. return nil, err
  35632. }
  35633. defer googleapi.CloseBody(res)
  35634. if err := googleapi.CheckResponse(res); err != nil {
  35635. return nil, err
  35636. }
  35637. ret := &Operation{
  35638. ServerResponse: googleapi.ServerResponse{
  35639. Header: res.Header,
  35640. HTTPStatusCode: res.StatusCode,
  35641. },
  35642. }
  35643. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  35644. return nil, err
  35645. }
  35646. return ret, nil
  35647. // {
  35648. // "description": "Creates a UrlMap resource in the specified project using the data included in the request.",
  35649. // "httpMethod": "POST",
  35650. // "id": "compute.urlMaps.insert",
  35651. // "parameterOrder": [
  35652. // "project"
  35653. // ],
  35654. // "parameters": {
  35655. // "project": {
  35656. // "description": "Project ID for this request.",
  35657. // "location": "path",
  35658. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35659. // "required": true,
  35660. // "type": "string"
  35661. // }
  35662. // },
  35663. // "path": "{project}/global/urlMaps",
  35664. // "request": {
  35665. // "$ref": "UrlMap"
  35666. // },
  35667. // "response": {
  35668. // "$ref": "Operation"
  35669. // },
  35670. // "scopes": [
  35671. // "https://www.googleapis.com/auth/cloud-platform",
  35672. // "https://www.googleapis.com/auth/compute"
  35673. // ]
  35674. // }
  35675. }
  35676. // method id "compute.urlMaps.list":
  35677. type UrlMapsListCall struct {
  35678. s *Service
  35679. project string
  35680. urlParams_ gensupport.URLParams
  35681. ifNoneMatch_ string
  35682. ctx_ context.Context
  35683. }
  35684. // List: Retrieves the list of UrlMap resources available to the
  35685. // specified project.
  35686. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/list
  35687. func (r *UrlMapsService) List(project string) *UrlMapsListCall {
  35688. c := &UrlMapsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35689. c.project = project
  35690. return c
  35691. }
  35692. // Filter sets the optional parameter "filter": Sets a filter expression
  35693. // for filtering listed resources, in the form filter={expression}. Your
  35694. // {expression} must be in the format: field_name comparison_string
  35695. // literal_string.
  35696. //
  35697. // The field_name is the name of the field you want to compare. Only
  35698. // atomic field types are supported (string, number, boolean). The
  35699. // comparison_string must be either eq (equals) or ne (not equals). The
  35700. // literal_string is the string value to filter to. The literal value
  35701. // must be valid for the type of field you are filtering by (string,
  35702. // number, boolean). For string fields, the literal value is interpreted
  35703. // as a regular expression using RE2 syntax. The literal value must
  35704. // match the entire field.
  35705. //
  35706. // For example, filter=name ne example-instance.
  35707. //
  35708. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  35709. // you can also filter on nested fields. For example, you could filter
  35710. // on instances that have set the scheduling.automaticRestart field to
  35711. // true. In particular, use filtering on nested fields to take advantage
  35712. // of instance labels to organize and filter results based on label
  35713. // values.
  35714. //
  35715. // The Beta API also supports filtering on multiple expressions by
  35716. // providing each separate expression within parentheses. For example,
  35717. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  35718. // Multiple expressions are treated as AND expressions meaning that
  35719. // resources must match all expressions to pass the filters.
  35720. func (c *UrlMapsListCall) Filter(filter string) *UrlMapsListCall {
  35721. c.urlParams_.Set("filter", filter)
  35722. return c
  35723. }
  35724. // MaxResults sets the optional parameter "maxResults": The maximum
  35725. // number of results per page that Compute Engine should return. If the
  35726. // number of available results is larger than maxResults, Compute Engine
  35727. // returns a nextPageToken that can be used to get the next page of
  35728. // results in subsequent list requests.
  35729. func (c *UrlMapsListCall) MaxResults(maxResults int64) *UrlMapsListCall {
  35730. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  35731. return c
  35732. }
  35733. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  35734. // a certain order. By default, results are returned in alphanumerical
  35735. // order based on the resource name.
  35736. //
  35737. // You can also sort results in descending order based on the creation
  35738. // timestamp using orderBy="creationTimestamp desc". This sorts results
  35739. // based on the creationTimestamp field in reverse chronological order
  35740. // (newest result first). Use this to sort resources like operations so
  35741. // that the newest operation is returned first.
  35742. //
  35743. // Currently, only sorting by name or creationTimestamp desc is
  35744. // supported.
  35745. func (c *UrlMapsListCall) OrderBy(orderBy string) *UrlMapsListCall {
  35746. c.urlParams_.Set("orderBy", orderBy)
  35747. return c
  35748. }
  35749. // PageToken sets the optional parameter "pageToken": Specifies a page
  35750. // token to use. Set pageToken to the nextPageToken returned by a
  35751. // previous list request to get the next page of results.
  35752. func (c *UrlMapsListCall) PageToken(pageToken string) *UrlMapsListCall {
  35753. c.urlParams_.Set("pageToken", pageToken)
  35754. return c
  35755. }
  35756. // Fields allows partial responses to be retrieved. See
  35757. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35758. // for more information.
  35759. func (c *UrlMapsListCall) Fields(s ...googleapi.Field) *UrlMapsListCall {
  35760. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35761. return c
  35762. }
  35763. // IfNoneMatch sets the optional parameter which makes the operation
  35764. // fail if the object's ETag matches the given value. This is useful for
  35765. // getting updates only after the object has changed since the last
  35766. // request. Use googleapi.IsNotModified to check whether the response
  35767. // error from Do is the result of In-None-Match.
  35768. func (c *UrlMapsListCall) IfNoneMatch(entityTag string) *UrlMapsListCall {
  35769. c.ifNoneMatch_ = entityTag
  35770. return c
  35771. }
  35772. // Context sets the context to be used in this call's Do method. Any
  35773. // pending HTTP request will be aborted if the provided context is
  35774. // canceled.
  35775. func (c *UrlMapsListCall) Context(ctx context.Context) *UrlMapsListCall {
  35776. c.ctx_ = ctx
  35777. return c
  35778. }
  35779. func (c *UrlMapsListCall) doRequest(alt string) (*http.Response, error) {
  35780. var body io.Reader = nil
  35781. c.urlParams_.Set("alt", alt)
  35782. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps")
  35783. urls += "?" + c.urlParams_.Encode()
  35784. req, _ := http.NewRequest("GET", urls, body)
  35785. googleapi.Expand(req.URL, map[string]string{
  35786. "project": c.project,
  35787. })
  35788. req.Header.Set("User-Agent", c.s.userAgent())
  35789. if c.ifNoneMatch_ != "" {
  35790. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  35791. }
  35792. if c.ctx_ != nil {
  35793. return ctxhttp.Do(c.ctx_, c.s.client, req)
  35794. }
  35795. return c.s.client.Do(req)
  35796. }
  35797. // Do executes the "compute.urlMaps.list" call.
  35798. // Exactly one of *UrlMapList or error will be non-nil. Any non-2xx
  35799. // status code is an error. Response headers are in either
  35800. // *UrlMapList.ServerResponse.Header or (if a response was returned at
  35801. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35802. // to check whether the returned error was because
  35803. // http.StatusNotModified was returned.
  35804. func (c *UrlMapsListCall) Do(opts ...googleapi.CallOption) (*UrlMapList, error) {
  35805. gensupport.SetOptions(c.urlParams_, opts...)
  35806. res, err := c.doRequest("json")
  35807. if res != nil && res.StatusCode == http.StatusNotModified {
  35808. if res.Body != nil {
  35809. res.Body.Close()
  35810. }
  35811. return nil, &googleapi.Error{
  35812. Code: res.StatusCode,
  35813. Header: res.Header,
  35814. }
  35815. }
  35816. if err != nil {
  35817. return nil, err
  35818. }
  35819. defer googleapi.CloseBody(res)
  35820. if err := googleapi.CheckResponse(res); err != nil {
  35821. return nil, err
  35822. }
  35823. ret := &UrlMapList{
  35824. ServerResponse: googleapi.ServerResponse{
  35825. Header: res.Header,
  35826. HTTPStatusCode: res.StatusCode,
  35827. },
  35828. }
  35829. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  35830. return nil, err
  35831. }
  35832. return ret, nil
  35833. // {
  35834. // "description": "Retrieves the list of UrlMap resources available to the specified project.",
  35835. // "httpMethod": "GET",
  35836. // "id": "compute.urlMaps.list",
  35837. // "parameterOrder": [
  35838. // "project"
  35839. // ],
  35840. // "parameters": {
  35841. // "filter": {
  35842. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  35843. // "location": "query",
  35844. // "type": "string"
  35845. // },
  35846. // "maxResults": {
  35847. // "default": "500",
  35848. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  35849. // "format": "uint32",
  35850. // "location": "query",
  35851. // "maximum": "500",
  35852. // "minimum": "0",
  35853. // "type": "integer"
  35854. // },
  35855. // "orderBy": {
  35856. // "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.",
  35857. // "location": "query",
  35858. // "type": "string"
  35859. // },
  35860. // "pageToken": {
  35861. // "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.",
  35862. // "location": "query",
  35863. // "type": "string"
  35864. // },
  35865. // "project": {
  35866. // "description": "Project ID for this request.",
  35867. // "location": "path",
  35868. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35869. // "required": true,
  35870. // "type": "string"
  35871. // }
  35872. // },
  35873. // "path": "{project}/global/urlMaps",
  35874. // "response": {
  35875. // "$ref": "UrlMapList"
  35876. // },
  35877. // "scopes": [
  35878. // "https://www.googleapis.com/auth/cloud-platform",
  35879. // "https://www.googleapis.com/auth/compute",
  35880. // "https://www.googleapis.com/auth/compute.readonly"
  35881. // ]
  35882. // }
  35883. }
  35884. // Pages invokes f for each page of results.
  35885. // A non-nil error returned from f will halt the iteration.
  35886. // The provided context supersedes any context provided to the Context method.
  35887. func (c *UrlMapsListCall) Pages(ctx context.Context, f func(*UrlMapList) error) error {
  35888. c.ctx_ = ctx
  35889. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  35890. for {
  35891. x, err := c.Do()
  35892. if err != nil {
  35893. return err
  35894. }
  35895. if err := f(x); err != nil {
  35896. return err
  35897. }
  35898. if x.NextPageToken == "" {
  35899. return nil
  35900. }
  35901. c.PageToken(x.NextPageToken)
  35902. }
  35903. }
  35904. // method id "compute.urlMaps.patch":
  35905. type UrlMapsPatchCall struct {
  35906. s *Service
  35907. project string
  35908. urlMap string
  35909. urlmap *UrlMap
  35910. urlParams_ gensupport.URLParams
  35911. ctx_ context.Context
  35912. }
  35913. // Patch: Updates the entire content of the UrlMap resource. This method
  35914. // supports patch semantics.
  35915. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/patch
  35916. func (r *UrlMapsService) Patch(project string, urlMap string, urlmap *UrlMap) *UrlMapsPatchCall {
  35917. c := &UrlMapsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35918. c.project = project
  35919. c.urlMap = urlMap
  35920. c.urlmap = urlmap
  35921. return c
  35922. }
  35923. // Fields allows partial responses to be retrieved. See
  35924. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35925. // for more information.
  35926. func (c *UrlMapsPatchCall) Fields(s ...googleapi.Field) *UrlMapsPatchCall {
  35927. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35928. return c
  35929. }
  35930. // Context sets the context to be used in this call's Do method. Any
  35931. // pending HTTP request will be aborted if the provided context is
  35932. // canceled.
  35933. func (c *UrlMapsPatchCall) Context(ctx context.Context) *UrlMapsPatchCall {
  35934. c.ctx_ = ctx
  35935. return c
  35936. }
  35937. func (c *UrlMapsPatchCall) doRequest(alt string) (*http.Response, error) {
  35938. var body io.Reader = nil
  35939. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  35940. if err != nil {
  35941. return nil, err
  35942. }
  35943. ctype := "application/json"
  35944. c.urlParams_.Set("alt", alt)
  35945. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  35946. urls += "?" + c.urlParams_.Encode()
  35947. req, _ := http.NewRequest("PATCH", urls, body)
  35948. googleapi.Expand(req.URL, map[string]string{
  35949. "project": c.project,
  35950. "urlMap": c.urlMap,
  35951. })
  35952. req.Header.Set("Content-Type", ctype)
  35953. req.Header.Set("User-Agent", c.s.userAgent())
  35954. if c.ctx_ != nil {
  35955. return ctxhttp.Do(c.ctx_, c.s.client, req)
  35956. }
  35957. return c.s.client.Do(req)
  35958. }
  35959. // Do executes the "compute.urlMaps.patch" call.
  35960. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  35961. // status code is an error. Response headers are in either
  35962. // *Operation.ServerResponse.Header or (if a response was returned at
  35963. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35964. // to check whether the returned error was because
  35965. // http.StatusNotModified was returned.
  35966. func (c *UrlMapsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  35967. gensupport.SetOptions(c.urlParams_, opts...)
  35968. res, err := c.doRequest("json")
  35969. if res != nil && res.StatusCode == http.StatusNotModified {
  35970. if res.Body != nil {
  35971. res.Body.Close()
  35972. }
  35973. return nil, &googleapi.Error{
  35974. Code: res.StatusCode,
  35975. Header: res.Header,
  35976. }
  35977. }
  35978. if err != nil {
  35979. return nil, err
  35980. }
  35981. defer googleapi.CloseBody(res)
  35982. if err := googleapi.CheckResponse(res); err != nil {
  35983. return nil, err
  35984. }
  35985. ret := &Operation{
  35986. ServerResponse: googleapi.ServerResponse{
  35987. Header: res.Header,
  35988. HTTPStatusCode: res.StatusCode,
  35989. },
  35990. }
  35991. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  35992. return nil, err
  35993. }
  35994. return ret, nil
  35995. // {
  35996. // "description": "Updates the entire content of the UrlMap resource. This method supports patch semantics.",
  35997. // "httpMethod": "PATCH",
  35998. // "id": "compute.urlMaps.patch",
  35999. // "parameterOrder": [
  36000. // "project",
  36001. // "urlMap"
  36002. // ],
  36003. // "parameters": {
  36004. // "project": {
  36005. // "description": "Project ID for this request.",
  36006. // "location": "path",
  36007. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36008. // "required": true,
  36009. // "type": "string"
  36010. // },
  36011. // "urlMap": {
  36012. // "description": "Name of the UrlMap resource to update.",
  36013. // "location": "path",
  36014. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  36015. // "required": true,
  36016. // "type": "string"
  36017. // }
  36018. // },
  36019. // "path": "{project}/global/urlMaps/{urlMap}",
  36020. // "request": {
  36021. // "$ref": "UrlMap"
  36022. // },
  36023. // "response": {
  36024. // "$ref": "Operation"
  36025. // },
  36026. // "scopes": [
  36027. // "https://www.googleapis.com/auth/cloud-platform",
  36028. // "https://www.googleapis.com/auth/compute"
  36029. // ]
  36030. // }
  36031. }
  36032. // method id "compute.urlMaps.update":
  36033. type UrlMapsUpdateCall struct {
  36034. s *Service
  36035. project string
  36036. urlMap string
  36037. urlmap *UrlMap
  36038. urlParams_ gensupport.URLParams
  36039. ctx_ context.Context
  36040. }
  36041. // Update: Updates the entire content of the UrlMap resource.
  36042. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/update
  36043. func (r *UrlMapsService) Update(project string, urlMap string, urlmap *UrlMap) *UrlMapsUpdateCall {
  36044. c := &UrlMapsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36045. c.project = project
  36046. c.urlMap = urlMap
  36047. c.urlmap = urlmap
  36048. return c
  36049. }
  36050. // Fields allows partial responses to be retrieved. See
  36051. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36052. // for more information.
  36053. func (c *UrlMapsUpdateCall) Fields(s ...googleapi.Field) *UrlMapsUpdateCall {
  36054. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36055. return c
  36056. }
  36057. // Context sets the context to be used in this call's Do method. Any
  36058. // pending HTTP request will be aborted if the provided context is
  36059. // canceled.
  36060. func (c *UrlMapsUpdateCall) Context(ctx context.Context) *UrlMapsUpdateCall {
  36061. c.ctx_ = ctx
  36062. return c
  36063. }
  36064. func (c *UrlMapsUpdateCall) doRequest(alt string) (*http.Response, error) {
  36065. var body io.Reader = nil
  36066. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  36067. if err != nil {
  36068. return nil, err
  36069. }
  36070. ctype := "application/json"
  36071. c.urlParams_.Set("alt", alt)
  36072. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  36073. urls += "?" + c.urlParams_.Encode()
  36074. req, _ := http.NewRequest("PUT", urls, body)
  36075. googleapi.Expand(req.URL, map[string]string{
  36076. "project": c.project,
  36077. "urlMap": c.urlMap,
  36078. })
  36079. req.Header.Set("Content-Type", ctype)
  36080. req.Header.Set("User-Agent", c.s.userAgent())
  36081. if c.ctx_ != nil {
  36082. return ctxhttp.Do(c.ctx_, c.s.client, req)
  36083. }
  36084. return c.s.client.Do(req)
  36085. }
  36086. // Do executes the "compute.urlMaps.update" call.
  36087. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  36088. // status code is an error. Response headers are in either
  36089. // *Operation.ServerResponse.Header or (if a response was returned at
  36090. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36091. // to check whether the returned error was because
  36092. // http.StatusNotModified was returned.
  36093. func (c *UrlMapsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  36094. gensupport.SetOptions(c.urlParams_, opts...)
  36095. res, err := c.doRequest("json")
  36096. if res != nil && res.StatusCode == http.StatusNotModified {
  36097. if res.Body != nil {
  36098. res.Body.Close()
  36099. }
  36100. return nil, &googleapi.Error{
  36101. Code: res.StatusCode,
  36102. Header: res.Header,
  36103. }
  36104. }
  36105. if err != nil {
  36106. return nil, err
  36107. }
  36108. defer googleapi.CloseBody(res)
  36109. if err := googleapi.CheckResponse(res); err != nil {
  36110. return nil, err
  36111. }
  36112. ret := &Operation{
  36113. ServerResponse: googleapi.ServerResponse{
  36114. Header: res.Header,
  36115. HTTPStatusCode: res.StatusCode,
  36116. },
  36117. }
  36118. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  36119. return nil, err
  36120. }
  36121. return ret, nil
  36122. // {
  36123. // "description": "Updates the entire content of the UrlMap resource.",
  36124. // "httpMethod": "PUT",
  36125. // "id": "compute.urlMaps.update",
  36126. // "parameterOrder": [
  36127. // "project",
  36128. // "urlMap"
  36129. // ],
  36130. // "parameters": {
  36131. // "project": {
  36132. // "description": "Project ID for this request.",
  36133. // "location": "path",
  36134. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36135. // "required": true,
  36136. // "type": "string"
  36137. // },
  36138. // "urlMap": {
  36139. // "description": "Name of the UrlMap resource to update.",
  36140. // "location": "path",
  36141. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  36142. // "required": true,
  36143. // "type": "string"
  36144. // }
  36145. // },
  36146. // "path": "{project}/global/urlMaps/{urlMap}",
  36147. // "request": {
  36148. // "$ref": "UrlMap"
  36149. // },
  36150. // "response": {
  36151. // "$ref": "Operation"
  36152. // },
  36153. // "scopes": [
  36154. // "https://www.googleapis.com/auth/cloud-platform",
  36155. // "https://www.googleapis.com/auth/compute"
  36156. // ]
  36157. // }
  36158. }
  36159. // method id "compute.urlMaps.validate":
  36160. type UrlMapsValidateCall struct {
  36161. s *Service
  36162. project string
  36163. urlMap string
  36164. urlmapsvalidaterequest *UrlMapsValidateRequest
  36165. urlParams_ gensupport.URLParams
  36166. ctx_ context.Context
  36167. }
  36168. // Validate: Runs static validation for the UrlMap. In particular, the
  36169. // tests of the provided UrlMap will be run. Calling this method does
  36170. // NOT create the UrlMap.
  36171. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/validate
  36172. func (r *UrlMapsService) Validate(project string, urlMap string, urlmapsvalidaterequest *UrlMapsValidateRequest) *UrlMapsValidateCall {
  36173. c := &UrlMapsValidateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36174. c.project = project
  36175. c.urlMap = urlMap
  36176. c.urlmapsvalidaterequest = urlmapsvalidaterequest
  36177. return c
  36178. }
  36179. // Fields allows partial responses to be retrieved. See
  36180. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36181. // for more information.
  36182. func (c *UrlMapsValidateCall) Fields(s ...googleapi.Field) *UrlMapsValidateCall {
  36183. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36184. return c
  36185. }
  36186. // Context sets the context to be used in this call's Do method. Any
  36187. // pending HTTP request will be aborted if the provided context is
  36188. // canceled.
  36189. func (c *UrlMapsValidateCall) Context(ctx context.Context) *UrlMapsValidateCall {
  36190. c.ctx_ = ctx
  36191. return c
  36192. }
  36193. func (c *UrlMapsValidateCall) doRequest(alt string) (*http.Response, error) {
  36194. var body io.Reader = nil
  36195. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapsvalidaterequest)
  36196. if err != nil {
  36197. return nil, err
  36198. }
  36199. ctype := "application/json"
  36200. c.urlParams_.Set("alt", alt)
  36201. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}/validate")
  36202. urls += "?" + c.urlParams_.Encode()
  36203. req, _ := http.NewRequest("POST", urls, body)
  36204. googleapi.Expand(req.URL, map[string]string{
  36205. "project": c.project,
  36206. "urlMap": c.urlMap,
  36207. })
  36208. req.Header.Set("Content-Type", ctype)
  36209. req.Header.Set("User-Agent", c.s.userAgent())
  36210. if c.ctx_ != nil {
  36211. return ctxhttp.Do(c.ctx_, c.s.client, req)
  36212. }
  36213. return c.s.client.Do(req)
  36214. }
  36215. // Do executes the "compute.urlMaps.validate" call.
  36216. // Exactly one of *UrlMapsValidateResponse or error will be non-nil. Any
  36217. // non-2xx status code is an error. Response headers are in either
  36218. // *UrlMapsValidateResponse.ServerResponse.Header or (if a response was
  36219. // returned at all) in error.(*googleapi.Error).Header. Use
  36220. // googleapi.IsNotModified to check whether the returned error was
  36221. // because http.StatusNotModified was returned.
  36222. func (c *UrlMapsValidateCall) Do(opts ...googleapi.CallOption) (*UrlMapsValidateResponse, error) {
  36223. gensupport.SetOptions(c.urlParams_, opts...)
  36224. res, err := c.doRequest("json")
  36225. if res != nil && res.StatusCode == http.StatusNotModified {
  36226. if res.Body != nil {
  36227. res.Body.Close()
  36228. }
  36229. return nil, &googleapi.Error{
  36230. Code: res.StatusCode,
  36231. Header: res.Header,
  36232. }
  36233. }
  36234. if err != nil {
  36235. return nil, err
  36236. }
  36237. defer googleapi.CloseBody(res)
  36238. if err := googleapi.CheckResponse(res); err != nil {
  36239. return nil, err
  36240. }
  36241. ret := &UrlMapsValidateResponse{
  36242. ServerResponse: googleapi.ServerResponse{
  36243. Header: res.Header,
  36244. HTTPStatusCode: res.StatusCode,
  36245. },
  36246. }
  36247. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  36248. return nil, err
  36249. }
  36250. return ret, nil
  36251. // {
  36252. // "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.",
  36253. // "httpMethod": "POST",
  36254. // "id": "compute.urlMaps.validate",
  36255. // "parameterOrder": [
  36256. // "project",
  36257. // "urlMap"
  36258. // ],
  36259. // "parameters": {
  36260. // "project": {
  36261. // "description": "Project ID for this request.",
  36262. // "location": "path",
  36263. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36264. // "required": true,
  36265. // "type": "string"
  36266. // },
  36267. // "urlMap": {
  36268. // "description": "Name of the UrlMap resource to be validated as.",
  36269. // "location": "path",
  36270. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  36271. // "required": true,
  36272. // "type": "string"
  36273. // }
  36274. // },
  36275. // "path": "{project}/global/urlMaps/{urlMap}/validate",
  36276. // "request": {
  36277. // "$ref": "UrlMapsValidateRequest"
  36278. // },
  36279. // "response": {
  36280. // "$ref": "UrlMapsValidateResponse"
  36281. // },
  36282. // "scopes": [
  36283. // "https://www.googleapis.com/auth/cloud-platform",
  36284. // "https://www.googleapis.com/auth/compute"
  36285. // ]
  36286. // }
  36287. }
  36288. // method id "compute.vpnTunnels.aggregatedList":
  36289. type VpnTunnelsAggregatedListCall struct {
  36290. s *Service
  36291. project string
  36292. urlParams_ gensupport.URLParams
  36293. ifNoneMatch_ string
  36294. ctx_ context.Context
  36295. }
  36296. // AggregatedList: Retrieves an aggregated list of VPN tunnels.
  36297. func (r *VpnTunnelsService) AggregatedList(project string) *VpnTunnelsAggregatedListCall {
  36298. c := &VpnTunnelsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36299. c.project = project
  36300. return c
  36301. }
  36302. // Filter sets the optional parameter "filter": Sets a filter expression
  36303. // for filtering listed resources, in the form filter={expression}. Your
  36304. // {expression} must be in the format: field_name comparison_string
  36305. // literal_string.
  36306. //
  36307. // The field_name is the name of the field you want to compare. Only
  36308. // atomic field types are supported (string, number, boolean). The
  36309. // comparison_string must be either eq (equals) or ne (not equals). The
  36310. // literal_string is the string value to filter to. The literal value
  36311. // must be valid for the type of field you are filtering by (string,
  36312. // number, boolean). For string fields, the literal value is interpreted
  36313. // as a regular expression using RE2 syntax. The literal value must
  36314. // match the entire field.
  36315. //
  36316. // For example, filter=name ne example-instance.
  36317. //
  36318. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  36319. // you can also filter on nested fields. For example, you could filter
  36320. // on instances that have set the scheduling.automaticRestart field to
  36321. // true. In particular, use filtering on nested fields to take advantage
  36322. // of instance labels to organize and filter results based on label
  36323. // values.
  36324. //
  36325. // The Beta API also supports filtering on multiple expressions by
  36326. // providing each separate expression within parentheses. For example,
  36327. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  36328. // Multiple expressions are treated as AND expressions meaning that
  36329. // resources must match all expressions to pass the filters.
  36330. func (c *VpnTunnelsAggregatedListCall) Filter(filter string) *VpnTunnelsAggregatedListCall {
  36331. c.urlParams_.Set("filter", filter)
  36332. return c
  36333. }
  36334. // MaxResults sets the optional parameter "maxResults": The maximum
  36335. // number of results per page that Compute Engine should return. If the
  36336. // number of available results is larger than maxResults, Compute Engine
  36337. // returns a nextPageToken that can be used to get the next page of
  36338. // results in subsequent list requests.
  36339. func (c *VpnTunnelsAggregatedListCall) MaxResults(maxResults int64) *VpnTunnelsAggregatedListCall {
  36340. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  36341. return c
  36342. }
  36343. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  36344. // a certain order. By default, results are returned in alphanumerical
  36345. // order based on the resource name.
  36346. //
  36347. // You can also sort results in descending order based on the creation
  36348. // timestamp using orderBy="creationTimestamp desc". This sorts results
  36349. // based on the creationTimestamp field in reverse chronological order
  36350. // (newest result first). Use this to sort resources like operations so
  36351. // that the newest operation is returned first.
  36352. //
  36353. // Currently, only sorting by name or creationTimestamp desc is
  36354. // supported.
  36355. func (c *VpnTunnelsAggregatedListCall) OrderBy(orderBy string) *VpnTunnelsAggregatedListCall {
  36356. c.urlParams_.Set("orderBy", orderBy)
  36357. return c
  36358. }
  36359. // PageToken sets the optional parameter "pageToken": Specifies a page
  36360. // token to use. Set pageToken to the nextPageToken returned by a
  36361. // previous list request to get the next page of results.
  36362. func (c *VpnTunnelsAggregatedListCall) PageToken(pageToken string) *VpnTunnelsAggregatedListCall {
  36363. c.urlParams_.Set("pageToken", pageToken)
  36364. return c
  36365. }
  36366. // Fields allows partial responses to be retrieved. See
  36367. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36368. // for more information.
  36369. func (c *VpnTunnelsAggregatedListCall) Fields(s ...googleapi.Field) *VpnTunnelsAggregatedListCall {
  36370. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36371. return c
  36372. }
  36373. // IfNoneMatch sets the optional parameter which makes the operation
  36374. // fail if the object's ETag matches the given value. This is useful for
  36375. // getting updates only after the object has changed since the last
  36376. // request. Use googleapi.IsNotModified to check whether the response
  36377. // error from Do is the result of In-None-Match.
  36378. func (c *VpnTunnelsAggregatedListCall) IfNoneMatch(entityTag string) *VpnTunnelsAggregatedListCall {
  36379. c.ifNoneMatch_ = entityTag
  36380. return c
  36381. }
  36382. // Context sets the context to be used in this call's Do method. Any
  36383. // pending HTTP request will be aborted if the provided context is
  36384. // canceled.
  36385. func (c *VpnTunnelsAggregatedListCall) Context(ctx context.Context) *VpnTunnelsAggregatedListCall {
  36386. c.ctx_ = ctx
  36387. return c
  36388. }
  36389. func (c *VpnTunnelsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  36390. var body io.Reader = nil
  36391. c.urlParams_.Set("alt", alt)
  36392. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/vpnTunnels")
  36393. urls += "?" + c.urlParams_.Encode()
  36394. req, _ := http.NewRequest("GET", urls, body)
  36395. googleapi.Expand(req.URL, map[string]string{
  36396. "project": c.project,
  36397. })
  36398. req.Header.Set("User-Agent", c.s.userAgent())
  36399. if c.ifNoneMatch_ != "" {
  36400. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  36401. }
  36402. if c.ctx_ != nil {
  36403. return ctxhttp.Do(c.ctx_, c.s.client, req)
  36404. }
  36405. return c.s.client.Do(req)
  36406. }
  36407. // Do executes the "compute.vpnTunnels.aggregatedList" call.
  36408. // Exactly one of *VpnTunnelAggregatedList or error will be non-nil. Any
  36409. // non-2xx status code is an error. Response headers are in either
  36410. // *VpnTunnelAggregatedList.ServerResponse.Header or (if a response was
  36411. // returned at all) in error.(*googleapi.Error).Header. Use
  36412. // googleapi.IsNotModified to check whether the returned error was
  36413. // because http.StatusNotModified was returned.
  36414. func (c *VpnTunnelsAggregatedListCall) Do(opts ...googleapi.CallOption) (*VpnTunnelAggregatedList, error) {
  36415. gensupport.SetOptions(c.urlParams_, opts...)
  36416. res, err := c.doRequest("json")
  36417. if res != nil && res.StatusCode == http.StatusNotModified {
  36418. if res.Body != nil {
  36419. res.Body.Close()
  36420. }
  36421. return nil, &googleapi.Error{
  36422. Code: res.StatusCode,
  36423. Header: res.Header,
  36424. }
  36425. }
  36426. if err != nil {
  36427. return nil, err
  36428. }
  36429. defer googleapi.CloseBody(res)
  36430. if err := googleapi.CheckResponse(res); err != nil {
  36431. return nil, err
  36432. }
  36433. ret := &VpnTunnelAggregatedList{
  36434. ServerResponse: googleapi.ServerResponse{
  36435. Header: res.Header,
  36436. HTTPStatusCode: res.StatusCode,
  36437. },
  36438. }
  36439. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  36440. return nil, err
  36441. }
  36442. return ret, nil
  36443. // {
  36444. // "description": "Retrieves an aggregated list of VPN tunnels.",
  36445. // "httpMethod": "GET",
  36446. // "id": "compute.vpnTunnels.aggregatedList",
  36447. // "parameterOrder": [
  36448. // "project"
  36449. // ],
  36450. // "parameters": {
  36451. // "filter": {
  36452. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  36453. // "location": "query",
  36454. // "type": "string"
  36455. // },
  36456. // "maxResults": {
  36457. // "default": "500",
  36458. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  36459. // "format": "uint32",
  36460. // "location": "query",
  36461. // "maximum": "500",
  36462. // "minimum": "0",
  36463. // "type": "integer"
  36464. // },
  36465. // "orderBy": {
  36466. // "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.",
  36467. // "location": "query",
  36468. // "type": "string"
  36469. // },
  36470. // "pageToken": {
  36471. // "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.",
  36472. // "location": "query",
  36473. // "type": "string"
  36474. // },
  36475. // "project": {
  36476. // "description": "Project ID for this request.",
  36477. // "location": "path",
  36478. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36479. // "required": true,
  36480. // "type": "string"
  36481. // }
  36482. // },
  36483. // "path": "{project}/aggregated/vpnTunnels",
  36484. // "response": {
  36485. // "$ref": "VpnTunnelAggregatedList"
  36486. // },
  36487. // "scopes": [
  36488. // "https://www.googleapis.com/auth/cloud-platform",
  36489. // "https://www.googleapis.com/auth/compute",
  36490. // "https://www.googleapis.com/auth/compute.readonly"
  36491. // ]
  36492. // }
  36493. }
  36494. // Pages invokes f for each page of results.
  36495. // A non-nil error returned from f will halt the iteration.
  36496. // The provided context supersedes any context provided to the Context method.
  36497. func (c *VpnTunnelsAggregatedListCall) Pages(ctx context.Context, f func(*VpnTunnelAggregatedList) error) error {
  36498. c.ctx_ = ctx
  36499. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  36500. for {
  36501. x, err := c.Do()
  36502. if err != nil {
  36503. return err
  36504. }
  36505. if err := f(x); err != nil {
  36506. return err
  36507. }
  36508. if x.NextPageToken == "" {
  36509. return nil
  36510. }
  36511. c.PageToken(x.NextPageToken)
  36512. }
  36513. }
  36514. // method id "compute.vpnTunnels.delete":
  36515. type VpnTunnelsDeleteCall struct {
  36516. s *Service
  36517. project string
  36518. region string
  36519. vpnTunnel string
  36520. urlParams_ gensupport.URLParams
  36521. ctx_ context.Context
  36522. }
  36523. // Delete: Deletes the specified VpnTunnel resource.
  36524. func (r *VpnTunnelsService) Delete(project string, region string, vpnTunnel string) *VpnTunnelsDeleteCall {
  36525. c := &VpnTunnelsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36526. c.project = project
  36527. c.region = region
  36528. c.vpnTunnel = vpnTunnel
  36529. return c
  36530. }
  36531. // Fields allows partial responses to be retrieved. See
  36532. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36533. // for more information.
  36534. func (c *VpnTunnelsDeleteCall) Fields(s ...googleapi.Field) *VpnTunnelsDeleteCall {
  36535. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36536. return c
  36537. }
  36538. // Context sets the context to be used in this call's Do method. Any
  36539. // pending HTTP request will be aborted if the provided context is
  36540. // canceled.
  36541. func (c *VpnTunnelsDeleteCall) Context(ctx context.Context) *VpnTunnelsDeleteCall {
  36542. c.ctx_ = ctx
  36543. return c
  36544. }
  36545. func (c *VpnTunnelsDeleteCall) doRequest(alt string) (*http.Response, error) {
  36546. var body io.Reader = nil
  36547. c.urlParams_.Set("alt", alt)
  36548. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels/{vpnTunnel}")
  36549. urls += "?" + c.urlParams_.Encode()
  36550. req, _ := http.NewRequest("DELETE", urls, body)
  36551. googleapi.Expand(req.URL, map[string]string{
  36552. "project": c.project,
  36553. "region": c.region,
  36554. "vpnTunnel": c.vpnTunnel,
  36555. })
  36556. req.Header.Set("User-Agent", c.s.userAgent())
  36557. if c.ctx_ != nil {
  36558. return ctxhttp.Do(c.ctx_, c.s.client, req)
  36559. }
  36560. return c.s.client.Do(req)
  36561. }
  36562. // Do executes the "compute.vpnTunnels.delete" call.
  36563. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  36564. // status code is an error. Response headers are in either
  36565. // *Operation.ServerResponse.Header or (if a response was returned at
  36566. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36567. // to check whether the returned error was because
  36568. // http.StatusNotModified was returned.
  36569. func (c *VpnTunnelsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  36570. gensupport.SetOptions(c.urlParams_, opts...)
  36571. res, err := c.doRequest("json")
  36572. if res != nil && res.StatusCode == http.StatusNotModified {
  36573. if res.Body != nil {
  36574. res.Body.Close()
  36575. }
  36576. return nil, &googleapi.Error{
  36577. Code: res.StatusCode,
  36578. Header: res.Header,
  36579. }
  36580. }
  36581. if err != nil {
  36582. return nil, err
  36583. }
  36584. defer googleapi.CloseBody(res)
  36585. if err := googleapi.CheckResponse(res); err != nil {
  36586. return nil, err
  36587. }
  36588. ret := &Operation{
  36589. ServerResponse: googleapi.ServerResponse{
  36590. Header: res.Header,
  36591. HTTPStatusCode: res.StatusCode,
  36592. },
  36593. }
  36594. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  36595. return nil, err
  36596. }
  36597. return ret, nil
  36598. // {
  36599. // "description": "Deletes the specified VpnTunnel resource.",
  36600. // "httpMethod": "DELETE",
  36601. // "id": "compute.vpnTunnels.delete",
  36602. // "parameterOrder": [
  36603. // "project",
  36604. // "region",
  36605. // "vpnTunnel"
  36606. // ],
  36607. // "parameters": {
  36608. // "project": {
  36609. // "description": "Project ID for this request.",
  36610. // "location": "path",
  36611. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36612. // "required": true,
  36613. // "type": "string"
  36614. // },
  36615. // "region": {
  36616. // "description": "The name of the region for this request.",
  36617. // "location": "path",
  36618. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  36619. // "required": true,
  36620. // "type": "string"
  36621. // },
  36622. // "vpnTunnel": {
  36623. // "description": "Name of the VpnTunnel resource to delete.",
  36624. // "location": "path",
  36625. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  36626. // "required": true,
  36627. // "type": "string"
  36628. // }
  36629. // },
  36630. // "path": "{project}/regions/{region}/vpnTunnels/{vpnTunnel}",
  36631. // "response": {
  36632. // "$ref": "Operation"
  36633. // },
  36634. // "scopes": [
  36635. // "https://www.googleapis.com/auth/cloud-platform",
  36636. // "https://www.googleapis.com/auth/compute"
  36637. // ]
  36638. // }
  36639. }
  36640. // method id "compute.vpnTunnels.get":
  36641. type VpnTunnelsGetCall struct {
  36642. s *Service
  36643. project string
  36644. region string
  36645. vpnTunnel string
  36646. urlParams_ gensupport.URLParams
  36647. ifNoneMatch_ string
  36648. ctx_ context.Context
  36649. }
  36650. // Get: Returns the specified VpnTunnel resource.
  36651. func (r *VpnTunnelsService) Get(project string, region string, vpnTunnel string) *VpnTunnelsGetCall {
  36652. c := &VpnTunnelsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36653. c.project = project
  36654. c.region = region
  36655. c.vpnTunnel = vpnTunnel
  36656. return c
  36657. }
  36658. // Fields allows partial responses to be retrieved. See
  36659. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36660. // for more information.
  36661. func (c *VpnTunnelsGetCall) Fields(s ...googleapi.Field) *VpnTunnelsGetCall {
  36662. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36663. return c
  36664. }
  36665. // IfNoneMatch sets the optional parameter which makes the operation
  36666. // fail if the object's ETag matches the given value. This is useful for
  36667. // getting updates only after the object has changed since the last
  36668. // request. Use googleapi.IsNotModified to check whether the response
  36669. // error from Do is the result of In-None-Match.
  36670. func (c *VpnTunnelsGetCall) IfNoneMatch(entityTag string) *VpnTunnelsGetCall {
  36671. c.ifNoneMatch_ = entityTag
  36672. return c
  36673. }
  36674. // Context sets the context to be used in this call's Do method. Any
  36675. // pending HTTP request will be aborted if the provided context is
  36676. // canceled.
  36677. func (c *VpnTunnelsGetCall) Context(ctx context.Context) *VpnTunnelsGetCall {
  36678. c.ctx_ = ctx
  36679. return c
  36680. }
  36681. func (c *VpnTunnelsGetCall) doRequest(alt string) (*http.Response, error) {
  36682. var body io.Reader = nil
  36683. c.urlParams_.Set("alt", alt)
  36684. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels/{vpnTunnel}")
  36685. urls += "?" + c.urlParams_.Encode()
  36686. req, _ := http.NewRequest("GET", urls, body)
  36687. googleapi.Expand(req.URL, map[string]string{
  36688. "project": c.project,
  36689. "region": c.region,
  36690. "vpnTunnel": c.vpnTunnel,
  36691. })
  36692. req.Header.Set("User-Agent", c.s.userAgent())
  36693. if c.ifNoneMatch_ != "" {
  36694. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  36695. }
  36696. if c.ctx_ != nil {
  36697. return ctxhttp.Do(c.ctx_, c.s.client, req)
  36698. }
  36699. return c.s.client.Do(req)
  36700. }
  36701. // Do executes the "compute.vpnTunnels.get" call.
  36702. // Exactly one of *VpnTunnel or error will be non-nil. Any non-2xx
  36703. // status code is an error. Response headers are in either
  36704. // *VpnTunnel.ServerResponse.Header or (if a response was returned at
  36705. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36706. // to check whether the returned error was because
  36707. // http.StatusNotModified was returned.
  36708. func (c *VpnTunnelsGetCall) Do(opts ...googleapi.CallOption) (*VpnTunnel, error) {
  36709. gensupport.SetOptions(c.urlParams_, opts...)
  36710. res, err := c.doRequest("json")
  36711. if res != nil && res.StatusCode == http.StatusNotModified {
  36712. if res.Body != nil {
  36713. res.Body.Close()
  36714. }
  36715. return nil, &googleapi.Error{
  36716. Code: res.StatusCode,
  36717. Header: res.Header,
  36718. }
  36719. }
  36720. if err != nil {
  36721. return nil, err
  36722. }
  36723. defer googleapi.CloseBody(res)
  36724. if err := googleapi.CheckResponse(res); err != nil {
  36725. return nil, err
  36726. }
  36727. ret := &VpnTunnel{
  36728. ServerResponse: googleapi.ServerResponse{
  36729. Header: res.Header,
  36730. HTTPStatusCode: res.StatusCode,
  36731. },
  36732. }
  36733. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  36734. return nil, err
  36735. }
  36736. return ret, nil
  36737. // {
  36738. // "description": "Returns the specified VpnTunnel resource.",
  36739. // "httpMethod": "GET",
  36740. // "id": "compute.vpnTunnels.get",
  36741. // "parameterOrder": [
  36742. // "project",
  36743. // "region",
  36744. // "vpnTunnel"
  36745. // ],
  36746. // "parameters": {
  36747. // "project": {
  36748. // "description": "Project ID for this request.",
  36749. // "location": "path",
  36750. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36751. // "required": true,
  36752. // "type": "string"
  36753. // },
  36754. // "region": {
  36755. // "description": "The name of the region for this request.",
  36756. // "location": "path",
  36757. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  36758. // "required": true,
  36759. // "type": "string"
  36760. // },
  36761. // "vpnTunnel": {
  36762. // "description": "Name of the VpnTunnel resource to return.",
  36763. // "location": "path",
  36764. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  36765. // "required": true,
  36766. // "type": "string"
  36767. // }
  36768. // },
  36769. // "path": "{project}/regions/{region}/vpnTunnels/{vpnTunnel}",
  36770. // "response": {
  36771. // "$ref": "VpnTunnel"
  36772. // },
  36773. // "scopes": [
  36774. // "https://www.googleapis.com/auth/cloud-platform",
  36775. // "https://www.googleapis.com/auth/compute",
  36776. // "https://www.googleapis.com/auth/compute.readonly"
  36777. // ]
  36778. // }
  36779. }
  36780. // method id "compute.vpnTunnels.insert":
  36781. type VpnTunnelsInsertCall struct {
  36782. s *Service
  36783. project string
  36784. region string
  36785. vpntunnel *VpnTunnel
  36786. urlParams_ gensupport.URLParams
  36787. ctx_ context.Context
  36788. }
  36789. // Insert: Creates a VpnTunnel resource in the specified project and
  36790. // region using the data included in the request.
  36791. func (r *VpnTunnelsService) Insert(project string, region string, vpntunnel *VpnTunnel) *VpnTunnelsInsertCall {
  36792. c := &VpnTunnelsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36793. c.project = project
  36794. c.region = region
  36795. c.vpntunnel = vpntunnel
  36796. return c
  36797. }
  36798. // Fields allows partial responses to be retrieved. See
  36799. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36800. // for more information.
  36801. func (c *VpnTunnelsInsertCall) Fields(s ...googleapi.Field) *VpnTunnelsInsertCall {
  36802. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36803. return c
  36804. }
  36805. // Context sets the context to be used in this call's Do method. Any
  36806. // pending HTTP request will be aborted if the provided context is
  36807. // canceled.
  36808. func (c *VpnTunnelsInsertCall) Context(ctx context.Context) *VpnTunnelsInsertCall {
  36809. c.ctx_ = ctx
  36810. return c
  36811. }
  36812. func (c *VpnTunnelsInsertCall) doRequest(alt string) (*http.Response, error) {
  36813. var body io.Reader = nil
  36814. body, err := googleapi.WithoutDataWrapper.JSONReader(c.vpntunnel)
  36815. if err != nil {
  36816. return nil, err
  36817. }
  36818. ctype := "application/json"
  36819. c.urlParams_.Set("alt", alt)
  36820. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels")
  36821. urls += "?" + c.urlParams_.Encode()
  36822. req, _ := http.NewRequest("POST", urls, body)
  36823. googleapi.Expand(req.URL, map[string]string{
  36824. "project": c.project,
  36825. "region": c.region,
  36826. })
  36827. req.Header.Set("Content-Type", ctype)
  36828. req.Header.Set("User-Agent", c.s.userAgent())
  36829. if c.ctx_ != nil {
  36830. return ctxhttp.Do(c.ctx_, c.s.client, req)
  36831. }
  36832. return c.s.client.Do(req)
  36833. }
  36834. // Do executes the "compute.vpnTunnels.insert" call.
  36835. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  36836. // status code is an error. Response headers are in either
  36837. // *Operation.ServerResponse.Header or (if a response was returned at
  36838. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36839. // to check whether the returned error was because
  36840. // http.StatusNotModified was returned.
  36841. func (c *VpnTunnelsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  36842. gensupport.SetOptions(c.urlParams_, opts...)
  36843. res, err := c.doRequest("json")
  36844. if res != nil && res.StatusCode == http.StatusNotModified {
  36845. if res.Body != nil {
  36846. res.Body.Close()
  36847. }
  36848. return nil, &googleapi.Error{
  36849. Code: res.StatusCode,
  36850. Header: res.Header,
  36851. }
  36852. }
  36853. if err != nil {
  36854. return nil, err
  36855. }
  36856. defer googleapi.CloseBody(res)
  36857. if err := googleapi.CheckResponse(res); err != nil {
  36858. return nil, err
  36859. }
  36860. ret := &Operation{
  36861. ServerResponse: googleapi.ServerResponse{
  36862. Header: res.Header,
  36863. HTTPStatusCode: res.StatusCode,
  36864. },
  36865. }
  36866. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  36867. return nil, err
  36868. }
  36869. return ret, nil
  36870. // {
  36871. // "description": "Creates a VpnTunnel resource in the specified project and region using the data included in the request.",
  36872. // "httpMethod": "POST",
  36873. // "id": "compute.vpnTunnels.insert",
  36874. // "parameterOrder": [
  36875. // "project",
  36876. // "region"
  36877. // ],
  36878. // "parameters": {
  36879. // "project": {
  36880. // "description": "Project ID for this request.",
  36881. // "location": "path",
  36882. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36883. // "required": true,
  36884. // "type": "string"
  36885. // },
  36886. // "region": {
  36887. // "description": "The name of the region for this request.",
  36888. // "location": "path",
  36889. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  36890. // "required": true,
  36891. // "type": "string"
  36892. // }
  36893. // },
  36894. // "path": "{project}/regions/{region}/vpnTunnels",
  36895. // "request": {
  36896. // "$ref": "VpnTunnel"
  36897. // },
  36898. // "response": {
  36899. // "$ref": "Operation"
  36900. // },
  36901. // "scopes": [
  36902. // "https://www.googleapis.com/auth/cloud-platform",
  36903. // "https://www.googleapis.com/auth/compute"
  36904. // ]
  36905. // }
  36906. }
  36907. // method id "compute.vpnTunnels.list":
  36908. type VpnTunnelsListCall struct {
  36909. s *Service
  36910. project string
  36911. region string
  36912. urlParams_ gensupport.URLParams
  36913. ifNoneMatch_ string
  36914. ctx_ context.Context
  36915. }
  36916. // List: Retrieves a list of VpnTunnel resources contained in the
  36917. // specified project and region.
  36918. func (r *VpnTunnelsService) List(project string, region string) *VpnTunnelsListCall {
  36919. c := &VpnTunnelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36920. c.project = project
  36921. c.region = region
  36922. return c
  36923. }
  36924. // Filter sets the optional parameter "filter": Sets a filter expression
  36925. // for filtering listed resources, in the form filter={expression}. Your
  36926. // {expression} must be in the format: field_name comparison_string
  36927. // literal_string.
  36928. //
  36929. // The field_name is the name of the field you want to compare. Only
  36930. // atomic field types are supported (string, number, boolean). The
  36931. // comparison_string must be either eq (equals) or ne (not equals). The
  36932. // literal_string is the string value to filter to. The literal value
  36933. // must be valid for the type of field you are filtering by (string,
  36934. // number, boolean). For string fields, the literal value is interpreted
  36935. // as a regular expression using RE2 syntax. The literal value must
  36936. // match the entire field.
  36937. //
  36938. // For example, filter=name ne example-instance.
  36939. //
  36940. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  36941. // you can also filter on nested fields. For example, you could filter
  36942. // on instances that have set the scheduling.automaticRestart field to
  36943. // true. In particular, use filtering on nested fields to take advantage
  36944. // of instance labels to organize and filter results based on label
  36945. // values.
  36946. //
  36947. // The Beta API also supports filtering on multiple expressions by
  36948. // providing each separate expression within parentheses. For example,
  36949. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  36950. // Multiple expressions are treated as AND expressions meaning that
  36951. // resources must match all expressions to pass the filters.
  36952. func (c *VpnTunnelsListCall) Filter(filter string) *VpnTunnelsListCall {
  36953. c.urlParams_.Set("filter", filter)
  36954. return c
  36955. }
  36956. // MaxResults sets the optional parameter "maxResults": The maximum
  36957. // number of results per page that Compute Engine should return. If the
  36958. // number of available results is larger than maxResults, Compute Engine
  36959. // returns a nextPageToken that can be used to get the next page of
  36960. // results in subsequent list requests.
  36961. func (c *VpnTunnelsListCall) MaxResults(maxResults int64) *VpnTunnelsListCall {
  36962. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  36963. return c
  36964. }
  36965. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  36966. // a certain order. By default, results are returned in alphanumerical
  36967. // order based on the resource name.
  36968. //
  36969. // You can also sort results in descending order based on the creation
  36970. // timestamp using orderBy="creationTimestamp desc". This sorts results
  36971. // based on the creationTimestamp field in reverse chronological order
  36972. // (newest result first). Use this to sort resources like operations so
  36973. // that the newest operation is returned first.
  36974. //
  36975. // Currently, only sorting by name or creationTimestamp desc is
  36976. // supported.
  36977. func (c *VpnTunnelsListCall) OrderBy(orderBy string) *VpnTunnelsListCall {
  36978. c.urlParams_.Set("orderBy", orderBy)
  36979. return c
  36980. }
  36981. // PageToken sets the optional parameter "pageToken": Specifies a page
  36982. // token to use. Set pageToken to the nextPageToken returned by a
  36983. // previous list request to get the next page of results.
  36984. func (c *VpnTunnelsListCall) PageToken(pageToken string) *VpnTunnelsListCall {
  36985. c.urlParams_.Set("pageToken", pageToken)
  36986. return c
  36987. }
  36988. // Fields allows partial responses to be retrieved. See
  36989. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36990. // for more information.
  36991. func (c *VpnTunnelsListCall) Fields(s ...googleapi.Field) *VpnTunnelsListCall {
  36992. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36993. return c
  36994. }
  36995. // IfNoneMatch sets the optional parameter which makes the operation
  36996. // fail if the object's ETag matches the given value. This is useful for
  36997. // getting updates only after the object has changed since the last
  36998. // request. Use googleapi.IsNotModified to check whether the response
  36999. // error from Do is the result of In-None-Match.
  37000. func (c *VpnTunnelsListCall) IfNoneMatch(entityTag string) *VpnTunnelsListCall {
  37001. c.ifNoneMatch_ = entityTag
  37002. return c
  37003. }
  37004. // Context sets the context to be used in this call's Do method. Any
  37005. // pending HTTP request will be aborted if the provided context is
  37006. // canceled.
  37007. func (c *VpnTunnelsListCall) Context(ctx context.Context) *VpnTunnelsListCall {
  37008. c.ctx_ = ctx
  37009. return c
  37010. }
  37011. func (c *VpnTunnelsListCall) doRequest(alt string) (*http.Response, error) {
  37012. var body io.Reader = nil
  37013. c.urlParams_.Set("alt", alt)
  37014. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels")
  37015. urls += "?" + c.urlParams_.Encode()
  37016. req, _ := http.NewRequest("GET", urls, body)
  37017. googleapi.Expand(req.URL, map[string]string{
  37018. "project": c.project,
  37019. "region": c.region,
  37020. })
  37021. req.Header.Set("User-Agent", c.s.userAgent())
  37022. if c.ifNoneMatch_ != "" {
  37023. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  37024. }
  37025. if c.ctx_ != nil {
  37026. return ctxhttp.Do(c.ctx_, c.s.client, req)
  37027. }
  37028. return c.s.client.Do(req)
  37029. }
  37030. // Do executes the "compute.vpnTunnels.list" call.
  37031. // Exactly one of *VpnTunnelList or error will be non-nil. Any non-2xx
  37032. // status code is an error. Response headers are in either
  37033. // *VpnTunnelList.ServerResponse.Header or (if a response was returned
  37034. // at all) in error.(*googleapi.Error).Header. Use
  37035. // googleapi.IsNotModified to check whether the returned error was
  37036. // because http.StatusNotModified was returned.
  37037. func (c *VpnTunnelsListCall) Do(opts ...googleapi.CallOption) (*VpnTunnelList, error) {
  37038. gensupport.SetOptions(c.urlParams_, opts...)
  37039. res, err := c.doRequest("json")
  37040. if res != nil && res.StatusCode == http.StatusNotModified {
  37041. if res.Body != nil {
  37042. res.Body.Close()
  37043. }
  37044. return nil, &googleapi.Error{
  37045. Code: res.StatusCode,
  37046. Header: res.Header,
  37047. }
  37048. }
  37049. if err != nil {
  37050. return nil, err
  37051. }
  37052. defer googleapi.CloseBody(res)
  37053. if err := googleapi.CheckResponse(res); err != nil {
  37054. return nil, err
  37055. }
  37056. ret := &VpnTunnelList{
  37057. ServerResponse: googleapi.ServerResponse{
  37058. Header: res.Header,
  37059. HTTPStatusCode: res.StatusCode,
  37060. },
  37061. }
  37062. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  37063. return nil, err
  37064. }
  37065. return ret, nil
  37066. // {
  37067. // "description": "Retrieves a list of VpnTunnel resources contained in the specified project and region.",
  37068. // "httpMethod": "GET",
  37069. // "id": "compute.vpnTunnels.list",
  37070. // "parameterOrder": [
  37071. // "project",
  37072. // "region"
  37073. // ],
  37074. // "parameters": {
  37075. // "filter": {
  37076. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  37077. // "location": "query",
  37078. // "type": "string"
  37079. // },
  37080. // "maxResults": {
  37081. // "default": "500",
  37082. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  37083. // "format": "uint32",
  37084. // "location": "query",
  37085. // "maximum": "500",
  37086. // "minimum": "0",
  37087. // "type": "integer"
  37088. // },
  37089. // "orderBy": {
  37090. // "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.",
  37091. // "location": "query",
  37092. // "type": "string"
  37093. // },
  37094. // "pageToken": {
  37095. // "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.",
  37096. // "location": "query",
  37097. // "type": "string"
  37098. // },
  37099. // "project": {
  37100. // "description": "Project ID for this request.",
  37101. // "location": "path",
  37102. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37103. // "required": true,
  37104. // "type": "string"
  37105. // },
  37106. // "region": {
  37107. // "description": "The name of the region for this request.",
  37108. // "location": "path",
  37109. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  37110. // "required": true,
  37111. // "type": "string"
  37112. // }
  37113. // },
  37114. // "path": "{project}/regions/{region}/vpnTunnels",
  37115. // "response": {
  37116. // "$ref": "VpnTunnelList"
  37117. // },
  37118. // "scopes": [
  37119. // "https://www.googleapis.com/auth/cloud-platform",
  37120. // "https://www.googleapis.com/auth/compute",
  37121. // "https://www.googleapis.com/auth/compute.readonly"
  37122. // ]
  37123. // }
  37124. }
  37125. // Pages invokes f for each page of results.
  37126. // A non-nil error returned from f will halt the iteration.
  37127. // The provided context supersedes any context provided to the Context method.
  37128. func (c *VpnTunnelsListCall) Pages(ctx context.Context, f func(*VpnTunnelList) error) error {
  37129. c.ctx_ = ctx
  37130. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  37131. for {
  37132. x, err := c.Do()
  37133. if err != nil {
  37134. return err
  37135. }
  37136. if err := f(x); err != nil {
  37137. return err
  37138. }
  37139. if x.NextPageToken == "" {
  37140. return nil
  37141. }
  37142. c.PageToken(x.NextPageToken)
  37143. }
  37144. }
  37145. // method id "compute.zoneOperations.delete":
  37146. type ZoneOperationsDeleteCall struct {
  37147. s *Service
  37148. project string
  37149. zone string
  37150. operation string
  37151. urlParams_ gensupport.URLParams
  37152. ctx_ context.Context
  37153. }
  37154. // Delete: Deletes the specified zone-specific Operations resource.
  37155. // For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/delete
  37156. func (r *ZoneOperationsService) Delete(project string, zone string, operation string) *ZoneOperationsDeleteCall {
  37157. c := &ZoneOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37158. c.project = project
  37159. c.zone = zone
  37160. c.operation = operation
  37161. return c
  37162. }
  37163. // Fields allows partial responses to be retrieved. See
  37164. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37165. // for more information.
  37166. func (c *ZoneOperationsDeleteCall) Fields(s ...googleapi.Field) *ZoneOperationsDeleteCall {
  37167. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37168. return c
  37169. }
  37170. // Context sets the context to be used in this call's Do method. Any
  37171. // pending HTTP request will be aborted if the provided context is
  37172. // canceled.
  37173. func (c *ZoneOperationsDeleteCall) Context(ctx context.Context) *ZoneOperationsDeleteCall {
  37174. c.ctx_ = ctx
  37175. return c
  37176. }
  37177. func (c *ZoneOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  37178. var body io.Reader = nil
  37179. c.urlParams_.Set("alt", alt)
  37180. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations/{operation}")
  37181. urls += "?" + c.urlParams_.Encode()
  37182. req, _ := http.NewRequest("DELETE", urls, body)
  37183. googleapi.Expand(req.URL, map[string]string{
  37184. "project": c.project,
  37185. "zone": c.zone,
  37186. "operation": c.operation,
  37187. })
  37188. req.Header.Set("User-Agent", c.s.userAgent())
  37189. if c.ctx_ != nil {
  37190. return ctxhttp.Do(c.ctx_, c.s.client, req)
  37191. }
  37192. return c.s.client.Do(req)
  37193. }
  37194. // Do executes the "compute.zoneOperations.delete" call.
  37195. func (c *ZoneOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  37196. gensupport.SetOptions(c.urlParams_, opts...)
  37197. res, err := c.doRequest("json")
  37198. if err != nil {
  37199. return err
  37200. }
  37201. defer googleapi.CloseBody(res)
  37202. if err := googleapi.CheckResponse(res); err != nil {
  37203. return err
  37204. }
  37205. return nil
  37206. // {
  37207. // "description": "Deletes the specified zone-specific Operations resource.",
  37208. // "httpMethod": "DELETE",
  37209. // "id": "compute.zoneOperations.delete",
  37210. // "parameterOrder": [
  37211. // "project",
  37212. // "zone",
  37213. // "operation"
  37214. // ],
  37215. // "parameters": {
  37216. // "operation": {
  37217. // "description": "Name of the Operations resource to delete.",
  37218. // "location": "path",
  37219. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  37220. // "required": true,
  37221. // "type": "string"
  37222. // },
  37223. // "project": {
  37224. // "description": "Project ID for this request.",
  37225. // "location": "path",
  37226. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37227. // "required": true,
  37228. // "type": "string"
  37229. // },
  37230. // "zone": {
  37231. // "description": "Name of the zone scoping this request.",
  37232. // "location": "path",
  37233. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  37234. // "required": true,
  37235. // "type": "string"
  37236. // }
  37237. // },
  37238. // "path": "{project}/zones/{zone}/operations/{operation}",
  37239. // "scopes": [
  37240. // "https://www.googleapis.com/auth/cloud-platform",
  37241. // "https://www.googleapis.com/auth/compute"
  37242. // ]
  37243. // }
  37244. }
  37245. // method id "compute.zoneOperations.get":
  37246. type ZoneOperationsGetCall struct {
  37247. s *Service
  37248. project string
  37249. zone string
  37250. operation string
  37251. urlParams_ gensupport.URLParams
  37252. ifNoneMatch_ string
  37253. ctx_ context.Context
  37254. }
  37255. // Get: Retrieves the specified zone-specific Operations resource.
  37256. // For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/get
  37257. func (r *ZoneOperationsService) Get(project string, zone string, operation string) *ZoneOperationsGetCall {
  37258. c := &ZoneOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37259. c.project = project
  37260. c.zone = zone
  37261. c.operation = operation
  37262. return c
  37263. }
  37264. // Fields allows partial responses to be retrieved. See
  37265. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37266. // for more information.
  37267. func (c *ZoneOperationsGetCall) Fields(s ...googleapi.Field) *ZoneOperationsGetCall {
  37268. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37269. return c
  37270. }
  37271. // IfNoneMatch sets the optional parameter which makes the operation
  37272. // fail if the object's ETag matches the given value. This is useful for
  37273. // getting updates only after the object has changed since the last
  37274. // request. Use googleapi.IsNotModified to check whether the response
  37275. // error from Do is the result of In-None-Match.
  37276. func (c *ZoneOperationsGetCall) IfNoneMatch(entityTag string) *ZoneOperationsGetCall {
  37277. c.ifNoneMatch_ = entityTag
  37278. return c
  37279. }
  37280. // Context sets the context to be used in this call's Do method. Any
  37281. // pending HTTP request will be aborted if the provided context is
  37282. // canceled.
  37283. func (c *ZoneOperationsGetCall) Context(ctx context.Context) *ZoneOperationsGetCall {
  37284. c.ctx_ = ctx
  37285. return c
  37286. }
  37287. func (c *ZoneOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  37288. var body io.Reader = nil
  37289. c.urlParams_.Set("alt", alt)
  37290. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations/{operation}")
  37291. urls += "?" + c.urlParams_.Encode()
  37292. req, _ := http.NewRequest("GET", urls, body)
  37293. googleapi.Expand(req.URL, map[string]string{
  37294. "project": c.project,
  37295. "zone": c.zone,
  37296. "operation": c.operation,
  37297. })
  37298. req.Header.Set("User-Agent", c.s.userAgent())
  37299. if c.ifNoneMatch_ != "" {
  37300. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  37301. }
  37302. if c.ctx_ != nil {
  37303. return ctxhttp.Do(c.ctx_, c.s.client, req)
  37304. }
  37305. return c.s.client.Do(req)
  37306. }
  37307. // Do executes the "compute.zoneOperations.get" call.
  37308. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  37309. // status code is an error. Response headers are in either
  37310. // *Operation.ServerResponse.Header or (if a response was returned at
  37311. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37312. // to check whether the returned error was because
  37313. // http.StatusNotModified was returned.
  37314. func (c *ZoneOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  37315. gensupport.SetOptions(c.urlParams_, opts...)
  37316. res, err := c.doRequest("json")
  37317. if res != nil && res.StatusCode == http.StatusNotModified {
  37318. if res.Body != nil {
  37319. res.Body.Close()
  37320. }
  37321. return nil, &googleapi.Error{
  37322. Code: res.StatusCode,
  37323. Header: res.Header,
  37324. }
  37325. }
  37326. if err != nil {
  37327. return nil, err
  37328. }
  37329. defer googleapi.CloseBody(res)
  37330. if err := googleapi.CheckResponse(res); err != nil {
  37331. return nil, err
  37332. }
  37333. ret := &Operation{
  37334. ServerResponse: googleapi.ServerResponse{
  37335. Header: res.Header,
  37336. HTTPStatusCode: res.StatusCode,
  37337. },
  37338. }
  37339. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  37340. return nil, err
  37341. }
  37342. return ret, nil
  37343. // {
  37344. // "description": "Retrieves the specified zone-specific Operations resource.",
  37345. // "httpMethod": "GET",
  37346. // "id": "compute.zoneOperations.get",
  37347. // "parameterOrder": [
  37348. // "project",
  37349. // "zone",
  37350. // "operation"
  37351. // ],
  37352. // "parameters": {
  37353. // "operation": {
  37354. // "description": "Name of the Operations resource to return.",
  37355. // "location": "path",
  37356. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  37357. // "required": true,
  37358. // "type": "string"
  37359. // },
  37360. // "project": {
  37361. // "description": "Project ID for this request.",
  37362. // "location": "path",
  37363. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37364. // "required": true,
  37365. // "type": "string"
  37366. // },
  37367. // "zone": {
  37368. // "description": "Name of the zone scoping this request.",
  37369. // "location": "path",
  37370. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  37371. // "required": true,
  37372. // "type": "string"
  37373. // }
  37374. // },
  37375. // "path": "{project}/zones/{zone}/operations/{operation}",
  37376. // "response": {
  37377. // "$ref": "Operation"
  37378. // },
  37379. // "scopes": [
  37380. // "https://www.googleapis.com/auth/cloud-platform",
  37381. // "https://www.googleapis.com/auth/compute",
  37382. // "https://www.googleapis.com/auth/compute.readonly"
  37383. // ]
  37384. // }
  37385. }
  37386. // method id "compute.zoneOperations.list":
  37387. type ZoneOperationsListCall struct {
  37388. s *Service
  37389. project string
  37390. zone string
  37391. urlParams_ gensupport.URLParams
  37392. ifNoneMatch_ string
  37393. ctx_ context.Context
  37394. }
  37395. // List: Retrieves a list of Operation resources contained within the
  37396. // specified zone.
  37397. // For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/list
  37398. func (r *ZoneOperationsService) List(project string, zone string) *ZoneOperationsListCall {
  37399. c := &ZoneOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37400. c.project = project
  37401. c.zone = zone
  37402. return c
  37403. }
  37404. // Filter sets the optional parameter "filter": Sets a filter expression
  37405. // for filtering listed resources, in the form filter={expression}. Your
  37406. // {expression} must be in the format: field_name comparison_string
  37407. // literal_string.
  37408. //
  37409. // The field_name is the name of the field you want to compare. Only
  37410. // atomic field types are supported (string, number, boolean). The
  37411. // comparison_string must be either eq (equals) or ne (not equals). The
  37412. // literal_string is the string value to filter to. The literal value
  37413. // must be valid for the type of field you are filtering by (string,
  37414. // number, boolean). For string fields, the literal value is interpreted
  37415. // as a regular expression using RE2 syntax. The literal value must
  37416. // match the entire field.
  37417. //
  37418. // For example, filter=name ne example-instance.
  37419. //
  37420. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  37421. // you can also filter on nested fields. For example, you could filter
  37422. // on instances that have set the scheduling.automaticRestart field to
  37423. // true. In particular, use filtering on nested fields to take advantage
  37424. // of instance labels to organize and filter results based on label
  37425. // values.
  37426. //
  37427. // The Beta API also supports filtering on multiple expressions by
  37428. // providing each separate expression within parentheses. For example,
  37429. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  37430. // Multiple expressions are treated as AND expressions meaning that
  37431. // resources must match all expressions to pass the filters.
  37432. func (c *ZoneOperationsListCall) Filter(filter string) *ZoneOperationsListCall {
  37433. c.urlParams_.Set("filter", filter)
  37434. return c
  37435. }
  37436. // MaxResults sets the optional parameter "maxResults": The maximum
  37437. // number of results per page that Compute Engine should return. If the
  37438. // number of available results is larger than maxResults, Compute Engine
  37439. // returns a nextPageToken that can be used to get the next page of
  37440. // results in subsequent list requests.
  37441. func (c *ZoneOperationsListCall) MaxResults(maxResults int64) *ZoneOperationsListCall {
  37442. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  37443. return c
  37444. }
  37445. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  37446. // a certain order. By default, results are returned in alphanumerical
  37447. // order based on the resource name.
  37448. //
  37449. // You can also sort results in descending order based on the creation
  37450. // timestamp using orderBy="creationTimestamp desc". This sorts results
  37451. // based on the creationTimestamp field in reverse chronological order
  37452. // (newest result first). Use this to sort resources like operations so
  37453. // that the newest operation is returned first.
  37454. //
  37455. // Currently, only sorting by name or creationTimestamp desc is
  37456. // supported.
  37457. func (c *ZoneOperationsListCall) OrderBy(orderBy string) *ZoneOperationsListCall {
  37458. c.urlParams_.Set("orderBy", orderBy)
  37459. return c
  37460. }
  37461. // PageToken sets the optional parameter "pageToken": Specifies a page
  37462. // token to use. Set pageToken to the nextPageToken returned by a
  37463. // previous list request to get the next page of results.
  37464. func (c *ZoneOperationsListCall) PageToken(pageToken string) *ZoneOperationsListCall {
  37465. c.urlParams_.Set("pageToken", pageToken)
  37466. return c
  37467. }
  37468. // Fields allows partial responses to be retrieved. See
  37469. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37470. // for more information.
  37471. func (c *ZoneOperationsListCall) Fields(s ...googleapi.Field) *ZoneOperationsListCall {
  37472. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37473. return c
  37474. }
  37475. // IfNoneMatch sets the optional parameter which makes the operation
  37476. // fail if the object's ETag matches the given value. This is useful for
  37477. // getting updates only after the object has changed since the last
  37478. // request. Use googleapi.IsNotModified to check whether the response
  37479. // error from Do is the result of In-None-Match.
  37480. func (c *ZoneOperationsListCall) IfNoneMatch(entityTag string) *ZoneOperationsListCall {
  37481. c.ifNoneMatch_ = entityTag
  37482. return c
  37483. }
  37484. // Context sets the context to be used in this call's Do method. Any
  37485. // pending HTTP request will be aborted if the provided context is
  37486. // canceled.
  37487. func (c *ZoneOperationsListCall) Context(ctx context.Context) *ZoneOperationsListCall {
  37488. c.ctx_ = ctx
  37489. return c
  37490. }
  37491. func (c *ZoneOperationsListCall) doRequest(alt string) (*http.Response, error) {
  37492. var body io.Reader = nil
  37493. c.urlParams_.Set("alt", alt)
  37494. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations")
  37495. urls += "?" + c.urlParams_.Encode()
  37496. req, _ := http.NewRequest("GET", urls, body)
  37497. googleapi.Expand(req.URL, map[string]string{
  37498. "project": c.project,
  37499. "zone": c.zone,
  37500. })
  37501. req.Header.Set("User-Agent", c.s.userAgent())
  37502. if c.ifNoneMatch_ != "" {
  37503. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  37504. }
  37505. if c.ctx_ != nil {
  37506. return ctxhttp.Do(c.ctx_, c.s.client, req)
  37507. }
  37508. return c.s.client.Do(req)
  37509. }
  37510. // Do executes the "compute.zoneOperations.list" call.
  37511. // Exactly one of *OperationList or error will be non-nil. Any non-2xx
  37512. // status code is an error. Response headers are in either
  37513. // *OperationList.ServerResponse.Header or (if a response was returned
  37514. // at all) in error.(*googleapi.Error).Header. Use
  37515. // googleapi.IsNotModified to check whether the returned error was
  37516. // because http.StatusNotModified was returned.
  37517. func (c *ZoneOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, error) {
  37518. gensupport.SetOptions(c.urlParams_, opts...)
  37519. res, err := c.doRequest("json")
  37520. if res != nil && res.StatusCode == http.StatusNotModified {
  37521. if res.Body != nil {
  37522. res.Body.Close()
  37523. }
  37524. return nil, &googleapi.Error{
  37525. Code: res.StatusCode,
  37526. Header: res.Header,
  37527. }
  37528. }
  37529. if err != nil {
  37530. return nil, err
  37531. }
  37532. defer googleapi.CloseBody(res)
  37533. if err := googleapi.CheckResponse(res); err != nil {
  37534. return nil, err
  37535. }
  37536. ret := &OperationList{
  37537. ServerResponse: googleapi.ServerResponse{
  37538. Header: res.Header,
  37539. HTTPStatusCode: res.StatusCode,
  37540. },
  37541. }
  37542. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  37543. return nil, err
  37544. }
  37545. return ret, nil
  37546. // {
  37547. // "description": "Retrieves a list of Operation resources contained within the specified zone.",
  37548. // "httpMethod": "GET",
  37549. // "id": "compute.zoneOperations.list",
  37550. // "parameterOrder": [
  37551. // "project",
  37552. // "zone"
  37553. // ],
  37554. // "parameters": {
  37555. // "filter": {
  37556. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  37557. // "location": "query",
  37558. // "type": "string"
  37559. // },
  37560. // "maxResults": {
  37561. // "default": "500",
  37562. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  37563. // "format": "uint32",
  37564. // "location": "query",
  37565. // "maximum": "500",
  37566. // "minimum": "0",
  37567. // "type": "integer"
  37568. // },
  37569. // "orderBy": {
  37570. // "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.",
  37571. // "location": "query",
  37572. // "type": "string"
  37573. // },
  37574. // "pageToken": {
  37575. // "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.",
  37576. // "location": "query",
  37577. // "type": "string"
  37578. // },
  37579. // "project": {
  37580. // "description": "Project ID for this request.",
  37581. // "location": "path",
  37582. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37583. // "required": true,
  37584. // "type": "string"
  37585. // },
  37586. // "zone": {
  37587. // "description": "Name of the zone scoping this request.",
  37588. // "location": "path",
  37589. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  37590. // "required": true,
  37591. // "type": "string"
  37592. // }
  37593. // },
  37594. // "path": "{project}/zones/{zone}/operations",
  37595. // "response": {
  37596. // "$ref": "OperationList"
  37597. // },
  37598. // "scopes": [
  37599. // "https://www.googleapis.com/auth/cloud-platform",
  37600. // "https://www.googleapis.com/auth/compute",
  37601. // "https://www.googleapis.com/auth/compute.readonly"
  37602. // ]
  37603. // }
  37604. }
  37605. // Pages invokes f for each page of results.
  37606. // A non-nil error returned from f will halt the iteration.
  37607. // The provided context supersedes any context provided to the Context method.
  37608. func (c *ZoneOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
  37609. c.ctx_ = ctx
  37610. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  37611. for {
  37612. x, err := c.Do()
  37613. if err != nil {
  37614. return err
  37615. }
  37616. if err := f(x); err != nil {
  37617. return err
  37618. }
  37619. if x.NextPageToken == "" {
  37620. return nil
  37621. }
  37622. c.PageToken(x.NextPageToken)
  37623. }
  37624. }
  37625. // method id "compute.zones.get":
  37626. type ZonesGetCall struct {
  37627. s *Service
  37628. project string
  37629. zone string
  37630. urlParams_ gensupport.URLParams
  37631. ifNoneMatch_ string
  37632. ctx_ context.Context
  37633. }
  37634. // Get: Returns the specified zone resource.
  37635. // For details, see https://cloud.google.com/compute/docs/reference/latest/zones/get
  37636. func (r *ZonesService) Get(project string, zone string) *ZonesGetCall {
  37637. c := &ZonesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37638. c.project = project
  37639. c.zone = zone
  37640. return c
  37641. }
  37642. // Fields allows partial responses to be retrieved. See
  37643. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37644. // for more information.
  37645. func (c *ZonesGetCall) Fields(s ...googleapi.Field) *ZonesGetCall {
  37646. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37647. return c
  37648. }
  37649. // IfNoneMatch sets the optional parameter which makes the operation
  37650. // fail if the object's ETag matches the given value. This is useful for
  37651. // getting updates only after the object has changed since the last
  37652. // request. Use googleapi.IsNotModified to check whether the response
  37653. // error from Do is the result of In-None-Match.
  37654. func (c *ZonesGetCall) IfNoneMatch(entityTag string) *ZonesGetCall {
  37655. c.ifNoneMatch_ = entityTag
  37656. return c
  37657. }
  37658. // Context sets the context to be used in this call's Do method. Any
  37659. // pending HTTP request will be aborted if the provided context is
  37660. // canceled.
  37661. func (c *ZonesGetCall) Context(ctx context.Context) *ZonesGetCall {
  37662. c.ctx_ = ctx
  37663. return c
  37664. }
  37665. func (c *ZonesGetCall) doRequest(alt string) (*http.Response, error) {
  37666. var body io.Reader = nil
  37667. c.urlParams_.Set("alt", alt)
  37668. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}")
  37669. urls += "?" + c.urlParams_.Encode()
  37670. req, _ := http.NewRequest("GET", urls, body)
  37671. googleapi.Expand(req.URL, map[string]string{
  37672. "project": c.project,
  37673. "zone": c.zone,
  37674. })
  37675. req.Header.Set("User-Agent", c.s.userAgent())
  37676. if c.ifNoneMatch_ != "" {
  37677. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  37678. }
  37679. if c.ctx_ != nil {
  37680. return ctxhttp.Do(c.ctx_, c.s.client, req)
  37681. }
  37682. return c.s.client.Do(req)
  37683. }
  37684. // Do executes the "compute.zones.get" call.
  37685. // Exactly one of *Zone or error will be non-nil. Any non-2xx status
  37686. // code is an error. Response headers are in either
  37687. // *Zone.ServerResponse.Header or (if a response was returned at all) in
  37688. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  37689. // whether the returned error was because http.StatusNotModified was
  37690. // returned.
  37691. func (c *ZonesGetCall) Do(opts ...googleapi.CallOption) (*Zone, error) {
  37692. gensupport.SetOptions(c.urlParams_, opts...)
  37693. res, err := c.doRequest("json")
  37694. if res != nil && res.StatusCode == http.StatusNotModified {
  37695. if res.Body != nil {
  37696. res.Body.Close()
  37697. }
  37698. return nil, &googleapi.Error{
  37699. Code: res.StatusCode,
  37700. Header: res.Header,
  37701. }
  37702. }
  37703. if err != nil {
  37704. return nil, err
  37705. }
  37706. defer googleapi.CloseBody(res)
  37707. if err := googleapi.CheckResponse(res); err != nil {
  37708. return nil, err
  37709. }
  37710. ret := &Zone{
  37711. ServerResponse: googleapi.ServerResponse{
  37712. Header: res.Header,
  37713. HTTPStatusCode: res.StatusCode,
  37714. },
  37715. }
  37716. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  37717. return nil, err
  37718. }
  37719. return ret, nil
  37720. // {
  37721. // "description": "Returns the specified zone resource.",
  37722. // "httpMethod": "GET",
  37723. // "id": "compute.zones.get",
  37724. // "parameterOrder": [
  37725. // "project",
  37726. // "zone"
  37727. // ],
  37728. // "parameters": {
  37729. // "project": {
  37730. // "description": "Project ID for this request.",
  37731. // "location": "path",
  37732. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37733. // "required": true,
  37734. // "type": "string"
  37735. // },
  37736. // "zone": {
  37737. // "description": "Name of the zone resource to return.",
  37738. // "location": "path",
  37739. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  37740. // "required": true,
  37741. // "type": "string"
  37742. // }
  37743. // },
  37744. // "path": "{project}/zones/{zone}",
  37745. // "response": {
  37746. // "$ref": "Zone"
  37747. // },
  37748. // "scopes": [
  37749. // "https://www.googleapis.com/auth/cloud-platform",
  37750. // "https://www.googleapis.com/auth/compute",
  37751. // "https://www.googleapis.com/auth/compute.readonly"
  37752. // ]
  37753. // }
  37754. }
  37755. // method id "compute.zones.list":
  37756. type ZonesListCall struct {
  37757. s *Service
  37758. project string
  37759. urlParams_ gensupport.URLParams
  37760. ifNoneMatch_ string
  37761. ctx_ context.Context
  37762. }
  37763. // List: Retrieves the list of zone resources available to the specified
  37764. // project.
  37765. // For details, see https://cloud.google.com/compute/docs/reference/latest/zones/list
  37766. func (r *ZonesService) List(project string) *ZonesListCall {
  37767. c := &ZonesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37768. c.project = project
  37769. return c
  37770. }
  37771. // Filter sets the optional parameter "filter": Sets a filter expression
  37772. // for filtering listed resources, in the form filter={expression}. Your
  37773. // {expression} must be in the format: field_name comparison_string
  37774. // literal_string.
  37775. //
  37776. // The field_name is the name of the field you want to compare. Only
  37777. // atomic field types are supported (string, number, boolean). The
  37778. // comparison_string must be either eq (equals) or ne (not equals). The
  37779. // literal_string is the string value to filter to. The literal value
  37780. // must be valid for the type of field you are filtering by (string,
  37781. // number, boolean). For string fields, the literal value is interpreted
  37782. // as a regular expression using RE2 syntax. The literal value must
  37783. // match the entire field.
  37784. //
  37785. // For example, filter=name ne example-instance.
  37786. //
  37787. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  37788. // you can also filter on nested fields. For example, you could filter
  37789. // on instances that have set the scheduling.automaticRestart field to
  37790. // true. In particular, use filtering on nested fields to take advantage
  37791. // of instance labels to organize and filter results based on label
  37792. // values.
  37793. //
  37794. // The Beta API also supports filtering on multiple expressions by
  37795. // providing each separate expression within parentheses. For example,
  37796. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  37797. // Multiple expressions are treated as AND expressions meaning that
  37798. // resources must match all expressions to pass the filters.
  37799. func (c *ZonesListCall) Filter(filter string) *ZonesListCall {
  37800. c.urlParams_.Set("filter", filter)
  37801. return c
  37802. }
  37803. // MaxResults sets the optional parameter "maxResults": The maximum
  37804. // number of results per page that Compute Engine should return. If the
  37805. // number of available results is larger than maxResults, Compute Engine
  37806. // returns a nextPageToken that can be used to get the next page of
  37807. // results in subsequent list requests.
  37808. func (c *ZonesListCall) MaxResults(maxResults int64) *ZonesListCall {
  37809. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  37810. return c
  37811. }
  37812. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  37813. // a certain order. By default, results are returned in alphanumerical
  37814. // order based on the resource name.
  37815. //
  37816. // You can also sort results in descending order based on the creation
  37817. // timestamp using orderBy="creationTimestamp desc". This sorts results
  37818. // based on the creationTimestamp field in reverse chronological order
  37819. // (newest result first). Use this to sort resources like operations so
  37820. // that the newest operation is returned first.
  37821. //
  37822. // Currently, only sorting by name or creationTimestamp desc is
  37823. // supported.
  37824. func (c *ZonesListCall) OrderBy(orderBy string) *ZonesListCall {
  37825. c.urlParams_.Set("orderBy", orderBy)
  37826. return c
  37827. }
  37828. // PageToken sets the optional parameter "pageToken": Specifies a page
  37829. // token to use. Set pageToken to the nextPageToken returned by a
  37830. // previous list request to get the next page of results.
  37831. func (c *ZonesListCall) PageToken(pageToken string) *ZonesListCall {
  37832. c.urlParams_.Set("pageToken", pageToken)
  37833. return c
  37834. }
  37835. // Fields allows partial responses to be retrieved. See
  37836. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37837. // for more information.
  37838. func (c *ZonesListCall) Fields(s ...googleapi.Field) *ZonesListCall {
  37839. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37840. return c
  37841. }
  37842. // IfNoneMatch sets the optional parameter which makes the operation
  37843. // fail if the object's ETag matches the given value. This is useful for
  37844. // getting updates only after the object has changed since the last
  37845. // request. Use googleapi.IsNotModified to check whether the response
  37846. // error from Do is the result of In-None-Match.
  37847. func (c *ZonesListCall) IfNoneMatch(entityTag string) *ZonesListCall {
  37848. c.ifNoneMatch_ = entityTag
  37849. return c
  37850. }
  37851. // Context sets the context to be used in this call's Do method. Any
  37852. // pending HTTP request will be aborted if the provided context is
  37853. // canceled.
  37854. func (c *ZonesListCall) Context(ctx context.Context) *ZonesListCall {
  37855. c.ctx_ = ctx
  37856. return c
  37857. }
  37858. func (c *ZonesListCall) doRequest(alt string) (*http.Response, error) {
  37859. var body io.Reader = nil
  37860. c.urlParams_.Set("alt", alt)
  37861. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones")
  37862. urls += "?" + c.urlParams_.Encode()
  37863. req, _ := http.NewRequest("GET", urls, body)
  37864. googleapi.Expand(req.URL, map[string]string{
  37865. "project": c.project,
  37866. })
  37867. req.Header.Set("User-Agent", c.s.userAgent())
  37868. if c.ifNoneMatch_ != "" {
  37869. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  37870. }
  37871. if c.ctx_ != nil {
  37872. return ctxhttp.Do(c.ctx_, c.s.client, req)
  37873. }
  37874. return c.s.client.Do(req)
  37875. }
  37876. // Do executes the "compute.zones.list" call.
  37877. // Exactly one of *ZoneList or error will be non-nil. Any non-2xx status
  37878. // code is an error. Response headers are in either
  37879. // *ZoneList.ServerResponse.Header or (if a response was returned at
  37880. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37881. // to check whether the returned error was because
  37882. // http.StatusNotModified was returned.
  37883. func (c *ZonesListCall) Do(opts ...googleapi.CallOption) (*ZoneList, error) {
  37884. gensupport.SetOptions(c.urlParams_, opts...)
  37885. res, err := c.doRequest("json")
  37886. if res != nil && res.StatusCode == http.StatusNotModified {
  37887. if res.Body != nil {
  37888. res.Body.Close()
  37889. }
  37890. return nil, &googleapi.Error{
  37891. Code: res.StatusCode,
  37892. Header: res.Header,
  37893. }
  37894. }
  37895. if err != nil {
  37896. return nil, err
  37897. }
  37898. defer googleapi.CloseBody(res)
  37899. if err := googleapi.CheckResponse(res); err != nil {
  37900. return nil, err
  37901. }
  37902. ret := &ZoneList{
  37903. ServerResponse: googleapi.ServerResponse{
  37904. Header: res.Header,
  37905. HTTPStatusCode: res.StatusCode,
  37906. },
  37907. }
  37908. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  37909. return nil, err
  37910. }
  37911. return ret, nil
  37912. // {
  37913. // "description": "Retrieves the list of zone resources available to the specified project.",
  37914. // "httpMethod": "GET",
  37915. // "id": "compute.zones.list",
  37916. // "parameterOrder": [
  37917. // "project"
  37918. // ],
  37919. // "parameters": {
  37920. // "filter": {
  37921. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. 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, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing 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.",
  37922. // "location": "query",
  37923. // "type": "string"
  37924. // },
  37925. // "maxResults": {
  37926. // "default": "500",
  37927. // "description": "The maximum number of results per page that Compute Engine should return. 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.",
  37928. // "format": "uint32",
  37929. // "location": "query",
  37930. // "maximum": "500",
  37931. // "minimum": "0",
  37932. // "type": "integer"
  37933. // },
  37934. // "orderBy": {
  37935. // "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.",
  37936. // "location": "query",
  37937. // "type": "string"
  37938. // },
  37939. // "pageToken": {
  37940. // "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.",
  37941. // "location": "query",
  37942. // "type": "string"
  37943. // },
  37944. // "project": {
  37945. // "description": "Project ID for this request.",
  37946. // "location": "path",
  37947. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37948. // "required": true,
  37949. // "type": "string"
  37950. // }
  37951. // },
  37952. // "path": "{project}/zones",
  37953. // "response": {
  37954. // "$ref": "ZoneList"
  37955. // },
  37956. // "scopes": [
  37957. // "https://www.googleapis.com/auth/cloud-platform",
  37958. // "https://www.googleapis.com/auth/compute",
  37959. // "https://www.googleapis.com/auth/compute.readonly"
  37960. // ]
  37961. // }
  37962. }
  37963. // Pages invokes f for each page of results.
  37964. // A non-nil error returned from f will halt the iteration.
  37965. // The provided context supersedes any context provided to the Context method.
  37966. func (c *ZonesListCall) Pages(ctx context.Context, f func(*ZoneList) error) error {
  37967. c.ctx_ = ctx
  37968. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  37969. for {
  37970. x, err := c.Do()
  37971. if err != nil {
  37972. return err
  37973. }
  37974. if err := f(x); err != nil {
  37975. return err
  37976. }
  37977. if x.NextPageToken == "" {
  37978. return nil
  37979. }
  37980. c.PageToken(x.NextPageToken)
  37981. }
  37982. }