compute-gen.go 1.4 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005350063500735008350093501035011350123501335014350153501635017350183501935020350213502235023350243502535026350273502835029350303503135032350333503435035350363503735038350393504035041350423504335044350453504635047350483504935050350513505235053350543505535056350573505835059350603506135062350633506435065350663506735068350693507035071350723507335074350753507635077350783507935080350813508235083350843508535086350873508835089350903509135092350933509435095350963509735098350993510035101351023510335104351053510635107351083510935110351113511235113351143511535116351173511835119351203512135122351233512435125351263512735128351293513035131351323513335134351353513635137351383513935140351413514235143351443514535146351473514835149351503515135152351533515435155351563515735158351593516035161351623516335164351653516635167351683516935170351713517235173351743517535176351773517835179351803518135182351833518435185351863518735188351893519035191351923519335194351953519635197351983519935200352013520235203352043520535206352073520835209352103521135212352133521435215352163521735218352193522035221352223522335224352253522635227352283522935230352313523235233352343523535236352373523835239352403524135242352433524435245352463524735248352493525035251352523525335254352553525635257352583525935260352613526235263352643526535266352673526835269352703527135272352733527435275352763527735278352793528035281352823528335284352853528635287352883528935290352913529235293352943529535296352973529835299353003530135302353033530435305353063530735308353093531035311353123531335314353153531635317353183531935320353213532235323353243532535326353273532835329353303533135332353333533435335353363533735338353393534035341353423534335344353453534635347353483534935350353513535235353353543535535356353573535835359353603536135362353633536435365353663536735368353693537035371353723537335374353753537635377353783537935380353813538235383353843538535386353873538835389353903539135392353933539435395353963539735398353993540035401354023540335404354053540635407354083540935410354113541235413354143541535416354173541835419354203542135422354233542435425354263542735428354293543035431354323543335434354353543635437354383543935440354413544235443354443544535446354473544835449354503545135452354533545435455354563545735458354593546035461354623546335464354653546635467354683546935470354713547235473354743547535476354773547835479354803548135482354833548435485354863548735488354893549035491354923549335494354953549635497354983549935500355013550235503355043550535506355073550835509355103551135512355133551435515355163551735518355193552035521355223552335524355253552635527355283552935530355313553235533355343553535536355373553835539355403554135542355433554435545355463554735548355493555035551355523555335554355553555635557355583555935560355613556235563355643556535566355673556835569355703557135572355733557435575355763557735578355793558035581355823558335584355853558635587355883558935590355913559235593355943559535596355973559835599356003560135602356033560435605356063560735608356093561035611356123561335614356153561635617356183561935620356213562235623356243562535626356273562835629356303563135632356333563435635356363563735638356393564035641356423564335644356453564635647356483564935650356513565235653356543565535656356573565835659356603566135662356633566435665356663566735668356693567035671356723567335674356753567635677356783567935680356813568235683356843568535686356873568835689356903569135692356933569435695356963569735698356993570035701357023570335704357053570635707357083570935710357113571235713357143571535716357173571835719357203572135722357233572435725357263572735728357293573035731357323573335734357353573635737357383573935740357413574235743357443574535746357473574835749357503575135752357533575435755357563575735758357593576035761357623576335764357653576635767357683576935770357713577235773357743577535776357773577835779357803578135782357833578435785357863578735788357893579035791357923579335794357953579635797357983579935800358013580235803358043580535806358073580835809358103581135812358133581435815358163581735818358193582035821358223582335824358253582635827358283582935830358313583235833358343583535836358373583835839358403584135842358433584435845358463584735848358493585035851358523585335854358553585635857358583585935860358613586235863358643586535866358673586835869358703587135872358733587435875358763587735878358793588035881358823588335884358853588635887358883588935890358913589235893358943589535896358973589835899359003590135902359033590435905359063590735908359093591035911359123591335914359153591635917359183591935920359213592235923359243592535926359273592835929359303593135932359333593435935359363593735938359393594035941359423594335944359453594635947359483594935950359513595235953359543595535956359573595835959359603596135962359633596435965359663596735968359693597035971359723597335974359753597635977359783597935980359813598235983359843598535986359873598835989359903599135992359933599435995359963599735998359993600036001360023600336004360053600636007360083600936010360113601236013360143601536016360173601836019360203602136022360233602436025360263602736028360293603036031360323603336034360353603636037360383603936040360413604236043360443604536046360473604836049360503605136052360533605436055360563605736058360593606036061360623606336064360653606636067360683606936070360713607236073360743607536076360773607836079360803608136082360833608436085360863608736088360893609036091360923609336094360953609636097360983609936100361013610236103361043610536106361073610836109361103611136112361133611436115361163611736118361193612036121361223612336124361253612636127361283612936130361313613236133361343613536136361373613836139361403614136142361433614436145361463614736148361493615036151361523615336154361553615636157361583615936160361613616236163361643616536166361673616836169361703617136172361733617436175361763617736178361793618036181361823618336184361853618636187361883618936190361913619236193361943619536196361973619836199362003620136202362033620436205362063620736208362093621036211362123621336214362153621636217362183621936220362213622236223362243622536226362273622836229362303623136232362333623436235362363623736238362393624036241362423624336244362453624636247362483624936250362513625236253362543625536256362573625836259362603626136262362633626436265362663626736268362693627036271362723627336274362753627636277362783627936280362813628236283362843628536286362873628836289362903629136292362933629436295362963629736298362993630036301363023630336304363053630636307363083630936310363113631236313363143631536316363173631836319363203632136322363233632436325363263632736328363293633036331363323633336334363353633636337363383633936340363413634236343363443634536346363473634836349363503635136352363533635436355363563635736358363593636036361363623636336364363653636636367363683636936370363713637236373363743637536376363773637836379363803638136382363833638436385363863638736388363893639036391363923639336394363953639636397363983639936400364013640236403364043640536406364073640836409364103641136412364133641436415364163641736418364193642036421364223642336424364253642636427364283642936430364313643236433364343643536436364373643836439364403644136442364433644436445364463644736448364493645036451364523645336454364553645636457364583645936460364613646236463364643646536466364673646836469364703647136472364733647436475364763647736478364793648036481364823648336484364853648636487364883648936490364913649236493364943649536496364973649836499365003650136502365033650436505365063650736508365093651036511365123651336514365153651636517365183651936520365213652236523365243652536526365273652836529365303653136532365333653436535365363653736538365393654036541365423654336544365453654636547365483654936550365513655236553365543655536556365573655836559365603656136562365633656436565365663656736568365693657036571365723657336574365753657636577365783657936580365813658236583365843658536586365873658836589365903659136592365933659436595365963659736598365993660036601366023660336604366053660636607366083660936610366113661236613366143661536616366173661836619366203662136622366233662436625366263662736628366293663036631366323663336634366353663636637366383663936640366413664236643366443664536646366473664836649366503665136652366533665436655366563665736658366593666036661366623666336664366653666636667366683666936670366713667236673366743667536676366773667836679366803668136682366833668436685366863668736688366893669036691366923669336694366953669636697366983669936700367013670236703367043670536706367073670836709367103671136712367133671436715367163671736718367193672036721367223672336724367253672636727367283672936730367313673236733367343673536736367373673836739367403674136742367433674436745367463674736748367493675036751367523675336754367553675636757367583675936760367613676236763367643676536766367673676836769367703677136772367733677436775367763677736778367793678036781367823678336784367853678636787367883678936790367913679236793367943679536796367973679836799368003680136802368033680436805368063680736808368093681036811368123681336814368153681636817368183681936820368213682236823368243682536826368273682836829368303683136832368333683436835368363683736838368393684036841368423684336844368453684636847368483684936850368513685236853368543685536856368573685836859368603686136862368633686436865368663686736868368693687036871368723687336874368753687636877368783687936880368813688236883368843688536886368873688836889368903689136892368933689436895368963689736898368993690036901369023690336904369053690636907369083690936910369113691236913369143691536916369173691836919369203692136922369233692436925369263692736928369293693036931369323693336934369353693636937369383693936940369413694236943369443694536946369473694836949369503695136952369533695436955369563695736958369593696036961369623696336964369653696636967369683696936970369713697236973369743697536976369773697836979369803698136982369833698436985369863698736988369893699036991369923699336994369953699636997369983699937000370013700237003370043700537006370073700837009370103701137012370133701437015370163701737018370193702037021370223702337024370253702637027370283702937030370313703237033370343703537036370373703837039370403704137042370433704437045370463704737048370493705037051370523705337054370553705637057370583705937060370613706237063370643706537066370673706837069370703707137072370733707437075370763707737078370793708037081370823708337084370853708637087370883708937090370913709237093370943709537096370973709837099371003710137102371033710437105371063710737108371093711037111371123711337114371153711637117371183711937120371213712237123371243712537126371273712837129371303713137132371333713437135371363713737138371393714037141371423714337144371453714637147371483714937150371513715237153371543715537156371573715837159371603716137162371633716437165371663716737168371693717037171371723717337174371753717637177371783717937180371813718237183371843718537186371873718837189371903719137192371933719437195371963719737198371993720037201372023720337204372053720637207372083720937210372113721237213372143721537216372173721837219372203722137222372233722437225372263722737228372293723037231372323723337234372353723637237372383723937240372413724237243372443724537246372473724837249372503725137252372533725437255372563725737258372593726037261372623726337264372653726637267372683726937270372713727237273372743727537276372773727837279372803728137282372833728437285372863728737288372893729037291372923729337294372953729637297372983729937300373013730237303373043730537306373073730837309373103731137312373133731437315373163731737318373193732037321373223732337324373253732637327373283732937330373313733237333373343733537336373373733837339373403734137342373433734437345373463734737348373493735037351373523735337354373553735637357373583735937360373613736237363373643736537366373673736837369373703737137372373733737437375373763737737378373793738037381373823738337384373853738637387373883738937390373913739237393373943739537396373973739837399374003740137402374033740437405374063740737408374093741037411374123741337414374153741637417374183741937420374213742237423374243742537426374273742837429374303743137432374333743437435374363743737438374393744037441374423744337444374453744637447374483744937450374513745237453374543745537456374573745837459374603746137462374633746437465374663746737468374693747037471374723747337474374753747637477374783747937480374813748237483374843748537486374873748837489374903749137492374933749437495374963749737498374993750037501375023750337504375053750637507375083750937510375113751237513375143751537516375173751837519375203752137522375233752437525375263752737528375293753037531375323753337534375353753637537375383753937540375413754237543375443754537546375473754837549375503755137552375533755437555375563755737558375593756037561375623756337564375653756637567375683756937570375713757237573375743757537576375773757837579375803758137582375833758437585375863758737588375893759037591375923759337594375953759637597375983759937600376013760237603376043760537606376073760837609376103761137612376133761437615376163761737618376193762037621376223762337624376253762637627376283762937630376313763237633376343763537636376373763837639376403764137642376433764437645376463764737648376493765037651376523765337654376553765637657376583765937660376613766237663376643766537666376673766837669376703767137672376733767437675376763767737678376793768037681376823768337684376853768637687376883768937690376913769237693376943769537696376973769837699377003770137702377033770437705377063770737708377093771037711377123771337714377153771637717377183771937720377213772237723377243772537726377273772837729377303773137732377333773437735377363773737738377393774037741377423774337744377453774637747377483774937750377513775237753377543775537756377573775837759377603776137762377633776437765377663776737768377693777037771377723777337774377753777637777377783777937780377813778237783377843778537786377873778837789377903779137792377933779437795377963779737798377993780037801378023780337804378053780637807378083780937810378113781237813378143781537816378173781837819378203782137822378233782437825378263782737828378293783037831378323783337834378353783637837378383783937840378413784237843378443784537846378473784837849378503785137852378533785437855378563785737858378593786037861378623786337864378653786637867378683786937870378713787237873378743787537876378773787837879378803788137882378833788437885378863788737888378893789037891378923789337894378953789637897378983789937900379013790237903379043790537906379073790837909379103791137912379133791437915379163791737918379193792037921379223792337924379253792637927379283792937930379313793237933379343793537936379373793837939379403794137942379433794437945379463794737948379493795037951379523795337954379553795637957379583795937960379613796237963379643796537966379673796837969379703797137972379733797437975379763797737978379793798037981379823798337984379853798637987379883798937990379913799237993379943799537996379973799837999380003800138002380033800438005380063800738008380093801038011380123801338014380153801638017380183801938020380213802238023380243802538026380273802838029380303803138032380333803438035380363803738038380393804038041380423804338044380453804638047380483804938050380513805238053380543805538056380573805838059380603806138062380633806438065380663806738068380693807038071380723807338074380753807638077380783807938080380813808238083380843808538086380873808838089380903809138092380933809438095380963809738098380993810038101381023810338104381053810638107381083810938110381113811238113381143811538116381173811838119381203812138122381233812438125381263812738128381293813038131381323813338134381353813638137381383813938140381413814238143381443814538146381473814838149381503815138152381533815438155381563815738158381593816038161381623816338164381653816638167381683816938170381713817238173381743817538176381773817838179381803818138182381833818438185381863818738188381893819038191381923819338194381953819638197381983819938200382013820238203382043820538206382073820838209382103821138212382133821438215382163821738218382193822038221382223822338224382253822638227382283822938230382313823238233382343823538236382373823838239382403824138242382433824438245382463824738248382493825038251382523825338254382553825638257382583825938260382613826238263382643826538266382673826838269382703827138272382733827438275382763827738278382793828038281382823828338284382853828638287382883828938290382913829238293382943829538296382973829838299383003830138302383033830438305383063830738308383093831038311383123831338314383153831638317383183831938320383213832238323383243832538326383273832838329383303833138332383333833438335383363833738338383393834038341383423834338344383453834638347383483834938350383513835238353383543835538356383573835838359383603836138362383633836438365383663836738368383693837038371383723837338374383753837638377383783837938380383813838238383383843838538386383873838838389383903839138392383933839438395383963839738398383993840038401384023840338404384053840638407384083840938410384113841238413384143841538416384173841838419384203842138422384233842438425384263842738428384293843038431384323843338434384353843638437384383843938440384413844238443384443844538446384473844838449384503845138452384533845438455384563845738458384593846038461384623846338464384653846638467384683846938470384713847238473384743847538476384773847838479384803848138482384833848438485384863848738488384893849038491384923849338494384953849638497384983849938500385013850238503385043850538506385073850838509385103851138512385133851438515385163851738518385193852038521385223852338524385253852638527385283852938530385313853238533385343853538536385373853838539385403854138542385433854438545385463854738548385493855038551385523855338554385553855638557385583855938560385613856238563385643856538566385673856838569385703857138572385733857438575385763857738578385793858038581385823858338584385853858638587385883858938590385913859238593385943859538596385973859838599386003860138602386033860438605386063860738608386093861038611386123861338614386153861638617386183861938620386213862238623386243862538626386273862838629386303863138632386333863438635386363863738638386393864038641386423864338644386453864638647386483864938650386513865238653386543865538656386573865838659386603866138662386633866438665386663866738668386693867038671386723867338674386753867638677386783867938680386813868238683386843868538686386873868838689386903869138692386933869438695386963869738698386993870038701387023870338704387053870638707387083870938710387113871238713387143871538716387173871838719387203872138722387233872438725387263872738728387293873038731387323873338734387353873638737387383873938740387413874238743387443874538746387473874838749387503875138752387533875438755387563875738758387593876038761387623876338764387653876638767387683876938770387713877238773387743877538776387773877838779387803878138782387833878438785387863878738788387893879038791387923879338794387953879638797387983879938800388013880238803388043880538806388073880838809388103881138812388133881438815388163881738818388193882038821388223882338824388253882638827388283882938830388313883238833388343883538836388373883838839388403884138842388433884438845388463884738848388493885038851388523885338854388553885638857388583885938860388613886238863388643886538866388673886838869388703887138872388733887438875388763887738878388793888038881388823888338884388853888638887388883888938890388913889238893388943889538896388973889838899389003890138902389033890438905389063890738908389093891038911389123891338914389153891638917389183891938920389213892238923389243892538926389273892838929389303893138932389333893438935389363893738938389393894038941389423894338944389453894638947389483894938950389513895238953389543895538956389573895838959389603896138962389633896438965389663896738968389693897038971389723897338974389753897638977389783897938980389813898238983389843898538986389873898838989389903899138992389933899438995389963899738998389993900039001390023900339004390053900639007390083900939010390113901239013390143901539016390173901839019390203902139022390233902439025390263902739028390293903039031390323903339034390353903639037390383903939040390413904239043390443904539046390473904839049390503905139052390533905439055390563905739058390593906039061390623906339064390653906639067390683906939070390713907239073390743907539076390773907839079390803908139082390833908439085390863908739088390893909039091390923909339094390953909639097390983909939100391013910239103391043910539106391073910839109391103911139112391133911439115391163911739118391193912039121391223912339124391253912639127391283912939130391313913239133391343913539136391373913839139391403914139142391433914439145391463914739148391493915039151391523915339154391553915639157391583915939160391613916239163391643916539166391673916839169391703917139172391733917439175391763917739178391793918039181391823918339184391853918639187391883918939190391913919239193391943919539196391973919839199392003920139202392033920439205392063920739208392093921039211392123921339214392153921639217392183921939220392213922239223392243922539226392273922839229392303923139232392333923439235392363923739238392393924039241392423924339244392453924639247392483924939250392513925239253392543925539256392573925839259392603926139262392633926439265392663926739268392693927039271392723927339274392753927639277392783927939280392813928239283392843928539286392873928839289392903929139292392933929439295392963929739298392993930039301393023930339304393053930639307393083930939310393113931239313393143931539316393173931839319393203932139322393233932439325393263932739328393293933039331393323933339334393353933639337393383933939340393413934239343393443934539346393473934839349393503935139352393533935439355393563935739358393593936039361393623936339364393653936639367393683936939370393713937239373393743937539376393773937839379393803938139382393833938439385393863938739388393893939039391393923939339394393953939639397393983939939400394013940239403394043940539406394073940839409394103941139412394133941439415394163941739418394193942039421394223942339424394253942639427394283942939430394313943239433394343943539436394373943839439394403944139442394433944439445394463944739448394493945039451394523945339454394553945639457394583945939460394613946239463394643946539466394673946839469394703947139472394733947439475394763947739478394793948039481394823948339484394853948639487394883948939490394913949239493394943949539496394973949839499395003950139502395033950439505395063950739508395093951039511395123951339514395153951639517395183951939520395213952239523395243952539526395273952839529395303953139532395333953439535395363953739538395393954039541395423954339544395453954639547395483954939550395513955239553395543955539556395573955839559395603956139562395633956439565395663956739568395693957039571395723957339574395753957639577395783957939580395813958239583395843958539586395873958839589395903959139592395933959439595395963959739598395993960039601396023960339604396053960639607396083960939610396113961239613396143961539616396173961839619396203962139622396233962439625396263962739628396293963039631396323963339634396353963639637396383963939640396413964239643396443964539646396473964839649396503965139652396533965439655396563965739658396593966039661396623966339664396653966639667396683966939670396713967239673396743967539676396773967839679396803968139682396833968439685396863968739688396893969039691396923969339694396953969639697396983969939700397013970239703397043970539706397073970839709397103971139712397133971439715397163971739718397193972039721397223972339724397253972639727397283972939730397313973239733397343973539736397373973839739397403974139742397433974439745397463974739748397493975039751397523975339754397553975639757397583975939760397613976239763397643976539766397673976839769397703977139772397733977439775397763977739778397793978039781397823978339784397853978639787397883978939790397913979239793397943979539796397973979839799398003980139802398033980439805398063980739808398093981039811398123981339814398153981639817398183981939820398213982239823398243982539826398273982839829398303983139832398333983439835398363983739838398393984039841398423984339844398453984639847398483984939850398513985239853398543985539856398573985839859398603986139862398633986439865398663986739868398693987039871398723987339874398753987639877398783987939880398813988239883398843988539886398873988839889398903989139892398933989439895398963989739898398993990039901399023990339904399053990639907399083990939910399113991239913399143991539916399173991839919399203992139922399233992439925399263992739928399293993039931399323993339934399353993639937
  1. // Package compute provides access to the Compute Engine API.
  2. //
  3. // See https://developers.google.com/compute/docs/reference/latest/
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/compute/v1"
  8. // ...
  9. // computeService, err := compute.New(oauthHttpClient)
  10. package compute // import "google.golang.org/api/compute/v1"
  11. import (
  12. "bytes"
  13. "encoding/json"
  14. "errors"
  15. "fmt"
  16. context "golang.org/x/net/context"
  17. ctxhttp "golang.org/x/net/context/ctxhttp"
  18. gensupport "google.golang.org/api/gensupport"
  19. googleapi "google.golang.org/api/googleapi"
  20. "io"
  21. "net/http"
  22. "net/url"
  23. "strconv"
  24. "strings"
  25. )
  26. // Always reference these packages, just in case the auto-generated code
  27. // below doesn't.
  28. var _ = bytes.NewBuffer
  29. var _ = strconv.Itoa
  30. var _ = fmt.Sprintf
  31. var _ = json.NewDecoder
  32. var _ = io.Copy
  33. var _ = url.Parse
  34. var _ = gensupport.MarshalJSON
  35. var _ = googleapi.Version
  36. var _ = errors.New
  37. var _ = strings.Replace
  38. var _ = context.Canceled
  39. var _ = ctxhttp.Do
  40. const apiId = "compute:v1"
  41. const apiName = "compute"
  42. const apiVersion = "v1"
  43. const basePath = "https://www.googleapis.com/compute/v1/projects/"
  44. // OAuth2 scopes used by this API.
  45. const (
  46. // View and manage your data across Google Cloud Platform services
  47. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
  48. // View and manage your Google Compute Engine resources
  49. ComputeScope = "https://www.googleapis.com/auth/compute"
  50. // View your Google Compute Engine resources
  51. ComputeReadonlyScope = "https://www.googleapis.com/auth/compute.readonly"
  52. // Manage your data and permissions in Google Cloud Storage
  53. DevstorageFullControlScope = "https://www.googleapis.com/auth/devstorage.full_control"
  54. // View your data in Google Cloud Storage
  55. DevstorageReadOnlyScope = "https://www.googleapis.com/auth/devstorage.read_only"
  56. // Manage your data in Google Cloud Storage
  57. DevstorageReadWriteScope = "https://www.googleapis.com/auth/devstorage.read_write"
  58. )
  59. func New(client *http.Client) (*Service, error) {
  60. if client == nil {
  61. return nil, errors.New("client is nil")
  62. }
  63. s := &Service{client: client, BasePath: basePath}
  64. s.Addresses = NewAddressesService(s)
  65. s.Autoscalers = NewAutoscalersService(s)
  66. s.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. // Index: Assigns a zero-based index to this disk, where 0 is reserved
  668. // for the boot disk. For example, if you have many disks attached to an
  669. // instance, each disk would have a unique index number. If not
  670. // specified, the server will choose an appropriate value.
  671. Index int64 `json:"index,omitempty"`
  672. // InitializeParams: [Input Only] Specifies the parameters for a new
  673. // disk that will be created alongside the new instance. Use
  674. // initialization parameters to create boot disks or local SSDs attached
  675. // to the new instance.
  676. //
  677. // This property is mutually exclusive with the source property; you can
  678. // only define one or the other, but not both.
  679. InitializeParams *AttachedDiskInitializeParams `json:"initializeParams,omitempty"`
  680. // Interface: Specifies the disk interface to use for attaching this
  681. // disk, either SCSI or NVME. The default is SCSI. For performance
  682. // characteristics of SCSI over NVMe, see Local SSD performance.
  683. //
  684. // Possible values:
  685. // "NVME"
  686. // "SCSI"
  687. Interface string `json:"interface,omitempty"`
  688. // Kind: [Output Only] Type of the resource. Always compute#attachedDisk
  689. // for attached disks.
  690. Kind string `json:"kind,omitempty"`
  691. // Licenses: [Output Only] Any valid publicly visible licenses.
  692. Licenses []string `json:"licenses,omitempty"`
  693. // Mode: The mode in which to attach this disk, either READ_WRITE or
  694. // READ_ONLY. If not specified, the default is to attach the disk in
  695. // READ_WRITE mode.
  696. //
  697. // Possible values:
  698. // "READ_ONLY"
  699. // "READ_WRITE"
  700. Mode string `json:"mode,omitempty"`
  701. // Source: Specifies a valid partial or full URL to an existing
  702. // Persistent Disk resource. This field is only applicable for
  703. // persistent disks.
  704. Source string `json:"source,omitempty"`
  705. // Type: Specifies the type of the disk, either SCRATCH or PERSISTENT.
  706. // If not specified, the default is PERSISTENT.
  707. //
  708. // Possible values:
  709. // "PERSISTENT"
  710. // "SCRATCH"
  711. Type string `json:"type,omitempty"`
  712. // ForceSendFields is a list of field names (e.g. "AutoDelete") to
  713. // unconditionally include in API requests. By default, fields with
  714. // empty values are omitted from API requests. However, any non-pointer,
  715. // non-interface field appearing in ForceSendFields will be sent to the
  716. // server regardless of whether the field is empty or not. This may be
  717. // used to include empty fields in Patch requests.
  718. ForceSendFields []string `json:"-"`
  719. }
  720. func (s *AttachedDisk) MarshalJSON() ([]byte, error) {
  721. type noMethod AttachedDisk
  722. raw := noMethod(*s)
  723. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  724. }
  725. // AttachedDiskInitializeParams: [Input Only] Specifies the parameters
  726. // for a new disk that will be created alongside the new instance. Use
  727. // initialization parameters to create boot disks or local SSDs attached
  728. // to the new instance.
  729. //
  730. // This property is mutually exclusive with the source property; you can
  731. // only define one or the other, but not both.
  732. type AttachedDiskInitializeParams struct {
  733. // DiskName: Specifies the disk name. If not specified, the default is
  734. // to use the name of the instance.
  735. DiskName string `json:"diskName,omitempty"`
  736. // DiskSizeGb: Specifies the size of the disk in base-2 GB.
  737. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  738. // DiskType: Specifies the disk type to use to create the instance. If
  739. // not specified, the default is pd-standard, specified using the full
  740. // URL. For
  741. // example:
  742. //
  743. // https://www.googleapis.com/compute/v1/projects/project/zones
  744. // /zone/diskTypes/pd-standard
  745. //
  746. // Other values include pd-ssd and local-ssd. If you define this field,
  747. // you can provide either the full or partial URL. For example, the
  748. // following are valid values:
  749. // -
  750. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
  751. // - projects/project/zones/zone/diskTypes/diskType
  752. // - zones/zone/diskTypes/diskType
  753. DiskType string `json:"diskType,omitempty"`
  754. // SourceImage: A source image used to create the disk. You can provide
  755. // a private (custom) image, and Compute Engine will use the
  756. // corresponding image from your project. For
  757. // example:
  758. //
  759. // global/images/my-private-image
  760. //
  761. // Or you can provide an image from a publicly-available project. For
  762. // example, to use a Debian image from the debian-cloud project, make
  763. // sure to include the project in the
  764. // URL:
  765. //
  766. // projects/debian-cloud/global/images/debian-7-wheezy-vYYYYMMDD
  767. //
  768. // where vYYYYMMDD is the image version. The fully-qualified URL will
  769. // also work in both cases.
  770. SourceImage string `json:"sourceImage,omitempty"`
  771. // ForceSendFields is a list of field names (e.g. "DiskName") to
  772. // unconditionally include in API requests. By default, fields with
  773. // empty values are omitted from API requests. However, any non-pointer,
  774. // non-interface field appearing in ForceSendFields will be sent to the
  775. // server regardless of whether the field is empty or not. This may be
  776. // used to include empty fields in Patch requests.
  777. ForceSendFields []string `json:"-"`
  778. }
  779. func (s *AttachedDiskInitializeParams) MarshalJSON() ([]byte, error) {
  780. type noMethod AttachedDiskInitializeParams
  781. raw := noMethod(*s)
  782. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  783. }
  784. type Autoscaler struct {
  785. // AutoscalingPolicy: Autoscaling configuration.
  786. AutoscalingPolicy *AutoscalingPolicy `json:"autoscalingPolicy,omitempty"`
  787. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  788. // format.
  789. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  790. // Description: An optional description of this resource. Provide this
  791. // property when you create the resource.
  792. Description string `json:"description,omitempty"`
  793. // Id: [Output Only] The unique identifier for the resource. This
  794. // identifier is defined by the server.
  795. Id uint64 `json:"id,omitempty,string"`
  796. // Kind: Type of the resource.
  797. Kind string `json:"kind,omitempty"`
  798. // Name: Name of the resource. Provided by the client when the resource
  799. // is created. The name must be 1-63 characters long, and comply with
  800. // RFC1035. Specifically, the name must be 1-63 characters long and
  801. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  802. // the first character must be a lowercase letter, and all following
  803. // characters must be a dash, lowercase letter, or digit, except the
  804. // last character, which cannot be a dash.
  805. Name string `json:"name,omitempty"`
  806. // SelfLink: [Output Only] Server-defined URL for the resource.
  807. SelfLink string `json:"selfLink,omitempty"`
  808. // Target: URL of Instance Group Manager or Replica Pool which will be
  809. // controlled by Autoscaler.
  810. Target string `json:"target,omitempty"`
  811. // Zone: [Output Only] URL of the zone where the instance group resides.
  812. Zone string `json:"zone,omitempty"`
  813. // ServerResponse contains the HTTP response code and headers from the
  814. // server.
  815. googleapi.ServerResponse `json:"-"`
  816. // ForceSendFields is a list of field names (e.g. "AutoscalingPolicy")
  817. // to unconditionally include in API requests. By default, fields with
  818. // empty values are omitted from API requests. However, any non-pointer,
  819. // non-interface field appearing in ForceSendFields will be sent to the
  820. // server regardless of whether the field is empty or not. This may be
  821. // used to include empty fields in Patch requests.
  822. ForceSendFields []string `json:"-"`
  823. }
  824. func (s *Autoscaler) MarshalJSON() ([]byte, error) {
  825. type noMethod Autoscaler
  826. raw := noMethod(*s)
  827. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  828. }
  829. type AutoscalerAggregatedList struct {
  830. // Id: [Output Only] The unique identifier for the resource. This
  831. // identifier is defined by the server.
  832. Id string `json:"id,omitempty"`
  833. // Items: A map of scoped autoscaler lists.
  834. Items map[string]AutoscalersScopedList `json:"items,omitempty"`
  835. // Kind: Type of resource.
  836. Kind string `json:"kind,omitempty"`
  837. // NextPageToken: [Output Only] This token allows you to get the next
  838. // page of results for list requests. If the number of results is larger
  839. // than maxResults, use the nextPageToken as a value for the query
  840. // parameter pageToken in the next list request. Subsequent list
  841. // requests will have their own nextPageToken to continue paging through
  842. // the results.
  843. NextPageToken string `json:"nextPageToken,omitempty"`
  844. // SelfLink: [Output Only] Server-defined URL for this resource.
  845. SelfLink string `json:"selfLink,omitempty"`
  846. // ServerResponse contains the HTTP response code and headers from the
  847. // server.
  848. googleapi.ServerResponse `json:"-"`
  849. // ForceSendFields is a list of field names (e.g. "Id") to
  850. // unconditionally include in API requests. By default, fields with
  851. // empty values are omitted from API requests. However, any non-pointer,
  852. // non-interface field appearing in ForceSendFields will be sent to the
  853. // server regardless of whether the field is empty or not. This may be
  854. // used to include empty fields in Patch requests.
  855. ForceSendFields []string `json:"-"`
  856. }
  857. func (s *AutoscalerAggregatedList) MarshalJSON() ([]byte, error) {
  858. type noMethod AutoscalerAggregatedList
  859. raw := noMethod(*s)
  860. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  861. }
  862. // AutoscalerList: Contains a list of persistent autoscaler resources.
  863. type AutoscalerList struct {
  864. // Id: [Output Only] The unique identifier for the resource. This
  865. // identifier is defined by the server.
  866. Id string `json:"id,omitempty"`
  867. // Items: A list of Autoscaler resources.
  868. Items []*Autoscaler `json:"items,omitempty"`
  869. // Kind: Type of resource.
  870. Kind string `json:"kind,omitempty"`
  871. // NextPageToken: [Output Only] This token allows you to get the next
  872. // page of results for list requests. If the number of results is larger
  873. // than maxResults, use the nextPageToken as a value for the query
  874. // parameter pageToken in the next list request. Subsequent list
  875. // requests will have their own nextPageToken to continue paging through
  876. // the results.
  877. NextPageToken string `json:"nextPageToken,omitempty"`
  878. // SelfLink: [Output Only] Server-defined URL for this resource.
  879. SelfLink string `json:"selfLink,omitempty"`
  880. // ServerResponse contains the HTTP response code and headers from the
  881. // server.
  882. googleapi.ServerResponse `json:"-"`
  883. // ForceSendFields is a list of field names (e.g. "Id") to
  884. // unconditionally include in API requests. By default, fields with
  885. // empty values are omitted from API requests. However, any non-pointer,
  886. // non-interface field appearing in ForceSendFields will be sent to the
  887. // server regardless of whether the field is empty or not. This may be
  888. // used to include empty fields in Patch requests.
  889. ForceSendFields []string `json:"-"`
  890. }
  891. func (s *AutoscalerList) MarshalJSON() ([]byte, error) {
  892. type noMethod AutoscalerList
  893. raw := noMethod(*s)
  894. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  895. }
  896. type AutoscalersScopedList struct {
  897. // Autoscalers: List of autoscalers contained in this scope.
  898. Autoscalers []*Autoscaler `json:"autoscalers,omitempty"`
  899. // Warning: Informational warning which replaces the list of autoscalers
  900. // when the list is empty.
  901. Warning *AutoscalersScopedListWarning `json:"warning,omitempty"`
  902. // ForceSendFields is a list of field names (e.g. "Autoscalers") to
  903. // unconditionally include in API requests. By default, fields with
  904. // empty values are omitted from API requests. However, any non-pointer,
  905. // non-interface field appearing in ForceSendFields will be sent to the
  906. // server regardless of whether the field is empty or not. This may be
  907. // used to include empty fields in Patch requests.
  908. ForceSendFields []string `json:"-"`
  909. }
  910. func (s *AutoscalersScopedList) MarshalJSON() ([]byte, error) {
  911. type noMethod AutoscalersScopedList
  912. raw := noMethod(*s)
  913. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  914. }
  915. // AutoscalersScopedListWarning: Informational warning which replaces
  916. // the list of autoscalers when the list is empty.
  917. type AutoscalersScopedListWarning struct {
  918. // Code: [Output Only] A warning code, if applicable. For example,
  919. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  920. // the response.
  921. //
  922. // Possible values:
  923. // "DEPRECATED_RESOURCE_USED"
  924. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  925. // "INJECTED_KERNELS_DEPRECATED"
  926. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  927. // "NEXT_HOP_CANNOT_IP_FORWARD"
  928. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  929. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  930. // "NEXT_HOP_NOT_RUNNING"
  931. // "NOT_CRITICAL_ERROR"
  932. // "NO_RESULTS_ON_PAGE"
  933. // "REQUIRED_TOS_AGREEMENT"
  934. // "RESOURCE_NOT_DELETED"
  935. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  936. // "UNREACHABLE"
  937. Code string `json:"code,omitempty"`
  938. // Data: [Output Only] Metadata about this warning in key: value format.
  939. // For example:
  940. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  941. Data []*AutoscalersScopedListWarningData `json:"data,omitempty"`
  942. // Message: [Output Only] A human-readable description of the warning
  943. // code.
  944. Message string `json:"message,omitempty"`
  945. // ForceSendFields is a list of field names (e.g. "Code") to
  946. // unconditionally include in API requests. By default, fields with
  947. // empty values are omitted from API requests. However, any non-pointer,
  948. // non-interface field appearing in ForceSendFields will be sent to the
  949. // server regardless of whether the field is empty or not. This may be
  950. // used to include empty fields in Patch requests.
  951. ForceSendFields []string `json:"-"`
  952. }
  953. func (s *AutoscalersScopedListWarning) MarshalJSON() ([]byte, error) {
  954. type noMethod AutoscalersScopedListWarning
  955. raw := noMethod(*s)
  956. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  957. }
  958. type AutoscalersScopedListWarningData struct {
  959. // Key: [Output Only] A key that provides more detail on the warning
  960. // being returned. For example, for warnings where there are no results
  961. // in a list request for a particular zone, this key might be scope and
  962. // the key value might be the zone name. Other examples might be a key
  963. // indicating a deprecated resource, and a suggested replacement, or a
  964. // warning about invalid network settings (for example, if an instance
  965. // attempts to perform IP forwarding but is not enabled for IP
  966. // forwarding).
  967. Key string `json:"key,omitempty"`
  968. // Value: [Output Only] A warning data value corresponding to the key.
  969. Value string `json:"value,omitempty"`
  970. // ForceSendFields is a list of field names (e.g. "Key") to
  971. // unconditionally include in API requests. By default, fields with
  972. // empty values are omitted from API requests. However, any non-pointer,
  973. // non-interface field appearing in ForceSendFields will be sent to the
  974. // server regardless of whether the field is empty or not. This may be
  975. // used to include empty fields in Patch requests.
  976. ForceSendFields []string `json:"-"`
  977. }
  978. func (s *AutoscalersScopedListWarningData) MarshalJSON() ([]byte, error) {
  979. type noMethod AutoscalersScopedListWarningData
  980. raw := noMethod(*s)
  981. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  982. }
  983. // AutoscalingPolicy: Cloud Autoscaler policy.
  984. type AutoscalingPolicy struct {
  985. // CoolDownPeriodSec: The number of seconds that the Autoscaler should
  986. // wait between two succeeding changes to the number of virtual
  987. // machines. You should define an interval that is at least as long as
  988. // the initialization time of a virtual machine and the time it may take
  989. // for replica pool to create the virtual machine. The default is 60
  990. // seconds.
  991. CoolDownPeriodSec int64 `json:"coolDownPeriodSec,omitempty"`
  992. // CpuUtilization: TODO(jbartosik): Add support for scaling based on
  993. // muliple utilization metrics (take max recommendation). Exactly one
  994. // utilization policy should be provided. Configuration parameters of
  995. // CPU based autoscaling policy.
  996. CpuUtilization *AutoscalingPolicyCpuUtilization `json:"cpuUtilization,omitempty"`
  997. // CustomMetricUtilizations: Configuration parameters of autoscaling
  998. // based on custom metric.
  999. CustomMetricUtilizations []*AutoscalingPolicyCustomMetricUtilization `json:"customMetricUtilizations,omitempty"`
  1000. // LoadBalancingUtilization: Configuration parameters of autoscaling
  1001. // based on load balancer.
  1002. LoadBalancingUtilization *AutoscalingPolicyLoadBalancingUtilization `json:"loadBalancingUtilization,omitempty"`
  1003. // MaxNumReplicas: The maximum number of replicas that the Autoscaler
  1004. // can scale up to. This field is required for config to be effective.
  1005. // Maximum number of replicas should be not lower than minimal number of
  1006. // replicas. Absolute limit for this value is defined in Autoscaler
  1007. // backend.
  1008. MaxNumReplicas int64 `json:"maxNumReplicas,omitempty"`
  1009. // MinNumReplicas: The minimum number of replicas that the Autoscaler
  1010. // can scale down to. Can't be less than 0. If not provided Autoscaler
  1011. // will choose default value depending on maximal number of replicas.
  1012. MinNumReplicas int64 `json:"minNumReplicas,omitempty"`
  1013. // ForceSendFields is a list of field names (e.g. "CoolDownPeriodSec")
  1014. // to unconditionally include in API requests. By default, fields with
  1015. // empty values are omitted from API requests. However, any non-pointer,
  1016. // non-interface field appearing in ForceSendFields will be sent to the
  1017. // server regardless of whether the field is empty or not. This may be
  1018. // used to include empty fields in Patch requests.
  1019. ForceSendFields []string `json:"-"`
  1020. }
  1021. func (s *AutoscalingPolicy) MarshalJSON() ([]byte, error) {
  1022. type noMethod AutoscalingPolicy
  1023. raw := noMethod(*s)
  1024. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1025. }
  1026. // AutoscalingPolicyCpuUtilization: CPU utilization policy.
  1027. type AutoscalingPolicyCpuUtilization struct {
  1028. // UtilizationTarget: The target utilization that the Autoscaler should
  1029. // maintain. It is represented as a fraction of used cores. For example:
  1030. // 6 cores used in 8-core VM are represented here as 0.75. Must be a
  1031. // float value between (0, 1]. If not defined, the default is 0.8.
  1032. UtilizationTarget float64 `json:"utilizationTarget,omitempty"`
  1033. // ForceSendFields is a list of field names (e.g. "UtilizationTarget")
  1034. // to unconditionally include in API requests. By default, fields with
  1035. // empty values are omitted from API requests. However, any non-pointer,
  1036. // non-interface field appearing in ForceSendFields will be sent to the
  1037. // server regardless of whether the field is empty or not. This may be
  1038. // used to include empty fields in Patch requests.
  1039. ForceSendFields []string `json:"-"`
  1040. }
  1041. func (s *AutoscalingPolicyCpuUtilization) MarshalJSON() ([]byte, error) {
  1042. type noMethod AutoscalingPolicyCpuUtilization
  1043. raw := noMethod(*s)
  1044. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1045. }
  1046. // AutoscalingPolicyCustomMetricUtilization: Custom utilization metric
  1047. // policy.
  1048. type AutoscalingPolicyCustomMetricUtilization struct {
  1049. // Metric: Identifier of the metric. It should be a Cloud Monitoring
  1050. // metric. The metric can not have negative values. The metric should be
  1051. // an utilization metric (increasing number of VMs handling requests x
  1052. // times should reduce average value of the metric roughly x times). For
  1053. // example you could use:
  1054. // compute.googleapis.com/instance/network/received_bytes_count.
  1055. Metric string `json:"metric,omitempty"`
  1056. // UtilizationTarget: Target value of the metric which Autoscaler should
  1057. // maintain. Must be a positive value.
  1058. UtilizationTarget float64 `json:"utilizationTarget,omitempty"`
  1059. // UtilizationTargetType: Defines type in which utilization_target is
  1060. // expressed.
  1061. //
  1062. // Possible values:
  1063. // "DELTA_PER_MINUTE"
  1064. // "DELTA_PER_SECOND"
  1065. // "GAUGE"
  1066. UtilizationTargetType string `json:"utilizationTargetType,omitempty"`
  1067. // ForceSendFields is a list of field names (e.g. "Metric") to
  1068. // unconditionally include in API requests. By default, fields with
  1069. // empty values are omitted from API requests. However, any non-pointer,
  1070. // non-interface field appearing in ForceSendFields will be sent to the
  1071. // server regardless of whether the field is empty or not. This may be
  1072. // used to include empty fields in Patch requests.
  1073. ForceSendFields []string `json:"-"`
  1074. }
  1075. func (s *AutoscalingPolicyCustomMetricUtilization) MarshalJSON() ([]byte, error) {
  1076. type noMethod AutoscalingPolicyCustomMetricUtilization
  1077. raw := noMethod(*s)
  1078. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1079. }
  1080. // AutoscalingPolicyLoadBalancingUtilization: Load balancing utilization
  1081. // policy.
  1082. type AutoscalingPolicyLoadBalancingUtilization struct {
  1083. // UtilizationTarget: Fraction of backend capacity utilization (set in
  1084. // HTTP load balancing configuration) that Autoscaler should maintain.
  1085. // Must be a positive float value. If not defined, the default is 0.8.
  1086. // For example if your maxRatePerInstance capacity (in HTTP Load
  1087. // Balancing configuration) is set at 10 and you would like to keep
  1088. // number of instances such that each instance receives 7 QPS on
  1089. // average, set this to 0.7.
  1090. UtilizationTarget float64 `json:"utilizationTarget,omitempty"`
  1091. // ForceSendFields is a list of field names (e.g. "UtilizationTarget")
  1092. // to unconditionally include in API requests. By default, fields with
  1093. // empty values are omitted from API requests. However, any non-pointer,
  1094. // non-interface field appearing in ForceSendFields will be sent to the
  1095. // server regardless of whether the field is empty or not. This may be
  1096. // used to include empty fields in Patch requests.
  1097. ForceSendFields []string `json:"-"`
  1098. }
  1099. func (s *AutoscalingPolicyLoadBalancingUtilization) MarshalJSON() ([]byte, error) {
  1100. type noMethod AutoscalingPolicyLoadBalancingUtilization
  1101. raw := noMethod(*s)
  1102. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1103. }
  1104. // Backend: Message containing information of one individual backend.
  1105. type Backend struct {
  1106. // BalancingMode: Specifies the balancing mode for this backend. The
  1107. // default is UTILIZATION but available values are UTILIZATION and RATE.
  1108. //
  1109. // Possible values:
  1110. // "RATE"
  1111. // "UTILIZATION"
  1112. BalancingMode string `json:"balancingMode,omitempty"`
  1113. // CapacityScaler: A multiplier applied to the group's maximum servicing
  1114. // capacity (either UTILIZATION or RATE). Default value is 1, which
  1115. // means the group will serve up to 100% of its configured CPU or RPS
  1116. // (depending on balancingMode). A setting of 0 means the group is
  1117. // completely drained, offering 0% of its available CPU or RPS. Valid
  1118. // range is [0.0,1.0].
  1119. CapacityScaler float64 `json:"capacityScaler,omitempty"`
  1120. // Description: An optional description of this resource. Provide this
  1121. // property when you create the resource.
  1122. Description string `json:"description,omitempty"`
  1123. // Group: The fully-qualified URL of a zonal Instance Group resource.
  1124. // This instance group defines the list of instances that serve traffic.
  1125. // Member virtual machine instances from each instance group must live
  1126. // in the same zone as the instance group itself. No two backends in a
  1127. // backend service are allowed to use same Instance Group
  1128. // resource.
  1129. //
  1130. // Note that you must specify an Instance Group resource using the
  1131. // fully-qualified URL, rather than a partial URL.
  1132. Group string `json:"group,omitempty"`
  1133. // MaxRate: The max requests per second (RPS) of the group. Can be used
  1134. // with either balancing mode, but required if RATE mode. For RATE mode,
  1135. // either maxRate or maxRatePerInstance must be set.
  1136. MaxRate int64 `json:"maxRate,omitempty"`
  1137. // MaxRatePerInstance: The max requests per second (RPS) that a single
  1138. // backed instance can handle. This is used to calculate the capacity of
  1139. // the group. Can be used in either balancing mode. For RATE mode,
  1140. // either maxRate or maxRatePerInstance must be set.
  1141. MaxRatePerInstance float64 `json:"maxRatePerInstance,omitempty"`
  1142. // MaxUtilization: Used when balancingMode is UTILIZATION. This ratio
  1143. // defines the CPU utilization target for the group. The default is 0.8.
  1144. // Valid range is [0.0, 1.0].
  1145. MaxUtilization float64 `json:"maxUtilization,omitempty"`
  1146. // ForceSendFields is a list of field names (e.g. "BalancingMode") to
  1147. // unconditionally include in API requests. By default, fields with
  1148. // empty values are omitted from API requests. However, any non-pointer,
  1149. // non-interface field appearing in ForceSendFields will be sent to the
  1150. // server regardless of whether the field is empty or not. This may be
  1151. // used to include empty fields in Patch requests.
  1152. ForceSendFields []string `json:"-"`
  1153. }
  1154. func (s *Backend) MarshalJSON() ([]byte, error) {
  1155. type noMethod Backend
  1156. raw := noMethod(*s)
  1157. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1158. }
  1159. // BackendService: A BackendService resource. This resource defines a
  1160. // group of backend virtual machines and their serving capacity.
  1161. type BackendService struct {
  1162. // Backends: The list of backends that serve this BackendService.
  1163. Backends []*Backend `json:"backends,omitempty"`
  1164. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  1165. // format.
  1166. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  1167. // Description: An optional description of this resource. Provide this
  1168. // property when you create the resource.
  1169. Description string `json:"description,omitempty"`
  1170. // Fingerprint: Fingerprint of this resource. A hash of the contents
  1171. // stored in this object. This field is used in optimistic locking. This
  1172. // field will be ignored when inserting a BackendService. An up-to-date
  1173. // fingerprint must be provided in order to update the BackendService.
  1174. Fingerprint string `json:"fingerprint,omitempty"`
  1175. // HealthChecks: The list of URLs to the HttpHealthCheck or
  1176. // HttpsHealthCheck resource for health checking this BackendService.
  1177. // Currently at most one health check can be specified, and a health
  1178. // check is required.
  1179. HealthChecks []string `json:"healthChecks,omitempty"`
  1180. // Id: [Output Only] The unique identifier for the resource. This
  1181. // identifier is defined by the server.
  1182. Id uint64 `json:"id,omitempty,string"`
  1183. // Kind: [Output Only] Type of resource. Always compute#backendService
  1184. // for backend services.
  1185. Kind string `json:"kind,omitempty"`
  1186. // Name: Name of the resource. Provided by the client when the resource
  1187. // is created. The name must be 1-63 characters long, and comply with
  1188. // RFC1035. Specifically, the name must be 1-63 characters long and
  1189. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  1190. // the first character must be a lowercase letter, and all following
  1191. // characters must be a dash, lowercase letter, or digit, except the
  1192. // last character, which cannot be a dash.
  1193. Name string `json:"name,omitempty"`
  1194. // Port: Deprecated in favor of portName. The TCP port to connect on the
  1195. // backend. The default value is 80.
  1196. Port int64 `json:"port,omitempty"`
  1197. // PortName: Name of backend port. The same name should appear in the
  1198. // resource views referenced by this service. Required.
  1199. PortName string `json:"portName,omitempty"`
  1200. // Possible values:
  1201. // "HTTP"
  1202. // "HTTPS"
  1203. Protocol string `json:"protocol,omitempty"`
  1204. // SelfLink: [Output Only] Server-defined URL for the resource.
  1205. SelfLink string `json:"selfLink,omitempty"`
  1206. // TimeoutSec: How many seconds to wait for the backend before
  1207. // considering it a failed request. Default is 30 seconds. Valid range
  1208. // is [1, 86400].
  1209. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  1210. // ServerResponse contains the HTTP response code and headers from the
  1211. // server.
  1212. googleapi.ServerResponse `json:"-"`
  1213. // ForceSendFields is a list of field names (e.g. "Backends") to
  1214. // unconditionally include in API requests. By default, fields with
  1215. // empty values are omitted from API requests. However, any non-pointer,
  1216. // non-interface field appearing in ForceSendFields will be sent to the
  1217. // server regardless of whether the field is empty or not. This may be
  1218. // used to include empty fields in Patch requests.
  1219. ForceSendFields []string `json:"-"`
  1220. }
  1221. func (s *BackendService) MarshalJSON() ([]byte, error) {
  1222. type noMethod BackendService
  1223. raw := noMethod(*s)
  1224. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1225. }
  1226. type BackendServiceGroupHealth struct {
  1227. HealthStatus []*HealthStatus `json:"healthStatus,omitempty"`
  1228. // Kind: [Output Only] Type of resource. Always
  1229. // compute#backendServiceGroupHealth for the health of backend services.
  1230. Kind string `json:"kind,omitempty"`
  1231. // ServerResponse contains the HTTP response code and headers from the
  1232. // server.
  1233. googleapi.ServerResponse `json:"-"`
  1234. // ForceSendFields is a list of field names (e.g. "HealthStatus") to
  1235. // unconditionally include in API requests. By default, fields with
  1236. // empty values are omitted from API requests. However, any non-pointer,
  1237. // non-interface field appearing in ForceSendFields will be sent to the
  1238. // server regardless of whether the field is empty or not. This may be
  1239. // used to include empty fields in Patch requests.
  1240. ForceSendFields []string `json:"-"`
  1241. }
  1242. func (s *BackendServiceGroupHealth) MarshalJSON() ([]byte, error) {
  1243. type noMethod BackendServiceGroupHealth
  1244. raw := noMethod(*s)
  1245. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1246. }
  1247. // BackendServiceList: Contains a list of BackendService resources.
  1248. type BackendServiceList struct {
  1249. // Id: [Output Only] The unique identifier for the resource. This
  1250. // identifier is defined by the server.
  1251. Id string `json:"id,omitempty"`
  1252. // Items: A list of BackendService resources.
  1253. Items []*BackendService `json:"items,omitempty"`
  1254. // Kind: [Output Only] Type of resource. Always
  1255. // compute#backendServiceList for lists of backend services.
  1256. Kind string `json:"kind,omitempty"`
  1257. // NextPageToken: [Output Only] This token allows you to get the next
  1258. // page of results for list requests. If the number of results is larger
  1259. // than maxResults, use the nextPageToken as a value for the query
  1260. // parameter pageToken in the next list request. Subsequent list
  1261. // requests will have their own nextPageToken to continue paging through
  1262. // the results.
  1263. NextPageToken string `json:"nextPageToken,omitempty"`
  1264. // SelfLink: [Output Only] Server-defined URL for this resource.
  1265. SelfLink string `json:"selfLink,omitempty"`
  1266. // ServerResponse contains the HTTP response code and headers from the
  1267. // server.
  1268. googleapi.ServerResponse `json:"-"`
  1269. // ForceSendFields is a list of field names (e.g. "Id") to
  1270. // unconditionally include in API requests. By default, fields with
  1271. // empty values are omitted from API requests. However, any non-pointer,
  1272. // non-interface field appearing in ForceSendFields will be sent to the
  1273. // server regardless of whether the field is empty or not. This may be
  1274. // used to include empty fields in Patch requests.
  1275. ForceSendFields []string `json:"-"`
  1276. }
  1277. func (s *BackendServiceList) MarshalJSON() ([]byte, error) {
  1278. type noMethod BackendServiceList
  1279. raw := noMethod(*s)
  1280. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1281. }
  1282. // DeprecationStatus: Deprecation status for a public resource.
  1283. type DeprecationStatus struct {
  1284. // Deleted: An optional RFC3339 timestamp on or after which the
  1285. // deprecation state of this resource will be changed to DELETED.
  1286. Deleted string `json:"deleted,omitempty"`
  1287. // Deprecated: An optional RFC3339 timestamp on or after which the
  1288. // deprecation state of this resource will be changed to DEPRECATED.
  1289. Deprecated string `json:"deprecated,omitempty"`
  1290. // Obsolete: An optional RFC3339 timestamp on or after which the
  1291. // deprecation state of this resource will be changed to OBSOLETE.
  1292. Obsolete string `json:"obsolete,omitempty"`
  1293. // Replacement: The URL of the suggested replacement for a deprecated
  1294. // resource. The suggested replacement resource must be the same kind of
  1295. // resource as the deprecated resource.
  1296. Replacement string `json:"replacement,omitempty"`
  1297. // State: The deprecation state of this resource. This can be
  1298. // DEPRECATED, OBSOLETE, or DELETED. Operations which create a new
  1299. // resource using a DEPRECATED resource will return successfully, but
  1300. // with a warning indicating the deprecated resource and recommending
  1301. // its replacement. Operations which use OBSOLETE or DELETED resources
  1302. // will be rejected and result in an error.
  1303. //
  1304. // Possible values:
  1305. // "DELETED"
  1306. // "DEPRECATED"
  1307. // "OBSOLETE"
  1308. State string `json:"state,omitempty"`
  1309. // ForceSendFields is a list of field names (e.g. "Deleted") to
  1310. // unconditionally include in API requests. By default, fields with
  1311. // empty values are omitted from API requests. However, any non-pointer,
  1312. // non-interface field appearing in ForceSendFields will be sent to the
  1313. // server regardless of whether the field is empty or not. This may be
  1314. // used to include empty fields in Patch requests.
  1315. ForceSendFields []string `json:"-"`
  1316. }
  1317. func (s *DeprecationStatus) MarshalJSON() ([]byte, error) {
  1318. type noMethod DeprecationStatus
  1319. raw := noMethod(*s)
  1320. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1321. }
  1322. // Disk: A Disk resource.
  1323. type Disk struct {
  1324. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  1325. // format.
  1326. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  1327. // Description: An optional description of this resource. Provide this
  1328. // property when you create the resource.
  1329. Description string `json:"description,omitempty"`
  1330. // Id: [Output Only] The unique identifier for the resource. This
  1331. // identifier is defined by the server.
  1332. Id uint64 `json:"id,omitempty,string"`
  1333. // Kind: [Output Only] Type of the resource. Always compute#disk for
  1334. // disks.
  1335. Kind string `json:"kind,omitempty"`
  1336. // LastAttachTimestamp: [Output Only] Last attach timestamp in RFC3339
  1337. // text format.
  1338. LastAttachTimestamp string `json:"lastAttachTimestamp,omitempty"`
  1339. // LastDetachTimestamp: [Output Only] Last detach timestamp in RFC3339
  1340. // text format.
  1341. LastDetachTimestamp string `json:"lastDetachTimestamp,omitempty"`
  1342. // Licenses: Any applicable publicly visible licenses.
  1343. Licenses []string `json:"licenses,omitempty"`
  1344. // Name: Name of the resource; provided by the client when the resource
  1345. // is created. The name must be 1-63 characters long, and comply with
  1346. // RFC1035. Specifically, the name must be 1-63 characters long and
  1347. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  1348. // the first character must be a lowercase letter, and all following
  1349. // characters must be a dash, lowercase letter, or digit, except the
  1350. // last character, which cannot be a dash.
  1351. Name string `json:"name,omitempty"`
  1352. // Options: Internal use only.
  1353. Options string `json:"options,omitempty"`
  1354. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  1355. // resource.
  1356. SelfLink string `json:"selfLink,omitempty"`
  1357. // SizeGb: Size of the persistent disk, specified in GB. You can specify
  1358. // this field when creating a persistent disk using the sourceImage or
  1359. // sourceSnapshot parameter, or specify it alone to create an empty
  1360. // persistent disk.
  1361. //
  1362. // If you specify this field along with sourceImage or sourceSnapshot,
  1363. // the value of sizeGb must not be less than the size of the sourceImage
  1364. // or the size of the snapshot.
  1365. SizeGb int64 `json:"sizeGb,omitempty,string"`
  1366. // SourceImage: The source image used to create this disk. If the source
  1367. // image is deleted from the system, this field will not be set, even if
  1368. // an image with the same name has been re-created.
  1369. //
  1370. // When creating a disk, you can provide a private (custom) image using
  1371. // the following input, and Compute Engine will use the corresponding
  1372. // image from your project. For example:
  1373. //
  1374. // global/images/my-private-image
  1375. //
  1376. // Or you can provide an image from a publicly-available project. For
  1377. // example, to use a Debian image from the debian-cloud project, make
  1378. // sure to include the project in the
  1379. // URL:
  1380. //
  1381. // projects/debian-cloud/global/images/debian-7-wheezy-vYYYYMMDD
  1382. //
  1383. // where vYYYYMMDD is the image version. The fully-qualified URL will
  1384. // also work in both cases.
  1385. SourceImage string `json:"sourceImage,omitempty"`
  1386. // SourceImageId: The ID value of the image used to create this disk.
  1387. // This value identifies the exact image that was used to create this
  1388. // persistent disk. For example, if you created the persistent disk from
  1389. // an image that was later deleted and recreated under the same name,
  1390. // the source image ID would identify the exact version of the image
  1391. // that was used.
  1392. SourceImageId string `json:"sourceImageId,omitempty"`
  1393. // SourceSnapshot: The source snapshot used to create this disk. You can
  1394. // provide this as a partial or full URL to the resource. For example,
  1395. // the following are valid values:
  1396. // -
  1397. // https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
  1398. // - projects/project/global/snapshots/snapshot
  1399. // - global/snapshots/snapshot
  1400. SourceSnapshot string `json:"sourceSnapshot,omitempty"`
  1401. // SourceSnapshotId: [Output Only] The unique ID of the snapshot used to
  1402. // create this disk. This value identifies the exact snapshot that was
  1403. // used to create this persistent disk. For example, if you created the
  1404. // persistent disk from a snapshot that was later deleted and recreated
  1405. // under the same name, the source snapshot ID would identify the exact
  1406. // version of the snapshot that was used.
  1407. SourceSnapshotId string `json:"sourceSnapshotId,omitempty"`
  1408. // Status: [Output Only] The status of disk creation. Applicable
  1409. // statuses includes: CREATING, FAILED, READY, RESTORING.
  1410. //
  1411. // Possible values:
  1412. // "CREATING"
  1413. // "FAILED"
  1414. // "READY"
  1415. // "RESTORING"
  1416. Status string `json:"status,omitempty"`
  1417. // Type: URL of the disk type resource describing which disk type to use
  1418. // to create the disk; provided by the client when the disk is created.
  1419. Type string `json:"type,omitempty"`
  1420. // Users: Links to the users of the disk (attached instances) in form:
  1421. // project/zones/zone/instances/instance
  1422. Users []string `json:"users,omitempty"`
  1423. // Zone: [Output Only] URL of the zone where the disk resides.
  1424. Zone string `json:"zone,omitempty"`
  1425. // ServerResponse contains the HTTP response code and headers from the
  1426. // server.
  1427. googleapi.ServerResponse `json:"-"`
  1428. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  1429. // to unconditionally include in API requests. By default, fields with
  1430. // empty values are omitted from API requests. However, any non-pointer,
  1431. // non-interface field appearing in ForceSendFields will be sent to the
  1432. // server regardless of whether the field is empty or not. This may be
  1433. // used to include empty fields in Patch requests.
  1434. ForceSendFields []string `json:"-"`
  1435. }
  1436. func (s *Disk) MarshalJSON() ([]byte, error) {
  1437. type noMethod Disk
  1438. raw := noMethod(*s)
  1439. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1440. }
  1441. type DiskAggregatedList struct {
  1442. // Id: [Output Only] The unique identifier for the resource. This
  1443. // identifier is defined by the server.
  1444. Id string `json:"id,omitempty"`
  1445. // Items: [Output Only] A map of scoped disk lists.
  1446. Items map[string]DisksScopedList `json:"items,omitempty"`
  1447. // Kind: [Output Only] Type of resource. Always
  1448. // compute#diskAggregatedList for aggregated lists of persistent disks.
  1449. Kind string `json:"kind,omitempty"`
  1450. // NextPageToken: [Output Only] This token allows you to get the next
  1451. // page of results for list requests. If the number of results is larger
  1452. // than maxResults, use the nextPageToken as a value for the query
  1453. // parameter pageToken in the next list request. Subsequent list
  1454. // requests will have their own nextPageToken to continue paging through
  1455. // the results.
  1456. NextPageToken string `json:"nextPageToken,omitempty"`
  1457. // SelfLink: [Output Only] Server-defined URL for this resource.
  1458. SelfLink string `json:"selfLink,omitempty"`
  1459. // ServerResponse contains the HTTP response code and headers from the
  1460. // server.
  1461. googleapi.ServerResponse `json:"-"`
  1462. // ForceSendFields is a list of field names (e.g. "Id") to
  1463. // unconditionally include in API requests. By default, fields with
  1464. // empty values are omitted from API requests. However, any non-pointer,
  1465. // non-interface field appearing in ForceSendFields will be sent to the
  1466. // server regardless of whether the field is empty or not. This may be
  1467. // used to include empty fields in Patch requests.
  1468. ForceSendFields []string `json:"-"`
  1469. }
  1470. func (s *DiskAggregatedList) MarshalJSON() ([]byte, error) {
  1471. type noMethod DiskAggregatedList
  1472. raw := noMethod(*s)
  1473. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1474. }
  1475. // DiskList: A list of Disk resources.
  1476. type DiskList struct {
  1477. // Id: [Output Only] The unique identifier for the resource. This
  1478. // identifier is defined by the server.
  1479. Id string `json:"id,omitempty"`
  1480. // Items: [Output Only] A list of persistent disks.
  1481. Items []*Disk `json:"items,omitempty"`
  1482. // Kind: [Output Only] Type of resource. Always compute#diskList for
  1483. // lists of disks.
  1484. Kind string `json:"kind,omitempty"`
  1485. // NextPageToken: [Output Only] This token allows you to get the next
  1486. // page of results for list requests. If the number of results is larger
  1487. // than maxResults, use the nextPageToken as a value for the query
  1488. // parameter pageToken in the next list request. Subsequent list
  1489. // requests will have their own nextPageToken to continue paging through
  1490. // the results.
  1491. NextPageToken string `json:"nextPageToken,omitempty"`
  1492. // SelfLink: [Output Only] Server-defined URL for this resource.
  1493. SelfLink string `json:"selfLink,omitempty"`
  1494. // ServerResponse contains the HTTP response code and headers from the
  1495. // server.
  1496. googleapi.ServerResponse `json:"-"`
  1497. // ForceSendFields is a list of field names (e.g. "Id") to
  1498. // unconditionally include in API requests. By default, fields with
  1499. // empty values are omitted from API requests. However, any non-pointer,
  1500. // non-interface field appearing in ForceSendFields will be sent to the
  1501. // server regardless of whether the field is empty or not. This may be
  1502. // used to include empty fields in Patch requests.
  1503. ForceSendFields []string `json:"-"`
  1504. }
  1505. func (s *DiskList) MarshalJSON() ([]byte, error) {
  1506. type noMethod DiskList
  1507. raw := noMethod(*s)
  1508. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1509. }
  1510. type DiskMoveRequest struct {
  1511. // DestinationZone: The URL of the destination zone to move the disk to.
  1512. // This can be a full or partial URL. For example, the following are all
  1513. // valid URLs to a zone:
  1514. // - https://www.googleapis.com/compute/v1/projects/project/zones/zone
  1515. //
  1516. // - projects/project/zones/zone
  1517. // - zones/zone
  1518. DestinationZone string `json:"destinationZone,omitempty"`
  1519. // TargetDisk: The URL of the target disk to move. This can be a full or
  1520. // partial URL. For example, the following are all valid URLs to a disk:
  1521. //
  1522. // -
  1523. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk
  1524. // - projects/project/zones/zone/disks/disk
  1525. // - zones/zone/disks/disk
  1526. TargetDisk string `json:"targetDisk,omitempty"`
  1527. // ForceSendFields is a list of field names (e.g. "DestinationZone") to
  1528. // 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 *DiskMoveRequest) MarshalJSON() ([]byte, error) {
  1536. type noMethod DiskMoveRequest
  1537. raw := noMethod(*s)
  1538. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1539. }
  1540. // DiskType: A disk type resource.
  1541. type DiskType struct {
  1542. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  1543. // format.
  1544. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  1545. // DefaultDiskSizeGb: [Output Only] Server-defined default disk size in
  1546. // GB.
  1547. DefaultDiskSizeGb int64 `json:"defaultDiskSizeGb,omitempty,string"`
  1548. // Deprecated: [Output Only] The deprecation status associated with this
  1549. // disk type.
  1550. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  1551. // Description: [Output Only] An optional description of this resource.
  1552. Description string `json:"description,omitempty"`
  1553. // Id: [Output Only] The unique identifier for the resource. This
  1554. // identifier is defined by the server.
  1555. Id uint64 `json:"id,omitempty,string"`
  1556. // Kind: [Output Only] Type of the resource. Always compute#diskType for
  1557. // disk types.
  1558. Kind string `json:"kind,omitempty"`
  1559. // Name: [Output Only] Name of the resource.
  1560. Name string `json:"name,omitempty"`
  1561. // SelfLink: [Output Only] Server-defined URL for the resource.
  1562. SelfLink string `json:"selfLink,omitempty"`
  1563. // ValidDiskSize: [Output Only] An optional textual description of the
  1564. // valid disk size, such as "10GB-10TB".
  1565. ValidDiskSize string `json:"validDiskSize,omitempty"`
  1566. // Zone: [Output Only] URL of the zone where the disk type resides.
  1567. Zone string `json:"zone,omitempty"`
  1568. // ServerResponse contains the HTTP response code and headers from the
  1569. // server.
  1570. googleapi.ServerResponse `json:"-"`
  1571. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  1572. // to unconditionally include in API requests. By default, fields with
  1573. // empty values are omitted from API requests. However, any non-pointer,
  1574. // non-interface field appearing in ForceSendFields will be sent to the
  1575. // server regardless of whether the field is empty or not. This may be
  1576. // used to include empty fields in Patch requests.
  1577. ForceSendFields []string `json:"-"`
  1578. }
  1579. func (s *DiskType) MarshalJSON() ([]byte, error) {
  1580. type noMethod DiskType
  1581. raw := noMethod(*s)
  1582. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1583. }
  1584. type DiskTypeAggregatedList struct {
  1585. // Id: [Output Only] The unique identifier for the resource. This
  1586. // identifier is defined by the server.
  1587. Id string `json:"id,omitempty"`
  1588. // Items: [Output Only] A map of scoped disk type lists.
  1589. Items map[string]DiskTypesScopedList `json:"items,omitempty"`
  1590. // Kind: [Output Only] Type of resource. Always
  1591. // compute#diskTypeAggregatedList.
  1592. Kind string `json:"kind,omitempty"`
  1593. // NextPageToken: [Output Only] This token allows you to get the next
  1594. // page of results for list requests. If the number of results is larger
  1595. // than maxResults, use the nextPageToken as a value for the query
  1596. // parameter pageToken in the next list request. Subsequent list
  1597. // requests will have their own nextPageToken to continue paging through
  1598. // the results.
  1599. NextPageToken string `json:"nextPageToken,omitempty"`
  1600. // SelfLink: [Output Only] Server-defined URL for this resource.
  1601. SelfLink string `json:"selfLink,omitempty"`
  1602. // ServerResponse contains the HTTP response code and headers from the
  1603. // server.
  1604. googleapi.ServerResponse `json:"-"`
  1605. // ForceSendFields is a list of field names (e.g. "Id") to
  1606. // unconditionally include in API requests. By default, fields with
  1607. // empty values are omitted from API requests. However, any non-pointer,
  1608. // non-interface field appearing in ForceSendFields will be sent to the
  1609. // server regardless of whether the field is empty or not. This may be
  1610. // used to include empty fields in Patch requests.
  1611. ForceSendFields []string `json:"-"`
  1612. }
  1613. func (s *DiskTypeAggregatedList) MarshalJSON() ([]byte, error) {
  1614. type noMethod DiskTypeAggregatedList
  1615. raw := noMethod(*s)
  1616. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1617. }
  1618. // DiskTypeList: Contains a list of disk type resources.
  1619. type DiskTypeList struct {
  1620. // Id: [Output Only] The unique identifier for the resource. This
  1621. // identifier is defined by the server.
  1622. Id string `json:"id,omitempty"`
  1623. // Items: [Output Only] A list of Disk Type resources.
  1624. Items []*DiskType `json:"items,omitempty"`
  1625. // Kind: [Output Only] Type of resource. Always compute#diskTypeList for
  1626. // disk types.
  1627. Kind string `json:"kind,omitempty"`
  1628. // NextPageToken: [Output Only] This token allows you to get the next
  1629. // page of results for list requests. If the number of results is larger
  1630. // than maxResults, use the nextPageToken as a value for the query
  1631. // parameter pageToken in the next list request. Subsequent list
  1632. // requests will have their own nextPageToken to continue paging through
  1633. // the results.
  1634. NextPageToken string `json:"nextPageToken,omitempty"`
  1635. // SelfLink: [Output Only] Server-defined URL for this resource.
  1636. SelfLink string `json:"selfLink,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. "Id") to
  1641. // 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 *DiskTypeList) MarshalJSON() ([]byte, error) {
  1649. type noMethod DiskTypeList
  1650. raw := noMethod(*s)
  1651. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1652. }
  1653. type DiskTypesScopedList struct {
  1654. // DiskTypes: [Output Only] List of disk types contained in this scope.
  1655. DiskTypes []*DiskType `json:"diskTypes,omitempty"`
  1656. // Warning: [Output Only] Informational warning which replaces the list
  1657. // of disk types when the list is empty.
  1658. Warning *DiskTypesScopedListWarning `json:"warning,omitempty"`
  1659. // ForceSendFields is a list of field names (e.g. "DiskTypes") to
  1660. // unconditionally include in API requests. By default, fields with
  1661. // empty values are omitted from API requests. However, any non-pointer,
  1662. // non-interface field appearing in ForceSendFields will be sent to the
  1663. // server regardless of whether the field is empty or not. This may be
  1664. // used to include empty fields in Patch requests.
  1665. ForceSendFields []string `json:"-"`
  1666. }
  1667. func (s *DiskTypesScopedList) MarshalJSON() ([]byte, error) {
  1668. type noMethod DiskTypesScopedList
  1669. raw := noMethod(*s)
  1670. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1671. }
  1672. // DiskTypesScopedListWarning: [Output Only] Informational warning which
  1673. // replaces the list of disk types when the list is empty.
  1674. type DiskTypesScopedListWarning struct {
  1675. // Code: [Output Only] A warning code, if applicable. For example,
  1676. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1677. // the response.
  1678. //
  1679. // Possible values:
  1680. // "DEPRECATED_RESOURCE_USED"
  1681. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1682. // "INJECTED_KERNELS_DEPRECATED"
  1683. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1684. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1685. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1686. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1687. // "NEXT_HOP_NOT_RUNNING"
  1688. // "NOT_CRITICAL_ERROR"
  1689. // "NO_RESULTS_ON_PAGE"
  1690. // "REQUIRED_TOS_AGREEMENT"
  1691. // "RESOURCE_NOT_DELETED"
  1692. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1693. // "UNREACHABLE"
  1694. Code string `json:"code,omitempty"`
  1695. // Data: [Output Only] Metadata about this warning in key: value format.
  1696. // For example:
  1697. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1698. Data []*DiskTypesScopedListWarningData `json:"data,omitempty"`
  1699. // Message: [Output Only] A human-readable description of the warning
  1700. // code.
  1701. Message string `json:"message,omitempty"`
  1702. // ForceSendFields is a list of field names (e.g. "Code") to
  1703. // unconditionally include in API requests. By default, fields with
  1704. // empty values are omitted from API requests. However, any non-pointer,
  1705. // non-interface field appearing in ForceSendFields will be sent to the
  1706. // server regardless of whether the field is empty or not. This may be
  1707. // used to include empty fields in Patch requests.
  1708. ForceSendFields []string `json:"-"`
  1709. }
  1710. func (s *DiskTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  1711. type noMethod DiskTypesScopedListWarning
  1712. raw := noMethod(*s)
  1713. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1714. }
  1715. type DiskTypesScopedListWarningData struct {
  1716. // Key: [Output Only] A key that provides more detail on the warning
  1717. // being returned. For example, for warnings where there are no results
  1718. // in a list request for a particular zone, this key might be scope and
  1719. // the key value might be the zone name. Other examples might be a key
  1720. // indicating a deprecated resource, and a suggested replacement, or a
  1721. // warning about invalid network settings (for example, if an instance
  1722. // attempts to perform IP forwarding but is not enabled for IP
  1723. // forwarding).
  1724. Key string `json:"key,omitempty"`
  1725. // Value: [Output Only] A warning data value corresponding to the key.
  1726. Value string `json:"value,omitempty"`
  1727. // ForceSendFields is a list of field names (e.g. "Key") to
  1728. // unconditionally include in API requests. By default, fields with
  1729. // empty values are omitted from API requests. However, any non-pointer,
  1730. // non-interface field appearing in ForceSendFields will be sent to the
  1731. // server regardless of whether the field is empty or not. This may be
  1732. // used to include empty fields in Patch requests.
  1733. ForceSendFields []string `json:"-"`
  1734. }
  1735. func (s *DiskTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  1736. type noMethod DiskTypesScopedListWarningData
  1737. raw := noMethod(*s)
  1738. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1739. }
  1740. type DisksScopedList struct {
  1741. // Disks: [Output Only] List of disks contained in this scope.
  1742. Disks []*Disk `json:"disks,omitempty"`
  1743. // Warning: [Output Only] Informational warning which replaces the list
  1744. // of disks when the list is empty.
  1745. Warning *DisksScopedListWarning `json:"warning,omitempty"`
  1746. // ForceSendFields is a list of field names (e.g. "Disks") to
  1747. // unconditionally include in API requests. By default, fields with
  1748. // empty values are omitted from API requests. However, any non-pointer,
  1749. // non-interface field appearing in ForceSendFields will be sent to the
  1750. // server regardless of whether the field is empty or not. This may be
  1751. // used to include empty fields in Patch requests.
  1752. ForceSendFields []string `json:"-"`
  1753. }
  1754. func (s *DisksScopedList) MarshalJSON() ([]byte, error) {
  1755. type noMethod DisksScopedList
  1756. raw := noMethod(*s)
  1757. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1758. }
  1759. // DisksScopedListWarning: [Output Only] Informational warning which
  1760. // replaces the list of disks when the list is empty.
  1761. type DisksScopedListWarning struct {
  1762. // Code: [Output Only] A warning code, if applicable. For example,
  1763. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1764. // the response.
  1765. //
  1766. // Possible values:
  1767. // "DEPRECATED_RESOURCE_USED"
  1768. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1769. // "INJECTED_KERNELS_DEPRECATED"
  1770. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1771. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1772. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1773. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1774. // "NEXT_HOP_NOT_RUNNING"
  1775. // "NOT_CRITICAL_ERROR"
  1776. // "NO_RESULTS_ON_PAGE"
  1777. // "REQUIRED_TOS_AGREEMENT"
  1778. // "RESOURCE_NOT_DELETED"
  1779. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1780. // "UNREACHABLE"
  1781. Code string `json:"code,omitempty"`
  1782. // Data: [Output Only] Metadata about this warning in key: value format.
  1783. // For example:
  1784. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1785. Data []*DisksScopedListWarningData `json:"data,omitempty"`
  1786. // Message: [Output Only] A human-readable description of the warning
  1787. // code.
  1788. Message string `json:"message,omitempty"`
  1789. // ForceSendFields is a list of field names (e.g. "Code") to
  1790. // unconditionally include in API requests. By default, fields with
  1791. // empty values are omitted from API requests. However, any non-pointer,
  1792. // non-interface field appearing in ForceSendFields will be sent to the
  1793. // server regardless of whether the field is empty or not. This may be
  1794. // used to include empty fields in Patch requests.
  1795. ForceSendFields []string `json:"-"`
  1796. }
  1797. func (s *DisksScopedListWarning) MarshalJSON() ([]byte, error) {
  1798. type noMethod DisksScopedListWarning
  1799. raw := noMethod(*s)
  1800. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1801. }
  1802. type DisksScopedListWarningData struct {
  1803. // Key: [Output Only] A key that provides more detail on the warning
  1804. // being returned. For example, for warnings where there are no results
  1805. // in a list request for a particular zone, this key might be scope and
  1806. // the key value might be the zone name. Other examples might be a key
  1807. // indicating a deprecated resource, and a suggested replacement, or a
  1808. // warning about invalid network settings (for example, if an instance
  1809. // attempts to perform IP forwarding but is not enabled for IP
  1810. // forwarding).
  1811. Key string `json:"key,omitempty"`
  1812. // Value: [Output Only] A warning data value corresponding to the key.
  1813. Value string `json:"value,omitempty"`
  1814. // ForceSendFields is a list of field names (e.g. "Key") to
  1815. // unconditionally include in API requests. By default, fields with
  1816. // empty values are omitted from API requests. However, any non-pointer,
  1817. // non-interface field appearing in ForceSendFields will be sent to the
  1818. // server regardless of whether the field is empty or not. This may be
  1819. // used to include empty fields in Patch requests.
  1820. ForceSendFields []string `json:"-"`
  1821. }
  1822. func (s *DisksScopedListWarningData) MarshalJSON() ([]byte, error) {
  1823. type noMethod DisksScopedListWarningData
  1824. raw := noMethod(*s)
  1825. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1826. }
  1827. // Firewall: A Firewall resource.
  1828. type Firewall struct {
  1829. // Allowed: The list of rules specified by this firewall. Each rule
  1830. // specifies a protocol and port-range tuple that describes a permitted
  1831. // connection.
  1832. Allowed []*FirewallAllowed `json:"allowed,omitempty"`
  1833. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  1834. // format.
  1835. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  1836. // Description: An optional description of this resource. Provide this
  1837. // property when you create the resource.
  1838. Description string `json:"description,omitempty"`
  1839. // Id: [Output Only] The unique identifier for the resource. This
  1840. // identifier is defined by the server.
  1841. Id uint64 `json:"id,omitempty,string"`
  1842. // Kind: [Output Ony] Type of the resource. Always compute#firewall for
  1843. // firewall rules.
  1844. Kind string `json:"kind,omitempty"`
  1845. // Name: Name of the resource; provided by the client when the resource
  1846. // is created. The name must be 1-63 characters long, and comply with
  1847. // RFC1035. Specifically, the name must be 1-63 characters long and
  1848. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  1849. // the first character must be a lowercase letter, and all following
  1850. // characters must be a dash, lowercase letter, or digit, except the
  1851. // last character, which cannot be a dash.
  1852. Name string `json:"name,omitempty"`
  1853. // Network: URL of the network resource for this firewall rule. If not
  1854. // specified when creating a firewall rule, the default network is
  1855. // used:
  1856. // global/networks/default
  1857. // If you choose to specify this property, you can specify the network
  1858. // as a full or partial URL. For example, the following are all valid
  1859. // URLs:
  1860. // -
  1861. // https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network
  1862. // - projects/myproject/global/networks/my-network
  1863. // - global/networks/default
  1864. Network string `json:"network,omitempty"`
  1865. // SelfLink: [Output Only] Server-defined URL for the resource.
  1866. SelfLink string `json:"selfLink,omitempty"`
  1867. // SourceRanges: The IP address blocks that this rule applies to,
  1868. // expressed in CIDR format. One or both of sourceRanges and sourceTags
  1869. // may be set.
  1870. //
  1871. // If both properties are set, an inbound connection is allowed if the
  1872. // range matches the sourceRanges OR the tag of the source matches the
  1873. // sourceTags property. The connection does not need to match both
  1874. // properties.
  1875. SourceRanges []string `json:"sourceRanges,omitempty"`
  1876. // SourceTags: A list of instance tags which this rule applies to. One
  1877. // or both of sourceRanges and sourceTags may be set.
  1878. //
  1879. // If both properties are set, an inbound connection is allowed if the
  1880. // range matches the sourceRanges OR the tag of the source matches the
  1881. // sourceTags property. The connection does not need to match both
  1882. // properties.
  1883. SourceTags []string `json:"sourceTags,omitempty"`
  1884. // TargetTags: A list of instance tags indicating sets of instances
  1885. // located in the network that may make network connections as specified
  1886. // in allowed[]. If no targetTags are specified, the firewall rule
  1887. // applies to all instances on the specified network.
  1888. TargetTags []string `json:"targetTags,omitempty"`
  1889. // ServerResponse contains the HTTP response code and headers from the
  1890. // server.
  1891. googleapi.ServerResponse `json:"-"`
  1892. // ForceSendFields is a list of field names (e.g. "Allowed") to
  1893. // unconditionally include in API requests. By default, fields with
  1894. // empty values are omitted from API requests. However, any non-pointer,
  1895. // non-interface field appearing in ForceSendFields will be sent to the
  1896. // server regardless of whether the field is empty or not. This may be
  1897. // used to include empty fields in Patch requests.
  1898. ForceSendFields []string `json:"-"`
  1899. }
  1900. func (s *Firewall) MarshalJSON() ([]byte, error) {
  1901. type noMethod Firewall
  1902. raw := noMethod(*s)
  1903. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1904. }
  1905. type FirewallAllowed struct {
  1906. // IPProtocol: The IP protocol that is allowed for this rule. The
  1907. // protocol type is required when creating a firewall. This value can
  1908. // either be one of the following well known protocol strings (tcp, udp,
  1909. // icmp, esp, ah, sctp), or the IP protocol number.
  1910. IPProtocol string `json:"IPProtocol,omitempty"`
  1911. // Ports: An optional list of ports which are allowed. This field is
  1912. // only applicable for UDP or TCP protocol. Each entry must be either an
  1913. // integer or a range. If not specified, connections through any port
  1914. // are allowed
  1915. //
  1916. // Example inputs include: ["22"], ["80","443"], and ["12345-12349"].
  1917. Ports []string `json:"ports,omitempty"`
  1918. // ForceSendFields is a list of field names (e.g. "IPProtocol") to
  1919. // unconditionally include in API requests. By default, fields with
  1920. // empty values are omitted from API requests. However, any non-pointer,
  1921. // non-interface field appearing in ForceSendFields will be sent to the
  1922. // server regardless of whether the field is empty or not. This may be
  1923. // used to include empty fields in Patch requests.
  1924. ForceSendFields []string `json:"-"`
  1925. }
  1926. func (s *FirewallAllowed) MarshalJSON() ([]byte, error) {
  1927. type noMethod FirewallAllowed
  1928. raw := noMethod(*s)
  1929. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1930. }
  1931. // FirewallList: Contains a list of Firewall resources.
  1932. type FirewallList struct {
  1933. // Id: [Output Only] The unique identifier for the resource. This
  1934. // identifier is defined by the server.
  1935. Id string `json:"id,omitempty"`
  1936. // Items: [Output Only] A list of Firewall resources.
  1937. Items []*Firewall `json:"items,omitempty"`
  1938. // Kind: [Output Only] Type of resource. Always compute#firewallList for
  1939. // lists of firewalls.
  1940. Kind string `json:"kind,omitempty"`
  1941. // NextPageToken: [Output Only] This token allows you to get the next
  1942. // page of results for list requests. If the number of results is larger
  1943. // than maxResults, use the nextPageToken as a value for the query
  1944. // parameter pageToken in the next list request. Subsequent list
  1945. // requests will have their own nextPageToken to continue paging through
  1946. // the results.
  1947. NextPageToken string `json:"nextPageToken,omitempty"`
  1948. // SelfLink: [Output Only] Server-defined URL for this resource.
  1949. SelfLink string `json:"selfLink,omitempty"`
  1950. // ServerResponse contains the HTTP response code and headers from the
  1951. // server.
  1952. googleapi.ServerResponse `json:"-"`
  1953. // ForceSendFields is a list of field names (e.g. "Id") to
  1954. // unconditionally include in API requests. By default, fields with
  1955. // empty values are omitted from API requests. However, any non-pointer,
  1956. // non-interface field appearing in ForceSendFields will be sent to the
  1957. // server regardless of whether the field is empty or not. This may be
  1958. // used to include empty fields in Patch requests.
  1959. ForceSendFields []string `json:"-"`
  1960. }
  1961. func (s *FirewallList) MarshalJSON() ([]byte, error) {
  1962. type noMethod FirewallList
  1963. raw := noMethod(*s)
  1964. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1965. }
  1966. // ForwardingRule: A ForwardingRule resource. A ForwardingRule resource
  1967. // specifies which pool of target virtual machines to forward a packet
  1968. // to if it matches the given [IPAddress, IPProtocol, portRange] tuple.
  1969. type ForwardingRule struct {
  1970. // IPAddress: Value of the reserved IP address that this forwarding rule
  1971. // is serving on behalf of. For global forwarding rules, the address
  1972. // must be a global IP; for regional forwarding rules, the address must
  1973. // live in the same region as the forwarding rule. If left empty
  1974. // (default value), an ephemeral IP from the same scope (global or
  1975. // regional) will be assigned.
  1976. IPAddress string `json:"IPAddress,omitempty"`
  1977. // IPProtocol: The IP protocol to which this rule applies. Valid options
  1978. // are TCP, UDP, ESP, AH or SCTP.
  1979. //
  1980. // Possible values:
  1981. // "AH"
  1982. // "ESP"
  1983. // "SCTP"
  1984. // "TCP"
  1985. // "UDP"
  1986. IPProtocol string `json:"IPProtocol,omitempty"`
  1987. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  1988. // format.
  1989. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  1990. // Description: An optional description of this resource. Provide this
  1991. // property when you create the resource.
  1992. Description string `json:"description,omitempty"`
  1993. // Id: [Output Only] The unique identifier for the resource. This
  1994. // identifier is defined by the server.
  1995. Id uint64 `json:"id,omitempty,string"`
  1996. // Kind: [Output Only] Type of the resource. Always
  1997. // compute#forwardingRule for Forwarding Rule resources.
  1998. Kind string `json:"kind,omitempty"`
  1999. // Name: Name of the resource; provided by the client when the resource
  2000. // is created. The name must be 1-63 characters long, and comply with
  2001. // RFC1035. Specifically, the name must be 1-63 characters long and
  2002. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  2003. // the first character must be a lowercase letter, and all following
  2004. // characters must be a dash, lowercase letter, or digit, except the
  2005. // last character, which cannot be a dash.
  2006. Name string `json:"name,omitempty"`
  2007. // PortRange: Applicable only when IPProtocol is TCP, UDP, or SCTP, only
  2008. // packets addressed to ports in the specified range will be forwarded
  2009. // to target. Forwarding rules with the same [IPAddress, IPProtocol]
  2010. // pair must have disjoint port ranges.
  2011. PortRange string `json:"portRange,omitempty"`
  2012. // Region: [Output Only] URL of the region where the regional forwarding
  2013. // rule resides. This field is not applicable to global forwarding
  2014. // rules.
  2015. Region string `json:"region,omitempty"`
  2016. // SelfLink: [Output Only] Server-defined URL for the resource.
  2017. SelfLink string `json:"selfLink,omitempty"`
  2018. // Target: The URL of the target resource to receive the matched
  2019. // traffic. For regional forwarding rules, this target must live in the
  2020. // same region as the forwarding rule. For global forwarding rules, this
  2021. // target must be a global TargetHttpProxy or TargetHttpsProxy resource.
  2022. // The forwarded traffic must be of a type appropriate to the target
  2023. // object. For example, TargetHttpProxy requires HTTP traffic, and
  2024. // TargetHttpsProxy requires HTTPS traffic.
  2025. Target string `json:"target,omitempty"`
  2026. // ServerResponse contains the HTTP response code and headers from the
  2027. // server.
  2028. googleapi.ServerResponse `json:"-"`
  2029. // ForceSendFields is a list of field names (e.g. "IPAddress") to
  2030. // unconditionally include in API requests. By default, fields with
  2031. // empty values are omitted from API requests. However, any non-pointer,
  2032. // non-interface field appearing in ForceSendFields will be sent to the
  2033. // server regardless of whether the field is empty or not. This may be
  2034. // used to include empty fields in Patch requests.
  2035. ForceSendFields []string `json:"-"`
  2036. }
  2037. func (s *ForwardingRule) MarshalJSON() ([]byte, error) {
  2038. type noMethod ForwardingRule
  2039. raw := noMethod(*s)
  2040. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2041. }
  2042. type ForwardingRuleAggregatedList struct {
  2043. // Id: [Output Only] The unique identifier for the resource. This
  2044. // identifier is defined by the server.
  2045. Id string `json:"id,omitempty"`
  2046. // Items: A map of scoped forwarding rule lists.
  2047. Items map[string]ForwardingRulesScopedList `json:"items,omitempty"`
  2048. // Kind: Type of resource.
  2049. Kind string `json:"kind,omitempty"`
  2050. // NextPageToken: [Output Only] This token allows you to get the next
  2051. // page of results for list requests. If the number of results is larger
  2052. // than maxResults, use the nextPageToken as a value for the query
  2053. // parameter pageToken in the next list request. Subsequent list
  2054. // requests will have their own nextPageToken to continue paging through
  2055. // the results.
  2056. NextPageToken string `json:"nextPageToken,omitempty"`
  2057. // SelfLink: [Output Only] Server-defined URL for this resource.
  2058. SelfLink string `json:"selfLink,omitempty"`
  2059. // ServerResponse contains the HTTP response code and headers from the
  2060. // server.
  2061. googleapi.ServerResponse `json:"-"`
  2062. // ForceSendFields is a list of field names (e.g. "Id") to
  2063. // unconditionally include in API requests. By default, fields with
  2064. // empty values are omitted from API requests. However, any non-pointer,
  2065. // non-interface field appearing in ForceSendFields will be sent to the
  2066. // server regardless of whether the field is empty or not. This may be
  2067. // used to include empty fields in Patch requests.
  2068. ForceSendFields []string `json:"-"`
  2069. }
  2070. func (s *ForwardingRuleAggregatedList) MarshalJSON() ([]byte, error) {
  2071. type noMethod ForwardingRuleAggregatedList
  2072. raw := noMethod(*s)
  2073. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2074. }
  2075. // ForwardingRuleList: Contains a list of ForwardingRule resources.
  2076. type ForwardingRuleList struct {
  2077. // Id: [Output Only] Unique identifier for the resource. Set by the
  2078. // server.
  2079. Id string `json:"id,omitempty"`
  2080. // Items: A list of ForwardingRule resources.
  2081. Items []*ForwardingRule `json:"items,omitempty"`
  2082. // Kind: Type of resource.
  2083. Kind string `json:"kind,omitempty"`
  2084. // NextPageToken: [Output Only] This token allows you to get the next
  2085. // page of results for list requests. If the number of results is larger
  2086. // than maxResults, use the nextPageToken as a value for the query
  2087. // parameter pageToken in the next list request. Subsequent list
  2088. // requests will have their own nextPageToken to continue paging through
  2089. // the results.
  2090. NextPageToken string `json:"nextPageToken,omitempty"`
  2091. // SelfLink: [Output Only] Server-defined URL for this resource.
  2092. SelfLink string `json:"selfLink,omitempty"`
  2093. // ServerResponse contains the HTTP response code and headers from the
  2094. // server.
  2095. googleapi.ServerResponse `json:"-"`
  2096. // ForceSendFields is a list of field names (e.g. "Id") to
  2097. // unconditionally include in API requests. By default, fields with
  2098. // empty values are omitted from API requests. However, any non-pointer,
  2099. // non-interface field appearing in ForceSendFields will be sent to the
  2100. // server regardless of whether the field is empty or not. This may be
  2101. // used to include empty fields in Patch requests.
  2102. ForceSendFields []string `json:"-"`
  2103. }
  2104. func (s *ForwardingRuleList) MarshalJSON() ([]byte, error) {
  2105. type noMethod ForwardingRuleList
  2106. raw := noMethod(*s)
  2107. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2108. }
  2109. type ForwardingRulesScopedList struct {
  2110. // ForwardingRules: List of forwarding rules contained in this scope.
  2111. ForwardingRules []*ForwardingRule `json:"forwardingRules,omitempty"`
  2112. // Warning: Informational warning which replaces the list of forwarding
  2113. // rules when the list is empty.
  2114. Warning *ForwardingRulesScopedListWarning `json:"warning,omitempty"`
  2115. // ForceSendFields is a list of field names (e.g. "ForwardingRules") 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 *ForwardingRulesScopedList) MarshalJSON() ([]byte, error) {
  2124. type noMethod ForwardingRulesScopedList
  2125. raw := noMethod(*s)
  2126. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2127. }
  2128. // ForwardingRulesScopedListWarning: Informational warning which
  2129. // replaces the list of forwarding rules when the list is empty.
  2130. type ForwardingRulesScopedListWarning struct {
  2131. // Code: [Output Only] A warning code, if applicable. For example,
  2132. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  2133. // the response.
  2134. //
  2135. // Possible values:
  2136. // "DEPRECATED_RESOURCE_USED"
  2137. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  2138. // "INJECTED_KERNELS_DEPRECATED"
  2139. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  2140. // "NEXT_HOP_CANNOT_IP_FORWARD"
  2141. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  2142. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  2143. // "NEXT_HOP_NOT_RUNNING"
  2144. // "NOT_CRITICAL_ERROR"
  2145. // "NO_RESULTS_ON_PAGE"
  2146. // "REQUIRED_TOS_AGREEMENT"
  2147. // "RESOURCE_NOT_DELETED"
  2148. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  2149. // "UNREACHABLE"
  2150. Code string `json:"code,omitempty"`
  2151. // Data: [Output Only] Metadata about this warning in key: value format.
  2152. // For example:
  2153. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  2154. Data []*ForwardingRulesScopedListWarningData `json:"data,omitempty"`
  2155. // Message: [Output Only] A human-readable description of the warning
  2156. // code.
  2157. Message string `json:"message,omitempty"`
  2158. // ForceSendFields is a list of field names (e.g. "Code") to
  2159. // unconditionally include in API requests. By default, fields with
  2160. // empty values are omitted from API requests. However, any non-pointer,
  2161. // non-interface field appearing in ForceSendFields will be sent to the
  2162. // server regardless of whether the field is empty or not. This may be
  2163. // used to include empty fields in Patch requests.
  2164. ForceSendFields []string `json:"-"`
  2165. }
  2166. func (s *ForwardingRulesScopedListWarning) MarshalJSON() ([]byte, error) {
  2167. type noMethod ForwardingRulesScopedListWarning
  2168. raw := noMethod(*s)
  2169. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2170. }
  2171. type ForwardingRulesScopedListWarningData struct {
  2172. // Key: [Output Only] A key that provides more detail on the warning
  2173. // being returned. For example, for warnings where there are no results
  2174. // in a list request for a particular zone, this key might be scope and
  2175. // the key value might be the zone name. Other examples might be a key
  2176. // indicating a deprecated resource, and a suggested replacement, or a
  2177. // warning about invalid network settings (for example, if an instance
  2178. // attempts to perform IP forwarding but is not enabled for IP
  2179. // forwarding).
  2180. Key string `json:"key,omitempty"`
  2181. // Value: [Output Only] A warning data value corresponding to the key.
  2182. Value string `json:"value,omitempty"`
  2183. // ForceSendFields is a list of field names (e.g. "Key") to
  2184. // unconditionally include in API requests. By default, fields with
  2185. // empty values are omitted from API requests. However, any non-pointer,
  2186. // non-interface field appearing in ForceSendFields will be sent to the
  2187. // server regardless of whether the field is empty or not. This may be
  2188. // used to include empty fields in Patch requests.
  2189. ForceSendFields []string `json:"-"`
  2190. }
  2191. func (s *ForwardingRulesScopedListWarningData) MarshalJSON() ([]byte, error) {
  2192. type noMethod ForwardingRulesScopedListWarningData
  2193. raw := noMethod(*s)
  2194. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2195. }
  2196. type HealthCheckReference struct {
  2197. HealthCheck string `json:"healthCheck,omitempty"`
  2198. // ForceSendFields is a list of field names (e.g. "HealthCheck") to
  2199. // unconditionally include in API requests. By default, fields with
  2200. // empty values are omitted from API requests. However, any non-pointer,
  2201. // non-interface field appearing in ForceSendFields will be sent to the
  2202. // server regardless of whether the field is empty or not. This may be
  2203. // used to include empty fields in Patch requests.
  2204. ForceSendFields []string `json:"-"`
  2205. }
  2206. func (s *HealthCheckReference) MarshalJSON() ([]byte, error) {
  2207. type noMethod HealthCheckReference
  2208. raw := noMethod(*s)
  2209. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2210. }
  2211. type HealthStatus struct {
  2212. // HealthState: Health state of the instance.
  2213. //
  2214. // Possible values:
  2215. // "HEALTHY"
  2216. // "UNHEALTHY"
  2217. HealthState string `json:"healthState,omitempty"`
  2218. // Instance: URL of the instance resource.
  2219. Instance string `json:"instance,omitempty"`
  2220. // IpAddress: The IP address represented by this resource.
  2221. IpAddress string `json:"ipAddress,omitempty"`
  2222. // Port: The port on the instance.
  2223. Port int64 `json:"port,omitempty"`
  2224. // ForceSendFields is a list of field names (e.g. "HealthState") to
  2225. // unconditionally include in API requests. By default, fields with
  2226. // empty values are omitted from API requests. However, any non-pointer,
  2227. // non-interface field appearing in ForceSendFields will be sent to the
  2228. // server regardless of whether the field is empty or not. This may be
  2229. // used to include empty fields in Patch requests.
  2230. ForceSendFields []string `json:"-"`
  2231. }
  2232. func (s *HealthStatus) MarshalJSON() ([]byte, error) {
  2233. type noMethod HealthStatus
  2234. raw := noMethod(*s)
  2235. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2236. }
  2237. // HostRule: UrlMaps A host-matching rule for a URL. If matched, will
  2238. // use the named PathMatcher to select the BackendService.
  2239. type HostRule struct {
  2240. // Description: An optional description of this resource. Provide this
  2241. // property when you create the resource.
  2242. Description string `json:"description,omitempty"`
  2243. // Hosts: The list of host patterns to match. They must be valid
  2244. // hostnames, except * will match any string of ([a-z0-9-.]*). In that
  2245. // case, * must be the first character and must be followed in the
  2246. // pattern by either - or ..
  2247. Hosts []string `json:"hosts,omitempty"`
  2248. // PathMatcher: The name of the PathMatcher to use to match the path
  2249. // portion of the URL if the hostRule matches the URL's host portion.
  2250. PathMatcher string `json:"pathMatcher,omitempty"`
  2251. // ForceSendFields is a list of field names (e.g. "Description") to
  2252. // unconditionally include in API requests. By default, fields with
  2253. // empty values are omitted from API requests. However, any non-pointer,
  2254. // non-interface field appearing in ForceSendFields will be sent to the
  2255. // server regardless of whether the field is empty or not. This may be
  2256. // used to include empty fields in Patch requests.
  2257. ForceSendFields []string `json:"-"`
  2258. }
  2259. func (s *HostRule) MarshalJSON() ([]byte, error) {
  2260. type noMethod HostRule
  2261. raw := noMethod(*s)
  2262. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2263. }
  2264. // HttpHealthCheck: An HttpHealthCheck resource. This resource defines a
  2265. // template for how individual instances should be checked for health,
  2266. // via HTTP.
  2267. type HttpHealthCheck struct {
  2268. // CheckIntervalSec: How often (in seconds) to send a health check. The
  2269. // default value is 5 seconds.
  2270. CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"`
  2271. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  2272. // format.
  2273. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  2274. // Description: An optional description of this resource. Provide this
  2275. // property when you create the resource.
  2276. Description string `json:"description,omitempty"`
  2277. // HealthyThreshold: A so-far unhealthy instance will be marked healthy
  2278. // after this many consecutive successes. The default value is 2.
  2279. HealthyThreshold int64 `json:"healthyThreshold,omitempty"`
  2280. // Host: The value of the host header in the HTTP health check request.
  2281. // If left empty (default value), the public IP on behalf of which this
  2282. // health check is performed will be used.
  2283. Host string `json:"host,omitempty"`
  2284. // Id: [Output Only] The unique identifier for the resource. This
  2285. // identifier is defined by the server.
  2286. Id uint64 `json:"id,omitempty,string"`
  2287. // Kind: Type of the resource.
  2288. Kind string `json:"kind,omitempty"`
  2289. // Name: Name of the resource. Provided by the client when the resource
  2290. // is created. The name must be 1-63 characters long, and comply with
  2291. // RFC1035. Specifically, the name must be 1-63 characters long and
  2292. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  2293. // the first character must be a lowercase letter, and all following
  2294. // characters must be a dash, lowercase letter, or digit, except the
  2295. // last character, which cannot be a dash.
  2296. Name string `json:"name,omitempty"`
  2297. // Port: The TCP port number for the HTTP health check request. The
  2298. // default value is 80.
  2299. Port int64 `json:"port,omitempty"`
  2300. // RequestPath: The request path of the HTTP health check request. The
  2301. // default value is "/".
  2302. RequestPath string `json:"requestPath,omitempty"`
  2303. // SelfLink: [Output Only] Server-defined URL for the resource.
  2304. SelfLink string `json:"selfLink,omitempty"`
  2305. // TimeoutSec: How long (in seconds) to wait before claiming failure.
  2306. // The default value is 5 seconds. It is invalid for timeoutSec to have
  2307. // greater value than checkIntervalSec.
  2308. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  2309. // UnhealthyThreshold: A so-far healthy instance will be marked
  2310. // unhealthy after this many consecutive failures. The default value is
  2311. // 2.
  2312. UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"`
  2313. // ServerResponse contains the HTTP response code and headers from the
  2314. // server.
  2315. googleapi.ServerResponse `json:"-"`
  2316. // ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to
  2317. // unconditionally include in API requests. By default, fields with
  2318. // empty values are omitted from API requests. However, any non-pointer,
  2319. // non-interface field appearing in ForceSendFields will be sent to the
  2320. // server regardless of whether the field is empty or not. This may be
  2321. // used to include empty fields in Patch requests.
  2322. ForceSendFields []string `json:"-"`
  2323. }
  2324. func (s *HttpHealthCheck) MarshalJSON() ([]byte, error) {
  2325. type noMethod HttpHealthCheck
  2326. raw := noMethod(*s)
  2327. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2328. }
  2329. // HttpHealthCheckList: Contains a list of HttpHealthCheck resources.
  2330. type HttpHealthCheckList struct {
  2331. // Id: [Output Only] Unique identifier for the resource. Defined by the
  2332. // server.
  2333. Id string `json:"id,omitempty"`
  2334. // Items: A list of HttpHealthCheck resources.
  2335. Items []*HttpHealthCheck `json:"items,omitempty"`
  2336. // Kind: Type of resource.
  2337. Kind string `json:"kind,omitempty"`
  2338. // NextPageToken: [Output Only] This token allows you to get the next
  2339. // page of results for list requests. If the number of results is larger
  2340. // than maxResults, use the nextPageToken as a value for the query
  2341. // parameter pageToken in the next list request. Subsequent list
  2342. // requests will have their own nextPageToken to continue paging through
  2343. // the results.
  2344. NextPageToken string `json:"nextPageToken,omitempty"`
  2345. // SelfLink: [Output Only] Server-defined URL for this resource.
  2346. SelfLink string `json:"selfLink,omitempty"`
  2347. // ServerResponse contains the HTTP response code and headers from the
  2348. // server.
  2349. googleapi.ServerResponse `json:"-"`
  2350. // ForceSendFields is a list of field names (e.g. "Id") to
  2351. // unconditionally include in API requests. By default, fields with
  2352. // empty values are omitted from API requests. However, any non-pointer,
  2353. // non-interface field appearing in ForceSendFields will be sent to the
  2354. // server regardless of whether the field is empty or not. This may be
  2355. // used to include empty fields in Patch requests.
  2356. ForceSendFields []string `json:"-"`
  2357. }
  2358. func (s *HttpHealthCheckList) MarshalJSON() ([]byte, error) {
  2359. type noMethod HttpHealthCheckList
  2360. raw := noMethod(*s)
  2361. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2362. }
  2363. // HttpsHealthCheck: An HttpsHealthCheck resource. This resource defines
  2364. // a template for how individual instances should be checked for health,
  2365. // via HTTPS.
  2366. type HttpsHealthCheck struct {
  2367. // CheckIntervalSec: How often (in seconds) to send a health check. The
  2368. // default value is 5 seconds.
  2369. CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"`
  2370. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  2371. // format.
  2372. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  2373. // Description: An optional description of this resource. Provide this
  2374. // property when you create the resource.
  2375. Description string `json:"description,omitempty"`
  2376. // HealthyThreshold: A so-far unhealthy instance will be marked healthy
  2377. // after this many consecutive successes. The default value is 2.
  2378. HealthyThreshold int64 `json:"healthyThreshold,omitempty"`
  2379. // Host: The value of the host header in the HTTPS health check request.
  2380. // If left empty (default value), the public IP on behalf of which this
  2381. // health check is performed will be used.
  2382. Host string `json:"host,omitempty"`
  2383. // Id: [Output Only] The unique identifier for the resource. This
  2384. // identifier is defined by the server.
  2385. Id uint64 `json:"id,omitempty,string"`
  2386. // Kind: Type of the resource.
  2387. Kind string `json:"kind,omitempty"`
  2388. // Name: Name of the resource. Provided by the client when the resource
  2389. // is created. The name must be 1-63 characters long, and comply with
  2390. // RFC1035. Specifically, the name must be 1-63 characters long and
  2391. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  2392. // the first character must be a lowercase letter, and all following
  2393. // characters must be a dash, lowercase letter, or digit, except the
  2394. // last character, which cannot be a dash.
  2395. Name string `json:"name,omitempty"`
  2396. // Port: The TCP port number for the HTTPS health check request. The
  2397. // default value is 443.
  2398. Port int64 `json:"port,omitempty"`
  2399. // RequestPath: The request path of the HTTPS health check request. The
  2400. // default value is "/".
  2401. RequestPath string `json:"requestPath,omitempty"`
  2402. // SelfLink: [Output Only] Server-defined URL for the resource.
  2403. SelfLink string `json:"selfLink,omitempty"`
  2404. // TimeoutSec: How long (in seconds) to wait before claiming failure.
  2405. // The default value is 5 seconds. It is invalid for timeoutSec to have
  2406. // a greater value than checkIntervalSec.
  2407. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  2408. // UnhealthyThreshold: A so-far healthy instance will be marked
  2409. // unhealthy after this many consecutive failures. The default value is
  2410. // 2.
  2411. UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"`
  2412. // ServerResponse contains the HTTP response code and headers from the
  2413. // server.
  2414. googleapi.ServerResponse `json:"-"`
  2415. // ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to
  2416. // unconditionally include in API requests. By default, fields with
  2417. // empty values are omitted from API requests. However, any non-pointer,
  2418. // non-interface field appearing in ForceSendFields will be sent to the
  2419. // server regardless of whether the field is empty or not. This may be
  2420. // used to include empty fields in Patch requests.
  2421. ForceSendFields []string `json:"-"`
  2422. }
  2423. func (s *HttpsHealthCheck) MarshalJSON() ([]byte, error) {
  2424. type noMethod HttpsHealthCheck
  2425. raw := noMethod(*s)
  2426. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2427. }
  2428. // HttpsHealthCheckList: Contains a list of HttpsHealthCheck resources.
  2429. type HttpsHealthCheckList struct {
  2430. // Id: [Output Only] Unique identifier for the resource; defined by the
  2431. // server.
  2432. Id string `json:"id,omitempty"`
  2433. // Items: A list of HttpsHealthCheck resources.
  2434. Items []*HttpsHealthCheck `json:"items,omitempty"`
  2435. // Kind: Type of resource.
  2436. Kind string `json:"kind,omitempty"`
  2437. // NextPageToken: [Output Only] This token allows you to get the next
  2438. // page of results for list requests. If the number of results is larger
  2439. // than maxResults, use the nextPageToken as a value for the query
  2440. // parameter pageToken in the next list request. Subsequent list
  2441. // requests will have their own nextPageToken to continue paging through
  2442. // the results.
  2443. NextPageToken string `json:"nextPageToken,omitempty"`
  2444. // SelfLink: [Output Only] Server-defined URL for this resource.
  2445. SelfLink string `json:"selfLink,omitempty"`
  2446. // ServerResponse contains the HTTP response code and headers from the
  2447. // server.
  2448. googleapi.ServerResponse `json:"-"`
  2449. // ForceSendFields is a list of field names (e.g. "Id") to
  2450. // unconditionally include in API requests. By default, fields with
  2451. // empty values are omitted from API requests. However, any non-pointer,
  2452. // non-interface field appearing in ForceSendFields will be sent to the
  2453. // server regardless of whether the field is empty or not. This may be
  2454. // used to include empty fields in Patch requests.
  2455. ForceSendFields []string `json:"-"`
  2456. }
  2457. func (s *HttpsHealthCheckList) MarshalJSON() ([]byte, error) {
  2458. type noMethod HttpsHealthCheckList
  2459. raw := noMethod(*s)
  2460. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2461. }
  2462. // Image: An Image resource.
  2463. type Image struct {
  2464. // ArchiveSizeBytes: Size of the image tar.gz archive stored in Google
  2465. // Cloud Storage (in bytes).
  2466. ArchiveSizeBytes int64 `json:"archiveSizeBytes,omitempty,string"`
  2467. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  2468. // format.
  2469. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  2470. // Deprecated: The deprecation status associated with this image.
  2471. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  2472. // Description: An optional description of this resource. Provide this
  2473. // property when you create the resource.
  2474. Description string `json:"description,omitempty"`
  2475. // DiskSizeGb: Size of the image when restored onto a persistent disk
  2476. // (in GB).
  2477. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  2478. // Id: [Output Only] The unique identifier for the resource. This
  2479. // identifier is defined by the server.
  2480. Id uint64 `json:"id,omitempty,string"`
  2481. // Kind: [Output Only] Type of the resource. Always compute#image for
  2482. // images.
  2483. Kind string `json:"kind,omitempty"`
  2484. // Licenses: Any applicable publicly visible licenses.
  2485. Licenses []string `json:"licenses,omitempty"`
  2486. // Name: Name of the resource; provided by the client when the resource
  2487. // is created. The name must be 1-63 characters long, and comply with
  2488. // RFC1035. Specifically, the name must be 1-63 characters long and
  2489. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  2490. // the first character must be a lowercase letter, and all following
  2491. // characters must be a dash, lowercase letter, or digit, except the
  2492. // last character, which cannot be a dash.
  2493. Name string `json:"name,omitempty"`
  2494. // RawDisk: The parameters of the raw disk image.
  2495. RawDisk *ImageRawDisk `json:"rawDisk,omitempty"`
  2496. // SelfLink: [Output Only] Server-defined URL for the resource.
  2497. SelfLink string `json:"selfLink,omitempty"`
  2498. // SourceDisk: URL of the The source disk used to create this image.
  2499. // This can be a full or valid partial URL. You must provide either this
  2500. // property or the rawDisk.source property but not both to create an
  2501. // image. For example, the following are valid values:
  2502. // -
  2503. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/disk/disk
  2504. // - projects/project/zones/zone/disk/disk
  2505. // - zones/zone/disks/disk
  2506. SourceDisk string `json:"sourceDisk,omitempty"`
  2507. // SourceDiskId: The ID value of the disk used to create this image.
  2508. // This value may be used to determine whether the image was taken from
  2509. // the current or a previous instance of a given disk name.
  2510. SourceDiskId string `json:"sourceDiskId,omitempty"`
  2511. // SourceType: The type of the image used to create this disk. The
  2512. // default and only value is RAW
  2513. //
  2514. // Possible values:
  2515. // "RAW" (default)
  2516. SourceType string `json:"sourceType,omitempty"`
  2517. // Status: [Output Only] The status of the image. An image can be used
  2518. // to create other resources, such as instances, only after the image
  2519. // has been successfully created and the status is set to READY.
  2520. // Possible values are FAILED, PENDING, or READY.
  2521. //
  2522. // Possible values:
  2523. // "FAILED"
  2524. // "PENDING"
  2525. // "READY"
  2526. Status string `json:"status,omitempty"`
  2527. // ServerResponse contains the HTTP response code and headers from the
  2528. // server.
  2529. googleapi.ServerResponse `json:"-"`
  2530. // ForceSendFields is a list of field names (e.g. "ArchiveSizeBytes") to
  2531. // unconditionally include in API requests. By default, fields with
  2532. // empty values are omitted from API requests. However, any non-pointer,
  2533. // non-interface field appearing in ForceSendFields will be sent to the
  2534. // server regardless of whether the field is empty or not. This may be
  2535. // used to include empty fields in Patch requests.
  2536. ForceSendFields []string `json:"-"`
  2537. }
  2538. func (s *Image) MarshalJSON() ([]byte, error) {
  2539. type noMethod Image
  2540. raw := noMethod(*s)
  2541. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2542. }
  2543. // ImageRawDisk: The parameters of the raw disk image.
  2544. type ImageRawDisk struct {
  2545. // ContainerType: The format used to encode and transmit the block
  2546. // device, which should be TAR. This is just a container and
  2547. // transmission format and not a runtime format. Provided by the client
  2548. // when the disk image is created.
  2549. //
  2550. // Possible values:
  2551. // "TAR"
  2552. ContainerType string `json:"containerType,omitempty"`
  2553. // Sha1Checksum: An optional SHA1 checksum of the disk image before
  2554. // unpackaging; provided by the client when the disk image is created.
  2555. Sha1Checksum string `json:"sha1Checksum,omitempty"`
  2556. // Source: The full Google Cloud Storage URL where the disk image is
  2557. // stored. You must provide either this property or the sourceDisk
  2558. // property but not both.
  2559. Source string `json:"source,omitempty"`
  2560. // ForceSendFields is a list of field names (e.g. "ContainerType") to
  2561. // unconditionally include in API requests. By default, fields with
  2562. // empty values are omitted from API requests. However, any non-pointer,
  2563. // non-interface field appearing in ForceSendFields will be sent to the
  2564. // server regardless of whether the field is empty or not. This may be
  2565. // used to include empty fields in Patch requests.
  2566. ForceSendFields []string `json:"-"`
  2567. }
  2568. func (s *ImageRawDisk) MarshalJSON() ([]byte, error) {
  2569. type noMethod ImageRawDisk
  2570. raw := noMethod(*s)
  2571. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2572. }
  2573. // ImageList: Contains a list of Image resources.
  2574. type ImageList struct {
  2575. // Id: [Output Only] The unique identifier for the resource. This
  2576. // identifier is defined by the server.
  2577. Id string `json:"id,omitempty"`
  2578. // Items: [Output Only] A list of Image resources.
  2579. Items []*Image `json:"items,omitempty"`
  2580. // Kind: Type of resource.
  2581. Kind string `json:"kind,omitempty"`
  2582. // NextPageToken: [Output Only] This token allows you to get the next
  2583. // page of results for list requests. If the number of results is larger
  2584. // than maxResults, use the nextPageToken as a value for the query
  2585. // parameter pageToken in the next list request. Subsequent list
  2586. // requests will have their own nextPageToken to continue paging through
  2587. // the results.
  2588. NextPageToken string `json:"nextPageToken,omitempty"`
  2589. // SelfLink: [Output Only] Server-defined URL for this resource.
  2590. SelfLink string `json:"selfLink,omitempty"`
  2591. // ServerResponse contains the HTTP response code and headers from the
  2592. // server.
  2593. googleapi.ServerResponse `json:"-"`
  2594. // ForceSendFields is a list of field names (e.g. "Id") to
  2595. // unconditionally include in API requests. By default, fields with
  2596. // empty values are omitted from API requests. However, any non-pointer,
  2597. // non-interface field appearing in ForceSendFields will be sent to the
  2598. // server regardless of whether the field is empty or not. This may be
  2599. // used to include empty fields in Patch requests.
  2600. ForceSendFields []string `json:"-"`
  2601. }
  2602. func (s *ImageList) MarshalJSON() ([]byte, error) {
  2603. type noMethod ImageList
  2604. raw := noMethod(*s)
  2605. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2606. }
  2607. // Instance: An Instance resource.
  2608. type Instance struct {
  2609. // CanIpForward: Allows this instance to send and receive packets with
  2610. // non-matching destination or source IPs. This is required if you plan
  2611. // to use this instance to forward routes. For more information, see
  2612. // Enabling IP Forwarding.
  2613. CanIpForward bool `json:"canIpForward,omitempty"`
  2614. // CpuPlatform: [Output Only] The CPU platform used by this instance.
  2615. CpuPlatform string `json:"cpuPlatform,omitempty"`
  2616. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  2617. // format.
  2618. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  2619. // Description: An optional description of this resource. Provide this
  2620. // property when you create the resource.
  2621. Description string `json:"description,omitempty"`
  2622. // Disks: Array of disks associated with this instance. Persistent disks
  2623. // must be created before you can assign them.
  2624. Disks []*AttachedDisk `json:"disks,omitempty"`
  2625. // Id: [Output Only] The unique identifier for the resource. This
  2626. // identifier is defined by the server.
  2627. Id uint64 `json:"id,omitempty,string"`
  2628. // Kind: [Output Only] Type of the resource. Always compute#instance for
  2629. // instances.
  2630. Kind string `json:"kind,omitempty"`
  2631. // MachineType: Full or partial URL of the machine type resource to use
  2632. // for this instance, in the format: zones/zone/machineTypes/
  2633. // machine-type. This is provided by the client when the instance is
  2634. // created. For example, the following is a valid partial url to a
  2635. // predefined machine
  2636. // type:
  2637. //
  2638. // zones/us-central1-f/machineTypes/n1-standard-1
  2639. //
  2640. // To create a custom machine type, provide a URL to a machine type in
  2641. // the following format, where CPUS is 1 or an even number up to 32 (2,
  2642. // 4, 6, ... 24, etc), and MEMORY is the total memory for this instance.
  2643. // Memory must be a multiple of 256 MB and must be supplied in MB (e.g.
  2644. // 5 GB of memory is 5120
  2645. // MB):
  2646. //
  2647. // zones/zone/machineTypes/custom-CPUS-MEMORY
  2648. //
  2649. // For example: zones/us-central1-f/machineTypes/custom-4-5120
  2650. //
  2651. // For a full list of restrictions, read the Specifications for custom
  2652. // machine types.
  2653. MachineType string `json:"machineType,omitempty"`
  2654. // Metadata: The metadata key/value pairs assigned to this instance.
  2655. // This includes custom metadata and predefined keys.
  2656. Metadata *Metadata `json:"metadata,omitempty"`
  2657. // Name: The name of the resource, provided by the client when initially
  2658. // creating the resource. The resource name must be 1-63 characters
  2659. // long, and comply with RFC1035. Specifically, the name must be 1-63
  2660. // characters long and match the regular expression
  2661. // [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a
  2662. // lowercase letter, and all following characters must be a dash,
  2663. // lowercase letter, or digit, except the last character, which cannot
  2664. // be a dash.
  2665. Name string `json:"name,omitempty"`
  2666. // NetworkInterfaces: An array of configurations for this interface.
  2667. // This specifies how this interface is configured to interact with
  2668. // other network services, such as connecting to the internet.
  2669. NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"`
  2670. // Scheduling: Scheduling options for this instance.
  2671. Scheduling *Scheduling `json:"scheduling,omitempty"`
  2672. // SelfLink: [Output Only] Server-defined URL for this resource.
  2673. SelfLink string `json:"selfLink,omitempty"`
  2674. // ServiceAccounts: A list of service accounts, with their specified
  2675. // scopes, authorized for this instance. Service accounts generate
  2676. // access tokens that can be accessed through the metadata server and
  2677. // used to authenticate applications on the instance. See Authenticating
  2678. // from Google Compute Engine for more information.
  2679. ServiceAccounts []*ServiceAccount `json:"serviceAccounts,omitempty"`
  2680. // Status: [Output Only] The status of the instance. One of the
  2681. // following values: PROVISIONING, STAGING, RUNNING, STOPPING, and
  2682. // TERMINATED.
  2683. //
  2684. // Possible values:
  2685. // "PROVISIONING"
  2686. // "RUNNING"
  2687. // "STAGING"
  2688. // "STOPPED"
  2689. // "STOPPING"
  2690. // "SUSPENDED"
  2691. // "SUSPENDING"
  2692. // "TERMINATED"
  2693. Status string `json:"status,omitempty"`
  2694. // StatusMessage: [Output Only] An optional, human-readable explanation
  2695. // of the status.
  2696. StatusMessage string `json:"statusMessage,omitempty"`
  2697. // Tags: A list of tags to appy to this instance. Tags are used to
  2698. // identify valid sources or targets for network firewalls and are
  2699. // specified by the client during instance creation. The tags can be
  2700. // later modified by the setTags method. Each tag within the list must
  2701. // comply with RFC1035.
  2702. Tags *Tags `json:"tags,omitempty"`
  2703. // Zone: [Output Only] URL of the zone where the instance resides.
  2704. Zone string `json:"zone,omitempty"`
  2705. // ServerResponse contains the HTTP response code and headers from the
  2706. // server.
  2707. googleapi.ServerResponse `json:"-"`
  2708. // ForceSendFields is a list of field names (e.g. "CanIpForward") to
  2709. // unconditionally include in API requests. By default, fields with
  2710. // empty values are omitted from API requests. However, any non-pointer,
  2711. // non-interface field appearing in ForceSendFields will be sent to the
  2712. // server regardless of whether the field is empty or not. This may be
  2713. // used to include empty fields in Patch requests.
  2714. ForceSendFields []string `json:"-"`
  2715. }
  2716. func (s *Instance) MarshalJSON() ([]byte, error) {
  2717. type noMethod Instance
  2718. raw := noMethod(*s)
  2719. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2720. }
  2721. type InstanceAggregatedList struct {
  2722. // Id: [Output Only] The unique identifier for the resource. This
  2723. // identifier is defined by the server.
  2724. Id string `json:"id,omitempty"`
  2725. // Items: [Output Only] A map of scoped instance lists.
  2726. Items map[string]InstancesScopedList `json:"items,omitempty"`
  2727. // Kind: [Output Only] Type of resource. Always
  2728. // compute#instanceAggregatedList for aggregated lists of Instance
  2729. // resources.
  2730. Kind string `json:"kind,omitempty"`
  2731. // NextPageToken: [Output Only] This token allows you to get the next
  2732. // page of results for list requests. If the number of results is larger
  2733. // than maxResults, use the nextPageToken as a value for the query
  2734. // parameter pageToken in the next list request. Subsequent list
  2735. // requests will have their own nextPageToken to continue paging through
  2736. // the results.
  2737. NextPageToken string `json:"nextPageToken,omitempty"`
  2738. // SelfLink: [Output Only] Server-defined URL for this resource.
  2739. SelfLink string `json:"selfLink,omitempty"`
  2740. // ServerResponse contains the HTTP response code and headers from the
  2741. // server.
  2742. googleapi.ServerResponse `json:"-"`
  2743. // ForceSendFields is a list of field names (e.g. "Id") to
  2744. // unconditionally include in API requests. By default, fields with
  2745. // empty values are omitted from API requests. However, any non-pointer,
  2746. // non-interface field appearing in ForceSendFields will be sent to the
  2747. // server regardless of whether the field is empty or not. This may be
  2748. // used to include empty fields in Patch requests.
  2749. ForceSendFields []string `json:"-"`
  2750. }
  2751. func (s *InstanceAggregatedList) MarshalJSON() ([]byte, error) {
  2752. type noMethod InstanceAggregatedList
  2753. raw := noMethod(*s)
  2754. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2755. }
  2756. type InstanceGroup struct {
  2757. // CreationTimestamp: [Output Only] The creation timestamp for this
  2758. // instance group in RFC3339 text format.
  2759. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  2760. // Description: An optional description of this resource. Provide this
  2761. // property when you create the resource.
  2762. Description string `json:"description,omitempty"`
  2763. // Fingerprint: [Output Only] The fingerprint of the named ports. The
  2764. // system uses this fingerprint to detect conflicts when multiple users
  2765. // change the named ports concurrently.
  2766. Fingerprint string `json:"fingerprint,omitempty"`
  2767. // Id: [Output Only] A unique identifier for this resource type. The
  2768. // server generates this identifier.
  2769. Id uint64 `json:"id,omitempty,string"`
  2770. // Kind: [Output Only] The resource type, which is always
  2771. // compute#instanceGroup for instance groups.
  2772. Kind string `json:"kind,omitempty"`
  2773. // Name: The name of the instance group. The name must be 1-63
  2774. // characters long, and comply with RFC1035.
  2775. Name string `json:"name,omitempty"`
  2776. // NamedPorts: Assigns a name to a port number. For example: {name:
  2777. // "http", port: 80}
  2778. //
  2779. // This allows the system to reference ports by the assigned name
  2780. // instead of a port number. Named ports can also contain multiple
  2781. // ports. For example: [{name: "http", port: 80},{name: "http", port:
  2782. // 8080}]
  2783. //
  2784. // Named ports apply to all instances in this instance group.
  2785. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  2786. // Network: [Output Only] The URL of the network to which all instances
  2787. // in the instance group belong.
  2788. Network string `json:"network,omitempty"`
  2789. // SelfLink: [Output Only] The URL for this instance group. The server
  2790. // generates this URL.
  2791. SelfLink string `json:"selfLink,omitempty"`
  2792. // Size: [Output Only] The total number of instances in the instance
  2793. // group.
  2794. Size int64 `json:"size,omitempty"`
  2795. // Subnetwork: [Output Only] The URL of the subnetwork to which all
  2796. // instances in the instance group belong.
  2797. Subnetwork string `json:"subnetwork,omitempty"`
  2798. // Zone: [Output Only] The URL of the zone where the instance group is
  2799. // located.
  2800. Zone string `json:"zone,omitempty"`
  2801. // ServerResponse contains the HTTP response code and headers from the
  2802. // server.
  2803. googleapi.ServerResponse `json:"-"`
  2804. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  2805. // to unconditionally include in API requests. By default, fields with
  2806. // empty values are omitted from API requests. However, any non-pointer,
  2807. // non-interface field appearing in ForceSendFields will be sent to the
  2808. // server regardless of whether the field is empty or not. This may be
  2809. // used to include empty fields in Patch requests.
  2810. ForceSendFields []string `json:"-"`
  2811. }
  2812. func (s *InstanceGroup) MarshalJSON() ([]byte, error) {
  2813. type noMethod InstanceGroup
  2814. raw := noMethod(*s)
  2815. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2816. }
  2817. type InstanceGroupAggregatedList struct {
  2818. // Id: [Output Only] A unique identifier for this aggregated list of
  2819. // instance groups. The server generates this identifier.
  2820. Id string `json:"id,omitempty"`
  2821. // Items: A map of scoped instance group lists.
  2822. Items map[string]InstanceGroupsScopedList `json:"items,omitempty"`
  2823. // Kind: [Output Only] The resource type, which is always
  2824. // compute#instanceGroupAggregatedList for aggregated lists of instance
  2825. // groups.
  2826. Kind string `json:"kind,omitempty"`
  2827. // NextPageToken: [Output Only] This token allows you to get the next
  2828. // page of results for list requests. If the number of results is larger
  2829. // than maxResults, use the nextPageToken as a value for the query
  2830. // parameter pageToken in the next list request. Subsequent list
  2831. // requests will have their own nextPageToken to continue paging through
  2832. // the results.
  2833. NextPageToken string `json:"nextPageToken,omitempty"`
  2834. // SelfLink: [Output Only] The URL for this resource type. The server
  2835. // generates this URL.
  2836. SelfLink string `json:"selfLink,omitempty"`
  2837. // ServerResponse contains the HTTP response code and headers from the
  2838. // server.
  2839. googleapi.ServerResponse `json:"-"`
  2840. // ForceSendFields is a list of field names (e.g. "Id") to
  2841. // unconditionally include in API requests. By default, fields with
  2842. // empty values are omitted from API requests. However, any non-pointer,
  2843. // non-interface field appearing in ForceSendFields will be sent to the
  2844. // server regardless of whether the field is empty or not. This may be
  2845. // used to include empty fields in Patch requests.
  2846. ForceSendFields []string `json:"-"`
  2847. }
  2848. func (s *InstanceGroupAggregatedList) MarshalJSON() ([]byte, error) {
  2849. type noMethod InstanceGroupAggregatedList
  2850. raw := noMethod(*s)
  2851. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2852. }
  2853. // InstanceGroupList: A list of InstanceGroup resources.
  2854. type InstanceGroupList struct {
  2855. // Id: [Output Only] A unique identifier for this list of instance
  2856. // groups. The server generates this identifier.
  2857. Id string `json:"id,omitempty"`
  2858. // Items: A list of instance groups.
  2859. Items []*InstanceGroup `json:"items,omitempty"`
  2860. // Kind: [Output Only] The resource type, which is always
  2861. // compute#instanceGroupList for instance group lists.
  2862. Kind string `json:"kind,omitempty"`
  2863. // NextPageToken: [Output Only] This token allows you to get the next
  2864. // page of results for list requests. If the number of results is larger
  2865. // than maxResults, use the nextPageToken as a value for the query
  2866. // parameter pageToken in the next list request. Subsequent list
  2867. // requests will have their own nextPageToken to continue paging through
  2868. // the results.
  2869. NextPageToken string `json:"nextPageToken,omitempty"`
  2870. // SelfLink: [Output Only] The URL for this resource type. The server
  2871. // generates this URL.
  2872. SelfLink string `json:"selfLink,omitempty"`
  2873. // ServerResponse contains the HTTP response code and headers from the
  2874. // server.
  2875. googleapi.ServerResponse `json:"-"`
  2876. // ForceSendFields is a list of field names (e.g. "Id") to
  2877. // unconditionally include in API requests. By default, fields with
  2878. // empty values are omitted from API requests. However, any non-pointer,
  2879. // non-interface field appearing in ForceSendFields will be sent to the
  2880. // server regardless of whether the field is empty or not. This may be
  2881. // used to include empty fields in Patch requests.
  2882. ForceSendFields []string `json:"-"`
  2883. }
  2884. func (s *InstanceGroupList) MarshalJSON() ([]byte, error) {
  2885. type noMethod InstanceGroupList
  2886. raw := noMethod(*s)
  2887. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2888. }
  2889. // InstanceGroupManager: InstanceGroupManagers
  2890. //
  2891. // Next available tag: 20
  2892. type InstanceGroupManager struct {
  2893. // BaseInstanceName: The base instance name to use for instances in this
  2894. // group. The value must be 1-58 characters long. Instances are named by
  2895. // appending a hyphen and a random four-character string to the base
  2896. // instance name. The base instance name must comply with RFC1035.
  2897. BaseInstanceName string `json:"baseInstanceName,omitempty"`
  2898. // CreationTimestamp: [Output Only] The creation timestamp for this
  2899. // managed instance group in RFC3339 text format.
  2900. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  2901. // CurrentActions: [Output Only] The list of instance actions and the
  2902. // number of instances in this managed instance group that are scheduled
  2903. // for each of those actions.
  2904. CurrentActions *InstanceGroupManagerActionsSummary `json:"currentActions,omitempty"`
  2905. // Description: An optional description of this resource. Provide this
  2906. // property when you create the resource.
  2907. Description string `json:"description,omitempty"`
  2908. // Fingerprint: [Output Only] The fingerprint of the target pools
  2909. // information. You can use this optional field for optimistic locking
  2910. // when you update the target pool entries.
  2911. Fingerprint string `json:"fingerprint,omitempty"`
  2912. // Id: [Output Only] A unique identifier for this resource type. The
  2913. // server generates this identifier.
  2914. Id uint64 `json:"id,omitempty,string"`
  2915. // InstanceGroup: [Output Only] The URL of the Instance Group resource.
  2916. InstanceGroup string `json:"instanceGroup,omitempty"`
  2917. // InstanceTemplate: The URL of the instance template that is specified
  2918. // for this managed instance group. The group uses this template to
  2919. // create all new instances in the managed instance group.
  2920. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  2921. // Kind: [Output Only] The resource type, which is always
  2922. // compute#instanceGroupManager for managed instance groups.
  2923. Kind string `json:"kind,omitempty"`
  2924. // Name: The name of the managed instance group. The name must be 1-63
  2925. // characters long, and comply with RFC1035.
  2926. Name string `json:"name,omitempty"`
  2927. // NamedPorts: Named ports configured for the Instance Groups
  2928. // complementary to this Instance Group Manager.
  2929. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  2930. // SelfLink: [Output Only] The URL for this managed instance group. The
  2931. // server defines this URL.
  2932. SelfLink string `json:"selfLink,omitempty"`
  2933. // TargetPools: The URLs for all TargetPool resources to which instances
  2934. // in the instanceGroup field are added. The target pools automatically
  2935. // apply to all of the instances in the managed instance group.
  2936. TargetPools []string `json:"targetPools,omitempty"`
  2937. // TargetSize: The target number of running instances for this managed
  2938. // instance group. Deleting or abandoning instances reduces this number.
  2939. // Resizing the group changes this number.
  2940. TargetSize int64 `json:"targetSize,omitempty"`
  2941. // Zone: The name of the zone where the managed instance group is
  2942. // located.
  2943. Zone string `json:"zone,omitempty"`
  2944. // ServerResponse contains the HTTP response code and headers from the
  2945. // server.
  2946. googleapi.ServerResponse `json:"-"`
  2947. // ForceSendFields is a list of field names (e.g. "BaseInstanceName") to
  2948. // unconditionally include in API requests. By default, fields with
  2949. // empty values are omitted from API requests. However, any non-pointer,
  2950. // non-interface field appearing in ForceSendFields will be sent to the
  2951. // server regardless of whether the field is empty or not. This may be
  2952. // used to include empty fields in Patch requests.
  2953. ForceSendFields []string `json:"-"`
  2954. }
  2955. func (s *InstanceGroupManager) MarshalJSON() ([]byte, error) {
  2956. type noMethod InstanceGroupManager
  2957. raw := noMethod(*s)
  2958. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2959. }
  2960. type InstanceGroupManagerActionsSummary struct {
  2961. // Abandoning: [Output Only] The total number of instances in the
  2962. // managed instance group that are scheduled to be abandoned. Abandoning
  2963. // an instance removes it from the managed instance group without
  2964. // deleting it.
  2965. Abandoning int64 `json:"abandoning,omitempty"`
  2966. // Creating: [Output Only] The number of instances in the managed
  2967. // instance group that are scheduled to be created or are currently
  2968. // being created. If the group fails to create one of these instances,
  2969. // it tries again until it creates the instance successfully.
  2970. Creating int64 `json:"creating,omitempty"`
  2971. // Deleting: [Output Only] The number of instances in the managed
  2972. // instance group that are scheduled to be deleted or are currently
  2973. // being deleted.
  2974. Deleting int64 `json:"deleting,omitempty"`
  2975. // None: [Output Only] The number of instances in the managed instance
  2976. // group that are running and have no scheduled actions.
  2977. None int64 `json:"none,omitempty"`
  2978. // Recreating: [Output Only] The number of instances in the managed
  2979. // instance group that are scheduled to be recreated or are currently
  2980. // being being recreated. Recreating an instance deletes the existing
  2981. // root persistent disk and creates a new disk from the image that is
  2982. // defined in the instance template.
  2983. Recreating int64 `json:"recreating,omitempty"`
  2984. // Refreshing: [Output Only] The number of instances in the managed
  2985. // instance group that are being reconfigured with properties that do
  2986. // not require a restart or a recreate action. For example, setting or
  2987. // removing target pools for the instance.
  2988. Refreshing int64 `json:"refreshing,omitempty"`
  2989. // Restarting: [Output Only] The number of instances in the managed
  2990. // instance group that are scheduled to be restarted or are currently
  2991. // being restarted.
  2992. Restarting int64 `json:"restarting,omitempty"`
  2993. // ForceSendFields is a list of field names (e.g. "Abandoning") to
  2994. // unconditionally include in API requests. By default, fields with
  2995. // empty values are omitted from API requests. However, any non-pointer,
  2996. // non-interface field appearing in ForceSendFields will be sent to the
  2997. // server regardless of whether the field is empty or not. This may be
  2998. // used to include empty fields in Patch requests.
  2999. ForceSendFields []string `json:"-"`
  3000. }
  3001. func (s *InstanceGroupManagerActionsSummary) MarshalJSON() ([]byte, error) {
  3002. type noMethod InstanceGroupManagerActionsSummary
  3003. raw := noMethod(*s)
  3004. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3005. }
  3006. type InstanceGroupManagerAggregatedList struct {
  3007. // Id: [Output Only] A unique identifier for this aggregated list of
  3008. // managed instance groups. The server generates this identifier.
  3009. Id string `json:"id,omitempty"`
  3010. // Items: [Output Only] A map of filtered managed instance group lists.
  3011. Items map[string]InstanceGroupManagersScopedList `json:"items,omitempty"`
  3012. // Kind: [Output Only] The resource type, which is always
  3013. // compute#instanceGroupManagerAggregatedList for an aggregated list of
  3014. // managed instance groups.
  3015. Kind string `json:"kind,omitempty"`
  3016. // NextPageToken: [Output Only] This token allows you to get the next
  3017. // page of results for list requests. If the number of results is larger
  3018. // than maxResults, use the nextPageToken as a value for the query
  3019. // parameter pageToken in the next list request. Subsequent list
  3020. // requests will have their own nextPageToken to continue paging through
  3021. // the results.
  3022. NextPageToken string `json:"nextPageToken,omitempty"`
  3023. // SelfLink: [Output Only] The URL for this resource type. The server
  3024. // generates this URL.
  3025. SelfLink string `json:"selfLink,omitempty"`
  3026. // ServerResponse contains the HTTP response code and headers from the
  3027. // server.
  3028. googleapi.ServerResponse `json:"-"`
  3029. // ForceSendFields is a list of field names (e.g. "Id") to
  3030. // unconditionally include in API requests. By default, fields with
  3031. // empty values are omitted from API requests. However, any non-pointer,
  3032. // non-interface field appearing in ForceSendFields will be sent to the
  3033. // server regardless of whether the field is empty or not. This may be
  3034. // used to include empty fields in Patch requests.
  3035. ForceSendFields []string `json:"-"`
  3036. }
  3037. func (s *InstanceGroupManagerAggregatedList) MarshalJSON() ([]byte, error) {
  3038. type noMethod InstanceGroupManagerAggregatedList
  3039. raw := noMethod(*s)
  3040. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3041. }
  3042. // InstanceGroupManagerList: [Output Only] A list of managed instance
  3043. // groups.
  3044. type InstanceGroupManagerList struct {
  3045. // Id: [Output Only] A unique identifier for this resource type. The
  3046. // server generates this identifier.
  3047. Id string `json:"id,omitempty"`
  3048. // Items: [Output Only] A list of managed instance groups.
  3049. Items []*InstanceGroupManager `json:"items,omitempty"`
  3050. // Kind: [Output Only] The resource type, which is always
  3051. // compute#instanceGroupManagerList for a list of managed instance
  3052. // groups.
  3053. Kind string `json:"kind,omitempty"`
  3054. // NextPageToken: [Output Only] This token allows you to get the next
  3055. // page of results for list requests. If the number of results is larger
  3056. // than maxResults, use the nextPageToken as a value for the query
  3057. // parameter pageToken in the next list request. Subsequent list
  3058. // requests will have their own nextPageToken to continue paging through
  3059. // the results.
  3060. NextPageToken string `json:"nextPageToken,omitempty"`
  3061. // SelfLink: [Output Only] The URL for this resource type. The server
  3062. // generates this URL.
  3063. SelfLink string `json:"selfLink,omitempty"`
  3064. // ServerResponse contains the HTTP response code and headers from the
  3065. // server.
  3066. googleapi.ServerResponse `json:"-"`
  3067. // ForceSendFields is a list of field names (e.g. "Id") to
  3068. // unconditionally include in API requests. By default, fields with
  3069. // empty values are omitted from API requests. However, any non-pointer,
  3070. // non-interface field appearing in ForceSendFields will be sent to the
  3071. // server regardless of whether the field is empty or not. This may be
  3072. // used to include empty fields in Patch requests.
  3073. ForceSendFields []string `json:"-"`
  3074. }
  3075. func (s *InstanceGroupManagerList) MarshalJSON() ([]byte, error) {
  3076. type noMethod InstanceGroupManagerList
  3077. raw := noMethod(*s)
  3078. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3079. }
  3080. type InstanceGroupManagersAbandonInstancesRequest struct {
  3081. // Instances: The URL for one or more instances to abandon from the
  3082. // managed instance group.
  3083. Instances []string `json:"instances,omitempty"`
  3084. // ForceSendFields is a list of field names (e.g. "Instances") to
  3085. // unconditionally include in API requests. By default, fields with
  3086. // empty values are omitted from API requests. However, any non-pointer,
  3087. // non-interface field appearing in ForceSendFields will be sent to the
  3088. // server regardless of whether the field is empty or not. This may be
  3089. // used to include empty fields in Patch requests.
  3090. ForceSendFields []string `json:"-"`
  3091. }
  3092. func (s *InstanceGroupManagersAbandonInstancesRequest) MarshalJSON() ([]byte, error) {
  3093. type noMethod InstanceGroupManagersAbandonInstancesRequest
  3094. raw := noMethod(*s)
  3095. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3096. }
  3097. type InstanceGroupManagersDeleteInstancesRequest struct {
  3098. // Instances: The list of instances to delete from this managed instance
  3099. // group. Specify one or more instance URLs.
  3100. Instances []string `json:"instances,omitempty"`
  3101. // ForceSendFields is a list of field names (e.g. "Instances") to
  3102. // unconditionally include in API requests. By default, fields with
  3103. // empty values are omitted from API requests. However, any non-pointer,
  3104. // non-interface field appearing in ForceSendFields will be sent to the
  3105. // server regardless of whether the field is empty or not. This may be
  3106. // used to include empty fields in Patch requests.
  3107. ForceSendFields []string `json:"-"`
  3108. }
  3109. func (s *InstanceGroupManagersDeleteInstancesRequest) MarshalJSON() ([]byte, error) {
  3110. type noMethod InstanceGroupManagersDeleteInstancesRequest
  3111. raw := noMethod(*s)
  3112. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3113. }
  3114. type InstanceGroupManagersListManagedInstancesResponse struct {
  3115. // ManagedInstances: [Output Only] The list of instances in the managed
  3116. // instance group.
  3117. ManagedInstances []*ManagedInstance `json:"managedInstances,omitempty"`
  3118. // ServerResponse contains the HTTP response code and headers from the
  3119. // server.
  3120. googleapi.ServerResponse `json:"-"`
  3121. // ForceSendFields is a list of field names (e.g. "ManagedInstances") to
  3122. // unconditionally include in API requests. By default, fields with
  3123. // empty values are omitted from API requests. However, any non-pointer,
  3124. // non-interface field appearing in ForceSendFields will be sent to the
  3125. // server regardless of whether the field is empty or not. This may be
  3126. // used to include empty fields in Patch requests.
  3127. ForceSendFields []string `json:"-"`
  3128. }
  3129. func (s *InstanceGroupManagersListManagedInstancesResponse) MarshalJSON() ([]byte, error) {
  3130. type noMethod InstanceGroupManagersListManagedInstancesResponse
  3131. raw := noMethod(*s)
  3132. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3133. }
  3134. type InstanceGroupManagersRecreateInstancesRequest struct {
  3135. // Instances: The URL for one or more instances to recreate.
  3136. Instances []string `json:"instances,omitempty"`
  3137. // ForceSendFields is a list of field names (e.g. "Instances") to
  3138. // unconditionally include in API requests. By default, fields with
  3139. // empty values are omitted from API requests. However, any non-pointer,
  3140. // non-interface field appearing in ForceSendFields will be sent to the
  3141. // server regardless of whether the field is empty or not. This may be
  3142. // used to include empty fields in Patch requests.
  3143. ForceSendFields []string `json:"-"`
  3144. }
  3145. func (s *InstanceGroupManagersRecreateInstancesRequest) MarshalJSON() ([]byte, error) {
  3146. type noMethod InstanceGroupManagersRecreateInstancesRequest
  3147. raw := noMethod(*s)
  3148. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3149. }
  3150. type InstanceGroupManagersScopedList struct {
  3151. // InstanceGroupManagers: [Output Only] The list of managed instance
  3152. // groups that are contained in the specified project and zone.
  3153. InstanceGroupManagers []*InstanceGroupManager `json:"instanceGroupManagers,omitempty"`
  3154. // Warning: [Output Only] The warning that replaces the list of managed
  3155. // instance groups when the list is empty.
  3156. Warning *InstanceGroupManagersScopedListWarning `json:"warning,omitempty"`
  3157. // ForceSendFields is a list of field names (e.g.
  3158. // "InstanceGroupManagers") to unconditionally include in API requests.
  3159. // By default, fields with empty values are omitted from API requests.
  3160. // However, any non-pointer, non-interface field appearing in
  3161. // ForceSendFields will be sent to the server regardless of whether the
  3162. // field is empty or not. This may be used to include empty fields in
  3163. // Patch requests.
  3164. ForceSendFields []string `json:"-"`
  3165. }
  3166. func (s *InstanceGroupManagersScopedList) MarshalJSON() ([]byte, error) {
  3167. type noMethod InstanceGroupManagersScopedList
  3168. raw := noMethod(*s)
  3169. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3170. }
  3171. // InstanceGroupManagersScopedListWarning: [Output Only] The warning
  3172. // that replaces the list of managed instance groups when the list is
  3173. // empty.
  3174. type InstanceGroupManagersScopedListWarning struct {
  3175. // Code: [Output Only] A warning code, if applicable. For example,
  3176. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  3177. // the response.
  3178. //
  3179. // Possible values:
  3180. // "DEPRECATED_RESOURCE_USED"
  3181. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  3182. // "INJECTED_KERNELS_DEPRECATED"
  3183. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  3184. // "NEXT_HOP_CANNOT_IP_FORWARD"
  3185. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  3186. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  3187. // "NEXT_HOP_NOT_RUNNING"
  3188. // "NOT_CRITICAL_ERROR"
  3189. // "NO_RESULTS_ON_PAGE"
  3190. // "REQUIRED_TOS_AGREEMENT"
  3191. // "RESOURCE_NOT_DELETED"
  3192. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  3193. // "UNREACHABLE"
  3194. Code string `json:"code,omitempty"`
  3195. // Data: [Output Only] Metadata about this warning in key: value format.
  3196. // For example:
  3197. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  3198. Data []*InstanceGroupManagersScopedListWarningData `json:"data,omitempty"`
  3199. // Message: [Output Only] A human-readable description of the warning
  3200. // code.
  3201. Message string `json:"message,omitempty"`
  3202. // ForceSendFields is a list of field names (e.g. "Code") to
  3203. // unconditionally include in API requests. By default, fields with
  3204. // empty values are omitted from API requests. However, any non-pointer,
  3205. // non-interface field appearing in ForceSendFields will be sent to the
  3206. // server regardless of whether the field is empty or not. This may be
  3207. // used to include empty fields in Patch requests.
  3208. ForceSendFields []string `json:"-"`
  3209. }
  3210. func (s *InstanceGroupManagersScopedListWarning) MarshalJSON() ([]byte, error) {
  3211. type noMethod InstanceGroupManagersScopedListWarning
  3212. raw := noMethod(*s)
  3213. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3214. }
  3215. type InstanceGroupManagersScopedListWarningData struct {
  3216. // Key: [Output Only] A key that provides more detail on the warning
  3217. // being returned. For example, for warnings where there are no results
  3218. // in a list request for a particular zone, this key might be scope and
  3219. // the key value might be the zone name. Other examples might be a key
  3220. // indicating a deprecated resource, and a suggested replacement, or a
  3221. // warning about invalid network settings (for example, if an instance
  3222. // attempts to perform IP forwarding but is not enabled for IP
  3223. // forwarding).
  3224. Key string `json:"key,omitempty"`
  3225. // Value: [Output Only] A warning data value corresponding to the key.
  3226. Value string `json:"value,omitempty"`
  3227. // ForceSendFields is a list of field names (e.g. "Key") to
  3228. // unconditionally include in API requests. By default, fields with
  3229. // empty values are omitted from API requests. However, any non-pointer,
  3230. // non-interface field appearing in ForceSendFields will be sent to the
  3231. // server regardless of whether the field is empty or not. This may be
  3232. // used to include empty fields in Patch requests.
  3233. ForceSendFields []string `json:"-"`
  3234. }
  3235. func (s *InstanceGroupManagersScopedListWarningData) MarshalJSON() ([]byte, error) {
  3236. type noMethod InstanceGroupManagersScopedListWarningData
  3237. raw := noMethod(*s)
  3238. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3239. }
  3240. type InstanceGroupManagersSetInstanceTemplateRequest struct {
  3241. // InstanceTemplate: The URL of the instance template that is specified
  3242. // for this managed instance group. The group uses this template to
  3243. // create all new instances in the managed instance group.
  3244. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  3245. // ForceSendFields is a list of field names (e.g. "InstanceTemplate") to
  3246. // unconditionally include in API requests. By default, fields with
  3247. // empty values are omitted from API requests. However, any non-pointer,
  3248. // non-interface field appearing in ForceSendFields will be sent to the
  3249. // server regardless of whether the field is empty or not. This may be
  3250. // used to include empty fields in Patch requests.
  3251. ForceSendFields []string `json:"-"`
  3252. }
  3253. func (s *InstanceGroupManagersSetInstanceTemplateRequest) MarshalJSON() ([]byte, error) {
  3254. type noMethod InstanceGroupManagersSetInstanceTemplateRequest
  3255. raw := noMethod(*s)
  3256. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3257. }
  3258. type InstanceGroupManagersSetTargetPoolsRequest struct {
  3259. // Fingerprint: The fingerprint of the target pools information. Use
  3260. // this optional property to prevent conflicts when multiple users
  3261. // change the target pools settings concurrently. Obtain the fingerprint
  3262. // with the instanceGroupManagers.get method. Then, include the
  3263. // fingerprint in your request to ensure that you do not overwrite
  3264. // changes that were applied from another concurrent request.
  3265. Fingerprint string `json:"fingerprint,omitempty"`
  3266. // TargetPools: The list of target pool URLs that instances in this
  3267. // managed instance group belong to. The managed instance group applies
  3268. // these target pools to all of the instances in the group. Existing
  3269. // instances and new instances in the group all receive these target
  3270. // pool settings.
  3271. TargetPools []string `json:"targetPools,omitempty"`
  3272. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  3273. // unconditionally include in API requests. By default, fields with
  3274. // empty values are omitted from API requests. However, any non-pointer,
  3275. // non-interface field appearing in ForceSendFields will be sent to the
  3276. // server regardless of whether the field is empty or not. This may be
  3277. // used to include empty fields in Patch requests.
  3278. ForceSendFields []string `json:"-"`
  3279. }
  3280. func (s *InstanceGroupManagersSetTargetPoolsRequest) MarshalJSON() ([]byte, error) {
  3281. type noMethod InstanceGroupManagersSetTargetPoolsRequest
  3282. raw := noMethod(*s)
  3283. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3284. }
  3285. type InstanceGroupsAddInstancesRequest struct {
  3286. // Instances: The list of instances to add to the instance group.
  3287. Instances []*InstanceReference `json:"instances,omitempty"`
  3288. // ForceSendFields is a list of field names (e.g. "Instances") to
  3289. // unconditionally include in API requests. By default, fields with
  3290. // empty values are omitted from API requests. However, any non-pointer,
  3291. // non-interface field appearing in ForceSendFields will be sent to the
  3292. // server regardless of whether the field is empty or not. This may be
  3293. // used to include empty fields in Patch requests.
  3294. ForceSendFields []string `json:"-"`
  3295. }
  3296. func (s *InstanceGroupsAddInstancesRequest) MarshalJSON() ([]byte, error) {
  3297. type noMethod InstanceGroupsAddInstancesRequest
  3298. raw := noMethod(*s)
  3299. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3300. }
  3301. type InstanceGroupsListInstances struct {
  3302. // Id: [Output Only] A unique identifier for this list of instance
  3303. // groups. The server generates this identifier.
  3304. Id string `json:"id,omitempty"`
  3305. // Items: [Output Only] A list of instances and any named ports that are
  3306. // assigned to those instances.
  3307. Items []*InstanceWithNamedPorts `json:"items,omitempty"`
  3308. // Kind: [Output Only] The resource type, which is always
  3309. // compute#instanceGroupsListInstances for lists of instance groups.
  3310. Kind string `json:"kind,omitempty"`
  3311. // NextPageToken: [Output Only] This token allows you to get the next
  3312. // page of results for list requests. If the number of results is larger
  3313. // than maxResults, use the nextPageToken as a value for the query
  3314. // parameter pageToken in the next list request. Subsequent list
  3315. // requests will have their own nextPageToken to continue paging through
  3316. // the results.
  3317. NextPageToken string `json:"nextPageToken,omitempty"`
  3318. // SelfLink: [Output Only] The URL for this list of instance groups. The
  3319. // server generates this URL.
  3320. SelfLink string `json:"selfLink,omitempty"`
  3321. // ServerResponse contains the HTTP response code and headers from the
  3322. // server.
  3323. googleapi.ServerResponse `json:"-"`
  3324. // ForceSendFields is a list of field names (e.g. "Id") to
  3325. // unconditionally include in API requests. By default, fields with
  3326. // empty values are omitted from API requests. However, any non-pointer,
  3327. // non-interface field appearing in ForceSendFields will be sent to the
  3328. // server regardless of whether the field is empty or not. This may be
  3329. // used to include empty fields in Patch requests.
  3330. ForceSendFields []string `json:"-"`
  3331. }
  3332. func (s *InstanceGroupsListInstances) MarshalJSON() ([]byte, error) {
  3333. type noMethod InstanceGroupsListInstances
  3334. raw := noMethod(*s)
  3335. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3336. }
  3337. type InstanceGroupsListInstancesRequest struct {
  3338. // InstanceState: A filter for the state of the instances in the
  3339. // instance group. Valid options are ALL or RUNNING. If you do not
  3340. // specify this parameter the list includes all instances regardless of
  3341. // their state.
  3342. //
  3343. // Possible values:
  3344. // "ALL"
  3345. // "RUNNING"
  3346. InstanceState string `json:"instanceState,omitempty"`
  3347. // ForceSendFields is a list of field names (e.g. "InstanceState") to
  3348. // unconditionally include in API requests. By default, fields with
  3349. // empty values are omitted from API requests. However, any non-pointer,
  3350. // non-interface field appearing in ForceSendFields will be sent to the
  3351. // server regardless of whether the field is empty or not. This may be
  3352. // used to include empty fields in Patch requests.
  3353. ForceSendFields []string `json:"-"`
  3354. }
  3355. func (s *InstanceGroupsListInstancesRequest) MarshalJSON() ([]byte, error) {
  3356. type noMethod InstanceGroupsListInstancesRequest
  3357. raw := noMethod(*s)
  3358. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3359. }
  3360. type InstanceGroupsRemoveInstancesRequest struct {
  3361. // Instances: The list of instances to remove from the instance group.
  3362. Instances []*InstanceReference `json:"instances,omitempty"`
  3363. // ForceSendFields is a list of field names (e.g. "Instances") to
  3364. // unconditionally include in API requests. By default, fields with
  3365. // empty values are omitted from API requests. However, any non-pointer,
  3366. // non-interface field appearing in ForceSendFields will be sent to the
  3367. // server regardless of whether the field is empty or not. This may be
  3368. // used to include empty fields in Patch requests.
  3369. ForceSendFields []string `json:"-"`
  3370. }
  3371. func (s *InstanceGroupsRemoveInstancesRequest) MarshalJSON() ([]byte, error) {
  3372. type noMethod InstanceGroupsRemoveInstancesRequest
  3373. raw := noMethod(*s)
  3374. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3375. }
  3376. type InstanceGroupsScopedList struct {
  3377. // InstanceGroups: [Output Only] The list of instance groups that are
  3378. // contained in this scope.
  3379. InstanceGroups []*InstanceGroup `json:"instanceGroups,omitempty"`
  3380. // Warning: [Output Only] An informational warning that replaces the
  3381. // list of instance groups when the list is empty.
  3382. Warning *InstanceGroupsScopedListWarning `json:"warning,omitempty"`
  3383. // ForceSendFields is a list of field names (e.g. "InstanceGroups") to
  3384. // unconditionally include in API requests. By default, fields with
  3385. // empty values are omitted from API requests. However, any non-pointer,
  3386. // non-interface field appearing in ForceSendFields will be sent to the
  3387. // server regardless of whether the field is empty or not. This may be
  3388. // used to include empty fields in Patch requests.
  3389. ForceSendFields []string `json:"-"`
  3390. }
  3391. func (s *InstanceGroupsScopedList) MarshalJSON() ([]byte, error) {
  3392. type noMethod InstanceGroupsScopedList
  3393. raw := noMethod(*s)
  3394. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3395. }
  3396. // InstanceGroupsScopedListWarning: [Output Only] An informational
  3397. // warning that replaces the list of instance groups when the list is
  3398. // empty.
  3399. type InstanceGroupsScopedListWarning struct {
  3400. // Code: [Output Only] A warning code, if applicable. For example,
  3401. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  3402. // the response.
  3403. //
  3404. // Possible values:
  3405. // "DEPRECATED_RESOURCE_USED"
  3406. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  3407. // "INJECTED_KERNELS_DEPRECATED"
  3408. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  3409. // "NEXT_HOP_CANNOT_IP_FORWARD"
  3410. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  3411. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  3412. // "NEXT_HOP_NOT_RUNNING"
  3413. // "NOT_CRITICAL_ERROR"
  3414. // "NO_RESULTS_ON_PAGE"
  3415. // "REQUIRED_TOS_AGREEMENT"
  3416. // "RESOURCE_NOT_DELETED"
  3417. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  3418. // "UNREACHABLE"
  3419. Code string `json:"code,omitempty"`
  3420. // Data: [Output Only] Metadata about this warning in key: value format.
  3421. // For example:
  3422. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  3423. Data []*InstanceGroupsScopedListWarningData `json:"data,omitempty"`
  3424. // Message: [Output Only] A human-readable description of the warning
  3425. // code.
  3426. Message string `json:"message,omitempty"`
  3427. // ForceSendFields is a list of field names (e.g. "Code") to
  3428. // unconditionally include in API requests. By default, fields with
  3429. // empty values are omitted from API requests. However, any non-pointer,
  3430. // non-interface field appearing in ForceSendFields will be sent to the
  3431. // server regardless of whether the field is empty or not. This may be
  3432. // used to include empty fields in Patch requests.
  3433. ForceSendFields []string `json:"-"`
  3434. }
  3435. func (s *InstanceGroupsScopedListWarning) MarshalJSON() ([]byte, error) {
  3436. type noMethod InstanceGroupsScopedListWarning
  3437. raw := noMethod(*s)
  3438. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3439. }
  3440. type InstanceGroupsScopedListWarningData struct {
  3441. // Key: [Output Only] A key that provides more detail on the warning
  3442. // being returned. For example, for warnings where there are no results
  3443. // in a list request for a particular zone, this key might be scope and
  3444. // the key value might be the zone name. Other examples might be a key
  3445. // indicating a deprecated resource, and a suggested replacement, or a
  3446. // warning about invalid network settings (for example, if an instance
  3447. // attempts to perform IP forwarding but is not enabled for IP
  3448. // forwarding).
  3449. Key string `json:"key,omitempty"`
  3450. // Value: [Output Only] A warning data value corresponding to the key.
  3451. Value string `json:"value,omitempty"`
  3452. // ForceSendFields is a list of field names (e.g. "Key") to
  3453. // unconditionally include in API requests. By default, fields with
  3454. // empty values are omitted from API requests. However, any non-pointer,
  3455. // non-interface field appearing in ForceSendFields will be sent to the
  3456. // server regardless of whether the field is empty or not. This may be
  3457. // used to include empty fields in Patch requests.
  3458. ForceSendFields []string `json:"-"`
  3459. }
  3460. func (s *InstanceGroupsScopedListWarningData) MarshalJSON() ([]byte, error) {
  3461. type noMethod InstanceGroupsScopedListWarningData
  3462. raw := noMethod(*s)
  3463. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3464. }
  3465. type InstanceGroupsSetNamedPortsRequest struct {
  3466. // Fingerprint: The fingerprint of the named ports information for this
  3467. // instance group. Use this optional property to prevent conflicts when
  3468. // multiple users change the named ports settings concurrently. Obtain
  3469. // the fingerprint with the instanceGroups.get method. Then, include the
  3470. // fingerprint in your request to ensure that you do not overwrite
  3471. // changes that were applied from another concurrent request.
  3472. Fingerprint string `json:"fingerprint,omitempty"`
  3473. // NamedPorts: The list of named ports to set for this instance group.
  3474. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  3475. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  3476. // unconditionally include in API requests. By default, fields with
  3477. // empty values are omitted from API requests. However, any non-pointer,
  3478. // non-interface field appearing in ForceSendFields will be sent to the
  3479. // server regardless of whether the field is empty or not. This may be
  3480. // used to include empty fields in Patch requests.
  3481. ForceSendFields []string `json:"-"`
  3482. }
  3483. func (s *InstanceGroupsSetNamedPortsRequest) MarshalJSON() ([]byte, error) {
  3484. type noMethod InstanceGroupsSetNamedPortsRequest
  3485. raw := noMethod(*s)
  3486. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3487. }
  3488. // InstanceList: Contains a list of instance resources.
  3489. type InstanceList struct {
  3490. // Id: [Output Only] The unique identifier for the resource. This
  3491. // identifier is defined by the server.
  3492. Id string `json:"id,omitempty"`
  3493. // Items: [Output Only] A list of Instance resources.
  3494. Items []*Instance `json:"items,omitempty"`
  3495. // Kind: [Output Only] Type of resource. Always compute#instanceList for
  3496. // lists of Instance resources.
  3497. Kind string `json:"kind,omitempty"`
  3498. // NextPageToken: [Output Only] This token allows you to get the next
  3499. // page of results for list requests. If the number of results is larger
  3500. // than maxResults, use the nextPageToken as a value for the query
  3501. // parameter pageToken in the next list request. Subsequent list
  3502. // requests will have their own nextPageToken to continue paging through
  3503. // the results.
  3504. NextPageToken string `json:"nextPageToken,omitempty"`
  3505. // SelfLink: [Output Only] Server-defined URL for this resource.
  3506. SelfLink string `json:"selfLink,omitempty"`
  3507. // ServerResponse contains the HTTP response code and headers from the
  3508. // server.
  3509. googleapi.ServerResponse `json:"-"`
  3510. // ForceSendFields is a list of field names (e.g. "Id") to
  3511. // unconditionally include in API requests. By default, fields with
  3512. // empty values are omitted from API requests. However, any non-pointer,
  3513. // non-interface field appearing in ForceSendFields will be sent to the
  3514. // server regardless of whether the field is empty or not. This may be
  3515. // used to include empty fields in Patch requests.
  3516. ForceSendFields []string `json:"-"`
  3517. }
  3518. func (s *InstanceList) MarshalJSON() ([]byte, error) {
  3519. type noMethod InstanceList
  3520. raw := noMethod(*s)
  3521. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3522. }
  3523. type InstanceMoveRequest struct {
  3524. // DestinationZone: The URL of the destination zone to move the instance
  3525. // to. This can be a full or partial URL. For example, the following are
  3526. // all valid URLs to a zone:
  3527. // - https://www.googleapis.com/compute/v1/projects/project/zones/zone
  3528. //
  3529. // - projects/project/zones/zone
  3530. // - zones/zone
  3531. DestinationZone string `json:"destinationZone,omitempty"`
  3532. // TargetInstance: The URL of the target instance to move. This can be a
  3533. // full or partial URL. For example, the following are all valid URLs to
  3534. // an instance:
  3535. // -
  3536. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance
  3537. // - projects/project/zones/zone/instances/instance
  3538. // - zones/zone/instances/instance
  3539. TargetInstance string `json:"targetInstance,omitempty"`
  3540. // ForceSendFields is a list of field names (e.g. "DestinationZone") to
  3541. // unconditionally include in API requests. By default, fields with
  3542. // empty values are omitted from API requests. However, any non-pointer,
  3543. // non-interface field appearing in ForceSendFields will be sent to the
  3544. // server regardless of whether the field is empty or not. This may be
  3545. // used to include empty fields in Patch requests.
  3546. ForceSendFields []string `json:"-"`
  3547. }
  3548. func (s *InstanceMoveRequest) MarshalJSON() ([]byte, error) {
  3549. type noMethod InstanceMoveRequest
  3550. raw := noMethod(*s)
  3551. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3552. }
  3553. type InstanceProperties struct {
  3554. // CanIpForward: Enables instances created based on this template to
  3555. // send packets with source IP addresses other than their own and
  3556. // receive packets with destination IP addresses other than their own.
  3557. // If these instances will be used as an IP gateway or it will be set as
  3558. // the next-hop in a Route resource, specify true. If unsure, leave this
  3559. // set to false. See the canIpForward documentation for more
  3560. // information.
  3561. CanIpForward bool `json:"canIpForward,omitempty"`
  3562. // Description: An optional text description for the instances that are
  3563. // created from this instance template.
  3564. Description string `json:"description,omitempty"`
  3565. // Disks: An array of disks that are associated with the instances that
  3566. // are created from this template.
  3567. Disks []*AttachedDisk `json:"disks,omitempty"`
  3568. // MachineType: The machine type to use for instances that are created
  3569. // from this template.
  3570. MachineType string `json:"machineType,omitempty"`
  3571. // Metadata: The metadata key/value pairs to assign to instances that
  3572. // are created from this template. These pairs can consist of custom
  3573. // metadata or predefined keys. See Project and instance metadata for
  3574. // more information.
  3575. Metadata *Metadata `json:"metadata,omitempty"`
  3576. // NetworkInterfaces: An array of network access configurations for this
  3577. // interface.
  3578. NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"`
  3579. // Scheduling: Specifies the scheduling options for the instances that
  3580. // are created from this template.
  3581. Scheduling *Scheduling `json:"scheduling,omitempty"`
  3582. // ServiceAccounts: A list of service accounts with specified scopes.
  3583. // Access tokens for these service accounts are available to the
  3584. // instances that are created from this template. Use metadata queries
  3585. // to obtain the access tokens for these instances.
  3586. ServiceAccounts []*ServiceAccount `json:"serviceAccounts,omitempty"`
  3587. // Tags: A list of tags to apply to the instances that are created from
  3588. // this template. The tags identify valid sources or targets for network
  3589. // firewalls. The setTags method can modify this list of tags. Each tag
  3590. // within the list must comply with RFC1035.
  3591. Tags *Tags `json:"tags,omitempty"`
  3592. // ForceSendFields is a list of field names (e.g. "CanIpForward") to
  3593. // unconditionally include in API requests. By default, fields with
  3594. // empty values are omitted from API requests. However, any non-pointer,
  3595. // non-interface field appearing in ForceSendFields will be sent to the
  3596. // server regardless of whether the field is empty or not. This may be
  3597. // used to include empty fields in Patch requests.
  3598. ForceSendFields []string `json:"-"`
  3599. }
  3600. func (s *InstanceProperties) MarshalJSON() ([]byte, error) {
  3601. type noMethod InstanceProperties
  3602. raw := noMethod(*s)
  3603. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3604. }
  3605. type InstanceReference struct {
  3606. // Instance: The URL for a specific instance.
  3607. Instance string `json:"instance,omitempty"`
  3608. // ForceSendFields is a list of field names (e.g. "Instance") to
  3609. // unconditionally include in API requests. By default, fields with
  3610. // empty values are omitted from API requests. However, any non-pointer,
  3611. // non-interface field appearing in ForceSendFields will be sent to the
  3612. // server regardless of whether the field is empty or not. This may be
  3613. // used to include empty fields in Patch requests.
  3614. ForceSendFields []string `json:"-"`
  3615. }
  3616. func (s *InstanceReference) MarshalJSON() ([]byte, error) {
  3617. type noMethod InstanceReference
  3618. raw := noMethod(*s)
  3619. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3620. }
  3621. // InstanceTemplate: An Instance Template resource.
  3622. type InstanceTemplate struct {
  3623. // CreationTimestamp: [Output Only] The creation timestamp for this
  3624. // instance template in RFC3339 text format.
  3625. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  3626. // Description: An optional description of this resource. Provide this
  3627. // property when you create the resource.
  3628. Description string `json:"description,omitempty"`
  3629. // Id: [Output Only] A unique identifier for this instance template. The
  3630. // server defines this identifier.
  3631. Id uint64 `json:"id,omitempty,string"`
  3632. // Kind: [Output Only] The resource type, which is always
  3633. // compute#instanceTemplate for instance templates.
  3634. Kind string `json:"kind,omitempty"`
  3635. // Name: Name of the resource; provided by the client when the resource
  3636. // is created. The name must be 1-63 characters long, and comply with
  3637. // RFC1035. Specifically, the name must be 1-63 characters long and
  3638. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  3639. // the first character must be a lowercase letter, and all following
  3640. // characters must be a dash, lowercase letter, or digit, except the
  3641. // last character, which cannot be a dash.
  3642. Name string `json:"name,omitempty"`
  3643. // Properties: The instance properties for this instance template.
  3644. Properties *InstanceProperties `json:"properties,omitempty"`
  3645. // SelfLink: [Output Only] The URL for this instance template. The
  3646. // server defines this URL.
  3647. SelfLink string `json:"selfLink,omitempty"`
  3648. // ServerResponse contains the HTTP response code and headers from the
  3649. // server.
  3650. googleapi.ServerResponse `json:"-"`
  3651. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  3652. // to unconditionally include in API requests. By default, fields with
  3653. // empty values are omitted from API requests. However, any non-pointer,
  3654. // non-interface field appearing in ForceSendFields will be sent to the
  3655. // server regardless of whether the field is empty or not. This may be
  3656. // used to include empty fields in Patch requests.
  3657. ForceSendFields []string `json:"-"`
  3658. }
  3659. func (s *InstanceTemplate) MarshalJSON() ([]byte, error) {
  3660. type noMethod InstanceTemplate
  3661. raw := noMethod(*s)
  3662. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3663. }
  3664. // InstanceTemplateList: A list of instance templates.
  3665. type InstanceTemplateList struct {
  3666. // Id: [Output Only] A unique identifier for this instance template. The
  3667. // server defines this identifier.
  3668. Id string `json:"id,omitempty"`
  3669. // Items: [Output Only] list of InstanceTemplate resources.
  3670. Items []*InstanceTemplate `json:"items,omitempty"`
  3671. // Kind: [Output Only] The resource type, which is always
  3672. // compute#instanceTemplatesListResponse for instance template lists.
  3673. Kind string `json:"kind,omitempty"`
  3674. // NextPageToken: [Output Only] This token allows you to get the next
  3675. // page of results for list requests. If the number of results is larger
  3676. // than maxResults, use the nextPageToken as a value for the query
  3677. // parameter pageToken in the next list request. Subsequent list
  3678. // requests will have their own nextPageToken to continue paging through
  3679. // the results.
  3680. NextPageToken string `json:"nextPageToken,omitempty"`
  3681. // SelfLink: [Output Only] The URL for this instance template list. The
  3682. // server defines this URL.
  3683. SelfLink string `json:"selfLink,omitempty"`
  3684. // ServerResponse contains the HTTP response code and headers from the
  3685. // server.
  3686. googleapi.ServerResponse `json:"-"`
  3687. // ForceSendFields is a list of field names (e.g. "Id") to
  3688. // unconditionally include in API requests. By default, fields with
  3689. // empty values are omitted from API requests. However, any non-pointer,
  3690. // non-interface field appearing in ForceSendFields will be sent to the
  3691. // server regardless of whether the field is empty or not. This may be
  3692. // used to include empty fields in Patch requests.
  3693. ForceSendFields []string `json:"-"`
  3694. }
  3695. func (s *InstanceTemplateList) MarshalJSON() ([]byte, error) {
  3696. type noMethod InstanceTemplateList
  3697. raw := noMethod(*s)
  3698. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3699. }
  3700. type InstanceWithNamedPorts struct {
  3701. // Instance: [Output Only] The URL of the instance.
  3702. Instance string `json:"instance,omitempty"`
  3703. // NamedPorts: [Output Only] The named ports that belong to this
  3704. // instance group.
  3705. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  3706. // Status: [Output Only] The status of the instance.
  3707. //
  3708. // Possible values:
  3709. // "PROVISIONING"
  3710. // "RUNNING"
  3711. // "STAGING"
  3712. // "STOPPED"
  3713. // "STOPPING"
  3714. // "SUSPENDED"
  3715. // "SUSPENDING"
  3716. // "TERMINATED"
  3717. Status string `json:"status,omitempty"`
  3718. // ForceSendFields is a list of field names (e.g. "Instance") to
  3719. // unconditionally include in API requests. By default, fields with
  3720. // empty values are omitted from API requests. However, any non-pointer,
  3721. // non-interface field appearing in ForceSendFields will be sent to the
  3722. // server regardless of whether the field is empty or not. This may be
  3723. // used to include empty fields in Patch requests.
  3724. ForceSendFields []string `json:"-"`
  3725. }
  3726. func (s *InstanceWithNamedPorts) MarshalJSON() ([]byte, error) {
  3727. type noMethod InstanceWithNamedPorts
  3728. raw := noMethod(*s)
  3729. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3730. }
  3731. type InstancesScopedList struct {
  3732. // Instances: [Output Only] List of instances contained in this scope.
  3733. Instances []*Instance `json:"instances,omitempty"`
  3734. // Warning: [Output Only] Informational warning which replaces the list
  3735. // of instances when the list is empty.
  3736. Warning *InstancesScopedListWarning `json:"warning,omitempty"`
  3737. // ForceSendFields is a list of field names (e.g. "Instances") to
  3738. // unconditionally include in API requests. By default, fields with
  3739. // empty values are omitted from API requests. However, any non-pointer,
  3740. // non-interface field appearing in ForceSendFields will be sent to the
  3741. // server regardless of whether the field is empty or not. This may be
  3742. // used to include empty fields in Patch requests.
  3743. ForceSendFields []string `json:"-"`
  3744. }
  3745. func (s *InstancesScopedList) MarshalJSON() ([]byte, error) {
  3746. type noMethod InstancesScopedList
  3747. raw := noMethod(*s)
  3748. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3749. }
  3750. // InstancesScopedListWarning: [Output Only] Informational warning which
  3751. // replaces the list of instances when the list is empty.
  3752. type InstancesScopedListWarning struct {
  3753. // Code: [Output Only] A warning code, if applicable. For example,
  3754. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  3755. // the response.
  3756. //
  3757. // Possible values:
  3758. // "DEPRECATED_RESOURCE_USED"
  3759. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  3760. // "INJECTED_KERNELS_DEPRECATED"
  3761. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  3762. // "NEXT_HOP_CANNOT_IP_FORWARD"
  3763. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  3764. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  3765. // "NEXT_HOP_NOT_RUNNING"
  3766. // "NOT_CRITICAL_ERROR"
  3767. // "NO_RESULTS_ON_PAGE"
  3768. // "REQUIRED_TOS_AGREEMENT"
  3769. // "RESOURCE_NOT_DELETED"
  3770. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  3771. // "UNREACHABLE"
  3772. Code string `json:"code,omitempty"`
  3773. // Data: [Output Only] Metadata about this warning in key: value format.
  3774. // For example:
  3775. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  3776. Data []*InstancesScopedListWarningData `json:"data,omitempty"`
  3777. // Message: [Output Only] A human-readable description of the warning
  3778. // code.
  3779. Message string `json:"message,omitempty"`
  3780. // ForceSendFields is a list of field names (e.g. "Code") to
  3781. // unconditionally include in API requests. By default, fields with
  3782. // empty values are omitted from API requests. However, any non-pointer,
  3783. // non-interface field appearing in ForceSendFields will be sent to the
  3784. // server regardless of whether the field is empty or not. This may be
  3785. // used to include empty fields in Patch requests.
  3786. ForceSendFields []string `json:"-"`
  3787. }
  3788. func (s *InstancesScopedListWarning) MarshalJSON() ([]byte, error) {
  3789. type noMethod InstancesScopedListWarning
  3790. raw := noMethod(*s)
  3791. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3792. }
  3793. type InstancesScopedListWarningData struct {
  3794. // Key: [Output Only] A key that provides more detail on the warning
  3795. // being returned. For example, for warnings where there are no results
  3796. // in a list request for a particular zone, this key might be scope and
  3797. // the key value might be the zone name. Other examples might be a key
  3798. // indicating a deprecated resource, and a suggested replacement, or a
  3799. // warning about invalid network settings (for example, if an instance
  3800. // attempts to perform IP forwarding but is not enabled for IP
  3801. // forwarding).
  3802. Key string `json:"key,omitempty"`
  3803. // Value: [Output Only] A warning data value corresponding to the key.
  3804. Value string `json:"value,omitempty"`
  3805. // ForceSendFields is a list of field names (e.g. "Key") to
  3806. // unconditionally include in API requests. By default, fields with
  3807. // empty values are omitted from API requests. However, any non-pointer,
  3808. // non-interface field appearing in ForceSendFields will be sent to the
  3809. // server regardless of whether the field is empty or not. This may be
  3810. // used to include empty fields in Patch requests.
  3811. ForceSendFields []string `json:"-"`
  3812. }
  3813. func (s *InstancesScopedListWarningData) MarshalJSON() ([]byte, error) {
  3814. type noMethod InstancesScopedListWarningData
  3815. raw := noMethod(*s)
  3816. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3817. }
  3818. type InstancesSetMachineTypeRequest struct {
  3819. // MachineType: Full or partial URL of the machine type resource. See
  3820. // Machine Types for a full list of machine types. For example:
  3821. // zones/us-central1-f/machineTypes/n1-standard-1
  3822. MachineType string `json:"machineType,omitempty"`
  3823. // ForceSendFields is a list of field names (e.g. "MachineType") to
  3824. // unconditionally include in API requests. By default, fields with
  3825. // empty values are omitted from API requests. However, any non-pointer,
  3826. // non-interface field appearing in ForceSendFields will be sent to the
  3827. // server regardless of whether the field is empty or not. This may be
  3828. // used to include empty fields in Patch requests.
  3829. ForceSendFields []string `json:"-"`
  3830. }
  3831. func (s *InstancesSetMachineTypeRequest) MarshalJSON() ([]byte, error) {
  3832. type noMethod InstancesSetMachineTypeRequest
  3833. raw := noMethod(*s)
  3834. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3835. }
  3836. // License: A license resource.
  3837. type License struct {
  3838. // ChargesUseFee: [Output Only] If true, the customer will be charged
  3839. // license fee for running software that contains this license on an
  3840. // instance.
  3841. ChargesUseFee bool `json:"chargesUseFee,omitempty"`
  3842. // Kind: [Output Only] Type of resource. Always compute#license for
  3843. // licenses.
  3844. Kind string `json:"kind,omitempty"`
  3845. // Name: [Output Only] Name of the resource. The name is 1-63 characters
  3846. // long and complies with RFC1035.
  3847. Name string `json:"name,omitempty"`
  3848. // SelfLink: [Output Only] Server-defined URL for the resource.
  3849. SelfLink string `json:"selfLink,omitempty"`
  3850. // ServerResponse contains the HTTP response code and headers from the
  3851. // server.
  3852. googleapi.ServerResponse `json:"-"`
  3853. // ForceSendFields is a list of field names (e.g. "ChargesUseFee") to
  3854. // unconditionally include in API requests. By default, fields with
  3855. // empty values are omitted from API requests. However, any non-pointer,
  3856. // non-interface field appearing in ForceSendFields will be sent to the
  3857. // server regardless of whether the field is empty or not. This may be
  3858. // used to include empty fields in Patch requests.
  3859. ForceSendFields []string `json:"-"`
  3860. }
  3861. func (s *License) MarshalJSON() ([]byte, error) {
  3862. type noMethod License
  3863. raw := noMethod(*s)
  3864. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3865. }
  3866. // MachineType: A Machine Type resource.
  3867. type MachineType struct {
  3868. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  3869. // format.
  3870. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  3871. // Deprecated: [Output Only] The deprecation status associated with this
  3872. // machine type.
  3873. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  3874. // Description: [Output Only] An optional textual description of the
  3875. // resource.
  3876. Description string `json:"description,omitempty"`
  3877. // GuestCpus: [Output Only] The number of virtual CPUs that are
  3878. // available to the instance.
  3879. GuestCpus int64 `json:"guestCpus,omitempty"`
  3880. // Id: [Output Only] The unique identifier for the resource. This
  3881. // identifier is defined by the server.
  3882. Id uint64 `json:"id,omitempty,string"`
  3883. // ImageSpaceGb: [Deprecated] This property is deprecated and will never
  3884. // be populated with any relevant values.
  3885. ImageSpaceGb int64 `json:"imageSpaceGb,omitempty"`
  3886. // Kind: [Output Only] The type of the resource. Always
  3887. // compute#machineType for machine types.
  3888. Kind string `json:"kind,omitempty"`
  3889. // MaximumPersistentDisks: [Output Only] Maximum persistent disks
  3890. // allowed.
  3891. MaximumPersistentDisks int64 `json:"maximumPersistentDisks,omitempty"`
  3892. // MaximumPersistentDisksSizeGb: [Output Only] Maximum total persistent
  3893. // disks size (GB) allowed.
  3894. MaximumPersistentDisksSizeGb int64 `json:"maximumPersistentDisksSizeGb,omitempty,string"`
  3895. // MemoryMb: [Output Only] The amount of physical memory available to
  3896. // the instance, defined in MB.
  3897. MemoryMb int64 `json:"memoryMb,omitempty"`
  3898. // Name: [Output Only] Name of the resource.
  3899. Name string `json:"name,omitempty"`
  3900. // ScratchDisks: [Output Only] List of extended scratch disks assigned
  3901. // to the instance.
  3902. ScratchDisks []*MachineTypeScratchDisks `json:"scratchDisks,omitempty"`
  3903. // SelfLink: [Output Only] Server-defined URL for the resource.
  3904. SelfLink string `json:"selfLink,omitempty"`
  3905. // Zone: [Output Only] The name of the zone where the machine type
  3906. // resides, such as us-central1-a.
  3907. Zone string `json:"zone,omitempty"`
  3908. // ServerResponse contains the HTTP response code and headers from the
  3909. // server.
  3910. googleapi.ServerResponse `json:"-"`
  3911. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  3912. // to unconditionally include in API requests. By default, fields with
  3913. // empty values are omitted from API requests. However, any non-pointer,
  3914. // non-interface field appearing in ForceSendFields will be sent to the
  3915. // server regardless of whether the field is empty or not. This may be
  3916. // used to include empty fields in Patch requests.
  3917. ForceSendFields []string `json:"-"`
  3918. }
  3919. func (s *MachineType) MarshalJSON() ([]byte, error) {
  3920. type noMethod MachineType
  3921. raw := noMethod(*s)
  3922. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3923. }
  3924. type MachineTypeScratchDisks struct {
  3925. // DiskGb: Size of the scratch disk, defined in GB.
  3926. DiskGb int64 `json:"diskGb,omitempty"`
  3927. // ForceSendFields is a list of field names (e.g. "DiskGb") to
  3928. // unconditionally include in API requests. By default, fields with
  3929. // empty values are omitted from API requests. However, any non-pointer,
  3930. // non-interface field appearing in ForceSendFields will be sent to the
  3931. // server regardless of whether the field is empty or not. This may be
  3932. // used to include empty fields in Patch requests.
  3933. ForceSendFields []string `json:"-"`
  3934. }
  3935. func (s *MachineTypeScratchDisks) MarshalJSON() ([]byte, error) {
  3936. type noMethod MachineTypeScratchDisks
  3937. raw := noMethod(*s)
  3938. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3939. }
  3940. type MachineTypeAggregatedList struct {
  3941. // Id: [Output Only] The unique identifier for the resource. This
  3942. // identifier is defined by the server.
  3943. Id string `json:"id,omitempty"`
  3944. // Items: [Output Only] A map of scoped machine type lists.
  3945. Items map[string]MachineTypesScopedList `json:"items,omitempty"`
  3946. // Kind: [Output Only] Type of resource. Always
  3947. // compute#machineTypeAggregatedList for aggregated lists of machine
  3948. // types.
  3949. Kind string `json:"kind,omitempty"`
  3950. // NextPageToken: [Output Only] This token allows you to get the next
  3951. // page of results for list requests. If the number of results is larger
  3952. // than maxResults, use the nextPageToken as a value for the query
  3953. // parameter pageToken in the next list request. Subsequent list
  3954. // requests will have their own nextPageToken to continue paging through
  3955. // the results.
  3956. NextPageToken string `json:"nextPageToken,omitempty"`
  3957. // SelfLink: [Output Only] Server-defined URL for this resource.
  3958. SelfLink string `json:"selfLink,omitempty"`
  3959. // ServerResponse contains the HTTP response code and headers from the
  3960. // server.
  3961. googleapi.ServerResponse `json:"-"`
  3962. // ForceSendFields is a list of field names (e.g. "Id") to
  3963. // unconditionally include in API requests. By default, fields with
  3964. // empty values are omitted from API requests. However, any non-pointer,
  3965. // non-interface field appearing in ForceSendFields will be sent to the
  3966. // server regardless of whether the field is empty or not. This may be
  3967. // used to include empty fields in Patch requests.
  3968. ForceSendFields []string `json:"-"`
  3969. }
  3970. func (s *MachineTypeAggregatedList) MarshalJSON() ([]byte, error) {
  3971. type noMethod MachineTypeAggregatedList
  3972. raw := noMethod(*s)
  3973. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3974. }
  3975. // MachineTypeList: Contains a list of Machine Type resources.
  3976. type MachineTypeList struct {
  3977. // Id: [Output Only] The unique identifier for the resource. This
  3978. // identifier is defined by the server.
  3979. Id string `json:"id,omitempty"`
  3980. // Items: [Output Only] A list of Machine Type resources.
  3981. Items []*MachineType `json:"items,omitempty"`
  3982. // Kind: [Output Only] Type of resource. Always compute#machineTypeList
  3983. // for lists of machine types.
  3984. Kind string `json:"kind,omitempty"`
  3985. // NextPageToken: [Output Only] This token allows you to get the next
  3986. // page of results for list requests. If the number of results is larger
  3987. // than maxResults, use the nextPageToken as a value for the query
  3988. // parameter pageToken in the next list request. Subsequent list
  3989. // requests will have their own nextPageToken to continue paging through
  3990. // the results.
  3991. NextPageToken string `json:"nextPageToken,omitempty"`
  3992. // SelfLink: [Output Only] Server-defined URL for this resource.
  3993. SelfLink string `json:"selfLink,omitempty"`
  3994. // ServerResponse contains the HTTP response code and headers from the
  3995. // server.
  3996. googleapi.ServerResponse `json:"-"`
  3997. // ForceSendFields is a list of field names (e.g. "Id") to
  3998. // unconditionally include in API requests. By default, fields with
  3999. // empty values are omitted from API requests. However, any non-pointer,
  4000. // non-interface field appearing in ForceSendFields will be sent to the
  4001. // server regardless of whether the field is empty or not. This may be
  4002. // used to include empty fields in Patch requests.
  4003. ForceSendFields []string `json:"-"`
  4004. }
  4005. func (s *MachineTypeList) MarshalJSON() ([]byte, error) {
  4006. type noMethod MachineTypeList
  4007. raw := noMethod(*s)
  4008. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4009. }
  4010. type MachineTypesScopedList struct {
  4011. // MachineTypes: [Output Only] List of machine types contained in this
  4012. // scope.
  4013. MachineTypes []*MachineType `json:"machineTypes,omitempty"`
  4014. // Warning: [Output Only] An informational warning that appears when the
  4015. // machine types list is empty.
  4016. Warning *MachineTypesScopedListWarning `json:"warning,omitempty"`
  4017. // ForceSendFields is a list of field names (e.g. "MachineTypes") to
  4018. // unconditionally include in API requests. By default, fields with
  4019. // empty values are omitted from API requests. However, any non-pointer,
  4020. // non-interface field appearing in ForceSendFields will be sent to the
  4021. // server regardless of whether the field is empty or not. This may be
  4022. // used to include empty fields in Patch requests.
  4023. ForceSendFields []string `json:"-"`
  4024. }
  4025. func (s *MachineTypesScopedList) MarshalJSON() ([]byte, error) {
  4026. type noMethod MachineTypesScopedList
  4027. raw := noMethod(*s)
  4028. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4029. }
  4030. // MachineTypesScopedListWarning: [Output Only] An informational warning
  4031. // that appears when the machine types list is empty.
  4032. type MachineTypesScopedListWarning struct {
  4033. // Code: [Output Only] A warning code, if applicable. For example,
  4034. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  4035. // the response.
  4036. //
  4037. // Possible values:
  4038. // "DEPRECATED_RESOURCE_USED"
  4039. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4040. // "INJECTED_KERNELS_DEPRECATED"
  4041. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4042. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4043. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4044. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4045. // "NEXT_HOP_NOT_RUNNING"
  4046. // "NOT_CRITICAL_ERROR"
  4047. // "NO_RESULTS_ON_PAGE"
  4048. // "REQUIRED_TOS_AGREEMENT"
  4049. // "RESOURCE_NOT_DELETED"
  4050. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4051. // "UNREACHABLE"
  4052. Code string `json:"code,omitempty"`
  4053. // Data: [Output Only] Metadata about this warning in key: value format.
  4054. // For example:
  4055. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4056. Data []*MachineTypesScopedListWarningData `json:"data,omitempty"`
  4057. // Message: [Output Only] A human-readable description of the warning
  4058. // code.
  4059. Message string `json:"message,omitempty"`
  4060. // ForceSendFields is a list of field names (e.g. "Code") to
  4061. // unconditionally include in API requests. By default, fields with
  4062. // empty values are omitted from API requests. However, any non-pointer,
  4063. // non-interface field appearing in ForceSendFields will be sent to the
  4064. // server regardless of whether the field is empty or not. This may be
  4065. // used to include empty fields in Patch requests.
  4066. ForceSendFields []string `json:"-"`
  4067. }
  4068. func (s *MachineTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  4069. type noMethod MachineTypesScopedListWarning
  4070. raw := noMethod(*s)
  4071. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4072. }
  4073. type MachineTypesScopedListWarningData struct {
  4074. // Key: [Output Only] A key that provides more detail on the warning
  4075. // being returned. For example, for warnings where there are no results
  4076. // in a list request for a particular zone, this key might be scope and
  4077. // the key value might be the zone name. Other examples might be a key
  4078. // indicating a deprecated resource, and a suggested replacement, or a
  4079. // warning about invalid network settings (for example, if an instance
  4080. // attempts to perform IP forwarding but is not enabled for IP
  4081. // forwarding).
  4082. Key string `json:"key,omitempty"`
  4083. // Value: [Output Only] A warning data value corresponding to the key.
  4084. Value string `json:"value,omitempty"`
  4085. // ForceSendFields is a list of field names (e.g. "Key") to
  4086. // unconditionally include in API requests. By default, fields with
  4087. // empty values are omitted from API requests. However, any non-pointer,
  4088. // non-interface field appearing in ForceSendFields will be sent to the
  4089. // server regardless of whether the field is empty or not. This may be
  4090. // used to include empty fields in Patch requests.
  4091. ForceSendFields []string `json:"-"`
  4092. }
  4093. func (s *MachineTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  4094. type noMethod MachineTypesScopedListWarningData
  4095. raw := noMethod(*s)
  4096. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4097. }
  4098. type ManagedInstance struct {
  4099. // CurrentAction: [Output Only] The current action that the managed
  4100. // instance group has scheduled for the instance. Possible values:
  4101. // - NONE The instance is running, and the managed instance group does
  4102. // not have any scheduled actions for this instance.
  4103. // - CREATING The managed instance group is creating this instance. If
  4104. // the group fails to create this instance, it will try again until it
  4105. // is successful.
  4106. // - CREATING_WITHOUT_RETRIES The managed instance group is attempting
  4107. // to create this instance only once. If the group fails to create this
  4108. // instance, it does not try again and the group's target_size value is
  4109. // decreased.
  4110. // - RECREATING The managed instance group is recreating this instance.
  4111. //
  4112. // - DELETING The managed instance group is permanently deleting this
  4113. // instance.
  4114. // - ABANDONING The managed instance group is abandoning this instance.
  4115. // The instance will be removed from the instance group and from any
  4116. // target pools that are associated with this group.
  4117. // - RESTARTING The managed instance group is restarting the instance.
  4118. //
  4119. // - REFRESHING The managed instance group is applying configuration
  4120. // changes to the instance without stopping it. For example, the group
  4121. // can update the target pool list for an instance without stopping that
  4122. // instance.
  4123. //
  4124. // Possible values:
  4125. // "ABANDONING"
  4126. // "CREATING"
  4127. // "DELETING"
  4128. // "NONE"
  4129. // "RECREATING"
  4130. // "REFRESHING"
  4131. // "RESTARTING"
  4132. CurrentAction string `json:"currentAction,omitempty"`
  4133. // Id: [Output only] The unique identifier for this resource. This field
  4134. // is empty when instance does not exist.
  4135. Id uint64 `json:"id,omitempty,string"`
  4136. // Instance: [Output Only] The URL of the instance. The URL can exist
  4137. // even if the instance has not yet been created.
  4138. Instance string `json:"instance,omitempty"`
  4139. // InstanceStatus: [Output Only] The status of the instance. This field
  4140. // is empty when the instance does not exist.
  4141. //
  4142. // Possible values:
  4143. // "PROVISIONING"
  4144. // "RUNNING"
  4145. // "STAGING"
  4146. // "STOPPED"
  4147. // "STOPPING"
  4148. // "SUSPENDED"
  4149. // "SUSPENDING"
  4150. // "TERMINATED"
  4151. InstanceStatus string `json:"instanceStatus,omitempty"`
  4152. // LastAttempt: [Output Only] Information about the last attempt to
  4153. // create or delete the instance.
  4154. LastAttempt *ManagedInstanceLastAttempt `json:"lastAttempt,omitempty"`
  4155. // ForceSendFields is a list of field names (e.g. "CurrentAction") to
  4156. // unconditionally include in API requests. By default, fields with
  4157. // empty values are omitted from API requests. However, any non-pointer,
  4158. // non-interface field appearing in ForceSendFields will be sent to the
  4159. // server regardless of whether the field is empty or not. This may be
  4160. // used to include empty fields in Patch requests.
  4161. ForceSendFields []string `json:"-"`
  4162. }
  4163. func (s *ManagedInstance) MarshalJSON() ([]byte, error) {
  4164. type noMethod ManagedInstance
  4165. raw := noMethod(*s)
  4166. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4167. }
  4168. type ManagedInstanceLastAttempt struct {
  4169. // Errors: [Output Only] Encountered errors during the last attempt to
  4170. // create or delete the instance.
  4171. Errors *ManagedInstanceLastAttemptErrors `json:"errors,omitempty"`
  4172. // ForceSendFields is a list of field names (e.g. "Errors") to
  4173. // unconditionally include in API requests. By default, fields with
  4174. // empty values are omitted from API requests. However, any non-pointer,
  4175. // non-interface field appearing in ForceSendFields will be sent to the
  4176. // server regardless of whether the field is empty or not. This may be
  4177. // used to include empty fields in Patch requests.
  4178. ForceSendFields []string `json:"-"`
  4179. }
  4180. func (s *ManagedInstanceLastAttempt) MarshalJSON() ([]byte, error) {
  4181. type noMethod ManagedInstanceLastAttempt
  4182. raw := noMethod(*s)
  4183. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4184. }
  4185. // ManagedInstanceLastAttemptErrors: [Output Only] Encountered errors
  4186. // during the last attempt to create or delete the instance.
  4187. type ManagedInstanceLastAttemptErrors struct {
  4188. // Errors: [Output Only] The array of errors encountered while
  4189. // processing this operation.
  4190. Errors []*ManagedInstanceLastAttemptErrorsErrors `json:"errors,omitempty"`
  4191. // ForceSendFields is a list of field names (e.g. "Errors") 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 *ManagedInstanceLastAttemptErrors) MarshalJSON() ([]byte, error) {
  4200. type noMethod ManagedInstanceLastAttemptErrors
  4201. raw := noMethod(*s)
  4202. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4203. }
  4204. type ManagedInstanceLastAttemptErrorsErrors struct {
  4205. // Code: [Output Only] The error type identifier for this error.
  4206. Code string `json:"code,omitempty"`
  4207. // Location: [Output Only] Indicates the field in the request which
  4208. // caused the error. This property is optional.
  4209. Location string `json:"location,omitempty"`
  4210. // Message: [Output Only] An optional, human-readable error message.
  4211. Message string `json:"message,omitempty"`
  4212. // ForceSendFields is a list of field names (e.g. "Code") to
  4213. // unconditionally include in API requests. By default, fields with
  4214. // empty values are omitted from API requests. However, any non-pointer,
  4215. // non-interface field appearing in ForceSendFields will be sent to the
  4216. // server regardless of whether the field is empty or not. This may be
  4217. // used to include empty fields in Patch requests.
  4218. ForceSendFields []string `json:"-"`
  4219. }
  4220. func (s *ManagedInstanceLastAttemptErrorsErrors) MarshalJSON() ([]byte, error) {
  4221. type noMethod ManagedInstanceLastAttemptErrorsErrors
  4222. raw := noMethod(*s)
  4223. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4224. }
  4225. // Metadata: A metadata key/value entry.
  4226. type Metadata struct {
  4227. // Fingerprint: Specifies a fingerprint for this request, which is
  4228. // essentially a hash of the metadata's contents and used for optimistic
  4229. // locking. The fingerprint is initially generated by Compute Engine and
  4230. // changes after every request to modify or update metadata. You must
  4231. // always provide an up-to-date fingerprint hash in order to update or
  4232. // change metadata.
  4233. Fingerprint string `json:"fingerprint,omitempty"`
  4234. // Items: Array of key/value pairs. The total size of all keys and
  4235. // values must be less than 512 KB.
  4236. Items []*MetadataItems `json:"items,omitempty"`
  4237. // Kind: [Output Only] Type of the resource. Always compute#metadata for
  4238. // metadata.
  4239. Kind string `json:"kind,omitempty"`
  4240. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  4241. // unconditionally include in API requests. By default, fields with
  4242. // empty values are omitted from API requests. However, any non-pointer,
  4243. // non-interface field appearing in ForceSendFields will be sent to the
  4244. // server regardless of whether the field is empty or not. This may be
  4245. // used to include empty fields in Patch requests.
  4246. ForceSendFields []string `json:"-"`
  4247. }
  4248. func (s *Metadata) MarshalJSON() ([]byte, error) {
  4249. type noMethod Metadata
  4250. raw := noMethod(*s)
  4251. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4252. }
  4253. type MetadataItems struct {
  4254. // Key: Key for the metadata entry. Keys must conform to the following
  4255. // regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is
  4256. // reflected as part of a URL in the metadata server. Additionally, to
  4257. // avoid ambiguity, keys must not conflict with any other metadata keys
  4258. // for the project.
  4259. Key string `json:"key,omitempty"`
  4260. // Value: Value for the metadata entry. These are free-form strings, and
  4261. // only have meaning as interpreted by the image running in the
  4262. // instance. The only restriction placed on values is that their size
  4263. // must be less than or equal to 32768 bytes.
  4264. Value *string `json:"value,omitempty"`
  4265. // ForceSendFields is a list of field names (e.g. "Key") to
  4266. // unconditionally include in API requests. By default, fields with
  4267. // empty values are omitted from API requests. However, any non-pointer,
  4268. // non-interface field appearing in ForceSendFields will be sent to the
  4269. // server regardless of whether the field is empty or not. This may be
  4270. // used to include empty fields in Patch requests.
  4271. ForceSendFields []string `json:"-"`
  4272. }
  4273. func (s *MetadataItems) MarshalJSON() ([]byte, error) {
  4274. type noMethod MetadataItems
  4275. raw := noMethod(*s)
  4276. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4277. }
  4278. // NamedPort: The named port. For example: .
  4279. type NamedPort struct {
  4280. // Name: The name for this named port. The name must be 1-63 characters
  4281. // long, and comply with RFC1035.
  4282. Name string `json:"name,omitempty"`
  4283. // Port: The port number, which can be a value between 1 and 65535.
  4284. Port int64 `json:"port,omitempty"`
  4285. // ForceSendFields is a list of field names (e.g. "Name") to
  4286. // unconditionally include in API requests. By default, fields with
  4287. // empty values are omitted from API requests. However, any non-pointer,
  4288. // non-interface field appearing in ForceSendFields will be sent to the
  4289. // server regardless of whether the field is empty or not. This may be
  4290. // used to include empty fields in Patch requests.
  4291. ForceSendFields []string `json:"-"`
  4292. }
  4293. func (s *NamedPort) MarshalJSON() ([]byte, error) {
  4294. type noMethod NamedPort
  4295. raw := noMethod(*s)
  4296. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4297. }
  4298. // Network: A network resource.
  4299. type Network struct {
  4300. // IPv4Range: The range of internal addresses that are legal on this
  4301. // network. This range is a CIDR specification, for example:
  4302. // 192.168.0.0/16. Provided by the client when the network is created.
  4303. IPv4Range string `json:"IPv4Range,omitempty"`
  4304. // AutoCreateSubnetworks: When set to true, the network is created in
  4305. // "auto subnet mode". When set to false, the network is in "custom
  4306. // subnet mode".
  4307. //
  4308. // In "auto subnet mode", a newly created network is assigned the
  4309. // default CIDR of 10.128.0.0/9 and it automatically creates one
  4310. // subnetwork per region.
  4311. AutoCreateSubnetworks bool `json:"autoCreateSubnetworks,omitempty"`
  4312. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  4313. // format.
  4314. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  4315. // Description: An optional description of this resource. Provide this
  4316. // property when you create the resource.
  4317. Description string `json:"description,omitempty"`
  4318. // GatewayIPv4: A gateway address for default routing to other networks.
  4319. // This value is read only and is selected by the Google Compute Engine,
  4320. // typically as the first usable address in the IPv4Range.
  4321. GatewayIPv4 string `json:"gatewayIPv4,omitempty"`
  4322. // Id: [Output Only] The unique identifier for the resource. This
  4323. // identifier is defined by the server.
  4324. Id uint64 `json:"id,omitempty,string"`
  4325. // Kind: [Output Only] Type of the resource. Always compute#network for
  4326. // networks.
  4327. Kind string `json:"kind,omitempty"`
  4328. // Name: Name of the resource. Provided by the client when the resource
  4329. // is created. The name must be 1-63 characters long, and comply with
  4330. // RFC1035. Specifically, the name must be 1-63 characters long and
  4331. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  4332. // the first character must be a lowercase letter, and all following
  4333. // characters must be a dash, lowercase letter, or digit, except the
  4334. // last character, which cannot be a dash.
  4335. Name string `json:"name,omitempty"`
  4336. // SelfLink: [Output Only] Server-defined URL for the resource.
  4337. SelfLink string `json:"selfLink,omitempty"`
  4338. // Subnetworks: [Output Only] Server-defined fully-qualified URLs for
  4339. // all subnetworks in this network.
  4340. Subnetworks []string `json:"subnetworks,omitempty"`
  4341. // ServerResponse contains the HTTP response code and headers from the
  4342. // server.
  4343. googleapi.ServerResponse `json:"-"`
  4344. // ForceSendFields is a list of field names (e.g. "IPv4Range") to
  4345. // unconditionally include in API requests. By default, fields with
  4346. // empty values are omitted from API requests. However, any non-pointer,
  4347. // non-interface field appearing in ForceSendFields will be sent to the
  4348. // server regardless of whether the field is empty or not. This may be
  4349. // used to include empty fields in Patch requests.
  4350. ForceSendFields []string `json:"-"`
  4351. }
  4352. func (s *Network) MarshalJSON() ([]byte, error) {
  4353. type noMethod Network
  4354. raw := noMethod(*s)
  4355. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4356. }
  4357. // NetworkInterface: A network interface resource attached to an
  4358. // instance.
  4359. type NetworkInterface struct {
  4360. // AccessConfigs: An array of configurations for this interface.
  4361. // Currently, ONE_TO_ONE_NAT is the only access config supported. If
  4362. // there are no accessConfigs specified, then this instance will have no
  4363. // external internet access.
  4364. AccessConfigs []*AccessConfig `json:"accessConfigs,omitempty"`
  4365. // Name: [Output Only] The name of the network interface, generated by
  4366. // the server. For network devices, these are eth0, eth1, etc.
  4367. Name string `json:"name,omitempty"`
  4368. // Network: URL of the network resource for this instance. This is
  4369. // required for creating an instance but optional when creating a
  4370. // firewall rule. If not specified when creating a firewall rule, the
  4371. // default network is used:
  4372. //
  4373. // global/networks/default
  4374. //
  4375. // If you specify this property, you can specify the network as a full
  4376. // or partial URL. For example, the following are all valid URLs:
  4377. // -
  4378. // https://www.googleapis.com/compute/v1/projects/project/global/networks/network
  4379. // - projects/project/global/networks/network
  4380. // - global/networks/default
  4381. Network string `json:"network,omitempty"`
  4382. // NetworkIP: [Output Only] An optional IPV4 internal network address
  4383. // assigned to the instance for this network interface.
  4384. NetworkIP string `json:"networkIP,omitempty"`
  4385. // Subnetwork: The URL of the Subnetwork resource for this instance. If
  4386. // the network resource is in legacy mode, do not provide this property.
  4387. // If the network is in auto subnet mode, providing the subnetwork is
  4388. // optional. If the network is in custom subnet mode, then this field
  4389. // should be specified. If you specify this property, you can specify
  4390. // the subnetwork as a full or partial URL. For example, the following
  4391. // are all valid URLs:
  4392. // -
  4393. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/subnetworks/subnetwork
  4394. // - zones/zone/subnetworks/subnetwork
  4395. Subnetwork string `json:"subnetwork,omitempty"`
  4396. // ForceSendFields is a list of field names (e.g. "AccessConfigs") 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 *NetworkInterface) MarshalJSON() ([]byte, error) {
  4405. type noMethod NetworkInterface
  4406. raw := noMethod(*s)
  4407. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4408. }
  4409. // NetworkList: Contains a list of Network resources.
  4410. type NetworkList struct {
  4411. // Id: [Output Only] The unique identifier for the resource. This
  4412. // identifier is defined by the server.
  4413. Id string `json:"id,omitempty"`
  4414. // Items: [Output Only] A list of Network resources.
  4415. Items []*Network `json:"items,omitempty"`
  4416. // Kind: [Output Only] Type of resource. Always compute#networkList for
  4417. // lists of networks.
  4418. Kind string `json:"kind,omitempty"`
  4419. // NextPageToken: [Output Only] This token allows you to get the next
  4420. // page of results for list requests. If the number of results is larger
  4421. // than maxResults, use the nextPageToken as a value for the query
  4422. // parameter pageToken in the next list request. Subsequent list
  4423. // requests will have their own nextPageToken to continue paging through
  4424. // the results.
  4425. NextPageToken string `json:"nextPageToken,omitempty"`
  4426. // SelfLink: [Output Only] Server-defined URL for this resource .
  4427. SelfLink string `json:"selfLink,omitempty"`
  4428. // ServerResponse contains the HTTP response code and headers from the
  4429. // server.
  4430. googleapi.ServerResponse `json:"-"`
  4431. // ForceSendFields is a list of field names (e.g. "Id") to
  4432. // unconditionally include in API requests. By default, fields with
  4433. // empty values are omitted from API requests. However, any non-pointer,
  4434. // non-interface field appearing in ForceSendFields will be sent to the
  4435. // server regardless of whether the field is empty or not. This may be
  4436. // used to include empty fields in Patch requests.
  4437. ForceSendFields []string `json:"-"`
  4438. }
  4439. func (s *NetworkList) MarshalJSON() ([]byte, error) {
  4440. type noMethod NetworkList
  4441. raw := noMethod(*s)
  4442. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4443. }
  4444. // Operation: An Operation resource, used to manage asynchronous API
  4445. // requests.
  4446. type Operation struct {
  4447. // ClientOperationId: [Output Only] A unique client ID generated by the
  4448. // server.
  4449. ClientOperationId string `json:"clientOperationId,omitempty"`
  4450. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  4451. // format.
  4452. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  4453. // Description: [Output Only] A textual description of the operation,
  4454. // which is set when the operation is created.
  4455. Description string `json:"description,omitempty"`
  4456. // EndTime: [Output Only] The time that this operation was completed.
  4457. // This value is in RFC3339 text format.
  4458. EndTime string `json:"endTime,omitempty"`
  4459. // Error: [Output Only] If errors are generated during processing of the
  4460. // operation, this field will be populated.
  4461. Error *OperationError `json:"error,omitempty"`
  4462. // HttpErrorMessage: [Output Only] If the operation fails, this field
  4463. // contains the HTTP error message that was returned, such as NOT FOUND.
  4464. HttpErrorMessage string `json:"httpErrorMessage,omitempty"`
  4465. // HttpErrorStatusCode: [Output Only] If the operation fails, this field
  4466. // contains the HTTP error status code that was returned. For example, a
  4467. // 404 means the resource was not found.
  4468. HttpErrorStatusCode int64 `json:"httpErrorStatusCode,omitempty"`
  4469. // Id: [Output Only] The unique identifier for the resource. This
  4470. // identifier is defined by the server.
  4471. Id uint64 `json:"id,omitempty,string"`
  4472. // InsertTime: [Output Only] The time that this operation was requested.
  4473. // This value is in RFC3339 text format.
  4474. InsertTime string `json:"insertTime,omitempty"`
  4475. // Kind: [Output Only] Type of the resource. Always compute#operation
  4476. // for Operation resources.
  4477. Kind string `json:"kind,omitempty"`
  4478. // Name: [Output Only] Name of the resource.
  4479. Name string `json:"name,omitempty"`
  4480. // OperationType: [Output Only] The type of operation, which can be
  4481. // insert, update, or delete.
  4482. OperationType string `json:"operationType,omitempty"`
  4483. // Progress: [Output Only] An optional progress indicator that ranges
  4484. // from 0 to 100. There is no requirement that this be linear or support
  4485. // any granularity of operations. This should not be used to guess when
  4486. // the operation will be complete. This number should monotonically
  4487. // increase as the operation progresses.
  4488. Progress int64 `json:"progress,omitempty"`
  4489. // Region: [Output Only] URL of the region where the operation resides.
  4490. // Only available when performing regional operations.
  4491. Region string `json:"region,omitempty"`
  4492. // SelfLink: [Output Only] Server-defined URL for the resource.
  4493. SelfLink string `json:"selfLink,omitempty"`
  4494. // StartTime: [Output Only] The time that this operation was started by
  4495. // the server. This value is in RFC3339 text format.
  4496. StartTime string `json:"startTime,omitempty"`
  4497. // Status: [Output Only] The status of the operation, which can be one
  4498. // of the following: PENDING, RUNNING, or DONE.
  4499. //
  4500. // Possible values:
  4501. // "DONE"
  4502. // "PENDING"
  4503. // "RUNNING"
  4504. Status string `json:"status,omitempty"`
  4505. // StatusMessage: [Output Only] An optional textual description of the
  4506. // current status of the operation.
  4507. StatusMessage string `json:"statusMessage,omitempty"`
  4508. // TargetId: [Output Only] The unique target ID, which identifies a
  4509. // specific incarnation of the target resource.
  4510. TargetId uint64 `json:"targetId,omitempty,string"`
  4511. // TargetLink: [Output Only] The URL of the resource that the operation
  4512. // is modifying.
  4513. TargetLink string `json:"targetLink,omitempty"`
  4514. // User: [Output Only] User who requested the operation, for example:
  4515. // user@example.com.
  4516. User string `json:"user,omitempty"`
  4517. // Warnings: [Output Only] If warning messages are generated during
  4518. // processing of the operation, this field will be populated.
  4519. Warnings []*OperationWarnings `json:"warnings,omitempty"`
  4520. // Zone: [Output Only] URL of the zone where the operation resides. Only
  4521. // available when performing per-zone operations.
  4522. Zone string `json:"zone,omitempty"`
  4523. // ServerResponse contains the HTTP response code and headers from the
  4524. // server.
  4525. googleapi.ServerResponse `json:"-"`
  4526. // ForceSendFields is a list of field names (e.g. "ClientOperationId")
  4527. // to unconditionally include in API requests. By default, fields with
  4528. // empty values are omitted from API requests. However, any non-pointer,
  4529. // non-interface field appearing in ForceSendFields will be sent to the
  4530. // server regardless of whether the field is empty or not. This may be
  4531. // used to include empty fields in Patch requests.
  4532. ForceSendFields []string `json:"-"`
  4533. }
  4534. func (s *Operation) MarshalJSON() ([]byte, error) {
  4535. type noMethod Operation
  4536. raw := noMethod(*s)
  4537. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4538. }
  4539. // OperationError: [Output Only] If errors are generated during
  4540. // processing of the operation, this field will be populated.
  4541. type OperationError struct {
  4542. // Errors: [Output Only] The array of errors encountered while
  4543. // processing this operation.
  4544. Errors []*OperationErrorErrors `json:"errors,omitempty"`
  4545. // ForceSendFields is a list of field names (e.g. "Errors") to
  4546. // unconditionally include in API requests. By default, fields with
  4547. // empty values are omitted from API requests. However, any non-pointer,
  4548. // non-interface field appearing in ForceSendFields will be sent to the
  4549. // server regardless of whether the field is empty or not. This may be
  4550. // used to include empty fields in Patch requests.
  4551. ForceSendFields []string `json:"-"`
  4552. }
  4553. func (s *OperationError) MarshalJSON() ([]byte, error) {
  4554. type noMethod OperationError
  4555. raw := noMethod(*s)
  4556. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4557. }
  4558. type OperationErrorErrors struct {
  4559. // Code: [Output Only] The error type identifier for this error.
  4560. Code string `json:"code,omitempty"`
  4561. // Location: [Output Only] Indicates the field in the request which
  4562. // caused the error. This property is optional.
  4563. Location string `json:"location,omitempty"`
  4564. // Message: [Output Only] An optional, human-readable error message.
  4565. Message string `json:"message,omitempty"`
  4566. // ForceSendFields is a list of field names (e.g. "Code") to
  4567. // unconditionally include in API requests. By default, fields with
  4568. // empty values are omitted from API requests. However, any non-pointer,
  4569. // non-interface field appearing in ForceSendFields will be sent to the
  4570. // server regardless of whether the field is empty or not. This may be
  4571. // used to include empty fields in Patch requests.
  4572. ForceSendFields []string `json:"-"`
  4573. }
  4574. func (s *OperationErrorErrors) MarshalJSON() ([]byte, error) {
  4575. type noMethod OperationErrorErrors
  4576. raw := noMethod(*s)
  4577. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4578. }
  4579. type OperationWarnings struct {
  4580. // Code: [Output Only] A warning code, if applicable. For example,
  4581. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  4582. // the response.
  4583. //
  4584. // Possible values:
  4585. // "DEPRECATED_RESOURCE_USED"
  4586. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4587. // "INJECTED_KERNELS_DEPRECATED"
  4588. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4589. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4590. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4591. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4592. // "NEXT_HOP_NOT_RUNNING"
  4593. // "NOT_CRITICAL_ERROR"
  4594. // "NO_RESULTS_ON_PAGE"
  4595. // "REQUIRED_TOS_AGREEMENT"
  4596. // "RESOURCE_NOT_DELETED"
  4597. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4598. // "UNREACHABLE"
  4599. Code string `json:"code,omitempty"`
  4600. // Data: [Output Only] Metadata about this warning in key: value format.
  4601. // For example:
  4602. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4603. Data []*OperationWarningsData `json:"data,omitempty"`
  4604. // Message: [Output Only] A human-readable description of the warning
  4605. // code.
  4606. Message string `json:"message,omitempty"`
  4607. // ForceSendFields is a list of field names (e.g. "Code") to
  4608. // unconditionally include in API requests. By default, fields with
  4609. // empty values are omitted from API requests. However, any non-pointer,
  4610. // non-interface field appearing in ForceSendFields will be sent to the
  4611. // server regardless of whether the field is empty or not. This may be
  4612. // used to include empty fields in Patch requests.
  4613. ForceSendFields []string `json:"-"`
  4614. }
  4615. func (s *OperationWarnings) MarshalJSON() ([]byte, error) {
  4616. type noMethod OperationWarnings
  4617. raw := noMethod(*s)
  4618. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4619. }
  4620. type OperationWarningsData struct {
  4621. // Key: [Output Only] A key that provides more detail on the warning
  4622. // being returned. For example, for warnings where there are no results
  4623. // in a list request for a particular zone, this key might be scope and
  4624. // the key value might be the zone name. Other examples might be a key
  4625. // indicating a deprecated resource, and a suggested replacement, or a
  4626. // warning about invalid network settings (for example, if an instance
  4627. // attempts to perform IP forwarding but is not enabled for IP
  4628. // forwarding).
  4629. Key string `json:"key,omitempty"`
  4630. // Value: [Output Only] A warning data value corresponding to the key.
  4631. Value string `json:"value,omitempty"`
  4632. // ForceSendFields is a list of field names (e.g. "Key") to
  4633. // unconditionally include in API requests. By default, fields with
  4634. // empty values are omitted from API requests. However, any non-pointer,
  4635. // non-interface field appearing in ForceSendFields will be sent to the
  4636. // server regardless of whether the field is empty or not. This may be
  4637. // used to include empty fields in Patch requests.
  4638. ForceSendFields []string `json:"-"`
  4639. }
  4640. func (s *OperationWarningsData) MarshalJSON() ([]byte, error) {
  4641. type noMethod OperationWarningsData
  4642. raw := noMethod(*s)
  4643. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4644. }
  4645. type OperationAggregatedList struct {
  4646. // Id: [Output Only] The unique identifier for the resource. This
  4647. // identifier is defined by the server.
  4648. Id string `json:"id,omitempty"`
  4649. // Items: [Output Only] A map of scoped operation lists.
  4650. Items map[string]OperationsScopedList `json:"items,omitempty"`
  4651. // Kind: [Output Only] Type of resource. Always
  4652. // compute#operationAggregatedList for aggregated lists of operations.
  4653. Kind string `json:"kind,omitempty"`
  4654. // NextPageToken: [Output Only] This token allows you to get the next
  4655. // page of results for list requests. If the number of results is larger
  4656. // than maxResults, use the nextPageToken as a value for the query
  4657. // parameter pageToken in the next list request. Subsequent list
  4658. // requests will have their own nextPageToken to continue paging through
  4659. // the results.
  4660. NextPageToken string `json:"nextPageToken,omitempty"`
  4661. // SelfLink: [Output Only] Server-defined URL for this resource.
  4662. SelfLink string `json:"selfLink,omitempty"`
  4663. // ServerResponse contains the HTTP response code and headers from the
  4664. // server.
  4665. googleapi.ServerResponse `json:"-"`
  4666. // ForceSendFields is a list of field names (e.g. "Id") to
  4667. // unconditionally include in API requests. By default, fields with
  4668. // empty values are omitted from API requests. However, any non-pointer,
  4669. // non-interface field appearing in ForceSendFields will be sent to the
  4670. // server regardless of whether the field is empty or not. This may be
  4671. // used to include empty fields in Patch requests.
  4672. ForceSendFields []string `json:"-"`
  4673. }
  4674. func (s *OperationAggregatedList) MarshalJSON() ([]byte, error) {
  4675. type noMethod OperationAggregatedList
  4676. raw := noMethod(*s)
  4677. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4678. }
  4679. // OperationList: Contains a list of Operation resources.
  4680. type OperationList struct {
  4681. // Id: [Output Only] The unique identifier for the resource. This
  4682. // identifier is defined by the server.
  4683. Id string `json:"id,omitempty"`
  4684. // Items: [Output Only] The Operation resources.
  4685. Items []*Operation `json:"items,omitempty"`
  4686. // Kind: [Output Only] Type of resource. Always compute#operations for
  4687. // Operations resource.
  4688. Kind string `json:"kind,omitempty"`
  4689. // NextPageToken: [Output Only] This token allows you to get the next
  4690. // page of results for list requests. If the number of results is larger
  4691. // than maxResults, use the nextPageToken as a value for the query
  4692. // parameter pageToken in the next list request. Subsequent list
  4693. // requests will have their own nextPageToken to continue paging through
  4694. // the results.
  4695. NextPageToken string `json:"nextPageToken,omitempty"`
  4696. // SelfLink: [Output Only] Server-defined URL for this resource.
  4697. SelfLink string `json:"selfLink,omitempty"`
  4698. // ServerResponse contains the HTTP response code and headers from the
  4699. // server.
  4700. googleapi.ServerResponse `json:"-"`
  4701. // ForceSendFields is a list of field names (e.g. "Id") to
  4702. // unconditionally include in API requests. By default, fields with
  4703. // empty values are omitted from API requests. However, any non-pointer,
  4704. // non-interface field appearing in ForceSendFields will be sent to the
  4705. // server regardless of whether the field is empty or not. This may be
  4706. // used to include empty fields in Patch requests.
  4707. ForceSendFields []string `json:"-"`
  4708. }
  4709. func (s *OperationList) MarshalJSON() ([]byte, error) {
  4710. type noMethod OperationList
  4711. raw := noMethod(*s)
  4712. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4713. }
  4714. type OperationsScopedList struct {
  4715. // Operations: [Output Only] List of operations contained in this scope.
  4716. Operations []*Operation `json:"operations,omitempty"`
  4717. // Warning: [Output Only] Informational warning which replaces the list
  4718. // of operations when the list is empty.
  4719. Warning *OperationsScopedListWarning `json:"warning,omitempty"`
  4720. // ForceSendFields is a list of field names (e.g. "Operations") to
  4721. // unconditionally include in API requests. By default, fields with
  4722. // empty values are omitted from API requests. However, any non-pointer,
  4723. // non-interface field appearing in ForceSendFields will be sent to the
  4724. // server regardless of whether the field is empty or not. This may be
  4725. // used to include empty fields in Patch requests.
  4726. ForceSendFields []string `json:"-"`
  4727. }
  4728. func (s *OperationsScopedList) MarshalJSON() ([]byte, error) {
  4729. type noMethod OperationsScopedList
  4730. raw := noMethod(*s)
  4731. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4732. }
  4733. // OperationsScopedListWarning: [Output Only] Informational warning
  4734. // which replaces the list of operations when the list is empty.
  4735. type OperationsScopedListWarning struct {
  4736. // Code: [Output Only] A warning code, if applicable. For example,
  4737. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  4738. // the response.
  4739. //
  4740. // Possible values:
  4741. // "DEPRECATED_RESOURCE_USED"
  4742. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4743. // "INJECTED_KERNELS_DEPRECATED"
  4744. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4745. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4746. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4747. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4748. // "NEXT_HOP_NOT_RUNNING"
  4749. // "NOT_CRITICAL_ERROR"
  4750. // "NO_RESULTS_ON_PAGE"
  4751. // "REQUIRED_TOS_AGREEMENT"
  4752. // "RESOURCE_NOT_DELETED"
  4753. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4754. // "UNREACHABLE"
  4755. Code string `json:"code,omitempty"`
  4756. // Data: [Output Only] Metadata about this warning in key: value format.
  4757. // For example:
  4758. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4759. Data []*OperationsScopedListWarningData `json:"data,omitempty"`
  4760. // Message: [Output Only] A human-readable description of the warning
  4761. // code.
  4762. Message string `json:"message,omitempty"`
  4763. // ForceSendFields is a list of field names (e.g. "Code") 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 *OperationsScopedListWarning) MarshalJSON() ([]byte, error) {
  4772. type noMethod OperationsScopedListWarning
  4773. raw := noMethod(*s)
  4774. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4775. }
  4776. type OperationsScopedListWarningData struct {
  4777. // Key: [Output Only] A key that provides more detail on the warning
  4778. // being returned. For example, for warnings where there are no results
  4779. // in a list request for a particular zone, this key might be scope and
  4780. // the key value might be the zone name. Other examples might be a key
  4781. // indicating a deprecated resource, and a suggested replacement, or a
  4782. // warning about invalid network settings (for example, if an instance
  4783. // attempts to perform IP forwarding but is not enabled for IP
  4784. // forwarding).
  4785. Key string `json:"key,omitempty"`
  4786. // Value: [Output Only] A warning data value corresponding to the key.
  4787. Value string `json:"value,omitempty"`
  4788. // ForceSendFields is a list of field names (e.g. "Key") to
  4789. // unconditionally include in API requests. By default, fields with
  4790. // empty values are omitted from API requests. However, any non-pointer,
  4791. // non-interface field appearing in ForceSendFields will be sent to the
  4792. // server regardless of whether the field is empty or not. This may be
  4793. // used to include empty fields in Patch requests.
  4794. ForceSendFields []string `json:"-"`
  4795. }
  4796. func (s *OperationsScopedListWarningData) MarshalJSON() ([]byte, error) {
  4797. type noMethod OperationsScopedListWarningData
  4798. raw := noMethod(*s)
  4799. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4800. }
  4801. // PathMatcher: A matcher for the path portion of the URL. The
  4802. // BackendService from the longest-matched rule will serve the URL. If
  4803. // no rule was matched, the default service will be used.
  4804. type PathMatcher struct {
  4805. // DefaultService: The full or partial URL to the BackendService
  4806. // resource. This will be used if none of the pathRules defined by this
  4807. // PathMatcher is matched by the URL's path portion. For example, the
  4808. // following are all valid URLs to a BackendService resource:
  4809. // -
  4810. // https://www.googleapis.com/compute/v1/projects/project/global/backendServices/backendService
  4811. // - compute/v1/projects/project/global/backendServices/backendService
  4812. //
  4813. // - global/backendServices/backendService
  4814. DefaultService string `json:"defaultService,omitempty"`
  4815. // Description: An optional description of this resource. Provide this
  4816. // property when you create the resource.
  4817. Description string `json:"description,omitempty"`
  4818. // Name: The name to which this PathMatcher is referred by the HostRule.
  4819. Name string `json:"name,omitempty"`
  4820. // PathRules: The list of path rules.
  4821. PathRules []*PathRule `json:"pathRules,omitempty"`
  4822. // ForceSendFields is a list of field names (e.g. "DefaultService") to
  4823. // unconditionally include in API requests. By default, fields with
  4824. // empty values are omitted from API requests. However, any non-pointer,
  4825. // non-interface field appearing in ForceSendFields will be sent to the
  4826. // server regardless of whether the field is empty or not. This may be
  4827. // used to include empty fields in Patch requests.
  4828. ForceSendFields []string `json:"-"`
  4829. }
  4830. func (s *PathMatcher) MarshalJSON() ([]byte, error) {
  4831. type noMethod PathMatcher
  4832. raw := noMethod(*s)
  4833. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4834. }
  4835. // PathRule: A path-matching rule for a URL. If matched, will use the
  4836. // specified BackendService to handle the traffic arriving at this URL.
  4837. type PathRule struct {
  4838. // Paths: The list of path patterns to match. Each must start with / and
  4839. // the only place a * is allowed is at the end following a /. The string
  4840. // fed to the path matcher does not include any text after the first ?
  4841. // or #, and those chars are not allowed here.
  4842. Paths []string `json:"paths,omitempty"`
  4843. // Service: The URL of the BackendService resource if this rule is
  4844. // matched.
  4845. Service string `json:"service,omitempty"`
  4846. // ForceSendFields is a list of field names (e.g. "Paths") to
  4847. // unconditionally include in API requests. By default, fields with
  4848. // empty values are omitted from API requests. However, any non-pointer,
  4849. // non-interface field appearing in ForceSendFields will be sent to the
  4850. // server regardless of whether the field is empty or not. This may be
  4851. // used to include empty fields in Patch requests.
  4852. ForceSendFields []string `json:"-"`
  4853. }
  4854. func (s *PathRule) MarshalJSON() ([]byte, error) {
  4855. type noMethod PathRule
  4856. raw := noMethod(*s)
  4857. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4858. }
  4859. // Project: A Project resource. Projects can only be created in the
  4860. // Google Developers Console. Unless marked otherwise, values can only
  4861. // be modified in the console.
  4862. type Project struct {
  4863. // CommonInstanceMetadata: Metadata key/value pairs available to all
  4864. // instances contained in this project. See Custom metadata for more
  4865. // information.
  4866. CommonInstanceMetadata *Metadata `json:"commonInstanceMetadata,omitempty"`
  4867. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  4868. // format.
  4869. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  4870. // Description: An optional textual description of the resource.
  4871. Description string `json:"description,omitempty"`
  4872. // EnabledFeatures: Restricted features enabled for use on this project.
  4873. EnabledFeatures []string `json:"enabledFeatures,omitempty"`
  4874. // Id: [Output Only] The unique identifier for the resource. This
  4875. // identifier is defined by the server. This is not the project ID, and
  4876. // is just a unique ID used by Compute Engine to identify resources.
  4877. Id uint64 `json:"id,omitempty,string"`
  4878. // Kind: [Output Only] Type of the resource. Always compute#project for
  4879. // projects.
  4880. Kind string `json:"kind,omitempty"`
  4881. // Name: The project ID. For example: my-example-project. Use the
  4882. // project ID to make requests to Compute Engine.
  4883. Name string `json:"name,omitempty"`
  4884. // Quotas: [Output Only] Quotas assigned to this project.
  4885. Quotas []*Quota `json:"quotas,omitempty"`
  4886. // SelfLink: [Output Only] Server-defined URL for the resource.
  4887. SelfLink string `json:"selfLink,omitempty"`
  4888. // UsageExportLocation: The naming prefix for daily usage reports and
  4889. // the Google Cloud Storage bucket where they are stored.
  4890. UsageExportLocation *UsageExportLocation `json:"usageExportLocation,omitempty"`
  4891. // ServerResponse contains the HTTP response code and headers from the
  4892. // server.
  4893. googleapi.ServerResponse `json:"-"`
  4894. // ForceSendFields is a list of field names (e.g.
  4895. // "CommonInstanceMetadata") to unconditionally include in API requests.
  4896. // By default, fields with empty values are omitted from API requests.
  4897. // However, any non-pointer, non-interface field appearing in
  4898. // ForceSendFields will be sent to the server regardless of whether the
  4899. // field is empty or not. This may be used to include empty fields in
  4900. // Patch requests.
  4901. ForceSendFields []string `json:"-"`
  4902. }
  4903. func (s *Project) MarshalJSON() ([]byte, error) {
  4904. type noMethod Project
  4905. raw := noMethod(*s)
  4906. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4907. }
  4908. // Quota: A quotas entry.
  4909. type Quota struct {
  4910. // Limit: [Output Only] Quota limit for this metric.
  4911. Limit float64 `json:"limit,omitempty"`
  4912. // Metric: [Output Only] Name of the quota metric.
  4913. //
  4914. // Possible values:
  4915. // "AUTOSCALERS"
  4916. // "BACKEND_SERVICES"
  4917. // "CPUS"
  4918. // "DISKS_TOTAL_GB"
  4919. // "FIREWALLS"
  4920. // "FORWARDING_RULES"
  4921. // "HEALTH_CHECKS"
  4922. // "IMAGES"
  4923. // "INSTANCES"
  4924. // "INSTANCE_GROUPS"
  4925. // "INSTANCE_GROUP_MANAGERS"
  4926. // "INSTANCE_TEMPLATES"
  4927. // "IN_USE_ADDRESSES"
  4928. // "LOCAL_SSD_TOTAL_GB"
  4929. // "NETWORKS"
  4930. // "ROUTES"
  4931. // "SNAPSHOTS"
  4932. // "SSD_TOTAL_GB"
  4933. // "SSL_CERTIFICATES"
  4934. // "STATIC_ADDRESSES"
  4935. // "SUBNETWORKS"
  4936. // "TARGET_HTTPS_PROXIES"
  4937. // "TARGET_HTTP_PROXIES"
  4938. // "TARGET_INSTANCES"
  4939. // "TARGET_POOLS"
  4940. // "TARGET_VPN_GATEWAYS"
  4941. // "URL_MAPS"
  4942. // "VPN_TUNNELS"
  4943. Metric string `json:"metric,omitempty"`
  4944. // Usage: [Output Only] Current usage of this metric.
  4945. Usage float64 `json:"usage,omitempty"`
  4946. // ForceSendFields is a list of field names (e.g. "Limit") to
  4947. // unconditionally include in API requests. By default, fields with
  4948. // empty values are omitted from API requests. However, any non-pointer,
  4949. // non-interface field appearing in ForceSendFields will be sent to the
  4950. // server regardless of whether the field is empty or not. This may be
  4951. // used to include empty fields in Patch requests.
  4952. ForceSendFields []string `json:"-"`
  4953. }
  4954. func (s *Quota) MarshalJSON() ([]byte, error) {
  4955. type noMethod Quota
  4956. raw := noMethod(*s)
  4957. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4958. }
  4959. // Region: Region resource.
  4960. type Region struct {
  4961. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  4962. // format.
  4963. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  4964. // Deprecated: [Output Only] The deprecation status associated with this
  4965. // region.
  4966. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  4967. // Description: [Output Only] Textual description of the resource.
  4968. Description string `json:"description,omitempty"`
  4969. // Id: [Output Only] The unique identifier for the resource. This
  4970. // identifier is defined by the server.
  4971. Id uint64 `json:"id,omitempty,string"`
  4972. // Kind: [Output Only] Type of the resource. Always compute#region for
  4973. // regions.
  4974. Kind string `json:"kind,omitempty"`
  4975. // Name: [Output Only] Name of the resource.
  4976. Name string `json:"name,omitempty"`
  4977. // Quotas: [Output Only] Quotas assigned to this region.
  4978. Quotas []*Quota `json:"quotas,omitempty"`
  4979. // SelfLink: [Output Only] Server-defined URL for the resource.
  4980. SelfLink string `json:"selfLink,omitempty"`
  4981. // Status: [Output Only] Status of the region, either UP or DOWN.
  4982. //
  4983. // Possible values:
  4984. // "DOWN"
  4985. // "UP"
  4986. Status string `json:"status,omitempty"`
  4987. // Zones: [Output Only] A list of zones available in this region, in the
  4988. // form of resource URLs.
  4989. Zones []string `json:"zones,omitempty"`
  4990. // ServerResponse contains the HTTP response code and headers from the
  4991. // server.
  4992. googleapi.ServerResponse `json:"-"`
  4993. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  4994. // to unconditionally include in API requests. By default, fields with
  4995. // empty values are omitted from API requests. However, any non-pointer,
  4996. // non-interface field appearing in ForceSendFields will be sent to the
  4997. // server regardless of whether the field is empty or not. This may be
  4998. // used to include empty fields in Patch requests.
  4999. ForceSendFields []string `json:"-"`
  5000. }
  5001. func (s *Region) MarshalJSON() ([]byte, error) {
  5002. type noMethod Region
  5003. raw := noMethod(*s)
  5004. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5005. }
  5006. // RegionList: Contains a list of region resources.
  5007. type RegionList struct {
  5008. // Id: [Output Only] The unique identifier for the resource. This
  5009. // identifier is defined by the server.
  5010. Id string `json:"id,omitempty"`
  5011. // Items: [Output Only] A list of Region resources.
  5012. Items []*Region `json:"items,omitempty"`
  5013. // Kind: [Output Only] Type of resource. Always compute#regionList for
  5014. // lists of regions.
  5015. Kind string `json:"kind,omitempty"`
  5016. // NextPageToken: [Output Only] This token allows you to get the next
  5017. // page of results for list requests. If the number of results is larger
  5018. // than maxResults, use the nextPageToken as a value for the query
  5019. // parameter pageToken in the next list request. Subsequent list
  5020. // requests will have their own nextPageToken to continue paging through
  5021. // the results.
  5022. NextPageToken string `json:"nextPageToken,omitempty"`
  5023. // SelfLink: [Output Only] Server-defined URL for this resource.
  5024. SelfLink string `json:"selfLink,omitempty"`
  5025. // ServerResponse contains the HTTP response code and headers from the
  5026. // server.
  5027. googleapi.ServerResponse `json:"-"`
  5028. // ForceSendFields is a list of field names (e.g. "Id") to
  5029. // unconditionally include in API requests. By default, fields with
  5030. // empty values are omitted from API requests. However, any non-pointer,
  5031. // non-interface field appearing in ForceSendFields will be sent to the
  5032. // server regardless of whether the field is empty or not. This may be
  5033. // used to include empty fields in Patch requests.
  5034. ForceSendFields []string `json:"-"`
  5035. }
  5036. func (s *RegionList) MarshalJSON() ([]byte, error) {
  5037. type noMethod RegionList
  5038. raw := noMethod(*s)
  5039. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5040. }
  5041. type ResourceGroupReference struct {
  5042. // Group: A URI referencing one of the resource views listed in the
  5043. // backend service.
  5044. Group string `json:"group,omitempty"`
  5045. // ForceSendFields is a list of field names (e.g. "Group") to
  5046. // unconditionally include in API requests. By default, fields with
  5047. // empty values are omitted from API requests. However, any non-pointer,
  5048. // non-interface field appearing in ForceSendFields will be sent to the
  5049. // server regardless of whether the field is empty or not. This may be
  5050. // used to include empty fields in Patch requests.
  5051. ForceSendFields []string `json:"-"`
  5052. }
  5053. func (s *ResourceGroupReference) MarshalJSON() ([]byte, error) {
  5054. type noMethod ResourceGroupReference
  5055. raw := noMethod(*s)
  5056. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5057. }
  5058. // Route: The route resource. A Route is a rule that specifies how
  5059. // certain packets should be handled by the virtual network. Routes are
  5060. // associated with instances by tags and the set of Routes for a
  5061. // particular instance is called its routing table. For each packet
  5062. // leaving a instance, the system searches that instance's routing table
  5063. // for a single best matching Route. Routes match packets by destination
  5064. // IP address, preferring smaller or more specific ranges over larger
  5065. // ones. If there is a tie, the system selects the Route with the
  5066. // smallest priority value. If there is still a tie, it uses the layer
  5067. // three and four packet headers to select just one of the remaining
  5068. // matching Routes. The packet is then forwarded as specified by the
  5069. // nextHop field of the winning Route -- either to another instance
  5070. // destination, a instance gateway or a Google Compute Engien-operated
  5071. // gateway. Packets that do not match any Route in the sending
  5072. // instance's routing table are dropped.
  5073. type Route struct {
  5074. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  5075. // format.
  5076. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  5077. // Description: An optional description of this resource. Provide this
  5078. // property when you create the resource.
  5079. Description string `json:"description,omitempty"`
  5080. // DestRange: The destination range of outgoing packets that this route
  5081. // applies to.
  5082. DestRange string `json:"destRange,omitempty"`
  5083. // Id: [Output Only] The unique identifier for the resource. This
  5084. // identifier is defined by the server.
  5085. Id uint64 `json:"id,omitempty,string"`
  5086. // Kind: [Output Only] Type of this resource. Always compute#routes for
  5087. // Route resources.
  5088. Kind string `json:"kind,omitempty"`
  5089. // Name: Name of the resource; provided by the client when the resource
  5090. // is created. The name must be 1-63 characters long, and comply with
  5091. // RFC1035. Specifically, the name must be 1-63 characters long and
  5092. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  5093. // the first character must be a lowercase letter, and all following
  5094. // characters must be a dash, lowercase letter, or digit, except the
  5095. // last character, which cannot be a dash.
  5096. Name string `json:"name,omitempty"`
  5097. // Network: Fully-qualified URL of the network that this route applies
  5098. // to.
  5099. Network string `json:"network,omitempty"`
  5100. // NextHopGateway: The URL to a gateway that should handle matching
  5101. // packets. You can only specify the internet gateway using a full or
  5102. // partial valid URL:
  5103. // projects/<project-id>/global/gateways/default-internet-gateway
  5104. NextHopGateway string `json:"nextHopGateway,omitempty"`
  5105. // NextHopInstance: The URL to an instance that should handle matching
  5106. // packets. You can specify this as a full or partial URL. For
  5107. // example:
  5108. // https://www.googleapis.com/compute/v1/projects/project/zones/
  5109. // zone/instances/
  5110. NextHopInstance string `json:"nextHopInstance,omitempty"`
  5111. // NextHopIp: The network IP address of an instance that should handle
  5112. // matching packets.
  5113. NextHopIp string `json:"nextHopIp,omitempty"`
  5114. // NextHopNetwork: The URL of the local network if it should handle
  5115. // matching packets.
  5116. NextHopNetwork string `json:"nextHopNetwork,omitempty"`
  5117. // NextHopVpnTunnel: The URL to a VpnTunnel that should handle matching
  5118. // packets.
  5119. NextHopVpnTunnel string `json:"nextHopVpnTunnel,omitempty"`
  5120. // Priority: The priority of this route. Priority is used to break ties
  5121. // in cases where there is more than one matching route of equal prefix
  5122. // length. In the case of two routes with equal prefix length, the one
  5123. // with the lowest-numbered priority value wins. Default value is 1000.
  5124. // Valid range is 0 through 65535.
  5125. Priority int64 `json:"priority,omitempty"`
  5126. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  5127. // resource.
  5128. SelfLink string `json:"selfLink,omitempty"`
  5129. // Tags: A list of instance tags to which this route applies.
  5130. Tags []string `json:"tags,omitempty"`
  5131. // Warnings: [Output Only] If potential misconfigurations are detected
  5132. // for this route, this field will be populated with warning messages.
  5133. Warnings []*RouteWarnings `json:"warnings,omitempty"`
  5134. // ServerResponse contains the HTTP response code and headers from the
  5135. // server.
  5136. googleapi.ServerResponse `json:"-"`
  5137. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  5138. // to unconditionally include in API requests. By default, fields with
  5139. // empty values are omitted from API requests. However, any non-pointer,
  5140. // non-interface field appearing in ForceSendFields will be sent to the
  5141. // server regardless of whether the field is empty or not. This may be
  5142. // used to include empty fields in Patch requests.
  5143. ForceSendFields []string `json:"-"`
  5144. }
  5145. func (s *Route) MarshalJSON() ([]byte, error) {
  5146. type noMethod Route
  5147. raw := noMethod(*s)
  5148. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5149. }
  5150. type RouteWarnings struct {
  5151. // Code: [Output Only] A warning code, if applicable. For example,
  5152. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5153. // the response.
  5154. //
  5155. // Possible values:
  5156. // "DEPRECATED_RESOURCE_USED"
  5157. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5158. // "INJECTED_KERNELS_DEPRECATED"
  5159. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5160. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5161. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5162. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5163. // "NEXT_HOP_NOT_RUNNING"
  5164. // "NOT_CRITICAL_ERROR"
  5165. // "NO_RESULTS_ON_PAGE"
  5166. // "REQUIRED_TOS_AGREEMENT"
  5167. // "RESOURCE_NOT_DELETED"
  5168. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5169. // "UNREACHABLE"
  5170. Code string `json:"code,omitempty"`
  5171. // Data: [Output Only] Metadata about this warning in key: value format.
  5172. // For example:
  5173. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5174. Data []*RouteWarningsData `json:"data,omitempty"`
  5175. // Message: [Output Only] A human-readable description of the warning
  5176. // code.
  5177. Message string `json:"message,omitempty"`
  5178. // ForceSendFields is a list of field names (e.g. "Code") to
  5179. // unconditionally include in API requests. By default, fields with
  5180. // empty values are omitted from API requests. However, any non-pointer,
  5181. // non-interface field appearing in ForceSendFields will be sent to the
  5182. // server regardless of whether the field is empty or not. This may be
  5183. // used to include empty fields in Patch requests.
  5184. ForceSendFields []string `json:"-"`
  5185. }
  5186. func (s *RouteWarnings) MarshalJSON() ([]byte, error) {
  5187. type noMethod RouteWarnings
  5188. raw := noMethod(*s)
  5189. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5190. }
  5191. type RouteWarningsData struct {
  5192. // Key: [Output Only] A key that provides more detail on the warning
  5193. // being returned. For example, for warnings where there are no results
  5194. // in a list request for a particular zone, this key might be scope and
  5195. // the key value might be the zone name. Other examples might be a key
  5196. // indicating a deprecated resource, and a suggested replacement, or a
  5197. // warning about invalid network settings (for example, if an instance
  5198. // attempts to perform IP forwarding but is not enabled for IP
  5199. // forwarding).
  5200. Key string `json:"key,omitempty"`
  5201. // Value: [Output Only] A warning data value corresponding to the key.
  5202. Value string `json:"value,omitempty"`
  5203. // ForceSendFields is a list of field names (e.g. "Key") to
  5204. // unconditionally include in API requests. By default, fields with
  5205. // empty values are omitted from API requests. However, any non-pointer,
  5206. // non-interface field appearing in ForceSendFields will be sent to the
  5207. // server regardless of whether the field is empty or not. This may be
  5208. // used to include empty fields in Patch requests.
  5209. ForceSendFields []string `json:"-"`
  5210. }
  5211. func (s *RouteWarningsData) MarshalJSON() ([]byte, error) {
  5212. type noMethod RouteWarningsData
  5213. raw := noMethod(*s)
  5214. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5215. }
  5216. // RouteList: Contains a list of route resources.
  5217. type RouteList struct {
  5218. // Id: [Output Only] Unique identifier for the resource. Defined by the
  5219. // server.
  5220. Id string `json:"id,omitempty"`
  5221. // Items: [Output Only] A list of Route resources.
  5222. Items []*Route `json:"items,omitempty"`
  5223. // Kind: Type of resource.
  5224. Kind string `json:"kind,omitempty"`
  5225. // NextPageToken: [Output Only] This token allows you to get the next
  5226. // page of results for list requests. If the number of results is larger
  5227. // than maxResults, use the nextPageToken as a value for the query
  5228. // parameter pageToken in the next list request. Subsequent list
  5229. // requests will have their own nextPageToken to continue paging through
  5230. // the results.
  5231. NextPageToken string `json:"nextPageToken,omitempty"`
  5232. // SelfLink: [Output Only] Server-defined URL for this resource.
  5233. SelfLink string `json:"selfLink,omitempty"`
  5234. // ServerResponse contains the HTTP response code and headers from the
  5235. // server.
  5236. googleapi.ServerResponse `json:"-"`
  5237. // ForceSendFields is a list of field names (e.g. "Id") to
  5238. // unconditionally include in API requests. By default, fields with
  5239. // empty values are omitted from API requests. However, any non-pointer,
  5240. // non-interface field appearing in ForceSendFields will be sent to the
  5241. // server regardless of whether the field is empty or not. This may be
  5242. // used to include empty fields in Patch requests.
  5243. ForceSendFields []string `json:"-"`
  5244. }
  5245. func (s *RouteList) MarshalJSON() ([]byte, error) {
  5246. type noMethod RouteList
  5247. raw := noMethod(*s)
  5248. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5249. }
  5250. // Scheduling: Sets the scheduling options for an Instance.
  5251. type Scheduling struct {
  5252. // AutomaticRestart: Specifies whether the instance should be
  5253. // automatically restarted if it is terminated by Compute Engine (not
  5254. // terminated by a user). You can only set the automatic restart option
  5255. // for standard instances. Preemptible instances cannot be automatically
  5256. // restarted.
  5257. AutomaticRestart bool `json:"automaticRestart,omitempty"`
  5258. // OnHostMaintenance: Defines the maintenance behavior for this
  5259. // instance. For standard instances, the default behavior is MIGRATE.
  5260. // For preemptible instances, the default and only possible behavior is
  5261. // TERMINATE. For more information, see Setting maintenance behavior.
  5262. //
  5263. // Possible values:
  5264. // "MIGRATE"
  5265. // "TERMINATE"
  5266. OnHostMaintenance string `json:"onHostMaintenance,omitempty"`
  5267. // Preemptible: Whether the instance is preemptible.
  5268. Preemptible bool `json:"preemptible,omitempty"`
  5269. // ForceSendFields is a list of field names (e.g. "AutomaticRestart") to
  5270. // unconditionally include in API requests. By default, fields with
  5271. // empty values are omitted from API requests. However, any non-pointer,
  5272. // non-interface field appearing in ForceSendFields will be sent to the
  5273. // server regardless of whether the field is empty or not. This may be
  5274. // used to include empty fields in Patch requests.
  5275. ForceSendFields []string `json:"-"`
  5276. }
  5277. func (s *Scheduling) MarshalJSON() ([]byte, error) {
  5278. type noMethod Scheduling
  5279. raw := noMethod(*s)
  5280. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5281. }
  5282. // SerialPortOutput: An instance's serial console output.
  5283. type SerialPortOutput struct {
  5284. // Contents: [Output Only] The contents of the console output.
  5285. Contents string `json:"contents,omitempty"`
  5286. // Kind: [Output Only] Type of the resource. Always
  5287. // compute#serialPortOutput for serial port output.
  5288. Kind string `json:"kind,omitempty"`
  5289. // SelfLink: [Output Only] Server-defined URL for the resource.
  5290. SelfLink string `json:"selfLink,omitempty"`
  5291. // ServerResponse contains the HTTP response code and headers from the
  5292. // server.
  5293. googleapi.ServerResponse `json:"-"`
  5294. // ForceSendFields is a list of field names (e.g. "Contents") to
  5295. // unconditionally include in API requests. By default, fields with
  5296. // empty values are omitted from API requests. However, any non-pointer,
  5297. // non-interface field appearing in ForceSendFields will be sent to the
  5298. // server regardless of whether the field is empty or not. This may be
  5299. // used to include empty fields in Patch requests.
  5300. ForceSendFields []string `json:"-"`
  5301. }
  5302. func (s *SerialPortOutput) MarshalJSON() ([]byte, error) {
  5303. type noMethod SerialPortOutput
  5304. raw := noMethod(*s)
  5305. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5306. }
  5307. // ServiceAccount: A service account.
  5308. type ServiceAccount struct {
  5309. // Email: Email address of the service account.
  5310. Email string `json:"email,omitempty"`
  5311. // Scopes: The list of scopes to be made available for this service
  5312. // account.
  5313. Scopes []string `json:"scopes,omitempty"`
  5314. // ForceSendFields is a list of field names (e.g. "Email") to
  5315. // unconditionally include in API requests. By default, fields with
  5316. // empty values are omitted from API requests. However, any non-pointer,
  5317. // non-interface field appearing in ForceSendFields will be sent to the
  5318. // server regardless of whether the field is empty or not. This may be
  5319. // used to include empty fields in Patch requests.
  5320. ForceSendFields []string `json:"-"`
  5321. }
  5322. func (s *ServiceAccount) MarshalJSON() ([]byte, error) {
  5323. type noMethod ServiceAccount
  5324. raw := noMethod(*s)
  5325. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5326. }
  5327. // Snapshot: A persistent disk snapshot resource.
  5328. type Snapshot struct {
  5329. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  5330. // format.
  5331. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  5332. // Description: An optional description of this resource. Provide this
  5333. // property when you create the resource.
  5334. Description string `json:"description,omitempty"`
  5335. // DiskSizeGb: [Output Only] Size of the snapshot, specified in GB.
  5336. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  5337. // Id: [Output Only] The unique identifier for the resource. This
  5338. // identifier is defined by the server.
  5339. Id uint64 `json:"id,omitempty,string"`
  5340. // Kind: [Output Only] Type of the resource. Always compute#snapshot for
  5341. // Snapshot resources.
  5342. Kind string `json:"kind,omitempty"`
  5343. // Licenses: Public visible licenses.
  5344. Licenses []string `json:"licenses,omitempty"`
  5345. // Name: Name of the resource; provided by the client when the resource
  5346. // is created. The name must be 1-63 characters long, and comply with
  5347. // RFC1035. Specifically, the name must be 1-63 characters long and
  5348. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  5349. // the first character must be a lowercase letter, and all following
  5350. // characters must be a dash, lowercase letter, or digit, except the
  5351. // last character, which cannot be a dash.
  5352. Name string `json:"name,omitempty"`
  5353. // SelfLink: [Output Only] Server-defined URL for the resource.
  5354. SelfLink string `json:"selfLink,omitempty"`
  5355. // SourceDisk: [Output Only] The source disk used to create this
  5356. // snapshot.
  5357. SourceDisk string `json:"sourceDisk,omitempty"`
  5358. // SourceDiskId: [Output Only] The ID value of the disk used to create
  5359. // this snapshot. This value may be used to determine whether the
  5360. // snapshot was taken from the current or a previous instance of a given
  5361. // disk name.
  5362. SourceDiskId string `json:"sourceDiskId,omitempty"`
  5363. // Status: [Output Only] The status of the snapshot.
  5364. //
  5365. // Possible values:
  5366. // "CREATING"
  5367. // "DELETING"
  5368. // "FAILED"
  5369. // "READY"
  5370. // "UPLOADING"
  5371. Status string `json:"status,omitempty"`
  5372. // StorageBytes: [Output Only] A size of the the storage used by the
  5373. // snapshot. As snapshots share storage, this number is expected to
  5374. // change with snapshot creation/deletion.
  5375. StorageBytes int64 `json:"storageBytes,omitempty,string"`
  5376. // StorageBytesStatus: [Output Only] An indicator whether storageBytes
  5377. // is in a stable state or it is being adjusted as a result of shared
  5378. // storage reallocation.
  5379. //
  5380. // Possible values:
  5381. // "UPDATING"
  5382. // "UP_TO_DATE"
  5383. StorageBytesStatus string `json:"storageBytesStatus,omitempty"`
  5384. // ServerResponse contains the HTTP response code and headers from the
  5385. // server.
  5386. googleapi.ServerResponse `json:"-"`
  5387. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  5388. // to unconditionally include in API requests. By default, fields with
  5389. // empty values are omitted from API requests. However, any non-pointer,
  5390. // non-interface field appearing in ForceSendFields will be sent to the
  5391. // server regardless of whether the field is empty or not. This may be
  5392. // used to include empty fields in Patch requests.
  5393. ForceSendFields []string `json:"-"`
  5394. }
  5395. func (s *Snapshot) MarshalJSON() ([]byte, error) {
  5396. type noMethod Snapshot
  5397. raw := noMethod(*s)
  5398. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5399. }
  5400. // SnapshotList: Contains a list of Snapshot resources.
  5401. type SnapshotList struct {
  5402. // Id: [Output Only] The unique identifier for the resource. This
  5403. // identifier is defined by the server.
  5404. Id string `json:"id,omitempty"`
  5405. // Items: [Output Only] A list of Snapshot resources.
  5406. Items []*Snapshot `json:"items,omitempty"`
  5407. // Kind: Type of resource.
  5408. Kind string `json:"kind,omitempty"`
  5409. // NextPageToken: [Output Only] This token allows you to get the next
  5410. // page of results for list requests. If the number of results is larger
  5411. // than maxResults, use the nextPageToken as a value for the query
  5412. // parameter pageToken in the next list request. Subsequent list
  5413. // requests will have their own nextPageToken to continue paging through
  5414. // the results.
  5415. NextPageToken string `json:"nextPageToken,omitempty"`
  5416. // SelfLink: [Output Only] Server-defined URL for this resource.
  5417. SelfLink string `json:"selfLink,omitempty"`
  5418. // ServerResponse contains the HTTP response code and headers from the
  5419. // server.
  5420. googleapi.ServerResponse `json:"-"`
  5421. // ForceSendFields is a list of field names (e.g. "Id") to
  5422. // unconditionally include in API requests. By default, fields with
  5423. // empty values are omitted from API requests. However, any non-pointer,
  5424. // non-interface field appearing in ForceSendFields will be sent to the
  5425. // server regardless of whether the field is empty or not. This may be
  5426. // used to include empty fields in Patch requests.
  5427. ForceSendFields []string `json:"-"`
  5428. }
  5429. func (s *SnapshotList) MarshalJSON() ([]byte, error) {
  5430. type noMethod SnapshotList
  5431. raw := noMethod(*s)
  5432. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5433. }
  5434. // SslCertificate: An SslCertificate resource. This resource provides a
  5435. // mechanism to upload an SSL key and certificate to the load balancer
  5436. // to serve secure connections from the user.
  5437. type SslCertificate struct {
  5438. // Certificate: A local certificate file. The certificate must be in PEM
  5439. // format. The certificate chain must be no greater than 5 certs long.
  5440. // The chain must include at least one intermediate cert.
  5441. Certificate string `json:"certificate,omitempty"`
  5442. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  5443. // format.
  5444. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  5445. // Description: An optional description of this resource. Provide this
  5446. // property when you create the resource.
  5447. Description string `json:"description,omitempty"`
  5448. // Id: [Output Only] The unique identifier for the resource. This
  5449. // identifier is defined by the server.
  5450. Id uint64 `json:"id,omitempty,string"`
  5451. // Kind: [Output Only] Type of the resource. Always
  5452. // compute#sslCertificate for SSL certificates.
  5453. Kind string `json:"kind,omitempty"`
  5454. // Name: Name of the resource. Provided by the client when the resource
  5455. // is created. The name must be 1-63 characters long, and comply with
  5456. // RFC1035. Specifically, the name must be 1-63 characters long and
  5457. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  5458. // the first character must be a lowercase letter, and all following
  5459. // characters must be a dash, lowercase letter, or digit, except the
  5460. // last character, which cannot be a dash.
  5461. Name string `json:"name,omitempty"`
  5462. // PrivateKey: A write-only private key in PEM format. Only insert RPCs
  5463. // will include this field.
  5464. PrivateKey string `json:"privateKey,omitempty"`
  5465. // SelfLink: [Output only] Server-defined URL for the resource.
  5466. SelfLink string `json:"selfLink,omitempty"`
  5467. // ServerResponse contains the HTTP response code and headers from the
  5468. // server.
  5469. googleapi.ServerResponse `json:"-"`
  5470. // ForceSendFields is a list of field names (e.g. "Certificate") to
  5471. // unconditionally include in API requests. By default, fields with
  5472. // empty values are omitted from API requests. However, any non-pointer,
  5473. // non-interface field appearing in ForceSendFields will be sent to the
  5474. // server regardless of whether the field is empty or not. This may be
  5475. // used to include empty fields in Patch requests.
  5476. ForceSendFields []string `json:"-"`
  5477. }
  5478. func (s *SslCertificate) MarshalJSON() ([]byte, error) {
  5479. type noMethod SslCertificate
  5480. raw := noMethod(*s)
  5481. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5482. }
  5483. // SslCertificateList: Contains a list of SslCertificate resources.
  5484. type SslCertificateList struct {
  5485. // Id: [Output Only] Unique identifier for the resource. Defined by the
  5486. // server.
  5487. Id string `json:"id,omitempty"`
  5488. // Items: A list of SslCertificate resources.
  5489. Items []*SslCertificate `json:"items,omitempty"`
  5490. // Kind: Type of resource.
  5491. Kind string `json:"kind,omitempty"`
  5492. // NextPageToken: [Output Only] This token allows you to get the next
  5493. // page of results for list requests. If the number of results is larger
  5494. // than maxResults, use the nextPageToken as a value for the query
  5495. // parameter pageToken in the next list request. Subsequent list
  5496. // requests will have their own nextPageToken to continue paging through
  5497. // the results.
  5498. NextPageToken string `json:"nextPageToken,omitempty"`
  5499. // SelfLink: [Output Only] Server-defined URL for this resource.
  5500. SelfLink string `json:"selfLink,omitempty"`
  5501. // ServerResponse contains the HTTP response code and headers from the
  5502. // server.
  5503. googleapi.ServerResponse `json:"-"`
  5504. // ForceSendFields is a list of field names (e.g. "Id") to
  5505. // unconditionally include in API requests. By default, fields with
  5506. // empty values are omitted from API requests. However, any non-pointer,
  5507. // non-interface field appearing in ForceSendFields will be sent to the
  5508. // server regardless of whether the field is empty or not. This may be
  5509. // used to include empty fields in Patch requests.
  5510. ForceSendFields []string `json:"-"`
  5511. }
  5512. func (s *SslCertificateList) MarshalJSON() ([]byte, error) {
  5513. type noMethod SslCertificateList
  5514. raw := noMethod(*s)
  5515. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5516. }
  5517. // Subnetwork: A Subnetwork resource.
  5518. type Subnetwork struct {
  5519. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  5520. // format.
  5521. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  5522. // Description: An optional description of this resource. Provide this
  5523. // property when you create the resource.
  5524. Description string `json:"description,omitempty"`
  5525. // GatewayAddress: [Output Only] The gateway address for default routes
  5526. // to reach destination addresses outside this subnetwork.
  5527. GatewayAddress string `json:"gatewayAddress,omitempty"`
  5528. // Id: [Output Only] The unique identifier for the resource. This
  5529. // identifier is defined by the server.
  5530. Id uint64 `json:"id,omitempty,string"`
  5531. // IpCidrRange: The range of internal addresses that are owned by this
  5532. // subnetwork. Provide this property when you create the subnetwork. For
  5533. // example, 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and
  5534. // non-overlapping within a network.
  5535. IpCidrRange string `json:"ipCidrRange,omitempty"`
  5536. // Kind: [Output Only] Type of the resource. Always compute#subnetwork
  5537. // for Subnetwork resources.
  5538. Kind string `json:"kind,omitempty"`
  5539. // Name: The name of the resource, provided by the client when initially
  5540. // creating the resource. The name must be 1-63 characters long, and
  5541. // comply with RFC1035. Specifically, the name must be 1-63 characters
  5542. // long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])?
  5543. // which means the first character must be a lowercase letter, and all
  5544. // following characters must be a dash, lowercase letter, or digit,
  5545. // except the last character, which cannot be a dash.
  5546. Name string `json:"name,omitempty"`
  5547. // Network: The URL of the network to which this subnetwork belongs,
  5548. // provided by the client when initially creating the subnetwork. Only
  5549. // networks that are in the distributed mode can have subnetworks.
  5550. Network string `json:"network,omitempty"`
  5551. // Region: [Output Only] URL of the region where the Subnetwork resides.
  5552. Region string `json:"region,omitempty"`
  5553. // SelfLink: [Output Only] Server-defined URL for the resource.
  5554. SelfLink string `json:"selfLink,omitempty"`
  5555. // ServerResponse contains the HTTP response code and headers from the
  5556. // server.
  5557. googleapi.ServerResponse `json:"-"`
  5558. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  5559. // to unconditionally include in API requests. By default, fields with
  5560. // empty values are omitted from API requests. However, any non-pointer,
  5561. // non-interface field appearing in ForceSendFields will be sent to the
  5562. // server regardless of whether the field is empty or not. This may be
  5563. // used to include empty fields in Patch requests.
  5564. ForceSendFields []string `json:"-"`
  5565. }
  5566. func (s *Subnetwork) MarshalJSON() ([]byte, error) {
  5567. type noMethod Subnetwork
  5568. raw := noMethod(*s)
  5569. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5570. }
  5571. type SubnetworkAggregatedList struct {
  5572. // Id: [Output Only] The unique identifier for the resource. This
  5573. // identifier is defined by the server.
  5574. Id string `json:"id,omitempty"`
  5575. // Items: [Output] A map of scoped Subnetwork lists.
  5576. Items map[string]SubnetworksScopedList `json:"items,omitempty"`
  5577. // Kind: [Output Only] Type of resource. Always
  5578. // compute#subnetworkAggregatedList for aggregated lists of subnetworks.
  5579. Kind string `json:"kind,omitempty"`
  5580. // NextPageToken: [Output Only] This token allows you to get the next
  5581. // page of results for list requests. If the number of results is larger
  5582. // than maxResults, use the nextPageToken as a value for the query
  5583. // parameter pageToken in the next list request. Subsequent list
  5584. // requests will have their own nextPageToken to continue paging through
  5585. // the results.
  5586. NextPageToken string `json:"nextPageToken,omitempty"`
  5587. // SelfLink: [Output Only] Server-defined URL for this resource.
  5588. SelfLink string `json:"selfLink,omitempty"`
  5589. // ServerResponse contains the HTTP response code and headers from the
  5590. // server.
  5591. googleapi.ServerResponse `json:"-"`
  5592. // ForceSendFields is a list of field names (e.g. "Id") to
  5593. // unconditionally include in API requests. By default, fields with
  5594. // empty values are omitted from API requests. However, any non-pointer,
  5595. // non-interface field appearing in ForceSendFields will be sent to the
  5596. // server regardless of whether the field is empty or not. This may be
  5597. // used to include empty fields in Patch requests.
  5598. ForceSendFields []string `json:"-"`
  5599. }
  5600. func (s *SubnetworkAggregatedList) MarshalJSON() ([]byte, error) {
  5601. type noMethod SubnetworkAggregatedList
  5602. raw := noMethod(*s)
  5603. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5604. }
  5605. // SubnetworkList: Contains a list of Subnetwork resources.
  5606. type SubnetworkList struct {
  5607. // Id: [Output Only] The unique identifier for the resource. This
  5608. // identifier is defined by the server.
  5609. Id string `json:"id,omitempty"`
  5610. // Items: The Subnetwork resources.
  5611. Items []*Subnetwork `json:"items,omitempty"`
  5612. // Kind: [Output Only] Type of resource. Always compute#subnetworkList
  5613. // for lists of subnetworks.
  5614. Kind string `json:"kind,omitempty"`
  5615. // NextPageToken: [Output Only] This token allows you to get the next
  5616. // page of results for list requests. If the number of results is larger
  5617. // than maxResults, use the nextPageToken as a value for the query
  5618. // parameter pageToken in the next list request. Subsequent list
  5619. // requests will have their own nextPageToken to continue paging through
  5620. // the results.
  5621. NextPageToken string `json:"nextPageToken,omitempty"`
  5622. // SelfLink: [Output Only] Server-defined URL for this resource.
  5623. SelfLink string `json:"selfLink,omitempty"`
  5624. // ServerResponse contains the HTTP response code and headers from the
  5625. // server.
  5626. googleapi.ServerResponse `json:"-"`
  5627. // ForceSendFields is a list of field names (e.g. "Id") to
  5628. // unconditionally include in API requests. By default, fields with
  5629. // empty values are omitted from API requests. However, any non-pointer,
  5630. // non-interface field appearing in ForceSendFields will be sent to the
  5631. // server regardless of whether the field is empty or not. This may be
  5632. // used to include empty fields in Patch requests.
  5633. ForceSendFields []string `json:"-"`
  5634. }
  5635. func (s *SubnetworkList) MarshalJSON() ([]byte, error) {
  5636. type noMethod SubnetworkList
  5637. raw := noMethod(*s)
  5638. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5639. }
  5640. type SubnetworksScopedList struct {
  5641. // Subnetworks: List of subnetworks contained in this scope.
  5642. Subnetworks []*Subnetwork `json:"subnetworks,omitempty"`
  5643. // Warning: An informational warning that appears when the list of
  5644. // addresses is empty.
  5645. Warning *SubnetworksScopedListWarning `json:"warning,omitempty"`
  5646. // ForceSendFields is a list of field names (e.g. "Subnetworks") to
  5647. // unconditionally include in API requests. By default, fields with
  5648. // empty values are omitted from API requests. However, any non-pointer,
  5649. // non-interface field appearing in ForceSendFields will be sent to the
  5650. // server regardless of whether the field is empty or not. This may be
  5651. // used to include empty fields in Patch requests.
  5652. ForceSendFields []string `json:"-"`
  5653. }
  5654. func (s *SubnetworksScopedList) MarshalJSON() ([]byte, error) {
  5655. type noMethod SubnetworksScopedList
  5656. raw := noMethod(*s)
  5657. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5658. }
  5659. // SubnetworksScopedListWarning: An informational warning that appears
  5660. // when the list of addresses is empty.
  5661. type SubnetworksScopedListWarning struct {
  5662. // Code: [Output Only] A warning code, if applicable. For example,
  5663. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5664. // the response.
  5665. //
  5666. // Possible values:
  5667. // "DEPRECATED_RESOURCE_USED"
  5668. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5669. // "INJECTED_KERNELS_DEPRECATED"
  5670. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5671. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5672. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5673. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5674. // "NEXT_HOP_NOT_RUNNING"
  5675. // "NOT_CRITICAL_ERROR"
  5676. // "NO_RESULTS_ON_PAGE"
  5677. // "REQUIRED_TOS_AGREEMENT"
  5678. // "RESOURCE_NOT_DELETED"
  5679. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5680. // "UNREACHABLE"
  5681. Code string `json:"code,omitempty"`
  5682. // Data: [Output Only] Metadata about this warning in key: value format.
  5683. // For example:
  5684. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5685. Data []*SubnetworksScopedListWarningData `json:"data,omitempty"`
  5686. // Message: [Output Only] A human-readable description of the warning
  5687. // code.
  5688. Message string `json:"message,omitempty"`
  5689. // ForceSendFields is a list of field names (e.g. "Code") to
  5690. // unconditionally include in API requests. By default, fields with
  5691. // empty values are omitted from API requests. However, any non-pointer,
  5692. // non-interface field appearing in ForceSendFields will be sent to the
  5693. // server regardless of whether the field is empty or not. This may be
  5694. // used to include empty fields in Patch requests.
  5695. ForceSendFields []string `json:"-"`
  5696. }
  5697. func (s *SubnetworksScopedListWarning) MarshalJSON() ([]byte, error) {
  5698. type noMethod SubnetworksScopedListWarning
  5699. raw := noMethod(*s)
  5700. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5701. }
  5702. type SubnetworksScopedListWarningData struct {
  5703. // Key: [Output Only] A key that provides more detail on the warning
  5704. // being returned. For example, for warnings where there are no results
  5705. // in a list request for a particular zone, this key might be scope and
  5706. // the key value might be the zone name. Other examples might be a key
  5707. // indicating a deprecated resource, and a suggested replacement, or a
  5708. // warning about invalid network settings (for example, if an instance
  5709. // attempts to perform IP forwarding but is not enabled for IP
  5710. // forwarding).
  5711. Key string `json:"key,omitempty"`
  5712. // Value: [Output Only] A warning data value corresponding to the key.
  5713. Value string `json:"value,omitempty"`
  5714. // ForceSendFields is a list of field names (e.g. "Key") to
  5715. // unconditionally include in API requests. By default, fields with
  5716. // empty values are omitted from API requests. However, any non-pointer,
  5717. // non-interface field appearing in ForceSendFields will be sent to the
  5718. // server regardless of whether the field is empty or not. This may be
  5719. // used to include empty fields in Patch requests.
  5720. ForceSendFields []string `json:"-"`
  5721. }
  5722. func (s *SubnetworksScopedListWarningData) MarshalJSON() ([]byte, error) {
  5723. type noMethod SubnetworksScopedListWarningData
  5724. raw := noMethod(*s)
  5725. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5726. }
  5727. // Tags: A set of instance tags.
  5728. type Tags struct {
  5729. // Fingerprint: Specifies a fingerprint for this request, which is
  5730. // essentially a hash of the metadata's contents and used for optimistic
  5731. // locking. The fingerprint is initially generated by Compute Engine and
  5732. // changes after every request to modify or update metadata. You must
  5733. // always provide an up-to-date fingerprint hash in order to update or
  5734. // change metadata.
  5735. //
  5736. // To see the latest fingerprint, make get() request to the instance.
  5737. Fingerprint string `json:"fingerprint,omitempty"`
  5738. // Items: An array of tags. Each tag must be 1-63 characters long, and
  5739. // comply with RFC1035.
  5740. Items []string `json:"items,omitempty"`
  5741. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  5742. // unconditionally include in API requests. By default, fields with
  5743. // empty values are omitted from API requests. However, any non-pointer,
  5744. // non-interface field appearing in ForceSendFields will be sent to the
  5745. // server regardless of whether the field is empty or not. This may be
  5746. // used to include empty fields in Patch requests.
  5747. ForceSendFields []string `json:"-"`
  5748. }
  5749. func (s *Tags) MarshalJSON() ([]byte, error) {
  5750. type noMethod Tags
  5751. raw := noMethod(*s)
  5752. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5753. }
  5754. // TargetHttpProxy: A TargetHttpProxy resource. This resource defines an
  5755. // HTTP proxy.
  5756. type TargetHttpProxy struct {
  5757. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  5758. // format.
  5759. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  5760. // Description: An optional description of this resource. Provide this
  5761. // property when you create the resource.
  5762. Description string `json:"description,omitempty"`
  5763. // Id: [Output Only] The unique identifier for the resource. This
  5764. // identifier is defined by the server.
  5765. Id uint64 `json:"id,omitempty,string"`
  5766. // Kind: [Output Only] Type of resource. Always compute#targetHttpProxy
  5767. // for target HTTP proxies.
  5768. Kind string `json:"kind,omitempty"`
  5769. // Name: Name of the resource; provided by the client when the resource
  5770. // is created. The name must be 1-63 characters long, and comply with
  5771. // RFC1035. Specifically, the name must be 1-63 characters long and
  5772. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  5773. // the first character must be a lowercase letter, and all following
  5774. // characters must be a dash, lowercase letter, or digit, except the
  5775. // last character, which cannot be a dash.
  5776. Name string `json:"name,omitempty"`
  5777. // SelfLink: [Output Only] Server-defined URL for the resource.
  5778. SelfLink string `json:"selfLink,omitempty"`
  5779. // UrlMap: URL to the UrlMap resource that defines the mapping from URL
  5780. // to the BackendService.
  5781. UrlMap string `json:"urlMap,omitempty"`
  5782. // ServerResponse contains the HTTP response code and headers from the
  5783. // server.
  5784. googleapi.ServerResponse `json:"-"`
  5785. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  5786. // to unconditionally include in API requests. By default, fields with
  5787. // empty values are omitted from API requests. However, any non-pointer,
  5788. // non-interface field appearing in ForceSendFields will be sent to the
  5789. // server regardless of whether the field is empty or not. This may be
  5790. // used to include empty fields in Patch requests.
  5791. ForceSendFields []string `json:"-"`
  5792. }
  5793. func (s *TargetHttpProxy) MarshalJSON() ([]byte, error) {
  5794. type noMethod TargetHttpProxy
  5795. raw := noMethod(*s)
  5796. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5797. }
  5798. // TargetHttpProxyList: A list of TargetHttpProxy resources.
  5799. type TargetHttpProxyList struct {
  5800. // Id: [Output Only] The unique identifier for the resource. This
  5801. // identifier is defined by the server.
  5802. Id string `json:"id,omitempty"`
  5803. // Items: A list of TargetHttpProxy resources.
  5804. Items []*TargetHttpProxy `json:"items,omitempty"`
  5805. // Kind: Type of resource. Always compute#targetHttpProxyList for lists
  5806. // of Target HTTP proxies.
  5807. Kind string `json:"kind,omitempty"`
  5808. // NextPageToken: [Output Only] This token allows you to get the next
  5809. // page of results for list requests. If the number of results is larger
  5810. // than maxResults, use the nextPageToken as a value for the query
  5811. // parameter pageToken in the next list request. Subsequent list
  5812. // requests will have their own nextPageToken to continue paging through
  5813. // the results.
  5814. NextPageToken string `json:"nextPageToken,omitempty"`
  5815. // SelfLink: [Output Only] Server-defined URL for this resource.
  5816. SelfLink string `json:"selfLink,omitempty"`
  5817. // ServerResponse contains the HTTP response code and headers from the
  5818. // server.
  5819. googleapi.ServerResponse `json:"-"`
  5820. // ForceSendFields is a list of field names (e.g. "Id") to
  5821. // unconditionally include in API requests. By default, fields with
  5822. // empty values are omitted from API requests. However, any non-pointer,
  5823. // non-interface field appearing in ForceSendFields will be sent to the
  5824. // server regardless of whether the field is empty or not. This may be
  5825. // used to include empty fields in Patch requests.
  5826. ForceSendFields []string `json:"-"`
  5827. }
  5828. func (s *TargetHttpProxyList) MarshalJSON() ([]byte, error) {
  5829. type noMethod TargetHttpProxyList
  5830. raw := noMethod(*s)
  5831. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5832. }
  5833. type TargetHttpsProxiesSetSslCertificatesRequest struct {
  5834. // SslCertificates: New set of URLs to SslCertificate resources to
  5835. // associate with this TargetHttpProxy. Currently exactly one ssl
  5836. // certificate must be specified.
  5837. SslCertificates []string `json:"sslCertificates,omitempty"`
  5838. // ForceSendFields is a list of field names (e.g. "SslCertificates") to
  5839. // unconditionally include in API requests. By default, fields with
  5840. // empty values are omitted from API requests. However, any non-pointer,
  5841. // non-interface field appearing in ForceSendFields will be sent to the
  5842. // server regardless of whether the field is empty or not. This may be
  5843. // used to include empty fields in Patch requests.
  5844. ForceSendFields []string `json:"-"`
  5845. }
  5846. func (s *TargetHttpsProxiesSetSslCertificatesRequest) MarshalJSON() ([]byte, error) {
  5847. type noMethod TargetHttpsProxiesSetSslCertificatesRequest
  5848. raw := noMethod(*s)
  5849. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5850. }
  5851. // TargetHttpsProxy: A TargetHttpsProxy resource. This resource defines
  5852. // an HTTPS proxy.
  5853. type TargetHttpsProxy struct {
  5854. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  5855. // format.
  5856. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  5857. // Description: An optional description of this resource. Provide this
  5858. // property when you create the resource.
  5859. Description string `json:"description,omitempty"`
  5860. // Id: [Output Only] The unique identifier for the resource. This
  5861. // identifier is defined by the server.
  5862. Id uint64 `json:"id,omitempty,string"`
  5863. // Kind: [Output Only] Type of the resource. Always
  5864. // compute#targetHttpsProxy for target HTTPS proxies.
  5865. Kind string `json:"kind,omitempty"`
  5866. // Name: Name of the resource. Provided by the client when the resource
  5867. // is created. The name must be 1-63 characters long, and comply with
  5868. // RFC1035. Specifically, the name must be 1-63 characters long and
  5869. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  5870. // the first character must be a lowercase letter, and all following
  5871. // characters must be a dash, lowercase letter, or digit, except the
  5872. // last character, which cannot be a dash.
  5873. Name string `json:"name,omitempty"`
  5874. // SelfLink: [Output Only] Server-defined URL for the resource.
  5875. SelfLink string `json:"selfLink,omitempty"`
  5876. // SslCertificates: URLs to SslCertificate resources that are used to
  5877. // authenticate connections between users and the load balancer.
  5878. // Currently exactly one SSL certificate must be specified.
  5879. SslCertificates []string `json:"sslCertificates,omitempty"`
  5880. // UrlMap: URL to the UrlMap resource that defines the mapping from URL
  5881. // to the BackendService.
  5882. UrlMap string `json:"urlMap,omitempty"`
  5883. // ServerResponse contains the HTTP response code and headers from the
  5884. // server.
  5885. googleapi.ServerResponse `json:"-"`
  5886. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  5887. // to unconditionally include in API requests. By default, fields with
  5888. // empty values are omitted from API requests. However, any non-pointer,
  5889. // non-interface field appearing in ForceSendFields will be sent to the
  5890. // server regardless of whether the field is empty or not. This may be
  5891. // used to include empty fields in Patch requests.
  5892. ForceSendFields []string `json:"-"`
  5893. }
  5894. func (s *TargetHttpsProxy) MarshalJSON() ([]byte, error) {
  5895. type noMethod TargetHttpsProxy
  5896. raw := noMethod(*s)
  5897. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5898. }
  5899. // TargetHttpsProxyList: Contains a list of TargetHttpsProxy resources.
  5900. type TargetHttpsProxyList struct {
  5901. // Id: [Output Only] The unique identifier for the resource. This
  5902. // identifier is defined by the server.
  5903. Id string `json:"id,omitempty"`
  5904. // Items: A list of TargetHttpsProxy resources.
  5905. Items []*TargetHttpsProxy `json:"items,omitempty"`
  5906. // Kind: Type of resource.
  5907. Kind string `json:"kind,omitempty"`
  5908. // NextPageToken: [Output Only] This token allows you to get the next
  5909. // page of results for list requests. If the number of results is larger
  5910. // than maxResults, use the nextPageToken as a value for the query
  5911. // parameter pageToken in the next list request. Subsequent list
  5912. // requests will have their own nextPageToken to continue paging through
  5913. // the results.
  5914. NextPageToken string `json:"nextPageToken,omitempty"`
  5915. // SelfLink: [Output Only] Server-defined URL for this resource.
  5916. SelfLink string `json:"selfLink,omitempty"`
  5917. // ServerResponse contains the HTTP response code and headers from the
  5918. // server.
  5919. googleapi.ServerResponse `json:"-"`
  5920. // ForceSendFields is a list of field names (e.g. "Id") to
  5921. // unconditionally include in API requests. By default, fields with
  5922. // empty values are omitted from API requests. However, any non-pointer,
  5923. // non-interface field appearing in ForceSendFields will be sent to the
  5924. // server regardless of whether the field is empty or not. This may be
  5925. // used to include empty fields in Patch requests.
  5926. ForceSendFields []string `json:"-"`
  5927. }
  5928. func (s *TargetHttpsProxyList) MarshalJSON() ([]byte, error) {
  5929. type noMethod TargetHttpsProxyList
  5930. raw := noMethod(*s)
  5931. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5932. }
  5933. // TargetInstance: A TargetInstance resource. This resource defines an
  5934. // endpoint instance that terminates traffic of certain protocols.
  5935. type TargetInstance struct {
  5936. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  5937. // format.
  5938. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  5939. // Description: An optional description of this resource. Provide this
  5940. // property when you create the resource.
  5941. Description string `json:"description,omitempty"`
  5942. // Id: [Output Only] The unique identifier for the resource. This
  5943. // identifier is defined by the server.
  5944. Id uint64 `json:"id,omitempty,string"`
  5945. // Instance: The URL to the instance that terminates the relevant
  5946. // traffic.
  5947. Instance string `json:"instance,omitempty"`
  5948. // Kind: [Output Only] The type of the resource. Always
  5949. // compute#targetInstance for target instances.
  5950. Kind string `json:"kind,omitempty"`
  5951. // Name: Name of the resource. Provided by the client when the resource
  5952. // is created. The name must be 1-63 characters long, and comply with
  5953. // RFC1035. Specifically, the name must be 1-63 characters long and
  5954. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  5955. // the first character must be a lowercase letter, and all following
  5956. // characters must be a dash, lowercase letter, or digit, except the
  5957. // last character, which cannot be a dash.
  5958. Name string `json:"name,omitempty"`
  5959. // NatPolicy: NAT option controlling how IPs are NAT'ed to the instance.
  5960. // Currently only NO_NAT (default value) is supported.
  5961. //
  5962. // Possible values:
  5963. // "NO_NAT"
  5964. NatPolicy string `json:"natPolicy,omitempty"`
  5965. // SelfLink: [Output Only] Server-defined URL for the resource.
  5966. SelfLink string `json:"selfLink,omitempty"`
  5967. // Zone: [Output Only] URL of the zone where the target instance
  5968. // resides.
  5969. Zone string `json:"zone,omitempty"`
  5970. // ServerResponse contains the HTTP response code and headers from the
  5971. // server.
  5972. googleapi.ServerResponse `json:"-"`
  5973. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  5974. // to unconditionally include in API requests. By default, fields with
  5975. // empty values are omitted from API requests. However, any non-pointer,
  5976. // non-interface field appearing in ForceSendFields will be sent to the
  5977. // server regardless of whether the field is empty or not. This may be
  5978. // used to include empty fields in Patch requests.
  5979. ForceSendFields []string `json:"-"`
  5980. }
  5981. func (s *TargetInstance) MarshalJSON() ([]byte, error) {
  5982. type noMethod TargetInstance
  5983. raw := noMethod(*s)
  5984. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5985. }
  5986. type TargetInstanceAggregatedList struct {
  5987. // Id: [Output Only] Unique identifier for the resource; defined by the
  5988. // server.
  5989. Id string `json:"id,omitempty"`
  5990. // Items: A map of scoped target instance lists.
  5991. Items map[string]TargetInstancesScopedList `json:"items,omitempty"`
  5992. // Kind: Type of resource.
  5993. Kind string `json:"kind,omitempty"`
  5994. // NextPageToken: [Output Only] This token allows you to get the next
  5995. // page of results for list requests. If the number of results is larger
  5996. // than maxResults, use the nextPageToken as a value for the query
  5997. // parameter pageToken in the next list request. Subsequent list
  5998. // requests will have their own nextPageToken to continue paging through
  5999. // the results.
  6000. NextPageToken string `json:"nextPageToken,omitempty"`
  6001. // SelfLink: [Output Only] Server-defined URL for this resource.
  6002. SelfLink string `json:"selfLink,omitempty"`
  6003. // ServerResponse contains the HTTP response code and headers from the
  6004. // server.
  6005. googleapi.ServerResponse `json:"-"`
  6006. // ForceSendFields is a list of field names (e.g. "Id") to
  6007. // unconditionally include in API requests. By default, fields with
  6008. // empty values are omitted from API requests. However, any non-pointer,
  6009. // non-interface field appearing in ForceSendFields will be sent to the
  6010. // server regardless of whether the field is empty or not. This may be
  6011. // used to include empty fields in Patch requests.
  6012. ForceSendFields []string `json:"-"`
  6013. }
  6014. func (s *TargetInstanceAggregatedList) MarshalJSON() ([]byte, error) {
  6015. type noMethod TargetInstanceAggregatedList
  6016. raw := noMethod(*s)
  6017. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6018. }
  6019. // TargetInstanceList: Contains a list of TargetInstance resources.
  6020. type TargetInstanceList struct {
  6021. // Id: [Output Only] The unique identifier for the resource. This
  6022. // identifier is defined by the server.
  6023. Id string `json:"id,omitempty"`
  6024. // Items: A list of TargetInstance resources.
  6025. Items []*TargetInstance `json:"items,omitempty"`
  6026. // Kind: Type of resource.
  6027. Kind string `json:"kind,omitempty"`
  6028. // NextPageToken: [Output Only] This token allows you to get the next
  6029. // page of results for list requests. If the number of results is larger
  6030. // than maxResults, use the nextPageToken as a value for the query
  6031. // parameter pageToken in the next list request. Subsequent list
  6032. // requests will have their own nextPageToken to continue paging through
  6033. // the results.
  6034. NextPageToken string `json:"nextPageToken,omitempty"`
  6035. // SelfLink: [Output Only] Server-defined URL for this resource.
  6036. SelfLink string `json:"selfLink,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. "Id") to
  6041. // 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 *TargetInstanceList) MarshalJSON() ([]byte, error) {
  6049. type noMethod TargetInstanceList
  6050. raw := noMethod(*s)
  6051. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6052. }
  6053. type TargetInstancesScopedList struct {
  6054. // TargetInstances: List of target instances contained in this scope.
  6055. TargetInstances []*TargetInstance `json:"targetInstances,omitempty"`
  6056. // Warning: Informational warning which replaces the list of addresses
  6057. // when the list is empty.
  6058. Warning *TargetInstancesScopedListWarning `json:"warning,omitempty"`
  6059. // ForceSendFields is a list of field names (e.g. "TargetInstances") to
  6060. // unconditionally include in API requests. By default, fields with
  6061. // empty values are omitted from API requests. However, any non-pointer,
  6062. // non-interface field appearing in ForceSendFields will be sent to the
  6063. // server regardless of whether the field is empty or not. This may be
  6064. // used to include empty fields in Patch requests.
  6065. ForceSendFields []string `json:"-"`
  6066. }
  6067. func (s *TargetInstancesScopedList) MarshalJSON() ([]byte, error) {
  6068. type noMethod TargetInstancesScopedList
  6069. raw := noMethod(*s)
  6070. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6071. }
  6072. // TargetInstancesScopedListWarning: Informational warning which
  6073. // replaces the list of addresses when the list is empty.
  6074. type TargetInstancesScopedListWarning struct {
  6075. // Code: [Output Only] A warning code, if applicable. For example,
  6076. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6077. // the response.
  6078. //
  6079. // Possible values:
  6080. // "DEPRECATED_RESOURCE_USED"
  6081. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6082. // "INJECTED_KERNELS_DEPRECATED"
  6083. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6084. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6085. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6086. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6087. // "NEXT_HOP_NOT_RUNNING"
  6088. // "NOT_CRITICAL_ERROR"
  6089. // "NO_RESULTS_ON_PAGE"
  6090. // "REQUIRED_TOS_AGREEMENT"
  6091. // "RESOURCE_NOT_DELETED"
  6092. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6093. // "UNREACHABLE"
  6094. Code string `json:"code,omitempty"`
  6095. // Data: [Output Only] Metadata about this warning in key: value format.
  6096. // For example:
  6097. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6098. Data []*TargetInstancesScopedListWarningData `json:"data,omitempty"`
  6099. // Message: [Output Only] A human-readable description of the warning
  6100. // code.
  6101. Message string `json:"message,omitempty"`
  6102. // ForceSendFields is a list of field names (e.g. "Code") to
  6103. // unconditionally include in API requests. By default, fields with
  6104. // empty values are omitted from API requests. However, any non-pointer,
  6105. // non-interface field appearing in ForceSendFields will be sent to the
  6106. // server regardless of whether the field is empty or not. This may be
  6107. // used to include empty fields in Patch requests.
  6108. ForceSendFields []string `json:"-"`
  6109. }
  6110. func (s *TargetInstancesScopedListWarning) MarshalJSON() ([]byte, error) {
  6111. type noMethod TargetInstancesScopedListWarning
  6112. raw := noMethod(*s)
  6113. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6114. }
  6115. type TargetInstancesScopedListWarningData struct {
  6116. // Key: [Output Only] A key that provides more detail on the warning
  6117. // being returned. For example, for warnings where there are no results
  6118. // in a list request for a particular zone, this key might be scope and
  6119. // the key value might be the zone name. Other examples might be a key
  6120. // indicating a deprecated resource, and a suggested replacement, or a
  6121. // warning about invalid network settings (for example, if an instance
  6122. // attempts to perform IP forwarding but is not enabled for IP
  6123. // forwarding).
  6124. Key string `json:"key,omitempty"`
  6125. // Value: [Output Only] A warning data value corresponding to the key.
  6126. Value string `json:"value,omitempty"`
  6127. // ForceSendFields is a list of field names (e.g. "Key") to
  6128. // 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 *TargetInstancesScopedListWarningData) MarshalJSON() ([]byte, error) {
  6136. type noMethod TargetInstancesScopedListWarningData
  6137. raw := noMethod(*s)
  6138. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6139. }
  6140. // TargetPool: A TargetPool resource. This resource defines a pool of
  6141. // instances, associated HttpHealthCheck resources, and the fallback
  6142. // TargetPool.
  6143. type TargetPool struct {
  6144. // BackupPool: This field is applicable only when the containing target
  6145. // pool is serving a forwarding rule as the primary pool, and its
  6146. // failoverRatio field is properly set to a value between [0,
  6147. // 1].
  6148. //
  6149. // backupPool and failoverRatio together define the fallback behavior of
  6150. // the primary target pool: if the ratio of the healthy instances in the
  6151. // primary pool is at or below failoverRatio, traffic arriving at the
  6152. // load-balanced IP will be directed to the backup pool.
  6153. //
  6154. // In case where failoverRatio and backupPool are not set, or all the
  6155. // instances in the backup pool are unhealthy, the traffic will be
  6156. // directed back to the primary pool in the "force" mode, where traffic
  6157. // will be spread to the healthy instances with the best effort, or to
  6158. // all instances when no instance is healthy.
  6159. BackupPool string `json:"backupPool,omitempty"`
  6160. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  6161. // format.
  6162. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  6163. // Description: An optional description of this resource. Provide this
  6164. // property when you create the resource.
  6165. Description string `json:"description,omitempty"`
  6166. // FailoverRatio: This field is applicable only when the containing
  6167. // target pool is serving a forwarding rule as the primary pool (i.e.,
  6168. // not as a backup pool to some other target pool). The value of the
  6169. // field must be in [0, 1].
  6170. //
  6171. // If set, backupPool must also be set. They together define the
  6172. // fallback behavior of the primary target pool: if the ratio of the
  6173. // healthy instances in the primary pool is at or below this number,
  6174. // traffic arriving at the load-balanced IP will be directed to the
  6175. // backup pool.
  6176. //
  6177. // In case where failoverRatio is not set or all the instances in the
  6178. // backup pool are unhealthy, the traffic will be directed back to the
  6179. // primary pool in the "force" mode, where traffic will be spread to the
  6180. // healthy instances with the best effort, or to all instances when no
  6181. // instance is healthy.
  6182. FailoverRatio float64 `json:"failoverRatio,omitempty"`
  6183. // HealthChecks: A list of URLs to the HttpHealthCheck resource. A
  6184. // member instance in this pool is considered healthy if and only if all
  6185. // specified health checks pass. An empty list means all member
  6186. // instances will be considered healthy at all times.
  6187. HealthChecks []string `json:"healthChecks,omitempty"`
  6188. // Id: [Output Only] The unique identifier for the resource. This
  6189. // identifier is defined by the server.
  6190. Id uint64 `json:"id,omitempty,string"`
  6191. // Instances: A list of resource URLs to the member virtual machines
  6192. // serving this pool. They must live in zones contained in the same
  6193. // region as this pool.
  6194. Instances []string `json:"instances,omitempty"`
  6195. // Kind: [Output Only] Type of the resource. Always compute#targetPool
  6196. // for target pools.
  6197. Kind string `json:"kind,omitempty"`
  6198. // Name: Name of the resource. Provided by the client when the resource
  6199. // is created. The name must be 1-63 characters long, and comply with
  6200. // RFC1035. Specifically, the name must be 1-63 characters long and
  6201. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  6202. // the first character must be a lowercase letter, and all following
  6203. // characters must be a dash, lowercase letter, or digit, except the
  6204. // last character, which cannot be a dash.
  6205. Name string `json:"name,omitempty"`
  6206. // Region: [Output Only] URL of the region where the target pool
  6207. // resides.
  6208. Region string `json:"region,omitempty"`
  6209. // SelfLink: [Output Only] Server-defined URL for the resource.
  6210. SelfLink string `json:"selfLink,omitempty"`
  6211. // SessionAffinity: Sesssion affinity option, must be one of the
  6212. // following values:
  6213. // NONE: Connections from the same client IP may go to any instance in
  6214. // the pool.
  6215. // CLIENT_IP: Connections from the same client IP will go to the same
  6216. // instance in the pool while that instance remains
  6217. // healthy.
  6218. // CLIENT_IP_PROTO: Connections from the same client IP with the same IP
  6219. // protocol will go to the same instance in the pool while that instance
  6220. // remains healthy.
  6221. //
  6222. // Possible values:
  6223. // "CLIENT_IP"
  6224. // "CLIENT_IP_PROTO"
  6225. // "NONE"
  6226. SessionAffinity string `json:"sessionAffinity,omitempty"`
  6227. // ServerResponse contains the HTTP response code and headers from the
  6228. // server.
  6229. googleapi.ServerResponse `json:"-"`
  6230. // ForceSendFields is a list of field names (e.g. "BackupPool") to
  6231. // unconditionally include in API requests. By default, fields with
  6232. // empty values are omitted from API requests. However, any non-pointer,
  6233. // non-interface field appearing in ForceSendFields will be sent to the
  6234. // server regardless of whether the field is empty or not. This may be
  6235. // used to include empty fields in Patch requests.
  6236. ForceSendFields []string `json:"-"`
  6237. }
  6238. func (s *TargetPool) MarshalJSON() ([]byte, error) {
  6239. type noMethod TargetPool
  6240. raw := noMethod(*s)
  6241. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6242. }
  6243. type TargetPoolAggregatedList struct {
  6244. // Id: [Output Only] Unique identifier for the resource. Defined by the
  6245. // server.
  6246. Id string `json:"id,omitempty"`
  6247. // Items: A map of scoped target pool lists.
  6248. Items map[string]TargetPoolsScopedList `json:"items,omitempty"`
  6249. // Kind: Type of resource.
  6250. Kind string `json:"kind,omitempty"`
  6251. // NextPageToken: [Output Only] This token allows you to get the next
  6252. // page of results for list requests. If the number of results is larger
  6253. // than maxResults, use the nextPageToken as a value for the query
  6254. // parameter pageToken in the next list request. Subsequent list
  6255. // requests will have their own nextPageToken to continue paging through
  6256. // the results.
  6257. NextPageToken string `json:"nextPageToken,omitempty"`
  6258. // SelfLink: [Output Only] Server-defined URL for this resource.
  6259. SelfLink string `json:"selfLink,omitempty"`
  6260. // ServerResponse contains the HTTP response code and headers from the
  6261. // server.
  6262. googleapi.ServerResponse `json:"-"`
  6263. // ForceSendFields is a list of field names (e.g. "Id") to
  6264. // unconditionally include in API requests. By default, fields with
  6265. // empty values are omitted from API requests. However, any non-pointer,
  6266. // non-interface field appearing in ForceSendFields will be sent to the
  6267. // server regardless of whether the field is empty or not. This may be
  6268. // used to include empty fields in Patch requests.
  6269. ForceSendFields []string `json:"-"`
  6270. }
  6271. func (s *TargetPoolAggregatedList) MarshalJSON() ([]byte, error) {
  6272. type noMethod TargetPoolAggregatedList
  6273. raw := noMethod(*s)
  6274. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6275. }
  6276. type TargetPoolInstanceHealth struct {
  6277. HealthStatus []*HealthStatus `json:"healthStatus,omitempty"`
  6278. // Kind: Type of resource.
  6279. Kind string `json:"kind,omitempty"`
  6280. // ServerResponse contains the HTTP response code and headers from the
  6281. // server.
  6282. googleapi.ServerResponse `json:"-"`
  6283. // ForceSendFields is a list of field names (e.g. "HealthStatus") to
  6284. // unconditionally include in API requests. By default, fields with
  6285. // empty values are omitted from API requests. However, any non-pointer,
  6286. // non-interface field appearing in ForceSendFields will be sent to the
  6287. // server regardless of whether the field is empty or not. This may be
  6288. // used to include empty fields in Patch requests.
  6289. ForceSendFields []string `json:"-"`
  6290. }
  6291. func (s *TargetPoolInstanceHealth) MarshalJSON() ([]byte, error) {
  6292. type noMethod TargetPoolInstanceHealth
  6293. raw := noMethod(*s)
  6294. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6295. }
  6296. // TargetPoolList: Contains a list of TargetPool resources.
  6297. type TargetPoolList struct {
  6298. // Id: [Output Only] Unique identifier for the resource. Defined by the
  6299. // server.
  6300. Id string `json:"id,omitempty"`
  6301. // Items: A list of TargetPool resources.
  6302. Items []*TargetPool `json:"items,omitempty"`
  6303. // Kind: Type of resource.
  6304. Kind string `json:"kind,omitempty"`
  6305. // NextPageToken: [Output Only] This token allows you to get the next
  6306. // page of results for list requests. If the number of results is larger
  6307. // than maxResults, use the nextPageToken as a value for the query
  6308. // parameter pageToken in the next list request. Subsequent list
  6309. // requests will have their own nextPageToken to continue paging through
  6310. // the results.
  6311. NextPageToken string `json:"nextPageToken,omitempty"`
  6312. // SelfLink: [Output Only] Server-defined URL for this resource.
  6313. SelfLink string `json:"selfLink,omitempty"`
  6314. // ServerResponse contains the HTTP response code and headers from the
  6315. // server.
  6316. googleapi.ServerResponse `json:"-"`
  6317. // ForceSendFields is a list of field names (e.g. "Id") to
  6318. // unconditionally include in API requests. By default, fields with
  6319. // empty values are omitted from API requests. However, any non-pointer,
  6320. // non-interface field appearing in ForceSendFields will be sent to the
  6321. // server regardless of whether the field is empty or not. This may be
  6322. // used to include empty fields in Patch requests.
  6323. ForceSendFields []string `json:"-"`
  6324. }
  6325. func (s *TargetPoolList) MarshalJSON() ([]byte, error) {
  6326. type noMethod TargetPoolList
  6327. raw := noMethod(*s)
  6328. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6329. }
  6330. type TargetPoolsAddHealthCheckRequest struct {
  6331. // HealthChecks: Health check URLs to be added to targetPool.
  6332. HealthChecks []*HealthCheckReference `json:"healthChecks,omitempty"`
  6333. // ForceSendFields is a list of field names (e.g. "HealthChecks") to
  6334. // unconditionally include in API requests. By default, fields with
  6335. // empty values are omitted from API requests. However, any non-pointer,
  6336. // non-interface field appearing in ForceSendFields will be sent to the
  6337. // server regardless of whether the field is empty or not. This may be
  6338. // used to include empty fields in Patch requests.
  6339. ForceSendFields []string `json:"-"`
  6340. }
  6341. func (s *TargetPoolsAddHealthCheckRequest) MarshalJSON() ([]byte, error) {
  6342. type noMethod TargetPoolsAddHealthCheckRequest
  6343. raw := noMethod(*s)
  6344. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6345. }
  6346. type TargetPoolsAddInstanceRequest struct {
  6347. // Instances: URLs of the instances to be added to targetPool.
  6348. Instances []*InstanceReference `json:"instances,omitempty"`
  6349. // ForceSendFields is a list of field names (e.g. "Instances") to
  6350. // unconditionally include in API requests. By default, fields with
  6351. // empty values are omitted from API requests. However, any non-pointer,
  6352. // non-interface field appearing in ForceSendFields will be sent to the
  6353. // server regardless of whether the field is empty or not. This may be
  6354. // used to include empty fields in Patch requests.
  6355. ForceSendFields []string `json:"-"`
  6356. }
  6357. func (s *TargetPoolsAddInstanceRequest) MarshalJSON() ([]byte, error) {
  6358. type noMethod TargetPoolsAddInstanceRequest
  6359. raw := noMethod(*s)
  6360. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6361. }
  6362. type TargetPoolsRemoveHealthCheckRequest struct {
  6363. // HealthChecks: Health check URLs to be removed from targetPool.
  6364. HealthChecks []*HealthCheckReference `json:"healthChecks,omitempty"`
  6365. // ForceSendFields is a list of field names (e.g. "HealthChecks") to
  6366. // unconditionally include in API requests. By default, fields with
  6367. // empty values are omitted from API requests. However, any non-pointer,
  6368. // non-interface field appearing in ForceSendFields will be sent to the
  6369. // server regardless of whether the field is empty or not. This may be
  6370. // used to include empty fields in Patch requests.
  6371. ForceSendFields []string `json:"-"`
  6372. }
  6373. func (s *TargetPoolsRemoveHealthCheckRequest) MarshalJSON() ([]byte, error) {
  6374. type noMethod TargetPoolsRemoveHealthCheckRequest
  6375. raw := noMethod(*s)
  6376. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6377. }
  6378. type TargetPoolsRemoveInstanceRequest struct {
  6379. // Instances: URLs of the instances to be removed from targetPool.
  6380. Instances []*InstanceReference `json:"instances,omitempty"`
  6381. // ForceSendFields is a list of field names (e.g. "Instances") to
  6382. // unconditionally include in API requests. By default, fields with
  6383. // empty values are omitted from API requests. However, any non-pointer,
  6384. // non-interface field appearing in ForceSendFields will be sent to the
  6385. // server regardless of whether the field is empty or not. This may be
  6386. // used to include empty fields in Patch requests.
  6387. ForceSendFields []string `json:"-"`
  6388. }
  6389. func (s *TargetPoolsRemoveInstanceRequest) MarshalJSON() ([]byte, error) {
  6390. type noMethod TargetPoolsRemoveInstanceRequest
  6391. raw := noMethod(*s)
  6392. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6393. }
  6394. type TargetPoolsScopedList struct {
  6395. // TargetPools: List of target pools contained in this scope.
  6396. TargetPools []*TargetPool `json:"targetPools,omitempty"`
  6397. // Warning: Informational warning which replaces the list of addresses
  6398. // when the list is empty.
  6399. Warning *TargetPoolsScopedListWarning `json:"warning,omitempty"`
  6400. // ForceSendFields is a list of field names (e.g. "TargetPools") to
  6401. // unconditionally include in API requests. By default, fields with
  6402. // empty values are omitted from API requests. However, any non-pointer,
  6403. // non-interface field appearing in ForceSendFields will be sent to the
  6404. // server regardless of whether the field is empty or not. This may be
  6405. // used to include empty fields in Patch requests.
  6406. ForceSendFields []string `json:"-"`
  6407. }
  6408. func (s *TargetPoolsScopedList) MarshalJSON() ([]byte, error) {
  6409. type noMethod TargetPoolsScopedList
  6410. raw := noMethod(*s)
  6411. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6412. }
  6413. // TargetPoolsScopedListWarning: Informational warning which replaces
  6414. // the list of addresses when the list is empty.
  6415. type TargetPoolsScopedListWarning struct {
  6416. // Code: [Output Only] A warning code, if applicable. For example,
  6417. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6418. // the response.
  6419. //
  6420. // Possible values:
  6421. // "DEPRECATED_RESOURCE_USED"
  6422. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6423. // "INJECTED_KERNELS_DEPRECATED"
  6424. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6425. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6426. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6427. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6428. // "NEXT_HOP_NOT_RUNNING"
  6429. // "NOT_CRITICAL_ERROR"
  6430. // "NO_RESULTS_ON_PAGE"
  6431. // "REQUIRED_TOS_AGREEMENT"
  6432. // "RESOURCE_NOT_DELETED"
  6433. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6434. // "UNREACHABLE"
  6435. Code string `json:"code,omitempty"`
  6436. // Data: [Output Only] Metadata about this warning in key: value format.
  6437. // For example:
  6438. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6439. Data []*TargetPoolsScopedListWarningData `json:"data,omitempty"`
  6440. // Message: [Output Only] A human-readable description of the warning
  6441. // code.
  6442. Message string `json:"message,omitempty"`
  6443. // ForceSendFields is a list of field names (e.g. "Code") to
  6444. // unconditionally include in API requests. By default, fields with
  6445. // empty values are omitted from API requests. However, any non-pointer,
  6446. // non-interface field appearing in ForceSendFields will be sent to the
  6447. // server regardless of whether the field is empty or not. This may be
  6448. // used to include empty fields in Patch requests.
  6449. ForceSendFields []string `json:"-"`
  6450. }
  6451. func (s *TargetPoolsScopedListWarning) MarshalJSON() ([]byte, error) {
  6452. type noMethod TargetPoolsScopedListWarning
  6453. raw := noMethod(*s)
  6454. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6455. }
  6456. type TargetPoolsScopedListWarningData struct {
  6457. // Key: [Output Only] A key that provides more detail on the warning
  6458. // being returned. For example, for warnings where there are no results
  6459. // in a list request for a particular zone, this key might be scope and
  6460. // the key value might be the zone name. Other examples might be a key
  6461. // indicating a deprecated resource, and a suggested replacement, or a
  6462. // warning about invalid network settings (for example, if an instance
  6463. // attempts to perform IP forwarding but is not enabled for IP
  6464. // forwarding).
  6465. Key string `json:"key,omitempty"`
  6466. // Value: [Output Only] A warning data value corresponding to the key.
  6467. Value string `json:"value,omitempty"`
  6468. // ForceSendFields is a list of field names (e.g. "Key") to
  6469. // unconditionally include in API requests. By default, fields with
  6470. // empty values are omitted from API requests. However, any non-pointer,
  6471. // non-interface field appearing in ForceSendFields will be sent to the
  6472. // server regardless of whether the field is empty or not. This may be
  6473. // used to include empty fields in Patch requests.
  6474. ForceSendFields []string `json:"-"`
  6475. }
  6476. func (s *TargetPoolsScopedListWarningData) MarshalJSON() ([]byte, error) {
  6477. type noMethod TargetPoolsScopedListWarningData
  6478. raw := noMethod(*s)
  6479. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6480. }
  6481. type TargetReference struct {
  6482. Target string `json:"target,omitempty"`
  6483. // ForceSendFields is a list of field names (e.g. "Target") to
  6484. // unconditionally include in API requests. By default, fields with
  6485. // empty values are omitted from API requests. However, any non-pointer,
  6486. // non-interface field appearing in ForceSendFields will be sent to the
  6487. // server regardless of whether the field is empty or not. This may be
  6488. // used to include empty fields in Patch requests.
  6489. ForceSendFields []string `json:"-"`
  6490. }
  6491. func (s *TargetReference) MarshalJSON() ([]byte, error) {
  6492. type noMethod TargetReference
  6493. raw := noMethod(*s)
  6494. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6495. }
  6496. type TargetVpnGateway struct {
  6497. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  6498. // format.
  6499. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  6500. // Description: An optional description of this resource. Provide this
  6501. // property when you create the resource.
  6502. Description string `json:"description,omitempty"`
  6503. // ForwardingRules: [Output Only] A list of URLs to the ForwardingRule
  6504. // resources. ForwardingRules are created using
  6505. // compute.forwardingRules.insert and associated to a VPN gateway.
  6506. ForwardingRules []string `json:"forwardingRules,omitempty"`
  6507. // Id: [Output Only] The unique identifier for the resource. This
  6508. // identifier is defined by the server.
  6509. Id uint64 `json:"id,omitempty,string"`
  6510. // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway
  6511. // for target VPN gateways.
  6512. Kind string `json:"kind,omitempty"`
  6513. // Name: Name of the resource; provided by the client when the resource
  6514. // is created. The name must be 1-63 characters long, and comply with
  6515. // RFC1035. Specifically, the name must be 1-63 characters long and
  6516. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  6517. // the first character must be a lowercase letter, and all following
  6518. // characters must be a dash, lowercase letter, or digit, except the
  6519. // last character, which cannot be a dash.
  6520. Name string `json:"name,omitempty"`
  6521. // Network: URL of the network to which this VPN gateway is attached.
  6522. // Provided by the client when the VPN gateway is created.
  6523. Network string `json:"network,omitempty"`
  6524. // Region: [Output Only] URL of the region where the target VPN gateway
  6525. // resides.
  6526. Region string `json:"region,omitempty"`
  6527. // SelfLink: [Output Only] Server-defined URL for the resource.
  6528. SelfLink string `json:"selfLink,omitempty"`
  6529. // Status: [Output Only] The status of the VPN gateway.
  6530. //
  6531. // Possible values:
  6532. // "CREATING"
  6533. // "DELETING"
  6534. // "FAILED"
  6535. // "READY"
  6536. Status string `json:"status,omitempty"`
  6537. // Tunnels: [Output Only] A list of URLs to VpnTunnel resources.
  6538. // VpnTunnels are created using compute.vpntunnels.insert and associated
  6539. // to a VPN gateway.
  6540. Tunnels []string `json:"tunnels,omitempty"`
  6541. // ServerResponse contains the HTTP response code and headers from the
  6542. // server.
  6543. googleapi.ServerResponse `json:"-"`
  6544. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  6545. // to unconditionally include in API requests. By default, fields with
  6546. // empty values are omitted from API requests. However, any non-pointer,
  6547. // non-interface field appearing in ForceSendFields will be sent to the
  6548. // server regardless of whether the field is empty or not. This may be
  6549. // used to include empty fields in Patch requests.
  6550. ForceSendFields []string `json:"-"`
  6551. }
  6552. func (s *TargetVpnGateway) MarshalJSON() ([]byte, error) {
  6553. type noMethod TargetVpnGateway
  6554. raw := noMethod(*s)
  6555. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6556. }
  6557. type TargetVpnGatewayAggregatedList struct {
  6558. // Id: [Output Only] The unique identifier for the resource. This
  6559. // identifier is defined by the server.
  6560. Id string `json:"id,omitempty"`
  6561. // Items: A map of scoped target vpn gateway lists.
  6562. Items map[string]TargetVpnGatewaysScopedList `json:"items,omitempty"`
  6563. // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway
  6564. // for target VPN gateways.
  6565. Kind string `json:"kind,omitempty"`
  6566. // NextPageToken: [Output Only] This token allows you to get the next
  6567. // page of results for list requests. If the number of results is larger
  6568. // than maxResults, use the nextPageToken as a value for the query
  6569. // parameter pageToken in the next list request. Subsequent list
  6570. // requests will have their own nextPageToken to continue paging through
  6571. // the results.
  6572. NextPageToken string `json:"nextPageToken,omitempty"`
  6573. // SelfLink: [Output Only] Server-defined URL for the resource.
  6574. SelfLink string `json:"selfLink,omitempty"`
  6575. // ServerResponse contains the HTTP response code and headers from the
  6576. // server.
  6577. googleapi.ServerResponse `json:"-"`
  6578. // ForceSendFields is a list of field names (e.g. "Id") to
  6579. // unconditionally include in API requests. By default, fields with
  6580. // empty values are omitted from API requests. However, any non-pointer,
  6581. // non-interface field appearing in ForceSendFields will be sent to the
  6582. // server regardless of whether the field is empty or not. This may be
  6583. // used to include empty fields in Patch requests.
  6584. ForceSendFields []string `json:"-"`
  6585. }
  6586. func (s *TargetVpnGatewayAggregatedList) MarshalJSON() ([]byte, error) {
  6587. type noMethod TargetVpnGatewayAggregatedList
  6588. raw := noMethod(*s)
  6589. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6590. }
  6591. // TargetVpnGatewayList: Contains a list of TargetVpnGateway resources.
  6592. type TargetVpnGatewayList struct {
  6593. // Id: [Output Only] The unique identifier for the resource. This
  6594. // identifier is defined by the server.
  6595. Id string `json:"id,omitempty"`
  6596. // Items: [Output Only] A list of TargetVpnGateway resources.
  6597. Items []*TargetVpnGateway `json:"items,omitempty"`
  6598. // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway
  6599. // for target VPN gateways.
  6600. Kind string `json:"kind,omitempty"`
  6601. // NextPageToken: [Output Only] This token allows you to get the next
  6602. // page of results for list requests. If the number of results is larger
  6603. // than maxResults, use the nextPageToken as a value for the query
  6604. // parameter pageToken in the next list request. Subsequent list
  6605. // requests will have their own nextPageToken to continue paging through
  6606. // the results.
  6607. NextPageToken string `json:"nextPageToken,omitempty"`
  6608. // SelfLink: [Output Only] Server-defined URL for the resource.
  6609. SelfLink string `json:"selfLink,omitempty"`
  6610. // ServerResponse contains the HTTP response code and headers from the
  6611. // server.
  6612. googleapi.ServerResponse `json:"-"`
  6613. // ForceSendFields is a list of field names (e.g. "Id") to
  6614. // unconditionally include in API requests. By default, fields with
  6615. // empty values are omitted from API requests. However, any non-pointer,
  6616. // non-interface field appearing in ForceSendFields will be sent to the
  6617. // server regardless of whether the field is empty or not. This may be
  6618. // used to include empty fields in Patch requests.
  6619. ForceSendFields []string `json:"-"`
  6620. }
  6621. func (s *TargetVpnGatewayList) MarshalJSON() ([]byte, error) {
  6622. type noMethod TargetVpnGatewayList
  6623. raw := noMethod(*s)
  6624. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6625. }
  6626. type TargetVpnGatewaysScopedList struct {
  6627. // TargetVpnGateways: [Output Only] List of target vpn gateways
  6628. // contained in this scope.
  6629. TargetVpnGateways []*TargetVpnGateway `json:"targetVpnGateways,omitempty"`
  6630. // Warning: [Output Only] Informational warning which replaces the list
  6631. // of addresses when the list is empty.
  6632. Warning *TargetVpnGatewaysScopedListWarning `json:"warning,omitempty"`
  6633. // ForceSendFields is a list of field names (e.g. "TargetVpnGateways")
  6634. // to unconditionally include in API requests. By default, fields with
  6635. // empty values are omitted from API requests. However, any non-pointer,
  6636. // non-interface field appearing in ForceSendFields will be sent to the
  6637. // server regardless of whether the field is empty or not. This may be
  6638. // used to include empty fields in Patch requests.
  6639. ForceSendFields []string `json:"-"`
  6640. }
  6641. func (s *TargetVpnGatewaysScopedList) MarshalJSON() ([]byte, error) {
  6642. type noMethod TargetVpnGatewaysScopedList
  6643. raw := noMethod(*s)
  6644. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6645. }
  6646. // TargetVpnGatewaysScopedListWarning: [Output Only] Informational
  6647. // warning which replaces the list of addresses when the list is empty.
  6648. type TargetVpnGatewaysScopedListWarning struct {
  6649. // Code: [Output Only] A warning code, if applicable. For example,
  6650. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6651. // the response.
  6652. //
  6653. // Possible values:
  6654. // "DEPRECATED_RESOURCE_USED"
  6655. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6656. // "INJECTED_KERNELS_DEPRECATED"
  6657. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6658. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6659. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6660. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6661. // "NEXT_HOP_NOT_RUNNING"
  6662. // "NOT_CRITICAL_ERROR"
  6663. // "NO_RESULTS_ON_PAGE"
  6664. // "REQUIRED_TOS_AGREEMENT"
  6665. // "RESOURCE_NOT_DELETED"
  6666. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6667. // "UNREACHABLE"
  6668. Code string `json:"code,omitempty"`
  6669. // Data: [Output Only] Metadata about this warning in key: value format.
  6670. // For example:
  6671. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6672. Data []*TargetVpnGatewaysScopedListWarningData `json:"data,omitempty"`
  6673. // Message: [Output Only] A human-readable description of the warning
  6674. // code.
  6675. Message string `json:"message,omitempty"`
  6676. // ForceSendFields is a list of field names (e.g. "Code") to
  6677. // unconditionally include in API requests. By default, fields with
  6678. // empty values are omitted from API requests. However, any non-pointer,
  6679. // non-interface field appearing in ForceSendFields will be sent to the
  6680. // server regardless of whether the field is empty or not. This may be
  6681. // used to include empty fields in Patch requests.
  6682. ForceSendFields []string `json:"-"`
  6683. }
  6684. func (s *TargetVpnGatewaysScopedListWarning) MarshalJSON() ([]byte, error) {
  6685. type noMethod TargetVpnGatewaysScopedListWarning
  6686. raw := noMethod(*s)
  6687. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6688. }
  6689. type TargetVpnGatewaysScopedListWarningData struct {
  6690. // Key: [Output Only] A key that provides more detail on the warning
  6691. // being returned. For example, for warnings where there are no results
  6692. // in a list request for a particular zone, this key might be scope and
  6693. // the key value might be the zone name. Other examples might be a key
  6694. // indicating a deprecated resource, and a suggested replacement, or a
  6695. // warning about invalid network settings (for example, if an instance
  6696. // attempts to perform IP forwarding but is not enabled for IP
  6697. // forwarding).
  6698. Key string `json:"key,omitempty"`
  6699. // Value: [Output Only] A warning data value corresponding to the key.
  6700. Value string `json:"value,omitempty"`
  6701. // ForceSendFields is a list of field names (e.g. "Key") to
  6702. // unconditionally include in API requests. By default, fields with
  6703. // empty values are omitted from API requests. However, any non-pointer,
  6704. // non-interface field appearing in ForceSendFields will be sent to the
  6705. // server regardless of whether the field is empty or not. This may be
  6706. // used to include empty fields in Patch requests.
  6707. ForceSendFields []string `json:"-"`
  6708. }
  6709. func (s *TargetVpnGatewaysScopedListWarningData) MarshalJSON() ([]byte, error) {
  6710. type noMethod TargetVpnGatewaysScopedListWarningData
  6711. raw := noMethod(*s)
  6712. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6713. }
  6714. type TestFailure struct {
  6715. ActualService string `json:"actualService,omitempty"`
  6716. ExpectedService string `json:"expectedService,omitempty"`
  6717. Host string `json:"host,omitempty"`
  6718. Path string `json:"path,omitempty"`
  6719. // ForceSendFields is a list of field names (e.g. "ActualService") to
  6720. // unconditionally include in API requests. By default, fields with
  6721. // empty values are omitted from API requests. However, any non-pointer,
  6722. // non-interface field appearing in ForceSendFields will be sent to the
  6723. // server regardless of whether the field is empty or not. This may be
  6724. // used to include empty fields in Patch requests.
  6725. ForceSendFields []string `json:"-"`
  6726. }
  6727. func (s *TestFailure) MarshalJSON() ([]byte, error) {
  6728. type noMethod TestFailure
  6729. raw := noMethod(*s)
  6730. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6731. }
  6732. // UrlMap: A UrlMap resource. This resource defines the mapping from URL
  6733. // to the BackendService resource, based on the "longest-match" of the
  6734. // URL's host and path.
  6735. type UrlMap struct {
  6736. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  6737. // format.
  6738. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  6739. // DefaultService: The URL of the BackendService resource if none of the
  6740. // hostRules match.
  6741. DefaultService string `json:"defaultService,omitempty"`
  6742. // Description: An optional description of this resource. Provide this
  6743. // property when you create the resource.
  6744. Description string `json:"description,omitempty"`
  6745. // Fingerprint: Fingerprint of this resource. A hash of the contents
  6746. // stored in this object. This field is used in optimistic locking. This
  6747. // field will be ignored when inserting a UrlMap. An up-to-date
  6748. // fingerprint must be provided in order to update the UrlMap.
  6749. Fingerprint string `json:"fingerprint,omitempty"`
  6750. // HostRules: The list of HostRules to use against the URL.
  6751. HostRules []*HostRule `json:"hostRules,omitempty"`
  6752. // Id: [Output Only] The unique identifier for the resource. This
  6753. // identifier is defined by the server.
  6754. Id uint64 `json:"id,omitempty,string"`
  6755. // Kind: [Output Only] Type of the resource. Always compute#urlMaps for
  6756. // url maps.
  6757. Kind string `json:"kind,omitempty"`
  6758. // Name: Name of the resource. Provided by the client when the resource
  6759. // is created. The name must be 1-63 characters long, and comply with
  6760. // RFC1035. Specifically, the name must be 1-63 characters long and
  6761. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  6762. // the first character must be a lowercase letter, and all following
  6763. // characters must be a dash, lowercase letter, or digit, except the
  6764. // last character, which cannot be a dash.
  6765. Name string `json:"name,omitempty"`
  6766. // PathMatchers: The list of named PathMatchers to use against the URL.
  6767. PathMatchers []*PathMatcher `json:"pathMatchers,omitempty"`
  6768. // SelfLink: [Output Only] Server-defined URL for the resource.
  6769. SelfLink string `json:"selfLink,omitempty"`
  6770. // Tests: The list of expected URL mappings. Request to update this
  6771. // UrlMap will succeed only all of the test cases pass.
  6772. Tests []*UrlMapTest `json:"tests,omitempty"`
  6773. // ServerResponse contains the HTTP response code and headers from the
  6774. // server.
  6775. googleapi.ServerResponse `json:"-"`
  6776. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  6777. // to unconditionally include in API requests. By default, fields with
  6778. // empty values are omitted from API requests. However, any non-pointer,
  6779. // non-interface field appearing in ForceSendFields will be sent to the
  6780. // server regardless of whether the field is empty or not. This may be
  6781. // used to include empty fields in Patch requests.
  6782. ForceSendFields []string `json:"-"`
  6783. }
  6784. func (s *UrlMap) MarshalJSON() ([]byte, error) {
  6785. type noMethod UrlMap
  6786. raw := noMethod(*s)
  6787. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6788. }
  6789. // UrlMapList: Contains a list of UrlMap resources.
  6790. type UrlMapList struct {
  6791. // Id: [Output Only] Unique identifier for the resource. Set by the
  6792. // server.
  6793. Id string `json:"id,omitempty"`
  6794. // Items: A list of UrlMap resources.
  6795. Items []*UrlMap `json:"items,omitempty"`
  6796. // Kind: Type of resource.
  6797. Kind string `json:"kind,omitempty"`
  6798. // NextPageToken: [Output Only] This token allows you to get the next
  6799. // page of results for list requests. If the number of results is larger
  6800. // than maxResults, use the nextPageToken as a value for the query
  6801. // parameter pageToken in the next list request. Subsequent list
  6802. // requests will have their own nextPageToken to continue paging through
  6803. // the results.
  6804. NextPageToken string `json:"nextPageToken,omitempty"`
  6805. // SelfLink: [Output Only] Server-defined URL for this resource.
  6806. SelfLink string `json:"selfLink,omitempty"`
  6807. // ServerResponse contains the HTTP response code and headers from the
  6808. // server.
  6809. googleapi.ServerResponse `json:"-"`
  6810. // ForceSendFields is a list of field names (e.g. "Id") to
  6811. // unconditionally include in API requests. By default, fields with
  6812. // empty values are omitted from API requests. However, any non-pointer,
  6813. // non-interface field appearing in ForceSendFields will be sent to the
  6814. // server regardless of whether the field is empty or not. This may be
  6815. // used to include empty fields in Patch requests.
  6816. ForceSendFields []string `json:"-"`
  6817. }
  6818. func (s *UrlMapList) MarshalJSON() ([]byte, error) {
  6819. type noMethod UrlMapList
  6820. raw := noMethod(*s)
  6821. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6822. }
  6823. type UrlMapReference struct {
  6824. UrlMap string `json:"urlMap,omitempty"`
  6825. // ForceSendFields is a list of field names (e.g. "UrlMap") to
  6826. // unconditionally include in API requests. By default, fields with
  6827. // empty values are omitted from API requests. However, any non-pointer,
  6828. // non-interface field appearing in ForceSendFields will be sent to the
  6829. // server regardless of whether the field is empty or not. This may be
  6830. // used to include empty fields in Patch requests.
  6831. ForceSendFields []string `json:"-"`
  6832. }
  6833. func (s *UrlMapReference) MarshalJSON() ([]byte, error) {
  6834. type noMethod UrlMapReference
  6835. raw := noMethod(*s)
  6836. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6837. }
  6838. // UrlMapTest: Message for the expected URL mappings.
  6839. type UrlMapTest struct {
  6840. // Description: Description of this test case.
  6841. Description string `json:"description,omitempty"`
  6842. // Host: Host portion of the URL.
  6843. Host string `json:"host,omitempty"`
  6844. // Path: Path portion of the URL.
  6845. Path string `json:"path,omitempty"`
  6846. // Service: Expected BackendService resource the given URL should be
  6847. // mapped to.
  6848. Service string `json:"service,omitempty"`
  6849. // ForceSendFields is a list of field names (e.g. "Description") to
  6850. // unconditionally include in API requests. By default, fields with
  6851. // empty values are omitted from API requests. However, any non-pointer,
  6852. // non-interface field appearing in ForceSendFields will be sent to the
  6853. // server regardless of whether the field is empty or not. This may be
  6854. // used to include empty fields in Patch requests.
  6855. ForceSendFields []string `json:"-"`
  6856. }
  6857. func (s *UrlMapTest) MarshalJSON() ([]byte, error) {
  6858. type noMethod UrlMapTest
  6859. raw := noMethod(*s)
  6860. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6861. }
  6862. // UrlMapValidationResult: Message representing the validation result
  6863. // for a UrlMap.
  6864. type UrlMapValidationResult struct {
  6865. LoadErrors []string `json:"loadErrors,omitempty"`
  6866. // LoadSucceeded: Whether the given UrlMap can be successfully loaded.
  6867. // If false, 'loadErrors' indicates the reasons.
  6868. LoadSucceeded bool `json:"loadSucceeded,omitempty"`
  6869. TestFailures []*TestFailure `json:"testFailures,omitempty"`
  6870. // TestPassed: If successfully loaded, this field indicates whether the
  6871. // test passed. If false, 'testFailures's indicate the reason of
  6872. // failure.
  6873. TestPassed bool `json:"testPassed,omitempty"`
  6874. // ForceSendFields is a list of field names (e.g. "LoadErrors") to
  6875. // unconditionally include in API requests. By default, fields with
  6876. // empty values are omitted from API requests. However, any non-pointer,
  6877. // non-interface field appearing in ForceSendFields will be sent to the
  6878. // server regardless of whether the field is empty or not. This may be
  6879. // used to include empty fields in Patch requests.
  6880. ForceSendFields []string `json:"-"`
  6881. }
  6882. func (s *UrlMapValidationResult) MarshalJSON() ([]byte, error) {
  6883. type noMethod UrlMapValidationResult
  6884. raw := noMethod(*s)
  6885. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6886. }
  6887. type UrlMapsValidateRequest struct {
  6888. // Resource: Content of the UrlMap to be validated.
  6889. Resource *UrlMap `json:"resource,omitempty"`
  6890. // ForceSendFields is a list of field names (e.g. "Resource") to
  6891. // unconditionally include in API requests. By default, fields with
  6892. // empty values are omitted from API requests. However, any non-pointer,
  6893. // non-interface field appearing in ForceSendFields will be sent to the
  6894. // server regardless of whether the field is empty or not. This may be
  6895. // used to include empty fields in Patch requests.
  6896. ForceSendFields []string `json:"-"`
  6897. }
  6898. func (s *UrlMapsValidateRequest) MarshalJSON() ([]byte, error) {
  6899. type noMethod UrlMapsValidateRequest
  6900. raw := noMethod(*s)
  6901. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6902. }
  6903. type UrlMapsValidateResponse struct {
  6904. Result *UrlMapValidationResult `json:"result,omitempty"`
  6905. // ServerResponse contains the HTTP response code and headers from the
  6906. // server.
  6907. googleapi.ServerResponse `json:"-"`
  6908. // ForceSendFields is a list of field names (e.g. "Result") to
  6909. // unconditionally include in API requests. By default, fields with
  6910. // empty values are omitted from API requests. However, any non-pointer,
  6911. // non-interface field appearing in ForceSendFields will be sent to the
  6912. // server regardless of whether the field is empty or not. This may be
  6913. // used to include empty fields in Patch requests.
  6914. ForceSendFields []string `json:"-"`
  6915. }
  6916. func (s *UrlMapsValidateResponse) MarshalJSON() ([]byte, error) {
  6917. type noMethod UrlMapsValidateResponse
  6918. raw := noMethod(*s)
  6919. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6920. }
  6921. // UsageExportLocation: The location in Cloud Storage and naming method
  6922. // of the daily usage report. Contains bucket_name and report_name
  6923. // prefix.
  6924. type UsageExportLocation struct {
  6925. // BucketName: The name of an existing bucket in Cloud Storage where the
  6926. // usage report object is stored. The Google Service Account is granted
  6927. // write access to this bucket. This can either be the bucket name by
  6928. // itself, such as example-bucket, or the bucket name with gs:// or
  6929. // https://storage.googleapis.com/ in front of it, such as
  6930. // gs://example-bucket.
  6931. BucketName string `json:"bucketName,omitempty"`
  6932. // ReportNamePrefix: An optional prefix for the name of the usage report
  6933. // object stored in bucketName. If not supplied, defaults to usage. The
  6934. // report is stored as a CSV file named
  6935. // report_name_prefix_gce_YYYYMMDD.csv where YYYYMMDD is the day of the
  6936. // usage according to Pacific Time. If you supply a prefix, it should
  6937. // conform to Cloud Storage object naming conventions.
  6938. ReportNamePrefix string `json:"reportNamePrefix,omitempty"`
  6939. // ForceSendFields is a list of field names (e.g. "BucketName") to
  6940. // unconditionally include in API requests. By default, fields with
  6941. // empty values are omitted from API requests. However, any non-pointer,
  6942. // non-interface field appearing in ForceSendFields will be sent to the
  6943. // server regardless of whether the field is empty or not. This may be
  6944. // used to include empty fields in Patch requests.
  6945. ForceSendFields []string `json:"-"`
  6946. }
  6947. func (s *UsageExportLocation) MarshalJSON() ([]byte, error) {
  6948. type noMethod UsageExportLocation
  6949. raw := noMethod(*s)
  6950. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6951. }
  6952. type VpnTunnel struct {
  6953. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  6954. // format.
  6955. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  6956. // Description: An optional description of this resource. Provide this
  6957. // property when you create the resource.
  6958. Description string `json:"description,omitempty"`
  6959. // DetailedStatus: [Output Only] Detailed status message for the VPN
  6960. // tunnel.
  6961. DetailedStatus string `json:"detailedStatus,omitempty"`
  6962. // Id: [Output Only] The unique identifier for the resource. This
  6963. // identifier is defined by the server.
  6964. Id uint64 `json:"id,omitempty,string"`
  6965. // IkeVersion: IKE protocol version to use when establishing the VPN
  6966. // tunnel with peer VPN gateway. Acceptable IKE versions are 1 or 2.
  6967. // Default version is 2.
  6968. IkeVersion int64 `json:"ikeVersion,omitempty"`
  6969. // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for
  6970. // VPN tunnels.
  6971. Kind string `json:"kind,omitempty"`
  6972. // LocalTrafficSelector: Local traffic selector to use when establishing
  6973. // the VPN tunnel with peer VPN gateway. The value should be a CIDR
  6974. // formatted string, for example: 192.168.0.0/16. The ranges should be
  6975. // disjoint.
  6976. LocalTrafficSelector []string `json:"localTrafficSelector,omitempty"`
  6977. // Name: Name of the resource; provided by the client when the resource
  6978. // is created. The name must be 1-63 characters long, and comply with
  6979. // RFC1035. Specifically, the name must be 1-63 characters long and
  6980. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  6981. // the first character must be a lowercase letter, and all following
  6982. // characters must be a dash, lowercase letter, or digit, except the
  6983. // last character, which cannot be a dash.
  6984. Name string `json:"name,omitempty"`
  6985. // PeerIp: IP address of the peer VPN gateway.
  6986. PeerIp string `json:"peerIp,omitempty"`
  6987. // Region: [Output Only] URL of the region where the VPN tunnel resides.
  6988. Region string `json:"region,omitempty"`
  6989. // SelfLink: [Output Only] Server-defined URL for the resource.
  6990. SelfLink string `json:"selfLink,omitempty"`
  6991. // SharedSecret: Shared secret used to set the secure session between
  6992. // the Cloud VPN gateway and the peer VPN gateway.
  6993. SharedSecret string `json:"sharedSecret,omitempty"`
  6994. // SharedSecretHash: Hash of the shared secret.
  6995. SharedSecretHash string `json:"sharedSecretHash,omitempty"`
  6996. // Status: [Output Only] The status of the VPN tunnel.
  6997. //
  6998. // Possible values:
  6999. // "AUTHORIZATION_ERROR"
  7000. // "DEPROVISIONING"
  7001. // "ESTABLISHED"
  7002. // "FAILED"
  7003. // "FIRST_HANDSHAKE"
  7004. // "NEGOTIATION_FAILURE"
  7005. // "NETWORK_ERROR"
  7006. // "NO_INCOMING_PACKETS"
  7007. // "PROVISIONING"
  7008. // "REJECTED"
  7009. // "WAITING_FOR_FULL_CONFIG"
  7010. Status string `json:"status,omitempty"`
  7011. // TargetVpnGateway: URL of the VPN gateway to which this VPN tunnel is
  7012. // associated. Provided by the client when the VPN tunnel is created.
  7013. TargetVpnGateway string `json:"targetVpnGateway,omitempty"`
  7014. // ServerResponse contains the HTTP response code and headers from the
  7015. // server.
  7016. googleapi.ServerResponse `json:"-"`
  7017. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  7018. // to unconditionally include in API requests. By default, fields with
  7019. // empty values are omitted from API requests. However, any non-pointer,
  7020. // non-interface field appearing in ForceSendFields will be sent to the
  7021. // server regardless of whether the field is empty or not. This may be
  7022. // used to include empty fields in Patch requests.
  7023. ForceSendFields []string `json:"-"`
  7024. }
  7025. func (s *VpnTunnel) MarshalJSON() ([]byte, error) {
  7026. type noMethod VpnTunnel
  7027. raw := noMethod(*s)
  7028. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  7029. }
  7030. type VpnTunnelAggregatedList struct {
  7031. // Id: [Output Only] The unique identifier for the resource. This
  7032. // identifier is defined by the server.
  7033. Id string `json:"id,omitempty"`
  7034. // Items: [Output Only] A map of scoped vpn tunnel lists.
  7035. Items map[string]VpnTunnelsScopedList `json:"items,omitempty"`
  7036. // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for
  7037. // VPN tunnels.
  7038. Kind string `json:"kind,omitempty"`
  7039. // NextPageToken: [Output Only] This token allows you to get the next
  7040. // page of results for list requests. If the number of results is larger
  7041. // than maxResults, use the nextPageToken as a value for the query
  7042. // parameter pageToken in the next list request. Subsequent list
  7043. // requests will have their own nextPageToken to continue paging through
  7044. // the results.
  7045. NextPageToken string `json:"nextPageToken,omitempty"`
  7046. // SelfLink: [Output Only] Server-defined URL for this resource.
  7047. SelfLink string `json:"selfLink,omitempty"`
  7048. // ServerResponse contains the HTTP response code and headers from the
  7049. // server.
  7050. googleapi.ServerResponse `json:"-"`
  7051. // ForceSendFields is a list of field names (e.g. "Id") to
  7052. // unconditionally include in API requests. By default, fields with
  7053. // empty values are omitted from API requests. However, any non-pointer,
  7054. // non-interface field appearing in ForceSendFields will be sent to the
  7055. // server regardless of whether the field is empty or not. This may be
  7056. // used to include empty fields in Patch requests.
  7057. ForceSendFields []string `json:"-"`
  7058. }
  7059. func (s *VpnTunnelAggregatedList) MarshalJSON() ([]byte, error) {
  7060. type noMethod VpnTunnelAggregatedList
  7061. raw := noMethod(*s)
  7062. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  7063. }
  7064. // VpnTunnelList: Contains a list of VpnTunnel resources.
  7065. type VpnTunnelList struct {
  7066. // Id: [Output Only] The unique identifier for the resource. This
  7067. // identifier is defined by the server.
  7068. Id string `json:"id,omitempty"`
  7069. // Items: [Output Only] A list of VpnTunnel resources.
  7070. Items []*VpnTunnel `json:"items,omitempty"`
  7071. // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for
  7072. // VPN tunnels.
  7073. Kind string `json:"kind,omitempty"`
  7074. // NextPageToken: [Output Only] This token allows you to get the next
  7075. // page of results for list requests. If the number of results is larger
  7076. // than maxResults, use the nextPageToken as a value for the query
  7077. // parameter pageToken in the next list request. Subsequent list
  7078. // requests will have their own nextPageToken to continue paging through
  7079. // the results.
  7080. NextPageToken string `json:"nextPageToken,omitempty"`
  7081. // SelfLink: [Output Only] Server-defined URL for the resource.
  7082. SelfLink string `json:"selfLink,omitempty"`
  7083. // ServerResponse contains the HTTP response code and headers from the
  7084. // server.
  7085. googleapi.ServerResponse `json:"-"`
  7086. // ForceSendFields is a list of field names (e.g. "Id") to
  7087. // unconditionally include in API requests. By default, fields with
  7088. // empty values are omitted from API requests. However, any non-pointer,
  7089. // non-interface field appearing in ForceSendFields will be sent to the
  7090. // server regardless of whether the field is empty or not. This may be
  7091. // used to include empty fields in Patch requests.
  7092. ForceSendFields []string `json:"-"`
  7093. }
  7094. func (s *VpnTunnelList) MarshalJSON() ([]byte, error) {
  7095. type noMethod VpnTunnelList
  7096. raw := noMethod(*s)
  7097. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  7098. }
  7099. type VpnTunnelsScopedList struct {
  7100. // VpnTunnels: List of vpn tunnels contained in this scope.
  7101. VpnTunnels []*VpnTunnel `json:"vpnTunnels,omitempty"`
  7102. // Warning: Informational warning which replaces the list of addresses
  7103. // when the list is empty.
  7104. Warning *VpnTunnelsScopedListWarning `json:"warning,omitempty"`
  7105. // ForceSendFields is a list of field names (e.g. "VpnTunnels") to
  7106. // unconditionally include in API requests. By default, fields with
  7107. // empty values are omitted from API requests. However, any non-pointer,
  7108. // non-interface field appearing in ForceSendFields will be sent to the
  7109. // server regardless of whether the field is empty or not. This may be
  7110. // used to include empty fields in Patch requests.
  7111. ForceSendFields []string `json:"-"`
  7112. }
  7113. func (s *VpnTunnelsScopedList) MarshalJSON() ([]byte, error) {
  7114. type noMethod VpnTunnelsScopedList
  7115. raw := noMethod(*s)
  7116. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  7117. }
  7118. // VpnTunnelsScopedListWarning: Informational warning which replaces the
  7119. // list of addresses when the list is empty.
  7120. type VpnTunnelsScopedListWarning struct {
  7121. // Code: [Output Only] A warning code, if applicable. For example,
  7122. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  7123. // the response.
  7124. //
  7125. // Possible values:
  7126. // "DEPRECATED_RESOURCE_USED"
  7127. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  7128. // "INJECTED_KERNELS_DEPRECATED"
  7129. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  7130. // "NEXT_HOP_CANNOT_IP_FORWARD"
  7131. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  7132. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  7133. // "NEXT_HOP_NOT_RUNNING"
  7134. // "NOT_CRITICAL_ERROR"
  7135. // "NO_RESULTS_ON_PAGE"
  7136. // "REQUIRED_TOS_AGREEMENT"
  7137. // "RESOURCE_NOT_DELETED"
  7138. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  7139. // "UNREACHABLE"
  7140. Code string `json:"code,omitempty"`
  7141. // Data: [Output Only] Metadata about this warning in key: value format.
  7142. // For example:
  7143. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  7144. Data []*VpnTunnelsScopedListWarningData `json:"data,omitempty"`
  7145. // Message: [Output Only] A human-readable description of the warning
  7146. // code.
  7147. Message string `json:"message,omitempty"`
  7148. // ForceSendFields is a list of field names (e.g. "Code") to
  7149. // unconditionally include in API requests. By default, fields with
  7150. // empty values are omitted from API requests. However, any non-pointer,
  7151. // non-interface field appearing in ForceSendFields will be sent to the
  7152. // server regardless of whether the field is empty or not. This may be
  7153. // used to include empty fields in Patch requests.
  7154. ForceSendFields []string `json:"-"`
  7155. }
  7156. func (s *VpnTunnelsScopedListWarning) MarshalJSON() ([]byte, error) {
  7157. type noMethod VpnTunnelsScopedListWarning
  7158. raw := noMethod(*s)
  7159. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  7160. }
  7161. type VpnTunnelsScopedListWarningData struct {
  7162. // Key: [Output Only] A key that provides more detail on the warning
  7163. // being returned. For example, for warnings where there are no results
  7164. // in a list request for a particular zone, this key might be scope and
  7165. // the key value might be the zone name. Other examples might be a key
  7166. // indicating a deprecated resource, and a suggested replacement, or a
  7167. // warning about invalid network settings (for example, if an instance
  7168. // attempts to perform IP forwarding but is not enabled for IP
  7169. // forwarding).
  7170. Key string `json:"key,omitempty"`
  7171. // Value: [Output Only] A warning data value corresponding to the key.
  7172. Value string `json:"value,omitempty"`
  7173. // ForceSendFields is a list of field names (e.g. "Key") to
  7174. // unconditionally include in API requests. By default, fields with
  7175. // empty values are omitted from API requests. However, any non-pointer,
  7176. // non-interface field appearing in ForceSendFields will be sent to the
  7177. // server regardless of whether the field is empty or not. This may be
  7178. // used to include empty fields in Patch requests.
  7179. ForceSendFields []string `json:"-"`
  7180. }
  7181. func (s *VpnTunnelsScopedListWarningData) MarshalJSON() ([]byte, error) {
  7182. type noMethod VpnTunnelsScopedListWarningData
  7183. raw := noMethod(*s)
  7184. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  7185. }
  7186. // Zone: A Zone resource.
  7187. type Zone struct {
  7188. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  7189. // format.
  7190. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  7191. // Deprecated: [Output Only] The deprecation status associated with this
  7192. // zone.
  7193. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  7194. // Description: [Output Only] Textual description of the resource.
  7195. Description string `json:"description,omitempty"`
  7196. // Id: [Output Only] The unique identifier for the resource. This
  7197. // identifier is defined by the server.
  7198. Id uint64 `json:"id,omitempty,string"`
  7199. // Kind: [Output Only] Type of the resource. Always compute#zone for
  7200. // zones.
  7201. Kind string `json:"kind,omitempty"`
  7202. // MaintenanceWindows: [Output Only] Any scheduled maintenance windows
  7203. // for this zone. When the zone is in a maintenance window, all
  7204. // resources which reside in the zone will be unavailable. For more
  7205. // information, see Maintenance Windows
  7206. MaintenanceWindows []*ZoneMaintenanceWindows `json:"maintenanceWindows,omitempty"`
  7207. // Name: [Output Only] Name of the resource.
  7208. Name string `json:"name,omitempty"`
  7209. // Region: [Output Only] Full URL reference to the region which hosts
  7210. // the zone.
  7211. Region string `json:"region,omitempty"`
  7212. // SelfLink: [Output Only] Server-defined URL for the resource.
  7213. SelfLink string `json:"selfLink,omitempty"`
  7214. // Status: [Output Only] Status of the zone, either UP or DOWN.
  7215. //
  7216. // Possible values:
  7217. // "DOWN"
  7218. // "UP"
  7219. Status string `json:"status,omitempty"`
  7220. // ServerResponse contains the HTTP response code and headers from the
  7221. // server.
  7222. googleapi.ServerResponse `json:"-"`
  7223. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  7224. // to unconditionally include in API requests. By default, fields with
  7225. // empty values are omitted from API requests. However, any non-pointer,
  7226. // non-interface field appearing in ForceSendFields will be sent to the
  7227. // server regardless of whether the field is empty or not. This may be
  7228. // used to include empty fields in Patch requests.
  7229. ForceSendFields []string `json:"-"`
  7230. }
  7231. func (s *Zone) MarshalJSON() ([]byte, error) {
  7232. type noMethod Zone
  7233. raw := noMethod(*s)
  7234. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  7235. }
  7236. type ZoneMaintenanceWindows struct {
  7237. // BeginTime: [Output Only] Starting time of the maintenance window, in
  7238. // RFC3339 format.
  7239. BeginTime string `json:"beginTime,omitempty"`
  7240. // Description: [Output Only] Textual description of the maintenance
  7241. // window.
  7242. Description string `json:"description,omitempty"`
  7243. // EndTime: [Output Only] Ending time of the maintenance window, in
  7244. // RFC3339 format.
  7245. EndTime string `json:"endTime,omitempty"`
  7246. // Name: [Output Only] Name of the maintenance window.
  7247. Name string `json:"name,omitempty"`
  7248. // ForceSendFields is a list of field names (e.g. "BeginTime") to
  7249. // unconditionally include in API requests. By default, fields with
  7250. // empty values are omitted from API requests. However, any non-pointer,
  7251. // non-interface field appearing in ForceSendFields will be sent to the
  7252. // server regardless of whether the field is empty or not. This may be
  7253. // used to include empty fields in Patch requests.
  7254. ForceSendFields []string `json:"-"`
  7255. }
  7256. func (s *ZoneMaintenanceWindows) MarshalJSON() ([]byte, error) {
  7257. type noMethod ZoneMaintenanceWindows
  7258. raw := noMethod(*s)
  7259. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  7260. }
  7261. // ZoneList: Contains a list of zone resources.
  7262. type ZoneList struct {
  7263. // Id: [Output Only] Unique identifier for the resource; defined by the
  7264. // server.
  7265. Id string `json:"id,omitempty"`
  7266. // Items: [Output Only] A list of Zone resources.
  7267. Items []*Zone `json:"items,omitempty"`
  7268. // Kind: Type of resource.
  7269. Kind string `json:"kind,omitempty"`
  7270. // NextPageToken: [Output Only] This token allows you to get the next
  7271. // page of results for list requests. If the number of results is larger
  7272. // than maxResults, use the nextPageToken as a value for the query
  7273. // parameter pageToken in the next list request. Subsequent list
  7274. // requests will have their own nextPageToken to continue paging through
  7275. // the results.
  7276. NextPageToken string `json:"nextPageToken,omitempty"`
  7277. // SelfLink: [Output Only] Server-defined URL for this resource.
  7278. SelfLink string `json:"selfLink,omitempty"`
  7279. // ServerResponse contains the HTTP response code and headers from the
  7280. // server.
  7281. googleapi.ServerResponse `json:"-"`
  7282. // ForceSendFields is a list of field names (e.g. "Id") to
  7283. // unconditionally include in API requests. By default, fields with
  7284. // empty values are omitted from API requests. However, any non-pointer,
  7285. // non-interface field appearing in ForceSendFields will be sent to the
  7286. // server regardless of whether the field is empty or not. This may be
  7287. // used to include empty fields in Patch requests.
  7288. ForceSendFields []string `json:"-"`
  7289. }
  7290. func (s *ZoneList) MarshalJSON() ([]byte, error) {
  7291. type noMethod ZoneList
  7292. raw := noMethod(*s)
  7293. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  7294. }
  7295. // method id "compute.addresses.aggregatedList":
  7296. type AddressesAggregatedListCall struct {
  7297. s *Service
  7298. project string
  7299. urlParams_ gensupport.URLParams
  7300. ifNoneMatch_ string
  7301. ctx_ context.Context
  7302. }
  7303. // AggregatedList: Retrieves an aggregated list of addresses.
  7304. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/aggregatedList
  7305. func (r *AddressesService) AggregatedList(project string) *AddressesAggregatedListCall {
  7306. c := &AddressesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7307. c.project = project
  7308. return c
  7309. }
  7310. // Filter sets the optional parameter "filter": Sets a filter expression
  7311. // for filtering listed resources, in the form filter={expression}. Your
  7312. // {expression} must be in the format: field_name comparison_string
  7313. // literal_string.
  7314. //
  7315. // The field_name is the name of the field you want to compare. Only
  7316. // atomic field types are supported (string, number, boolean). The
  7317. // comparison_string must be either eq (equals) or ne (not equals). The
  7318. // literal_string is the string value to filter to. The literal value
  7319. // must be valid for the type of field you are filtering by (string,
  7320. // number, boolean). For string fields, the literal value is interpreted
  7321. // as a regular expression using RE2 syntax. The literal value must
  7322. // match the entire field.
  7323. //
  7324. // For example, filter=name ne example-instance.
  7325. //
  7326. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  7327. // you can also filter on nested fields. For example, you could filter
  7328. // on instances that have set the scheduling.automaticRestart field to
  7329. // true. In particular, use filtering on nested fields to take advantage
  7330. // of instance labels to organize and filter results based on label
  7331. // values.
  7332. //
  7333. // The Beta API also supports filtering on multiple expressions by
  7334. // providing each separate expression within parentheses. For example,
  7335. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  7336. // Multiple expressions are treated as AND expressions meaning that
  7337. // resources must match all expressions to pass the filters.
  7338. func (c *AddressesAggregatedListCall) Filter(filter string) *AddressesAggregatedListCall {
  7339. c.urlParams_.Set("filter", filter)
  7340. return c
  7341. }
  7342. // MaxResults sets the optional parameter "maxResults": The maximum
  7343. // number of results per page that Compute Engine should return. If the
  7344. // number of available results is larger than maxResults, Compute Engine
  7345. // returns a nextPageToken that can be used to get the next page of
  7346. // results in subsequent list requests.
  7347. func (c *AddressesAggregatedListCall) MaxResults(maxResults int64) *AddressesAggregatedListCall {
  7348. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  7349. return c
  7350. }
  7351. // PageToken sets the optional parameter "pageToken": Specifies a page
  7352. // token to use. Set pageToken to the nextPageToken returned by a
  7353. // previous list request to get the next page of results.
  7354. func (c *AddressesAggregatedListCall) PageToken(pageToken string) *AddressesAggregatedListCall {
  7355. c.urlParams_.Set("pageToken", pageToken)
  7356. return c
  7357. }
  7358. // Fields allows partial responses to be retrieved. See
  7359. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7360. // for more information.
  7361. func (c *AddressesAggregatedListCall) Fields(s ...googleapi.Field) *AddressesAggregatedListCall {
  7362. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7363. return c
  7364. }
  7365. // IfNoneMatch sets the optional parameter which makes the operation
  7366. // fail if the object's ETag matches the given value. This is useful for
  7367. // getting updates only after the object has changed since the last
  7368. // request. Use googleapi.IsNotModified to check whether the response
  7369. // error from Do is the result of In-None-Match.
  7370. func (c *AddressesAggregatedListCall) IfNoneMatch(entityTag string) *AddressesAggregatedListCall {
  7371. c.ifNoneMatch_ = entityTag
  7372. return c
  7373. }
  7374. // Context sets the context to be used in this call's Do method. Any
  7375. // pending HTTP request will be aborted if the provided context is
  7376. // canceled.
  7377. func (c *AddressesAggregatedListCall) Context(ctx context.Context) *AddressesAggregatedListCall {
  7378. c.ctx_ = ctx
  7379. return c
  7380. }
  7381. func (c *AddressesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  7382. var body io.Reader = nil
  7383. c.urlParams_.Set("alt", alt)
  7384. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/addresses")
  7385. urls += "?" + c.urlParams_.Encode()
  7386. req, _ := http.NewRequest("GET", urls, body)
  7387. googleapi.Expand(req.URL, map[string]string{
  7388. "project": c.project,
  7389. })
  7390. req.Header.Set("User-Agent", c.s.userAgent())
  7391. if c.ifNoneMatch_ != "" {
  7392. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  7393. }
  7394. if c.ctx_ != nil {
  7395. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7396. }
  7397. return c.s.client.Do(req)
  7398. }
  7399. // Do executes the "compute.addresses.aggregatedList" call.
  7400. // Exactly one of *AddressAggregatedList or error will be non-nil. Any
  7401. // non-2xx status code is an error. Response headers are in either
  7402. // *AddressAggregatedList.ServerResponse.Header or (if a response was
  7403. // returned at all) in error.(*googleapi.Error).Header. Use
  7404. // googleapi.IsNotModified to check whether the returned error was
  7405. // because http.StatusNotModified was returned.
  7406. func (c *AddressesAggregatedListCall) Do(opts ...googleapi.CallOption) (*AddressAggregatedList, error) {
  7407. gensupport.SetOptions(c.urlParams_, opts...)
  7408. res, err := c.doRequest("json")
  7409. if res != nil && res.StatusCode == http.StatusNotModified {
  7410. if res.Body != nil {
  7411. res.Body.Close()
  7412. }
  7413. return nil, &googleapi.Error{
  7414. Code: res.StatusCode,
  7415. Header: res.Header,
  7416. }
  7417. }
  7418. if err != nil {
  7419. return nil, err
  7420. }
  7421. defer googleapi.CloseBody(res)
  7422. if err := googleapi.CheckResponse(res); err != nil {
  7423. return nil, err
  7424. }
  7425. ret := &AddressAggregatedList{
  7426. ServerResponse: googleapi.ServerResponse{
  7427. Header: res.Header,
  7428. HTTPStatusCode: res.StatusCode,
  7429. },
  7430. }
  7431. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7432. return nil, err
  7433. }
  7434. return ret, nil
  7435. // {
  7436. // "description": "Retrieves an aggregated list of addresses.",
  7437. // "httpMethod": "GET",
  7438. // "id": "compute.addresses.aggregatedList",
  7439. // "parameterOrder": [
  7440. // "project"
  7441. // ],
  7442. // "parameters": {
  7443. // "filter": {
  7444. // "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.",
  7445. // "location": "query",
  7446. // "type": "string"
  7447. // },
  7448. // "maxResults": {
  7449. // "default": "500",
  7450. // "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.",
  7451. // "format": "uint32",
  7452. // "location": "query",
  7453. // "maximum": "500",
  7454. // "minimum": "0",
  7455. // "type": "integer"
  7456. // },
  7457. // "pageToken": {
  7458. // "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.",
  7459. // "location": "query",
  7460. // "type": "string"
  7461. // },
  7462. // "project": {
  7463. // "description": "Project ID for this request.",
  7464. // "location": "path",
  7465. // "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])?))",
  7466. // "required": true,
  7467. // "type": "string"
  7468. // }
  7469. // },
  7470. // "path": "{project}/aggregated/addresses",
  7471. // "response": {
  7472. // "$ref": "AddressAggregatedList"
  7473. // },
  7474. // "scopes": [
  7475. // "https://www.googleapis.com/auth/cloud-platform",
  7476. // "https://www.googleapis.com/auth/compute",
  7477. // "https://www.googleapis.com/auth/compute.readonly"
  7478. // ]
  7479. // }
  7480. }
  7481. // Pages invokes f for each page of results.
  7482. // A non-nil error returned from f will halt the iteration.
  7483. // The provided context supersedes any context provided to the Context method.
  7484. func (c *AddressesAggregatedListCall) Pages(ctx context.Context, f func(*AddressAggregatedList) error) error {
  7485. c.ctx_ = ctx
  7486. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  7487. for {
  7488. x, err := c.Do()
  7489. if err != nil {
  7490. return err
  7491. }
  7492. if err := f(x); err != nil {
  7493. return err
  7494. }
  7495. if x.NextPageToken == "" {
  7496. return nil
  7497. }
  7498. c.PageToken(x.NextPageToken)
  7499. }
  7500. }
  7501. // method id "compute.addresses.delete":
  7502. type AddressesDeleteCall struct {
  7503. s *Service
  7504. project string
  7505. region string
  7506. address string
  7507. urlParams_ gensupport.URLParams
  7508. ctx_ context.Context
  7509. }
  7510. // Delete: Deletes the specified address resource.
  7511. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/delete
  7512. func (r *AddressesService) Delete(project string, region string, address string) *AddressesDeleteCall {
  7513. c := &AddressesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7514. c.project = project
  7515. c.region = region
  7516. c.address = address
  7517. return c
  7518. }
  7519. // Fields allows partial responses to be retrieved. See
  7520. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7521. // for more information.
  7522. func (c *AddressesDeleteCall) Fields(s ...googleapi.Field) *AddressesDeleteCall {
  7523. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7524. return c
  7525. }
  7526. // Context sets the context to be used in this call's Do method. Any
  7527. // pending HTTP request will be aborted if the provided context is
  7528. // canceled.
  7529. func (c *AddressesDeleteCall) Context(ctx context.Context) *AddressesDeleteCall {
  7530. c.ctx_ = ctx
  7531. return c
  7532. }
  7533. func (c *AddressesDeleteCall) doRequest(alt string) (*http.Response, error) {
  7534. var body io.Reader = nil
  7535. c.urlParams_.Set("alt", alt)
  7536. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{address}")
  7537. urls += "?" + c.urlParams_.Encode()
  7538. req, _ := http.NewRequest("DELETE", urls, body)
  7539. googleapi.Expand(req.URL, map[string]string{
  7540. "project": c.project,
  7541. "region": c.region,
  7542. "address": c.address,
  7543. })
  7544. req.Header.Set("User-Agent", c.s.userAgent())
  7545. if c.ctx_ != nil {
  7546. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7547. }
  7548. return c.s.client.Do(req)
  7549. }
  7550. // Do executes the "compute.addresses.delete" call.
  7551. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  7552. // status code is an error. Response headers are in either
  7553. // *Operation.ServerResponse.Header or (if a response was returned at
  7554. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7555. // to check whether the returned error was because
  7556. // http.StatusNotModified was returned.
  7557. func (c *AddressesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  7558. gensupport.SetOptions(c.urlParams_, opts...)
  7559. res, err := c.doRequest("json")
  7560. if res != nil && res.StatusCode == http.StatusNotModified {
  7561. if res.Body != nil {
  7562. res.Body.Close()
  7563. }
  7564. return nil, &googleapi.Error{
  7565. Code: res.StatusCode,
  7566. Header: res.Header,
  7567. }
  7568. }
  7569. if err != nil {
  7570. return nil, err
  7571. }
  7572. defer googleapi.CloseBody(res)
  7573. if err := googleapi.CheckResponse(res); err != nil {
  7574. return nil, err
  7575. }
  7576. ret := &Operation{
  7577. ServerResponse: googleapi.ServerResponse{
  7578. Header: res.Header,
  7579. HTTPStatusCode: res.StatusCode,
  7580. },
  7581. }
  7582. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7583. return nil, err
  7584. }
  7585. return ret, nil
  7586. // {
  7587. // "description": "Deletes the specified address resource.",
  7588. // "httpMethod": "DELETE",
  7589. // "id": "compute.addresses.delete",
  7590. // "parameterOrder": [
  7591. // "project",
  7592. // "region",
  7593. // "address"
  7594. // ],
  7595. // "parameters": {
  7596. // "address": {
  7597. // "description": "Name of the address resource to delete.",
  7598. // "location": "path",
  7599. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  7600. // "required": true,
  7601. // "type": "string"
  7602. // },
  7603. // "project": {
  7604. // "description": "Project ID for this request.",
  7605. // "location": "path",
  7606. // "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])?))",
  7607. // "required": true,
  7608. // "type": "string"
  7609. // },
  7610. // "region": {
  7611. // "description": "The name of the region for this request.",
  7612. // "location": "path",
  7613. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  7614. // "required": true,
  7615. // "type": "string"
  7616. // }
  7617. // },
  7618. // "path": "{project}/regions/{region}/addresses/{address}",
  7619. // "response": {
  7620. // "$ref": "Operation"
  7621. // },
  7622. // "scopes": [
  7623. // "https://www.googleapis.com/auth/cloud-platform",
  7624. // "https://www.googleapis.com/auth/compute"
  7625. // ]
  7626. // }
  7627. }
  7628. // method id "compute.addresses.get":
  7629. type AddressesGetCall struct {
  7630. s *Service
  7631. project string
  7632. region string
  7633. address string
  7634. urlParams_ gensupport.URLParams
  7635. ifNoneMatch_ string
  7636. ctx_ context.Context
  7637. }
  7638. // Get: Returns the specified address resource.
  7639. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/get
  7640. func (r *AddressesService) Get(project string, region string, address string) *AddressesGetCall {
  7641. c := &AddressesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7642. c.project = project
  7643. c.region = region
  7644. c.address = address
  7645. return c
  7646. }
  7647. // Fields allows partial responses to be retrieved. See
  7648. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7649. // for more information.
  7650. func (c *AddressesGetCall) Fields(s ...googleapi.Field) *AddressesGetCall {
  7651. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7652. return c
  7653. }
  7654. // IfNoneMatch sets the optional parameter which makes the operation
  7655. // fail if the object's ETag matches the given value. This is useful for
  7656. // getting updates only after the object has changed since the last
  7657. // request. Use googleapi.IsNotModified to check whether the response
  7658. // error from Do is the result of In-None-Match.
  7659. func (c *AddressesGetCall) IfNoneMatch(entityTag string) *AddressesGetCall {
  7660. c.ifNoneMatch_ = entityTag
  7661. return c
  7662. }
  7663. // Context sets the context to be used in this call's Do method. Any
  7664. // pending HTTP request will be aborted if the provided context is
  7665. // canceled.
  7666. func (c *AddressesGetCall) Context(ctx context.Context) *AddressesGetCall {
  7667. c.ctx_ = ctx
  7668. return c
  7669. }
  7670. func (c *AddressesGetCall) doRequest(alt string) (*http.Response, error) {
  7671. var body io.Reader = nil
  7672. c.urlParams_.Set("alt", alt)
  7673. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{address}")
  7674. urls += "?" + c.urlParams_.Encode()
  7675. req, _ := http.NewRequest("GET", urls, body)
  7676. googleapi.Expand(req.URL, map[string]string{
  7677. "project": c.project,
  7678. "region": c.region,
  7679. "address": c.address,
  7680. })
  7681. req.Header.Set("User-Agent", c.s.userAgent())
  7682. if c.ifNoneMatch_ != "" {
  7683. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  7684. }
  7685. if c.ctx_ != nil {
  7686. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7687. }
  7688. return c.s.client.Do(req)
  7689. }
  7690. // Do executes the "compute.addresses.get" call.
  7691. // Exactly one of *Address or error will be non-nil. Any non-2xx status
  7692. // code is an error. Response headers are in either
  7693. // *Address.ServerResponse.Header or (if a response was returned at all)
  7694. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7695. // check whether the returned error was because http.StatusNotModified
  7696. // was returned.
  7697. func (c *AddressesGetCall) Do(opts ...googleapi.CallOption) (*Address, error) {
  7698. gensupport.SetOptions(c.urlParams_, opts...)
  7699. res, err := c.doRequest("json")
  7700. if res != nil && res.StatusCode == http.StatusNotModified {
  7701. if res.Body != nil {
  7702. res.Body.Close()
  7703. }
  7704. return nil, &googleapi.Error{
  7705. Code: res.StatusCode,
  7706. Header: res.Header,
  7707. }
  7708. }
  7709. if err != nil {
  7710. return nil, err
  7711. }
  7712. defer googleapi.CloseBody(res)
  7713. if err := googleapi.CheckResponse(res); err != nil {
  7714. return nil, err
  7715. }
  7716. ret := &Address{
  7717. ServerResponse: googleapi.ServerResponse{
  7718. Header: res.Header,
  7719. HTTPStatusCode: res.StatusCode,
  7720. },
  7721. }
  7722. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7723. return nil, err
  7724. }
  7725. return ret, nil
  7726. // {
  7727. // "description": "Returns the specified address resource.",
  7728. // "httpMethod": "GET",
  7729. // "id": "compute.addresses.get",
  7730. // "parameterOrder": [
  7731. // "project",
  7732. // "region",
  7733. // "address"
  7734. // ],
  7735. // "parameters": {
  7736. // "address": {
  7737. // "description": "Name of the address resource to return.",
  7738. // "location": "path",
  7739. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  7740. // "required": true,
  7741. // "type": "string"
  7742. // },
  7743. // "project": {
  7744. // "description": "Project ID for this request.",
  7745. // "location": "path",
  7746. // "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])?))",
  7747. // "required": true,
  7748. // "type": "string"
  7749. // },
  7750. // "region": {
  7751. // "description": "The name of the region for this request.",
  7752. // "location": "path",
  7753. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  7754. // "required": true,
  7755. // "type": "string"
  7756. // }
  7757. // },
  7758. // "path": "{project}/regions/{region}/addresses/{address}",
  7759. // "response": {
  7760. // "$ref": "Address"
  7761. // },
  7762. // "scopes": [
  7763. // "https://www.googleapis.com/auth/cloud-platform",
  7764. // "https://www.googleapis.com/auth/compute",
  7765. // "https://www.googleapis.com/auth/compute.readonly"
  7766. // ]
  7767. // }
  7768. }
  7769. // method id "compute.addresses.insert":
  7770. type AddressesInsertCall struct {
  7771. s *Service
  7772. project string
  7773. region string
  7774. address *Address
  7775. urlParams_ gensupport.URLParams
  7776. ctx_ context.Context
  7777. }
  7778. // Insert: Creates an address resource in the specified project using
  7779. // the data included in the request.
  7780. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/insert
  7781. func (r *AddressesService) Insert(project string, region string, address *Address) *AddressesInsertCall {
  7782. c := &AddressesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7783. c.project = project
  7784. c.region = region
  7785. c.address = address
  7786. return c
  7787. }
  7788. // Fields allows partial responses to be retrieved. See
  7789. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7790. // for more information.
  7791. func (c *AddressesInsertCall) Fields(s ...googleapi.Field) *AddressesInsertCall {
  7792. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7793. return c
  7794. }
  7795. // Context sets the context to be used in this call's Do method. Any
  7796. // pending HTTP request will be aborted if the provided context is
  7797. // canceled.
  7798. func (c *AddressesInsertCall) Context(ctx context.Context) *AddressesInsertCall {
  7799. c.ctx_ = ctx
  7800. return c
  7801. }
  7802. func (c *AddressesInsertCall) doRequest(alt string) (*http.Response, error) {
  7803. var body io.Reader = nil
  7804. body, err := googleapi.WithoutDataWrapper.JSONReader(c.address)
  7805. if err != nil {
  7806. return nil, err
  7807. }
  7808. ctype := "application/json"
  7809. c.urlParams_.Set("alt", alt)
  7810. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses")
  7811. urls += "?" + c.urlParams_.Encode()
  7812. req, _ := http.NewRequest("POST", urls, body)
  7813. googleapi.Expand(req.URL, map[string]string{
  7814. "project": c.project,
  7815. "region": c.region,
  7816. })
  7817. req.Header.Set("Content-Type", ctype)
  7818. req.Header.Set("User-Agent", c.s.userAgent())
  7819. if c.ctx_ != nil {
  7820. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7821. }
  7822. return c.s.client.Do(req)
  7823. }
  7824. // Do executes the "compute.addresses.insert" call.
  7825. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  7826. // status code is an error. Response headers are in either
  7827. // *Operation.ServerResponse.Header or (if a response was returned at
  7828. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7829. // to check whether the returned error was because
  7830. // http.StatusNotModified was returned.
  7831. func (c *AddressesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  7832. gensupport.SetOptions(c.urlParams_, opts...)
  7833. res, err := c.doRequest("json")
  7834. if res != nil && res.StatusCode == http.StatusNotModified {
  7835. if res.Body != nil {
  7836. res.Body.Close()
  7837. }
  7838. return nil, &googleapi.Error{
  7839. Code: res.StatusCode,
  7840. Header: res.Header,
  7841. }
  7842. }
  7843. if err != nil {
  7844. return nil, err
  7845. }
  7846. defer googleapi.CloseBody(res)
  7847. if err := googleapi.CheckResponse(res); err != nil {
  7848. return nil, err
  7849. }
  7850. ret := &Operation{
  7851. ServerResponse: googleapi.ServerResponse{
  7852. Header: res.Header,
  7853. HTTPStatusCode: res.StatusCode,
  7854. },
  7855. }
  7856. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7857. return nil, err
  7858. }
  7859. return ret, nil
  7860. // {
  7861. // "description": "Creates an address resource in the specified project using the data included in the request.",
  7862. // "httpMethod": "POST",
  7863. // "id": "compute.addresses.insert",
  7864. // "parameterOrder": [
  7865. // "project",
  7866. // "region"
  7867. // ],
  7868. // "parameters": {
  7869. // "project": {
  7870. // "description": "Project ID for this request.",
  7871. // "location": "path",
  7872. // "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])?))",
  7873. // "required": true,
  7874. // "type": "string"
  7875. // },
  7876. // "region": {
  7877. // "description": "The name of the region for this request.",
  7878. // "location": "path",
  7879. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  7880. // "required": true,
  7881. // "type": "string"
  7882. // }
  7883. // },
  7884. // "path": "{project}/regions/{region}/addresses",
  7885. // "request": {
  7886. // "$ref": "Address"
  7887. // },
  7888. // "response": {
  7889. // "$ref": "Operation"
  7890. // },
  7891. // "scopes": [
  7892. // "https://www.googleapis.com/auth/cloud-platform",
  7893. // "https://www.googleapis.com/auth/compute"
  7894. // ]
  7895. // }
  7896. }
  7897. // method id "compute.addresses.list":
  7898. type AddressesListCall struct {
  7899. s *Service
  7900. project string
  7901. region string
  7902. urlParams_ gensupport.URLParams
  7903. ifNoneMatch_ string
  7904. ctx_ context.Context
  7905. }
  7906. // List: Retrieves a list of address resources contained within the
  7907. // specified region.
  7908. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/list
  7909. func (r *AddressesService) List(project string, region string) *AddressesListCall {
  7910. c := &AddressesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7911. c.project = project
  7912. c.region = region
  7913. return c
  7914. }
  7915. // Filter sets the optional parameter "filter": Sets a filter expression
  7916. // for filtering listed resources, in the form filter={expression}. Your
  7917. // {expression} must be in the format: field_name comparison_string
  7918. // literal_string.
  7919. //
  7920. // The field_name is the name of the field you want to compare. Only
  7921. // atomic field types are supported (string, number, boolean). The
  7922. // comparison_string must be either eq (equals) or ne (not equals). The
  7923. // literal_string is the string value to filter to. The literal value
  7924. // must be valid for the type of field you are filtering by (string,
  7925. // number, boolean). For string fields, the literal value is interpreted
  7926. // as a regular expression using RE2 syntax. The literal value must
  7927. // match the entire field.
  7928. //
  7929. // For example, filter=name ne example-instance.
  7930. //
  7931. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  7932. // you can also filter on nested fields. For example, you could filter
  7933. // on instances that have set the scheduling.automaticRestart field to
  7934. // true. In particular, use filtering on nested fields to take advantage
  7935. // of instance labels to organize and filter results based on label
  7936. // values.
  7937. //
  7938. // The Beta API also supports filtering on multiple expressions by
  7939. // providing each separate expression within parentheses. For example,
  7940. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  7941. // Multiple expressions are treated as AND expressions meaning that
  7942. // resources must match all expressions to pass the filters.
  7943. func (c *AddressesListCall) Filter(filter string) *AddressesListCall {
  7944. c.urlParams_.Set("filter", filter)
  7945. return c
  7946. }
  7947. // MaxResults sets the optional parameter "maxResults": The maximum
  7948. // number of results per page that Compute Engine should return. If the
  7949. // number of available results is larger than maxResults, Compute Engine
  7950. // returns a nextPageToken that can be used to get the next page of
  7951. // results in subsequent list requests.
  7952. func (c *AddressesListCall) MaxResults(maxResults int64) *AddressesListCall {
  7953. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  7954. return c
  7955. }
  7956. // PageToken sets the optional parameter "pageToken": Specifies a page
  7957. // token to use. Set pageToken to the nextPageToken returned by a
  7958. // previous list request to get the next page of results.
  7959. func (c *AddressesListCall) PageToken(pageToken string) *AddressesListCall {
  7960. c.urlParams_.Set("pageToken", pageToken)
  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 *AddressesListCall) Fields(s ...googleapi.Field) *AddressesListCall {
  7967. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7968. return c
  7969. }
  7970. // IfNoneMatch sets the optional parameter which makes the operation
  7971. // fail if the object's ETag matches the given value. This is useful for
  7972. // getting updates only after the object has changed since the last
  7973. // request. Use googleapi.IsNotModified to check whether the response
  7974. // error from Do is the result of In-None-Match.
  7975. func (c *AddressesListCall) IfNoneMatch(entityTag string) *AddressesListCall {
  7976. c.ifNoneMatch_ = entityTag
  7977. return c
  7978. }
  7979. // Context sets the context to be used in this call's Do method. Any
  7980. // pending HTTP request will be aborted if the provided context is
  7981. // canceled.
  7982. func (c *AddressesListCall) Context(ctx context.Context) *AddressesListCall {
  7983. c.ctx_ = ctx
  7984. return c
  7985. }
  7986. func (c *AddressesListCall) doRequest(alt string) (*http.Response, error) {
  7987. var body io.Reader = nil
  7988. c.urlParams_.Set("alt", alt)
  7989. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses")
  7990. urls += "?" + c.urlParams_.Encode()
  7991. req, _ := http.NewRequest("GET", urls, body)
  7992. googleapi.Expand(req.URL, map[string]string{
  7993. "project": c.project,
  7994. "region": c.region,
  7995. })
  7996. req.Header.Set("User-Agent", c.s.userAgent())
  7997. if c.ifNoneMatch_ != "" {
  7998. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  7999. }
  8000. if c.ctx_ != nil {
  8001. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8002. }
  8003. return c.s.client.Do(req)
  8004. }
  8005. // Do executes the "compute.addresses.list" call.
  8006. // Exactly one of *AddressList or error will be non-nil. Any non-2xx
  8007. // status code is an error. Response headers are in either
  8008. // *AddressList.ServerResponse.Header or (if a response was returned at
  8009. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8010. // to check whether the returned error was because
  8011. // http.StatusNotModified was returned.
  8012. func (c *AddressesListCall) Do(opts ...googleapi.CallOption) (*AddressList, error) {
  8013. gensupport.SetOptions(c.urlParams_, opts...)
  8014. res, err := c.doRequest("json")
  8015. if res != nil && res.StatusCode == http.StatusNotModified {
  8016. if res.Body != nil {
  8017. res.Body.Close()
  8018. }
  8019. return nil, &googleapi.Error{
  8020. Code: res.StatusCode,
  8021. Header: res.Header,
  8022. }
  8023. }
  8024. if err != nil {
  8025. return nil, err
  8026. }
  8027. defer googleapi.CloseBody(res)
  8028. if err := googleapi.CheckResponse(res); err != nil {
  8029. return nil, err
  8030. }
  8031. ret := &AddressList{
  8032. ServerResponse: googleapi.ServerResponse{
  8033. Header: res.Header,
  8034. HTTPStatusCode: res.StatusCode,
  8035. },
  8036. }
  8037. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8038. return nil, err
  8039. }
  8040. return ret, nil
  8041. // {
  8042. // "description": "Retrieves a list of address resources contained within the specified region.",
  8043. // "httpMethod": "GET",
  8044. // "id": "compute.addresses.list",
  8045. // "parameterOrder": [
  8046. // "project",
  8047. // "region"
  8048. // ],
  8049. // "parameters": {
  8050. // "filter": {
  8051. // "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.",
  8052. // "location": "query",
  8053. // "type": "string"
  8054. // },
  8055. // "maxResults": {
  8056. // "default": "500",
  8057. // "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.",
  8058. // "format": "uint32",
  8059. // "location": "query",
  8060. // "maximum": "500",
  8061. // "minimum": "0",
  8062. // "type": "integer"
  8063. // },
  8064. // "pageToken": {
  8065. // "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.",
  8066. // "location": "query",
  8067. // "type": "string"
  8068. // },
  8069. // "project": {
  8070. // "description": "Project ID for this request.",
  8071. // "location": "path",
  8072. // "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])?))",
  8073. // "required": true,
  8074. // "type": "string"
  8075. // },
  8076. // "region": {
  8077. // "description": "The name of the region for this request.",
  8078. // "location": "path",
  8079. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  8080. // "required": true,
  8081. // "type": "string"
  8082. // }
  8083. // },
  8084. // "path": "{project}/regions/{region}/addresses",
  8085. // "response": {
  8086. // "$ref": "AddressList"
  8087. // },
  8088. // "scopes": [
  8089. // "https://www.googleapis.com/auth/cloud-platform",
  8090. // "https://www.googleapis.com/auth/compute",
  8091. // "https://www.googleapis.com/auth/compute.readonly"
  8092. // ]
  8093. // }
  8094. }
  8095. // Pages invokes f for each page of results.
  8096. // A non-nil error returned from f will halt the iteration.
  8097. // The provided context supersedes any context provided to the Context method.
  8098. func (c *AddressesListCall) Pages(ctx context.Context, f func(*AddressList) error) error {
  8099. c.ctx_ = ctx
  8100. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  8101. for {
  8102. x, err := c.Do()
  8103. if err != nil {
  8104. return err
  8105. }
  8106. if err := f(x); err != nil {
  8107. return err
  8108. }
  8109. if x.NextPageToken == "" {
  8110. return nil
  8111. }
  8112. c.PageToken(x.NextPageToken)
  8113. }
  8114. }
  8115. // method id "compute.autoscalers.aggregatedList":
  8116. type AutoscalersAggregatedListCall struct {
  8117. s *Service
  8118. project string
  8119. urlParams_ gensupport.URLParams
  8120. ifNoneMatch_ string
  8121. ctx_ context.Context
  8122. }
  8123. // AggregatedList: Retrieves an aggregated list of autoscalers.
  8124. func (r *AutoscalersService) AggregatedList(project string) *AutoscalersAggregatedListCall {
  8125. c := &AutoscalersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8126. c.project = project
  8127. return c
  8128. }
  8129. // Filter sets the optional parameter "filter": Sets a filter expression
  8130. // for filtering listed resources, in the form filter={expression}. Your
  8131. // {expression} must be in the format: field_name comparison_string
  8132. // literal_string.
  8133. //
  8134. // The field_name is the name of the field you want to compare. Only
  8135. // atomic field types are supported (string, number, boolean). The
  8136. // comparison_string must be either eq (equals) or ne (not equals). The
  8137. // literal_string is the string value to filter to. The literal value
  8138. // must be valid for the type of field you are filtering by (string,
  8139. // number, boolean). For string fields, the literal value is interpreted
  8140. // as a regular expression using RE2 syntax. The literal value must
  8141. // match the entire field.
  8142. //
  8143. // For example, filter=name ne example-instance.
  8144. //
  8145. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  8146. // you can also filter on nested fields. For example, you could filter
  8147. // on instances that have set the scheduling.automaticRestart field to
  8148. // true. In particular, use filtering on nested fields to take advantage
  8149. // of instance labels to organize and filter results based on label
  8150. // values.
  8151. //
  8152. // The Beta API also supports filtering on multiple expressions by
  8153. // providing each separate expression within parentheses. For example,
  8154. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  8155. // Multiple expressions are treated as AND expressions meaning that
  8156. // resources must match all expressions to pass the filters.
  8157. func (c *AutoscalersAggregatedListCall) Filter(filter string) *AutoscalersAggregatedListCall {
  8158. c.urlParams_.Set("filter", filter)
  8159. return c
  8160. }
  8161. // MaxResults sets the optional parameter "maxResults": The maximum
  8162. // number of results per page that Compute Engine should return. If the
  8163. // number of available results is larger than maxResults, Compute Engine
  8164. // returns a nextPageToken that can be used to get the next page of
  8165. // results in subsequent list requests.
  8166. func (c *AutoscalersAggregatedListCall) MaxResults(maxResults int64) *AutoscalersAggregatedListCall {
  8167. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  8168. return c
  8169. }
  8170. // PageToken sets the optional parameter "pageToken": Specifies a page
  8171. // token to use. Set pageToken to the nextPageToken returned by a
  8172. // previous list request to get the next page of results.
  8173. func (c *AutoscalersAggregatedListCall) PageToken(pageToken string) *AutoscalersAggregatedListCall {
  8174. c.urlParams_.Set("pageToken", pageToken)
  8175. return c
  8176. }
  8177. // Fields allows partial responses to be retrieved. See
  8178. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8179. // for more information.
  8180. func (c *AutoscalersAggregatedListCall) Fields(s ...googleapi.Field) *AutoscalersAggregatedListCall {
  8181. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8182. return c
  8183. }
  8184. // IfNoneMatch sets the optional parameter which makes the operation
  8185. // fail if the object's ETag matches the given value. This is useful for
  8186. // getting updates only after the object has changed since the last
  8187. // request. Use googleapi.IsNotModified to check whether the response
  8188. // error from Do is the result of In-None-Match.
  8189. func (c *AutoscalersAggregatedListCall) IfNoneMatch(entityTag string) *AutoscalersAggregatedListCall {
  8190. c.ifNoneMatch_ = entityTag
  8191. return c
  8192. }
  8193. // Context sets the context to be used in this call's Do method. Any
  8194. // pending HTTP request will be aborted if the provided context is
  8195. // canceled.
  8196. func (c *AutoscalersAggregatedListCall) Context(ctx context.Context) *AutoscalersAggregatedListCall {
  8197. c.ctx_ = ctx
  8198. return c
  8199. }
  8200. func (c *AutoscalersAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  8201. var body io.Reader = nil
  8202. c.urlParams_.Set("alt", alt)
  8203. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/autoscalers")
  8204. urls += "?" + c.urlParams_.Encode()
  8205. req, _ := http.NewRequest("GET", urls, body)
  8206. googleapi.Expand(req.URL, map[string]string{
  8207. "project": c.project,
  8208. })
  8209. req.Header.Set("User-Agent", c.s.userAgent())
  8210. if c.ifNoneMatch_ != "" {
  8211. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  8212. }
  8213. if c.ctx_ != nil {
  8214. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8215. }
  8216. return c.s.client.Do(req)
  8217. }
  8218. // Do executes the "compute.autoscalers.aggregatedList" call.
  8219. // Exactly one of *AutoscalerAggregatedList or error will be non-nil.
  8220. // Any non-2xx status code is an error. Response headers are in either
  8221. // *AutoscalerAggregatedList.ServerResponse.Header or (if a response was
  8222. // returned at all) in error.(*googleapi.Error).Header. Use
  8223. // googleapi.IsNotModified to check whether the returned error was
  8224. // because http.StatusNotModified was returned.
  8225. func (c *AutoscalersAggregatedListCall) Do(opts ...googleapi.CallOption) (*AutoscalerAggregatedList, error) {
  8226. gensupport.SetOptions(c.urlParams_, opts...)
  8227. res, err := c.doRequest("json")
  8228. if res != nil && res.StatusCode == http.StatusNotModified {
  8229. if res.Body != nil {
  8230. res.Body.Close()
  8231. }
  8232. return nil, &googleapi.Error{
  8233. Code: res.StatusCode,
  8234. Header: res.Header,
  8235. }
  8236. }
  8237. if err != nil {
  8238. return nil, err
  8239. }
  8240. defer googleapi.CloseBody(res)
  8241. if err := googleapi.CheckResponse(res); err != nil {
  8242. return nil, err
  8243. }
  8244. ret := &AutoscalerAggregatedList{
  8245. ServerResponse: googleapi.ServerResponse{
  8246. Header: res.Header,
  8247. HTTPStatusCode: res.StatusCode,
  8248. },
  8249. }
  8250. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8251. return nil, err
  8252. }
  8253. return ret, nil
  8254. // {
  8255. // "description": "Retrieves an aggregated list of autoscalers.",
  8256. // "httpMethod": "GET",
  8257. // "id": "compute.autoscalers.aggregatedList",
  8258. // "parameterOrder": [
  8259. // "project"
  8260. // ],
  8261. // "parameters": {
  8262. // "filter": {
  8263. // "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.",
  8264. // "location": "query",
  8265. // "type": "string"
  8266. // },
  8267. // "maxResults": {
  8268. // "default": "500",
  8269. // "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.",
  8270. // "format": "uint32",
  8271. // "location": "query",
  8272. // "maximum": "500",
  8273. // "minimum": "0",
  8274. // "type": "integer"
  8275. // },
  8276. // "pageToken": {
  8277. // "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.",
  8278. // "location": "query",
  8279. // "type": "string"
  8280. // },
  8281. // "project": {
  8282. // "description": "Project ID for this request.",
  8283. // "location": "path",
  8284. // "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])?))",
  8285. // "required": true,
  8286. // "type": "string"
  8287. // }
  8288. // },
  8289. // "path": "{project}/aggregated/autoscalers",
  8290. // "response": {
  8291. // "$ref": "AutoscalerAggregatedList"
  8292. // },
  8293. // "scopes": [
  8294. // "https://www.googleapis.com/auth/cloud-platform",
  8295. // "https://www.googleapis.com/auth/compute",
  8296. // "https://www.googleapis.com/auth/compute.readonly"
  8297. // ]
  8298. // }
  8299. }
  8300. // Pages invokes f for each page of results.
  8301. // A non-nil error returned from f will halt the iteration.
  8302. // The provided context supersedes any context provided to the Context method.
  8303. func (c *AutoscalersAggregatedListCall) Pages(ctx context.Context, f func(*AutoscalerAggregatedList) error) error {
  8304. c.ctx_ = ctx
  8305. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  8306. for {
  8307. x, err := c.Do()
  8308. if err != nil {
  8309. return err
  8310. }
  8311. if err := f(x); err != nil {
  8312. return err
  8313. }
  8314. if x.NextPageToken == "" {
  8315. return nil
  8316. }
  8317. c.PageToken(x.NextPageToken)
  8318. }
  8319. }
  8320. // method id "compute.autoscalers.delete":
  8321. type AutoscalersDeleteCall struct {
  8322. s *Service
  8323. project string
  8324. zone string
  8325. autoscaler string
  8326. urlParams_ gensupport.URLParams
  8327. ctx_ context.Context
  8328. }
  8329. // Delete: Deletes the specified autoscaler resource.
  8330. func (r *AutoscalersService) Delete(project string, zone string, autoscaler string) *AutoscalersDeleteCall {
  8331. c := &AutoscalersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8332. c.project = project
  8333. c.zone = zone
  8334. c.autoscaler = autoscaler
  8335. return c
  8336. }
  8337. // Fields allows partial responses to be retrieved. See
  8338. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8339. // for more information.
  8340. func (c *AutoscalersDeleteCall) Fields(s ...googleapi.Field) *AutoscalersDeleteCall {
  8341. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8342. return c
  8343. }
  8344. // Context sets the context to be used in this call's Do method. Any
  8345. // pending HTTP request will be aborted if the provided context is
  8346. // canceled.
  8347. func (c *AutoscalersDeleteCall) Context(ctx context.Context) *AutoscalersDeleteCall {
  8348. c.ctx_ = ctx
  8349. return c
  8350. }
  8351. func (c *AutoscalersDeleteCall) doRequest(alt string) (*http.Response, error) {
  8352. var body io.Reader = nil
  8353. c.urlParams_.Set("alt", alt)
  8354. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers/{autoscaler}")
  8355. urls += "?" + c.urlParams_.Encode()
  8356. req, _ := http.NewRequest("DELETE", urls, body)
  8357. googleapi.Expand(req.URL, map[string]string{
  8358. "project": c.project,
  8359. "zone": c.zone,
  8360. "autoscaler": c.autoscaler,
  8361. })
  8362. req.Header.Set("User-Agent", c.s.userAgent())
  8363. if c.ctx_ != nil {
  8364. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8365. }
  8366. return c.s.client.Do(req)
  8367. }
  8368. // Do executes the "compute.autoscalers.delete" call.
  8369. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  8370. // status code is an error. Response headers are in either
  8371. // *Operation.ServerResponse.Header or (if a response was returned at
  8372. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8373. // to check whether the returned error was because
  8374. // http.StatusNotModified was returned.
  8375. func (c *AutoscalersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  8376. gensupport.SetOptions(c.urlParams_, opts...)
  8377. res, err := c.doRequest("json")
  8378. if res != nil && res.StatusCode == http.StatusNotModified {
  8379. if res.Body != nil {
  8380. res.Body.Close()
  8381. }
  8382. return nil, &googleapi.Error{
  8383. Code: res.StatusCode,
  8384. Header: res.Header,
  8385. }
  8386. }
  8387. if err != nil {
  8388. return nil, err
  8389. }
  8390. defer googleapi.CloseBody(res)
  8391. if err := googleapi.CheckResponse(res); err != nil {
  8392. return nil, err
  8393. }
  8394. ret := &Operation{
  8395. ServerResponse: googleapi.ServerResponse{
  8396. Header: res.Header,
  8397. HTTPStatusCode: res.StatusCode,
  8398. },
  8399. }
  8400. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8401. return nil, err
  8402. }
  8403. return ret, nil
  8404. // {
  8405. // "description": "Deletes the specified autoscaler resource.",
  8406. // "httpMethod": "DELETE",
  8407. // "id": "compute.autoscalers.delete",
  8408. // "parameterOrder": [
  8409. // "project",
  8410. // "zone",
  8411. // "autoscaler"
  8412. // ],
  8413. // "parameters": {
  8414. // "autoscaler": {
  8415. // "description": "Name of the persistent autoscaler resource to delete.",
  8416. // "location": "path",
  8417. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  8418. // "required": true,
  8419. // "type": "string"
  8420. // },
  8421. // "project": {
  8422. // "description": "Project ID for this request.",
  8423. // "location": "path",
  8424. // "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])?))",
  8425. // "required": true,
  8426. // "type": "string"
  8427. // },
  8428. // "zone": {
  8429. // "description": "Name of the zone scoping this request.",
  8430. // "location": "path",
  8431. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  8432. // "required": true,
  8433. // "type": "string"
  8434. // }
  8435. // },
  8436. // "path": "{project}/zones/{zone}/autoscalers/{autoscaler}",
  8437. // "response": {
  8438. // "$ref": "Operation"
  8439. // },
  8440. // "scopes": [
  8441. // "https://www.googleapis.com/auth/cloud-platform",
  8442. // "https://www.googleapis.com/auth/compute"
  8443. // ]
  8444. // }
  8445. }
  8446. // method id "compute.autoscalers.get":
  8447. type AutoscalersGetCall struct {
  8448. s *Service
  8449. project string
  8450. zone string
  8451. autoscaler string
  8452. urlParams_ gensupport.URLParams
  8453. ifNoneMatch_ string
  8454. ctx_ context.Context
  8455. }
  8456. // Get: Returns the specified autoscaler resource.
  8457. func (r *AutoscalersService) Get(project string, zone string, autoscaler string) *AutoscalersGetCall {
  8458. c := &AutoscalersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8459. c.project = project
  8460. c.zone = zone
  8461. c.autoscaler = autoscaler
  8462. return c
  8463. }
  8464. // Fields allows partial responses to be retrieved. See
  8465. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8466. // for more information.
  8467. func (c *AutoscalersGetCall) Fields(s ...googleapi.Field) *AutoscalersGetCall {
  8468. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8469. return c
  8470. }
  8471. // IfNoneMatch sets the optional parameter which makes the operation
  8472. // fail if the object's ETag matches the given value. This is useful for
  8473. // getting updates only after the object has changed since the last
  8474. // request. Use googleapi.IsNotModified to check whether the response
  8475. // error from Do is the result of In-None-Match.
  8476. func (c *AutoscalersGetCall) IfNoneMatch(entityTag string) *AutoscalersGetCall {
  8477. c.ifNoneMatch_ = entityTag
  8478. return c
  8479. }
  8480. // Context sets the context to be used in this call's Do method. Any
  8481. // pending HTTP request will be aborted if the provided context is
  8482. // canceled.
  8483. func (c *AutoscalersGetCall) Context(ctx context.Context) *AutoscalersGetCall {
  8484. c.ctx_ = ctx
  8485. return c
  8486. }
  8487. func (c *AutoscalersGetCall) doRequest(alt string) (*http.Response, error) {
  8488. var body io.Reader = nil
  8489. c.urlParams_.Set("alt", alt)
  8490. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers/{autoscaler}")
  8491. urls += "?" + c.urlParams_.Encode()
  8492. req, _ := http.NewRequest("GET", urls, body)
  8493. googleapi.Expand(req.URL, map[string]string{
  8494. "project": c.project,
  8495. "zone": c.zone,
  8496. "autoscaler": c.autoscaler,
  8497. })
  8498. req.Header.Set("User-Agent", c.s.userAgent())
  8499. if c.ifNoneMatch_ != "" {
  8500. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  8501. }
  8502. if c.ctx_ != nil {
  8503. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8504. }
  8505. return c.s.client.Do(req)
  8506. }
  8507. // Do executes the "compute.autoscalers.get" call.
  8508. // Exactly one of *Autoscaler or error will be non-nil. Any non-2xx
  8509. // status code is an error. Response headers are in either
  8510. // *Autoscaler.ServerResponse.Header or (if a response was returned at
  8511. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8512. // to check whether the returned error was because
  8513. // http.StatusNotModified was returned.
  8514. func (c *AutoscalersGetCall) Do(opts ...googleapi.CallOption) (*Autoscaler, error) {
  8515. gensupport.SetOptions(c.urlParams_, opts...)
  8516. res, err := c.doRequest("json")
  8517. if res != nil && res.StatusCode == http.StatusNotModified {
  8518. if res.Body != nil {
  8519. res.Body.Close()
  8520. }
  8521. return nil, &googleapi.Error{
  8522. Code: res.StatusCode,
  8523. Header: res.Header,
  8524. }
  8525. }
  8526. if err != nil {
  8527. return nil, err
  8528. }
  8529. defer googleapi.CloseBody(res)
  8530. if err := googleapi.CheckResponse(res); err != nil {
  8531. return nil, err
  8532. }
  8533. ret := &Autoscaler{
  8534. ServerResponse: googleapi.ServerResponse{
  8535. Header: res.Header,
  8536. HTTPStatusCode: res.StatusCode,
  8537. },
  8538. }
  8539. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8540. return nil, err
  8541. }
  8542. return ret, nil
  8543. // {
  8544. // "description": "Returns the specified autoscaler resource.",
  8545. // "httpMethod": "GET",
  8546. // "id": "compute.autoscalers.get",
  8547. // "parameterOrder": [
  8548. // "project",
  8549. // "zone",
  8550. // "autoscaler"
  8551. // ],
  8552. // "parameters": {
  8553. // "autoscaler": {
  8554. // "description": "Name of the persistent autoscaler resource to return.",
  8555. // "location": "path",
  8556. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  8557. // "required": true,
  8558. // "type": "string"
  8559. // },
  8560. // "project": {
  8561. // "description": "Project ID for this request.",
  8562. // "location": "path",
  8563. // "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])?))",
  8564. // "required": true,
  8565. // "type": "string"
  8566. // },
  8567. // "zone": {
  8568. // "description": "Name of the zone scoping this request.",
  8569. // "location": "path",
  8570. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  8571. // "required": true,
  8572. // "type": "string"
  8573. // }
  8574. // },
  8575. // "path": "{project}/zones/{zone}/autoscalers/{autoscaler}",
  8576. // "response": {
  8577. // "$ref": "Autoscaler"
  8578. // },
  8579. // "scopes": [
  8580. // "https://www.googleapis.com/auth/cloud-platform",
  8581. // "https://www.googleapis.com/auth/compute",
  8582. // "https://www.googleapis.com/auth/compute.readonly"
  8583. // ]
  8584. // }
  8585. }
  8586. // method id "compute.autoscalers.insert":
  8587. type AutoscalersInsertCall struct {
  8588. s *Service
  8589. project string
  8590. zone string
  8591. autoscaler *Autoscaler
  8592. urlParams_ gensupport.URLParams
  8593. ctx_ context.Context
  8594. }
  8595. // Insert: Creates an autoscaler resource in the specified project using
  8596. // the data included in the request.
  8597. func (r *AutoscalersService) Insert(project string, zone string, autoscaler *Autoscaler) *AutoscalersInsertCall {
  8598. c := &AutoscalersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8599. c.project = project
  8600. c.zone = zone
  8601. c.autoscaler = autoscaler
  8602. return c
  8603. }
  8604. // Fields allows partial responses to be retrieved. See
  8605. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8606. // for more information.
  8607. func (c *AutoscalersInsertCall) Fields(s ...googleapi.Field) *AutoscalersInsertCall {
  8608. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8609. return c
  8610. }
  8611. // Context sets the context to be used in this call's Do method. Any
  8612. // pending HTTP request will be aborted if the provided context is
  8613. // canceled.
  8614. func (c *AutoscalersInsertCall) Context(ctx context.Context) *AutoscalersInsertCall {
  8615. c.ctx_ = ctx
  8616. return c
  8617. }
  8618. func (c *AutoscalersInsertCall) doRequest(alt string) (*http.Response, error) {
  8619. var body io.Reader = nil
  8620. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  8621. if err != nil {
  8622. return nil, err
  8623. }
  8624. ctype := "application/json"
  8625. c.urlParams_.Set("alt", alt)
  8626. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  8627. urls += "?" + c.urlParams_.Encode()
  8628. req, _ := http.NewRequest("POST", urls, body)
  8629. googleapi.Expand(req.URL, map[string]string{
  8630. "project": c.project,
  8631. "zone": c.zone,
  8632. })
  8633. req.Header.Set("Content-Type", ctype)
  8634. req.Header.Set("User-Agent", c.s.userAgent())
  8635. if c.ctx_ != nil {
  8636. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8637. }
  8638. return c.s.client.Do(req)
  8639. }
  8640. // Do executes the "compute.autoscalers.insert" call.
  8641. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  8642. // status code is an error. Response headers are in either
  8643. // *Operation.ServerResponse.Header or (if a response was returned at
  8644. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8645. // to check whether the returned error was because
  8646. // http.StatusNotModified was returned.
  8647. func (c *AutoscalersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  8648. gensupport.SetOptions(c.urlParams_, opts...)
  8649. res, err := c.doRequest("json")
  8650. if res != nil && res.StatusCode == http.StatusNotModified {
  8651. if res.Body != nil {
  8652. res.Body.Close()
  8653. }
  8654. return nil, &googleapi.Error{
  8655. Code: res.StatusCode,
  8656. Header: res.Header,
  8657. }
  8658. }
  8659. if err != nil {
  8660. return nil, err
  8661. }
  8662. defer googleapi.CloseBody(res)
  8663. if err := googleapi.CheckResponse(res); err != nil {
  8664. return nil, err
  8665. }
  8666. ret := &Operation{
  8667. ServerResponse: googleapi.ServerResponse{
  8668. Header: res.Header,
  8669. HTTPStatusCode: res.StatusCode,
  8670. },
  8671. }
  8672. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8673. return nil, err
  8674. }
  8675. return ret, nil
  8676. // {
  8677. // "description": "Creates an autoscaler resource in the specified project using the data included in the request.",
  8678. // "httpMethod": "POST",
  8679. // "id": "compute.autoscalers.insert",
  8680. // "parameterOrder": [
  8681. // "project",
  8682. // "zone"
  8683. // ],
  8684. // "parameters": {
  8685. // "project": {
  8686. // "description": "Project ID for this request.",
  8687. // "location": "path",
  8688. // "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])?))",
  8689. // "required": true,
  8690. // "type": "string"
  8691. // },
  8692. // "zone": {
  8693. // "description": "Name of the zone scoping this request.",
  8694. // "location": "path",
  8695. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  8696. // "required": true,
  8697. // "type": "string"
  8698. // }
  8699. // },
  8700. // "path": "{project}/zones/{zone}/autoscalers",
  8701. // "request": {
  8702. // "$ref": "Autoscaler"
  8703. // },
  8704. // "response": {
  8705. // "$ref": "Operation"
  8706. // },
  8707. // "scopes": [
  8708. // "https://www.googleapis.com/auth/cloud-platform",
  8709. // "https://www.googleapis.com/auth/compute"
  8710. // ]
  8711. // }
  8712. }
  8713. // method id "compute.autoscalers.list":
  8714. type AutoscalersListCall struct {
  8715. s *Service
  8716. project string
  8717. zone string
  8718. urlParams_ gensupport.URLParams
  8719. ifNoneMatch_ string
  8720. ctx_ context.Context
  8721. }
  8722. // List: Retrieves a list of autoscaler resources contained within the
  8723. // specified zone.
  8724. func (r *AutoscalersService) List(project string, zone string) *AutoscalersListCall {
  8725. c := &AutoscalersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8726. c.project = project
  8727. c.zone = zone
  8728. return c
  8729. }
  8730. // Filter sets the optional parameter "filter": Sets a filter expression
  8731. // for filtering listed resources, in the form filter={expression}. Your
  8732. // {expression} must be in the format: field_name comparison_string
  8733. // literal_string.
  8734. //
  8735. // The field_name is the name of the field you want to compare. Only
  8736. // atomic field types are supported (string, number, boolean). The
  8737. // comparison_string must be either eq (equals) or ne (not equals). The
  8738. // literal_string is the string value to filter to. The literal value
  8739. // must be valid for the type of field you are filtering by (string,
  8740. // number, boolean). For string fields, the literal value is interpreted
  8741. // as a regular expression using RE2 syntax. The literal value must
  8742. // match the entire field.
  8743. //
  8744. // For example, filter=name ne example-instance.
  8745. //
  8746. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  8747. // you can also filter on nested fields. For example, you could filter
  8748. // on instances that have set the scheduling.automaticRestart field to
  8749. // true. In particular, use filtering on nested fields to take advantage
  8750. // of instance labels to organize and filter results based on label
  8751. // values.
  8752. //
  8753. // The Beta API also supports filtering on multiple expressions by
  8754. // providing each separate expression within parentheses. For example,
  8755. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  8756. // Multiple expressions are treated as AND expressions meaning that
  8757. // resources must match all expressions to pass the filters.
  8758. func (c *AutoscalersListCall) Filter(filter string) *AutoscalersListCall {
  8759. c.urlParams_.Set("filter", filter)
  8760. return c
  8761. }
  8762. // MaxResults sets the optional parameter "maxResults": The maximum
  8763. // number of results per page that Compute Engine should return. If the
  8764. // number of available results is larger than maxResults, Compute Engine
  8765. // returns a nextPageToken that can be used to get the next page of
  8766. // results in subsequent list requests.
  8767. func (c *AutoscalersListCall) MaxResults(maxResults int64) *AutoscalersListCall {
  8768. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  8769. return c
  8770. }
  8771. // PageToken sets the optional parameter "pageToken": Specifies a page
  8772. // token to use. Set pageToken to the nextPageToken returned by a
  8773. // previous list request to get the next page of results.
  8774. func (c *AutoscalersListCall) PageToken(pageToken string) *AutoscalersListCall {
  8775. c.urlParams_.Set("pageToken", pageToken)
  8776. return c
  8777. }
  8778. // Fields allows partial responses to be retrieved. See
  8779. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8780. // for more information.
  8781. func (c *AutoscalersListCall) Fields(s ...googleapi.Field) *AutoscalersListCall {
  8782. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8783. return c
  8784. }
  8785. // IfNoneMatch sets the optional parameter which makes the operation
  8786. // fail if the object's ETag matches the given value. This is useful for
  8787. // getting updates only after the object has changed since the last
  8788. // request. Use googleapi.IsNotModified to check whether the response
  8789. // error from Do is the result of In-None-Match.
  8790. func (c *AutoscalersListCall) IfNoneMatch(entityTag string) *AutoscalersListCall {
  8791. c.ifNoneMatch_ = entityTag
  8792. return c
  8793. }
  8794. // Context sets the context to be used in this call's Do method. Any
  8795. // pending HTTP request will be aborted if the provided context is
  8796. // canceled.
  8797. func (c *AutoscalersListCall) Context(ctx context.Context) *AutoscalersListCall {
  8798. c.ctx_ = ctx
  8799. return c
  8800. }
  8801. func (c *AutoscalersListCall) doRequest(alt string) (*http.Response, error) {
  8802. var body io.Reader = nil
  8803. c.urlParams_.Set("alt", alt)
  8804. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  8805. urls += "?" + c.urlParams_.Encode()
  8806. req, _ := http.NewRequest("GET", urls, body)
  8807. googleapi.Expand(req.URL, map[string]string{
  8808. "project": c.project,
  8809. "zone": c.zone,
  8810. })
  8811. req.Header.Set("User-Agent", c.s.userAgent())
  8812. if c.ifNoneMatch_ != "" {
  8813. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  8814. }
  8815. if c.ctx_ != nil {
  8816. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8817. }
  8818. return c.s.client.Do(req)
  8819. }
  8820. // Do executes the "compute.autoscalers.list" call.
  8821. // Exactly one of *AutoscalerList or error will be non-nil. Any non-2xx
  8822. // status code is an error. Response headers are in either
  8823. // *AutoscalerList.ServerResponse.Header or (if a response was returned
  8824. // at all) in error.(*googleapi.Error).Header. Use
  8825. // googleapi.IsNotModified to check whether the returned error was
  8826. // because http.StatusNotModified was returned.
  8827. func (c *AutoscalersListCall) Do(opts ...googleapi.CallOption) (*AutoscalerList, error) {
  8828. gensupport.SetOptions(c.urlParams_, opts...)
  8829. res, err := c.doRequest("json")
  8830. if res != nil && res.StatusCode == http.StatusNotModified {
  8831. if res.Body != nil {
  8832. res.Body.Close()
  8833. }
  8834. return nil, &googleapi.Error{
  8835. Code: res.StatusCode,
  8836. Header: res.Header,
  8837. }
  8838. }
  8839. if err != nil {
  8840. return nil, err
  8841. }
  8842. defer googleapi.CloseBody(res)
  8843. if err := googleapi.CheckResponse(res); err != nil {
  8844. return nil, err
  8845. }
  8846. ret := &AutoscalerList{
  8847. ServerResponse: googleapi.ServerResponse{
  8848. Header: res.Header,
  8849. HTTPStatusCode: res.StatusCode,
  8850. },
  8851. }
  8852. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8853. return nil, err
  8854. }
  8855. return ret, nil
  8856. // {
  8857. // "description": "Retrieves a list of autoscaler resources contained within the specified zone.",
  8858. // "httpMethod": "GET",
  8859. // "id": "compute.autoscalers.list",
  8860. // "parameterOrder": [
  8861. // "project",
  8862. // "zone"
  8863. // ],
  8864. // "parameters": {
  8865. // "filter": {
  8866. // "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.",
  8867. // "location": "query",
  8868. // "type": "string"
  8869. // },
  8870. // "maxResults": {
  8871. // "default": "500",
  8872. // "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.",
  8873. // "format": "uint32",
  8874. // "location": "query",
  8875. // "maximum": "500",
  8876. // "minimum": "0",
  8877. // "type": "integer"
  8878. // },
  8879. // "pageToken": {
  8880. // "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.",
  8881. // "location": "query",
  8882. // "type": "string"
  8883. // },
  8884. // "project": {
  8885. // "description": "Project ID for this request.",
  8886. // "location": "path",
  8887. // "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])?))",
  8888. // "required": true,
  8889. // "type": "string"
  8890. // },
  8891. // "zone": {
  8892. // "description": "Name of the zone scoping this request.",
  8893. // "location": "path",
  8894. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  8895. // "required": true,
  8896. // "type": "string"
  8897. // }
  8898. // },
  8899. // "path": "{project}/zones/{zone}/autoscalers",
  8900. // "response": {
  8901. // "$ref": "AutoscalerList"
  8902. // },
  8903. // "scopes": [
  8904. // "https://www.googleapis.com/auth/cloud-platform",
  8905. // "https://www.googleapis.com/auth/compute",
  8906. // "https://www.googleapis.com/auth/compute.readonly"
  8907. // ]
  8908. // }
  8909. }
  8910. // Pages invokes f for each page of results.
  8911. // A non-nil error returned from f will halt the iteration.
  8912. // The provided context supersedes any context provided to the Context method.
  8913. func (c *AutoscalersListCall) Pages(ctx context.Context, f func(*AutoscalerList) error) error {
  8914. c.ctx_ = ctx
  8915. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  8916. for {
  8917. x, err := c.Do()
  8918. if err != nil {
  8919. return err
  8920. }
  8921. if err := f(x); err != nil {
  8922. return err
  8923. }
  8924. if x.NextPageToken == "" {
  8925. return nil
  8926. }
  8927. c.PageToken(x.NextPageToken)
  8928. }
  8929. }
  8930. // method id "compute.autoscalers.patch":
  8931. type AutoscalersPatchCall struct {
  8932. s *Service
  8933. project string
  8934. zone string
  8935. autoscaler2 *Autoscaler
  8936. urlParams_ gensupport.URLParams
  8937. ctx_ context.Context
  8938. }
  8939. // Patch: Updates an autoscaler resource in the specified project using
  8940. // the data included in the request. This method supports patch
  8941. // semantics.
  8942. func (r *AutoscalersService) Patch(project string, zone string, autoscaler string, autoscaler2 *Autoscaler) *AutoscalersPatchCall {
  8943. c := &AutoscalersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8944. c.project = project
  8945. c.zone = zone
  8946. c.urlParams_.Set("autoscaler", autoscaler)
  8947. c.autoscaler2 = autoscaler2
  8948. return c
  8949. }
  8950. // Fields allows partial responses to be retrieved. See
  8951. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8952. // for more information.
  8953. func (c *AutoscalersPatchCall) Fields(s ...googleapi.Field) *AutoscalersPatchCall {
  8954. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8955. return c
  8956. }
  8957. // Context sets the context to be used in this call's Do method. Any
  8958. // pending HTTP request will be aborted if the provided context is
  8959. // canceled.
  8960. func (c *AutoscalersPatchCall) Context(ctx context.Context) *AutoscalersPatchCall {
  8961. c.ctx_ = ctx
  8962. return c
  8963. }
  8964. func (c *AutoscalersPatchCall) doRequest(alt string) (*http.Response, error) {
  8965. var body io.Reader = nil
  8966. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler2)
  8967. if err != nil {
  8968. return nil, err
  8969. }
  8970. ctype := "application/json"
  8971. c.urlParams_.Set("alt", alt)
  8972. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  8973. urls += "?" + c.urlParams_.Encode()
  8974. req, _ := http.NewRequest("PATCH", urls, body)
  8975. googleapi.Expand(req.URL, map[string]string{
  8976. "project": c.project,
  8977. "zone": c.zone,
  8978. })
  8979. req.Header.Set("Content-Type", ctype)
  8980. req.Header.Set("User-Agent", c.s.userAgent())
  8981. if c.ctx_ != nil {
  8982. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8983. }
  8984. return c.s.client.Do(req)
  8985. }
  8986. // Do executes the "compute.autoscalers.patch" call.
  8987. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  8988. // status code is an error. Response headers are in either
  8989. // *Operation.ServerResponse.Header or (if a response was returned at
  8990. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8991. // to check whether the returned error was because
  8992. // http.StatusNotModified was returned.
  8993. func (c *AutoscalersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  8994. gensupport.SetOptions(c.urlParams_, opts...)
  8995. res, err := c.doRequest("json")
  8996. if res != nil && res.StatusCode == http.StatusNotModified {
  8997. if res.Body != nil {
  8998. res.Body.Close()
  8999. }
  9000. return nil, &googleapi.Error{
  9001. Code: res.StatusCode,
  9002. Header: res.Header,
  9003. }
  9004. }
  9005. if err != nil {
  9006. return nil, err
  9007. }
  9008. defer googleapi.CloseBody(res)
  9009. if err := googleapi.CheckResponse(res); err != nil {
  9010. return nil, err
  9011. }
  9012. ret := &Operation{
  9013. ServerResponse: googleapi.ServerResponse{
  9014. Header: res.Header,
  9015. HTTPStatusCode: res.StatusCode,
  9016. },
  9017. }
  9018. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9019. return nil, err
  9020. }
  9021. return ret, nil
  9022. // {
  9023. // "description": "Updates an autoscaler resource in the specified project using the data included in the request. This method supports patch semantics.",
  9024. // "httpMethod": "PATCH",
  9025. // "id": "compute.autoscalers.patch",
  9026. // "parameterOrder": [
  9027. // "project",
  9028. // "zone",
  9029. // "autoscaler"
  9030. // ],
  9031. // "parameters": {
  9032. // "autoscaler": {
  9033. // "description": "Name of the autoscaler resource to update.",
  9034. // "location": "query",
  9035. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  9036. // "required": true,
  9037. // "type": "string"
  9038. // },
  9039. // "project": {
  9040. // "description": "Project ID for this request.",
  9041. // "location": "path",
  9042. // "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])?))",
  9043. // "required": true,
  9044. // "type": "string"
  9045. // },
  9046. // "zone": {
  9047. // "description": "Name of the zone scoping this request.",
  9048. // "location": "path",
  9049. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  9050. // "required": true,
  9051. // "type": "string"
  9052. // }
  9053. // },
  9054. // "path": "{project}/zones/{zone}/autoscalers",
  9055. // "request": {
  9056. // "$ref": "Autoscaler"
  9057. // },
  9058. // "response": {
  9059. // "$ref": "Operation"
  9060. // },
  9061. // "scopes": [
  9062. // "https://www.googleapis.com/auth/cloud-platform",
  9063. // "https://www.googleapis.com/auth/compute"
  9064. // ]
  9065. // }
  9066. }
  9067. // method id "compute.autoscalers.update":
  9068. type AutoscalersUpdateCall struct {
  9069. s *Service
  9070. project string
  9071. zone string
  9072. autoscaler *Autoscaler
  9073. urlParams_ gensupport.URLParams
  9074. ctx_ context.Context
  9075. }
  9076. // Update: Updates an autoscaler resource in the specified project using
  9077. // the data included in the request.
  9078. func (r *AutoscalersService) Update(project string, zone string, autoscaler *Autoscaler) *AutoscalersUpdateCall {
  9079. c := &AutoscalersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9080. c.project = project
  9081. c.zone = zone
  9082. c.autoscaler = autoscaler
  9083. return c
  9084. }
  9085. // Autoscaler sets the optional parameter "autoscaler": Name of the
  9086. // autoscaler resource to update.
  9087. func (c *AutoscalersUpdateCall) Autoscaler(autoscaler string) *AutoscalersUpdateCall {
  9088. c.urlParams_.Set("autoscaler", autoscaler)
  9089. return c
  9090. }
  9091. // Fields allows partial responses to be retrieved. See
  9092. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9093. // for more information.
  9094. func (c *AutoscalersUpdateCall) Fields(s ...googleapi.Field) *AutoscalersUpdateCall {
  9095. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9096. return c
  9097. }
  9098. // Context sets the context to be used in this call's Do method. Any
  9099. // pending HTTP request will be aborted if the provided context is
  9100. // canceled.
  9101. func (c *AutoscalersUpdateCall) Context(ctx context.Context) *AutoscalersUpdateCall {
  9102. c.ctx_ = ctx
  9103. return c
  9104. }
  9105. func (c *AutoscalersUpdateCall) doRequest(alt string) (*http.Response, error) {
  9106. var body io.Reader = nil
  9107. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  9108. if err != nil {
  9109. return nil, err
  9110. }
  9111. ctype := "application/json"
  9112. c.urlParams_.Set("alt", alt)
  9113. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  9114. urls += "?" + c.urlParams_.Encode()
  9115. req, _ := http.NewRequest("PUT", urls, body)
  9116. googleapi.Expand(req.URL, map[string]string{
  9117. "project": c.project,
  9118. "zone": c.zone,
  9119. })
  9120. req.Header.Set("Content-Type", ctype)
  9121. req.Header.Set("User-Agent", c.s.userAgent())
  9122. if c.ctx_ != nil {
  9123. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9124. }
  9125. return c.s.client.Do(req)
  9126. }
  9127. // Do executes the "compute.autoscalers.update" call.
  9128. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  9129. // status code is an error. Response headers are in either
  9130. // *Operation.ServerResponse.Header or (if a response was returned at
  9131. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9132. // to check whether the returned error was because
  9133. // http.StatusNotModified was returned.
  9134. func (c *AutoscalersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  9135. gensupport.SetOptions(c.urlParams_, opts...)
  9136. res, err := c.doRequest("json")
  9137. if res != nil && res.StatusCode == http.StatusNotModified {
  9138. if res.Body != nil {
  9139. res.Body.Close()
  9140. }
  9141. return nil, &googleapi.Error{
  9142. Code: res.StatusCode,
  9143. Header: res.Header,
  9144. }
  9145. }
  9146. if err != nil {
  9147. return nil, err
  9148. }
  9149. defer googleapi.CloseBody(res)
  9150. if err := googleapi.CheckResponse(res); err != nil {
  9151. return nil, err
  9152. }
  9153. ret := &Operation{
  9154. ServerResponse: googleapi.ServerResponse{
  9155. Header: res.Header,
  9156. HTTPStatusCode: res.StatusCode,
  9157. },
  9158. }
  9159. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9160. return nil, err
  9161. }
  9162. return ret, nil
  9163. // {
  9164. // "description": "Updates an autoscaler resource in the specified project using the data included in the request.",
  9165. // "httpMethod": "PUT",
  9166. // "id": "compute.autoscalers.update",
  9167. // "parameterOrder": [
  9168. // "project",
  9169. // "zone"
  9170. // ],
  9171. // "parameters": {
  9172. // "autoscaler": {
  9173. // "description": "Name of the autoscaler resource to update.",
  9174. // "location": "query",
  9175. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  9176. // "type": "string"
  9177. // },
  9178. // "project": {
  9179. // "description": "Project ID for this request.",
  9180. // "location": "path",
  9181. // "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])?))",
  9182. // "required": true,
  9183. // "type": "string"
  9184. // },
  9185. // "zone": {
  9186. // "description": "Name of the zone scoping this request.",
  9187. // "location": "path",
  9188. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  9189. // "required": true,
  9190. // "type": "string"
  9191. // }
  9192. // },
  9193. // "path": "{project}/zones/{zone}/autoscalers",
  9194. // "request": {
  9195. // "$ref": "Autoscaler"
  9196. // },
  9197. // "response": {
  9198. // "$ref": "Operation"
  9199. // },
  9200. // "scopes": [
  9201. // "https://www.googleapis.com/auth/cloud-platform",
  9202. // "https://www.googleapis.com/auth/compute"
  9203. // ]
  9204. // }
  9205. }
  9206. // method id "compute.backendServices.delete":
  9207. type BackendServicesDeleteCall struct {
  9208. s *Service
  9209. project string
  9210. backendService string
  9211. urlParams_ gensupport.URLParams
  9212. ctx_ context.Context
  9213. }
  9214. // Delete: Deletes the specified BackendService resource.
  9215. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/delete
  9216. func (r *BackendServicesService) Delete(project string, backendService string) *BackendServicesDeleteCall {
  9217. c := &BackendServicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9218. c.project = project
  9219. c.backendService = backendService
  9220. return c
  9221. }
  9222. // Fields allows partial responses to be retrieved. See
  9223. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9224. // for more information.
  9225. func (c *BackendServicesDeleteCall) Fields(s ...googleapi.Field) *BackendServicesDeleteCall {
  9226. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9227. return c
  9228. }
  9229. // Context sets the context to be used in this call's Do method. Any
  9230. // pending HTTP request will be aborted if the provided context is
  9231. // canceled.
  9232. func (c *BackendServicesDeleteCall) Context(ctx context.Context) *BackendServicesDeleteCall {
  9233. c.ctx_ = ctx
  9234. return c
  9235. }
  9236. func (c *BackendServicesDeleteCall) doRequest(alt string) (*http.Response, error) {
  9237. var body io.Reader = nil
  9238. c.urlParams_.Set("alt", alt)
  9239. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  9240. urls += "?" + c.urlParams_.Encode()
  9241. req, _ := http.NewRequest("DELETE", urls, body)
  9242. googleapi.Expand(req.URL, map[string]string{
  9243. "project": c.project,
  9244. "backendService": c.backendService,
  9245. })
  9246. req.Header.Set("User-Agent", c.s.userAgent())
  9247. if c.ctx_ != nil {
  9248. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9249. }
  9250. return c.s.client.Do(req)
  9251. }
  9252. // Do executes the "compute.backendServices.delete" call.
  9253. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  9254. // status code is an error. Response headers are in either
  9255. // *Operation.ServerResponse.Header or (if a response was returned at
  9256. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9257. // to check whether the returned error was because
  9258. // http.StatusNotModified was returned.
  9259. func (c *BackendServicesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  9260. gensupport.SetOptions(c.urlParams_, opts...)
  9261. res, err := c.doRequest("json")
  9262. if res != nil && res.StatusCode == http.StatusNotModified {
  9263. if res.Body != nil {
  9264. res.Body.Close()
  9265. }
  9266. return nil, &googleapi.Error{
  9267. Code: res.StatusCode,
  9268. Header: res.Header,
  9269. }
  9270. }
  9271. if err != nil {
  9272. return nil, err
  9273. }
  9274. defer googleapi.CloseBody(res)
  9275. if err := googleapi.CheckResponse(res); err != nil {
  9276. return nil, err
  9277. }
  9278. ret := &Operation{
  9279. ServerResponse: googleapi.ServerResponse{
  9280. Header: res.Header,
  9281. HTTPStatusCode: res.StatusCode,
  9282. },
  9283. }
  9284. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9285. return nil, err
  9286. }
  9287. return ret, nil
  9288. // {
  9289. // "description": "Deletes the specified BackendService resource.",
  9290. // "httpMethod": "DELETE",
  9291. // "id": "compute.backendServices.delete",
  9292. // "parameterOrder": [
  9293. // "project",
  9294. // "backendService"
  9295. // ],
  9296. // "parameters": {
  9297. // "backendService": {
  9298. // "description": "Name of the BackendService resource to delete.",
  9299. // "location": "path",
  9300. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  9301. // "required": true,
  9302. // "type": "string"
  9303. // },
  9304. // "project": {
  9305. // "description": "Project ID for this request.",
  9306. // "location": "path",
  9307. // "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])?))",
  9308. // "required": true,
  9309. // "type": "string"
  9310. // }
  9311. // },
  9312. // "path": "{project}/global/backendServices/{backendService}",
  9313. // "response": {
  9314. // "$ref": "Operation"
  9315. // },
  9316. // "scopes": [
  9317. // "https://www.googleapis.com/auth/cloud-platform",
  9318. // "https://www.googleapis.com/auth/compute"
  9319. // ]
  9320. // }
  9321. }
  9322. // method id "compute.backendServices.get":
  9323. type BackendServicesGetCall struct {
  9324. s *Service
  9325. project string
  9326. backendService string
  9327. urlParams_ gensupport.URLParams
  9328. ifNoneMatch_ string
  9329. ctx_ context.Context
  9330. }
  9331. // Get: Returns the specified BackendService resource.
  9332. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/get
  9333. func (r *BackendServicesService) Get(project string, backendService string) *BackendServicesGetCall {
  9334. c := &BackendServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9335. c.project = project
  9336. c.backendService = backendService
  9337. return c
  9338. }
  9339. // Fields allows partial responses to be retrieved. See
  9340. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9341. // for more information.
  9342. func (c *BackendServicesGetCall) Fields(s ...googleapi.Field) *BackendServicesGetCall {
  9343. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9344. return c
  9345. }
  9346. // IfNoneMatch sets the optional parameter which makes the operation
  9347. // fail if the object's ETag matches the given value. This is useful for
  9348. // getting updates only after the object has changed since the last
  9349. // request. Use googleapi.IsNotModified to check whether the response
  9350. // error from Do is the result of In-None-Match.
  9351. func (c *BackendServicesGetCall) IfNoneMatch(entityTag string) *BackendServicesGetCall {
  9352. c.ifNoneMatch_ = entityTag
  9353. return c
  9354. }
  9355. // Context sets the context to be used in this call's Do method. Any
  9356. // pending HTTP request will be aborted if the provided context is
  9357. // canceled.
  9358. func (c *BackendServicesGetCall) Context(ctx context.Context) *BackendServicesGetCall {
  9359. c.ctx_ = ctx
  9360. return c
  9361. }
  9362. func (c *BackendServicesGetCall) doRequest(alt string) (*http.Response, error) {
  9363. var body io.Reader = nil
  9364. c.urlParams_.Set("alt", alt)
  9365. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  9366. urls += "?" + c.urlParams_.Encode()
  9367. req, _ := http.NewRequest("GET", urls, body)
  9368. googleapi.Expand(req.URL, map[string]string{
  9369. "project": c.project,
  9370. "backendService": c.backendService,
  9371. })
  9372. req.Header.Set("User-Agent", c.s.userAgent())
  9373. if c.ifNoneMatch_ != "" {
  9374. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  9375. }
  9376. if c.ctx_ != nil {
  9377. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9378. }
  9379. return c.s.client.Do(req)
  9380. }
  9381. // Do executes the "compute.backendServices.get" call.
  9382. // Exactly one of *BackendService or error will be non-nil. Any non-2xx
  9383. // status code is an error. Response headers are in either
  9384. // *BackendService.ServerResponse.Header or (if a response was returned
  9385. // at all) in error.(*googleapi.Error).Header. Use
  9386. // googleapi.IsNotModified to check whether the returned error was
  9387. // because http.StatusNotModified was returned.
  9388. func (c *BackendServicesGetCall) Do(opts ...googleapi.CallOption) (*BackendService, error) {
  9389. gensupport.SetOptions(c.urlParams_, opts...)
  9390. res, err := c.doRequest("json")
  9391. if res != nil && res.StatusCode == http.StatusNotModified {
  9392. if res.Body != nil {
  9393. res.Body.Close()
  9394. }
  9395. return nil, &googleapi.Error{
  9396. Code: res.StatusCode,
  9397. Header: res.Header,
  9398. }
  9399. }
  9400. if err != nil {
  9401. return nil, err
  9402. }
  9403. defer googleapi.CloseBody(res)
  9404. if err := googleapi.CheckResponse(res); err != nil {
  9405. return nil, err
  9406. }
  9407. ret := &BackendService{
  9408. ServerResponse: googleapi.ServerResponse{
  9409. Header: res.Header,
  9410. HTTPStatusCode: res.StatusCode,
  9411. },
  9412. }
  9413. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9414. return nil, err
  9415. }
  9416. return ret, nil
  9417. // {
  9418. // "description": "Returns the specified BackendService resource.",
  9419. // "httpMethod": "GET",
  9420. // "id": "compute.backendServices.get",
  9421. // "parameterOrder": [
  9422. // "project",
  9423. // "backendService"
  9424. // ],
  9425. // "parameters": {
  9426. // "backendService": {
  9427. // "description": "Name of the BackendService resource to return.",
  9428. // "location": "path",
  9429. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  9430. // "required": true,
  9431. // "type": "string"
  9432. // },
  9433. // "project": {
  9434. // "description": "Project ID for this request.",
  9435. // "location": "path",
  9436. // "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])?))",
  9437. // "required": true,
  9438. // "type": "string"
  9439. // }
  9440. // },
  9441. // "path": "{project}/global/backendServices/{backendService}",
  9442. // "response": {
  9443. // "$ref": "BackendService"
  9444. // },
  9445. // "scopes": [
  9446. // "https://www.googleapis.com/auth/cloud-platform",
  9447. // "https://www.googleapis.com/auth/compute",
  9448. // "https://www.googleapis.com/auth/compute.readonly"
  9449. // ]
  9450. // }
  9451. }
  9452. // method id "compute.backendServices.getHealth":
  9453. type BackendServicesGetHealthCall struct {
  9454. s *Service
  9455. project string
  9456. backendService string
  9457. resourcegroupreference *ResourceGroupReference
  9458. urlParams_ gensupport.URLParams
  9459. ctx_ context.Context
  9460. }
  9461. // GetHealth: Gets the most recent health check results for this
  9462. // BackendService.
  9463. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/getHealth
  9464. func (r *BackendServicesService) GetHealth(project string, backendService string, resourcegroupreference *ResourceGroupReference) *BackendServicesGetHealthCall {
  9465. c := &BackendServicesGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9466. c.project = project
  9467. c.backendService = backendService
  9468. c.resourcegroupreference = resourcegroupreference
  9469. return c
  9470. }
  9471. // Fields allows partial responses to be retrieved. See
  9472. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9473. // for more information.
  9474. func (c *BackendServicesGetHealthCall) Fields(s ...googleapi.Field) *BackendServicesGetHealthCall {
  9475. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9476. return c
  9477. }
  9478. // Context sets the context to be used in this call's Do method. Any
  9479. // pending HTTP request will be aborted if the provided context is
  9480. // canceled.
  9481. func (c *BackendServicesGetHealthCall) Context(ctx context.Context) *BackendServicesGetHealthCall {
  9482. c.ctx_ = ctx
  9483. return c
  9484. }
  9485. func (c *BackendServicesGetHealthCall) doRequest(alt string) (*http.Response, error) {
  9486. var body io.Reader = nil
  9487. body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcegroupreference)
  9488. if err != nil {
  9489. return nil, err
  9490. }
  9491. ctype := "application/json"
  9492. c.urlParams_.Set("alt", alt)
  9493. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}/getHealth")
  9494. urls += "?" + c.urlParams_.Encode()
  9495. req, _ := http.NewRequest("POST", urls, body)
  9496. googleapi.Expand(req.URL, map[string]string{
  9497. "project": c.project,
  9498. "backendService": c.backendService,
  9499. })
  9500. req.Header.Set("Content-Type", ctype)
  9501. req.Header.Set("User-Agent", c.s.userAgent())
  9502. if c.ctx_ != nil {
  9503. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9504. }
  9505. return c.s.client.Do(req)
  9506. }
  9507. // Do executes the "compute.backendServices.getHealth" call.
  9508. // Exactly one of *BackendServiceGroupHealth or error will be non-nil.
  9509. // Any non-2xx status code is an error. Response headers are in either
  9510. // *BackendServiceGroupHealth.ServerResponse.Header or (if a response
  9511. // was returned at all) in error.(*googleapi.Error).Header. Use
  9512. // googleapi.IsNotModified to check whether the returned error was
  9513. // because http.StatusNotModified was returned.
  9514. func (c *BackendServicesGetHealthCall) Do(opts ...googleapi.CallOption) (*BackendServiceGroupHealth, error) {
  9515. gensupport.SetOptions(c.urlParams_, opts...)
  9516. res, err := c.doRequest("json")
  9517. if res != nil && res.StatusCode == http.StatusNotModified {
  9518. if res.Body != nil {
  9519. res.Body.Close()
  9520. }
  9521. return nil, &googleapi.Error{
  9522. Code: res.StatusCode,
  9523. Header: res.Header,
  9524. }
  9525. }
  9526. if err != nil {
  9527. return nil, err
  9528. }
  9529. defer googleapi.CloseBody(res)
  9530. if err := googleapi.CheckResponse(res); err != nil {
  9531. return nil, err
  9532. }
  9533. ret := &BackendServiceGroupHealth{
  9534. ServerResponse: googleapi.ServerResponse{
  9535. Header: res.Header,
  9536. HTTPStatusCode: res.StatusCode,
  9537. },
  9538. }
  9539. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9540. return nil, err
  9541. }
  9542. return ret, nil
  9543. // {
  9544. // "description": "Gets the most recent health check results for this BackendService.",
  9545. // "httpMethod": "POST",
  9546. // "id": "compute.backendServices.getHealth",
  9547. // "parameterOrder": [
  9548. // "project",
  9549. // "backendService"
  9550. // ],
  9551. // "parameters": {
  9552. // "backendService": {
  9553. // "description": "Name of the BackendService resource to which the queried instance belongs.",
  9554. // "location": "path",
  9555. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  9556. // "required": true,
  9557. // "type": "string"
  9558. // },
  9559. // "project": {
  9560. // "location": "path",
  9561. // "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])?))",
  9562. // "required": true,
  9563. // "type": "string"
  9564. // }
  9565. // },
  9566. // "path": "{project}/global/backendServices/{backendService}/getHealth",
  9567. // "request": {
  9568. // "$ref": "ResourceGroupReference"
  9569. // },
  9570. // "response": {
  9571. // "$ref": "BackendServiceGroupHealth"
  9572. // },
  9573. // "scopes": [
  9574. // "https://www.googleapis.com/auth/cloud-platform",
  9575. // "https://www.googleapis.com/auth/compute",
  9576. // "https://www.googleapis.com/auth/compute.readonly"
  9577. // ]
  9578. // }
  9579. }
  9580. // method id "compute.backendServices.insert":
  9581. type BackendServicesInsertCall struct {
  9582. s *Service
  9583. project string
  9584. backendservice *BackendService
  9585. urlParams_ gensupport.URLParams
  9586. ctx_ context.Context
  9587. }
  9588. // Insert: Creates a BackendService resource in the specified project
  9589. // using the data included in the request. There are several
  9590. // restrictions and guidelines to keep in mind when creating a backend
  9591. // service. Read Restrictions and Guidelines for more information.
  9592. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/insert
  9593. func (r *BackendServicesService) Insert(project string, backendservice *BackendService) *BackendServicesInsertCall {
  9594. c := &BackendServicesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9595. c.project = project
  9596. c.backendservice = backendservice
  9597. return c
  9598. }
  9599. // Fields allows partial responses to be retrieved. See
  9600. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9601. // for more information.
  9602. func (c *BackendServicesInsertCall) Fields(s ...googleapi.Field) *BackendServicesInsertCall {
  9603. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9604. return c
  9605. }
  9606. // Context sets the context to be used in this call's Do method. Any
  9607. // pending HTTP request will be aborted if the provided context is
  9608. // canceled.
  9609. func (c *BackendServicesInsertCall) Context(ctx context.Context) *BackendServicesInsertCall {
  9610. c.ctx_ = ctx
  9611. return c
  9612. }
  9613. func (c *BackendServicesInsertCall) doRequest(alt string) (*http.Response, error) {
  9614. var body io.Reader = nil
  9615. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  9616. if err != nil {
  9617. return nil, err
  9618. }
  9619. ctype := "application/json"
  9620. c.urlParams_.Set("alt", alt)
  9621. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices")
  9622. urls += "?" + c.urlParams_.Encode()
  9623. req, _ := http.NewRequest("POST", urls, body)
  9624. googleapi.Expand(req.URL, map[string]string{
  9625. "project": c.project,
  9626. })
  9627. req.Header.Set("Content-Type", ctype)
  9628. req.Header.Set("User-Agent", c.s.userAgent())
  9629. if c.ctx_ != nil {
  9630. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9631. }
  9632. return c.s.client.Do(req)
  9633. }
  9634. // Do executes the "compute.backendServices.insert" call.
  9635. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  9636. // status code is an error. Response headers are in either
  9637. // *Operation.ServerResponse.Header or (if a response was returned at
  9638. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9639. // to check whether the returned error was because
  9640. // http.StatusNotModified was returned.
  9641. func (c *BackendServicesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  9642. gensupport.SetOptions(c.urlParams_, opts...)
  9643. res, err := c.doRequest("json")
  9644. if res != nil && res.StatusCode == http.StatusNotModified {
  9645. if res.Body != nil {
  9646. res.Body.Close()
  9647. }
  9648. return nil, &googleapi.Error{
  9649. Code: res.StatusCode,
  9650. Header: res.Header,
  9651. }
  9652. }
  9653. if err != nil {
  9654. return nil, err
  9655. }
  9656. defer googleapi.CloseBody(res)
  9657. if err := googleapi.CheckResponse(res); err != nil {
  9658. return nil, err
  9659. }
  9660. ret := &Operation{
  9661. ServerResponse: googleapi.ServerResponse{
  9662. Header: res.Header,
  9663. HTTPStatusCode: res.StatusCode,
  9664. },
  9665. }
  9666. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9667. return nil, err
  9668. }
  9669. return ret, nil
  9670. // {
  9671. // "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.",
  9672. // "httpMethod": "POST",
  9673. // "id": "compute.backendServices.insert",
  9674. // "parameterOrder": [
  9675. // "project"
  9676. // ],
  9677. // "parameters": {
  9678. // "project": {
  9679. // "description": "Project ID for this request.",
  9680. // "location": "path",
  9681. // "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])?))",
  9682. // "required": true,
  9683. // "type": "string"
  9684. // }
  9685. // },
  9686. // "path": "{project}/global/backendServices",
  9687. // "request": {
  9688. // "$ref": "BackendService"
  9689. // },
  9690. // "response": {
  9691. // "$ref": "Operation"
  9692. // },
  9693. // "scopes": [
  9694. // "https://www.googleapis.com/auth/cloud-platform",
  9695. // "https://www.googleapis.com/auth/compute"
  9696. // ]
  9697. // }
  9698. }
  9699. // method id "compute.backendServices.list":
  9700. type BackendServicesListCall struct {
  9701. s *Service
  9702. project string
  9703. urlParams_ gensupport.URLParams
  9704. ifNoneMatch_ string
  9705. ctx_ context.Context
  9706. }
  9707. // List: Retrieves the list of BackendService resources available to the
  9708. // specified project.
  9709. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/list
  9710. func (r *BackendServicesService) List(project string) *BackendServicesListCall {
  9711. c := &BackendServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9712. c.project = project
  9713. return c
  9714. }
  9715. // Filter sets the optional parameter "filter": Sets a filter expression
  9716. // for filtering listed resources, in the form filter={expression}. Your
  9717. // {expression} must be in the format: field_name comparison_string
  9718. // literal_string.
  9719. //
  9720. // The field_name is the name of the field you want to compare. Only
  9721. // atomic field types are supported (string, number, boolean). The
  9722. // comparison_string must be either eq (equals) or ne (not equals). The
  9723. // literal_string is the string value to filter to. The literal value
  9724. // must be valid for the type of field you are filtering by (string,
  9725. // number, boolean). For string fields, the literal value is interpreted
  9726. // as a regular expression using RE2 syntax. The literal value must
  9727. // match the entire field.
  9728. //
  9729. // For example, filter=name ne example-instance.
  9730. //
  9731. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  9732. // you can also filter on nested fields. For example, you could filter
  9733. // on instances that have set the scheduling.automaticRestart field to
  9734. // true. In particular, use filtering on nested fields to take advantage
  9735. // of instance labels to organize and filter results based on label
  9736. // values.
  9737. //
  9738. // The Beta API also supports filtering on multiple expressions by
  9739. // providing each separate expression within parentheses. For example,
  9740. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  9741. // Multiple expressions are treated as AND expressions meaning that
  9742. // resources must match all expressions to pass the filters.
  9743. func (c *BackendServicesListCall) Filter(filter string) *BackendServicesListCall {
  9744. c.urlParams_.Set("filter", filter)
  9745. return c
  9746. }
  9747. // MaxResults sets the optional parameter "maxResults": The maximum
  9748. // number of results per page that Compute Engine should return. If the
  9749. // number of available results is larger than maxResults, Compute Engine
  9750. // returns a nextPageToken that can be used to get the next page of
  9751. // results in subsequent list requests.
  9752. func (c *BackendServicesListCall) MaxResults(maxResults int64) *BackendServicesListCall {
  9753. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  9754. return c
  9755. }
  9756. // PageToken sets the optional parameter "pageToken": Specifies a page
  9757. // token to use. Set pageToken to the nextPageToken returned by a
  9758. // previous list request to get the next page of results.
  9759. func (c *BackendServicesListCall) PageToken(pageToken string) *BackendServicesListCall {
  9760. c.urlParams_.Set("pageToken", pageToken)
  9761. return c
  9762. }
  9763. // Fields allows partial responses to be retrieved. See
  9764. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9765. // for more information.
  9766. func (c *BackendServicesListCall) Fields(s ...googleapi.Field) *BackendServicesListCall {
  9767. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9768. return c
  9769. }
  9770. // IfNoneMatch sets the optional parameter which makes the operation
  9771. // fail if the object's ETag matches the given value. This is useful for
  9772. // getting updates only after the object has changed since the last
  9773. // request. Use googleapi.IsNotModified to check whether the response
  9774. // error from Do is the result of In-None-Match.
  9775. func (c *BackendServicesListCall) IfNoneMatch(entityTag string) *BackendServicesListCall {
  9776. c.ifNoneMatch_ = entityTag
  9777. return c
  9778. }
  9779. // Context sets the context to be used in this call's Do method. Any
  9780. // pending HTTP request will be aborted if the provided context is
  9781. // canceled.
  9782. func (c *BackendServicesListCall) Context(ctx context.Context) *BackendServicesListCall {
  9783. c.ctx_ = ctx
  9784. return c
  9785. }
  9786. func (c *BackendServicesListCall) doRequest(alt string) (*http.Response, error) {
  9787. var body io.Reader = nil
  9788. c.urlParams_.Set("alt", alt)
  9789. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices")
  9790. urls += "?" + c.urlParams_.Encode()
  9791. req, _ := http.NewRequest("GET", urls, body)
  9792. googleapi.Expand(req.URL, map[string]string{
  9793. "project": c.project,
  9794. })
  9795. req.Header.Set("User-Agent", c.s.userAgent())
  9796. if c.ifNoneMatch_ != "" {
  9797. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  9798. }
  9799. if c.ctx_ != nil {
  9800. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9801. }
  9802. return c.s.client.Do(req)
  9803. }
  9804. // Do executes the "compute.backendServices.list" call.
  9805. // Exactly one of *BackendServiceList or error will be non-nil. Any
  9806. // non-2xx status code is an error. Response headers are in either
  9807. // *BackendServiceList.ServerResponse.Header or (if a response was
  9808. // returned at all) in error.(*googleapi.Error).Header. Use
  9809. // googleapi.IsNotModified to check whether the returned error was
  9810. // because http.StatusNotModified was returned.
  9811. func (c *BackendServicesListCall) Do(opts ...googleapi.CallOption) (*BackendServiceList, error) {
  9812. gensupport.SetOptions(c.urlParams_, opts...)
  9813. res, err := c.doRequest("json")
  9814. if res != nil && res.StatusCode == http.StatusNotModified {
  9815. if res.Body != nil {
  9816. res.Body.Close()
  9817. }
  9818. return nil, &googleapi.Error{
  9819. Code: res.StatusCode,
  9820. Header: res.Header,
  9821. }
  9822. }
  9823. if err != nil {
  9824. return nil, err
  9825. }
  9826. defer googleapi.CloseBody(res)
  9827. if err := googleapi.CheckResponse(res); err != nil {
  9828. return nil, err
  9829. }
  9830. ret := &BackendServiceList{
  9831. ServerResponse: googleapi.ServerResponse{
  9832. Header: res.Header,
  9833. HTTPStatusCode: res.StatusCode,
  9834. },
  9835. }
  9836. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9837. return nil, err
  9838. }
  9839. return ret, nil
  9840. // {
  9841. // "description": "Retrieves the list of BackendService resources available to the specified project.",
  9842. // "httpMethod": "GET",
  9843. // "id": "compute.backendServices.list",
  9844. // "parameterOrder": [
  9845. // "project"
  9846. // ],
  9847. // "parameters": {
  9848. // "filter": {
  9849. // "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.",
  9850. // "location": "query",
  9851. // "type": "string"
  9852. // },
  9853. // "maxResults": {
  9854. // "default": "500",
  9855. // "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.",
  9856. // "format": "uint32",
  9857. // "location": "query",
  9858. // "maximum": "500",
  9859. // "minimum": "0",
  9860. // "type": "integer"
  9861. // },
  9862. // "pageToken": {
  9863. // "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.",
  9864. // "location": "query",
  9865. // "type": "string"
  9866. // },
  9867. // "project": {
  9868. // "description": "Project ID for this request.",
  9869. // "location": "path",
  9870. // "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])?))",
  9871. // "required": true,
  9872. // "type": "string"
  9873. // }
  9874. // },
  9875. // "path": "{project}/global/backendServices",
  9876. // "response": {
  9877. // "$ref": "BackendServiceList"
  9878. // },
  9879. // "scopes": [
  9880. // "https://www.googleapis.com/auth/cloud-platform",
  9881. // "https://www.googleapis.com/auth/compute",
  9882. // "https://www.googleapis.com/auth/compute.readonly"
  9883. // ]
  9884. // }
  9885. }
  9886. // Pages invokes f for each page of results.
  9887. // A non-nil error returned from f will halt the iteration.
  9888. // The provided context supersedes any context provided to the Context method.
  9889. func (c *BackendServicesListCall) Pages(ctx context.Context, f func(*BackendServiceList) error) error {
  9890. c.ctx_ = ctx
  9891. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  9892. for {
  9893. x, err := c.Do()
  9894. if err != nil {
  9895. return err
  9896. }
  9897. if err := f(x); err != nil {
  9898. return err
  9899. }
  9900. if x.NextPageToken == "" {
  9901. return nil
  9902. }
  9903. c.PageToken(x.NextPageToken)
  9904. }
  9905. }
  9906. // method id "compute.backendServices.patch":
  9907. type BackendServicesPatchCall struct {
  9908. s *Service
  9909. project string
  9910. backendService string
  9911. backendservice *BackendService
  9912. urlParams_ gensupport.URLParams
  9913. ctx_ context.Context
  9914. }
  9915. // Patch: Updates the entire content of the BackendService resource.
  9916. // There are several restrictions and guidelines to keep in mind when
  9917. // updating a backend service. Read Restrictions and Guidelines for
  9918. // more information. This method supports patch semantics.
  9919. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/patch
  9920. func (r *BackendServicesService) Patch(project string, backendService string, backendservice *BackendService) *BackendServicesPatchCall {
  9921. c := &BackendServicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9922. c.project = project
  9923. c.backendService = backendService
  9924. c.backendservice = backendservice
  9925. return c
  9926. }
  9927. // Fields allows partial responses to be retrieved. See
  9928. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9929. // for more information.
  9930. func (c *BackendServicesPatchCall) Fields(s ...googleapi.Field) *BackendServicesPatchCall {
  9931. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9932. return c
  9933. }
  9934. // Context sets the context to be used in this call's Do method. Any
  9935. // pending HTTP request will be aborted if the provided context is
  9936. // canceled.
  9937. func (c *BackendServicesPatchCall) Context(ctx context.Context) *BackendServicesPatchCall {
  9938. c.ctx_ = ctx
  9939. return c
  9940. }
  9941. func (c *BackendServicesPatchCall) doRequest(alt string) (*http.Response, error) {
  9942. var body io.Reader = nil
  9943. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  9944. if err != nil {
  9945. return nil, err
  9946. }
  9947. ctype := "application/json"
  9948. c.urlParams_.Set("alt", alt)
  9949. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  9950. urls += "?" + c.urlParams_.Encode()
  9951. req, _ := http.NewRequest("PATCH", urls, body)
  9952. googleapi.Expand(req.URL, map[string]string{
  9953. "project": c.project,
  9954. "backendService": c.backendService,
  9955. })
  9956. req.Header.Set("Content-Type", ctype)
  9957. req.Header.Set("User-Agent", c.s.userAgent())
  9958. if c.ctx_ != nil {
  9959. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9960. }
  9961. return c.s.client.Do(req)
  9962. }
  9963. // Do executes the "compute.backendServices.patch" call.
  9964. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  9965. // status code is an error. Response headers are in either
  9966. // *Operation.ServerResponse.Header or (if a response was returned at
  9967. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9968. // to check whether the returned error was because
  9969. // http.StatusNotModified was returned.
  9970. func (c *BackendServicesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  9971. gensupport.SetOptions(c.urlParams_, opts...)
  9972. res, err := c.doRequest("json")
  9973. if res != nil && res.StatusCode == http.StatusNotModified {
  9974. if res.Body != nil {
  9975. res.Body.Close()
  9976. }
  9977. return nil, &googleapi.Error{
  9978. Code: res.StatusCode,
  9979. Header: res.Header,
  9980. }
  9981. }
  9982. if err != nil {
  9983. return nil, err
  9984. }
  9985. defer googleapi.CloseBody(res)
  9986. if err := googleapi.CheckResponse(res); err != nil {
  9987. return nil, err
  9988. }
  9989. ret := &Operation{
  9990. ServerResponse: googleapi.ServerResponse{
  9991. Header: res.Header,
  9992. HTTPStatusCode: res.StatusCode,
  9993. },
  9994. }
  9995. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9996. return nil, err
  9997. }
  9998. return ret, nil
  9999. // {
  10000. // "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.",
  10001. // "httpMethod": "PATCH",
  10002. // "id": "compute.backendServices.patch",
  10003. // "parameterOrder": [
  10004. // "project",
  10005. // "backendService"
  10006. // ],
  10007. // "parameters": {
  10008. // "backendService": {
  10009. // "description": "Name of the BackendService resource to update.",
  10010. // "location": "path",
  10011. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  10012. // "required": true,
  10013. // "type": "string"
  10014. // },
  10015. // "project": {
  10016. // "description": "Project ID for this request.",
  10017. // "location": "path",
  10018. // "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])?))",
  10019. // "required": true,
  10020. // "type": "string"
  10021. // }
  10022. // },
  10023. // "path": "{project}/global/backendServices/{backendService}",
  10024. // "request": {
  10025. // "$ref": "BackendService"
  10026. // },
  10027. // "response": {
  10028. // "$ref": "Operation"
  10029. // },
  10030. // "scopes": [
  10031. // "https://www.googleapis.com/auth/cloud-platform",
  10032. // "https://www.googleapis.com/auth/compute"
  10033. // ]
  10034. // }
  10035. }
  10036. // method id "compute.backendServices.update":
  10037. type BackendServicesUpdateCall struct {
  10038. s *Service
  10039. project string
  10040. backendService string
  10041. backendservice *BackendService
  10042. urlParams_ gensupport.URLParams
  10043. ctx_ context.Context
  10044. }
  10045. // Update: Updates the entire content of the BackendService resource.
  10046. // There are several restrictions and guidelines to keep in mind when
  10047. // updating a backend service. Read Restrictions and Guidelines for
  10048. // more information.
  10049. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/update
  10050. func (r *BackendServicesService) Update(project string, backendService string, backendservice *BackendService) *BackendServicesUpdateCall {
  10051. c := &BackendServicesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10052. c.project = project
  10053. c.backendService = backendService
  10054. c.backendservice = backendservice
  10055. return c
  10056. }
  10057. // Fields allows partial responses to be retrieved. See
  10058. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10059. // for more information.
  10060. func (c *BackendServicesUpdateCall) Fields(s ...googleapi.Field) *BackendServicesUpdateCall {
  10061. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10062. return c
  10063. }
  10064. // Context sets the context to be used in this call's Do method. Any
  10065. // pending HTTP request will be aborted if the provided context is
  10066. // canceled.
  10067. func (c *BackendServicesUpdateCall) Context(ctx context.Context) *BackendServicesUpdateCall {
  10068. c.ctx_ = ctx
  10069. return c
  10070. }
  10071. func (c *BackendServicesUpdateCall) doRequest(alt string) (*http.Response, error) {
  10072. var body io.Reader = nil
  10073. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  10074. if err != nil {
  10075. return nil, err
  10076. }
  10077. ctype := "application/json"
  10078. c.urlParams_.Set("alt", alt)
  10079. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  10080. urls += "?" + c.urlParams_.Encode()
  10081. req, _ := http.NewRequest("PUT", urls, body)
  10082. googleapi.Expand(req.URL, map[string]string{
  10083. "project": c.project,
  10084. "backendService": c.backendService,
  10085. })
  10086. req.Header.Set("Content-Type", ctype)
  10087. req.Header.Set("User-Agent", c.s.userAgent())
  10088. if c.ctx_ != nil {
  10089. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10090. }
  10091. return c.s.client.Do(req)
  10092. }
  10093. // Do executes the "compute.backendServices.update" call.
  10094. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  10095. // status code is an error. Response headers are in either
  10096. // *Operation.ServerResponse.Header or (if a response was returned at
  10097. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10098. // to check whether the returned error was because
  10099. // http.StatusNotModified was returned.
  10100. func (c *BackendServicesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  10101. gensupport.SetOptions(c.urlParams_, opts...)
  10102. res, err := c.doRequest("json")
  10103. if res != nil && res.StatusCode == http.StatusNotModified {
  10104. if res.Body != nil {
  10105. res.Body.Close()
  10106. }
  10107. return nil, &googleapi.Error{
  10108. Code: res.StatusCode,
  10109. Header: res.Header,
  10110. }
  10111. }
  10112. if err != nil {
  10113. return nil, err
  10114. }
  10115. defer googleapi.CloseBody(res)
  10116. if err := googleapi.CheckResponse(res); err != nil {
  10117. return nil, err
  10118. }
  10119. ret := &Operation{
  10120. ServerResponse: googleapi.ServerResponse{
  10121. Header: res.Header,
  10122. HTTPStatusCode: res.StatusCode,
  10123. },
  10124. }
  10125. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  10126. return nil, err
  10127. }
  10128. return ret, nil
  10129. // {
  10130. // "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.",
  10131. // "httpMethod": "PUT",
  10132. // "id": "compute.backendServices.update",
  10133. // "parameterOrder": [
  10134. // "project",
  10135. // "backendService"
  10136. // ],
  10137. // "parameters": {
  10138. // "backendService": {
  10139. // "description": "Name of the BackendService resource to update.",
  10140. // "location": "path",
  10141. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  10142. // "required": true,
  10143. // "type": "string"
  10144. // },
  10145. // "project": {
  10146. // "description": "Project ID for this request.",
  10147. // "location": "path",
  10148. // "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])?))",
  10149. // "required": true,
  10150. // "type": "string"
  10151. // }
  10152. // },
  10153. // "path": "{project}/global/backendServices/{backendService}",
  10154. // "request": {
  10155. // "$ref": "BackendService"
  10156. // },
  10157. // "response": {
  10158. // "$ref": "Operation"
  10159. // },
  10160. // "scopes": [
  10161. // "https://www.googleapis.com/auth/cloud-platform",
  10162. // "https://www.googleapis.com/auth/compute"
  10163. // ]
  10164. // }
  10165. }
  10166. // method id "compute.diskTypes.aggregatedList":
  10167. type DiskTypesAggregatedListCall struct {
  10168. s *Service
  10169. project string
  10170. urlParams_ gensupport.URLParams
  10171. ifNoneMatch_ string
  10172. ctx_ context.Context
  10173. }
  10174. // AggregatedList: Retrieves an aggregated list of disk type resources.
  10175. // For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/aggregatedList
  10176. func (r *DiskTypesService) AggregatedList(project string) *DiskTypesAggregatedListCall {
  10177. c := &DiskTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10178. c.project = project
  10179. return c
  10180. }
  10181. // Filter sets the optional parameter "filter": Sets a filter expression
  10182. // for filtering listed resources, in the form filter={expression}. Your
  10183. // {expression} must be in the format: field_name comparison_string
  10184. // literal_string.
  10185. //
  10186. // The field_name is the name of the field you want to compare. Only
  10187. // atomic field types are supported (string, number, boolean). The
  10188. // comparison_string must be either eq (equals) or ne (not equals). The
  10189. // literal_string is the string value to filter to. The literal value
  10190. // must be valid for the type of field you are filtering by (string,
  10191. // number, boolean). For string fields, the literal value is interpreted
  10192. // as a regular expression using RE2 syntax. The literal value must
  10193. // match the entire field.
  10194. //
  10195. // For example, filter=name ne example-instance.
  10196. //
  10197. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  10198. // you can also filter on nested fields. For example, you could filter
  10199. // on instances that have set the scheduling.automaticRestart field to
  10200. // true. In particular, use filtering on nested fields to take advantage
  10201. // of instance labels to organize and filter results based on label
  10202. // values.
  10203. //
  10204. // The Beta API also supports filtering on multiple expressions by
  10205. // providing each separate expression within parentheses. For example,
  10206. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  10207. // Multiple expressions are treated as AND expressions meaning that
  10208. // resources must match all expressions to pass the filters.
  10209. func (c *DiskTypesAggregatedListCall) Filter(filter string) *DiskTypesAggregatedListCall {
  10210. c.urlParams_.Set("filter", filter)
  10211. return c
  10212. }
  10213. // MaxResults sets the optional parameter "maxResults": The maximum
  10214. // number of results per page that Compute Engine should return. If the
  10215. // number of available results is larger than maxResults, Compute Engine
  10216. // returns a nextPageToken that can be used to get the next page of
  10217. // results in subsequent list requests.
  10218. func (c *DiskTypesAggregatedListCall) MaxResults(maxResults int64) *DiskTypesAggregatedListCall {
  10219. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  10220. return c
  10221. }
  10222. // PageToken sets the optional parameter "pageToken": Specifies a page
  10223. // token to use. Set pageToken to the nextPageToken returned by a
  10224. // previous list request to get the next page of results.
  10225. func (c *DiskTypesAggregatedListCall) PageToken(pageToken string) *DiskTypesAggregatedListCall {
  10226. c.urlParams_.Set("pageToken", pageToken)
  10227. return c
  10228. }
  10229. // Fields allows partial responses to be retrieved. See
  10230. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10231. // for more information.
  10232. func (c *DiskTypesAggregatedListCall) Fields(s ...googleapi.Field) *DiskTypesAggregatedListCall {
  10233. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10234. return c
  10235. }
  10236. // IfNoneMatch sets the optional parameter which makes the operation
  10237. // fail if the object's ETag matches the given value. This is useful for
  10238. // getting updates only after the object has changed since the last
  10239. // request. Use googleapi.IsNotModified to check whether the response
  10240. // error from Do is the result of In-None-Match.
  10241. func (c *DiskTypesAggregatedListCall) IfNoneMatch(entityTag string) *DiskTypesAggregatedListCall {
  10242. c.ifNoneMatch_ = entityTag
  10243. return c
  10244. }
  10245. // Context sets the context to be used in this call's Do method. Any
  10246. // pending HTTP request will be aborted if the provided context is
  10247. // canceled.
  10248. func (c *DiskTypesAggregatedListCall) Context(ctx context.Context) *DiskTypesAggregatedListCall {
  10249. c.ctx_ = ctx
  10250. return c
  10251. }
  10252. func (c *DiskTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  10253. var body io.Reader = nil
  10254. c.urlParams_.Set("alt", alt)
  10255. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/diskTypes")
  10256. urls += "?" + c.urlParams_.Encode()
  10257. req, _ := http.NewRequest("GET", urls, body)
  10258. googleapi.Expand(req.URL, map[string]string{
  10259. "project": c.project,
  10260. })
  10261. req.Header.Set("User-Agent", c.s.userAgent())
  10262. if c.ifNoneMatch_ != "" {
  10263. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  10264. }
  10265. if c.ctx_ != nil {
  10266. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10267. }
  10268. return c.s.client.Do(req)
  10269. }
  10270. // Do executes the "compute.diskTypes.aggregatedList" call.
  10271. // Exactly one of *DiskTypeAggregatedList or error will be non-nil. Any
  10272. // non-2xx status code is an error. Response headers are in either
  10273. // *DiskTypeAggregatedList.ServerResponse.Header or (if a response was
  10274. // returned at all) in error.(*googleapi.Error).Header. Use
  10275. // googleapi.IsNotModified to check whether the returned error was
  10276. // because http.StatusNotModified was returned.
  10277. func (c *DiskTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*DiskTypeAggregatedList, error) {
  10278. gensupport.SetOptions(c.urlParams_, opts...)
  10279. res, err := c.doRequest("json")
  10280. if res != nil && res.StatusCode == http.StatusNotModified {
  10281. if res.Body != nil {
  10282. res.Body.Close()
  10283. }
  10284. return nil, &googleapi.Error{
  10285. Code: res.StatusCode,
  10286. Header: res.Header,
  10287. }
  10288. }
  10289. if err != nil {
  10290. return nil, err
  10291. }
  10292. defer googleapi.CloseBody(res)
  10293. if err := googleapi.CheckResponse(res); err != nil {
  10294. return nil, err
  10295. }
  10296. ret := &DiskTypeAggregatedList{
  10297. ServerResponse: googleapi.ServerResponse{
  10298. Header: res.Header,
  10299. HTTPStatusCode: res.StatusCode,
  10300. },
  10301. }
  10302. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  10303. return nil, err
  10304. }
  10305. return ret, nil
  10306. // {
  10307. // "description": "Retrieves an aggregated list of disk type resources.",
  10308. // "httpMethod": "GET",
  10309. // "id": "compute.diskTypes.aggregatedList",
  10310. // "parameterOrder": [
  10311. // "project"
  10312. // ],
  10313. // "parameters": {
  10314. // "filter": {
  10315. // "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.",
  10316. // "location": "query",
  10317. // "type": "string"
  10318. // },
  10319. // "maxResults": {
  10320. // "default": "500",
  10321. // "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.",
  10322. // "format": "uint32",
  10323. // "location": "query",
  10324. // "maximum": "500",
  10325. // "minimum": "0",
  10326. // "type": "integer"
  10327. // },
  10328. // "pageToken": {
  10329. // "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.",
  10330. // "location": "query",
  10331. // "type": "string"
  10332. // },
  10333. // "project": {
  10334. // "description": "Project ID for this request.",
  10335. // "location": "path",
  10336. // "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])?))",
  10337. // "required": true,
  10338. // "type": "string"
  10339. // }
  10340. // },
  10341. // "path": "{project}/aggregated/diskTypes",
  10342. // "response": {
  10343. // "$ref": "DiskTypeAggregatedList"
  10344. // },
  10345. // "scopes": [
  10346. // "https://www.googleapis.com/auth/cloud-platform",
  10347. // "https://www.googleapis.com/auth/compute",
  10348. // "https://www.googleapis.com/auth/compute.readonly"
  10349. // ]
  10350. // }
  10351. }
  10352. // Pages invokes f for each page of results.
  10353. // A non-nil error returned from f will halt the iteration.
  10354. // The provided context supersedes any context provided to the Context method.
  10355. func (c *DiskTypesAggregatedListCall) Pages(ctx context.Context, f func(*DiskTypeAggregatedList) error) error {
  10356. c.ctx_ = ctx
  10357. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  10358. for {
  10359. x, err := c.Do()
  10360. if err != nil {
  10361. return err
  10362. }
  10363. if err := f(x); err != nil {
  10364. return err
  10365. }
  10366. if x.NextPageToken == "" {
  10367. return nil
  10368. }
  10369. c.PageToken(x.NextPageToken)
  10370. }
  10371. }
  10372. // method id "compute.diskTypes.get":
  10373. type DiskTypesGetCall struct {
  10374. s *Service
  10375. project string
  10376. zone string
  10377. diskType string
  10378. urlParams_ gensupport.URLParams
  10379. ifNoneMatch_ string
  10380. ctx_ context.Context
  10381. }
  10382. // Get: Returns the specified disk type resource.
  10383. // For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/get
  10384. func (r *DiskTypesService) Get(project string, zone string, diskType string) *DiskTypesGetCall {
  10385. c := &DiskTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10386. c.project = project
  10387. c.zone = zone
  10388. c.diskType = diskType
  10389. return c
  10390. }
  10391. // Fields allows partial responses to be retrieved. See
  10392. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10393. // for more information.
  10394. func (c *DiskTypesGetCall) Fields(s ...googleapi.Field) *DiskTypesGetCall {
  10395. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10396. return c
  10397. }
  10398. // IfNoneMatch sets the optional parameter which makes the operation
  10399. // fail if the object's ETag matches the given value. This is useful for
  10400. // getting updates only after the object has changed since the last
  10401. // request. Use googleapi.IsNotModified to check whether the response
  10402. // error from Do is the result of In-None-Match.
  10403. func (c *DiskTypesGetCall) IfNoneMatch(entityTag string) *DiskTypesGetCall {
  10404. c.ifNoneMatch_ = entityTag
  10405. return c
  10406. }
  10407. // Context sets the context to be used in this call's Do method. Any
  10408. // pending HTTP request will be aborted if the provided context is
  10409. // canceled.
  10410. func (c *DiskTypesGetCall) Context(ctx context.Context) *DiskTypesGetCall {
  10411. c.ctx_ = ctx
  10412. return c
  10413. }
  10414. func (c *DiskTypesGetCall) doRequest(alt string) (*http.Response, error) {
  10415. var body io.Reader = nil
  10416. c.urlParams_.Set("alt", alt)
  10417. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/diskTypes/{diskType}")
  10418. urls += "?" + c.urlParams_.Encode()
  10419. req, _ := http.NewRequest("GET", urls, body)
  10420. googleapi.Expand(req.URL, map[string]string{
  10421. "project": c.project,
  10422. "zone": c.zone,
  10423. "diskType": c.diskType,
  10424. })
  10425. req.Header.Set("User-Agent", c.s.userAgent())
  10426. if c.ifNoneMatch_ != "" {
  10427. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  10428. }
  10429. if c.ctx_ != nil {
  10430. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10431. }
  10432. return c.s.client.Do(req)
  10433. }
  10434. // Do executes the "compute.diskTypes.get" call.
  10435. // Exactly one of *DiskType or error will be non-nil. Any non-2xx status
  10436. // code is an error. Response headers are in either
  10437. // *DiskType.ServerResponse.Header or (if a response was returned at
  10438. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10439. // to check whether the returned error was because
  10440. // http.StatusNotModified was returned.
  10441. func (c *DiskTypesGetCall) Do(opts ...googleapi.CallOption) (*DiskType, error) {
  10442. gensupport.SetOptions(c.urlParams_, opts...)
  10443. res, err := c.doRequest("json")
  10444. if res != nil && res.StatusCode == http.StatusNotModified {
  10445. if res.Body != nil {
  10446. res.Body.Close()
  10447. }
  10448. return nil, &googleapi.Error{
  10449. Code: res.StatusCode,
  10450. Header: res.Header,
  10451. }
  10452. }
  10453. if err != nil {
  10454. return nil, err
  10455. }
  10456. defer googleapi.CloseBody(res)
  10457. if err := googleapi.CheckResponse(res); err != nil {
  10458. return nil, err
  10459. }
  10460. ret := &DiskType{
  10461. ServerResponse: googleapi.ServerResponse{
  10462. Header: res.Header,
  10463. HTTPStatusCode: res.StatusCode,
  10464. },
  10465. }
  10466. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  10467. return nil, err
  10468. }
  10469. return ret, nil
  10470. // {
  10471. // "description": "Returns the specified disk type resource.",
  10472. // "httpMethod": "GET",
  10473. // "id": "compute.diskTypes.get",
  10474. // "parameterOrder": [
  10475. // "project",
  10476. // "zone",
  10477. // "diskType"
  10478. // ],
  10479. // "parameters": {
  10480. // "diskType": {
  10481. // "description": "Name of the disk type resource to return.",
  10482. // "location": "path",
  10483. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  10484. // "required": true,
  10485. // "type": "string"
  10486. // },
  10487. // "project": {
  10488. // "description": "Project ID for this request.",
  10489. // "location": "path",
  10490. // "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])?))",
  10491. // "required": true,
  10492. // "type": "string"
  10493. // },
  10494. // "zone": {
  10495. // "description": "The name of the zone for this request.",
  10496. // "location": "path",
  10497. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  10498. // "required": true,
  10499. // "type": "string"
  10500. // }
  10501. // },
  10502. // "path": "{project}/zones/{zone}/diskTypes/{diskType}",
  10503. // "response": {
  10504. // "$ref": "DiskType"
  10505. // },
  10506. // "scopes": [
  10507. // "https://www.googleapis.com/auth/cloud-platform",
  10508. // "https://www.googleapis.com/auth/compute",
  10509. // "https://www.googleapis.com/auth/compute.readonly"
  10510. // ]
  10511. // }
  10512. }
  10513. // method id "compute.diskTypes.list":
  10514. type DiskTypesListCall struct {
  10515. s *Service
  10516. project string
  10517. zone string
  10518. urlParams_ gensupport.URLParams
  10519. ifNoneMatch_ string
  10520. ctx_ context.Context
  10521. }
  10522. // List: Retrieves a list of disk type resources available to the
  10523. // specified project.
  10524. // For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/list
  10525. func (r *DiskTypesService) List(project string, zone string) *DiskTypesListCall {
  10526. c := &DiskTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10527. c.project = project
  10528. c.zone = zone
  10529. return c
  10530. }
  10531. // Filter sets the optional parameter "filter": Sets a filter expression
  10532. // for filtering listed resources, in the form filter={expression}. Your
  10533. // {expression} must be in the format: field_name comparison_string
  10534. // literal_string.
  10535. //
  10536. // The field_name is the name of the field you want to compare. Only
  10537. // atomic field types are supported (string, number, boolean). The
  10538. // comparison_string must be either eq (equals) or ne (not equals). The
  10539. // literal_string is the string value to filter to. The literal value
  10540. // must be valid for the type of field you are filtering by (string,
  10541. // number, boolean). For string fields, the literal value is interpreted
  10542. // as a regular expression using RE2 syntax. The literal value must
  10543. // match the entire field.
  10544. //
  10545. // For example, filter=name ne example-instance.
  10546. //
  10547. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  10548. // you can also filter on nested fields. For example, you could filter
  10549. // on instances that have set the scheduling.automaticRestart field to
  10550. // true. In particular, use filtering on nested fields to take advantage
  10551. // of instance labels to organize and filter results based on label
  10552. // values.
  10553. //
  10554. // The Beta API also supports filtering on multiple expressions by
  10555. // providing each separate expression within parentheses. For example,
  10556. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  10557. // Multiple expressions are treated as AND expressions meaning that
  10558. // resources must match all expressions to pass the filters.
  10559. func (c *DiskTypesListCall) Filter(filter string) *DiskTypesListCall {
  10560. c.urlParams_.Set("filter", filter)
  10561. return c
  10562. }
  10563. // MaxResults sets the optional parameter "maxResults": The maximum
  10564. // number of results per page that Compute Engine should return. If the
  10565. // number of available results is larger than maxResults, Compute Engine
  10566. // returns a nextPageToken that can be used to get the next page of
  10567. // results in subsequent list requests.
  10568. func (c *DiskTypesListCall) MaxResults(maxResults int64) *DiskTypesListCall {
  10569. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  10570. return c
  10571. }
  10572. // PageToken sets the optional parameter "pageToken": Specifies a page
  10573. // token to use. Set pageToken to the nextPageToken returned by a
  10574. // previous list request to get the next page of results.
  10575. func (c *DiskTypesListCall) PageToken(pageToken string) *DiskTypesListCall {
  10576. c.urlParams_.Set("pageToken", pageToken)
  10577. return c
  10578. }
  10579. // Fields allows partial responses to be retrieved. See
  10580. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10581. // for more information.
  10582. func (c *DiskTypesListCall) Fields(s ...googleapi.Field) *DiskTypesListCall {
  10583. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10584. return c
  10585. }
  10586. // IfNoneMatch sets the optional parameter which makes the operation
  10587. // fail if the object's ETag matches the given value. This is useful for
  10588. // getting updates only after the object has changed since the last
  10589. // request. Use googleapi.IsNotModified to check whether the response
  10590. // error from Do is the result of In-None-Match.
  10591. func (c *DiskTypesListCall) IfNoneMatch(entityTag string) *DiskTypesListCall {
  10592. c.ifNoneMatch_ = entityTag
  10593. return c
  10594. }
  10595. // Context sets the context to be used in this call's Do method. Any
  10596. // pending HTTP request will be aborted if the provided context is
  10597. // canceled.
  10598. func (c *DiskTypesListCall) Context(ctx context.Context) *DiskTypesListCall {
  10599. c.ctx_ = ctx
  10600. return c
  10601. }
  10602. func (c *DiskTypesListCall) doRequest(alt string) (*http.Response, error) {
  10603. var body io.Reader = nil
  10604. c.urlParams_.Set("alt", alt)
  10605. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/diskTypes")
  10606. urls += "?" + c.urlParams_.Encode()
  10607. req, _ := http.NewRequest("GET", urls, body)
  10608. googleapi.Expand(req.URL, map[string]string{
  10609. "project": c.project,
  10610. "zone": c.zone,
  10611. })
  10612. req.Header.Set("User-Agent", c.s.userAgent())
  10613. if c.ifNoneMatch_ != "" {
  10614. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  10615. }
  10616. if c.ctx_ != nil {
  10617. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10618. }
  10619. return c.s.client.Do(req)
  10620. }
  10621. // Do executes the "compute.diskTypes.list" call.
  10622. // Exactly one of *DiskTypeList or error will be non-nil. Any non-2xx
  10623. // status code is an error. Response headers are in either
  10624. // *DiskTypeList.ServerResponse.Header or (if a response was returned at
  10625. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10626. // to check whether the returned error was because
  10627. // http.StatusNotModified was returned.
  10628. func (c *DiskTypesListCall) Do(opts ...googleapi.CallOption) (*DiskTypeList, error) {
  10629. gensupport.SetOptions(c.urlParams_, opts...)
  10630. res, err := c.doRequest("json")
  10631. if res != nil && res.StatusCode == http.StatusNotModified {
  10632. if res.Body != nil {
  10633. res.Body.Close()
  10634. }
  10635. return nil, &googleapi.Error{
  10636. Code: res.StatusCode,
  10637. Header: res.Header,
  10638. }
  10639. }
  10640. if err != nil {
  10641. return nil, err
  10642. }
  10643. defer googleapi.CloseBody(res)
  10644. if err := googleapi.CheckResponse(res); err != nil {
  10645. return nil, err
  10646. }
  10647. ret := &DiskTypeList{
  10648. ServerResponse: googleapi.ServerResponse{
  10649. Header: res.Header,
  10650. HTTPStatusCode: res.StatusCode,
  10651. },
  10652. }
  10653. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  10654. return nil, err
  10655. }
  10656. return ret, nil
  10657. // {
  10658. // "description": "Retrieves a list of disk type resources available to the specified project.",
  10659. // "httpMethod": "GET",
  10660. // "id": "compute.diskTypes.list",
  10661. // "parameterOrder": [
  10662. // "project",
  10663. // "zone"
  10664. // ],
  10665. // "parameters": {
  10666. // "filter": {
  10667. // "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.",
  10668. // "location": "query",
  10669. // "type": "string"
  10670. // },
  10671. // "maxResults": {
  10672. // "default": "500",
  10673. // "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.",
  10674. // "format": "uint32",
  10675. // "location": "query",
  10676. // "maximum": "500",
  10677. // "minimum": "0",
  10678. // "type": "integer"
  10679. // },
  10680. // "pageToken": {
  10681. // "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.",
  10682. // "location": "query",
  10683. // "type": "string"
  10684. // },
  10685. // "project": {
  10686. // "description": "Project ID for this request.",
  10687. // "location": "path",
  10688. // "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])?))",
  10689. // "required": true,
  10690. // "type": "string"
  10691. // },
  10692. // "zone": {
  10693. // "description": "The name of the zone for this request.",
  10694. // "location": "path",
  10695. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  10696. // "required": true,
  10697. // "type": "string"
  10698. // }
  10699. // },
  10700. // "path": "{project}/zones/{zone}/diskTypes",
  10701. // "response": {
  10702. // "$ref": "DiskTypeList"
  10703. // },
  10704. // "scopes": [
  10705. // "https://www.googleapis.com/auth/cloud-platform",
  10706. // "https://www.googleapis.com/auth/compute",
  10707. // "https://www.googleapis.com/auth/compute.readonly"
  10708. // ]
  10709. // }
  10710. }
  10711. // Pages invokes f for each page of results.
  10712. // A non-nil error returned from f will halt the iteration.
  10713. // The provided context supersedes any context provided to the Context method.
  10714. func (c *DiskTypesListCall) Pages(ctx context.Context, f func(*DiskTypeList) error) error {
  10715. c.ctx_ = ctx
  10716. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  10717. for {
  10718. x, err := c.Do()
  10719. if err != nil {
  10720. return err
  10721. }
  10722. if err := f(x); err != nil {
  10723. return err
  10724. }
  10725. if x.NextPageToken == "" {
  10726. return nil
  10727. }
  10728. c.PageToken(x.NextPageToken)
  10729. }
  10730. }
  10731. // method id "compute.disks.aggregatedList":
  10732. type DisksAggregatedListCall struct {
  10733. s *Service
  10734. project string
  10735. urlParams_ gensupport.URLParams
  10736. ifNoneMatch_ string
  10737. ctx_ context.Context
  10738. }
  10739. // AggregatedList: Retrieves an aggregated list of persistent disks.
  10740. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/aggregatedList
  10741. func (r *DisksService) AggregatedList(project string) *DisksAggregatedListCall {
  10742. c := &DisksAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10743. c.project = project
  10744. return c
  10745. }
  10746. // Filter sets the optional parameter "filter": Sets a filter expression
  10747. // for filtering listed resources, in the form filter={expression}. Your
  10748. // {expression} must be in the format: field_name comparison_string
  10749. // literal_string.
  10750. //
  10751. // The field_name is the name of the field you want to compare. Only
  10752. // atomic field types are supported (string, number, boolean). The
  10753. // comparison_string must be either eq (equals) or ne (not equals). The
  10754. // literal_string is the string value to filter to. The literal value
  10755. // must be valid for the type of field you are filtering by (string,
  10756. // number, boolean). For string fields, the literal value is interpreted
  10757. // as a regular expression using RE2 syntax. The literal value must
  10758. // match the entire field.
  10759. //
  10760. // For example, filter=name ne example-instance.
  10761. //
  10762. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  10763. // you can also filter on nested fields. For example, you could filter
  10764. // on instances that have set the scheduling.automaticRestart field to
  10765. // true. In particular, use filtering on nested fields to take advantage
  10766. // of instance labels to organize and filter results based on label
  10767. // values.
  10768. //
  10769. // The Beta API also supports filtering on multiple expressions by
  10770. // providing each separate expression within parentheses. For example,
  10771. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  10772. // Multiple expressions are treated as AND expressions meaning that
  10773. // resources must match all expressions to pass the filters.
  10774. func (c *DisksAggregatedListCall) Filter(filter string) *DisksAggregatedListCall {
  10775. c.urlParams_.Set("filter", filter)
  10776. return c
  10777. }
  10778. // MaxResults sets the optional parameter "maxResults": The maximum
  10779. // number of results per page that Compute Engine should return. If the
  10780. // number of available results is larger than maxResults, Compute Engine
  10781. // returns a nextPageToken that can be used to get the next page of
  10782. // results in subsequent list requests.
  10783. func (c *DisksAggregatedListCall) MaxResults(maxResults int64) *DisksAggregatedListCall {
  10784. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  10785. return c
  10786. }
  10787. // PageToken sets the optional parameter "pageToken": Specifies a page
  10788. // token to use. Set pageToken to the nextPageToken returned by a
  10789. // previous list request to get the next page of results.
  10790. func (c *DisksAggregatedListCall) PageToken(pageToken string) *DisksAggregatedListCall {
  10791. c.urlParams_.Set("pageToken", pageToken)
  10792. return c
  10793. }
  10794. // Fields allows partial responses to be retrieved. See
  10795. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10796. // for more information.
  10797. func (c *DisksAggregatedListCall) Fields(s ...googleapi.Field) *DisksAggregatedListCall {
  10798. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10799. return c
  10800. }
  10801. // IfNoneMatch sets the optional parameter which makes the operation
  10802. // fail if the object's ETag matches the given value. This is useful for
  10803. // getting updates only after the object has changed since the last
  10804. // request. Use googleapi.IsNotModified to check whether the response
  10805. // error from Do is the result of In-None-Match.
  10806. func (c *DisksAggregatedListCall) IfNoneMatch(entityTag string) *DisksAggregatedListCall {
  10807. c.ifNoneMatch_ = entityTag
  10808. return c
  10809. }
  10810. // Context sets the context to be used in this call's Do method. Any
  10811. // pending HTTP request will be aborted if the provided context is
  10812. // canceled.
  10813. func (c *DisksAggregatedListCall) Context(ctx context.Context) *DisksAggregatedListCall {
  10814. c.ctx_ = ctx
  10815. return c
  10816. }
  10817. func (c *DisksAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  10818. var body io.Reader = nil
  10819. c.urlParams_.Set("alt", alt)
  10820. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/disks")
  10821. urls += "?" + c.urlParams_.Encode()
  10822. req, _ := http.NewRequest("GET", urls, body)
  10823. googleapi.Expand(req.URL, map[string]string{
  10824. "project": c.project,
  10825. })
  10826. req.Header.Set("User-Agent", c.s.userAgent())
  10827. if c.ifNoneMatch_ != "" {
  10828. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  10829. }
  10830. if c.ctx_ != nil {
  10831. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10832. }
  10833. return c.s.client.Do(req)
  10834. }
  10835. // Do executes the "compute.disks.aggregatedList" call.
  10836. // Exactly one of *DiskAggregatedList or error will be non-nil. Any
  10837. // non-2xx status code is an error. Response headers are in either
  10838. // *DiskAggregatedList.ServerResponse.Header or (if a response was
  10839. // returned at all) in error.(*googleapi.Error).Header. Use
  10840. // googleapi.IsNotModified to check whether the returned error was
  10841. // because http.StatusNotModified was returned.
  10842. func (c *DisksAggregatedListCall) Do(opts ...googleapi.CallOption) (*DiskAggregatedList, error) {
  10843. gensupport.SetOptions(c.urlParams_, opts...)
  10844. res, err := c.doRequest("json")
  10845. if res != nil && res.StatusCode == http.StatusNotModified {
  10846. if res.Body != nil {
  10847. res.Body.Close()
  10848. }
  10849. return nil, &googleapi.Error{
  10850. Code: res.StatusCode,
  10851. Header: res.Header,
  10852. }
  10853. }
  10854. if err != nil {
  10855. return nil, err
  10856. }
  10857. defer googleapi.CloseBody(res)
  10858. if err := googleapi.CheckResponse(res); err != nil {
  10859. return nil, err
  10860. }
  10861. ret := &DiskAggregatedList{
  10862. ServerResponse: googleapi.ServerResponse{
  10863. Header: res.Header,
  10864. HTTPStatusCode: res.StatusCode,
  10865. },
  10866. }
  10867. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  10868. return nil, err
  10869. }
  10870. return ret, nil
  10871. // {
  10872. // "description": "Retrieves an aggregated list of persistent disks.",
  10873. // "httpMethod": "GET",
  10874. // "id": "compute.disks.aggregatedList",
  10875. // "parameterOrder": [
  10876. // "project"
  10877. // ],
  10878. // "parameters": {
  10879. // "filter": {
  10880. // "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.",
  10881. // "location": "query",
  10882. // "type": "string"
  10883. // },
  10884. // "maxResults": {
  10885. // "default": "500",
  10886. // "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.",
  10887. // "format": "uint32",
  10888. // "location": "query",
  10889. // "maximum": "500",
  10890. // "minimum": "0",
  10891. // "type": "integer"
  10892. // },
  10893. // "pageToken": {
  10894. // "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.",
  10895. // "location": "query",
  10896. // "type": "string"
  10897. // },
  10898. // "project": {
  10899. // "description": "Project ID for this request.",
  10900. // "location": "path",
  10901. // "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])?))",
  10902. // "required": true,
  10903. // "type": "string"
  10904. // }
  10905. // },
  10906. // "path": "{project}/aggregated/disks",
  10907. // "response": {
  10908. // "$ref": "DiskAggregatedList"
  10909. // },
  10910. // "scopes": [
  10911. // "https://www.googleapis.com/auth/cloud-platform",
  10912. // "https://www.googleapis.com/auth/compute",
  10913. // "https://www.googleapis.com/auth/compute.readonly"
  10914. // ]
  10915. // }
  10916. }
  10917. // Pages invokes f for each page of results.
  10918. // A non-nil error returned from f will halt the iteration.
  10919. // The provided context supersedes any context provided to the Context method.
  10920. func (c *DisksAggregatedListCall) Pages(ctx context.Context, f func(*DiskAggregatedList) error) error {
  10921. c.ctx_ = ctx
  10922. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  10923. for {
  10924. x, err := c.Do()
  10925. if err != nil {
  10926. return err
  10927. }
  10928. if err := f(x); err != nil {
  10929. return err
  10930. }
  10931. if x.NextPageToken == "" {
  10932. return nil
  10933. }
  10934. c.PageToken(x.NextPageToken)
  10935. }
  10936. }
  10937. // method id "compute.disks.createSnapshot":
  10938. type DisksCreateSnapshotCall struct {
  10939. s *Service
  10940. project string
  10941. zone string
  10942. disk string
  10943. snapshot *Snapshot
  10944. urlParams_ gensupport.URLParams
  10945. ctx_ context.Context
  10946. }
  10947. // CreateSnapshot: Creates a snapshot of a specified persistent disk.
  10948. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/createSnapshot
  10949. func (r *DisksService) CreateSnapshot(project string, zone string, disk string, snapshot *Snapshot) *DisksCreateSnapshotCall {
  10950. c := &DisksCreateSnapshotCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10951. c.project = project
  10952. c.zone = zone
  10953. c.disk = disk
  10954. c.snapshot = snapshot
  10955. return c
  10956. }
  10957. // Fields allows partial responses to be retrieved. See
  10958. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10959. // for more information.
  10960. func (c *DisksCreateSnapshotCall) Fields(s ...googleapi.Field) *DisksCreateSnapshotCall {
  10961. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10962. return c
  10963. }
  10964. // Context sets the context to be used in this call's Do method. Any
  10965. // pending HTTP request will be aborted if the provided context is
  10966. // canceled.
  10967. func (c *DisksCreateSnapshotCall) Context(ctx context.Context) *DisksCreateSnapshotCall {
  10968. c.ctx_ = ctx
  10969. return c
  10970. }
  10971. func (c *DisksCreateSnapshotCall) doRequest(alt string) (*http.Response, error) {
  10972. var body io.Reader = nil
  10973. body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot)
  10974. if err != nil {
  10975. return nil, err
  10976. }
  10977. ctype := "application/json"
  10978. c.urlParams_.Set("alt", alt)
  10979. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}/createSnapshot")
  10980. urls += "?" + c.urlParams_.Encode()
  10981. req, _ := http.NewRequest("POST", urls, body)
  10982. googleapi.Expand(req.URL, map[string]string{
  10983. "project": c.project,
  10984. "zone": c.zone,
  10985. "disk": c.disk,
  10986. })
  10987. req.Header.Set("Content-Type", ctype)
  10988. req.Header.Set("User-Agent", c.s.userAgent())
  10989. if c.ctx_ != nil {
  10990. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10991. }
  10992. return c.s.client.Do(req)
  10993. }
  10994. // Do executes the "compute.disks.createSnapshot" call.
  10995. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  10996. // status code is an error. Response headers are in either
  10997. // *Operation.ServerResponse.Header or (if a response was returned at
  10998. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10999. // to check whether the returned error was because
  11000. // http.StatusNotModified was returned.
  11001. func (c *DisksCreateSnapshotCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  11002. gensupport.SetOptions(c.urlParams_, opts...)
  11003. res, err := c.doRequest("json")
  11004. if res != nil && res.StatusCode == http.StatusNotModified {
  11005. if res.Body != nil {
  11006. res.Body.Close()
  11007. }
  11008. return nil, &googleapi.Error{
  11009. Code: res.StatusCode,
  11010. Header: res.Header,
  11011. }
  11012. }
  11013. if err != nil {
  11014. return nil, err
  11015. }
  11016. defer googleapi.CloseBody(res)
  11017. if err := googleapi.CheckResponse(res); err != nil {
  11018. return nil, err
  11019. }
  11020. ret := &Operation{
  11021. ServerResponse: googleapi.ServerResponse{
  11022. Header: res.Header,
  11023. HTTPStatusCode: res.StatusCode,
  11024. },
  11025. }
  11026. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  11027. return nil, err
  11028. }
  11029. return ret, nil
  11030. // {
  11031. // "description": "Creates a snapshot of a specified persistent disk.",
  11032. // "httpMethod": "POST",
  11033. // "id": "compute.disks.createSnapshot",
  11034. // "parameterOrder": [
  11035. // "project",
  11036. // "zone",
  11037. // "disk"
  11038. // ],
  11039. // "parameters": {
  11040. // "disk": {
  11041. // "description": "Name of the persistent disk to snapshot.",
  11042. // "location": "path",
  11043. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  11044. // "required": true,
  11045. // "type": "string"
  11046. // },
  11047. // "project": {
  11048. // "description": "Project ID for this request.",
  11049. // "location": "path",
  11050. // "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])?))",
  11051. // "required": true,
  11052. // "type": "string"
  11053. // },
  11054. // "zone": {
  11055. // "description": "The name of the zone for this request.",
  11056. // "location": "path",
  11057. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  11058. // "required": true,
  11059. // "type": "string"
  11060. // }
  11061. // },
  11062. // "path": "{project}/zones/{zone}/disks/{disk}/createSnapshot",
  11063. // "request": {
  11064. // "$ref": "Snapshot"
  11065. // },
  11066. // "response": {
  11067. // "$ref": "Operation"
  11068. // },
  11069. // "scopes": [
  11070. // "https://www.googleapis.com/auth/cloud-platform",
  11071. // "https://www.googleapis.com/auth/compute"
  11072. // ]
  11073. // }
  11074. }
  11075. // method id "compute.disks.delete":
  11076. type DisksDeleteCall struct {
  11077. s *Service
  11078. project string
  11079. zone string
  11080. disk string
  11081. urlParams_ gensupport.URLParams
  11082. ctx_ context.Context
  11083. }
  11084. // Delete: Deletes the specified persistent disk. Deleting a disk
  11085. // removes its data permanently and is irreversible. However, deleting a
  11086. // disk does not delete any snapshots previously made from the disk. You
  11087. // must separately delete snapshots.
  11088. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/delete
  11089. func (r *DisksService) Delete(project string, zone string, disk string) *DisksDeleteCall {
  11090. c := &DisksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11091. c.project = project
  11092. c.zone = zone
  11093. c.disk = disk
  11094. return c
  11095. }
  11096. // Fields allows partial responses to be retrieved. See
  11097. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11098. // for more information.
  11099. func (c *DisksDeleteCall) Fields(s ...googleapi.Field) *DisksDeleteCall {
  11100. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11101. return c
  11102. }
  11103. // Context sets the context to be used in this call's Do method. Any
  11104. // pending HTTP request will be aborted if the provided context is
  11105. // canceled.
  11106. func (c *DisksDeleteCall) Context(ctx context.Context) *DisksDeleteCall {
  11107. c.ctx_ = ctx
  11108. return c
  11109. }
  11110. func (c *DisksDeleteCall) doRequest(alt string) (*http.Response, error) {
  11111. var body io.Reader = nil
  11112. c.urlParams_.Set("alt", alt)
  11113. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}")
  11114. urls += "?" + c.urlParams_.Encode()
  11115. req, _ := http.NewRequest("DELETE", urls, body)
  11116. googleapi.Expand(req.URL, map[string]string{
  11117. "project": c.project,
  11118. "zone": c.zone,
  11119. "disk": c.disk,
  11120. })
  11121. req.Header.Set("User-Agent", c.s.userAgent())
  11122. if c.ctx_ != nil {
  11123. return ctxhttp.Do(c.ctx_, c.s.client, req)
  11124. }
  11125. return c.s.client.Do(req)
  11126. }
  11127. // Do executes the "compute.disks.delete" call.
  11128. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  11129. // status code is an error. Response headers are in either
  11130. // *Operation.ServerResponse.Header or (if a response was returned at
  11131. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11132. // to check whether the returned error was because
  11133. // http.StatusNotModified was returned.
  11134. func (c *DisksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  11135. gensupport.SetOptions(c.urlParams_, opts...)
  11136. res, err := c.doRequest("json")
  11137. if res != nil && res.StatusCode == http.StatusNotModified {
  11138. if res.Body != nil {
  11139. res.Body.Close()
  11140. }
  11141. return nil, &googleapi.Error{
  11142. Code: res.StatusCode,
  11143. Header: res.Header,
  11144. }
  11145. }
  11146. if err != nil {
  11147. return nil, err
  11148. }
  11149. defer googleapi.CloseBody(res)
  11150. if err := googleapi.CheckResponse(res); err != nil {
  11151. return nil, err
  11152. }
  11153. ret := &Operation{
  11154. ServerResponse: googleapi.ServerResponse{
  11155. Header: res.Header,
  11156. HTTPStatusCode: res.StatusCode,
  11157. },
  11158. }
  11159. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  11160. return nil, err
  11161. }
  11162. return ret, nil
  11163. // {
  11164. // "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.",
  11165. // "httpMethod": "DELETE",
  11166. // "id": "compute.disks.delete",
  11167. // "parameterOrder": [
  11168. // "project",
  11169. // "zone",
  11170. // "disk"
  11171. // ],
  11172. // "parameters": {
  11173. // "disk": {
  11174. // "description": "Name of the persistent disk to delete.",
  11175. // "location": "path",
  11176. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  11177. // "required": true,
  11178. // "type": "string"
  11179. // },
  11180. // "project": {
  11181. // "description": "Project ID for this request.",
  11182. // "location": "path",
  11183. // "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])?))",
  11184. // "required": true,
  11185. // "type": "string"
  11186. // },
  11187. // "zone": {
  11188. // "description": "The name of the zone for this request.",
  11189. // "location": "path",
  11190. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  11191. // "required": true,
  11192. // "type": "string"
  11193. // }
  11194. // },
  11195. // "path": "{project}/zones/{zone}/disks/{disk}",
  11196. // "response": {
  11197. // "$ref": "Operation"
  11198. // },
  11199. // "scopes": [
  11200. // "https://www.googleapis.com/auth/cloud-platform",
  11201. // "https://www.googleapis.com/auth/compute"
  11202. // ]
  11203. // }
  11204. }
  11205. // method id "compute.disks.get":
  11206. type DisksGetCall struct {
  11207. s *Service
  11208. project string
  11209. zone string
  11210. disk string
  11211. urlParams_ gensupport.URLParams
  11212. ifNoneMatch_ string
  11213. ctx_ context.Context
  11214. }
  11215. // Get: Returns a specified persistent disk.
  11216. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/get
  11217. func (r *DisksService) Get(project string, zone string, disk string) *DisksGetCall {
  11218. c := &DisksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11219. c.project = project
  11220. c.zone = zone
  11221. c.disk = disk
  11222. return c
  11223. }
  11224. // Fields allows partial responses to be retrieved. See
  11225. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11226. // for more information.
  11227. func (c *DisksGetCall) Fields(s ...googleapi.Field) *DisksGetCall {
  11228. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11229. return c
  11230. }
  11231. // IfNoneMatch sets the optional parameter which makes the operation
  11232. // fail if the object's ETag matches the given value. This is useful for
  11233. // getting updates only after the object has changed since the last
  11234. // request. Use googleapi.IsNotModified to check whether the response
  11235. // error from Do is the result of In-None-Match.
  11236. func (c *DisksGetCall) IfNoneMatch(entityTag string) *DisksGetCall {
  11237. c.ifNoneMatch_ = entityTag
  11238. return c
  11239. }
  11240. // Context sets the context to be used in this call's Do method. Any
  11241. // pending HTTP request will be aborted if the provided context is
  11242. // canceled.
  11243. func (c *DisksGetCall) Context(ctx context.Context) *DisksGetCall {
  11244. c.ctx_ = ctx
  11245. return c
  11246. }
  11247. func (c *DisksGetCall) doRequest(alt string) (*http.Response, error) {
  11248. var body io.Reader = nil
  11249. c.urlParams_.Set("alt", alt)
  11250. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}")
  11251. urls += "?" + c.urlParams_.Encode()
  11252. req, _ := http.NewRequest("GET", urls, body)
  11253. googleapi.Expand(req.URL, map[string]string{
  11254. "project": c.project,
  11255. "zone": c.zone,
  11256. "disk": c.disk,
  11257. })
  11258. req.Header.Set("User-Agent", c.s.userAgent())
  11259. if c.ifNoneMatch_ != "" {
  11260. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  11261. }
  11262. if c.ctx_ != nil {
  11263. return ctxhttp.Do(c.ctx_, c.s.client, req)
  11264. }
  11265. return c.s.client.Do(req)
  11266. }
  11267. // Do executes the "compute.disks.get" call.
  11268. // Exactly one of *Disk or error will be non-nil. Any non-2xx status
  11269. // code is an error. Response headers are in either
  11270. // *Disk.ServerResponse.Header or (if a response was returned at all) in
  11271. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  11272. // whether the returned error was because http.StatusNotModified was
  11273. // returned.
  11274. func (c *DisksGetCall) Do(opts ...googleapi.CallOption) (*Disk, error) {
  11275. gensupport.SetOptions(c.urlParams_, opts...)
  11276. res, err := c.doRequest("json")
  11277. if res != nil && res.StatusCode == http.StatusNotModified {
  11278. if res.Body != nil {
  11279. res.Body.Close()
  11280. }
  11281. return nil, &googleapi.Error{
  11282. Code: res.StatusCode,
  11283. Header: res.Header,
  11284. }
  11285. }
  11286. if err != nil {
  11287. return nil, err
  11288. }
  11289. defer googleapi.CloseBody(res)
  11290. if err := googleapi.CheckResponse(res); err != nil {
  11291. return nil, err
  11292. }
  11293. ret := &Disk{
  11294. ServerResponse: googleapi.ServerResponse{
  11295. Header: res.Header,
  11296. HTTPStatusCode: res.StatusCode,
  11297. },
  11298. }
  11299. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  11300. return nil, err
  11301. }
  11302. return ret, nil
  11303. // {
  11304. // "description": "Returns a specified persistent disk.",
  11305. // "httpMethod": "GET",
  11306. // "id": "compute.disks.get",
  11307. // "parameterOrder": [
  11308. // "project",
  11309. // "zone",
  11310. // "disk"
  11311. // ],
  11312. // "parameters": {
  11313. // "disk": {
  11314. // "description": "Name of the persistent disk to return.",
  11315. // "location": "path",
  11316. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  11317. // "required": true,
  11318. // "type": "string"
  11319. // },
  11320. // "project": {
  11321. // "description": "Project ID for this request.",
  11322. // "location": "path",
  11323. // "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])?))",
  11324. // "required": true,
  11325. // "type": "string"
  11326. // },
  11327. // "zone": {
  11328. // "description": "The name of the zone for this request.",
  11329. // "location": "path",
  11330. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  11331. // "required": true,
  11332. // "type": "string"
  11333. // }
  11334. // },
  11335. // "path": "{project}/zones/{zone}/disks/{disk}",
  11336. // "response": {
  11337. // "$ref": "Disk"
  11338. // },
  11339. // "scopes": [
  11340. // "https://www.googleapis.com/auth/cloud-platform",
  11341. // "https://www.googleapis.com/auth/compute",
  11342. // "https://www.googleapis.com/auth/compute.readonly"
  11343. // ]
  11344. // }
  11345. }
  11346. // method id "compute.disks.insert":
  11347. type DisksInsertCall struct {
  11348. s *Service
  11349. project string
  11350. zone string
  11351. disk *Disk
  11352. urlParams_ gensupport.URLParams
  11353. ctx_ context.Context
  11354. }
  11355. // Insert: Creates a persistent disk in the specified project using the
  11356. // data included in the request.
  11357. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/insert
  11358. func (r *DisksService) Insert(project string, zone string, disk *Disk) *DisksInsertCall {
  11359. c := &DisksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11360. c.project = project
  11361. c.zone = zone
  11362. c.disk = disk
  11363. return c
  11364. }
  11365. // SourceImage sets the optional parameter "sourceImage": Source image
  11366. // to restore onto a disk.
  11367. func (c *DisksInsertCall) SourceImage(sourceImage string) *DisksInsertCall {
  11368. c.urlParams_.Set("sourceImage", sourceImage)
  11369. return c
  11370. }
  11371. // Fields allows partial responses to be retrieved. See
  11372. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11373. // for more information.
  11374. func (c *DisksInsertCall) Fields(s ...googleapi.Field) *DisksInsertCall {
  11375. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11376. return c
  11377. }
  11378. // Context sets the context to be used in this call's Do method. Any
  11379. // pending HTTP request will be aborted if the provided context is
  11380. // canceled.
  11381. func (c *DisksInsertCall) Context(ctx context.Context) *DisksInsertCall {
  11382. c.ctx_ = ctx
  11383. return c
  11384. }
  11385. func (c *DisksInsertCall) doRequest(alt string) (*http.Response, error) {
  11386. var body io.Reader = nil
  11387. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk)
  11388. if err != nil {
  11389. return nil, err
  11390. }
  11391. ctype := "application/json"
  11392. c.urlParams_.Set("alt", alt)
  11393. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks")
  11394. urls += "?" + c.urlParams_.Encode()
  11395. req, _ := http.NewRequest("POST", urls, body)
  11396. googleapi.Expand(req.URL, map[string]string{
  11397. "project": c.project,
  11398. "zone": c.zone,
  11399. })
  11400. req.Header.Set("Content-Type", ctype)
  11401. req.Header.Set("User-Agent", c.s.userAgent())
  11402. if c.ctx_ != nil {
  11403. return ctxhttp.Do(c.ctx_, c.s.client, req)
  11404. }
  11405. return c.s.client.Do(req)
  11406. }
  11407. // Do executes the "compute.disks.insert" call.
  11408. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  11409. // status code is an error. Response headers are in either
  11410. // *Operation.ServerResponse.Header or (if a response was returned at
  11411. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11412. // to check whether the returned error was because
  11413. // http.StatusNotModified was returned.
  11414. func (c *DisksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  11415. gensupport.SetOptions(c.urlParams_, opts...)
  11416. res, err := c.doRequest("json")
  11417. if res != nil && res.StatusCode == http.StatusNotModified {
  11418. if res.Body != nil {
  11419. res.Body.Close()
  11420. }
  11421. return nil, &googleapi.Error{
  11422. Code: res.StatusCode,
  11423. Header: res.Header,
  11424. }
  11425. }
  11426. if err != nil {
  11427. return nil, err
  11428. }
  11429. defer googleapi.CloseBody(res)
  11430. if err := googleapi.CheckResponse(res); err != nil {
  11431. return nil, err
  11432. }
  11433. ret := &Operation{
  11434. ServerResponse: googleapi.ServerResponse{
  11435. Header: res.Header,
  11436. HTTPStatusCode: res.StatusCode,
  11437. },
  11438. }
  11439. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  11440. return nil, err
  11441. }
  11442. return ret, nil
  11443. // {
  11444. // "description": "Creates a persistent disk in the specified project using the data included in the request.",
  11445. // "httpMethod": "POST",
  11446. // "id": "compute.disks.insert",
  11447. // "parameterOrder": [
  11448. // "project",
  11449. // "zone"
  11450. // ],
  11451. // "parameters": {
  11452. // "project": {
  11453. // "description": "Project ID for this request.",
  11454. // "location": "path",
  11455. // "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])?))",
  11456. // "required": true,
  11457. // "type": "string"
  11458. // },
  11459. // "sourceImage": {
  11460. // "description": "Optional. Source image to restore onto a disk.",
  11461. // "location": "query",
  11462. // "type": "string"
  11463. // },
  11464. // "zone": {
  11465. // "description": "The name of the zone for this request.",
  11466. // "location": "path",
  11467. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  11468. // "required": true,
  11469. // "type": "string"
  11470. // }
  11471. // },
  11472. // "path": "{project}/zones/{zone}/disks",
  11473. // "request": {
  11474. // "$ref": "Disk"
  11475. // },
  11476. // "response": {
  11477. // "$ref": "Operation"
  11478. // },
  11479. // "scopes": [
  11480. // "https://www.googleapis.com/auth/cloud-platform",
  11481. // "https://www.googleapis.com/auth/compute"
  11482. // ]
  11483. // }
  11484. }
  11485. // method id "compute.disks.list":
  11486. type DisksListCall struct {
  11487. s *Service
  11488. project string
  11489. zone string
  11490. urlParams_ gensupport.URLParams
  11491. ifNoneMatch_ string
  11492. ctx_ context.Context
  11493. }
  11494. // List: Retrieves a list of persistent disks contained within the
  11495. // specified zone.
  11496. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/list
  11497. func (r *DisksService) List(project string, zone string) *DisksListCall {
  11498. c := &DisksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11499. c.project = project
  11500. c.zone = zone
  11501. return c
  11502. }
  11503. // Filter sets the optional parameter "filter": Sets a filter expression
  11504. // for filtering listed resources, in the form filter={expression}. Your
  11505. // {expression} must be in the format: field_name comparison_string
  11506. // literal_string.
  11507. //
  11508. // The field_name is the name of the field you want to compare. Only
  11509. // atomic field types are supported (string, number, boolean). The
  11510. // comparison_string must be either eq (equals) or ne (not equals). The
  11511. // literal_string is the string value to filter to. The literal value
  11512. // must be valid for the type of field you are filtering by (string,
  11513. // number, boolean). For string fields, the literal value is interpreted
  11514. // as a regular expression using RE2 syntax. The literal value must
  11515. // match the entire field.
  11516. //
  11517. // For example, filter=name ne example-instance.
  11518. //
  11519. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  11520. // you can also filter on nested fields. For example, you could filter
  11521. // on instances that have set the scheduling.automaticRestart field to
  11522. // true. In particular, use filtering on nested fields to take advantage
  11523. // of instance labels to organize and filter results based on label
  11524. // values.
  11525. //
  11526. // The Beta API also supports filtering on multiple expressions by
  11527. // providing each separate expression within parentheses. For example,
  11528. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  11529. // Multiple expressions are treated as AND expressions meaning that
  11530. // resources must match all expressions to pass the filters.
  11531. func (c *DisksListCall) Filter(filter string) *DisksListCall {
  11532. c.urlParams_.Set("filter", filter)
  11533. return c
  11534. }
  11535. // MaxResults sets the optional parameter "maxResults": The maximum
  11536. // number of results per page that Compute Engine should return. If the
  11537. // number of available results is larger than maxResults, Compute Engine
  11538. // returns a nextPageToken that can be used to get the next page of
  11539. // results in subsequent list requests.
  11540. func (c *DisksListCall) MaxResults(maxResults int64) *DisksListCall {
  11541. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  11542. return c
  11543. }
  11544. // PageToken sets the optional parameter "pageToken": Specifies a page
  11545. // token to use. Set pageToken to the nextPageToken returned by a
  11546. // previous list request to get the next page of results.
  11547. func (c *DisksListCall) PageToken(pageToken string) *DisksListCall {
  11548. c.urlParams_.Set("pageToken", pageToken)
  11549. return c
  11550. }
  11551. // Fields allows partial responses to be retrieved. See
  11552. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11553. // for more information.
  11554. func (c *DisksListCall) Fields(s ...googleapi.Field) *DisksListCall {
  11555. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11556. return c
  11557. }
  11558. // IfNoneMatch sets the optional parameter which makes the operation
  11559. // fail if the object's ETag matches the given value. This is useful for
  11560. // getting updates only after the object has changed since the last
  11561. // request. Use googleapi.IsNotModified to check whether the response
  11562. // error from Do is the result of In-None-Match.
  11563. func (c *DisksListCall) IfNoneMatch(entityTag string) *DisksListCall {
  11564. c.ifNoneMatch_ = entityTag
  11565. return c
  11566. }
  11567. // Context sets the context to be used in this call's Do method. Any
  11568. // pending HTTP request will be aborted if the provided context is
  11569. // canceled.
  11570. func (c *DisksListCall) Context(ctx context.Context) *DisksListCall {
  11571. c.ctx_ = ctx
  11572. return c
  11573. }
  11574. func (c *DisksListCall) doRequest(alt string) (*http.Response, error) {
  11575. var body io.Reader = nil
  11576. c.urlParams_.Set("alt", alt)
  11577. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks")
  11578. urls += "?" + c.urlParams_.Encode()
  11579. req, _ := http.NewRequest("GET", urls, body)
  11580. googleapi.Expand(req.URL, map[string]string{
  11581. "project": c.project,
  11582. "zone": c.zone,
  11583. })
  11584. req.Header.Set("User-Agent", c.s.userAgent())
  11585. if c.ifNoneMatch_ != "" {
  11586. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  11587. }
  11588. if c.ctx_ != nil {
  11589. return ctxhttp.Do(c.ctx_, c.s.client, req)
  11590. }
  11591. return c.s.client.Do(req)
  11592. }
  11593. // Do executes the "compute.disks.list" call.
  11594. // Exactly one of *DiskList or error will be non-nil. Any non-2xx status
  11595. // code is an error. Response headers are in either
  11596. // *DiskList.ServerResponse.Header or (if a response was returned at
  11597. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11598. // to check whether the returned error was because
  11599. // http.StatusNotModified was returned.
  11600. func (c *DisksListCall) Do(opts ...googleapi.CallOption) (*DiskList, error) {
  11601. gensupport.SetOptions(c.urlParams_, opts...)
  11602. res, err := c.doRequest("json")
  11603. if res != nil && res.StatusCode == http.StatusNotModified {
  11604. if res.Body != nil {
  11605. res.Body.Close()
  11606. }
  11607. return nil, &googleapi.Error{
  11608. Code: res.StatusCode,
  11609. Header: res.Header,
  11610. }
  11611. }
  11612. if err != nil {
  11613. return nil, err
  11614. }
  11615. defer googleapi.CloseBody(res)
  11616. if err := googleapi.CheckResponse(res); err != nil {
  11617. return nil, err
  11618. }
  11619. ret := &DiskList{
  11620. ServerResponse: googleapi.ServerResponse{
  11621. Header: res.Header,
  11622. HTTPStatusCode: res.StatusCode,
  11623. },
  11624. }
  11625. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  11626. return nil, err
  11627. }
  11628. return ret, nil
  11629. // {
  11630. // "description": "Retrieves a list of persistent disks contained within the specified zone.",
  11631. // "httpMethod": "GET",
  11632. // "id": "compute.disks.list",
  11633. // "parameterOrder": [
  11634. // "project",
  11635. // "zone"
  11636. // ],
  11637. // "parameters": {
  11638. // "filter": {
  11639. // "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.",
  11640. // "location": "query",
  11641. // "type": "string"
  11642. // },
  11643. // "maxResults": {
  11644. // "default": "500",
  11645. // "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.",
  11646. // "format": "uint32",
  11647. // "location": "query",
  11648. // "maximum": "500",
  11649. // "minimum": "0",
  11650. // "type": "integer"
  11651. // },
  11652. // "pageToken": {
  11653. // "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.",
  11654. // "location": "query",
  11655. // "type": "string"
  11656. // },
  11657. // "project": {
  11658. // "description": "Project ID for this request.",
  11659. // "location": "path",
  11660. // "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])?))",
  11661. // "required": true,
  11662. // "type": "string"
  11663. // },
  11664. // "zone": {
  11665. // "description": "The name of the zone for this request.",
  11666. // "location": "path",
  11667. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  11668. // "required": true,
  11669. // "type": "string"
  11670. // }
  11671. // },
  11672. // "path": "{project}/zones/{zone}/disks",
  11673. // "response": {
  11674. // "$ref": "DiskList"
  11675. // },
  11676. // "scopes": [
  11677. // "https://www.googleapis.com/auth/cloud-platform",
  11678. // "https://www.googleapis.com/auth/compute",
  11679. // "https://www.googleapis.com/auth/compute.readonly"
  11680. // ]
  11681. // }
  11682. }
  11683. // Pages invokes f for each page of results.
  11684. // A non-nil error returned from f will halt the iteration.
  11685. // The provided context supersedes any context provided to the Context method.
  11686. func (c *DisksListCall) Pages(ctx context.Context, f func(*DiskList) error) error {
  11687. c.ctx_ = ctx
  11688. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  11689. for {
  11690. x, err := c.Do()
  11691. if err != nil {
  11692. return err
  11693. }
  11694. if err := f(x); err != nil {
  11695. return err
  11696. }
  11697. if x.NextPageToken == "" {
  11698. return nil
  11699. }
  11700. c.PageToken(x.NextPageToken)
  11701. }
  11702. }
  11703. // method id "compute.firewalls.delete":
  11704. type FirewallsDeleteCall struct {
  11705. s *Service
  11706. project string
  11707. firewall string
  11708. urlParams_ gensupport.URLParams
  11709. ctx_ context.Context
  11710. }
  11711. // Delete: Deletes the specified firewall resource.
  11712. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/delete
  11713. func (r *FirewallsService) Delete(project string, firewall string) *FirewallsDeleteCall {
  11714. c := &FirewallsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11715. c.project = project
  11716. c.firewall = firewall
  11717. return c
  11718. }
  11719. // Fields allows partial responses to be retrieved. See
  11720. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11721. // for more information.
  11722. func (c *FirewallsDeleteCall) Fields(s ...googleapi.Field) *FirewallsDeleteCall {
  11723. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11724. return c
  11725. }
  11726. // Context sets the context to be used in this call's Do method. Any
  11727. // pending HTTP request will be aborted if the provided context is
  11728. // canceled.
  11729. func (c *FirewallsDeleteCall) Context(ctx context.Context) *FirewallsDeleteCall {
  11730. c.ctx_ = ctx
  11731. return c
  11732. }
  11733. func (c *FirewallsDeleteCall) doRequest(alt string) (*http.Response, error) {
  11734. var body io.Reader = nil
  11735. c.urlParams_.Set("alt", alt)
  11736. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  11737. urls += "?" + c.urlParams_.Encode()
  11738. req, _ := http.NewRequest("DELETE", urls, body)
  11739. googleapi.Expand(req.URL, map[string]string{
  11740. "project": c.project,
  11741. "firewall": c.firewall,
  11742. })
  11743. req.Header.Set("User-Agent", c.s.userAgent())
  11744. if c.ctx_ != nil {
  11745. return ctxhttp.Do(c.ctx_, c.s.client, req)
  11746. }
  11747. return c.s.client.Do(req)
  11748. }
  11749. // Do executes the "compute.firewalls.delete" call.
  11750. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  11751. // status code is an error. Response headers are in either
  11752. // *Operation.ServerResponse.Header or (if a response was returned at
  11753. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11754. // to check whether the returned error was because
  11755. // http.StatusNotModified was returned.
  11756. func (c *FirewallsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  11757. gensupport.SetOptions(c.urlParams_, opts...)
  11758. res, err := c.doRequest("json")
  11759. if res != nil && res.StatusCode == http.StatusNotModified {
  11760. if res.Body != nil {
  11761. res.Body.Close()
  11762. }
  11763. return nil, &googleapi.Error{
  11764. Code: res.StatusCode,
  11765. Header: res.Header,
  11766. }
  11767. }
  11768. if err != nil {
  11769. return nil, err
  11770. }
  11771. defer googleapi.CloseBody(res)
  11772. if err := googleapi.CheckResponse(res); err != nil {
  11773. return nil, err
  11774. }
  11775. ret := &Operation{
  11776. ServerResponse: googleapi.ServerResponse{
  11777. Header: res.Header,
  11778. HTTPStatusCode: res.StatusCode,
  11779. },
  11780. }
  11781. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  11782. return nil, err
  11783. }
  11784. return ret, nil
  11785. // {
  11786. // "description": "Deletes the specified firewall resource.",
  11787. // "httpMethod": "DELETE",
  11788. // "id": "compute.firewalls.delete",
  11789. // "parameterOrder": [
  11790. // "project",
  11791. // "firewall"
  11792. // ],
  11793. // "parameters": {
  11794. // "firewall": {
  11795. // "description": "Name of the firewall resource to delete.",
  11796. // "location": "path",
  11797. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  11798. // "required": true,
  11799. // "type": "string"
  11800. // },
  11801. // "project": {
  11802. // "description": "Project ID for this request.",
  11803. // "location": "path",
  11804. // "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])?))",
  11805. // "required": true,
  11806. // "type": "string"
  11807. // }
  11808. // },
  11809. // "path": "{project}/global/firewalls/{firewall}",
  11810. // "response": {
  11811. // "$ref": "Operation"
  11812. // },
  11813. // "scopes": [
  11814. // "https://www.googleapis.com/auth/cloud-platform",
  11815. // "https://www.googleapis.com/auth/compute"
  11816. // ]
  11817. // }
  11818. }
  11819. // method id "compute.firewalls.get":
  11820. type FirewallsGetCall struct {
  11821. s *Service
  11822. project string
  11823. firewall string
  11824. urlParams_ gensupport.URLParams
  11825. ifNoneMatch_ string
  11826. ctx_ context.Context
  11827. }
  11828. // Get: Returns the specified firewall resource.
  11829. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/get
  11830. func (r *FirewallsService) Get(project string, firewall string) *FirewallsGetCall {
  11831. c := &FirewallsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11832. c.project = project
  11833. c.firewall = firewall
  11834. return c
  11835. }
  11836. // Fields allows partial responses to be retrieved. See
  11837. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11838. // for more information.
  11839. func (c *FirewallsGetCall) Fields(s ...googleapi.Field) *FirewallsGetCall {
  11840. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11841. return c
  11842. }
  11843. // IfNoneMatch sets the optional parameter which makes the operation
  11844. // fail if the object's ETag matches the given value. This is useful for
  11845. // getting updates only after the object has changed since the last
  11846. // request. Use googleapi.IsNotModified to check whether the response
  11847. // error from Do is the result of In-None-Match.
  11848. func (c *FirewallsGetCall) IfNoneMatch(entityTag string) *FirewallsGetCall {
  11849. c.ifNoneMatch_ = entityTag
  11850. return c
  11851. }
  11852. // Context sets the context to be used in this call's Do method. Any
  11853. // pending HTTP request will be aborted if the provided context is
  11854. // canceled.
  11855. func (c *FirewallsGetCall) Context(ctx context.Context) *FirewallsGetCall {
  11856. c.ctx_ = ctx
  11857. return c
  11858. }
  11859. func (c *FirewallsGetCall) doRequest(alt string) (*http.Response, error) {
  11860. var body io.Reader = nil
  11861. c.urlParams_.Set("alt", alt)
  11862. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  11863. urls += "?" + c.urlParams_.Encode()
  11864. req, _ := http.NewRequest("GET", urls, body)
  11865. googleapi.Expand(req.URL, map[string]string{
  11866. "project": c.project,
  11867. "firewall": c.firewall,
  11868. })
  11869. req.Header.Set("User-Agent", c.s.userAgent())
  11870. if c.ifNoneMatch_ != "" {
  11871. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  11872. }
  11873. if c.ctx_ != nil {
  11874. return ctxhttp.Do(c.ctx_, c.s.client, req)
  11875. }
  11876. return c.s.client.Do(req)
  11877. }
  11878. // Do executes the "compute.firewalls.get" call.
  11879. // Exactly one of *Firewall or error will be non-nil. Any non-2xx status
  11880. // code is an error. Response headers are in either
  11881. // *Firewall.ServerResponse.Header or (if a response was returned at
  11882. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11883. // to check whether the returned error was because
  11884. // http.StatusNotModified was returned.
  11885. func (c *FirewallsGetCall) Do(opts ...googleapi.CallOption) (*Firewall, error) {
  11886. gensupport.SetOptions(c.urlParams_, opts...)
  11887. res, err := c.doRequest("json")
  11888. if res != nil && res.StatusCode == http.StatusNotModified {
  11889. if res.Body != nil {
  11890. res.Body.Close()
  11891. }
  11892. return nil, &googleapi.Error{
  11893. Code: res.StatusCode,
  11894. Header: res.Header,
  11895. }
  11896. }
  11897. if err != nil {
  11898. return nil, err
  11899. }
  11900. defer googleapi.CloseBody(res)
  11901. if err := googleapi.CheckResponse(res); err != nil {
  11902. return nil, err
  11903. }
  11904. ret := &Firewall{
  11905. ServerResponse: googleapi.ServerResponse{
  11906. Header: res.Header,
  11907. HTTPStatusCode: res.StatusCode,
  11908. },
  11909. }
  11910. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  11911. return nil, err
  11912. }
  11913. return ret, nil
  11914. // {
  11915. // "description": "Returns the specified firewall resource.",
  11916. // "httpMethod": "GET",
  11917. // "id": "compute.firewalls.get",
  11918. // "parameterOrder": [
  11919. // "project",
  11920. // "firewall"
  11921. // ],
  11922. // "parameters": {
  11923. // "firewall": {
  11924. // "description": "Name of the firewall resource to return.",
  11925. // "location": "path",
  11926. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  11927. // "required": true,
  11928. // "type": "string"
  11929. // },
  11930. // "project": {
  11931. // "description": "Project ID for this request.",
  11932. // "location": "path",
  11933. // "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])?))",
  11934. // "required": true,
  11935. // "type": "string"
  11936. // }
  11937. // },
  11938. // "path": "{project}/global/firewalls/{firewall}",
  11939. // "response": {
  11940. // "$ref": "Firewall"
  11941. // },
  11942. // "scopes": [
  11943. // "https://www.googleapis.com/auth/cloud-platform",
  11944. // "https://www.googleapis.com/auth/compute",
  11945. // "https://www.googleapis.com/auth/compute.readonly"
  11946. // ]
  11947. // }
  11948. }
  11949. // method id "compute.firewalls.insert":
  11950. type FirewallsInsertCall struct {
  11951. s *Service
  11952. project string
  11953. firewall *Firewall
  11954. urlParams_ gensupport.URLParams
  11955. ctx_ context.Context
  11956. }
  11957. // Insert: Creates a firewall resource in the specified project using
  11958. // the data included in the request.
  11959. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/insert
  11960. func (r *FirewallsService) Insert(project string, firewall *Firewall) *FirewallsInsertCall {
  11961. c := &FirewallsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11962. c.project = project
  11963. c.firewall = firewall
  11964. return c
  11965. }
  11966. // Fields allows partial responses to be retrieved. See
  11967. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11968. // for more information.
  11969. func (c *FirewallsInsertCall) Fields(s ...googleapi.Field) *FirewallsInsertCall {
  11970. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11971. return c
  11972. }
  11973. // Context sets the context to be used in this call's Do method. Any
  11974. // pending HTTP request will be aborted if the provided context is
  11975. // canceled.
  11976. func (c *FirewallsInsertCall) Context(ctx context.Context) *FirewallsInsertCall {
  11977. c.ctx_ = ctx
  11978. return c
  11979. }
  11980. func (c *FirewallsInsertCall) doRequest(alt string) (*http.Response, error) {
  11981. var body io.Reader = nil
  11982. body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall)
  11983. if err != nil {
  11984. return nil, err
  11985. }
  11986. ctype := "application/json"
  11987. c.urlParams_.Set("alt", alt)
  11988. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls")
  11989. urls += "?" + c.urlParams_.Encode()
  11990. req, _ := http.NewRequest("POST", urls, body)
  11991. googleapi.Expand(req.URL, map[string]string{
  11992. "project": c.project,
  11993. })
  11994. req.Header.Set("Content-Type", ctype)
  11995. req.Header.Set("User-Agent", c.s.userAgent())
  11996. if c.ctx_ != nil {
  11997. return ctxhttp.Do(c.ctx_, c.s.client, req)
  11998. }
  11999. return c.s.client.Do(req)
  12000. }
  12001. // Do executes the "compute.firewalls.insert" call.
  12002. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  12003. // status code is an error. Response headers are in either
  12004. // *Operation.ServerResponse.Header or (if a response was returned at
  12005. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  12006. // to check whether the returned error was because
  12007. // http.StatusNotModified was returned.
  12008. func (c *FirewallsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  12009. gensupport.SetOptions(c.urlParams_, opts...)
  12010. res, err := c.doRequest("json")
  12011. if res != nil && res.StatusCode == http.StatusNotModified {
  12012. if res.Body != nil {
  12013. res.Body.Close()
  12014. }
  12015. return nil, &googleapi.Error{
  12016. Code: res.StatusCode,
  12017. Header: res.Header,
  12018. }
  12019. }
  12020. if err != nil {
  12021. return nil, err
  12022. }
  12023. defer googleapi.CloseBody(res)
  12024. if err := googleapi.CheckResponse(res); err != nil {
  12025. return nil, err
  12026. }
  12027. ret := &Operation{
  12028. ServerResponse: googleapi.ServerResponse{
  12029. Header: res.Header,
  12030. HTTPStatusCode: res.StatusCode,
  12031. },
  12032. }
  12033. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  12034. return nil, err
  12035. }
  12036. return ret, nil
  12037. // {
  12038. // "description": "Creates a firewall resource in the specified project using the data included in the request.",
  12039. // "httpMethod": "POST",
  12040. // "id": "compute.firewalls.insert",
  12041. // "parameterOrder": [
  12042. // "project"
  12043. // ],
  12044. // "parameters": {
  12045. // "project": {
  12046. // "description": "Project ID for this request.",
  12047. // "location": "path",
  12048. // "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])?))",
  12049. // "required": true,
  12050. // "type": "string"
  12051. // }
  12052. // },
  12053. // "path": "{project}/global/firewalls",
  12054. // "request": {
  12055. // "$ref": "Firewall"
  12056. // },
  12057. // "response": {
  12058. // "$ref": "Operation"
  12059. // },
  12060. // "scopes": [
  12061. // "https://www.googleapis.com/auth/cloud-platform",
  12062. // "https://www.googleapis.com/auth/compute"
  12063. // ]
  12064. // }
  12065. }
  12066. // method id "compute.firewalls.list":
  12067. type FirewallsListCall struct {
  12068. s *Service
  12069. project string
  12070. urlParams_ gensupport.URLParams
  12071. ifNoneMatch_ string
  12072. ctx_ context.Context
  12073. }
  12074. // List: Retrieves the list of firewall resources available to the
  12075. // specified project.
  12076. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/list
  12077. func (r *FirewallsService) List(project string) *FirewallsListCall {
  12078. c := &FirewallsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12079. c.project = project
  12080. return c
  12081. }
  12082. // Filter sets the optional parameter "filter": Sets a filter expression
  12083. // for filtering listed resources, in the form filter={expression}. Your
  12084. // {expression} must be in the format: field_name comparison_string
  12085. // literal_string.
  12086. //
  12087. // The field_name is the name of the field you want to compare. Only
  12088. // atomic field types are supported (string, number, boolean). The
  12089. // comparison_string must be either eq (equals) or ne (not equals). The
  12090. // literal_string is the string value to filter to. The literal value
  12091. // must be valid for the type of field you are filtering by (string,
  12092. // number, boolean). For string fields, the literal value is interpreted
  12093. // as a regular expression using RE2 syntax. The literal value must
  12094. // match the entire field.
  12095. //
  12096. // For example, filter=name ne example-instance.
  12097. //
  12098. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  12099. // you can also filter on nested fields. For example, you could filter
  12100. // on instances that have set the scheduling.automaticRestart field to
  12101. // true. In particular, use filtering on nested fields to take advantage
  12102. // of instance labels to organize and filter results based on label
  12103. // values.
  12104. //
  12105. // The Beta API also supports filtering on multiple expressions by
  12106. // providing each separate expression within parentheses. For example,
  12107. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  12108. // Multiple expressions are treated as AND expressions meaning that
  12109. // resources must match all expressions to pass the filters.
  12110. func (c *FirewallsListCall) Filter(filter string) *FirewallsListCall {
  12111. c.urlParams_.Set("filter", filter)
  12112. return c
  12113. }
  12114. // MaxResults sets the optional parameter "maxResults": The maximum
  12115. // number of results per page that Compute Engine should return. If the
  12116. // number of available results is larger than maxResults, Compute Engine
  12117. // returns a nextPageToken that can be used to get the next page of
  12118. // results in subsequent list requests.
  12119. func (c *FirewallsListCall) MaxResults(maxResults int64) *FirewallsListCall {
  12120. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  12121. return c
  12122. }
  12123. // PageToken sets the optional parameter "pageToken": Specifies a page
  12124. // token to use. Set pageToken to the nextPageToken returned by a
  12125. // previous list request to get the next page of results.
  12126. func (c *FirewallsListCall) PageToken(pageToken string) *FirewallsListCall {
  12127. c.urlParams_.Set("pageToken", pageToken)
  12128. return c
  12129. }
  12130. // Fields allows partial responses to be retrieved. See
  12131. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12132. // for more information.
  12133. func (c *FirewallsListCall) Fields(s ...googleapi.Field) *FirewallsListCall {
  12134. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12135. return c
  12136. }
  12137. // IfNoneMatch sets the optional parameter which makes the operation
  12138. // fail if the object's ETag matches the given value. This is useful for
  12139. // getting updates only after the object has changed since the last
  12140. // request. Use googleapi.IsNotModified to check whether the response
  12141. // error from Do is the result of In-None-Match.
  12142. func (c *FirewallsListCall) IfNoneMatch(entityTag string) *FirewallsListCall {
  12143. c.ifNoneMatch_ = entityTag
  12144. return c
  12145. }
  12146. // Context sets the context to be used in this call's Do method. Any
  12147. // pending HTTP request will be aborted if the provided context is
  12148. // canceled.
  12149. func (c *FirewallsListCall) Context(ctx context.Context) *FirewallsListCall {
  12150. c.ctx_ = ctx
  12151. return c
  12152. }
  12153. func (c *FirewallsListCall) doRequest(alt string) (*http.Response, error) {
  12154. var body io.Reader = nil
  12155. c.urlParams_.Set("alt", alt)
  12156. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls")
  12157. urls += "?" + c.urlParams_.Encode()
  12158. req, _ := http.NewRequest("GET", urls, body)
  12159. googleapi.Expand(req.URL, map[string]string{
  12160. "project": c.project,
  12161. })
  12162. req.Header.Set("User-Agent", c.s.userAgent())
  12163. if c.ifNoneMatch_ != "" {
  12164. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  12165. }
  12166. if c.ctx_ != nil {
  12167. return ctxhttp.Do(c.ctx_, c.s.client, req)
  12168. }
  12169. return c.s.client.Do(req)
  12170. }
  12171. // Do executes the "compute.firewalls.list" call.
  12172. // Exactly one of *FirewallList or error will be non-nil. Any non-2xx
  12173. // status code is an error. Response headers are in either
  12174. // *FirewallList.ServerResponse.Header or (if a response was returned at
  12175. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  12176. // to check whether the returned error was because
  12177. // http.StatusNotModified was returned.
  12178. func (c *FirewallsListCall) Do(opts ...googleapi.CallOption) (*FirewallList, error) {
  12179. gensupport.SetOptions(c.urlParams_, opts...)
  12180. res, err := c.doRequest("json")
  12181. if res != nil && res.StatusCode == http.StatusNotModified {
  12182. if res.Body != nil {
  12183. res.Body.Close()
  12184. }
  12185. return nil, &googleapi.Error{
  12186. Code: res.StatusCode,
  12187. Header: res.Header,
  12188. }
  12189. }
  12190. if err != nil {
  12191. return nil, err
  12192. }
  12193. defer googleapi.CloseBody(res)
  12194. if err := googleapi.CheckResponse(res); err != nil {
  12195. return nil, err
  12196. }
  12197. ret := &FirewallList{
  12198. ServerResponse: googleapi.ServerResponse{
  12199. Header: res.Header,
  12200. HTTPStatusCode: res.StatusCode,
  12201. },
  12202. }
  12203. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  12204. return nil, err
  12205. }
  12206. return ret, nil
  12207. // {
  12208. // "description": "Retrieves the list of firewall resources available to the specified project.",
  12209. // "httpMethod": "GET",
  12210. // "id": "compute.firewalls.list",
  12211. // "parameterOrder": [
  12212. // "project"
  12213. // ],
  12214. // "parameters": {
  12215. // "filter": {
  12216. // "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.",
  12217. // "location": "query",
  12218. // "type": "string"
  12219. // },
  12220. // "maxResults": {
  12221. // "default": "500",
  12222. // "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.",
  12223. // "format": "uint32",
  12224. // "location": "query",
  12225. // "maximum": "500",
  12226. // "minimum": "0",
  12227. // "type": "integer"
  12228. // },
  12229. // "pageToken": {
  12230. // "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.",
  12231. // "location": "query",
  12232. // "type": "string"
  12233. // },
  12234. // "project": {
  12235. // "description": "Project ID for this request.",
  12236. // "location": "path",
  12237. // "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])?))",
  12238. // "required": true,
  12239. // "type": "string"
  12240. // }
  12241. // },
  12242. // "path": "{project}/global/firewalls",
  12243. // "response": {
  12244. // "$ref": "FirewallList"
  12245. // },
  12246. // "scopes": [
  12247. // "https://www.googleapis.com/auth/cloud-platform",
  12248. // "https://www.googleapis.com/auth/compute",
  12249. // "https://www.googleapis.com/auth/compute.readonly"
  12250. // ]
  12251. // }
  12252. }
  12253. // Pages invokes f for each page of results.
  12254. // A non-nil error returned from f will halt the iteration.
  12255. // The provided context supersedes any context provided to the Context method.
  12256. func (c *FirewallsListCall) Pages(ctx context.Context, f func(*FirewallList) error) error {
  12257. c.ctx_ = ctx
  12258. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  12259. for {
  12260. x, err := c.Do()
  12261. if err != nil {
  12262. return err
  12263. }
  12264. if err := f(x); err != nil {
  12265. return err
  12266. }
  12267. if x.NextPageToken == "" {
  12268. return nil
  12269. }
  12270. c.PageToken(x.NextPageToken)
  12271. }
  12272. }
  12273. // method id "compute.firewalls.patch":
  12274. type FirewallsPatchCall struct {
  12275. s *Service
  12276. project string
  12277. firewall string
  12278. firewall2 *Firewall
  12279. urlParams_ gensupport.URLParams
  12280. ctx_ context.Context
  12281. }
  12282. // Patch: Updates the specified firewall resource with the data included
  12283. // in the request. This method supports patch semantics.
  12284. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/patch
  12285. func (r *FirewallsService) Patch(project string, firewall string, firewall2 *Firewall) *FirewallsPatchCall {
  12286. c := &FirewallsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12287. c.project = project
  12288. c.firewall = firewall
  12289. c.firewall2 = firewall2
  12290. return c
  12291. }
  12292. // Fields allows partial responses to be retrieved. See
  12293. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12294. // for more information.
  12295. func (c *FirewallsPatchCall) Fields(s ...googleapi.Field) *FirewallsPatchCall {
  12296. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12297. return c
  12298. }
  12299. // Context sets the context to be used in this call's Do method. Any
  12300. // pending HTTP request will be aborted if the provided context is
  12301. // canceled.
  12302. func (c *FirewallsPatchCall) Context(ctx context.Context) *FirewallsPatchCall {
  12303. c.ctx_ = ctx
  12304. return c
  12305. }
  12306. func (c *FirewallsPatchCall) doRequest(alt string) (*http.Response, error) {
  12307. var body io.Reader = nil
  12308. body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2)
  12309. if err != nil {
  12310. return nil, err
  12311. }
  12312. ctype := "application/json"
  12313. c.urlParams_.Set("alt", alt)
  12314. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  12315. urls += "?" + c.urlParams_.Encode()
  12316. req, _ := http.NewRequest("PATCH", urls, body)
  12317. googleapi.Expand(req.URL, map[string]string{
  12318. "project": c.project,
  12319. "firewall": c.firewall,
  12320. })
  12321. req.Header.Set("Content-Type", ctype)
  12322. req.Header.Set("User-Agent", c.s.userAgent())
  12323. if c.ctx_ != nil {
  12324. return ctxhttp.Do(c.ctx_, c.s.client, req)
  12325. }
  12326. return c.s.client.Do(req)
  12327. }
  12328. // Do executes the "compute.firewalls.patch" call.
  12329. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  12330. // status code is an error. Response headers are in either
  12331. // *Operation.ServerResponse.Header or (if a response was returned at
  12332. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  12333. // to check whether the returned error was because
  12334. // http.StatusNotModified was returned.
  12335. func (c *FirewallsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  12336. gensupport.SetOptions(c.urlParams_, opts...)
  12337. res, err := c.doRequest("json")
  12338. if res != nil && res.StatusCode == http.StatusNotModified {
  12339. if res.Body != nil {
  12340. res.Body.Close()
  12341. }
  12342. return nil, &googleapi.Error{
  12343. Code: res.StatusCode,
  12344. Header: res.Header,
  12345. }
  12346. }
  12347. if err != nil {
  12348. return nil, err
  12349. }
  12350. defer googleapi.CloseBody(res)
  12351. if err := googleapi.CheckResponse(res); err != nil {
  12352. return nil, err
  12353. }
  12354. ret := &Operation{
  12355. ServerResponse: googleapi.ServerResponse{
  12356. Header: res.Header,
  12357. HTTPStatusCode: res.StatusCode,
  12358. },
  12359. }
  12360. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  12361. return nil, err
  12362. }
  12363. return ret, nil
  12364. // {
  12365. // "description": "Updates the specified firewall resource with the data included in the request. This method supports patch semantics.",
  12366. // "httpMethod": "PATCH",
  12367. // "id": "compute.firewalls.patch",
  12368. // "parameterOrder": [
  12369. // "project",
  12370. // "firewall"
  12371. // ],
  12372. // "parameters": {
  12373. // "firewall": {
  12374. // "description": "Name of the firewall resource to update.",
  12375. // "location": "path",
  12376. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  12377. // "required": true,
  12378. // "type": "string"
  12379. // },
  12380. // "project": {
  12381. // "description": "Project ID for this request.",
  12382. // "location": "path",
  12383. // "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])?))",
  12384. // "required": true,
  12385. // "type": "string"
  12386. // }
  12387. // },
  12388. // "path": "{project}/global/firewalls/{firewall}",
  12389. // "request": {
  12390. // "$ref": "Firewall"
  12391. // },
  12392. // "response": {
  12393. // "$ref": "Operation"
  12394. // },
  12395. // "scopes": [
  12396. // "https://www.googleapis.com/auth/cloud-platform",
  12397. // "https://www.googleapis.com/auth/compute"
  12398. // ]
  12399. // }
  12400. }
  12401. // method id "compute.firewalls.update":
  12402. type FirewallsUpdateCall struct {
  12403. s *Service
  12404. project string
  12405. firewall string
  12406. firewall2 *Firewall
  12407. urlParams_ gensupport.URLParams
  12408. ctx_ context.Context
  12409. }
  12410. // Update: Updates the specified firewall resource with the data
  12411. // included in the request.
  12412. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/update
  12413. func (r *FirewallsService) Update(project string, firewall string, firewall2 *Firewall) *FirewallsUpdateCall {
  12414. c := &FirewallsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12415. c.project = project
  12416. c.firewall = firewall
  12417. c.firewall2 = firewall2
  12418. return c
  12419. }
  12420. // Fields allows partial responses to be retrieved. See
  12421. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12422. // for more information.
  12423. func (c *FirewallsUpdateCall) Fields(s ...googleapi.Field) *FirewallsUpdateCall {
  12424. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12425. return c
  12426. }
  12427. // Context sets the context to be used in this call's Do method. Any
  12428. // pending HTTP request will be aborted if the provided context is
  12429. // canceled.
  12430. func (c *FirewallsUpdateCall) Context(ctx context.Context) *FirewallsUpdateCall {
  12431. c.ctx_ = ctx
  12432. return c
  12433. }
  12434. func (c *FirewallsUpdateCall) doRequest(alt string) (*http.Response, error) {
  12435. var body io.Reader = nil
  12436. body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2)
  12437. if err != nil {
  12438. return nil, err
  12439. }
  12440. ctype := "application/json"
  12441. c.urlParams_.Set("alt", alt)
  12442. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  12443. urls += "?" + c.urlParams_.Encode()
  12444. req, _ := http.NewRequest("PUT", urls, body)
  12445. googleapi.Expand(req.URL, map[string]string{
  12446. "project": c.project,
  12447. "firewall": c.firewall,
  12448. })
  12449. req.Header.Set("Content-Type", ctype)
  12450. req.Header.Set("User-Agent", c.s.userAgent())
  12451. if c.ctx_ != nil {
  12452. return ctxhttp.Do(c.ctx_, c.s.client, req)
  12453. }
  12454. return c.s.client.Do(req)
  12455. }
  12456. // Do executes the "compute.firewalls.update" call.
  12457. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  12458. // status code is an error. Response headers are in either
  12459. // *Operation.ServerResponse.Header or (if a response was returned at
  12460. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  12461. // to check whether the returned error was because
  12462. // http.StatusNotModified was returned.
  12463. func (c *FirewallsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  12464. gensupport.SetOptions(c.urlParams_, opts...)
  12465. res, err := c.doRequest("json")
  12466. if res != nil && res.StatusCode == http.StatusNotModified {
  12467. if res.Body != nil {
  12468. res.Body.Close()
  12469. }
  12470. return nil, &googleapi.Error{
  12471. Code: res.StatusCode,
  12472. Header: res.Header,
  12473. }
  12474. }
  12475. if err != nil {
  12476. return nil, err
  12477. }
  12478. defer googleapi.CloseBody(res)
  12479. if err := googleapi.CheckResponse(res); err != nil {
  12480. return nil, err
  12481. }
  12482. ret := &Operation{
  12483. ServerResponse: googleapi.ServerResponse{
  12484. Header: res.Header,
  12485. HTTPStatusCode: res.StatusCode,
  12486. },
  12487. }
  12488. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  12489. return nil, err
  12490. }
  12491. return ret, nil
  12492. // {
  12493. // "description": "Updates the specified firewall resource with the data included in the request.",
  12494. // "httpMethod": "PUT",
  12495. // "id": "compute.firewalls.update",
  12496. // "parameterOrder": [
  12497. // "project",
  12498. // "firewall"
  12499. // ],
  12500. // "parameters": {
  12501. // "firewall": {
  12502. // "description": "Name of the firewall resource to update.",
  12503. // "location": "path",
  12504. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  12505. // "required": true,
  12506. // "type": "string"
  12507. // },
  12508. // "project": {
  12509. // "description": "Project ID for this request.",
  12510. // "location": "path",
  12511. // "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])?))",
  12512. // "required": true,
  12513. // "type": "string"
  12514. // }
  12515. // },
  12516. // "path": "{project}/global/firewalls/{firewall}",
  12517. // "request": {
  12518. // "$ref": "Firewall"
  12519. // },
  12520. // "response": {
  12521. // "$ref": "Operation"
  12522. // },
  12523. // "scopes": [
  12524. // "https://www.googleapis.com/auth/cloud-platform",
  12525. // "https://www.googleapis.com/auth/compute"
  12526. // ]
  12527. // }
  12528. }
  12529. // method id "compute.forwardingRules.aggregatedList":
  12530. type ForwardingRulesAggregatedListCall struct {
  12531. s *Service
  12532. project string
  12533. urlParams_ gensupport.URLParams
  12534. ifNoneMatch_ string
  12535. ctx_ context.Context
  12536. }
  12537. // AggregatedList: Retrieves an aggregated list of forwarding rules.
  12538. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/aggregatedList
  12539. func (r *ForwardingRulesService) AggregatedList(project string) *ForwardingRulesAggregatedListCall {
  12540. c := &ForwardingRulesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12541. c.project = project
  12542. return c
  12543. }
  12544. // Filter sets the optional parameter "filter": Sets a filter expression
  12545. // for filtering listed resources, in the form filter={expression}. Your
  12546. // {expression} must be in the format: field_name comparison_string
  12547. // literal_string.
  12548. //
  12549. // The field_name is the name of the field you want to compare. Only
  12550. // atomic field types are supported (string, number, boolean). The
  12551. // comparison_string must be either eq (equals) or ne (not equals). The
  12552. // literal_string is the string value to filter to. The literal value
  12553. // must be valid for the type of field you are filtering by (string,
  12554. // number, boolean). For string fields, the literal value is interpreted
  12555. // as a regular expression using RE2 syntax. The literal value must
  12556. // match the entire field.
  12557. //
  12558. // For example, filter=name ne example-instance.
  12559. //
  12560. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  12561. // you can also filter on nested fields. For example, you could filter
  12562. // on instances that have set the scheduling.automaticRestart field to
  12563. // true. In particular, use filtering on nested fields to take advantage
  12564. // of instance labels to organize and filter results based on label
  12565. // values.
  12566. //
  12567. // The Beta API also supports filtering on multiple expressions by
  12568. // providing each separate expression within parentheses. For example,
  12569. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  12570. // Multiple expressions are treated as AND expressions meaning that
  12571. // resources must match all expressions to pass the filters.
  12572. func (c *ForwardingRulesAggregatedListCall) Filter(filter string) *ForwardingRulesAggregatedListCall {
  12573. c.urlParams_.Set("filter", filter)
  12574. return c
  12575. }
  12576. // MaxResults sets the optional parameter "maxResults": The maximum
  12577. // number of results per page that Compute Engine should return. If the
  12578. // number of available results is larger than maxResults, Compute Engine
  12579. // returns a nextPageToken that can be used to get the next page of
  12580. // results in subsequent list requests.
  12581. func (c *ForwardingRulesAggregatedListCall) MaxResults(maxResults int64) *ForwardingRulesAggregatedListCall {
  12582. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  12583. return c
  12584. }
  12585. // PageToken sets the optional parameter "pageToken": Specifies a page
  12586. // token to use. Set pageToken to the nextPageToken returned by a
  12587. // previous list request to get the next page of results.
  12588. func (c *ForwardingRulesAggregatedListCall) PageToken(pageToken string) *ForwardingRulesAggregatedListCall {
  12589. c.urlParams_.Set("pageToken", pageToken)
  12590. return c
  12591. }
  12592. // Fields allows partial responses to be retrieved. See
  12593. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12594. // for more information.
  12595. func (c *ForwardingRulesAggregatedListCall) Fields(s ...googleapi.Field) *ForwardingRulesAggregatedListCall {
  12596. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12597. return c
  12598. }
  12599. // IfNoneMatch sets the optional parameter which makes the operation
  12600. // fail if the object's ETag matches the given value. This is useful for
  12601. // getting updates only after the object has changed since the last
  12602. // request. Use googleapi.IsNotModified to check whether the response
  12603. // error from Do is the result of In-None-Match.
  12604. func (c *ForwardingRulesAggregatedListCall) IfNoneMatch(entityTag string) *ForwardingRulesAggregatedListCall {
  12605. c.ifNoneMatch_ = entityTag
  12606. return c
  12607. }
  12608. // Context sets the context to be used in this call's Do method. Any
  12609. // pending HTTP request will be aborted if the provided context is
  12610. // canceled.
  12611. func (c *ForwardingRulesAggregatedListCall) Context(ctx context.Context) *ForwardingRulesAggregatedListCall {
  12612. c.ctx_ = ctx
  12613. return c
  12614. }
  12615. func (c *ForwardingRulesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  12616. var body io.Reader = nil
  12617. c.urlParams_.Set("alt", alt)
  12618. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/forwardingRules")
  12619. urls += "?" + c.urlParams_.Encode()
  12620. req, _ := http.NewRequest("GET", urls, body)
  12621. googleapi.Expand(req.URL, map[string]string{
  12622. "project": c.project,
  12623. })
  12624. req.Header.Set("User-Agent", c.s.userAgent())
  12625. if c.ifNoneMatch_ != "" {
  12626. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  12627. }
  12628. if c.ctx_ != nil {
  12629. return ctxhttp.Do(c.ctx_, c.s.client, req)
  12630. }
  12631. return c.s.client.Do(req)
  12632. }
  12633. // Do executes the "compute.forwardingRules.aggregatedList" call.
  12634. // Exactly one of *ForwardingRuleAggregatedList or error will be
  12635. // non-nil. Any non-2xx status code is an error. Response headers are in
  12636. // either *ForwardingRuleAggregatedList.ServerResponse.Header or (if a
  12637. // response was returned at all) in error.(*googleapi.Error).Header. Use
  12638. // googleapi.IsNotModified to check whether the returned error was
  12639. // because http.StatusNotModified was returned.
  12640. func (c *ForwardingRulesAggregatedListCall) Do(opts ...googleapi.CallOption) (*ForwardingRuleAggregatedList, error) {
  12641. gensupport.SetOptions(c.urlParams_, opts...)
  12642. res, err := c.doRequest("json")
  12643. if res != nil && res.StatusCode == http.StatusNotModified {
  12644. if res.Body != nil {
  12645. res.Body.Close()
  12646. }
  12647. return nil, &googleapi.Error{
  12648. Code: res.StatusCode,
  12649. Header: res.Header,
  12650. }
  12651. }
  12652. if err != nil {
  12653. return nil, err
  12654. }
  12655. defer googleapi.CloseBody(res)
  12656. if err := googleapi.CheckResponse(res); err != nil {
  12657. return nil, err
  12658. }
  12659. ret := &ForwardingRuleAggregatedList{
  12660. ServerResponse: googleapi.ServerResponse{
  12661. Header: res.Header,
  12662. HTTPStatusCode: res.StatusCode,
  12663. },
  12664. }
  12665. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  12666. return nil, err
  12667. }
  12668. return ret, nil
  12669. // {
  12670. // "description": "Retrieves an aggregated list of forwarding rules.",
  12671. // "httpMethod": "GET",
  12672. // "id": "compute.forwardingRules.aggregatedList",
  12673. // "parameterOrder": [
  12674. // "project"
  12675. // ],
  12676. // "parameters": {
  12677. // "filter": {
  12678. // "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.",
  12679. // "location": "query",
  12680. // "type": "string"
  12681. // },
  12682. // "maxResults": {
  12683. // "default": "500",
  12684. // "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.",
  12685. // "format": "uint32",
  12686. // "location": "query",
  12687. // "maximum": "500",
  12688. // "minimum": "0",
  12689. // "type": "integer"
  12690. // },
  12691. // "pageToken": {
  12692. // "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.",
  12693. // "location": "query",
  12694. // "type": "string"
  12695. // },
  12696. // "project": {
  12697. // "description": "Project ID for this request.",
  12698. // "location": "path",
  12699. // "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])?))",
  12700. // "required": true,
  12701. // "type": "string"
  12702. // }
  12703. // },
  12704. // "path": "{project}/aggregated/forwardingRules",
  12705. // "response": {
  12706. // "$ref": "ForwardingRuleAggregatedList"
  12707. // },
  12708. // "scopes": [
  12709. // "https://www.googleapis.com/auth/cloud-platform",
  12710. // "https://www.googleapis.com/auth/compute",
  12711. // "https://www.googleapis.com/auth/compute.readonly"
  12712. // ]
  12713. // }
  12714. }
  12715. // Pages invokes f for each page of results.
  12716. // A non-nil error returned from f will halt the iteration.
  12717. // The provided context supersedes any context provided to the Context method.
  12718. func (c *ForwardingRulesAggregatedListCall) Pages(ctx context.Context, f func(*ForwardingRuleAggregatedList) error) error {
  12719. c.ctx_ = ctx
  12720. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  12721. for {
  12722. x, err := c.Do()
  12723. if err != nil {
  12724. return err
  12725. }
  12726. if err := f(x); err != nil {
  12727. return err
  12728. }
  12729. if x.NextPageToken == "" {
  12730. return nil
  12731. }
  12732. c.PageToken(x.NextPageToken)
  12733. }
  12734. }
  12735. // method id "compute.forwardingRules.delete":
  12736. type ForwardingRulesDeleteCall struct {
  12737. s *Service
  12738. project string
  12739. region string
  12740. forwardingRule string
  12741. urlParams_ gensupport.URLParams
  12742. ctx_ context.Context
  12743. }
  12744. // Delete: Deletes the specified ForwardingRule resource.
  12745. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/delete
  12746. func (r *ForwardingRulesService) Delete(project string, region string, forwardingRule string) *ForwardingRulesDeleteCall {
  12747. c := &ForwardingRulesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12748. c.project = project
  12749. c.region = region
  12750. c.forwardingRule = forwardingRule
  12751. return c
  12752. }
  12753. // Fields allows partial responses to be retrieved. See
  12754. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12755. // for more information.
  12756. func (c *ForwardingRulesDeleteCall) Fields(s ...googleapi.Field) *ForwardingRulesDeleteCall {
  12757. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12758. return c
  12759. }
  12760. // Context sets the context to be used in this call's Do method. Any
  12761. // pending HTTP request will be aborted if the provided context is
  12762. // canceled.
  12763. func (c *ForwardingRulesDeleteCall) Context(ctx context.Context) *ForwardingRulesDeleteCall {
  12764. c.ctx_ = ctx
  12765. return c
  12766. }
  12767. func (c *ForwardingRulesDeleteCall) doRequest(alt string) (*http.Response, error) {
  12768. var body io.Reader = nil
  12769. c.urlParams_.Set("alt", alt)
  12770. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}")
  12771. urls += "?" + c.urlParams_.Encode()
  12772. req, _ := http.NewRequest("DELETE", urls, body)
  12773. googleapi.Expand(req.URL, map[string]string{
  12774. "project": c.project,
  12775. "region": c.region,
  12776. "forwardingRule": c.forwardingRule,
  12777. })
  12778. req.Header.Set("User-Agent", c.s.userAgent())
  12779. if c.ctx_ != nil {
  12780. return ctxhttp.Do(c.ctx_, c.s.client, req)
  12781. }
  12782. return c.s.client.Do(req)
  12783. }
  12784. // Do executes the "compute.forwardingRules.delete" call.
  12785. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  12786. // status code is an error. Response headers are in either
  12787. // *Operation.ServerResponse.Header or (if a response was returned at
  12788. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  12789. // to check whether the returned error was because
  12790. // http.StatusNotModified was returned.
  12791. func (c *ForwardingRulesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  12792. gensupport.SetOptions(c.urlParams_, opts...)
  12793. res, err := c.doRequest("json")
  12794. if res != nil && res.StatusCode == http.StatusNotModified {
  12795. if res.Body != nil {
  12796. res.Body.Close()
  12797. }
  12798. return nil, &googleapi.Error{
  12799. Code: res.StatusCode,
  12800. Header: res.Header,
  12801. }
  12802. }
  12803. if err != nil {
  12804. return nil, err
  12805. }
  12806. defer googleapi.CloseBody(res)
  12807. if err := googleapi.CheckResponse(res); err != nil {
  12808. return nil, err
  12809. }
  12810. ret := &Operation{
  12811. ServerResponse: googleapi.ServerResponse{
  12812. Header: res.Header,
  12813. HTTPStatusCode: res.StatusCode,
  12814. },
  12815. }
  12816. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  12817. return nil, err
  12818. }
  12819. return ret, nil
  12820. // {
  12821. // "description": "Deletes the specified ForwardingRule resource.",
  12822. // "httpMethod": "DELETE",
  12823. // "id": "compute.forwardingRules.delete",
  12824. // "parameterOrder": [
  12825. // "project",
  12826. // "region",
  12827. // "forwardingRule"
  12828. // ],
  12829. // "parameters": {
  12830. // "forwardingRule": {
  12831. // "description": "Name of the ForwardingRule resource to delete.",
  12832. // "location": "path",
  12833. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  12834. // "required": true,
  12835. // "type": "string"
  12836. // },
  12837. // "project": {
  12838. // "description": "Project ID for this request.",
  12839. // "location": "path",
  12840. // "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])?))",
  12841. // "required": true,
  12842. // "type": "string"
  12843. // },
  12844. // "region": {
  12845. // "description": "Name of the region scoping this request.",
  12846. // "location": "path",
  12847. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  12848. // "required": true,
  12849. // "type": "string"
  12850. // }
  12851. // },
  12852. // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}",
  12853. // "response": {
  12854. // "$ref": "Operation"
  12855. // },
  12856. // "scopes": [
  12857. // "https://www.googleapis.com/auth/cloud-platform",
  12858. // "https://www.googleapis.com/auth/compute"
  12859. // ]
  12860. // }
  12861. }
  12862. // method id "compute.forwardingRules.get":
  12863. type ForwardingRulesGetCall struct {
  12864. s *Service
  12865. project string
  12866. region string
  12867. forwardingRule string
  12868. urlParams_ gensupport.URLParams
  12869. ifNoneMatch_ string
  12870. ctx_ context.Context
  12871. }
  12872. // Get: Returns the specified ForwardingRule resource.
  12873. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/get
  12874. func (r *ForwardingRulesService) Get(project string, region string, forwardingRule string) *ForwardingRulesGetCall {
  12875. c := &ForwardingRulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12876. c.project = project
  12877. c.region = region
  12878. c.forwardingRule = forwardingRule
  12879. return c
  12880. }
  12881. // Fields allows partial responses to be retrieved. See
  12882. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12883. // for more information.
  12884. func (c *ForwardingRulesGetCall) Fields(s ...googleapi.Field) *ForwardingRulesGetCall {
  12885. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12886. return c
  12887. }
  12888. // IfNoneMatch sets the optional parameter which makes the operation
  12889. // fail if the object's ETag matches the given value. This is useful for
  12890. // getting updates only after the object has changed since the last
  12891. // request. Use googleapi.IsNotModified to check whether the response
  12892. // error from Do is the result of In-None-Match.
  12893. func (c *ForwardingRulesGetCall) IfNoneMatch(entityTag string) *ForwardingRulesGetCall {
  12894. c.ifNoneMatch_ = entityTag
  12895. return c
  12896. }
  12897. // Context sets the context to be used in this call's Do method. Any
  12898. // pending HTTP request will be aborted if the provided context is
  12899. // canceled.
  12900. func (c *ForwardingRulesGetCall) Context(ctx context.Context) *ForwardingRulesGetCall {
  12901. c.ctx_ = ctx
  12902. return c
  12903. }
  12904. func (c *ForwardingRulesGetCall) doRequest(alt string) (*http.Response, error) {
  12905. var body io.Reader = nil
  12906. c.urlParams_.Set("alt", alt)
  12907. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}")
  12908. urls += "?" + c.urlParams_.Encode()
  12909. req, _ := http.NewRequest("GET", urls, body)
  12910. googleapi.Expand(req.URL, map[string]string{
  12911. "project": c.project,
  12912. "region": c.region,
  12913. "forwardingRule": c.forwardingRule,
  12914. })
  12915. req.Header.Set("User-Agent", c.s.userAgent())
  12916. if c.ifNoneMatch_ != "" {
  12917. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  12918. }
  12919. if c.ctx_ != nil {
  12920. return ctxhttp.Do(c.ctx_, c.s.client, req)
  12921. }
  12922. return c.s.client.Do(req)
  12923. }
  12924. // Do executes the "compute.forwardingRules.get" call.
  12925. // Exactly one of *ForwardingRule or error will be non-nil. Any non-2xx
  12926. // status code is an error. Response headers are in either
  12927. // *ForwardingRule.ServerResponse.Header or (if a response was returned
  12928. // at all) in error.(*googleapi.Error).Header. Use
  12929. // googleapi.IsNotModified to check whether the returned error was
  12930. // because http.StatusNotModified was returned.
  12931. func (c *ForwardingRulesGetCall) Do(opts ...googleapi.CallOption) (*ForwardingRule, error) {
  12932. gensupport.SetOptions(c.urlParams_, opts...)
  12933. res, err := c.doRequest("json")
  12934. if res != nil && res.StatusCode == http.StatusNotModified {
  12935. if res.Body != nil {
  12936. res.Body.Close()
  12937. }
  12938. return nil, &googleapi.Error{
  12939. Code: res.StatusCode,
  12940. Header: res.Header,
  12941. }
  12942. }
  12943. if err != nil {
  12944. return nil, err
  12945. }
  12946. defer googleapi.CloseBody(res)
  12947. if err := googleapi.CheckResponse(res); err != nil {
  12948. return nil, err
  12949. }
  12950. ret := &ForwardingRule{
  12951. ServerResponse: googleapi.ServerResponse{
  12952. Header: res.Header,
  12953. HTTPStatusCode: res.StatusCode,
  12954. },
  12955. }
  12956. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  12957. return nil, err
  12958. }
  12959. return ret, nil
  12960. // {
  12961. // "description": "Returns the specified ForwardingRule resource.",
  12962. // "httpMethod": "GET",
  12963. // "id": "compute.forwardingRules.get",
  12964. // "parameterOrder": [
  12965. // "project",
  12966. // "region",
  12967. // "forwardingRule"
  12968. // ],
  12969. // "parameters": {
  12970. // "forwardingRule": {
  12971. // "description": "Name of the ForwardingRule resource to return.",
  12972. // "location": "path",
  12973. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  12974. // "required": true,
  12975. // "type": "string"
  12976. // },
  12977. // "project": {
  12978. // "description": "Project ID for this request.",
  12979. // "location": "path",
  12980. // "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])?))",
  12981. // "required": true,
  12982. // "type": "string"
  12983. // },
  12984. // "region": {
  12985. // "description": "Name of the region scoping this request.",
  12986. // "location": "path",
  12987. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  12988. // "required": true,
  12989. // "type": "string"
  12990. // }
  12991. // },
  12992. // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}",
  12993. // "response": {
  12994. // "$ref": "ForwardingRule"
  12995. // },
  12996. // "scopes": [
  12997. // "https://www.googleapis.com/auth/cloud-platform",
  12998. // "https://www.googleapis.com/auth/compute",
  12999. // "https://www.googleapis.com/auth/compute.readonly"
  13000. // ]
  13001. // }
  13002. }
  13003. // method id "compute.forwardingRules.insert":
  13004. type ForwardingRulesInsertCall struct {
  13005. s *Service
  13006. project string
  13007. region string
  13008. forwardingrule *ForwardingRule
  13009. urlParams_ gensupport.URLParams
  13010. ctx_ context.Context
  13011. }
  13012. // Insert: Creates a ForwardingRule resource in the specified project
  13013. // and region using the data included in the request.
  13014. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/insert
  13015. func (r *ForwardingRulesService) Insert(project string, region string, forwardingrule *ForwardingRule) *ForwardingRulesInsertCall {
  13016. c := &ForwardingRulesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13017. c.project = project
  13018. c.region = region
  13019. c.forwardingrule = forwardingrule
  13020. return c
  13021. }
  13022. // Fields allows partial responses to be retrieved. See
  13023. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13024. // for more information.
  13025. func (c *ForwardingRulesInsertCall) Fields(s ...googleapi.Field) *ForwardingRulesInsertCall {
  13026. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13027. return c
  13028. }
  13029. // Context sets the context to be used in this call's Do method. Any
  13030. // pending HTTP request will be aborted if the provided context is
  13031. // canceled.
  13032. func (c *ForwardingRulesInsertCall) Context(ctx context.Context) *ForwardingRulesInsertCall {
  13033. c.ctx_ = ctx
  13034. return c
  13035. }
  13036. func (c *ForwardingRulesInsertCall) doRequest(alt string) (*http.Response, error) {
  13037. var body io.Reader = nil
  13038. body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule)
  13039. if err != nil {
  13040. return nil, err
  13041. }
  13042. ctype := "application/json"
  13043. c.urlParams_.Set("alt", alt)
  13044. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules")
  13045. urls += "?" + c.urlParams_.Encode()
  13046. req, _ := http.NewRequest("POST", urls, body)
  13047. googleapi.Expand(req.URL, map[string]string{
  13048. "project": c.project,
  13049. "region": c.region,
  13050. })
  13051. req.Header.Set("Content-Type", ctype)
  13052. req.Header.Set("User-Agent", c.s.userAgent())
  13053. if c.ctx_ != nil {
  13054. return ctxhttp.Do(c.ctx_, c.s.client, req)
  13055. }
  13056. return c.s.client.Do(req)
  13057. }
  13058. // Do executes the "compute.forwardingRules.insert" call.
  13059. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  13060. // status code is an error. Response headers are in either
  13061. // *Operation.ServerResponse.Header or (if a response was returned at
  13062. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  13063. // to check whether the returned error was because
  13064. // http.StatusNotModified was returned.
  13065. func (c *ForwardingRulesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  13066. gensupport.SetOptions(c.urlParams_, opts...)
  13067. res, err := c.doRequest("json")
  13068. if res != nil && res.StatusCode == http.StatusNotModified {
  13069. if res.Body != nil {
  13070. res.Body.Close()
  13071. }
  13072. return nil, &googleapi.Error{
  13073. Code: res.StatusCode,
  13074. Header: res.Header,
  13075. }
  13076. }
  13077. if err != nil {
  13078. return nil, err
  13079. }
  13080. defer googleapi.CloseBody(res)
  13081. if err := googleapi.CheckResponse(res); err != nil {
  13082. return nil, err
  13083. }
  13084. ret := &Operation{
  13085. ServerResponse: googleapi.ServerResponse{
  13086. Header: res.Header,
  13087. HTTPStatusCode: res.StatusCode,
  13088. },
  13089. }
  13090. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  13091. return nil, err
  13092. }
  13093. return ret, nil
  13094. // {
  13095. // "description": "Creates a ForwardingRule resource in the specified project and region using the data included in the request.",
  13096. // "httpMethod": "POST",
  13097. // "id": "compute.forwardingRules.insert",
  13098. // "parameterOrder": [
  13099. // "project",
  13100. // "region"
  13101. // ],
  13102. // "parameters": {
  13103. // "project": {
  13104. // "description": "Project ID for this request.",
  13105. // "location": "path",
  13106. // "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])?))",
  13107. // "required": true,
  13108. // "type": "string"
  13109. // },
  13110. // "region": {
  13111. // "description": "Name of the region scoping this request.",
  13112. // "location": "path",
  13113. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  13114. // "required": true,
  13115. // "type": "string"
  13116. // }
  13117. // },
  13118. // "path": "{project}/regions/{region}/forwardingRules",
  13119. // "request": {
  13120. // "$ref": "ForwardingRule"
  13121. // },
  13122. // "response": {
  13123. // "$ref": "Operation"
  13124. // },
  13125. // "scopes": [
  13126. // "https://www.googleapis.com/auth/cloud-platform",
  13127. // "https://www.googleapis.com/auth/compute"
  13128. // ]
  13129. // }
  13130. }
  13131. // method id "compute.forwardingRules.list":
  13132. type ForwardingRulesListCall struct {
  13133. s *Service
  13134. project string
  13135. region string
  13136. urlParams_ gensupport.URLParams
  13137. ifNoneMatch_ string
  13138. ctx_ context.Context
  13139. }
  13140. // List: Retrieves a list of ForwardingRule resources available to the
  13141. // specified project and region.
  13142. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/list
  13143. func (r *ForwardingRulesService) List(project string, region string) *ForwardingRulesListCall {
  13144. c := &ForwardingRulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13145. c.project = project
  13146. c.region = region
  13147. return c
  13148. }
  13149. // Filter sets the optional parameter "filter": Sets a filter expression
  13150. // for filtering listed resources, in the form filter={expression}. Your
  13151. // {expression} must be in the format: field_name comparison_string
  13152. // literal_string.
  13153. //
  13154. // The field_name is the name of the field you want to compare. Only
  13155. // atomic field types are supported (string, number, boolean). The
  13156. // comparison_string must be either eq (equals) or ne (not equals). The
  13157. // literal_string is the string value to filter to. The literal value
  13158. // must be valid for the type of field you are filtering by (string,
  13159. // number, boolean). For string fields, the literal value is interpreted
  13160. // as a regular expression using RE2 syntax. The literal value must
  13161. // match the entire field.
  13162. //
  13163. // For example, filter=name ne example-instance.
  13164. //
  13165. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  13166. // you can also filter on nested fields. For example, you could filter
  13167. // on instances that have set the scheduling.automaticRestart field to
  13168. // true. In particular, use filtering on nested fields to take advantage
  13169. // of instance labels to organize and filter results based on label
  13170. // values.
  13171. //
  13172. // The Beta API also supports filtering on multiple expressions by
  13173. // providing each separate expression within parentheses. For example,
  13174. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  13175. // Multiple expressions are treated as AND expressions meaning that
  13176. // resources must match all expressions to pass the filters.
  13177. func (c *ForwardingRulesListCall) Filter(filter string) *ForwardingRulesListCall {
  13178. c.urlParams_.Set("filter", filter)
  13179. return c
  13180. }
  13181. // MaxResults sets the optional parameter "maxResults": The maximum
  13182. // number of results per page that Compute Engine should return. If the
  13183. // number of available results is larger than maxResults, Compute Engine
  13184. // returns a nextPageToken that can be used to get the next page of
  13185. // results in subsequent list requests.
  13186. func (c *ForwardingRulesListCall) MaxResults(maxResults int64) *ForwardingRulesListCall {
  13187. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  13188. return c
  13189. }
  13190. // PageToken sets the optional parameter "pageToken": Specifies a page
  13191. // token to use. Set pageToken to the nextPageToken returned by a
  13192. // previous list request to get the next page of results.
  13193. func (c *ForwardingRulesListCall) PageToken(pageToken string) *ForwardingRulesListCall {
  13194. c.urlParams_.Set("pageToken", pageToken)
  13195. return c
  13196. }
  13197. // Fields allows partial responses to be retrieved. See
  13198. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13199. // for more information.
  13200. func (c *ForwardingRulesListCall) Fields(s ...googleapi.Field) *ForwardingRulesListCall {
  13201. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13202. return c
  13203. }
  13204. // IfNoneMatch sets the optional parameter which makes the operation
  13205. // fail if the object's ETag matches the given value. This is useful for
  13206. // getting updates only after the object has changed since the last
  13207. // request. Use googleapi.IsNotModified to check whether the response
  13208. // error from Do is the result of In-None-Match.
  13209. func (c *ForwardingRulesListCall) IfNoneMatch(entityTag string) *ForwardingRulesListCall {
  13210. c.ifNoneMatch_ = entityTag
  13211. return c
  13212. }
  13213. // Context sets the context to be used in this call's Do method. Any
  13214. // pending HTTP request will be aborted if the provided context is
  13215. // canceled.
  13216. func (c *ForwardingRulesListCall) Context(ctx context.Context) *ForwardingRulesListCall {
  13217. c.ctx_ = ctx
  13218. return c
  13219. }
  13220. func (c *ForwardingRulesListCall) doRequest(alt string) (*http.Response, error) {
  13221. var body io.Reader = nil
  13222. c.urlParams_.Set("alt", alt)
  13223. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules")
  13224. urls += "?" + c.urlParams_.Encode()
  13225. req, _ := http.NewRequest("GET", urls, body)
  13226. googleapi.Expand(req.URL, map[string]string{
  13227. "project": c.project,
  13228. "region": c.region,
  13229. })
  13230. req.Header.Set("User-Agent", c.s.userAgent())
  13231. if c.ifNoneMatch_ != "" {
  13232. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  13233. }
  13234. if c.ctx_ != nil {
  13235. return ctxhttp.Do(c.ctx_, c.s.client, req)
  13236. }
  13237. return c.s.client.Do(req)
  13238. }
  13239. // Do executes the "compute.forwardingRules.list" call.
  13240. // Exactly one of *ForwardingRuleList or error will be non-nil. Any
  13241. // non-2xx status code is an error. Response headers are in either
  13242. // *ForwardingRuleList.ServerResponse.Header or (if a response was
  13243. // returned at all) in error.(*googleapi.Error).Header. Use
  13244. // googleapi.IsNotModified to check whether the returned error was
  13245. // because http.StatusNotModified was returned.
  13246. func (c *ForwardingRulesListCall) Do(opts ...googleapi.CallOption) (*ForwardingRuleList, error) {
  13247. gensupport.SetOptions(c.urlParams_, opts...)
  13248. res, err := c.doRequest("json")
  13249. if res != nil && res.StatusCode == http.StatusNotModified {
  13250. if res.Body != nil {
  13251. res.Body.Close()
  13252. }
  13253. return nil, &googleapi.Error{
  13254. Code: res.StatusCode,
  13255. Header: res.Header,
  13256. }
  13257. }
  13258. if err != nil {
  13259. return nil, err
  13260. }
  13261. defer googleapi.CloseBody(res)
  13262. if err := googleapi.CheckResponse(res); err != nil {
  13263. return nil, err
  13264. }
  13265. ret := &ForwardingRuleList{
  13266. ServerResponse: googleapi.ServerResponse{
  13267. Header: res.Header,
  13268. HTTPStatusCode: res.StatusCode,
  13269. },
  13270. }
  13271. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  13272. return nil, err
  13273. }
  13274. return ret, nil
  13275. // {
  13276. // "description": "Retrieves a list of ForwardingRule resources available to the specified project and region.",
  13277. // "httpMethod": "GET",
  13278. // "id": "compute.forwardingRules.list",
  13279. // "parameterOrder": [
  13280. // "project",
  13281. // "region"
  13282. // ],
  13283. // "parameters": {
  13284. // "filter": {
  13285. // "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.",
  13286. // "location": "query",
  13287. // "type": "string"
  13288. // },
  13289. // "maxResults": {
  13290. // "default": "500",
  13291. // "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.",
  13292. // "format": "uint32",
  13293. // "location": "query",
  13294. // "maximum": "500",
  13295. // "minimum": "0",
  13296. // "type": "integer"
  13297. // },
  13298. // "pageToken": {
  13299. // "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.",
  13300. // "location": "query",
  13301. // "type": "string"
  13302. // },
  13303. // "project": {
  13304. // "description": "Project ID for this request.",
  13305. // "location": "path",
  13306. // "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])?))",
  13307. // "required": true,
  13308. // "type": "string"
  13309. // },
  13310. // "region": {
  13311. // "description": "Name of the region scoping this request.",
  13312. // "location": "path",
  13313. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  13314. // "required": true,
  13315. // "type": "string"
  13316. // }
  13317. // },
  13318. // "path": "{project}/regions/{region}/forwardingRules",
  13319. // "response": {
  13320. // "$ref": "ForwardingRuleList"
  13321. // },
  13322. // "scopes": [
  13323. // "https://www.googleapis.com/auth/cloud-platform",
  13324. // "https://www.googleapis.com/auth/compute",
  13325. // "https://www.googleapis.com/auth/compute.readonly"
  13326. // ]
  13327. // }
  13328. }
  13329. // Pages invokes f for each page of results.
  13330. // A non-nil error returned from f will halt the iteration.
  13331. // The provided context supersedes any context provided to the Context method.
  13332. func (c *ForwardingRulesListCall) Pages(ctx context.Context, f func(*ForwardingRuleList) error) error {
  13333. c.ctx_ = ctx
  13334. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  13335. for {
  13336. x, err := c.Do()
  13337. if err != nil {
  13338. return err
  13339. }
  13340. if err := f(x); err != nil {
  13341. return err
  13342. }
  13343. if x.NextPageToken == "" {
  13344. return nil
  13345. }
  13346. c.PageToken(x.NextPageToken)
  13347. }
  13348. }
  13349. // method id "compute.forwardingRules.setTarget":
  13350. type ForwardingRulesSetTargetCall struct {
  13351. s *Service
  13352. project string
  13353. region string
  13354. forwardingRule string
  13355. targetreference *TargetReference
  13356. urlParams_ gensupport.URLParams
  13357. ctx_ context.Context
  13358. }
  13359. // SetTarget: Changes target URL for forwarding rule. The new target
  13360. // should be of the same type as the old target.
  13361. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/setTarget
  13362. func (r *ForwardingRulesService) SetTarget(project string, region string, forwardingRule string, targetreference *TargetReference) *ForwardingRulesSetTargetCall {
  13363. c := &ForwardingRulesSetTargetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13364. c.project = project
  13365. c.region = region
  13366. c.forwardingRule = forwardingRule
  13367. c.targetreference = targetreference
  13368. return c
  13369. }
  13370. // Fields allows partial responses to be retrieved. See
  13371. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13372. // for more information.
  13373. func (c *ForwardingRulesSetTargetCall) Fields(s ...googleapi.Field) *ForwardingRulesSetTargetCall {
  13374. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13375. return c
  13376. }
  13377. // Context sets the context to be used in this call's Do method. Any
  13378. // pending HTTP request will be aborted if the provided context is
  13379. // canceled.
  13380. func (c *ForwardingRulesSetTargetCall) Context(ctx context.Context) *ForwardingRulesSetTargetCall {
  13381. c.ctx_ = ctx
  13382. return c
  13383. }
  13384. func (c *ForwardingRulesSetTargetCall) doRequest(alt string) (*http.Response, error) {
  13385. var body io.Reader = nil
  13386. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference)
  13387. if err != nil {
  13388. return nil, err
  13389. }
  13390. ctype := "application/json"
  13391. c.urlParams_.Set("alt", alt)
  13392. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget")
  13393. urls += "?" + c.urlParams_.Encode()
  13394. req, _ := http.NewRequest("POST", urls, body)
  13395. googleapi.Expand(req.URL, map[string]string{
  13396. "project": c.project,
  13397. "region": c.region,
  13398. "forwardingRule": c.forwardingRule,
  13399. })
  13400. req.Header.Set("Content-Type", ctype)
  13401. req.Header.Set("User-Agent", c.s.userAgent())
  13402. if c.ctx_ != nil {
  13403. return ctxhttp.Do(c.ctx_, c.s.client, req)
  13404. }
  13405. return c.s.client.Do(req)
  13406. }
  13407. // Do executes the "compute.forwardingRules.setTarget" call.
  13408. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  13409. // status code is an error. Response headers are in either
  13410. // *Operation.ServerResponse.Header or (if a response was returned at
  13411. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  13412. // to check whether the returned error was because
  13413. // http.StatusNotModified was returned.
  13414. func (c *ForwardingRulesSetTargetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  13415. gensupport.SetOptions(c.urlParams_, opts...)
  13416. res, err := c.doRequest("json")
  13417. if res != nil && res.StatusCode == http.StatusNotModified {
  13418. if res.Body != nil {
  13419. res.Body.Close()
  13420. }
  13421. return nil, &googleapi.Error{
  13422. Code: res.StatusCode,
  13423. Header: res.Header,
  13424. }
  13425. }
  13426. if err != nil {
  13427. return nil, err
  13428. }
  13429. defer googleapi.CloseBody(res)
  13430. if err := googleapi.CheckResponse(res); err != nil {
  13431. return nil, err
  13432. }
  13433. ret := &Operation{
  13434. ServerResponse: googleapi.ServerResponse{
  13435. Header: res.Header,
  13436. HTTPStatusCode: res.StatusCode,
  13437. },
  13438. }
  13439. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  13440. return nil, err
  13441. }
  13442. return ret, nil
  13443. // {
  13444. // "description": "Changes target URL for forwarding rule. The new target should be of the same type as the old target.",
  13445. // "httpMethod": "POST",
  13446. // "id": "compute.forwardingRules.setTarget",
  13447. // "parameterOrder": [
  13448. // "project",
  13449. // "region",
  13450. // "forwardingRule"
  13451. // ],
  13452. // "parameters": {
  13453. // "forwardingRule": {
  13454. // "description": "Name of the ForwardingRule resource in which target is to be set.",
  13455. // "location": "path",
  13456. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  13457. // "required": true,
  13458. // "type": "string"
  13459. // },
  13460. // "project": {
  13461. // "description": "Project ID for this request.",
  13462. // "location": "path",
  13463. // "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])?))",
  13464. // "required": true,
  13465. // "type": "string"
  13466. // },
  13467. // "region": {
  13468. // "description": "Name of the region scoping this request.",
  13469. // "location": "path",
  13470. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  13471. // "required": true,
  13472. // "type": "string"
  13473. // }
  13474. // },
  13475. // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget",
  13476. // "request": {
  13477. // "$ref": "TargetReference"
  13478. // },
  13479. // "response": {
  13480. // "$ref": "Operation"
  13481. // },
  13482. // "scopes": [
  13483. // "https://www.googleapis.com/auth/cloud-platform",
  13484. // "https://www.googleapis.com/auth/compute"
  13485. // ]
  13486. // }
  13487. }
  13488. // method id "compute.globalAddresses.delete":
  13489. type GlobalAddressesDeleteCall struct {
  13490. s *Service
  13491. project string
  13492. address string
  13493. urlParams_ gensupport.URLParams
  13494. ctx_ context.Context
  13495. }
  13496. // Delete: Deletes the specified address resource.
  13497. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/delete
  13498. func (r *GlobalAddressesService) Delete(project string, address string) *GlobalAddressesDeleteCall {
  13499. c := &GlobalAddressesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13500. c.project = project
  13501. c.address = address
  13502. return c
  13503. }
  13504. // Fields allows partial responses to be retrieved. See
  13505. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13506. // for more information.
  13507. func (c *GlobalAddressesDeleteCall) Fields(s ...googleapi.Field) *GlobalAddressesDeleteCall {
  13508. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13509. return c
  13510. }
  13511. // Context sets the context to be used in this call's Do method. Any
  13512. // pending HTTP request will be aborted if the provided context is
  13513. // canceled.
  13514. func (c *GlobalAddressesDeleteCall) Context(ctx context.Context) *GlobalAddressesDeleteCall {
  13515. c.ctx_ = ctx
  13516. return c
  13517. }
  13518. func (c *GlobalAddressesDeleteCall) doRequest(alt string) (*http.Response, error) {
  13519. var body io.Reader = nil
  13520. c.urlParams_.Set("alt", alt)
  13521. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{address}")
  13522. urls += "?" + c.urlParams_.Encode()
  13523. req, _ := http.NewRequest("DELETE", urls, body)
  13524. googleapi.Expand(req.URL, map[string]string{
  13525. "project": c.project,
  13526. "address": c.address,
  13527. })
  13528. req.Header.Set("User-Agent", c.s.userAgent())
  13529. if c.ctx_ != nil {
  13530. return ctxhttp.Do(c.ctx_, c.s.client, req)
  13531. }
  13532. return c.s.client.Do(req)
  13533. }
  13534. // Do executes the "compute.globalAddresses.delete" call.
  13535. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  13536. // status code is an error. Response headers are in either
  13537. // *Operation.ServerResponse.Header or (if a response was returned at
  13538. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  13539. // to check whether the returned error was because
  13540. // http.StatusNotModified was returned.
  13541. func (c *GlobalAddressesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  13542. gensupport.SetOptions(c.urlParams_, opts...)
  13543. res, err := c.doRequest("json")
  13544. if res != nil && res.StatusCode == http.StatusNotModified {
  13545. if res.Body != nil {
  13546. res.Body.Close()
  13547. }
  13548. return nil, &googleapi.Error{
  13549. Code: res.StatusCode,
  13550. Header: res.Header,
  13551. }
  13552. }
  13553. if err != nil {
  13554. return nil, err
  13555. }
  13556. defer googleapi.CloseBody(res)
  13557. if err := googleapi.CheckResponse(res); err != nil {
  13558. return nil, err
  13559. }
  13560. ret := &Operation{
  13561. ServerResponse: googleapi.ServerResponse{
  13562. Header: res.Header,
  13563. HTTPStatusCode: res.StatusCode,
  13564. },
  13565. }
  13566. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  13567. return nil, err
  13568. }
  13569. return ret, nil
  13570. // {
  13571. // "description": "Deletes the specified address resource.",
  13572. // "httpMethod": "DELETE",
  13573. // "id": "compute.globalAddresses.delete",
  13574. // "parameterOrder": [
  13575. // "project",
  13576. // "address"
  13577. // ],
  13578. // "parameters": {
  13579. // "address": {
  13580. // "description": "Name of the address resource to delete.",
  13581. // "location": "path",
  13582. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  13583. // "required": true,
  13584. // "type": "string"
  13585. // },
  13586. // "project": {
  13587. // "description": "Project ID for this request.",
  13588. // "location": "path",
  13589. // "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])?))",
  13590. // "required": true,
  13591. // "type": "string"
  13592. // }
  13593. // },
  13594. // "path": "{project}/global/addresses/{address}",
  13595. // "response": {
  13596. // "$ref": "Operation"
  13597. // },
  13598. // "scopes": [
  13599. // "https://www.googleapis.com/auth/cloud-platform",
  13600. // "https://www.googleapis.com/auth/compute"
  13601. // ]
  13602. // }
  13603. }
  13604. // method id "compute.globalAddresses.get":
  13605. type GlobalAddressesGetCall struct {
  13606. s *Service
  13607. project string
  13608. address string
  13609. urlParams_ gensupport.URLParams
  13610. ifNoneMatch_ string
  13611. ctx_ context.Context
  13612. }
  13613. // Get: Returns the specified address resource.
  13614. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/get
  13615. func (r *GlobalAddressesService) Get(project string, address string) *GlobalAddressesGetCall {
  13616. c := &GlobalAddressesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13617. c.project = project
  13618. c.address = address
  13619. return c
  13620. }
  13621. // Fields allows partial responses to be retrieved. See
  13622. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13623. // for more information.
  13624. func (c *GlobalAddressesGetCall) Fields(s ...googleapi.Field) *GlobalAddressesGetCall {
  13625. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13626. return c
  13627. }
  13628. // IfNoneMatch sets the optional parameter which makes the operation
  13629. // fail if the object's ETag matches the given value. This is useful for
  13630. // getting updates only after the object has changed since the last
  13631. // request. Use googleapi.IsNotModified to check whether the response
  13632. // error from Do is the result of In-None-Match.
  13633. func (c *GlobalAddressesGetCall) IfNoneMatch(entityTag string) *GlobalAddressesGetCall {
  13634. c.ifNoneMatch_ = entityTag
  13635. return c
  13636. }
  13637. // Context sets the context to be used in this call's Do method. Any
  13638. // pending HTTP request will be aborted if the provided context is
  13639. // canceled.
  13640. func (c *GlobalAddressesGetCall) Context(ctx context.Context) *GlobalAddressesGetCall {
  13641. c.ctx_ = ctx
  13642. return c
  13643. }
  13644. func (c *GlobalAddressesGetCall) doRequest(alt string) (*http.Response, error) {
  13645. var body io.Reader = nil
  13646. c.urlParams_.Set("alt", alt)
  13647. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{address}")
  13648. urls += "?" + c.urlParams_.Encode()
  13649. req, _ := http.NewRequest("GET", urls, body)
  13650. googleapi.Expand(req.URL, map[string]string{
  13651. "project": c.project,
  13652. "address": c.address,
  13653. })
  13654. req.Header.Set("User-Agent", c.s.userAgent())
  13655. if c.ifNoneMatch_ != "" {
  13656. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  13657. }
  13658. if c.ctx_ != nil {
  13659. return ctxhttp.Do(c.ctx_, c.s.client, req)
  13660. }
  13661. return c.s.client.Do(req)
  13662. }
  13663. // Do executes the "compute.globalAddresses.get" call.
  13664. // Exactly one of *Address or error will be non-nil. Any non-2xx status
  13665. // code is an error. Response headers are in either
  13666. // *Address.ServerResponse.Header or (if a response was returned at all)
  13667. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  13668. // check whether the returned error was because http.StatusNotModified
  13669. // was returned.
  13670. func (c *GlobalAddressesGetCall) Do(opts ...googleapi.CallOption) (*Address, error) {
  13671. gensupport.SetOptions(c.urlParams_, opts...)
  13672. res, err := c.doRequest("json")
  13673. if res != nil && res.StatusCode == http.StatusNotModified {
  13674. if res.Body != nil {
  13675. res.Body.Close()
  13676. }
  13677. return nil, &googleapi.Error{
  13678. Code: res.StatusCode,
  13679. Header: res.Header,
  13680. }
  13681. }
  13682. if err != nil {
  13683. return nil, err
  13684. }
  13685. defer googleapi.CloseBody(res)
  13686. if err := googleapi.CheckResponse(res); err != nil {
  13687. return nil, err
  13688. }
  13689. ret := &Address{
  13690. ServerResponse: googleapi.ServerResponse{
  13691. Header: res.Header,
  13692. HTTPStatusCode: res.StatusCode,
  13693. },
  13694. }
  13695. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  13696. return nil, err
  13697. }
  13698. return ret, nil
  13699. // {
  13700. // "description": "Returns the specified address resource.",
  13701. // "httpMethod": "GET",
  13702. // "id": "compute.globalAddresses.get",
  13703. // "parameterOrder": [
  13704. // "project",
  13705. // "address"
  13706. // ],
  13707. // "parameters": {
  13708. // "address": {
  13709. // "description": "Name of the address resource to return.",
  13710. // "location": "path",
  13711. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  13712. // "required": true,
  13713. // "type": "string"
  13714. // },
  13715. // "project": {
  13716. // "description": "Project ID for this request.",
  13717. // "location": "path",
  13718. // "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])?))",
  13719. // "required": true,
  13720. // "type": "string"
  13721. // }
  13722. // },
  13723. // "path": "{project}/global/addresses/{address}",
  13724. // "response": {
  13725. // "$ref": "Address"
  13726. // },
  13727. // "scopes": [
  13728. // "https://www.googleapis.com/auth/cloud-platform",
  13729. // "https://www.googleapis.com/auth/compute",
  13730. // "https://www.googleapis.com/auth/compute.readonly"
  13731. // ]
  13732. // }
  13733. }
  13734. // method id "compute.globalAddresses.insert":
  13735. type GlobalAddressesInsertCall struct {
  13736. s *Service
  13737. project string
  13738. address *Address
  13739. urlParams_ gensupport.URLParams
  13740. ctx_ context.Context
  13741. }
  13742. // Insert: Creates an address resource in the specified project using
  13743. // the data included in the request.
  13744. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/insert
  13745. func (r *GlobalAddressesService) Insert(project string, address *Address) *GlobalAddressesInsertCall {
  13746. c := &GlobalAddressesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13747. c.project = project
  13748. c.address = address
  13749. return c
  13750. }
  13751. // Fields allows partial responses to be retrieved. See
  13752. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13753. // for more information.
  13754. func (c *GlobalAddressesInsertCall) Fields(s ...googleapi.Field) *GlobalAddressesInsertCall {
  13755. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13756. return c
  13757. }
  13758. // Context sets the context to be used in this call's Do method. Any
  13759. // pending HTTP request will be aborted if the provided context is
  13760. // canceled.
  13761. func (c *GlobalAddressesInsertCall) Context(ctx context.Context) *GlobalAddressesInsertCall {
  13762. c.ctx_ = ctx
  13763. return c
  13764. }
  13765. func (c *GlobalAddressesInsertCall) doRequest(alt string) (*http.Response, error) {
  13766. var body io.Reader = nil
  13767. body, err := googleapi.WithoutDataWrapper.JSONReader(c.address)
  13768. if err != nil {
  13769. return nil, err
  13770. }
  13771. ctype := "application/json"
  13772. c.urlParams_.Set("alt", alt)
  13773. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses")
  13774. urls += "?" + c.urlParams_.Encode()
  13775. req, _ := http.NewRequest("POST", urls, body)
  13776. googleapi.Expand(req.URL, map[string]string{
  13777. "project": c.project,
  13778. })
  13779. req.Header.Set("Content-Type", ctype)
  13780. req.Header.Set("User-Agent", c.s.userAgent())
  13781. if c.ctx_ != nil {
  13782. return ctxhttp.Do(c.ctx_, c.s.client, req)
  13783. }
  13784. return c.s.client.Do(req)
  13785. }
  13786. // Do executes the "compute.globalAddresses.insert" call.
  13787. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  13788. // status code is an error. Response headers are in either
  13789. // *Operation.ServerResponse.Header or (if a response was returned at
  13790. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  13791. // to check whether the returned error was because
  13792. // http.StatusNotModified was returned.
  13793. func (c *GlobalAddressesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  13794. gensupport.SetOptions(c.urlParams_, opts...)
  13795. res, err := c.doRequest("json")
  13796. if res != nil && res.StatusCode == http.StatusNotModified {
  13797. if res.Body != nil {
  13798. res.Body.Close()
  13799. }
  13800. return nil, &googleapi.Error{
  13801. Code: res.StatusCode,
  13802. Header: res.Header,
  13803. }
  13804. }
  13805. if err != nil {
  13806. return nil, err
  13807. }
  13808. defer googleapi.CloseBody(res)
  13809. if err := googleapi.CheckResponse(res); err != nil {
  13810. return nil, err
  13811. }
  13812. ret := &Operation{
  13813. ServerResponse: googleapi.ServerResponse{
  13814. Header: res.Header,
  13815. HTTPStatusCode: res.StatusCode,
  13816. },
  13817. }
  13818. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  13819. return nil, err
  13820. }
  13821. return ret, nil
  13822. // {
  13823. // "description": "Creates an address resource in the specified project using the data included in the request.",
  13824. // "httpMethod": "POST",
  13825. // "id": "compute.globalAddresses.insert",
  13826. // "parameterOrder": [
  13827. // "project"
  13828. // ],
  13829. // "parameters": {
  13830. // "project": {
  13831. // "description": "Project ID for this request.",
  13832. // "location": "path",
  13833. // "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])?))",
  13834. // "required": true,
  13835. // "type": "string"
  13836. // }
  13837. // },
  13838. // "path": "{project}/global/addresses",
  13839. // "request": {
  13840. // "$ref": "Address"
  13841. // },
  13842. // "response": {
  13843. // "$ref": "Operation"
  13844. // },
  13845. // "scopes": [
  13846. // "https://www.googleapis.com/auth/cloud-platform",
  13847. // "https://www.googleapis.com/auth/compute"
  13848. // ]
  13849. // }
  13850. }
  13851. // method id "compute.globalAddresses.list":
  13852. type GlobalAddressesListCall struct {
  13853. s *Service
  13854. project string
  13855. urlParams_ gensupport.URLParams
  13856. ifNoneMatch_ string
  13857. ctx_ context.Context
  13858. }
  13859. // List: Retrieves a list of global address resources.
  13860. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/list
  13861. func (r *GlobalAddressesService) List(project string) *GlobalAddressesListCall {
  13862. c := &GlobalAddressesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13863. c.project = project
  13864. return c
  13865. }
  13866. // Filter sets the optional parameter "filter": Sets a filter expression
  13867. // for filtering listed resources, in the form filter={expression}. Your
  13868. // {expression} must be in the format: field_name comparison_string
  13869. // literal_string.
  13870. //
  13871. // The field_name is the name of the field you want to compare. Only
  13872. // atomic field types are supported (string, number, boolean). The
  13873. // comparison_string must be either eq (equals) or ne (not equals). The
  13874. // literal_string is the string value to filter to. The literal value
  13875. // must be valid for the type of field you are filtering by (string,
  13876. // number, boolean). For string fields, the literal value is interpreted
  13877. // as a regular expression using RE2 syntax. The literal value must
  13878. // match the entire field.
  13879. //
  13880. // For example, filter=name ne example-instance.
  13881. //
  13882. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  13883. // you can also filter on nested fields. For example, you could filter
  13884. // on instances that have set the scheduling.automaticRestart field to
  13885. // true. In particular, use filtering on nested fields to take advantage
  13886. // of instance labels to organize and filter results based on label
  13887. // values.
  13888. //
  13889. // The Beta API also supports filtering on multiple expressions by
  13890. // providing each separate expression within parentheses. For example,
  13891. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  13892. // Multiple expressions are treated as AND expressions meaning that
  13893. // resources must match all expressions to pass the filters.
  13894. func (c *GlobalAddressesListCall) Filter(filter string) *GlobalAddressesListCall {
  13895. c.urlParams_.Set("filter", filter)
  13896. return c
  13897. }
  13898. // MaxResults sets the optional parameter "maxResults": The maximum
  13899. // number of results per page that Compute Engine should return. If the
  13900. // number of available results is larger than maxResults, Compute Engine
  13901. // returns a nextPageToken that can be used to get the next page of
  13902. // results in subsequent list requests.
  13903. func (c *GlobalAddressesListCall) MaxResults(maxResults int64) *GlobalAddressesListCall {
  13904. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  13905. return c
  13906. }
  13907. // PageToken sets the optional parameter "pageToken": Specifies a page
  13908. // token to use. Set pageToken to the nextPageToken returned by a
  13909. // previous list request to get the next page of results.
  13910. func (c *GlobalAddressesListCall) PageToken(pageToken string) *GlobalAddressesListCall {
  13911. c.urlParams_.Set("pageToken", pageToken)
  13912. return c
  13913. }
  13914. // Fields allows partial responses to be retrieved. See
  13915. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13916. // for more information.
  13917. func (c *GlobalAddressesListCall) Fields(s ...googleapi.Field) *GlobalAddressesListCall {
  13918. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13919. return c
  13920. }
  13921. // IfNoneMatch sets the optional parameter which makes the operation
  13922. // fail if the object's ETag matches the given value. This is useful for
  13923. // getting updates only after the object has changed since the last
  13924. // request. Use googleapi.IsNotModified to check whether the response
  13925. // error from Do is the result of In-None-Match.
  13926. func (c *GlobalAddressesListCall) IfNoneMatch(entityTag string) *GlobalAddressesListCall {
  13927. c.ifNoneMatch_ = entityTag
  13928. return c
  13929. }
  13930. // Context sets the context to be used in this call's Do method. Any
  13931. // pending HTTP request will be aborted if the provided context is
  13932. // canceled.
  13933. func (c *GlobalAddressesListCall) Context(ctx context.Context) *GlobalAddressesListCall {
  13934. c.ctx_ = ctx
  13935. return c
  13936. }
  13937. func (c *GlobalAddressesListCall) doRequest(alt string) (*http.Response, error) {
  13938. var body io.Reader = nil
  13939. c.urlParams_.Set("alt", alt)
  13940. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses")
  13941. urls += "?" + c.urlParams_.Encode()
  13942. req, _ := http.NewRequest("GET", urls, body)
  13943. googleapi.Expand(req.URL, map[string]string{
  13944. "project": c.project,
  13945. })
  13946. req.Header.Set("User-Agent", c.s.userAgent())
  13947. if c.ifNoneMatch_ != "" {
  13948. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  13949. }
  13950. if c.ctx_ != nil {
  13951. return ctxhttp.Do(c.ctx_, c.s.client, req)
  13952. }
  13953. return c.s.client.Do(req)
  13954. }
  13955. // Do executes the "compute.globalAddresses.list" call.
  13956. // Exactly one of *AddressList or error will be non-nil. Any non-2xx
  13957. // status code is an error. Response headers are in either
  13958. // *AddressList.ServerResponse.Header or (if a response was returned at
  13959. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  13960. // to check whether the returned error was because
  13961. // http.StatusNotModified was returned.
  13962. func (c *GlobalAddressesListCall) Do(opts ...googleapi.CallOption) (*AddressList, error) {
  13963. gensupport.SetOptions(c.urlParams_, opts...)
  13964. res, err := c.doRequest("json")
  13965. if res != nil && res.StatusCode == http.StatusNotModified {
  13966. if res.Body != nil {
  13967. res.Body.Close()
  13968. }
  13969. return nil, &googleapi.Error{
  13970. Code: res.StatusCode,
  13971. Header: res.Header,
  13972. }
  13973. }
  13974. if err != nil {
  13975. return nil, err
  13976. }
  13977. defer googleapi.CloseBody(res)
  13978. if err := googleapi.CheckResponse(res); err != nil {
  13979. return nil, err
  13980. }
  13981. ret := &AddressList{
  13982. ServerResponse: googleapi.ServerResponse{
  13983. Header: res.Header,
  13984. HTTPStatusCode: res.StatusCode,
  13985. },
  13986. }
  13987. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  13988. return nil, err
  13989. }
  13990. return ret, nil
  13991. // {
  13992. // "description": "Retrieves a list of global address resources.",
  13993. // "httpMethod": "GET",
  13994. // "id": "compute.globalAddresses.list",
  13995. // "parameterOrder": [
  13996. // "project"
  13997. // ],
  13998. // "parameters": {
  13999. // "filter": {
  14000. // "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.",
  14001. // "location": "query",
  14002. // "type": "string"
  14003. // },
  14004. // "maxResults": {
  14005. // "default": "500",
  14006. // "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.",
  14007. // "format": "uint32",
  14008. // "location": "query",
  14009. // "maximum": "500",
  14010. // "minimum": "0",
  14011. // "type": "integer"
  14012. // },
  14013. // "pageToken": {
  14014. // "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.",
  14015. // "location": "query",
  14016. // "type": "string"
  14017. // },
  14018. // "project": {
  14019. // "description": "Project ID for this request.",
  14020. // "location": "path",
  14021. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  14022. // "required": true,
  14023. // "type": "string"
  14024. // }
  14025. // },
  14026. // "path": "{project}/global/addresses",
  14027. // "response": {
  14028. // "$ref": "AddressList"
  14029. // },
  14030. // "scopes": [
  14031. // "https://www.googleapis.com/auth/cloud-platform",
  14032. // "https://www.googleapis.com/auth/compute",
  14033. // "https://www.googleapis.com/auth/compute.readonly"
  14034. // ]
  14035. // }
  14036. }
  14037. // Pages invokes f for each page of results.
  14038. // A non-nil error returned from f will halt the iteration.
  14039. // The provided context supersedes any context provided to the Context method.
  14040. func (c *GlobalAddressesListCall) Pages(ctx context.Context, f func(*AddressList) error) error {
  14041. c.ctx_ = ctx
  14042. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  14043. for {
  14044. x, err := c.Do()
  14045. if err != nil {
  14046. return err
  14047. }
  14048. if err := f(x); err != nil {
  14049. return err
  14050. }
  14051. if x.NextPageToken == "" {
  14052. return nil
  14053. }
  14054. c.PageToken(x.NextPageToken)
  14055. }
  14056. }
  14057. // method id "compute.globalForwardingRules.delete":
  14058. type GlobalForwardingRulesDeleteCall struct {
  14059. s *Service
  14060. project string
  14061. forwardingRule string
  14062. urlParams_ gensupport.URLParams
  14063. ctx_ context.Context
  14064. }
  14065. // Delete: Deletes the specified ForwardingRule resource.
  14066. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/delete
  14067. func (r *GlobalForwardingRulesService) Delete(project string, forwardingRule string) *GlobalForwardingRulesDeleteCall {
  14068. c := &GlobalForwardingRulesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14069. c.project = project
  14070. c.forwardingRule = forwardingRule
  14071. return c
  14072. }
  14073. // Fields allows partial responses to be retrieved. See
  14074. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14075. // for more information.
  14076. func (c *GlobalForwardingRulesDeleteCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesDeleteCall {
  14077. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14078. return c
  14079. }
  14080. // Context sets the context to be used in this call's Do method. Any
  14081. // pending HTTP request will be aborted if the provided context is
  14082. // canceled.
  14083. func (c *GlobalForwardingRulesDeleteCall) Context(ctx context.Context) *GlobalForwardingRulesDeleteCall {
  14084. c.ctx_ = ctx
  14085. return c
  14086. }
  14087. func (c *GlobalForwardingRulesDeleteCall) doRequest(alt string) (*http.Response, error) {
  14088. var body io.Reader = nil
  14089. c.urlParams_.Set("alt", alt)
  14090. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}")
  14091. urls += "?" + c.urlParams_.Encode()
  14092. req, _ := http.NewRequest("DELETE", urls, body)
  14093. googleapi.Expand(req.URL, map[string]string{
  14094. "project": c.project,
  14095. "forwardingRule": c.forwardingRule,
  14096. })
  14097. req.Header.Set("User-Agent", c.s.userAgent())
  14098. if c.ctx_ != nil {
  14099. return ctxhttp.Do(c.ctx_, c.s.client, req)
  14100. }
  14101. return c.s.client.Do(req)
  14102. }
  14103. // Do executes the "compute.globalForwardingRules.delete" call.
  14104. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  14105. // status code is an error. Response headers are in either
  14106. // *Operation.ServerResponse.Header or (if a response was returned at
  14107. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  14108. // to check whether the returned error was because
  14109. // http.StatusNotModified was returned.
  14110. func (c *GlobalForwardingRulesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  14111. gensupport.SetOptions(c.urlParams_, opts...)
  14112. res, err := c.doRequest("json")
  14113. if res != nil && res.StatusCode == http.StatusNotModified {
  14114. if res.Body != nil {
  14115. res.Body.Close()
  14116. }
  14117. return nil, &googleapi.Error{
  14118. Code: res.StatusCode,
  14119. Header: res.Header,
  14120. }
  14121. }
  14122. if err != nil {
  14123. return nil, err
  14124. }
  14125. defer googleapi.CloseBody(res)
  14126. if err := googleapi.CheckResponse(res); err != nil {
  14127. return nil, err
  14128. }
  14129. ret := &Operation{
  14130. ServerResponse: googleapi.ServerResponse{
  14131. Header: res.Header,
  14132. HTTPStatusCode: res.StatusCode,
  14133. },
  14134. }
  14135. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  14136. return nil, err
  14137. }
  14138. return ret, nil
  14139. // {
  14140. // "description": "Deletes the specified ForwardingRule resource.",
  14141. // "httpMethod": "DELETE",
  14142. // "id": "compute.globalForwardingRules.delete",
  14143. // "parameterOrder": [
  14144. // "project",
  14145. // "forwardingRule"
  14146. // ],
  14147. // "parameters": {
  14148. // "forwardingRule": {
  14149. // "description": "Name of the ForwardingRule resource to delete.",
  14150. // "location": "path",
  14151. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  14152. // "required": true,
  14153. // "type": "string"
  14154. // },
  14155. // "project": {
  14156. // "description": "Project ID for this request.",
  14157. // "location": "path",
  14158. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  14159. // "required": true,
  14160. // "type": "string"
  14161. // }
  14162. // },
  14163. // "path": "{project}/global/forwardingRules/{forwardingRule}",
  14164. // "response": {
  14165. // "$ref": "Operation"
  14166. // },
  14167. // "scopes": [
  14168. // "https://www.googleapis.com/auth/cloud-platform",
  14169. // "https://www.googleapis.com/auth/compute"
  14170. // ]
  14171. // }
  14172. }
  14173. // method id "compute.globalForwardingRules.get":
  14174. type GlobalForwardingRulesGetCall struct {
  14175. s *Service
  14176. project string
  14177. forwardingRule string
  14178. urlParams_ gensupport.URLParams
  14179. ifNoneMatch_ string
  14180. ctx_ context.Context
  14181. }
  14182. // Get: Returns the specified ForwardingRule resource.
  14183. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/get
  14184. func (r *GlobalForwardingRulesService) Get(project string, forwardingRule string) *GlobalForwardingRulesGetCall {
  14185. c := &GlobalForwardingRulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14186. c.project = project
  14187. c.forwardingRule = forwardingRule
  14188. return c
  14189. }
  14190. // Fields allows partial responses to be retrieved. See
  14191. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14192. // for more information.
  14193. func (c *GlobalForwardingRulesGetCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesGetCall {
  14194. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14195. return c
  14196. }
  14197. // IfNoneMatch sets the optional parameter which makes the operation
  14198. // fail if the object's ETag matches the given value. This is useful for
  14199. // getting updates only after the object has changed since the last
  14200. // request. Use googleapi.IsNotModified to check whether the response
  14201. // error from Do is the result of In-None-Match.
  14202. func (c *GlobalForwardingRulesGetCall) IfNoneMatch(entityTag string) *GlobalForwardingRulesGetCall {
  14203. c.ifNoneMatch_ = entityTag
  14204. return c
  14205. }
  14206. // Context sets the context to be used in this call's Do method. Any
  14207. // pending HTTP request will be aborted if the provided context is
  14208. // canceled.
  14209. func (c *GlobalForwardingRulesGetCall) Context(ctx context.Context) *GlobalForwardingRulesGetCall {
  14210. c.ctx_ = ctx
  14211. return c
  14212. }
  14213. func (c *GlobalForwardingRulesGetCall) doRequest(alt string) (*http.Response, error) {
  14214. var body io.Reader = nil
  14215. c.urlParams_.Set("alt", alt)
  14216. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}")
  14217. urls += "?" + c.urlParams_.Encode()
  14218. req, _ := http.NewRequest("GET", urls, body)
  14219. googleapi.Expand(req.URL, map[string]string{
  14220. "project": c.project,
  14221. "forwardingRule": c.forwardingRule,
  14222. })
  14223. req.Header.Set("User-Agent", c.s.userAgent())
  14224. if c.ifNoneMatch_ != "" {
  14225. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  14226. }
  14227. if c.ctx_ != nil {
  14228. return ctxhttp.Do(c.ctx_, c.s.client, req)
  14229. }
  14230. return c.s.client.Do(req)
  14231. }
  14232. // Do executes the "compute.globalForwardingRules.get" call.
  14233. // Exactly one of *ForwardingRule or error will be non-nil. Any non-2xx
  14234. // status code is an error. Response headers are in either
  14235. // *ForwardingRule.ServerResponse.Header or (if a response was returned
  14236. // at all) in error.(*googleapi.Error).Header. Use
  14237. // googleapi.IsNotModified to check whether the returned error was
  14238. // because http.StatusNotModified was returned.
  14239. func (c *GlobalForwardingRulesGetCall) Do(opts ...googleapi.CallOption) (*ForwardingRule, error) {
  14240. gensupport.SetOptions(c.urlParams_, opts...)
  14241. res, err := c.doRequest("json")
  14242. if res != nil && res.StatusCode == http.StatusNotModified {
  14243. if res.Body != nil {
  14244. res.Body.Close()
  14245. }
  14246. return nil, &googleapi.Error{
  14247. Code: res.StatusCode,
  14248. Header: res.Header,
  14249. }
  14250. }
  14251. if err != nil {
  14252. return nil, err
  14253. }
  14254. defer googleapi.CloseBody(res)
  14255. if err := googleapi.CheckResponse(res); err != nil {
  14256. return nil, err
  14257. }
  14258. ret := &ForwardingRule{
  14259. ServerResponse: googleapi.ServerResponse{
  14260. Header: res.Header,
  14261. HTTPStatusCode: res.StatusCode,
  14262. },
  14263. }
  14264. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  14265. return nil, err
  14266. }
  14267. return ret, nil
  14268. // {
  14269. // "description": "Returns the specified ForwardingRule resource.",
  14270. // "httpMethod": "GET",
  14271. // "id": "compute.globalForwardingRules.get",
  14272. // "parameterOrder": [
  14273. // "project",
  14274. // "forwardingRule"
  14275. // ],
  14276. // "parameters": {
  14277. // "forwardingRule": {
  14278. // "description": "Name of the ForwardingRule resource to return.",
  14279. // "location": "path",
  14280. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  14281. // "required": true,
  14282. // "type": "string"
  14283. // },
  14284. // "project": {
  14285. // "description": "Project ID for this request.",
  14286. // "location": "path",
  14287. // "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])?))",
  14288. // "required": true,
  14289. // "type": "string"
  14290. // }
  14291. // },
  14292. // "path": "{project}/global/forwardingRules/{forwardingRule}",
  14293. // "response": {
  14294. // "$ref": "ForwardingRule"
  14295. // },
  14296. // "scopes": [
  14297. // "https://www.googleapis.com/auth/cloud-platform",
  14298. // "https://www.googleapis.com/auth/compute",
  14299. // "https://www.googleapis.com/auth/compute.readonly"
  14300. // ]
  14301. // }
  14302. }
  14303. // method id "compute.globalForwardingRules.insert":
  14304. type GlobalForwardingRulesInsertCall struct {
  14305. s *Service
  14306. project string
  14307. forwardingrule *ForwardingRule
  14308. urlParams_ gensupport.URLParams
  14309. ctx_ context.Context
  14310. }
  14311. // Insert: Creates a ForwardingRule resource in the specified project
  14312. // and region using the data included in the request.
  14313. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/insert
  14314. func (r *GlobalForwardingRulesService) Insert(project string, forwardingrule *ForwardingRule) *GlobalForwardingRulesInsertCall {
  14315. c := &GlobalForwardingRulesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14316. c.project = project
  14317. c.forwardingrule = forwardingrule
  14318. return c
  14319. }
  14320. // Fields allows partial responses to be retrieved. See
  14321. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14322. // for more information.
  14323. func (c *GlobalForwardingRulesInsertCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesInsertCall {
  14324. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14325. return c
  14326. }
  14327. // Context sets the context to be used in this call's Do method. Any
  14328. // pending HTTP request will be aborted if the provided context is
  14329. // canceled.
  14330. func (c *GlobalForwardingRulesInsertCall) Context(ctx context.Context) *GlobalForwardingRulesInsertCall {
  14331. c.ctx_ = ctx
  14332. return c
  14333. }
  14334. func (c *GlobalForwardingRulesInsertCall) doRequest(alt string) (*http.Response, error) {
  14335. var body io.Reader = nil
  14336. body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule)
  14337. if err != nil {
  14338. return nil, err
  14339. }
  14340. ctype := "application/json"
  14341. c.urlParams_.Set("alt", alt)
  14342. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules")
  14343. urls += "?" + c.urlParams_.Encode()
  14344. req, _ := http.NewRequest("POST", urls, body)
  14345. googleapi.Expand(req.URL, map[string]string{
  14346. "project": c.project,
  14347. })
  14348. req.Header.Set("Content-Type", ctype)
  14349. req.Header.Set("User-Agent", c.s.userAgent())
  14350. if c.ctx_ != nil {
  14351. return ctxhttp.Do(c.ctx_, c.s.client, req)
  14352. }
  14353. return c.s.client.Do(req)
  14354. }
  14355. // Do executes the "compute.globalForwardingRules.insert" call.
  14356. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  14357. // status code is an error. Response headers are in either
  14358. // *Operation.ServerResponse.Header or (if a response was returned at
  14359. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  14360. // to check whether the returned error was because
  14361. // http.StatusNotModified was returned.
  14362. func (c *GlobalForwardingRulesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  14363. gensupport.SetOptions(c.urlParams_, opts...)
  14364. res, err := c.doRequest("json")
  14365. if res != nil && res.StatusCode == http.StatusNotModified {
  14366. if res.Body != nil {
  14367. res.Body.Close()
  14368. }
  14369. return nil, &googleapi.Error{
  14370. Code: res.StatusCode,
  14371. Header: res.Header,
  14372. }
  14373. }
  14374. if err != nil {
  14375. return nil, err
  14376. }
  14377. defer googleapi.CloseBody(res)
  14378. if err := googleapi.CheckResponse(res); err != nil {
  14379. return nil, err
  14380. }
  14381. ret := &Operation{
  14382. ServerResponse: googleapi.ServerResponse{
  14383. Header: res.Header,
  14384. HTTPStatusCode: res.StatusCode,
  14385. },
  14386. }
  14387. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  14388. return nil, err
  14389. }
  14390. return ret, nil
  14391. // {
  14392. // "description": "Creates a ForwardingRule resource in the specified project and region using the data included in the request.",
  14393. // "httpMethod": "POST",
  14394. // "id": "compute.globalForwardingRules.insert",
  14395. // "parameterOrder": [
  14396. // "project"
  14397. // ],
  14398. // "parameters": {
  14399. // "project": {
  14400. // "description": "Project ID for this request.",
  14401. // "location": "path",
  14402. // "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])?))",
  14403. // "required": true,
  14404. // "type": "string"
  14405. // }
  14406. // },
  14407. // "path": "{project}/global/forwardingRules",
  14408. // "request": {
  14409. // "$ref": "ForwardingRule"
  14410. // },
  14411. // "response": {
  14412. // "$ref": "Operation"
  14413. // },
  14414. // "scopes": [
  14415. // "https://www.googleapis.com/auth/cloud-platform",
  14416. // "https://www.googleapis.com/auth/compute"
  14417. // ]
  14418. // }
  14419. }
  14420. // method id "compute.globalForwardingRules.list":
  14421. type GlobalForwardingRulesListCall struct {
  14422. s *Service
  14423. project string
  14424. urlParams_ gensupport.URLParams
  14425. ifNoneMatch_ string
  14426. ctx_ context.Context
  14427. }
  14428. // List: Retrieves a list of ForwardingRule resources available to the
  14429. // specified project.
  14430. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/list
  14431. func (r *GlobalForwardingRulesService) List(project string) *GlobalForwardingRulesListCall {
  14432. c := &GlobalForwardingRulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14433. c.project = project
  14434. return c
  14435. }
  14436. // Filter sets the optional parameter "filter": Sets a filter expression
  14437. // for filtering listed resources, in the form filter={expression}. Your
  14438. // {expression} must be in the format: field_name comparison_string
  14439. // literal_string.
  14440. //
  14441. // The field_name is the name of the field you want to compare. Only
  14442. // atomic field types are supported (string, number, boolean). The
  14443. // comparison_string must be either eq (equals) or ne (not equals). The
  14444. // literal_string is the string value to filter to. The literal value
  14445. // must be valid for the type of field you are filtering by (string,
  14446. // number, boolean). For string fields, the literal value is interpreted
  14447. // as a regular expression using RE2 syntax. The literal value must
  14448. // match the entire field.
  14449. //
  14450. // For example, filter=name ne example-instance.
  14451. //
  14452. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  14453. // you can also filter on nested fields. For example, you could filter
  14454. // on instances that have set the scheduling.automaticRestart field to
  14455. // true. In particular, use filtering on nested fields to take advantage
  14456. // of instance labels to organize and filter results based on label
  14457. // values.
  14458. //
  14459. // The Beta API also supports filtering on multiple expressions by
  14460. // providing each separate expression within parentheses. For example,
  14461. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  14462. // Multiple expressions are treated as AND expressions meaning that
  14463. // resources must match all expressions to pass the filters.
  14464. func (c *GlobalForwardingRulesListCall) Filter(filter string) *GlobalForwardingRulesListCall {
  14465. c.urlParams_.Set("filter", filter)
  14466. return c
  14467. }
  14468. // MaxResults sets the optional parameter "maxResults": The maximum
  14469. // number of results per page that Compute Engine should return. If the
  14470. // number of available results is larger than maxResults, Compute Engine
  14471. // returns a nextPageToken that can be used to get the next page of
  14472. // results in subsequent list requests.
  14473. func (c *GlobalForwardingRulesListCall) MaxResults(maxResults int64) *GlobalForwardingRulesListCall {
  14474. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  14475. return c
  14476. }
  14477. // PageToken sets the optional parameter "pageToken": Specifies a page
  14478. // token to use. Set pageToken to the nextPageToken returned by a
  14479. // previous list request to get the next page of results.
  14480. func (c *GlobalForwardingRulesListCall) PageToken(pageToken string) *GlobalForwardingRulesListCall {
  14481. c.urlParams_.Set("pageToken", pageToken)
  14482. return c
  14483. }
  14484. // Fields allows partial responses to be retrieved. See
  14485. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14486. // for more information.
  14487. func (c *GlobalForwardingRulesListCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesListCall {
  14488. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14489. return c
  14490. }
  14491. // IfNoneMatch sets the optional parameter which makes the operation
  14492. // fail if the object's ETag matches the given value. This is useful for
  14493. // getting updates only after the object has changed since the last
  14494. // request. Use googleapi.IsNotModified to check whether the response
  14495. // error from Do is the result of In-None-Match.
  14496. func (c *GlobalForwardingRulesListCall) IfNoneMatch(entityTag string) *GlobalForwardingRulesListCall {
  14497. c.ifNoneMatch_ = entityTag
  14498. return c
  14499. }
  14500. // Context sets the context to be used in this call's Do method. Any
  14501. // pending HTTP request will be aborted if the provided context is
  14502. // canceled.
  14503. func (c *GlobalForwardingRulesListCall) Context(ctx context.Context) *GlobalForwardingRulesListCall {
  14504. c.ctx_ = ctx
  14505. return c
  14506. }
  14507. func (c *GlobalForwardingRulesListCall) doRequest(alt string) (*http.Response, error) {
  14508. var body io.Reader = nil
  14509. c.urlParams_.Set("alt", alt)
  14510. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules")
  14511. urls += "?" + c.urlParams_.Encode()
  14512. req, _ := http.NewRequest("GET", urls, body)
  14513. googleapi.Expand(req.URL, map[string]string{
  14514. "project": c.project,
  14515. })
  14516. req.Header.Set("User-Agent", c.s.userAgent())
  14517. if c.ifNoneMatch_ != "" {
  14518. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  14519. }
  14520. if c.ctx_ != nil {
  14521. return ctxhttp.Do(c.ctx_, c.s.client, req)
  14522. }
  14523. return c.s.client.Do(req)
  14524. }
  14525. // Do executes the "compute.globalForwardingRules.list" call.
  14526. // Exactly one of *ForwardingRuleList or error will be non-nil. Any
  14527. // non-2xx status code is an error. Response headers are in either
  14528. // *ForwardingRuleList.ServerResponse.Header or (if a response was
  14529. // returned at all) in error.(*googleapi.Error).Header. Use
  14530. // googleapi.IsNotModified to check whether the returned error was
  14531. // because http.StatusNotModified was returned.
  14532. func (c *GlobalForwardingRulesListCall) Do(opts ...googleapi.CallOption) (*ForwardingRuleList, error) {
  14533. gensupport.SetOptions(c.urlParams_, opts...)
  14534. res, err := c.doRequest("json")
  14535. if res != nil && res.StatusCode == http.StatusNotModified {
  14536. if res.Body != nil {
  14537. res.Body.Close()
  14538. }
  14539. return nil, &googleapi.Error{
  14540. Code: res.StatusCode,
  14541. Header: res.Header,
  14542. }
  14543. }
  14544. if err != nil {
  14545. return nil, err
  14546. }
  14547. defer googleapi.CloseBody(res)
  14548. if err := googleapi.CheckResponse(res); err != nil {
  14549. return nil, err
  14550. }
  14551. ret := &ForwardingRuleList{
  14552. ServerResponse: googleapi.ServerResponse{
  14553. Header: res.Header,
  14554. HTTPStatusCode: res.StatusCode,
  14555. },
  14556. }
  14557. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  14558. return nil, err
  14559. }
  14560. return ret, nil
  14561. // {
  14562. // "description": "Retrieves a list of ForwardingRule resources available to the specified project.",
  14563. // "httpMethod": "GET",
  14564. // "id": "compute.globalForwardingRules.list",
  14565. // "parameterOrder": [
  14566. // "project"
  14567. // ],
  14568. // "parameters": {
  14569. // "filter": {
  14570. // "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.",
  14571. // "location": "query",
  14572. // "type": "string"
  14573. // },
  14574. // "maxResults": {
  14575. // "default": "500",
  14576. // "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.",
  14577. // "format": "uint32",
  14578. // "location": "query",
  14579. // "maximum": "500",
  14580. // "minimum": "0",
  14581. // "type": "integer"
  14582. // },
  14583. // "pageToken": {
  14584. // "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.",
  14585. // "location": "query",
  14586. // "type": "string"
  14587. // },
  14588. // "project": {
  14589. // "description": "Project ID for this request.",
  14590. // "location": "path",
  14591. // "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])?))",
  14592. // "required": true,
  14593. // "type": "string"
  14594. // }
  14595. // },
  14596. // "path": "{project}/global/forwardingRules",
  14597. // "response": {
  14598. // "$ref": "ForwardingRuleList"
  14599. // },
  14600. // "scopes": [
  14601. // "https://www.googleapis.com/auth/cloud-platform",
  14602. // "https://www.googleapis.com/auth/compute",
  14603. // "https://www.googleapis.com/auth/compute.readonly"
  14604. // ]
  14605. // }
  14606. }
  14607. // Pages invokes f for each page of results.
  14608. // A non-nil error returned from f will halt the iteration.
  14609. // The provided context supersedes any context provided to the Context method.
  14610. func (c *GlobalForwardingRulesListCall) Pages(ctx context.Context, f func(*ForwardingRuleList) error) error {
  14611. c.ctx_ = ctx
  14612. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  14613. for {
  14614. x, err := c.Do()
  14615. if err != nil {
  14616. return err
  14617. }
  14618. if err := f(x); err != nil {
  14619. return err
  14620. }
  14621. if x.NextPageToken == "" {
  14622. return nil
  14623. }
  14624. c.PageToken(x.NextPageToken)
  14625. }
  14626. }
  14627. // method id "compute.globalForwardingRules.setTarget":
  14628. type GlobalForwardingRulesSetTargetCall struct {
  14629. s *Service
  14630. project string
  14631. forwardingRule string
  14632. targetreference *TargetReference
  14633. urlParams_ gensupport.URLParams
  14634. ctx_ context.Context
  14635. }
  14636. // SetTarget: Changes target URL for forwarding rule. The new target
  14637. // should be of the same type as the old target.
  14638. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/setTarget
  14639. func (r *GlobalForwardingRulesService) SetTarget(project string, forwardingRule string, targetreference *TargetReference) *GlobalForwardingRulesSetTargetCall {
  14640. c := &GlobalForwardingRulesSetTargetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14641. c.project = project
  14642. c.forwardingRule = forwardingRule
  14643. c.targetreference = targetreference
  14644. return c
  14645. }
  14646. // Fields allows partial responses to be retrieved. See
  14647. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14648. // for more information.
  14649. func (c *GlobalForwardingRulesSetTargetCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesSetTargetCall {
  14650. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14651. return c
  14652. }
  14653. // Context sets the context to be used in this call's Do method. Any
  14654. // pending HTTP request will be aborted if the provided context is
  14655. // canceled.
  14656. func (c *GlobalForwardingRulesSetTargetCall) Context(ctx context.Context) *GlobalForwardingRulesSetTargetCall {
  14657. c.ctx_ = ctx
  14658. return c
  14659. }
  14660. func (c *GlobalForwardingRulesSetTargetCall) doRequest(alt string) (*http.Response, error) {
  14661. var body io.Reader = nil
  14662. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference)
  14663. if err != nil {
  14664. return nil, err
  14665. }
  14666. ctype := "application/json"
  14667. c.urlParams_.Set("alt", alt)
  14668. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}/setTarget")
  14669. urls += "?" + c.urlParams_.Encode()
  14670. req, _ := http.NewRequest("POST", urls, body)
  14671. googleapi.Expand(req.URL, map[string]string{
  14672. "project": c.project,
  14673. "forwardingRule": c.forwardingRule,
  14674. })
  14675. req.Header.Set("Content-Type", ctype)
  14676. req.Header.Set("User-Agent", c.s.userAgent())
  14677. if c.ctx_ != nil {
  14678. return ctxhttp.Do(c.ctx_, c.s.client, req)
  14679. }
  14680. return c.s.client.Do(req)
  14681. }
  14682. // Do executes the "compute.globalForwardingRules.setTarget" call.
  14683. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  14684. // status code is an error. Response headers are in either
  14685. // *Operation.ServerResponse.Header or (if a response was returned at
  14686. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  14687. // to check whether the returned error was because
  14688. // http.StatusNotModified was returned.
  14689. func (c *GlobalForwardingRulesSetTargetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  14690. gensupport.SetOptions(c.urlParams_, opts...)
  14691. res, err := c.doRequest("json")
  14692. if res != nil && res.StatusCode == http.StatusNotModified {
  14693. if res.Body != nil {
  14694. res.Body.Close()
  14695. }
  14696. return nil, &googleapi.Error{
  14697. Code: res.StatusCode,
  14698. Header: res.Header,
  14699. }
  14700. }
  14701. if err != nil {
  14702. return nil, err
  14703. }
  14704. defer googleapi.CloseBody(res)
  14705. if err := googleapi.CheckResponse(res); err != nil {
  14706. return nil, err
  14707. }
  14708. ret := &Operation{
  14709. ServerResponse: googleapi.ServerResponse{
  14710. Header: res.Header,
  14711. HTTPStatusCode: res.StatusCode,
  14712. },
  14713. }
  14714. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  14715. return nil, err
  14716. }
  14717. return ret, nil
  14718. // {
  14719. // "description": "Changes target URL for forwarding rule. The new target should be of the same type as the old target.",
  14720. // "httpMethod": "POST",
  14721. // "id": "compute.globalForwardingRules.setTarget",
  14722. // "parameterOrder": [
  14723. // "project",
  14724. // "forwardingRule"
  14725. // ],
  14726. // "parameters": {
  14727. // "forwardingRule": {
  14728. // "description": "Name of the ForwardingRule resource in which target is to be set.",
  14729. // "location": "path",
  14730. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  14731. // "required": true,
  14732. // "type": "string"
  14733. // },
  14734. // "project": {
  14735. // "description": "Project ID for this request.",
  14736. // "location": "path",
  14737. // "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])?))",
  14738. // "required": true,
  14739. // "type": "string"
  14740. // }
  14741. // },
  14742. // "path": "{project}/global/forwardingRules/{forwardingRule}/setTarget",
  14743. // "request": {
  14744. // "$ref": "TargetReference"
  14745. // },
  14746. // "response": {
  14747. // "$ref": "Operation"
  14748. // },
  14749. // "scopes": [
  14750. // "https://www.googleapis.com/auth/cloud-platform",
  14751. // "https://www.googleapis.com/auth/compute"
  14752. // ]
  14753. // }
  14754. }
  14755. // method id "compute.globalOperations.aggregatedList":
  14756. type GlobalOperationsAggregatedListCall struct {
  14757. s *Service
  14758. project string
  14759. urlParams_ gensupport.URLParams
  14760. ifNoneMatch_ string
  14761. ctx_ context.Context
  14762. }
  14763. // AggregatedList: Retrieves an aggregated list of all operations.
  14764. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/aggregatedList
  14765. func (r *GlobalOperationsService) AggregatedList(project string) *GlobalOperationsAggregatedListCall {
  14766. c := &GlobalOperationsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14767. c.project = project
  14768. return c
  14769. }
  14770. // Filter sets the optional parameter "filter": Sets a filter expression
  14771. // for filtering listed resources, in the form filter={expression}. Your
  14772. // {expression} must be in the format: field_name comparison_string
  14773. // literal_string.
  14774. //
  14775. // The field_name is the name of the field you want to compare. Only
  14776. // atomic field types are supported (string, number, boolean). The
  14777. // comparison_string must be either eq (equals) or ne (not equals). The
  14778. // literal_string is the string value to filter to. The literal value
  14779. // must be valid for the type of field you are filtering by (string,
  14780. // number, boolean). For string fields, the literal value is interpreted
  14781. // as a regular expression using RE2 syntax. The literal value must
  14782. // match the entire field.
  14783. //
  14784. // For example, filter=name ne example-instance.
  14785. //
  14786. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  14787. // you can also filter on nested fields. For example, you could filter
  14788. // on instances that have set the scheduling.automaticRestart field to
  14789. // true. In particular, use filtering on nested fields to take advantage
  14790. // of instance labels to organize and filter results based on label
  14791. // values.
  14792. //
  14793. // The Beta API also supports filtering on multiple expressions by
  14794. // providing each separate expression within parentheses. For example,
  14795. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  14796. // Multiple expressions are treated as AND expressions meaning that
  14797. // resources must match all expressions to pass the filters.
  14798. func (c *GlobalOperationsAggregatedListCall) Filter(filter string) *GlobalOperationsAggregatedListCall {
  14799. c.urlParams_.Set("filter", filter)
  14800. return c
  14801. }
  14802. // MaxResults sets the optional parameter "maxResults": The maximum
  14803. // number of results per page that Compute Engine should return. If the
  14804. // number of available results is larger than maxResults, Compute Engine
  14805. // returns a nextPageToken that can be used to get the next page of
  14806. // results in subsequent list requests.
  14807. func (c *GlobalOperationsAggregatedListCall) MaxResults(maxResults int64) *GlobalOperationsAggregatedListCall {
  14808. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  14809. return c
  14810. }
  14811. // PageToken sets the optional parameter "pageToken": Specifies a page
  14812. // token to use. Set pageToken to the nextPageToken returned by a
  14813. // previous list request to get the next page of results.
  14814. func (c *GlobalOperationsAggregatedListCall) PageToken(pageToken string) *GlobalOperationsAggregatedListCall {
  14815. c.urlParams_.Set("pageToken", pageToken)
  14816. return c
  14817. }
  14818. // Fields allows partial responses to be retrieved. See
  14819. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14820. // for more information.
  14821. func (c *GlobalOperationsAggregatedListCall) Fields(s ...googleapi.Field) *GlobalOperationsAggregatedListCall {
  14822. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14823. return c
  14824. }
  14825. // IfNoneMatch sets the optional parameter which makes the operation
  14826. // fail if the object's ETag matches the given value. This is useful for
  14827. // getting updates only after the object has changed since the last
  14828. // request. Use googleapi.IsNotModified to check whether the response
  14829. // error from Do is the result of In-None-Match.
  14830. func (c *GlobalOperationsAggregatedListCall) IfNoneMatch(entityTag string) *GlobalOperationsAggregatedListCall {
  14831. c.ifNoneMatch_ = entityTag
  14832. return c
  14833. }
  14834. // Context sets the context to be used in this call's Do method. Any
  14835. // pending HTTP request will be aborted if the provided context is
  14836. // canceled.
  14837. func (c *GlobalOperationsAggregatedListCall) Context(ctx context.Context) *GlobalOperationsAggregatedListCall {
  14838. c.ctx_ = ctx
  14839. return c
  14840. }
  14841. func (c *GlobalOperationsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  14842. var body io.Reader = nil
  14843. c.urlParams_.Set("alt", alt)
  14844. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/operations")
  14845. urls += "?" + c.urlParams_.Encode()
  14846. req, _ := http.NewRequest("GET", urls, body)
  14847. googleapi.Expand(req.URL, map[string]string{
  14848. "project": c.project,
  14849. })
  14850. req.Header.Set("User-Agent", c.s.userAgent())
  14851. if c.ifNoneMatch_ != "" {
  14852. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  14853. }
  14854. if c.ctx_ != nil {
  14855. return ctxhttp.Do(c.ctx_, c.s.client, req)
  14856. }
  14857. return c.s.client.Do(req)
  14858. }
  14859. // Do executes the "compute.globalOperations.aggregatedList" call.
  14860. // Exactly one of *OperationAggregatedList or error will be non-nil. Any
  14861. // non-2xx status code is an error. Response headers are in either
  14862. // *OperationAggregatedList.ServerResponse.Header or (if a response was
  14863. // returned at all) in error.(*googleapi.Error).Header. Use
  14864. // googleapi.IsNotModified to check whether the returned error was
  14865. // because http.StatusNotModified was returned.
  14866. func (c *GlobalOperationsAggregatedListCall) Do(opts ...googleapi.CallOption) (*OperationAggregatedList, error) {
  14867. gensupport.SetOptions(c.urlParams_, opts...)
  14868. res, err := c.doRequest("json")
  14869. if res != nil && res.StatusCode == http.StatusNotModified {
  14870. if res.Body != nil {
  14871. res.Body.Close()
  14872. }
  14873. return nil, &googleapi.Error{
  14874. Code: res.StatusCode,
  14875. Header: res.Header,
  14876. }
  14877. }
  14878. if err != nil {
  14879. return nil, err
  14880. }
  14881. defer googleapi.CloseBody(res)
  14882. if err := googleapi.CheckResponse(res); err != nil {
  14883. return nil, err
  14884. }
  14885. ret := &OperationAggregatedList{
  14886. ServerResponse: googleapi.ServerResponse{
  14887. Header: res.Header,
  14888. HTTPStatusCode: res.StatusCode,
  14889. },
  14890. }
  14891. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  14892. return nil, err
  14893. }
  14894. return ret, nil
  14895. // {
  14896. // "description": "Retrieves an aggregated list of all operations.",
  14897. // "httpMethod": "GET",
  14898. // "id": "compute.globalOperations.aggregatedList",
  14899. // "parameterOrder": [
  14900. // "project"
  14901. // ],
  14902. // "parameters": {
  14903. // "filter": {
  14904. // "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.",
  14905. // "location": "query",
  14906. // "type": "string"
  14907. // },
  14908. // "maxResults": {
  14909. // "default": "500",
  14910. // "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.",
  14911. // "format": "uint32",
  14912. // "location": "query",
  14913. // "maximum": "500",
  14914. // "minimum": "0",
  14915. // "type": "integer"
  14916. // },
  14917. // "pageToken": {
  14918. // "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.",
  14919. // "location": "query",
  14920. // "type": "string"
  14921. // },
  14922. // "project": {
  14923. // "description": "Project ID for this request.",
  14924. // "location": "path",
  14925. // "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])?))",
  14926. // "required": true,
  14927. // "type": "string"
  14928. // }
  14929. // },
  14930. // "path": "{project}/aggregated/operations",
  14931. // "response": {
  14932. // "$ref": "OperationAggregatedList"
  14933. // },
  14934. // "scopes": [
  14935. // "https://www.googleapis.com/auth/cloud-platform",
  14936. // "https://www.googleapis.com/auth/compute",
  14937. // "https://www.googleapis.com/auth/compute.readonly"
  14938. // ]
  14939. // }
  14940. }
  14941. // Pages invokes f for each page of results.
  14942. // A non-nil error returned from f will halt the iteration.
  14943. // The provided context supersedes any context provided to the Context method.
  14944. func (c *GlobalOperationsAggregatedListCall) Pages(ctx context.Context, f func(*OperationAggregatedList) error) error {
  14945. c.ctx_ = ctx
  14946. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  14947. for {
  14948. x, err := c.Do()
  14949. if err != nil {
  14950. return err
  14951. }
  14952. if err := f(x); err != nil {
  14953. return err
  14954. }
  14955. if x.NextPageToken == "" {
  14956. return nil
  14957. }
  14958. c.PageToken(x.NextPageToken)
  14959. }
  14960. }
  14961. // method id "compute.globalOperations.delete":
  14962. type GlobalOperationsDeleteCall struct {
  14963. s *Service
  14964. project string
  14965. operation string
  14966. urlParams_ gensupport.URLParams
  14967. ctx_ context.Context
  14968. }
  14969. // Delete: Deletes the specified Operations resource.
  14970. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/delete
  14971. func (r *GlobalOperationsService) Delete(project string, operation string) *GlobalOperationsDeleteCall {
  14972. c := &GlobalOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14973. c.project = project
  14974. c.operation = operation
  14975. return c
  14976. }
  14977. // Fields allows partial responses to be retrieved. See
  14978. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14979. // for more information.
  14980. func (c *GlobalOperationsDeleteCall) Fields(s ...googleapi.Field) *GlobalOperationsDeleteCall {
  14981. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14982. return c
  14983. }
  14984. // Context sets the context to be used in this call's Do method. Any
  14985. // pending HTTP request will be aborted if the provided context is
  14986. // canceled.
  14987. func (c *GlobalOperationsDeleteCall) Context(ctx context.Context) *GlobalOperationsDeleteCall {
  14988. c.ctx_ = ctx
  14989. return c
  14990. }
  14991. func (c *GlobalOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  14992. var body io.Reader = nil
  14993. c.urlParams_.Set("alt", alt)
  14994. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}")
  14995. urls += "?" + c.urlParams_.Encode()
  14996. req, _ := http.NewRequest("DELETE", urls, body)
  14997. googleapi.Expand(req.URL, map[string]string{
  14998. "project": c.project,
  14999. "operation": c.operation,
  15000. })
  15001. req.Header.Set("User-Agent", c.s.userAgent())
  15002. if c.ctx_ != nil {
  15003. return ctxhttp.Do(c.ctx_, c.s.client, req)
  15004. }
  15005. return c.s.client.Do(req)
  15006. }
  15007. // Do executes the "compute.globalOperations.delete" call.
  15008. func (c *GlobalOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  15009. gensupport.SetOptions(c.urlParams_, opts...)
  15010. res, err := c.doRequest("json")
  15011. if err != nil {
  15012. return err
  15013. }
  15014. defer googleapi.CloseBody(res)
  15015. if err := googleapi.CheckResponse(res); err != nil {
  15016. return err
  15017. }
  15018. return nil
  15019. // {
  15020. // "description": "Deletes the specified Operations resource.",
  15021. // "httpMethod": "DELETE",
  15022. // "id": "compute.globalOperations.delete",
  15023. // "parameterOrder": [
  15024. // "project",
  15025. // "operation"
  15026. // ],
  15027. // "parameters": {
  15028. // "operation": {
  15029. // "description": "Name of the Operations resource to delete.",
  15030. // "location": "path",
  15031. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  15032. // "required": true,
  15033. // "type": "string"
  15034. // },
  15035. // "project": {
  15036. // "description": "Project ID for this request.",
  15037. // "location": "path",
  15038. // "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])?))",
  15039. // "required": true,
  15040. // "type": "string"
  15041. // }
  15042. // },
  15043. // "path": "{project}/global/operations/{operation}",
  15044. // "scopes": [
  15045. // "https://www.googleapis.com/auth/cloud-platform",
  15046. // "https://www.googleapis.com/auth/compute"
  15047. // ]
  15048. // }
  15049. }
  15050. // method id "compute.globalOperations.get":
  15051. type GlobalOperationsGetCall struct {
  15052. s *Service
  15053. project string
  15054. operation string
  15055. urlParams_ gensupport.URLParams
  15056. ifNoneMatch_ string
  15057. ctx_ context.Context
  15058. }
  15059. // Get: Retrieves the specified Operations resource.
  15060. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/get
  15061. func (r *GlobalOperationsService) Get(project string, operation string) *GlobalOperationsGetCall {
  15062. c := &GlobalOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15063. c.project = project
  15064. c.operation = operation
  15065. return c
  15066. }
  15067. // Fields allows partial responses to be retrieved. See
  15068. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15069. // for more information.
  15070. func (c *GlobalOperationsGetCall) Fields(s ...googleapi.Field) *GlobalOperationsGetCall {
  15071. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15072. return c
  15073. }
  15074. // IfNoneMatch sets the optional parameter which makes the operation
  15075. // fail if the object's ETag matches the given value. This is useful for
  15076. // getting updates only after the object has changed since the last
  15077. // request. Use googleapi.IsNotModified to check whether the response
  15078. // error from Do is the result of In-None-Match.
  15079. func (c *GlobalOperationsGetCall) IfNoneMatch(entityTag string) *GlobalOperationsGetCall {
  15080. c.ifNoneMatch_ = entityTag
  15081. return c
  15082. }
  15083. // Context sets the context to be used in this call's Do method. Any
  15084. // pending HTTP request will be aborted if the provided context is
  15085. // canceled.
  15086. func (c *GlobalOperationsGetCall) Context(ctx context.Context) *GlobalOperationsGetCall {
  15087. c.ctx_ = ctx
  15088. return c
  15089. }
  15090. func (c *GlobalOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  15091. var body io.Reader = nil
  15092. c.urlParams_.Set("alt", alt)
  15093. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}")
  15094. urls += "?" + c.urlParams_.Encode()
  15095. req, _ := http.NewRequest("GET", urls, body)
  15096. googleapi.Expand(req.URL, map[string]string{
  15097. "project": c.project,
  15098. "operation": c.operation,
  15099. })
  15100. req.Header.Set("User-Agent", c.s.userAgent())
  15101. if c.ifNoneMatch_ != "" {
  15102. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  15103. }
  15104. if c.ctx_ != nil {
  15105. return ctxhttp.Do(c.ctx_, c.s.client, req)
  15106. }
  15107. return c.s.client.Do(req)
  15108. }
  15109. // Do executes the "compute.globalOperations.get" call.
  15110. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  15111. // status code is an error. Response headers are in either
  15112. // *Operation.ServerResponse.Header or (if a response was returned at
  15113. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  15114. // to check whether the returned error was because
  15115. // http.StatusNotModified was returned.
  15116. func (c *GlobalOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  15117. gensupport.SetOptions(c.urlParams_, opts...)
  15118. res, err := c.doRequest("json")
  15119. if res != nil && res.StatusCode == http.StatusNotModified {
  15120. if res.Body != nil {
  15121. res.Body.Close()
  15122. }
  15123. return nil, &googleapi.Error{
  15124. Code: res.StatusCode,
  15125. Header: res.Header,
  15126. }
  15127. }
  15128. if err != nil {
  15129. return nil, err
  15130. }
  15131. defer googleapi.CloseBody(res)
  15132. if err := googleapi.CheckResponse(res); err != nil {
  15133. return nil, err
  15134. }
  15135. ret := &Operation{
  15136. ServerResponse: googleapi.ServerResponse{
  15137. Header: res.Header,
  15138. HTTPStatusCode: res.StatusCode,
  15139. },
  15140. }
  15141. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  15142. return nil, err
  15143. }
  15144. return ret, nil
  15145. // {
  15146. // "description": "Retrieves the specified Operations resource.",
  15147. // "httpMethod": "GET",
  15148. // "id": "compute.globalOperations.get",
  15149. // "parameterOrder": [
  15150. // "project",
  15151. // "operation"
  15152. // ],
  15153. // "parameters": {
  15154. // "operation": {
  15155. // "description": "Name of the Operations resource to return.",
  15156. // "location": "path",
  15157. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  15158. // "required": true,
  15159. // "type": "string"
  15160. // },
  15161. // "project": {
  15162. // "description": "Project ID for this request.",
  15163. // "location": "path",
  15164. // "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])?))",
  15165. // "required": true,
  15166. // "type": "string"
  15167. // }
  15168. // },
  15169. // "path": "{project}/global/operations/{operation}",
  15170. // "response": {
  15171. // "$ref": "Operation"
  15172. // },
  15173. // "scopes": [
  15174. // "https://www.googleapis.com/auth/cloud-platform",
  15175. // "https://www.googleapis.com/auth/compute",
  15176. // "https://www.googleapis.com/auth/compute.readonly"
  15177. // ]
  15178. // }
  15179. }
  15180. // method id "compute.globalOperations.list":
  15181. type GlobalOperationsListCall struct {
  15182. s *Service
  15183. project string
  15184. urlParams_ gensupport.URLParams
  15185. ifNoneMatch_ string
  15186. ctx_ context.Context
  15187. }
  15188. // List: Retrieves a list of Operation resources contained within the
  15189. // specified project.
  15190. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/list
  15191. func (r *GlobalOperationsService) List(project string) *GlobalOperationsListCall {
  15192. c := &GlobalOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15193. c.project = project
  15194. return c
  15195. }
  15196. // Filter sets the optional parameter "filter": Sets a filter expression
  15197. // for filtering listed resources, in the form filter={expression}. Your
  15198. // {expression} must be in the format: field_name comparison_string
  15199. // literal_string.
  15200. //
  15201. // The field_name is the name of the field you want to compare. Only
  15202. // atomic field types are supported (string, number, boolean). The
  15203. // comparison_string must be either eq (equals) or ne (not equals). The
  15204. // literal_string is the string value to filter to. The literal value
  15205. // must be valid for the type of field you are filtering by (string,
  15206. // number, boolean). For string fields, the literal value is interpreted
  15207. // as a regular expression using RE2 syntax. The literal value must
  15208. // match the entire field.
  15209. //
  15210. // For example, filter=name ne example-instance.
  15211. //
  15212. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  15213. // you can also filter on nested fields. For example, you could filter
  15214. // on instances that have set the scheduling.automaticRestart field to
  15215. // true. In particular, use filtering on nested fields to take advantage
  15216. // of instance labels to organize and filter results based on label
  15217. // values.
  15218. //
  15219. // The Beta API also supports filtering on multiple expressions by
  15220. // providing each separate expression within parentheses. For example,
  15221. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  15222. // Multiple expressions are treated as AND expressions meaning that
  15223. // resources must match all expressions to pass the filters.
  15224. func (c *GlobalOperationsListCall) Filter(filter string) *GlobalOperationsListCall {
  15225. c.urlParams_.Set("filter", filter)
  15226. return c
  15227. }
  15228. // MaxResults sets the optional parameter "maxResults": The maximum
  15229. // number of results per page that Compute Engine should return. If the
  15230. // number of available results is larger than maxResults, Compute Engine
  15231. // returns a nextPageToken that can be used to get the next page of
  15232. // results in subsequent list requests.
  15233. func (c *GlobalOperationsListCall) MaxResults(maxResults int64) *GlobalOperationsListCall {
  15234. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  15235. return c
  15236. }
  15237. // PageToken sets the optional parameter "pageToken": Specifies a page
  15238. // token to use. Set pageToken to the nextPageToken returned by a
  15239. // previous list request to get the next page of results.
  15240. func (c *GlobalOperationsListCall) PageToken(pageToken string) *GlobalOperationsListCall {
  15241. c.urlParams_.Set("pageToken", pageToken)
  15242. return c
  15243. }
  15244. // Fields allows partial responses to be retrieved. See
  15245. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15246. // for more information.
  15247. func (c *GlobalOperationsListCall) Fields(s ...googleapi.Field) *GlobalOperationsListCall {
  15248. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15249. return c
  15250. }
  15251. // IfNoneMatch sets the optional parameter which makes the operation
  15252. // fail if the object's ETag matches the given value. This is useful for
  15253. // getting updates only after the object has changed since the last
  15254. // request. Use googleapi.IsNotModified to check whether the response
  15255. // error from Do is the result of In-None-Match.
  15256. func (c *GlobalOperationsListCall) IfNoneMatch(entityTag string) *GlobalOperationsListCall {
  15257. c.ifNoneMatch_ = entityTag
  15258. return c
  15259. }
  15260. // Context sets the context to be used in this call's Do method. Any
  15261. // pending HTTP request will be aborted if the provided context is
  15262. // canceled.
  15263. func (c *GlobalOperationsListCall) Context(ctx context.Context) *GlobalOperationsListCall {
  15264. c.ctx_ = ctx
  15265. return c
  15266. }
  15267. func (c *GlobalOperationsListCall) doRequest(alt string) (*http.Response, error) {
  15268. var body io.Reader = nil
  15269. c.urlParams_.Set("alt", alt)
  15270. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations")
  15271. urls += "?" + c.urlParams_.Encode()
  15272. req, _ := http.NewRequest("GET", urls, body)
  15273. googleapi.Expand(req.URL, map[string]string{
  15274. "project": c.project,
  15275. })
  15276. req.Header.Set("User-Agent", c.s.userAgent())
  15277. if c.ifNoneMatch_ != "" {
  15278. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  15279. }
  15280. if c.ctx_ != nil {
  15281. return ctxhttp.Do(c.ctx_, c.s.client, req)
  15282. }
  15283. return c.s.client.Do(req)
  15284. }
  15285. // Do executes the "compute.globalOperations.list" call.
  15286. // Exactly one of *OperationList or error will be non-nil. Any non-2xx
  15287. // status code is an error. Response headers are in either
  15288. // *OperationList.ServerResponse.Header or (if a response was returned
  15289. // at all) in error.(*googleapi.Error).Header. Use
  15290. // googleapi.IsNotModified to check whether the returned error was
  15291. // because http.StatusNotModified was returned.
  15292. func (c *GlobalOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, error) {
  15293. gensupport.SetOptions(c.urlParams_, opts...)
  15294. res, err := c.doRequest("json")
  15295. if res != nil && res.StatusCode == http.StatusNotModified {
  15296. if res.Body != nil {
  15297. res.Body.Close()
  15298. }
  15299. return nil, &googleapi.Error{
  15300. Code: res.StatusCode,
  15301. Header: res.Header,
  15302. }
  15303. }
  15304. if err != nil {
  15305. return nil, err
  15306. }
  15307. defer googleapi.CloseBody(res)
  15308. if err := googleapi.CheckResponse(res); err != nil {
  15309. return nil, err
  15310. }
  15311. ret := &OperationList{
  15312. ServerResponse: googleapi.ServerResponse{
  15313. Header: res.Header,
  15314. HTTPStatusCode: res.StatusCode,
  15315. },
  15316. }
  15317. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  15318. return nil, err
  15319. }
  15320. return ret, nil
  15321. // {
  15322. // "description": "Retrieves a list of Operation resources contained within the specified project.",
  15323. // "httpMethod": "GET",
  15324. // "id": "compute.globalOperations.list",
  15325. // "parameterOrder": [
  15326. // "project"
  15327. // ],
  15328. // "parameters": {
  15329. // "filter": {
  15330. // "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.",
  15331. // "location": "query",
  15332. // "type": "string"
  15333. // },
  15334. // "maxResults": {
  15335. // "default": "500",
  15336. // "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.",
  15337. // "format": "uint32",
  15338. // "location": "query",
  15339. // "maximum": "500",
  15340. // "minimum": "0",
  15341. // "type": "integer"
  15342. // },
  15343. // "pageToken": {
  15344. // "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.",
  15345. // "location": "query",
  15346. // "type": "string"
  15347. // },
  15348. // "project": {
  15349. // "description": "Project ID for this request.",
  15350. // "location": "path",
  15351. // "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])?))",
  15352. // "required": true,
  15353. // "type": "string"
  15354. // }
  15355. // },
  15356. // "path": "{project}/global/operations",
  15357. // "response": {
  15358. // "$ref": "OperationList"
  15359. // },
  15360. // "scopes": [
  15361. // "https://www.googleapis.com/auth/cloud-platform",
  15362. // "https://www.googleapis.com/auth/compute",
  15363. // "https://www.googleapis.com/auth/compute.readonly"
  15364. // ]
  15365. // }
  15366. }
  15367. // Pages invokes f for each page of results.
  15368. // A non-nil error returned from f will halt the iteration.
  15369. // The provided context supersedes any context provided to the Context method.
  15370. func (c *GlobalOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
  15371. c.ctx_ = ctx
  15372. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  15373. for {
  15374. x, err := c.Do()
  15375. if err != nil {
  15376. return err
  15377. }
  15378. if err := f(x); err != nil {
  15379. return err
  15380. }
  15381. if x.NextPageToken == "" {
  15382. return nil
  15383. }
  15384. c.PageToken(x.NextPageToken)
  15385. }
  15386. }
  15387. // method id "compute.httpHealthChecks.delete":
  15388. type HttpHealthChecksDeleteCall struct {
  15389. s *Service
  15390. project string
  15391. httpHealthCheck string
  15392. urlParams_ gensupport.URLParams
  15393. ctx_ context.Context
  15394. }
  15395. // Delete: Deletes the specified HttpHealthCheck resource.
  15396. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/delete
  15397. func (r *HttpHealthChecksService) Delete(project string, httpHealthCheck string) *HttpHealthChecksDeleteCall {
  15398. c := &HttpHealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15399. c.project = project
  15400. c.httpHealthCheck = httpHealthCheck
  15401. return c
  15402. }
  15403. // Fields allows partial responses to be retrieved. See
  15404. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15405. // for more information.
  15406. func (c *HttpHealthChecksDeleteCall) Fields(s ...googleapi.Field) *HttpHealthChecksDeleteCall {
  15407. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15408. return c
  15409. }
  15410. // Context sets the context to be used in this call's Do method. Any
  15411. // pending HTTP request will be aborted if the provided context is
  15412. // canceled.
  15413. func (c *HttpHealthChecksDeleteCall) Context(ctx context.Context) *HttpHealthChecksDeleteCall {
  15414. c.ctx_ = ctx
  15415. return c
  15416. }
  15417. func (c *HttpHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
  15418. var body io.Reader = nil
  15419. c.urlParams_.Set("alt", alt)
  15420. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  15421. urls += "?" + c.urlParams_.Encode()
  15422. req, _ := http.NewRequest("DELETE", urls, body)
  15423. googleapi.Expand(req.URL, map[string]string{
  15424. "project": c.project,
  15425. "httpHealthCheck": c.httpHealthCheck,
  15426. })
  15427. req.Header.Set("User-Agent", c.s.userAgent())
  15428. if c.ctx_ != nil {
  15429. return ctxhttp.Do(c.ctx_, c.s.client, req)
  15430. }
  15431. return c.s.client.Do(req)
  15432. }
  15433. // Do executes the "compute.httpHealthChecks.delete" call.
  15434. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  15435. // status code is an error. Response headers are in either
  15436. // *Operation.ServerResponse.Header or (if a response was returned at
  15437. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  15438. // to check whether the returned error was because
  15439. // http.StatusNotModified was returned.
  15440. func (c *HttpHealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  15441. gensupport.SetOptions(c.urlParams_, opts...)
  15442. res, err := c.doRequest("json")
  15443. if res != nil && res.StatusCode == http.StatusNotModified {
  15444. if res.Body != nil {
  15445. res.Body.Close()
  15446. }
  15447. return nil, &googleapi.Error{
  15448. Code: res.StatusCode,
  15449. Header: res.Header,
  15450. }
  15451. }
  15452. if err != nil {
  15453. return nil, err
  15454. }
  15455. defer googleapi.CloseBody(res)
  15456. if err := googleapi.CheckResponse(res); err != nil {
  15457. return nil, err
  15458. }
  15459. ret := &Operation{
  15460. ServerResponse: googleapi.ServerResponse{
  15461. Header: res.Header,
  15462. HTTPStatusCode: res.StatusCode,
  15463. },
  15464. }
  15465. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  15466. return nil, err
  15467. }
  15468. return ret, nil
  15469. // {
  15470. // "description": "Deletes the specified HttpHealthCheck resource.",
  15471. // "httpMethod": "DELETE",
  15472. // "id": "compute.httpHealthChecks.delete",
  15473. // "parameterOrder": [
  15474. // "project",
  15475. // "httpHealthCheck"
  15476. // ],
  15477. // "parameters": {
  15478. // "httpHealthCheck": {
  15479. // "description": "Name of the HttpHealthCheck resource to delete.",
  15480. // "location": "path",
  15481. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  15482. // "required": true,
  15483. // "type": "string"
  15484. // },
  15485. // "project": {
  15486. // "description": "Project ID for this request.",
  15487. // "location": "path",
  15488. // "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])?))",
  15489. // "required": true,
  15490. // "type": "string"
  15491. // }
  15492. // },
  15493. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  15494. // "response": {
  15495. // "$ref": "Operation"
  15496. // },
  15497. // "scopes": [
  15498. // "https://www.googleapis.com/auth/cloud-platform",
  15499. // "https://www.googleapis.com/auth/compute"
  15500. // ]
  15501. // }
  15502. }
  15503. // method id "compute.httpHealthChecks.get":
  15504. type HttpHealthChecksGetCall struct {
  15505. s *Service
  15506. project string
  15507. httpHealthCheck string
  15508. urlParams_ gensupport.URLParams
  15509. ifNoneMatch_ string
  15510. ctx_ context.Context
  15511. }
  15512. // Get: Returns the specified HttpHealthCheck resource.
  15513. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/get
  15514. func (r *HttpHealthChecksService) Get(project string, httpHealthCheck string) *HttpHealthChecksGetCall {
  15515. c := &HttpHealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15516. c.project = project
  15517. c.httpHealthCheck = httpHealthCheck
  15518. return c
  15519. }
  15520. // Fields allows partial responses to be retrieved. See
  15521. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15522. // for more information.
  15523. func (c *HttpHealthChecksGetCall) Fields(s ...googleapi.Field) *HttpHealthChecksGetCall {
  15524. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15525. return c
  15526. }
  15527. // IfNoneMatch sets the optional parameter which makes the operation
  15528. // fail if the object's ETag matches the given value. This is useful for
  15529. // getting updates only after the object has changed since the last
  15530. // request. Use googleapi.IsNotModified to check whether the response
  15531. // error from Do is the result of In-None-Match.
  15532. func (c *HttpHealthChecksGetCall) IfNoneMatch(entityTag string) *HttpHealthChecksGetCall {
  15533. c.ifNoneMatch_ = entityTag
  15534. return c
  15535. }
  15536. // Context sets the context to be used in this call's Do method. Any
  15537. // pending HTTP request will be aborted if the provided context is
  15538. // canceled.
  15539. func (c *HttpHealthChecksGetCall) Context(ctx context.Context) *HttpHealthChecksGetCall {
  15540. c.ctx_ = ctx
  15541. return c
  15542. }
  15543. func (c *HttpHealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
  15544. var body io.Reader = nil
  15545. c.urlParams_.Set("alt", alt)
  15546. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  15547. urls += "?" + c.urlParams_.Encode()
  15548. req, _ := http.NewRequest("GET", urls, body)
  15549. googleapi.Expand(req.URL, map[string]string{
  15550. "project": c.project,
  15551. "httpHealthCheck": c.httpHealthCheck,
  15552. })
  15553. req.Header.Set("User-Agent", c.s.userAgent())
  15554. if c.ifNoneMatch_ != "" {
  15555. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  15556. }
  15557. if c.ctx_ != nil {
  15558. return ctxhttp.Do(c.ctx_, c.s.client, req)
  15559. }
  15560. return c.s.client.Do(req)
  15561. }
  15562. // Do executes the "compute.httpHealthChecks.get" call.
  15563. // Exactly one of *HttpHealthCheck or error will be non-nil. Any non-2xx
  15564. // status code is an error. Response headers are in either
  15565. // *HttpHealthCheck.ServerResponse.Header or (if a response was returned
  15566. // at all) in error.(*googleapi.Error).Header. Use
  15567. // googleapi.IsNotModified to check whether the returned error was
  15568. // because http.StatusNotModified was returned.
  15569. func (c *HttpHealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HttpHealthCheck, error) {
  15570. gensupport.SetOptions(c.urlParams_, opts...)
  15571. res, err := c.doRequest("json")
  15572. if res != nil && res.StatusCode == http.StatusNotModified {
  15573. if res.Body != nil {
  15574. res.Body.Close()
  15575. }
  15576. return nil, &googleapi.Error{
  15577. Code: res.StatusCode,
  15578. Header: res.Header,
  15579. }
  15580. }
  15581. if err != nil {
  15582. return nil, err
  15583. }
  15584. defer googleapi.CloseBody(res)
  15585. if err := googleapi.CheckResponse(res); err != nil {
  15586. return nil, err
  15587. }
  15588. ret := &HttpHealthCheck{
  15589. ServerResponse: googleapi.ServerResponse{
  15590. Header: res.Header,
  15591. HTTPStatusCode: res.StatusCode,
  15592. },
  15593. }
  15594. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  15595. return nil, err
  15596. }
  15597. return ret, nil
  15598. // {
  15599. // "description": "Returns the specified HttpHealthCheck resource.",
  15600. // "httpMethod": "GET",
  15601. // "id": "compute.httpHealthChecks.get",
  15602. // "parameterOrder": [
  15603. // "project",
  15604. // "httpHealthCheck"
  15605. // ],
  15606. // "parameters": {
  15607. // "httpHealthCheck": {
  15608. // "description": "Name of the HttpHealthCheck resource to return.",
  15609. // "location": "path",
  15610. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  15611. // "required": true,
  15612. // "type": "string"
  15613. // },
  15614. // "project": {
  15615. // "description": "Project ID for this request.",
  15616. // "location": "path",
  15617. // "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])?))",
  15618. // "required": true,
  15619. // "type": "string"
  15620. // }
  15621. // },
  15622. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  15623. // "response": {
  15624. // "$ref": "HttpHealthCheck"
  15625. // },
  15626. // "scopes": [
  15627. // "https://www.googleapis.com/auth/cloud-platform",
  15628. // "https://www.googleapis.com/auth/compute",
  15629. // "https://www.googleapis.com/auth/compute.readonly"
  15630. // ]
  15631. // }
  15632. }
  15633. // method id "compute.httpHealthChecks.insert":
  15634. type HttpHealthChecksInsertCall struct {
  15635. s *Service
  15636. project string
  15637. httphealthcheck *HttpHealthCheck
  15638. urlParams_ gensupport.URLParams
  15639. ctx_ context.Context
  15640. }
  15641. // Insert: Creates a HttpHealthCheck resource in the specified project
  15642. // using the data included in the request.
  15643. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/insert
  15644. func (r *HttpHealthChecksService) Insert(project string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksInsertCall {
  15645. c := &HttpHealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15646. c.project = project
  15647. c.httphealthcheck = httphealthcheck
  15648. return c
  15649. }
  15650. // Fields allows partial responses to be retrieved. See
  15651. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15652. // for more information.
  15653. func (c *HttpHealthChecksInsertCall) Fields(s ...googleapi.Field) *HttpHealthChecksInsertCall {
  15654. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15655. return c
  15656. }
  15657. // Context sets the context to be used in this call's Do method. Any
  15658. // pending HTTP request will be aborted if the provided context is
  15659. // canceled.
  15660. func (c *HttpHealthChecksInsertCall) Context(ctx context.Context) *HttpHealthChecksInsertCall {
  15661. c.ctx_ = ctx
  15662. return c
  15663. }
  15664. func (c *HttpHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
  15665. var body io.Reader = nil
  15666. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck)
  15667. if err != nil {
  15668. return nil, err
  15669. }
  15670. ctype := "application/json"
  15671. c.urlParams_.Set("alt", alt)
  15672. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks")
  15673. urls += "?" + c.urlParams_.Encode()
  15674. req, _ := http.NewRequest("POST", urls, body)
  15675. googleapi.Expand(req.URL, map[string]string{
  15676. "project": c.project,
  15677. })
  15678. req.Header.Set("Content-Type", ctype)
  15679. req.Header.Set("User-Agent", c.s.userAgent())
  15680. if c.ctx_ != nil {
  15681. return ctxhttp.Do(c.ctx_, c.s.client, req)
  15682. }
  15683. return c.s.client.Do(req)
  15684. }
  15685. // Do executes the "compute.httpHealthChecks.insert" call.
  15686. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  15687. // status code is an error. Response headers are in either
  15688. // *Operation.ServerResponse.Header or (if a response was returned at
  15689. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  15690. // to check whether the returned error was because
  15691. // http.StatusNotModified was returned.
  15692. func (c *HttpHealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  15693. gensupport.SetOptions(c.urlParams_, opts...)
  15694. res, err := c.doRequest("json")
  15695. if res != nil && res.StatusCode == http.StatusNotModified {
  15696. if res.Body != nil {
  15697. res.Body.Close()
  15698. }
  15699. return nil, &googleapi.Error{
  15700. Code: res.StatusCode,
  15701. Header: res.Header,
  15702. }
  15703. }
  15704. if err != nil {
  15705. return nil, err
  15706. }
  15707. defer googleapi.CloseBody(res)
  15708. if err := googleapi.CheckResponse(res); err != nil {
  15709. return nil, err
  15710. }
  15711. ret := &Operation{
  15712. ServerResponse: googleapi.ServerResponse{
  15713. Header: res.Header,
  15714. HTTPStatusCode: res.StatusCode,
  15715. },
  15716. }
  15717. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  15718. return nil, err
  15719. }
  15720. return ret, nil
  15721. // {
  15722. // "description": "Creates a HttpHealthCheck resource in the specified project using the data included in the request.",
  15723. // "httpMethod": "POST",
  15724. // "id": "compute.httpHealthChecks.insert",
  15725. // "parameterOrder": [
  15726. // "project"
  15727. // ],
  15728. // "parameters": {
  15729. // "project": {
  15730. // "description": "Project ID for this request.",
  15731. // "location": "path",
  15732. // "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])?))",
  15733. // "required": true,
  15734. // "type": "string"
  15735. // }
  15736. // },
  15737. // "path": "{project}/global/httpHealthChecks",
  15738. // "request": {
  15739. // "$ref": "HttpHealthCheck"
  15740. // },
  15741. // "response": {
  15742. // "$ref": "Operation"
  15743. // },
  15744. // "scopes": [
  15745. // "https://www.googleapis.com/auth/cloud-platform",
  15746. // "https://www.googleapis.com/auth/compute"
  15747. // ]
  15748. // }
  15749. }
  15750. // method id "compute.httpHealthChecks.list":
  15751. type HttpHealthChecksListCall struct {
  15752. s *Service
  15753. project string
  15754. urlParams_ gensupport.URLParams
  15755. ifNoneMatch_ string
  15756. ctx_ context.Context
  15757. }
  15758. // List: Retrieves the list of HttpHealthCheck resources available to
  15759. // the specified project.
  15760. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/list
  15761. func (r *HttpHealthChecksService) List(project string) *HttpHealthChecksListCall {
  15762. c := &HttpHealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15763. c.project = project
  15764. return c
  15765. }
  15766. // Filter sets the optional parameter "filter": Sets a filter expression
  15767. // for filtering listed resources, in the form filter={expression}. Your
  15768. // {expression} must be in the format: field_name comparison_string
  15769. // literal_string.
  15770. //
  15771. // The field_name is the name of the field you want to compare. Only
  15772. // atomic field types are supported (string, number, boolean). The
  15773. // comparison_string must be either eq (equals) or ne (not equals). The
  15774. // literal_string is the string value to filter to. The literal value
  15775. // must be valid for the type of field you are filtering by (string,
  15776. // number, boolean). For string fields, the literal value is interpreted
  15777. // as a regular expression using RE2 syntax. The literal value must
  15778. // match the entire field.
  15779. //
  15780. // For example, filter=name ne example-instance.
  15781. //
  15782. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  15783. // you can also filter on nested fields. For example, you could filter
  15784. // on instances that have set the scheduling.automaticRestart field to
  15785. // true. In particular, use filtering on nested fields to take advantage
  15786. // of instance labels to organize and filter results based on label
  15787. // values.
  15788. //
  15789. // The Beta API also supports filtering on multiple expressions by
  15790. // providing each separate expression within parentheses. For example,
  15791. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  15792. // Multiple expressions are treated as AND expressions meaning that
  15793. // resources must match all expressions to pass the filters.
  15794. func (c *HttpHealthChecksListCall) Filter(filter string) *HttpHealthChecksListCall {
  15795. c.urlParams_.Set("filter", filter)
  15796. return c
  15797. }
  15798. // MaxResults sets the optional parameter "maxResults": The maximum
  15799. // number of results per page that Compute Engine should return. If the
  15800. // number of available results is larger than maxResults, Compute Engine
  15801. // returns a nextPageToken that can be used to get the next page of
  15802. // results in subsequent list requests.
  15803. func (c *HttpHealthChecksListCall) MaxResults(maxResults int64) *HttpHealthChecksListCall {
  15804. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  15805. return c
  15806. }
  15807. // PageToken sets the optional parameter "pageToken": Specifies a page
  15808. // token to use. Set pageToken to the nextPageToken returned by a
  15809. // previous list request to get the next page of results.
  15810. func (c *HttpHealthChecksListCall) PageToken(pageToken string) *HttpHealthChecksListCall {
  15811. c.urlParams_.Set("pageToken", pageToken)
  15812. return c
  15813. }
  15814. // Fields allows partial responses to be retrieved. See
  15815. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15816. // for more information.
  15817. func (c *HttpHealthChecksListCall) Fields(s ...googleapi.Field) *HttpHealthChecksListCall {
  15818. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15819. return c
  15820. }
  15821. // IfNoneMatch sets the optional parameter which makes the operation
  15822. // fail if the object's ETag matches the given value. This is useful for
  15823. // getting updates only after the object has changed since the last
  15824. // request. Use googleapi.IsNotModified to check whether the response
  15825. // error from Do is the result of In-None-Match.
  15826. func (c *HttpHealthChecksListCall) IfNoneMatch(entityTag string) *HttpHealthChecksListCall {
  15827. c.ifNoneMatch_ = entityTag
  15828. return c
  15829. }
  15830. // Context sets the context to be used in this call's Do method. Any
  15831. // pending HTTP request will be aborted if the provided context is
  15832. // canceled.
  15833. func (c *HttpHealthChecksListCall) Context(ctx context.Context) *HttpHealthChecksListCall {
  15834. c.ctx_ = ctx
  15835. return c
  15836. }
  15837. func (c *HttpHealthChecksListCall) doRequest(alt string) (*http.Response, error) {
  15838. var body io.Reader = nil
  15839. c.urlParams_.Set("alt", alt)
  15840. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks")
  15841. urls += "?" + c.urlParams_.Encode()
  15842. req, _ := http.NewRequest("GET", urls, body)
  15843. googleapi.Expand(req.URL, map[string]string{
  15844. "project": c.project,
  15845. })
  15846. req.Header.Set("User-Agent", c.s.userAgent())
  15847. if c.ifNoneMatch_ != "" {
  15848. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  15849. }
  15850. if c.ctx_ != nil {
  15851. return ctxhttp.Do(c.ctx_, c.s.client, req)
  15852. }
  15853. return c.s.client.Do(req)
  15854. }
  15855. // Do executes the "compute.httpHealthChecks.list" call.
  15856. // Exactly one of *HttpHealthCheckList or error will be non-nil. Any
  15857. // non-2xx status code is an error. Response headers are in either
  15858. // *HttpHealthCheckList.ServerResponse.Header or (if a response was
  15859. // returned at all) in error.(*googleapi.Error).Header. Use
  15860. // googleapi.IsNotModified to check whether the returned error was
  15861. // because http.StatusNotModified was returned.
  15862. func (c *HttpHealthChecksListCall) Do(opts ...googleapi.CallOption) (*HttpHealthCheckList, error) {
  15863. gensupport.SetOptions(c.urlParams_, opts...)
  15864. res, err := c.doRequest("json")
  15865. if res != nil && res.StatusCode == http.StatusNotModified {
  15866. if res.Body != nil {
  15867. res.Body.Close()
  15868. }
  15869. return nil, &googleapi.Error{
  15870. Code: res.StatusCode,
  15871. Header: res.Header,
  15872. }
  15873. }
  15874. if err != nil {
  15875. return nil, err
  15876. }
  15877. defer googleapi.CloseBody(res)
  15878. if err := googleapi.CheckResponse(res); err != nil {
  15879. return nil, err
  15880. }
  15881. ret := &HttpHealthCheckList{
  15882. ServerResponse: googleapi.ServerResponse{
  15883. Header: res.Header,
  15884. HTTPStatusCode: res.StatusCode,
  15885. },
  15886. }
  15887. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  15888. return nil, err
  15889. }
  15890. return ret, nil
  15891. // {
  15892. // "description": "Retrieves the list of HttpHealthCheck resources available to the specified project.",
  15893. // "httpMethod": "GET",
  15894. // "id": "compute.httpHealthChecks.list",
  15895. // "parameterOrder": [
  15896. // "project"
  15897. // ],
  15898. // "parameters": {
  15899. // "filter": {
  15900. // "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.",
  15901. // "location": "query",
  15902. // "type": "string"
  15903. // },
  15904. // "maxResults": {
  15905. // "default": "500",
  15906. // "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.",
  15907. // "format": "uint32",
  15908. // "location": "query",
  15909. // "maximum": "500",
  15910. // "minimum": "0",
  15911. // "type": "integer"
  15912. // },
  15913. // "pageToken": {
  15914. // "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.",
  15915. // "location": "query",
  15916. // "type": "string"
  15917. // },
  15918. // "project": {
  15919. // "description": "Project ID for this request.",
  15920. // "location": "path",
  15921. // "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])?))",
  15922. // "required": true,
  15923. // "type": "string"
  15924. // }
  15925. // },
  15926. // "path": "{project}/global/httpHealthChecks",
  15927. // "response": {
  15928. // "$ref": "HttpHealthCheckList"
  15929. // },
  15930. // "scopes": [
  15931. // "https://www.googleapis.com/auth/cloud-platform",
  15932. // "https://www.googleapis.com/auth/compute",
  15933. // "https://www.googleapis.com/auth/compute.readonly"
  15934. // ]
  15935. // }
  15936. }
  15937. // Pages invokes f for each page of results.
  15938. // A non-nil error returned from f will halt the iteration.
  15939. // The provided context supersedes any context provided to the Context method.
  15940. func (c *HttpHealthChecksListCall) Pages(ctx context.Context, f func(*HttpHealthCheckList) error) error {
  15941. c.ctx_ = ctx
  15942. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  15943. for {
  15944. x, err := c.Do()
  15945. if err != nil {
  15946. return err
  15947. }
  15948. if err := f(x); err != nil {
  15949. return err
  15950. }
  15951. if x.NextPageToken == "" {
  15952. return nil
  15953. }
  15954. c.PageToken(x.NextPageToken)
  15955. }
  15956. }
  15957. // method id "compute.httpHealthChecks.patch":
  15958. type HttpHealthChecksPatchCall struct {
  15959. s *Service
  15960. project string
  15961. httpHealthCheck string
  15962. httphealthcheck *HttpHealthCheck
  15963. urlParams_ gensupport.URLParams
  15964. ctx_ context.Context
  15965. }
  15966. // Patch: Updates a HttpHealthCheck resource in the specified project
  15967. // using the data included in the request. This method supports patch
  15968. // semantics.
  15969. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/patch
  15970. func (r *HttpHealthChecksService) Patch(project string, httpHealthCheck string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksPatchCall {
  15971. c := &HttpHealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15972. c.project = project
  15973. c.httpHealthCheck = httpHealthCheck
  15974. c.httphealthcheck = httphealthcheck
  15975. return c
  15976. }
  15977. // Fields allows partial responses to be retrieved. See
  15978. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15979. // for more information.
  15980. func (c *HttpHealthChecksPatchCall) Fields(s ...googleapi.Field) *HttpHealthChecksPatchCall {
  15981. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15982. return c
  15983. }
  15984. // Context sets the context to be used in this call's Do method. Any
  15985. // pending HTTP request will be aborted if the provided context is
  15986. // canceled.
  15987. func (c *HttpHealthChecksPatchCall) Context(ctx context.Context) *HttpHealthChecksPatchCall {
  15988. c.ctx_ = ctx
  15989. return c
  15990. }
  15991. func (c *HttpHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
  15992. var body io.Reader = nil
  15993. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck)
  15994. if err != nil {
  15995. return nil, err
  15996. }
  15997. ctype := "application/json"
  15998. c.urlParams_.Set("alt", alt)
  15999. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  16000. urls += "?" + c.urlParams_.Encode()
  16001. req, _ := http.NewRequest("PATCH", urls, body)
  16002. googleapi.Expand(req.URL, map[string]string{
  16003. "project": c.project,
  16004. "httpHealthCheck": c.httpHealthCheck,
  16005. })
  16006. req.Header.Set("Content-Type", ctype)
  16007. req.Header.Set("User-Agent", c.s.userAgent())
  16008. if c.ctx_ != nil {
  16009. return ctxhttp.Do(c.ctx_, c.s.client, req)
  16010. }
  16011. return c.s.client.Do(req)
  16012. }
  16013. // Do executes the "compute.httpHealthChecks.patch" call.
  16014. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  16015. // status code is an error. Response headers are in either
  16016. // *Operation.ServerResponse.Header or (if a response was returned at
  16017. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16018. // to check whether the returned error was because
  16019. // http.StatusNotModified was returned.
  16020. func (c *HttpHealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  16021. gensupport.SetOptions(c.urlParams_, opts...)
  16022. res, err := c.doRequest("json")
  16023. if res != nil && res.StatusCode == http.StatusNotModified {
  16024. if res.Body != nil {
  16025. res.Body.Close()
  16026. }
  16027. return nil, &googleapi.Error{
  16028. Code: res.StatusCode,
  16029. Header: res.Header,
  16030. }
  16031. }
  16032. if err != nil {
  16033. return nil, err
  16034. }
  16035. defer googleapi.CloseBody(res)
  16036. if err := googleapi.CheckResponse(res); err != nil {
  16037. return nil, err
  16038. }
  16039. ret := &Operation{
  16040. ServerResponse: googleapi.ServerResponse{
  16041. Header: res.Header,
  16042. HTTPStatusCode: res.StatusCode,
  16043. },
  16044. }
  16045. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  16046. return nil, err
  16047. }
  16048. return ret, nil
  16049. // {
  16050. // "description": "Updates a HttpHealthCheck resource in the specified project using the data included in the request. This method supports patch semantics.",
  16051. // "httpMethod": "PATCH",
  16052. // "id": "compute.httpHealthChecks.patch",
  16053. // "parameterOrder": [
  16054. // "project",
  16055. // "httpHealthCheck"
  16056. // ],
  16057. // "parameters": {
  16058. // "httpHealthCheck": {
  16059. // "description": "Name of the HttpHealthCheck resource to update.",
  16060. // "location": "path",
  16061. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  16062. // "required": true,
  16063. // "type": "string"
  16064. // },
  16065. // "project": {
  16066. // "description": "Project ID for this request.",
  16067. // "location": "path",
  16068. // "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])?))",
  16069. // "required": true,
  16070. // "type": "string"
  16071. // }
  16072. // },
  16073. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  16074. // "request": {
  16075. // "$ref": "HttpHealthCheck"
  16076. // },
  16077. // "response": {
  16078. // "$ref": "Operation"
  16079. // },
  16080. // "scopes": [
  16081. // "https://www.googleapis.com/auth/cloud-platform",
  16082. // "https://www.googleapis.com/auth/compute"
  16083. // ]
  16084. // }
  16085. }
  16086. // method id "compute.httpHealthChecks.update":
  16087. type HttpHealthChecksUpdateCall struct {
  16088. s *Service
  16089. project string
  16090. httpHealthCheck string
  16091. httphealthcheck *HttpHealthCheck
  16092. urlParams_ gensupport.URLParams
  16093. ctx_ context.Context
  16094. }
  16095. // Update: Updates a HttpHealthCheck resource in the specified project
  16096. // using the data included in the request.
  16097. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/update
  16098. func (r *HttpHealthChecksService) Update(project string, httpHealthCheck string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksUpdateCall {
  16099. c := &HttpHealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16100. c.project = project
  16101. c.httpHealthCheck = httpHealthCheck
  16102. c.httphealthcheck = httphealthcheck
  16103. return c
  16104. }
  16105. // Fields allows partial responses to be retrieved. See
  16106. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16107. // for more information.
  16108. func (c *HttpHealthChecksUpdateCall) Fields(s ...googleapi.Field) *HttpHealthChecksUpdateCall {
  16109. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16110. return c
  16111. }
  16112. // Context sets the context to be used in this call's Do method. Any
  16113. // pending HTTP request will be aborted if the provided context is
  16114. // canceled.
  16115. func (c *HttpHealthChecksUpdateCall) Context(ctx context.Context) *HttpHealthChecksUpdateCall {
  16116. c.ctx_ = ctx
  16117. return c
  16118. }
  16119. func (c *HttpHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
  16120. var body io.Reader = nil
  16121. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck)
  16122. if err != nil {
  16123. return nil, err
  16124. }
  16125. ctype := "application/json"
  16126. c.urlParams_.Set("alt", alt)
  16127. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  16128. urls += "?" + c.urlParams_.Encode()
  16129. req, _ := http.NewRequest("PUT", urls, body)
  16130. googleapi.Expand(req.URL, map[string]string{
  16131. "project": c.project,
  16132. "httpHealthCheck": c.httpHealthCheck,
  16133. })
  16134. req.Header.Set("Content-Type", ctype)
  16135. req.Header.Set("User-Agent", c.s.userAgent())
  16136. if c.ctx_ != nil {
  16137. return ctxhttp.Do(c.ctx_, c.s.client, req)
  16138. }
  16139. return c.s.client.Do(req)
  16140. }
  16141. // Do executes the "compute.httpHealthChecks.update" call.
  16142. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  16143. // status code is an error. Response headers are in either
  16144. // *Operation.ServerResponse.Header or (if a response was returned at
  16145. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16146. // to check whether the returned error was because
  16147. // http.StatusNotModified was returned.
  16148. func (c *HttpHealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  16149. gensupport.SetOptions(c.urlParams_, opts...)
  16150. res, err := c.doRequest("json")
  16151. if res != nil && res.StatusCode == http.StatusNotModified {
  16152. if res.Body != nil {
  16153. res.Body.Close()
  16154. }
  16155. return nil, &googleapi.Error{
  16156. Code: res.StatusCode,
  16157. Header: res.Header,
  16158. }
  16159. }
  16160. if err != nil {
  16161. return nil, err
  16162. }
  16163. defer googleapi.CloseBody(res)
  16164. if err := googleapi.CheckResponse(res); err != nil {
  16165. return nil, err
  16166. }
  16167. ret := &Operation{
  16168. ServerResponse: googleapi.ServerResponse{
  16169. Header: res.Header,
  16170. HTTPStatusCode: res.StatusCode,
  16171. },
  16172. }
  16173. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  16174. return nil, err
  16175. }
  16176. return ret, nil
  16177. // {
  16178. // "description": "Updates a HttpHealthCheck resource in the specified project using the data included in the request.",
  16179. // "httpMethod": "PUT",
  16180. // "id": "compute.httpHealthChecks.update",
  16181. // "parameterOrder": [
  16182. // "project",
  16183. // "httpHealthCheck"
  16184. // ],
  16185. // "parameters": {
  16186. // "httpHealthCheck": {
  16187. // "description": "Name of the HttpHealthCheck resource to update.",
  16188. // "location": "path",
  16189. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  16190. // "required": true,
  16191. // "type": "string"
  16192. // },
  16193. // "project": {
  16194. // "description": "Project ID for this request.",
  16195. // "location": "path",
  16196. // "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])?))",
  16197. // "required": true,
  16198. // "type": "string"
  16199. // }
  16200. // },
  16201. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  16202. // "request": {
  16203. // "$ref": "HttpHealthCheck"
  16204. // },
  16205. // "response": {
  16206. // "$ref": "Operation"
  16207. // },
  16208. // "scopes": [
  16209. // "https://www.googleapis.com/auth/cloud-platform",
  16210. // "https://www.googleapis.com/auth/compute"
  16211. // ]
  16212. // }
  16213. }
  16214. // method id "compute.httpsHealthChecks.delete":
  16215. type HttpsHealthChecksDeleteCall struct {
  16216. s *Service
  16217. project string
  16218. httpsHealthCheck string
  16219. urlParams_ gensupport.URLParams
  16220. ctx_ context.Context
  16221. }
  16222. // Delete: Deletes the specified HttpsHealthCheck resource.
  16223. func (r *HttpsHealthChecksService) Delete(project string, httpsHealthCheck string) *HttpsHealthChecksDeleteCall {
  16224. c := &HttpsHealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16225. c.project = project
  16226. c.httpsHealthCheck = httpsHealthCheck
  16227. return c
  16228. }
  16229. // Fields allows partial responses to be retrieved. See
  16230. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16231. // for more information.
  16232. func (c *HttpsHealthChecksDeleteCall) Fields(s ...googleapi.Field) *HttpsHealthChecksDeleteCall {
  16233. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16234. return c
  16235. }
  16236. // Context sets the context to be used in this call's Do method. Any
  16237. // pending HTTP request will be aborted if the provided context is
  16238. // canceled.
  16239. func (c *HttpsHealthChecksDeleteCall) Context(ctx context.Context) *HttpsHealthChecksDeleteCall {
  16240. c.ctx_ = ctx
  16241. return c
  16242. }
  16243. func (c *HttpsHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
  16244. var body io.Reader = nil
  16245. c.urlParams_.Set("alt", alt)
  16246. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  16247. urls += "?" + c.urlParams_.Encode()
  16248. req, _ := http.NewRequest("DELETE", urls, body)
  16249. googleapi.Expand(req.URL, map[string]string{
  16250. "project": c.project,
  16251. "httpsHealthCheck": c.httpsHealthCheck,
  16252. })
  16253. req.Header.Set("User-Agent", c.s.userAgent())
  16254. if c.ctx_ != nil {
  16255. return ctxhttp.Do(c.ctx_, c.s.client, req)
  16256. }
  16257. return c.s.client.Do(req)
  16258. }
  16259. // Do executes the "compute.httpsHealthChecks.delete" call.
  16260. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  16261. // status code is an error. Response headers are in either
  16262. // *Operation.ServerResponse.Header or (if a response was returned at
  16263. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16264. // to check whether the returned error was because
  16265. // http.StatusNotModified was returned.
  16266. func (c *HttpsHealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  16267. gensupport.SetOptions(c.urlParams_, opts...)
  16268. res, err := c.doRequest("json")
  16269. if res != nil && res.StatusCode == http.StatusNotModified {
  16270. if res.Body != nil {
  16271. res.Body.Close()
  16272. }
  16273. return nil, &googleapi.Error{
  16274. Code: res.StatusCode,
  16275. Header: res.Header,
  16276. }
  16277. }
  16278. if err != nil {
  16279. return nil, err
  16280. }
  16281. defer googleapi.CloseBody(res)
  16282. if err := googleapi.CheckResponse(res); err != nil {
  16283. return nil, err
  16284. }
  16285. ret := &Operation{
  16286. ServerResponse: googleapi.ServerResponse{
  16287. Header: res.Header,
  16288. HTTPStatusCode: res.StatusCode,
  16289. },
  16290. }
  16291. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  16292. return nil, err
  16293. }
  16294. return ret, nil
  16295. // {
  16296. // "description": "Deletes the specified HttpsHealthCheck resource.",
  16297. // "httpMethod": "DELETE",
  16298. // "id": "compute.httpsHealthChecks.delete",
  16299. // "parameterOrder": [
  16300. // "project",
  16301. // "httpsHealthCheck"
  16302. // ],
  16303. // "parameters": {
  16304. // "httpsHealthCheck": {
  16305. // "description": "Name of the HttpsHealthCheck resource to delete.",
  16306. // "location": "path",
  16307. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  16308. // "required": true,
  16309. // "type": "string"
  16310. // },
  16311. // "project": {
  16312. // "description": "Project ID for this request.",
  16313. // "location": "path",
  16314. // "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])?))",
  16315. // "required": true,
  16316. // "type": "string"
  16317. // }
  16318. // },
  16319. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  16320. // "response": {
  16321. // "$ref": "Operation"
  16322. // },
  16323. // "scopes": [
  16324. // "https://www.googleapis.com/auth/cloud-platform",
  16325. // "https://www.googleapis.com/auth/compute"
  16326. // ]
  16327. // }
  16328. }
  16329. // method id "compute.httpsHealthChecks.get":
  16330. type HttpsHealthChecksGetCall struct {
  16331. s *Service
  16332. project string
  16333. httpsHealthCheck string
  16334. urlParams_ gensupport.URLParams
  16335. ifNoneMatch_ string
  16336. ctx_ context.Context
  16337. }
  16338. // Get: Returns the specified HttpsHealthCheck resource.
  16339. func (r *HttpsHealthChecksService) Get(project string, httpsHealthCheck string) *HttpsHealthChecksGetCall {
  16340. c := &HttpsHealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16341. c.project = project
  16342. c.httpsHealthCheck = httpsHealthCheck
  16343. return c
  16344. }
  16345. // Fields allows partial responses to be retrieved. See
  16346. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16347. // for more information.
  16348. func (c *HttpsHealthChecksGetCall) Fields(s ...googleapi.Field) *HttpsHealthChecksGetCall {
  16349. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16350. return c
  16351. }
  16352. // IfNoneMatch sets the optional parameter which makes the operation
  16353. // fail if the object's ETag matches the given value. This is useful for
  16354. // getting updates only after the object has changed since the last
  16355. // request. Use googleapi.IsNotModified to check whether the response
  16356. // error from Do is the result of In-None-Match.
  16357. func (c *HttpsHealthChecksGetCall) IfNoneMatch(entityTag string) *HttpsHealthChecksGetCall {
  16358. c.ifNoneMatch_ = entityTag
  16359. return c
  16360. }
  16361. // Context sets the context to be used in this call's Do method. Any
  16362. // pending HTTP request will be aborted if the provided context is
  16363. // canceled.
  16364. func (c *HttpsHealthChecksGetCall) Context(ctx context.Context) *HttpsHealthChecksGetCall {
  16365. c.ctx_ = ctx
  16366. return c
  16367. }
  16368. func (c *HttpsHealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
  16369. var body io.Reader = nil
  16370. c.urlParams_.Set("alt", alt)
  16371. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  16372. urls += "?" + c.urlParams_.Encode()
  16373. req, _ := http.NewRequest("GET", urls, body)
  16374. googleapi.Expand(req.URL, map[string]string{
  16375. "project": c.project,
  16376. "httpsHealthCheck": c.httpsHealthCheck,
  16377. })
  16378. req.Header.Set("User-Agent", c.s.userAgent())
  16379. if c.ifNoneMatch_ != "" {
  16380. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  16381. }
  16382. if c.ctx_ != nil {
  16383. return ctxhttp.Do(c.ctx_, c.s.client, req)
  16384. }
  16385. return c.s.client.Do(req)
  16386. }
  16387. // Do executes the "compute.httpsHealthChecks.get" call.
  16388. // Exactly one of *HttpsHealthCheck or error will be non-nil. Any
  16389. // non-2xx status code is an error. Response headers are in either
  16390. // *HttpsHealthCheck.ServerResponse.Header or (if a response was
  16391. // returned at all) in error.(*googleapi.Error).Header. Use
  16392. // googleapi.IsNotModified to check whether the returned error was
  16393. // because http.StatusNotModified was returned.
  16394. func (c *HttpsHealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HttpsHealthCheck, error) {
  16395. gensupport.SetOptions(c.urlParams_, opts...)
  16396. res, err := c.doRequest("json")
  16397. if res != nil && res.StatusCode == http.StatusNotModified {
  16398. if res.Body != nil {
  16399. res.Body.Close()
  16400. }
  16401. return nil, &googleapi.Error{
  16402. Code: res.StatusCode,
  16403. Header: res.Header,
  16404. }
  16405. }
  16406. if err != nil {
  16407. return nil, err
  16408. }
  16409. defer googleapi.CloseBody(res)
  16410. if err := googleapi.CheckResponse(res); err != nil {
  16411. return nil, err
  16412. }
  16413. ret := &HttpsHealthCheck{
  16414. ServerResponse: googleapi.ServerResponse{
  16415. Header: res.Header,
  16416. HTTPStatusCode: res.StatusCode,
  16417. },
  16418. }
  16419. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  16420. return nil, err
  16421. }
  16422. return ret, nil
  16423. // {
  16424. // "description": "Returns the specified HttpsHealthCheck resource.",
  16425. // "httpMethod": "GET",
  16426. // "id": "compute.httpsHealthChecks.get",
  16427. // "parameterOrder": [
  16428. // "project",
  16429. // "httpsHealthCheck"
  16430. // ],
  16431. // "parameters": {
  16432. // "httpsHealthCheck": {
  16433. // "description": "Name of the HttpsHealthCheck resource to return.",
  16434. // "location": "path",
  16435. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  16436. // "required": true,
  16437. // "type": "string"
  16438. // },
  16439. // "project": {
  16440. // "description": "Project ID for this request.",
  16441. // "location": "path",
  16442. // "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])?))",
  16443. // "required": true,
  16444. // "type": "string"
  16445. // }
  16446. // },
  16447. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  16448. // "response": {
  16449. // "$ref": "HttpsHealthCheck"
  16450. // },
  16451. // "scopes": [
  16452. // "https://www.googleapis.com/auth/cloud-platform",
  16453. // "https://www.googleapis.com/auth/compute",
  16454. // "https://www.googleapis.com/auth/compute.readonly"
  16455. // ]
  16456. // }
  16457. }
  16458. // method id "compute.httpsHealthChecks.insert":
  16459. type HttpsHealthChecksInsertCall struct {
  16460. s *Service
  16461. project string
  16462. httpshealthcheck *HttpsHealthCheck
  16463. urlParams_ gensupport.URLParams
  16464. ctx_ context.Context
  16465. }
  16466. // Insert: Creates a HttpsHealthCheck resource in the specified project
  16467. // using the data included in the request.
  16468. func (r *HttpsHealthChecksService) Insert(project string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksInsertCall {
  16469. c := &HttpsHealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16470. c.project = project
  16471. c.httpshealthcheck = httpshealthcheck
  16472. return c
  16473. }
  16474. // Fields allows partial responses to be retrieved. See
  16475. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16476. // for more information.
  16477. func (c *HttpsHealthChecksInsertCall) Fields(s ...googleapi.Field) *HttpsHealthChecksInsertCall {
  16478. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16479. return c
  16480. }
  16481. // Context sets the context to be used in this call's Do method. Any
  16482. // pending HTTP request will be aborted if the provided context is
  16483. // canceled.
  16484. func (c *HttpsHealthChecksInsertCall) Context(ctx context.Context) *HttpsHealthChecksInsertCall {
  16485. c.ctx_ = ctx
  16486. return c
  16487. }
  16488. func (c *HttpsHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
  16489. var body io.Reader = nil
  16490. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck)
  16491. if err != nil {
  16492. return nil, err
  16493. }
  16494. ctype := "application/json"
  16495. c.urlParams_.Set("alt", alt)
  16496. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks")
  16497. urls += "?" + c.urlParams_.Encode()
  16498. req, _ := http.NewRequest("POST", urls, body)
  16499. googleapi.Expand(req.URL, map[string]string{
  16500. "project": c.project,
  16501. })
  16502. req.Header.Set("Content-Type", ctype)
  16503. req.Header.Set("User-Agent", c.s.userAgent())
  16504. if c.ctx_ != nil {
  16505. return ctxhttp.Do(c.ctx_, c.s.client, req)
  16506. }
  16507. return c.s.client.Do(req)
  16508. }
  16509. // Do executes the "compute.httpsHealthChecks.insert" call.
  16510. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  16511. // status code is an error. Response headers are in either
  16512. // *Operation.ServerResponse.Header or (if a response was returned at
  16513. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16514. // to check whether the returned error was because
  16515. // http.StatusNotModified was returned.
  16516. func (c *HttpsHealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  16517. gensupport.SetOptions(c.urlParams_, opts...)
  16518. res, err := c.doRequest("json")
  16519. if res != nil && res.StatusCode == http.StatusNotModified {
  16520. if res.Body != nil {
  16521. res.Body.Close()
  16522. }
  16523. return nil, &googleapi.Error{
  16524. Code: res.StatusCode,
  16525. Header: res.Header,
  16526. }
  16527. }
  16528. if err != nil {
  16529. return nil, err
  16530. }
  16531. defer googleapi.CloseBody(res)
  16532. if err := googleapi.CheckResponse(res); err != nil {
  16533. return nil, err
  16534. }
  16535. ret := &Operation{
  16536. ServerResponse: googleapi.ServerResponse{
  16537. Header: res.Header,
  16538. HTTPStatusCode: res.StatusCode,
  16539. },
  16540. }
  16541. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  16542. return nil, err
  16543. }
  16544. return ret, nil
  16545. // {
  16546. // "description": "Creates a HttpsHealthCheck resource in the specified project using the data included in the request.",
  16547. // "httpMethod": "POST",
  16548. // "id": "compute.httpsHealthChecks.insert",
  16549. // "parameterOrder": [
  16550. // "project"
  16551. // ],
  16552. // "parameters": {
  16553. // "project": {
  16554. // "description": "Project ID for this request.",
  16555. // "location": "path",
  16556. // "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])?))",
  16557. // "required": true,
  16558. // "type": "string"
  16559. // }
  16560. // },
  16561. // "path": "{project}/global/httpsHealthChecks",
  16562. // "request": {
  16563. // "$ref": "HttpsHealthCheck"
  16564. // },
  16565. // "response": {
  16566. // "$ref": "Operation"
  16567. // },
  16568. // "scopes": [
  16569. // "https://www.googleapis.com/auth/cloud-platform",
  16570. // "https://www.googleapis.com/auth/compute"
  16571. // ]
  16572. // }
  16573. }
  16574. // method id "compute.httpsHealthChecks.list":
  16575. type HttpsHealthChecksListCall struct {
  16576. s *Service
  16577. project string
  16578. urlParams_ gensupport.URLParams
  16579. ifNoneMatch_ string
  16580. ctx_ context.Context
  16581. }
  16582. // List: Retrieves the list of HttpsHealthCheck resources available to
  16583. // the specified project.
  16584. func (r *HttpsHealthChecksService) List(project string) *HttpsHealthChecksListCall {
  16585. c := &HttpsHealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16586. c.project = project
  16587. return c
  16588. }
  16589. // Filter sets the optional parameter "filter": Sets a filter expression
  16590. // for filtering listed resources, in the form filter={expression}. Your
  16591. // {expression} must be in the format: field_name comparison_string
  16592. // literal_string.
  16593. //
  16594. // The field_name is the name of the field you want to compare. Only
  16595. // atomic field types are supported (string, number, boolean). The
  16596. // comparison_string must be either eq (equals) or ne (not equals). The
  16597. // literal_string is the string value to filter to. The literal value
  16598. // must be valid for the type of field you are filtering by (string,
  16599. // number, boolean). For string fields, the literal value is interpreted
  16600. // as a regular expression using RE2 syntax. The literal value must
  16601. // match the entire field.
  16602. //
  16603. // For example, filter=name ne example-instance.
  16604. //
  16605. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  16606. // you can also filter on nested fields. For example, you could filter
  16607. // on instances that have set the scheduling.automaticRestart field to
  16608. // true. In particular, use filtering on nested fields to take advantage
  16609. // of instance labels to organize and filter results based on label
  16610. // values.
  16611. //
  16612. // The Beta API also supports filtering on multiple expressions by
  16613. // providing each separate expression within parentheses. For example,
  16614. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  16615. // Multiple expressions are treated as AND expressions meaning that
  16616. // resources must match all expressions to pass the filters.
  16617. func (c *HttpsHealthChecksListCall) Filter(filter string) *HttpsHealthChecksListCall {
  16618. c.urlParams_.Set("filter", filter)
  16619. return c
  16620. }
  16621. // MaxResults sets the optional parameter "maxResults": The maximum
  16622. // number of results per page that Compute Engine should return. If the
  16623. // number of available results is larger than maxResults, Compute Engine
  16624. // returns a nextPageToken that can be used to get the next page of
  16625. // results in subsequent list requests.
  16626. func (c *HttpsHealthChecksListCall) MaxResults(maxResults int64) *HttpsHealthChecksListCall {
  16627. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  16628. return c
  16629. }
  16630. // PageToken sets the optional parameter "pageToken": Specifies a page
  16631. // token to use. Set pageToken to the nextPageToken returned by a
  16632. // previous list request to get the next page of results.
  16633. func (c *HttpsHealthChecksListCall) PageToken(pageToken string) *HttpsHealthChecksListCall {
  16634. c.urlParams_.Set("pageToken", pageToken)
  16635. return c
  16636. }
  16637. // Fields allows partial responses to be retrieved. See
  16638. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16639. // for more information.
  16640. func (c *HttpsHealthChecksListCall) Fields(s ...googleapi.Field) *HttpsHealthChecksListCall {
  16641. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16642. return c
  16643. }
  16644. // IfNoneMatch sets the optional parameter which makes the operation
  16645. // fail if the object's ETag matches the given value. This is useful for
  16646. // getting updates only after the object has changed since the last
  16647. // request. Use googleapi.IsNotModified to check whether the response
  16648. // error from Do is the result of In-None-Match.
  16649. func (c *HttpsHealthChecksListCall) IfNoneMatch(entityTag string) *HttpsHealthChecksListCall {
  16650. c.ifNoneMatch_ = entityTag
  16651. return c
  16652. }
  16653. // Context sets the context to be used in this call's Do method. Any
  16654. // pending HTTP request will be aborted if the provided context is
  16655. // canceled.
  16656. func (c *HttpsHealthChecksListCall) Context(ctx context.Context) *HttpsHealthChecksListCall {
  16657. c.ctx_ = ctx
  16658. return c
  16659. }
  16660. func (c *HttpsHealthChecksListCall) doRequest(alt string) (*http.Response, error) {
  16661. var body io.Reader = nil
  16662. c.urlParams_.Set("alt", alt)
  16663. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks")
  16664. urls += "?" + c.urlParams_.Encode()
  16665. req, _ := http.NewRequest("GET", urls, body)
  16666. googleapi.Expand(req.URL, map[string]string{
  16667. "project": c.project,
  16668. })
  16669. req.Header.Set("User-Agent", c.s.userAgent())
  16670. if c.ifNoneMatch_ != "" {
  16671. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  16672. }
  16673. if c.ctx_ != nil {
  16674. return ctxhttp.Do(c.ctx_, c.s.client, req)
  16675. }
  16676. return c.s.client.Do(req)
  16677. }
  16678. // Do executes the "compute.httpsHealthChecks.list" call.
  16679. // Exactly one of *HttpsHealthCheckList or error will be non-nil. Any
  16680. // non-2xx status code is an error. Response headers are in either
  16681. // *HttpsHealthCheckList.ServerResponse.Header or (if a response was
  16682. // returned at all) in error.(*googleapi.Error).Header. Use
  16683. // googleapi.IsNotModified to check whether the returned error was
  16684. // because http.StatusNotModified was returned.
  16685. func (c *HttpsHealthChecksListCall) Do(opts ...googleapi.CallOption) (*HttpsHealthCheckList, error) {
  16686. gensupport.SetOptions(c.urlParams_, opts...)
  16687. res, err := c.doRequest("json")
  16688. if res != nil && res.StatusCode == http.StatusNotModified {
  16689. if res.Body != nil {
  16690. res.Body.Close()
  16691. }
  16692. return nil, &googleapi.Error{
  16693. Code: res.StatusCode,
  16694. Header: res.Header,
  16695. }
  16696. }
  16697. if err != nil {
  16698. return nil, err
  16699. }
  16700. defer googleapi.CloseBody(res)
  16701. if err := googleapi.CheckResponse(res); err != nil {
  16702. return nil, err
  16703. }
  16704. ret := &HttpsHealthCheckList{
  16705. ServerResponse: googleapi.ServerResponse{
  16706. Header: res.Header,
  16707. HTTPStatusCode: res.StatusCode,
  16708. },
  16709. }
  16710. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  16711. return nil, err
  16712. }
  16713. return ret, nil
  16714. // {
  16715. // "description": "Retrieves the list of HttpsHealthCheck resources available to the specified project.",
  16716. // "httpMethod": "GET",
  16717. // "id": "compute.httpsHealthChecks.list",
  16718. // "parameterOrder": [
  16719. // "project"
  16720. // ],
  16721. // "parameters": {
  16722. // "filter": {
  16723. // "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.",
  16724. // "location": "query",
  16725. // "type": "string"
  16726. // },
  16727. // "maxResults": {
  16728. // "default": "500",
  16729. // "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.",
  16730. // "format": "uint32",
  16731. // "location": "query",
  16732. // "maximum": "500",
  16733. // "minimum": "0",
  16734. // "type": "integer"
  16735. // },
  16736. // "pageToken": {
  16737. // "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.",
  16738. // "location": "query",
  16739. // "type": "string"
  16740. // },
  16741. // "project": {
  16742. // "description": "Project ID for this request.",
  16743. // "location": "path",
  16744. // "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])?))",
  16745. // "required": true,
  16746. // "type": "string"
  16747. // }
  16748. // },
  16749. // "path": "{project}/global/httpsHealthChecks",
  16750. // "response": {
  16751. // "$ref": "HttpsHealthCheckList"
  16752. // },
  16753. // "scopes": [
  16754. // "https://www.googleapis.com/auth/cloud-platform",
  16755. // "https://www.googleapis.com/auth/compute",
  16756. // "https://www.googleapis.com/auth/compute.readonly"
  16757. // ]
  16758. // }
  16759. }
  16760. // Pages invokes f for each page of results.
  16761. // A non-nil error returned from f will halt the iteration.
  16762. // The provided context supersedes any context provided to the Context method.
  16763. func (c *HttpsHealthChecksListCall) Pages(ctx context.Context, f func(*HttpsHealthCheckList) error) error {
  16764. c.ctx_ = ctx
  16765. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  16766. for {
  16767. x, err := c.Do()
  16768. if err != nil {
  16769. return err
  16770. }
  16771. if err := f(x); err != nil {
  16772. return err
  16773. }
  16774. if x.NextPageToken == "" {
  16775. return nil
  16776. }
  16777. c.PageToken(x.NextPageToken)
  16778. }
  16779. }
  16780. // method id "compute.httpsHealthChecks.patch":
  16781. type HttpsHealthChecksPatchCall struct {
  16782. s *Service
  16783. project string
  16784. httpsHealthCheck string
  16785. httpshealthcheck *HttpsHealthCheck
  16786. urlParams_ gensupport.URLParams
  16787. ctx_ context.Context
  16788. }
  16789. // Patch: Updates a HttpsHealthCheck resource in the specified project
  16790. // using the data included in the request. This method supports patch
  16791. // semantics.
  16792. func (r *HttpsHealthChecksService) Patch(project string, httpsHealthCheck string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksPatchCall {
  16793. c := &HttpsHealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16794. c.project = project
  16795. c.httpsHealthCheck = httpsHealthCheck
  16796. c.httpshealthcheck = httpshealthcheck
  16797. return c
  16798. }
  16799. // Fields allows partial responses to be retrieved. See
  16800. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16801. // for more information.
  16802. func (c *HttpsHealthChecksPatchCall) Fields(s ...googleapi.Field) *HttpsHealthChecksPatchCall {
  16803. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16804. return c
  16805. }
  16806. // Context sets the context to be used in this call's Do method. Any
  16807. // pending HTTP request will be aborted if the provided context is
  16808. // canceled.
  16809. func (c *HttpsHealthChecksPatchCall) Context(ctx context.Context) *HttpsHealthChecksPatchCall {
  16810. c.ctx_ = ctx
  16811. return c
  16812. }
  16813. func (c *HttpsHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
  16814. var body io.Reader = nil
  16815. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck)
  16816. if err != nil {
  16817. return nil, err
  16818. }
  16819. ctype := "application/json"
  16820. c.urlParams_.Set("alt", alt)
  16821. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  16822. urls += "?" + c.urlParams_.Encode()
  16823. req, _ := http.NewRequest("PATCH", urls, body)
  16824. googleapi.Expand(req.URL, map[string]string{
  16825. "project": c.project,
  16826. "httpsHealthCheck": c.httpsHealthCheck,
  16827. })
  16828. req.Header.Set("Content-Type", ctype)
  16829. req.Header.Set("User-Agent", c.s.userAgent())
  16830. if c.ctx_ != nil {
  16831. return ctxhttp.Do(c.ctx_, c.s.client, req)
  16832. }
  16833. return c.s.client.Do(req)
  16834. }
  16835. // Do executes the "compute.httpsHealthChecks.patch" call.
  16836. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  16837. // status code is an error. Response headers are in either
  16838. // *Operation.ServerResponse.Header or (if a response was returned at
  16839. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16840. // to check whether the returned error was because
  16841. // http.StatusNotModified was returned.
  16842. func (c *HttpsHealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  16843. gensupport.SetOptions(c.urlParams_, opts...)
  16844. res, err := c.doRequest("json")
  16845. if res != nil && res.StatusCode == http.StatusNotModified {
  16846. if res.Body != nil {
  16847. res.Body.Close()
  16848. }
  16849. return nil, &googleapi.Error{
  16850. Code: res.StatusCode,
  16851. Header: res.Header,
  16852. }
  16853. }
  16854. if err != nil {
  16855. return nil, err
  16856. }
  16857. defer googleapi.CloseBody(res)
  16858. if err := googleapi.CheckResponse(res); err != nil {
  16859. return nil, err
  16860. }
  16861. ret := &Operation{
  16862. ServerResponse: googleapi.ServerResponse{
  16863. Header: res.Header,
  16864. HTTPStatusCode: res.StatusCode,
  16865. },
  16866. }
  16867. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  16868. return nil, err
  16869. }
  16870. return ret, nil
  16871. // {
  16872. // "description": "Updates a HttpsHealthCheck resource in the specified project using the data included in the request. This method supports patch semantics.",
  16873. // "httpMethod": "PATCH",
  16874. // "id": "compute.httpsHealthChecks.patch",
  16875. // "parameterOrder": [
  16876. // "project",
  16877. // "httpsHealthCheck"
  16878. // ],
  16879. // "parameters": {
  16880. // "httpsHealthCheck": {
  16881. // "description": "Name of the HttpsHealthCheck resource to update.",
  16882. // "location": "path",
  16883. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  16884. // "required": true,
  16885. // "type": "string"
  16886. // },
  16887. // "project": {
  16888. // "description": "Project ID for this request.",
  16889. // "location": "path",
  16890. // "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])?))",
  16891. // "required": true,
  16892. // "type": "string"
  16893. // }
  16894. // },
  16895. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  16896. // "request": {
  16897. // "$ref": "HttpsHealthCheck"
  16898. // },
  16899. // "response": {
  16900. // "$ref": "Operation"
  16901. // },
  16902. // "scopes": [
  16903. // "https://www.googleapis.com/auth/cloud-platform",
  16904. // "https://www.googleapis.com/auth/compute"
  16905. // ]
  16906. // }
  16907. }
  16908. // method id "compute.httpsHealthChecks.update":
  16909. type HttpsHealthChecksUpdateCall struct {
  16910. s *Service
  16911. project string
  16912. httpsHealthCheck string
  16913. httpshealthcheck *HttpsHealthCheck
  16914. urlParams_ gensupport.URLParams
  16915. ctx_ context.Context
  16916. }
  16917. // Update: Updates a HttpsHealthCheck resource in the specified project
  16918. // using the data included in the request.
  16919. func (r *HttpsHealthChecksService) Update(project string, httpsHealthCheck string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksUpdateCall {
  16920. c := &HttpsHealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16921. c.project = project
  16922. c.httpsHealthCheck = httpsHealthCheck
  16923. c.httpshealthcheck = httpshealthcheck
  16924. return c
  16925. }
  16926. // Fields allows partial responses to be retrieved. See
  16927. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16928. // for more information.
  16929. func (c *HttpsHealthChecksUpdateCall) Fields(s ...googleapi.Field) *HttpsHealthChecksUpdateCall {
  16930. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16931. return c
  16932. }
  16933. // Context sets the context to be used in this call's Do method. Any
  16934. // pending HTTP request will be aborted if the provided context is
  16935. // canceled.
  16936. func (c *HttpsHealthChecksUpdateCall) Context(ctx context.Context) *HttpsHealthChecksUpdateCall {
  16937. c.ctx_ = ctx
  16938. return c
  16939. }
  16940. func (c *HttpsHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
  16941. var body io.Reader = nil
  16942. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck)
  16943. if err != nil {
  16944. return nil, err
  16945. }
  16946. ctype := "application/json"
  16947. c.urlParams_.Set("alt", alt)
  16948. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  16949. urls += "?" + c.urlParams_.Encode()
  16950. req, _ := http.NewRequest("PUT", urls, body)
  16951. googleapi.Expand(req.URL, map[string]string{
  16952. "project": c.project,
  16953. "httpsHealthCheck": c.httpsHealthCheck,
  16954. })
  16955. req.Header.Set("Content-Type", ctype)
  16956. req.Header.Set("User-Agent", c.s.userAgent())
  16957. if c.ctx_ != nil {
  16958. return ctxhttp.Do(c.ctx_, c.s.client, req)
  16959. }
  16960. return c.s.client.Do(req)
  16961. }
  16962. // Do executes the "compute.httpsHealthChecks.update" call.
  16963. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  16964. // status code is an error. Response headers are in either
  16965. // *Operation.ServerResponse.Header or (if a response was returned at
  16966. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16967. // to check whether the returned error was because
  16968. // http.StatusNotModified was returned.
  16969. func (c *HttpsHealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  16970. gensupport.SetOptions(c.urlParams_, opts...)
  16971. res, err := c.doRequest("json")
  16972. if res != nil && res.StatusCode == http.StatusNotModified {
  16973. if res.Body != nil {
  16974. res.Body.Close()
  16975. }
  16976. return nil, &googleapi.Error{
  16977. Code: res.StatusCode,
  16978. Header: res.Header,
  16979. }
  16980. }
  16981. if err != nil {
  16982. return nil, err
  16983. }
  16984. defer googleapi.CloseBody(res)
  16985. if err := googleapi.CheckResponse(res); err != nil {
  16986. return nil, err
  16987. }
  16988. ret := &Operation{
  16989. ServerResponse: googleapi.ServerResponse{
  16990. Header: res.Header,
  16991. HTTPStatusCode: res.StatusCode,
  16992. },
  16993. }
  16994. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  16995. return nil, err
  16996. }
  16997. return ret, nil
  16998. // {
  16999. // "description": "Updates a HttpsHealthCheck resource in the specified project using the data included in the request.",
  17000. // "httpMethod": "PUT",
  17001. // "id": "compute.httpsHealthChecks.update",
  17002. // "parameterOrder": [
  17003. // "project",
  17004. // "httpsHealthCheck"
  17005. // ],
  17006. // "parameters": {
  17007. // "httpsHealthCheck": {
  17008. // "description": "Name of the HttpsHealthCheck resource to update.",
  17009. // "location": "path",
  17010. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  17011. // "required": true,
  17012. // "type": "string"
  17013. // },
  17014. // "project": {
  17015. // "description": "Project ID for this request.",
  17016. // "location": "path",
  17017. // "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])?))",
  17018. // "required": true,
  17019. // "type": "string"
  17020. // }
  17021. // },
  17022. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  17023. // "request": {
  17024. // "$ref": "HttpsHealthCheck"
  17025. // },
  17026. // "response": {
  17027. // "$ref": "Operation"
  17028. // },
  17029. // "scopes": [
  17030. // "https://www.googleapis.com/auth/cloud-platform",
  17031. // "https://www.googleapis.com/auth/compute"
  17032. // ]
  17033. // }
  17034. }
  17035. // method id "compute.images.delete":
  17036. type ImagesDeleteCall struct {
  17037. s *Service
  17038. project string
  17039. image string
  17040. urlParams_ gensupport.URLParams
  17041. ctx_ context.Context
  17042. }
  17043. // Delete: Deletes the specified image resource.
  17044. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/delete
  17045. func (r *ImagesService) Delete(project string, image string) *ImagesDeleteCall {
  17046. c := &ImagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17047. c.project = project
  17048. c.image = image
  17049. return c
  17050. }
  17051. // Fields allows partial responses to be retrieved. See
  17052. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17053. // for more information.
  17054. func (c *ImagesDeleteCall) Fields(s ...googleapi.Field) *ImagesDeleteCall {
  17055. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17056. return c
  17057. }
  17058. // Context sets the context to be used in this call's Do method. Any
  17059. // pending HTTP request will be aborted if the provided context is
  17060. // canceled.
  17061. func (c *ImagesDeleteCall) Context(ctx context.Context) *ImagesDeleteCall {
  17062. c.ctx_ = ctx
  17063. return c
  17064. }
  17065. func (c *ImagesDeleteCall) doRequest(alt string) (*http.Response, error) {
  17066. var body io.Reader = nil
  17067. c.urlParams_.Set("alt", alt)
  17068. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}")
  17069. urls += "?" + c.urlParams_.Encode()
  17070. req, _ := http.NewRequest("DELETE", urls, body)
  17071. googleapi.Expand(req.URL, map[string]string{
  17072. "project": c.project,
  17073. "image": c.image,
  17074. })
  17075. req.Header.Set("User-Agent", c.s.userAgent())
  17076. if c.ctx_ != nil {
  17077. return ctxhttp.Do(c.ctx_, c.s.client, req)
  17078. }
  17079. return c.s.client.Do(req)
  17080. }
  17081. // Do executes the "compute.images.delete" call.
  17082. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  17083. // status code is an error. Response headers are in either
  17084. // *Operation.ServerResponse.Header or (if a response was returned at
  17085. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  17086. // to check whether the returned error was because
  17087. // http.StatusNotModified was returned.
  17088. func (c *ImagesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  17089. gensupport.SetOptions(c.urlParams_, opts...)
  17090. res, err := c.doRequest("json")
  17091. if res != nil && res.StatusCode == http.StatusNotModified {
  17092. if res.Body != nil {
  17093. res.Body.Close()
  17094. }
  17095. return nil, &googleapi.Error{
  17096. Code: res.StatusCode,
  17097. Header: res.Header,
  17098. }
  17099. }
  17100. if err != nil {
  17101. return nil, err
  17102. }
  17103. defer googleapi.CloseBody(res)
  17104. if err := googleapi.CheckResponse(res); err != nil {
  17105. return nil, err
  17106. }
  17107. ret := &Operation{
  17108. ServerResponse: googleapi.ServerResponse{
  17109. Header: res.Header,
  17110. HTTPStatusCode: res.StatusCode,
  17111. },
  17112. }
  17113. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  17114. return nil, err
  17115. }
  17116. return ret, nil
  17117. // {
  17118. // "description": "Deletes the specified image resource.",
  17119. // "httpMethod": "DELETE",
  17120. // "id": "compute.images.delete",
  17121. // "parameterOrder": [
  17122. // "project",
  17123. // "image"
  17124. // ],
  17125. // "parameters": {
  17126. // "image": {
  17127. // "description": "Name of the image resource to delete.",
  17128. // "location": "path",
  17129. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  17130. // "required": true,
  17131. // "type": "string"
  17132. // },
  17133. // "project": {
  17134. // "description": "Project ID for this request.",
  17135. // "location": "path",
  17136. // "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])?))",
  17137. // "required": true,
  17138. // "type": "string"
  17139. // }
  17140. // },
  17141. // "path": "{project}/global/images/{image}",
  17142. // "response": {
  17143. // "$ref": "Operation"
  17144. // },
  17145. // "scopes": [
  17146. // "https://www.googleapis.com/auth/cloud-platform",
  17147. // "https://www.googleapis.com/auth/compute"
  17148. // ]
  17149. // }
  17150. }
  17151. // method id "compute.images.deprecate":
  17152. type ImagesDeprecateCall struct {
  17153. s *Service
  17154. project string
  17155. image string
  17156. deprecationstatus *DeprecationStatus
  17157. urlParams_ gensupport.URLParams
  17158. ctx_ context.Context
  17159. }
  17160. // Deprecate: Sets the deprecation status of an image.
  17161. //
  17162. // If an empty request body is given, clears the deprecation status
  17163. // instead.
  17164. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/deprecate
  17165. func (r *ImagesService) Deprecate(project string, image string, deprecationstatus *DeprecationStatus) *ImagesDeprecateCall {
  17166. c := &ImagesDeprecateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17167. c.project = project
  17168. c.image = image
  17169. c.deprecationstatus = deprecationstatus
  17170. return c
  17171. }
  17172. // Fields allows partial responses to be retrieved. See
  17173. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17174. // for more information.
  17175. func (c *ImagesDeprecateCall) Fields(s ...googleapi.Field) *ImagesDeprecateCall {
  17176. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17177. return c
  17178. }
  17179. // Context sets the context to be used in this call's Do method. Any
  17180. // pending HTTP request will be aborted if the provided context is
  17181. // canceled.
  17182. func (c *ImagesDeprecateCall) Context(ctx context.Context) *ImagesDeprecateCall {
  17183. c.ctx_ = ctx
  17184. return c
  17185. }
  17186. func (c *ImagesDeprecateCall) doRequest(alt string) (*http.Response, error) {
  17187. var body io.Reader = nil
  17188. body, err := googleapi.WithoutDataWrapper.JSONReader(c.deprecationstatus)
  17189. if err != nil {
  17190. return nil, err
  17191. }
  17192. ctype := "application/json"
  17193. c.urlParams_.Set("alt", alt)
  17194. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}/deprecate")
  17195. urls += "?" + c.urlParams_.Encode()
  17196. req, _ := http.NewRequest("POST", urls, body)
  17197. googleapi.Expand(req.URL, map[string]string{
  17198. "project": c.project,
  17199. "image": c.image,
  17200. })
  17201. req.Header.Set("Content-Type", ctype)
  17202. req.Header.Set("User-Agent", c.s.userAgent())
  17203. if c.ctx_ != nil {
  17204. return ctxhttp.Do(c.ctx_, c.s.client, req)
  17205. }
  17206. return c.s.client.Do(req)
  17207. }
  17208. // Do executes the "compute.images.deprecate" call.
  17209. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  17210. // status code is an error. Response headers are in either
  17211. // *Operation.ServerResponse.Header or (if a response was returned at
  17212. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  17213. // to check whether the returned error was because
  17214. // http.StatusNotModified was returned.
  17215. func (c *ImagesDeprecateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  17216. gensupport.SetOptions(c.urlParams_, opts...)
  17217. res, err := c.doRequest("json")
  17218. if res != nil && res.StatusCode == http.StatusNotModified {
  17219. if res.Body != nil {
  17220. res.Body.Close()
  17221. }
  17222. return nil, &googleapi.Error{
  17223. Code: res.StatusCode,
  17224. Header: res.Header,
  17225. }
  17226. }
  17227. if err != nil {
  17228. return nil, err
  17229. }
  17230. defer googleapi.CloseBody(res)
  17231. if err := googleapi.CheckResponse(res); err != nil {
  17232. return nil, err
  17233. }
  17234. ret := &Operation{
  17235. ServerResponse: googleapi.ServerResponse{
  17236. Header: res.Header,
  17237. HTTPStatusCode: res.StatusCode,
  17238. },
  17239. }
  17240. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  17241. return nil, err
  17242. }
  17243. return ret, nil
  17244. // {
  17245. // "description": "Sets the deprecation status of an image.\n\nIf an empty request body is given, clears the deprecation status instead.",
  17246. // "httpMethod": "POST",
  17247. // "id": "compute.images.deprecate",
  17248. // "parameterOrder": [
  17249. // "project",
  17250. // "image"
  17251. // ],
  17252. // "parameters": {
  17253. // "image": {
  17254. // "description": "Image name.",
  17255. // "location": "path",
  17256. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  17257. // "required": true,
  17258. // "type": "string"
  17259. // },
  17260. // "project": {
  17261. // "description": "Project ID for this request.",
  17262. // "location": "path",
  17263. // "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])?))",
  17264. // "required": true,
  17265. // "type": "string"
  17266. // }
  17267. // },
  17268. // "path": "{project}/global/images/{image}/deprecate",
  17269. // "request": {
  17270. // "$ref": "DeprecationStatus"
  17271. // },
  17272. // "response": {
  17273. // "$ref": "Operation"
  17274. // },
  17275. // "scopes": [
  17276. // "https://www.googleapis.com/auth/cloud-platform",
  17277. // "https://www.googleapis.com/auth/compute"
  17278. // ]
  17279. // }
  17280. }
  17281. // method id "compute.images.get":
  17282. type ImagesGetCall struct {
  17283. s *Service
  17284. project string
  17285. image string
  17286. urlParams_ gensupport.URLParams
  17287. ifNoneMatch_ string
  17288. ctx_ context.Context
  17289. }
  17290. // Get: Returns the specified image resource.
  17291. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/get
  17292. func (r *ImagesService) Get(project string, image string) *ImagesGetCall {
  17293. c := &ImagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17294. c.project = project
  17295. c.image = image
  17296. return c
  17297. }
  17298. // Fields allows partial responses to be retrieved. See
  17299. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17300. // for more information.
  17301. func (c *ImagesGetCall) Fields(s ...googleapi.Field) *ImagesGetCall {
  17302. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17303. return c
  17304. }
  17305. // IfNoneMatch sets the optional parameter which makes the operation
  17306. // fail if the object's ETag matches the given value. This is useful for
  17307. // getting updates only after the object has changed since the last
  17308. // request. Use googleapi.IsNotModified to check whether the response
  17309. // error from Do is the result of In-None-Match.
  17310. func (c *ImagesGetCall) IfNoneMatch(entityTag string) *ImagesGetCall {
  17311. c.ifNoneMatch_ = entityTag
  17312. return c
  17313. }
  17314. // Context sets the context to be used in this call's Do method. Any
  17315. // pending HTTP request will be aborted if the provided context is
  17316. // canceled.
  17317. func (c *ImagesGetCall) Context(ctx context.Context) *ImagesGetCall {
  17318. c.ctx_ = ctx
  17319. return c
  17320. }
  17321. func (c *ImagesGetCall) doRequest(alt string) (*http.Response, error) {
  17322. var body io.Reader = nil
  17323. c.urlParams_.Set("alt", alt)
  17324. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}")
  17325. urls += "?" + c.urlParams_.Encode()
  17326. req, _ := http.NewRequest("GET", urls, body)
  17327. googleapi.Expand(req.URL, map[string]string{
  17328. "project": c.project,
  17329. "image": c.image,
  17330. })
  17331. req.Header.Set("User-Agent", c.s.userAgent())
  17332. if c.ifNoneMatch_ != "" {
  17333. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  17334. }
  17335. if c.ctx_ != nil {
  17336. return ctxhttp.Do(c.ctx_, c.s.client, req)
  17337. }
  17338. return c.s.client.Do(req)
  17339. }
  17340. // Do executes the "compute.images.get" call.
  17341. // Exactly one of *Image or error will be non-nil. Any non-2xx status
  17342. // code is an error. Response headers are in either
  17343. // *Image.ServerResponse.Header or (if a response was returned at all)
  17344. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  17345. // check whether the returned error was because http.StatusNotModified
  17346. // was returned.
  17347. func (c *ImagesGetCall) Do(opts ...googleapi.CallOption) (*Image, error) {
  17348. gensupport.SetOptions(c.urlParams_, opts...)
  17349. res, err := c.doRequest("json")
  17350. if res != nil && res.StatusCode == http.StatusNotModified {
  17351. if res.Body != nil {
  17352. res.Body.Close()
  17353. }
  17354. return nil, &googleapi.Error{
  17355. Code: res.StatusCode,
  17356. Header: res.Header,
  17357. }
  17358. }
  17359. if err != nil {
  17360. return nil, err
  17361. }
  17362. defer googleapi.CloseBody(res)
  17363. if err := googleapi.CheckResponse(res); err != nil {
  17364. return nil, err
  17365. }
  17366. ret := &Image{
  17367. ServerResponse: googleapi.ServerResponse{
  17368. Header: res.Header,
  17369. HTTPStatusCode: res.StatusCode,
  17370. },
  17371. }
  17372. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  17373. return nil, err
  17374. }
  17375. return ret, nil
  17376. // {
  17377. // "description": "Returns the specified image resource.",
  17378. // "httpMethod": "GET",
  17379. // "id": "compute.images.get",
  17380. // "parameterOrder": [
  17381. // "project",
  17382. // "image"
  17383. // ],
  17384. // "parameters": {
  17385. // "image": {
  17386. // "description": "Name of the image resource to return.",
  17387. // "location": "path",
  17388. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  17389. // "required": true,
  17390. // "type": "string"
  17391. // },
  17392. // "project": {
  17393. // "description": "Project ID for this request.",
  17394. // "location": "path",
  17395. // "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])?))",
  17396. // "required": true,
  17397. // "type": "string"
  17398. // }
  17399. // },
  17400. // "path": "{project}/global/images/{image}",
  17401. // "response": {
  17402. // "$ref": "Image"
  17403. // },
  17404. // "scopes": [
  17405. // "https://www.googleapis.com/auth/cloud-platform",
  17406. // "https://www.googleapis.com/auth/compute",
  17407. // "https://www.googleapis.com/auth/compute.readonly"
  17408. // ]
  17409. // }
  17410. }
  17411. // method id "compute.images.insert":
  17412. type ImagesInsertCall struct {
  17413. s *Service
  17414. project string
  17415. image *Image
  17416. urlParams_ gensupport.URLParams
  17417. ctx_ context.Context
  17418. }
  17419. // Insert: Creates an image resource in the specified project using the
  17420. // data included in the request.
  17421. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/insert
  17422. func (r *ImagesService) Insert(project string, image *Image) *ImagesInsertCall {
  17423. c := &ImagesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17424. c.project = project
  17425. c.image = image
  17426. return c
  17427. }
  17428. // Fields allows partial responses to be retrieved. See
  17429. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17430. // for more information.
  17431. func (c *ImagesInsertCall) Fields(s ...googleapi.Field) *ImagesInsertCall {
  17432. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17433. return c
  17434. }
  17435. // Context sets the context to be used in this call's Do method. Any
  17436. // pending HTTP request will be aborted if the provided context is
  17437. // canceled.
  17438. func (c *ImagesInsertCall) Context(ctx context.Context) *ImagesInsertCall {
  17439. c.ctx_ = ctx
  17440. return c
  17441. }
  17442. func (c *ImagesInsertCall) doRequest(alt string) (*http.Response, error) {
  17443. var body io.Reader = nil
  17444. body, err := googleapi.WithoutDataWrapper.JSONReader(c.image)
  17445. if err != nil {
  17446. return nil, err
  17447. }
  17448. ctype := "application/json"
  17449. c.urlParams_.Set("alt", alt)
  17450. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images")
  17451. urls += "?" + c.urlParams_.Encode()
  17452. req, _ := http.NewRequest("POST", urls, body)
  17453. googleapi.Expand(req.URL, map[string]string{
  17454. "project": c.project,
  17455. })
  17456. req.Header.Set("Content-Type", ctype)
  17457. req.Header.Set("User-Agent", c.s.userAgent())
  17458. if c.ctx_ != nil {
  17459. return ctxhttp.Do(c.ctx_, c.s.client, req)
  17460. }
  17461. return c.s.client.Do(req)
  17462. }
  17463. // Do executes the "compute.images.insert" call.
  17464. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  17465. // status code is an error. Response headers are in either
  17466. // *Operation.ServerResponse.Header or (if a response was returned at
  17467. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  17468. // to check whether the returned error was because
  17469. // http.StatusNotModified was returned.
  17470. func (c *ImagesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  17471. gensupport.SetOptions(c.urlParams_, opts...)
  17472. res, err := c.doRequest("json")
  17473. if res != nil && res.StatusCode == http.StatusNotModified {
  17474. if res.Body != nil {
  17475. res.Body.Close()
  17476. }
  17477. return nil, &googleapi.Error{
  17478. Code: res.StatusCode,
  17479. Header: res.Header,
  17480. }
  17481. }
  17482. if err != nil {
  17483. return nil, err
  17484. }
  17485. defer googleapi.CloseBody(res)
  17486. if err := googleapi.CheckResponse(res); err != nil {
  17487. return nil, err
  17488. }
  17489. ret := &Operation{
  17490. ServerResponse: googleapi.ServerResponse{
  17491. Header: res.Header,
  17492. HTTPStatusCode: res.StatusCode,
  17493. },
  17494. }
  17495. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  17496. return nil, err
  17497. }
  17498. return ret, nil
  17499. // {
  17500. // "description": "Creates an image resource in the specified project using the data included in the request.",
  17501. // "httpMethod": "POST",
  17502. // "id": "compute.images.insert",
  17503. // "parameterOrder": [
  17504. // "project"
  17505. // ],
  17506. // "parameters": {
  17507. // "project": {
  17508. // "description": "Project ID for this request.",
  17509. // "location": "path",
  17510. // "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])?))",
  17511. // "required": true,
  17512. // "type": "string"
  17513. // }
  17514. // },
  17515. // "path": "{project}/global/images",
  17516. // "request": {
  17517. // "$ref": "Image"
  17518. // },
  17519. // "response": {
  17520. // "$ref": "Operation"
  17521. // },
  17522. // "scopes": [
  17523. // "https://www.googleapis.com/auth/cloud-platform",
  17524. // "https://www.googleapis.com/auth/compute",
  17525. // "https://www.googleapis.com/auth/devstorage.full_control",
  17526. // "https://www.googleapis.com/auth/devstorage.read_only",
  17527. // "https://www.googleapis.com/auth/devstorage.read_write"
  17528. // ]
  17529. // }
  17530. }
  17531. // method id "compute.images.list":
  17532. type ImagesListCall struct {
  17533. s *Service
  17534. project string
  17535. urlParams_ gensupport.URLParams
  17536. ifNoneMatch_ string
  17537. ctx_ context.Context
  17538. }
  17539. // List: Retrieves the list of private images available to the specified
  17540. // project. Private images are images you create that belong to your
  17541. // project. This method does not get any images that belong to other
  17542. // projects, including publicly-available images, like Debian 7. If you
  17543. // want to get a list of publicly-available images, use this method to
  17544. // make a request to the respective image project, such as debian-cloud
  17545. // or windows-cloud.
  17546. //
  17547. // See Accessing images for more information.
  17548. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/list
  17549. func (r *ImagesService) List(project string) *ImagesListCall {
  17550. c := &ImagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17551. c.project = project
  17552. return c
  17553. }
  17554. // Filter sets the optional parameter "filter": Sets a filter expression
  17555. // for filtering listed resources, in the form filter={expression}. Your
  17556. // {expression} must be in the format: field_name comparison_string
  17557. // literal_string.
  17558. //
  17559. // The field_name is the name of the field you want to compare. Only
  17560. // atomic field types are supported (string, number, boolean). The
  17561. // comparison_string must be either eq (equals) or ne (not equals). The
  17562. // literal_string is the string value to filter to. The literal value
  17563. // must be valid for the type of field you are filtering by (string,
  17564. // number, boolean). For string fields, the literal value is interpreted
  17565. // as a regular expression using RE2 syntax. The literal value must
  17566. // match the entire field.
  17567. //
  17568. // For example, filter=name ne example-instance.
  17569. //
  17570. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  17571. // you can also filter on nested fields. For example, you could filter
  17572. // on instances that have set the scheduling.automaticRestart field to
  17573. // true. In particular, use filtering on nested fields to take advantage
  17574. // of instance labels to organize and filter results based on label
  17575. // values.
  17576. //
  17577. // The Beta API also supports filtering on multiple expressions by
  17578. // providing each separate expression within parentheses. For example,
  17579. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  17580. // Multiple expressions are treated as AND expressions meaning that
  17581. // resources must match all expressions to pass the filters.
  17582. func (c *ImagesListCall) Filter(filter string) *ImagesListCall {
  17583. c.urlParams_.Set("filter", filter)
  17584. return c
  17585. }
  17586. // MaxResults sets the optional parameter "maxResults": The maximum
  17587. // number of results per page that Compute Engine should return. If the
  17588. // number of available results is larger than maxResults, Compute Engine
  17589. // returns a nextPageToken that can be used to get the next page of
  17590. // results in subsequent list requests.
  17591. func (c *ImagesListCall) MaxResults(maxResults int64) *ImagesListCall {
  17592. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  17593. return c
  17594. }
  17595. // PageToken sets the optional parameter "pageToken": Specifies a page
  17596. // token to use. Set pageToken to the nextPageToken returned by a
  17597. // previous list request to get the next page of results.
  17598. func (c *ImagesListCall) PageToken(pageToken string) *ImagesListCall {
  17599. c.urlParams_.Set("pageToken", pageToken)
  17600. return c
  17601. }
  17602. // Fields allows partial responses to be retrieved. See
  17603. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17604. // for more information.
  17605. func (c *ImagesListCall) Fields(s ...googleapi.Field) *ImagesListCall {
  17606. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17607. return c
  17608. }
  17609. // IfNoneMatch sets the optional parameter which makes the operation
  17610. // fail if the object's ETag matches the given value. This is useful for
  17611. // getting updates only after the object has changed since the last
  17612. // request. Use googleapi.IsNotModified to check whether the response
  17613. // error from Do is the result of In-None-Match.
  17614. func (c *ImagesListCall) IfNoneMatch(entityTag string) *ImagesListCall {
  17615. c.ifNoneMatch_ = entityTag
  17616. return c
  17617. }
  17618. // Context sets the context to be used in this call's Do method. Any
  17619. // pending HTTP request will be aborted if the provided context is
  17620. // canceled.
  17621. func (c *ImagesListCall) Context(ctx context.Context) *ImagesListCall {
  17622. c.ctx_ = ctx
  17623. return c
  17624. }
  17625. func (c *ImagesListCall) doRequest(alt string) (*http.Response, error) {
  17626. var body io.Reader = nil
  17627. c.urlParams_.Set("alt", alt)
  17628. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images")
  17629. urls += "?" + c.urlParams_.Encode()
  17630. req, _ := http.NewRequest("GET", urls, body)
  17631. googleapi.Expand(req.URL, map[string]string{
  17632. "project": c.project,
  17633. })
  17634. req.Header.Set("User-Agent", c.s.userAgent())
  17635. if c.ifNoneMatch_ != "" {
  17636. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  17637. }
  17638. if c.ctx_ != nil {
  17639. return ctxhttp.Do(c.ctx_, c.s.client, req)
  17640. }
  17641. return c.s.client.Do(req)
  17642. }
  17643. // Do executes the "compute.images.list" call.
  17644. // Exactly one of *ImageList or error will be non-nil. Any non-2xx
  17645. // status code is an error. Response headers are in either
  17646. // *ImageList.ServerResponse.Header or (if a response was returned at
  17647. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  17648. // to check whether the returned error was because
  17649. // http.StatusNotModified was returned.
  17650. func (c *ImagesListCall) Do(opts ...googleapi.CallOption) (*ImageList, error) {
  17651. gensupport.SetOptions(c.urlParams_, opts...)
  17652. res, err := c.doRequest("json")
  17653. if res != nil && res.StatusCode == http.StatusNotModified {
  17654. if res.Body != nil {
  17655. res.Body.Close()
  17656. }
  17657. return nil, &googleapi.Error{
  17658. Code: res.StatusCode,
  17659. Header: res.Header,
  17660. }
  17661. }
  17662. if err != nil {
  17663. return nil, err
  17664. }
  17665. defer googleapi.CloseBody(res)
  17666. if err := googleapi.CheckResponse(res); err != nil {
  17667. return nil, err
  17668. }
  17669. ret := &ImageList{
  17670. ServerResponse: googleapi.ServerResponse{
  17671. Header: res.Header,
  17672. HTTPStatusCode: res.StatusCode,
  17673. },
  17674. }
  17675. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  17676. return nil, err
  17677. }
  17678. return ret, nil
  17679. // {
  17680. // "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.",
  17681. // "httpMethod": "GET",
  17682. // "id": "compute.images.list",
  17683. // "parameterOrder": [
  17684. // "project"
  17685. // ],
  17686. // "parameters": {
  17687. // "filter": {
  17688. // "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.",
  17689. // "location": "query",
  17690. // "type": "string"
  17691. // },
  17692. // "maxResults": {
  17693. // "default": "500",
  17694. // "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.",
  17695. // "format": "uint32",
  17696. // "location": "query",
  17697. // "maximum": "500",
  17698. // "minimum": "0",
  17699. // "type": "integer"
  17700. // },
  17701. // "pageToken": {
  17702. // "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.",
  17703. // "location": "query",
  17704. // "type": "string"
  17705. // },
  17706. // "project": {
  17707. // "description": "Project ID for this request.",
  17708. // "location": "path",
  17709. // "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])?))",
  17710. // "required": true,
  17711. // "type": "string"
  17712. // }
  17713. // },
  17714. // "path": "{project}/global/images",
  17715. // "response": {
  17716. // "$ref": "ImageList"
  17717. // },
  17718. // "scopes": [
  17719. // "https://www.googleapis.com/auth/cloud-platform",
  17720. // "https://www.googleapis.com/auth/compute",
  17721. // "https://www.googleapis.com/auth/compute.readonly"
  17722. // ]
  17723. // }
  17724. }
  17725. // Pages invokes f for each page of results.
  17726. // A non-nil error returned from f will halt the iteration.
  17727. // The provided context supersedes any context provided to the Context method.
  17728. func (c *ImagesListCall) Pages(ctx context.Context, f func(*ImageList) error) error {
  17729. c.ctx_ = ctx
  17730. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  17731. for {
  17732. x, err := c.Do()
  17733. if err != nil {
  17734. return err
  17735. }
  17736. if err := f(x); err != nil {
  17737. return err
  17738. }
  17739. if x.NextPageToken == "" {
  17740. return nil
  17741. }
  17742. c.PageToken(x.NextPageToken)
  17743. }
  17744. }
  17745. // method id "compute.instanceGroupManagers.abandonInstances":
  17746. type InstanceGroupManagersAbandonInstancesCall struct {
  17747. s *Service
  17748. project string
  17749. zone string
  17750. instanceGroupManager string
  17751. instancegroupmanagersabandoninstancesrequest *InstanceGroupManagersAbandonInstancesRequest
  17752. urlParams_ gensupport.URLParams
  17753. ctx_ context.Context
  17754. }
  17755. // AbandonInstances: Schedules a group action to remove the specified
  17756. // instances from the managed instance group. Abandoning an instance
  17757. // does not delete the instance, but it does remove the instance from
  17758. // any target pools that are applied by the managed instance group. This
  17759. // method reduces the targetSize of the managed instance group by the
  17760. // number of instances that you abandon. This operation is marked as
  17761. // DONE when the action is scheduled even if the instances have not yet
  17762. // been removed from the group. You must separately verify the status of
  17763. // the abandoning action with the listmanagedinstances method.
  17764. func (r *InstanceGroupManagersService) AbandonInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersabandoninstancesrequest *InstanceGroupManagersAbandonInstancesRequest) *InstanceGroupManagersAbandonInstancesCall {
  17765. c := &InstanceGroupManagersAbandonInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17766. c.project = project
  17767. c.zone = zone
  17768. c.instanceGroupManager = instanceGroupManager
  17769. c.instancegroupmanagersabandoninstancesrequest = instancegroupmanagersabandoninstancesrequest
  17770. return c
  17771. }
  17772. // Fields allows partial responses to be retrieved. See
  17773. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17774. // for more information.
  17775. func (c *InstanceGroupManagersAbandonInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersAbandonInstancesCall {
  17776. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17777. return c
  17778. }
  17779. // Context sets the context to be used in this call's Do method. Any
  17780. // pending HTTP request will be aborted if the provided context is
  17781. // canceled.
  17782. func (c *InstanceGroupManagersAbandonInstancesCall) Context(ctx context.Context) *InstanceGroupManagersAbandonInstancesCall {
  17783. c.ctx_ = ctx
  17784. return c
  17785. }
  17786. func (c *InstanceGroupManagersAbandonInstancesCall) doRequest(alt string) (*http.Response, error) {
  17787. var body io.Reader = nil
  17788. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersabandoninstancesrequest)
  17789. if err != nil {
  17790. return nil, err
  17791. }
  17792. ctype := "application/json"
  17793. c.urlParams_.Set("alt", alt)
  17794. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances")
  17795. urls += "?" + c.urlParams_.Encode()
  17796. req, _ := http.NewRequest("POST", urls, body)
  17797. googleapi.Expand(req.URL, map[string]string{
  17798. "project": c.project,
  17799. "zone": c.zone,
  17800. "instanceGroupManager": c.instanceGroupManager,
  17801. })
  17802. req.Header.Set("Content-Type", ctype)
  17803. req.Header.Set("User-Agent", c.s.userAgent())
  17804. if c.ctx_ != nil {
  17805. return ctxhttp.Do(c.ctx_, c.s.client, req)
  17806. }
  17807. return c.s.client.Do(req)
  17808. }
  17809. // Do executes the "compute.instanceGroupManagers.abandonInstances" call.
  17810. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  17811. // status code is an error. Response headers are in either
  17812. // *Operation.ServerResponse.Header or (if a response was returned at
  17813. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  17814. // to check whether the returned error was because
  17815. // http.StatusNotModified was returned.
  17816. func (c *InstanceGroupManagersAbandonInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  17817. gensupport.SetOptions(c.urlParams_, opts...)
  17818. res, err := c.doRequest("json")
  17819. if res != nil && res.StatusCode == http.StatusNotModified {
  17820. if res.Body != nil {
  17821. res.Body.Close()
  17822. }
  17823. return nil, &googleapi.Error{
  17824. Code: res.StatusCode,
  17825. Header: res.Header,
  17826. }
  17827. }
  17828. if err != nil {
  17829. return nil, err
  17830. }
  17831. defer googleapi.CloseBody(res)
  17832. if err := googleapi.CheckResponse(res); err != nil {
  17833. return nil, err
  17834. }
  17835. ret := &Operation{
  17836. ServerResponse: googleapi.ServerResponse{
  17837. Header: res.Header,
  17838. HTTPStatusCode: res.StatusCode,
  17839. },
  17840. }
  17841. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  17842. return nil, err
  17843. }
  17844. return ret, nil
  17845. // {
  17846. // "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.",
  17847. // "httpMethod": "POST",
  17848. // "id": "compute.instanceGroupManagers.abandonInstances",
  17849. // "parameterOrder": [
  17850. // "project",
  17851. // "zone",
  17852. // "instanceGroupManager"
  17853. // ],
  17854. // "parameters": {
  17855. // "instanceGroupManager": {
  17856. // "description": "The name of the managed instance group.",
  17857. // "location": "path",
  17858. // "required": true,
  17859. // "type": "string"
  17860. // },
  17861. // "project": {
  17862. // "description": "Project ID for this request.",
  17863. // "location": "path",
  17864. // "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])?))",
  17865. // "required": true,
  17866. // "type": "string"
  17867. // },
  17868. // "zone": {
  17869. // "description": "The name of the zone where the managed instance group is located.",
  17870. // "location": "path",
  17871. // "required": true,
  17872. // "type": "string"
  17873. // }
  17874. // },
  17875. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances",
  17876. // "request": {
  17877. // "$ref": "InstanceGroupManagersAbandonInstancesRequest"
  17878. // },
  17879. // "response": {
  17880. // "$ref": "Operation"
  17881. // },
  17882. // "scopes": [
  17883. // "https://www.googleapis.com/auth/cloud-platform",
  17884. // "https://www.googleapis.com/auth/compute"
  17885. // ]
  17886. // }
  17887. }
  17888. // method id "compute.instanceGroupManagers.aggregatedList":
  17889. type InstanceGroupManagersAggregatedListCall struct {
  17890. s *Service
  17891. project string
  17892. urlParams_ gensupport.URLParams
  17893. ifNoneMatch_ string
  17894. ctx_ context.Context
  17895. }
  17896. // AggregatedList: Retrieves the list of managed instance groups and
  17897. // groups them by zone.
  17898. func (r *InstanceGroupManagersService) AggregatedList(project string) *InstanceGroupManagersAggregatedListCall {
  17899. c := &InstanceGroupManagersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17900. c.project = project
  17901. return c
  17902. }
  17903. // Filter sets the optional parameter "filter": Sets a filter expression
  17904. // for filtering listed resources, in the form filter={expression}. Your
  17905. // {expression} must be in the format: field_name comparison_string
  17906. // literal_string.
  17907. //
  17908. // The field_name is the name of the field you want to compare. Only
  17909. // atomic field types are supported (string, number, boolean). The
  17910. // comparison_string must be either eq (equals) or ne (not equals). The
  17911. // literal_string is the string value to filter to. The literal value
  17912. // must be valid for the type of field you are filtering by (string,
  17913. // number, boolean). For string fields, the literal value is interpreted
  17914. // as a regular expression using RE2 syntax. The literal value must
  17915. // match the entire field.
  17916. //
  17917. // For example, filter=name ne example-instance.
  17918. //
  17919. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  17920. // you can also filter on nested fields. For example, you could filter
  17921. // on instances that have set the scheduling.automaticRestart field to
  17922. // true. In particular, use filtering on nested fields to take advantage
  17923. // of instance labels to organize and filter results based on label
  17924. // values.
  17925. //
  17926. // The Beta API also supports filtering on multiple expressions by
  17927. // providing each separate expression within parentheses. For example,
  17928. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  17929. // Multiple expressions are treated as AND expressions meaning that
  17930. // resources must match all expressions to pass the filters.
  17931. func (c *InstanceGroupManagersAggregatedListCall) Filter(filter string) *InstanceGroupManagersAggregatedListCall {
  17932. c.urlParams_.Set("filter", filter)
  17933. return c
  17934. }
  17935. // MaxResults sets the optional parameter "maxResults": The maximum
  17936. // number of results per page that Compute Engine should return. If the
  17937. // number of available results is larger than maxResults, Compute Engine
  17938. // returns a nextPageToken that can be used to get the next page of
  17939. // results in subsequent list requests.
  17940. func (c *InstanceGroupManagersAggregatedListCall) MaxResults(maxResults int64) *InstanceGroupManagersAggregatedListCall {
  17941. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  17942. return c
  17943. }
  17944. // PageToken sets the optional parameter "pageToken": Specifies a page
  17945. // token to use. Set pageToken to the nextPageToken returned by a
  17946. // previous list request to get the next page of results.
  17947. func (c *InstanceGroupManagersAggregatedListCall) PageToken(pageToken string) *InstanceGroupManagersAggregatedListCall {
  17948. c.urlParams_.Set("pageToken", pageToken)
  17949. return c
  17950. }
  17951. // Fields allows partial responses to be retrieved. See
  17952. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17953. // for more information.
  17954. func (c *InstanceGroupManagersAggregatedListCall) Fields(s ...googleapi.Field) *InstanceGroupManagersAggregatedListCall {
  17955. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17956. return c
  17957. }
  17958. // IfNoneMatch sets the optional parameter which makes the operation
  17959. // fail if the object's ETag matches the given value. This is useful for
  17960. // getting updates only after the object has changed since the last
  17961. // request. Use googleapi.IsNotModified to check whether the response
  17962. // error from Do is the result of In-None-Match.
  17963. func (c *InstanceGroupManagersAggregatedListCall) IfNoneMatch(entityTag string) *InstanceGroupManagersAggregatedListCall {
  17964. c.ifNoneMatch_ = entityTag
  17965. return c
  17966. }
  17967. // Context sets the context to be used in this call's Do method. Any
  17968. // pending HTTP request will be aborted if the provided context is
  17969. // canceled.
  17970. func (c *InstanceGroupManagersAggregatedListCall) Context(ctx context.Context) *InstanceGroupManagersAggregatedListCall {
  17971. c.ctx_ = ctx
  17972. return c
  17973. }
  17974. func (c *InstanceGroupManagersAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  17975. var body io.Reader = nil
  17976. c.urlParams_.Set("alt", alt)
  17977. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instanceGroupManagers")
  17978. urls += "?" + c.urlParams_.Encode()
  17979. req, _ := http.NewRequest("GET", urls, body)
  17980. googleapi.Expand(req.URL, map[string]string{
  17981. "project": c.project,
  17982. })
  17983. req.Header.Set("User-Agent", c.s.userAgent())
  17984. if c.ifNoneMatch_ != "" {
  17985. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  17986. }
  17987. if c.ctx_ != nil {
  17988. return ctxhttp.Do(c.ctx_, c.s.client, req)
  17989. }
  17990. return c.s.client.Do(req)
  17991. }
  17992. // Do executes the "compute.instanceGroupManagers.aggregatedList" call.
  17993. // Exactly one of *InstanceGroupManagerAggregatedList or error will be
  17994. // non-nil. Any non-2xx status code is an error. Response headers are in
  17995. // either *InstanceGroupManagerAggregatedList.ServerResponse.Header or
  17996. // (if a response was returned at all) in
  17997. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  17998. // whether the returned error was because http.StatusNotModified was
  17999. // returned.
  18000. func (c *InstanceGroupManagersAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagerAggregatedList, error) {
  18001. gensupport.SetOptions(c.urlParams_, opts...)
  18002. res, err := c.doRequest("json")
  18003. if res != nil && res.StatusCode == http.StatusNotModified {
  18004. if res.Body != nil {
  18005. res.Body.Close()
  18006. }
  18007. return nil, &googleapi.Error{
  18008. Code: res.StatusCode,
  18009. Header: res.Header,
  18010. }
  18011. }
  18012. if err != nil {
  18013. return nil, err
  18014. }
  18015. defer googleapi.CloseBody(res)
  18016. if err := googleapi.CheckResponse(res); err != nil {
  18017. return nil, err
  18018. }
  18019. ret := &InstanceGroupManagerAggregatedList{
  18020. ServerResponse: googleapi.ServerResponse{
  18021. Header: res.Header,
  18022. HTTPStatusCode: res.StatusCode,
  18023. },
  18024. }
  18025. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  18026. return nil, err
  18027. }
  18028. return ret, nil
  18029. // {
  18030. // "description": "Retrieves the list of managed instance groups and groups them by zone.",
  18031. // "httpMethod": "GET",
  18032. // "id": "compute.instanceGroupManagers.aggregatedList",
  18033. // "parameterOrder": [
  18034. // "project"
  18035. // ],
  18036. // "parameters": {
  18037. // "filter": {
  18038. // "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.",
  18039. // "location": "query",
  18040. // "type": "string"
  18041. // },
  18042. // "maxResults": {
  18043. // "default": "500",
  18044. // "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.",
  18045. // "format": "uint32",
  18046. // "location": "query",
  18047. // "maximum": "500",
  18048. // "minimum": "0",
  18049. // "type": "integer"
  18050. // },
  18051. // "pageToken": {
  18052. // "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.",
  18053. // "location": "query",
  18054. // "type": "string"
  18055. // },
  18056. // "project": {
  18057. // "description": "Project ID for this request.",
  18058. // "location": "path",
  18059. // "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])?))",
  18060. // "required": true,
  18061. // "type": "string"
  18062. // }
  18063. // },
  18064. // "path": "{project}/aggregated/instanceGroupManagers",
  18065. // "response": {
  18066. // "$ref": "InstanceGroupManagerAggregatedList"
  18067. // },
  18068. // "scopes": [
  18069. // "https://www.googleapis.com/auth/cloud-platform",
  18070. // "https://www.googleapis.com/auth/compute",
  18071. // "https://www.googleapis.com/auth/compute.readonly"
  18072. // ]
  18073. // }
  18074. }
  18075. // Pages invokes f for each page of results.
  18076. // A non-nil error returned from f will halt the iteration.
  18077. // The provided context supersedes any context provided to the Context method.
  18078. func (c *InstanceGroupManagersAggregatedListCall) Pages(ctx context.Context, f func(*InstanceGroupManagerAggregatedList) error) error {
  18079. c.ctx_ = ctx
  18080. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  18081. for {
  18082. x, err := c.Do()
  18083. if err != nil {
  18084. return err
  18085. }
  18086. if err := f(x); err != nil {
  18087. return err
  18088. }
  18089. if x.NextPageToken == "" {
  18090. return nil
  18091. }
  18092. c.PageToken(x.NextPageToken)
  18093. }
  18094. }
  18095. // method id "compute.instanceGroupManagers.delete":
  18096. type InstanceGroupManagersDeleteCall struct {
  18097. s *Service
  18098. project string
  18099. zone string
  18100. instanceGroupManager string
  18101. urlParams_ gensupport.URLParams
  18102. ctx_ context.Context
  18103. }
  18104. // Delete: Deletes the specified managed instance group and all of the
  18105. // instances in that group. Note that the instance group must not belong
  18106. // to a backend service. Read Deleting an instance group for more
  18107. // information.
  18108. func (r *InstanceGroupManagersService) Delete(project string, zone string, instanceGroupManager string) *InstanceGroupManagersDeleteCall {
  18109. c := &InstanceGroupManagersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18110. c.project = project
  18111. c.zone = zone
  18112. c.instanceGroupManager = instanceGroupManager
  18113. return c
  18114. }
  18115. // Fields allows partial responses to be retrieved. See
  18116. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18117. // for more information.
  18118. func (c *InstanceGroupManagersDeleteCall) Fields(s ...googleapi.Field) *InstanceGroupManagersDeleteCall {
  18119. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18120. return c
  18121. }
  18122. // Context sets the context to be used in this call's Do method. Any
  18123. // pending HTTP request will be aborted if the provided context is
  18124. // canceled.
  18125. func (c *InstanceGroupManagersDeleteCall) Context(ctx context.Context) *InstanceGroupManagersDeleteCall {
  18126. c.ctx_ = ctx
  18127. return c
  18128. }
  18129. func (c *InstanceGroupManagersDeleteCall) doRequest(alt string) (*http.Response, error) {
  18130. var body io.Reader = nil
  18131. c.urlParams_.Set("alt", alt)
  18132. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
  18133. urls += "?" + c.urlParams_.Encode()
  18134. req, _ := http.NewRequest("DELETE", urls, body)
  18135. googleapi.Expand(req.URL, map[string]string{
  18136. "project": c.project,
  18137. "zone": c.zone,
  18138. "instanceGroupManager": c.instanceGroupManager,
  18139. })
  18140. req.Header.Set("User-Agent", c.s.userAgent())
  18141. if c.ctx_ != nil {
  18142. return ctxhttp.Do(c.ctx_, c.s.client, req)
  18143. }
  18144. return c.s.client.Do(req)
  18145. }
  18146. // Do executes the "compute.instanceGroupManagers.delete" call.
  18147. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  18148. // status code is an error. Response headers are in either
  18149. // *Operation.ServerResponse.Header or (if a response was returned at
  18150. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  18151. // to check whether the returned error was because
  18152. // http.StatusNotModified was returned.
  18153. func (c *InstanceGroupManagersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  18154. gensupport.SetOptions(c.urlParams_, opts...)
  18155. res, err := c.doRequest("json")
  18156. if res != nil && res.StatusCode == http.StatusNotModified {
  18157. if res.Body != nil {
  18158. res.Body.Close()
  18159. }
  18160. return nil, &googleapi.Error{
  18161. Code: res.StatusCode,
  18162. Header: res.Header,
  18163. }
  18164. }
  18165. if err != nil {
  18166. return nil, err
  18167. }
  18168. defer googleapi.CloseBody(res)
  18169. if err := googleapi.CheckResponse(res); err != nil {
  18170. return nil, err
  18171. }
  18172. ret := &Operation{
  18173. ServerResponse: googleapi.ServerResponse{
  18174. Header: res.Header,
  18175. HTTPStatusCode: res.StatusCode,
  18176. },
  18177. }
  18178. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  18179. return nil, err
  18180. }
  18181. return ret, nil
  18182. // {
  18183. // "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.",
  18184. // "httpMethod": "DELETE",
  18185. // "id": "compute.instanceGroupManagers.delete",
  18186. // "parameterOrder": [
  18187. // "project",
  18188. // "zone",
  18189. // "instanceGroupManager"
  18190. // ],
  18191. // "parameters": {
  18192. // "instanceGroupManager": {
  18193. // "description": "The name of the managed instance group to delete.",
  18194. // "location": "path",
  18195. // "required": true,
  18196. // "type": "string"
  18197. // },
  18198. // "project": {
  18199. // "description": "Project ID for this request.",
  18200. // "location": "path",
  18201. // "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])?))",
  18202. // "required": true,
  18203. // "type": "string"
  18204. // },
  18205. // "zone": {
  18206. // "description": "The name of the zone where the managed instance group is located.",
  18207. // "location": "path",
  18208. // "required": true,
  18209. // "type": "string"
  18210. // }
  18211. // },
  18212. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
  18213. // "response": {
  18214. // "$ref": "Operation"
  18215. // },
  18216. // "scopes": [
  18217. // "https://www.googleapis.com/auth/cloud-platform",
  18218. // "https://www.googleapis.com/auth/compute"
  18219. // ]
  18220. // }
  18221. }
  18222. // method id "compute.instanceGroupManagers.deleteInstances":
  18223. type InstanceGroupManagersDeleteInstancesCall struct {
  18224. s *Service
  18225. project string
  18226. zone string
  18227. instanceGroupManager string
  18228. instancegroupmanagersdeleteinstancesrequest *InstanceGroupManagersDeleteInstancesRequest
  18229. urlParams_ gensupport.URLParams
  18230. ctx_ context.Context
  18231. }
  18232. // DeleteInstances: Schedules a group action to delete the specified
  18233. // instances in the managed instance group. The instances are also
  18234. // removed from any target pools of which they were a member. This
  18235. // method reduces the targetSize of the managed instance group by the
  18236. // number of instances that you delete. This operation is marked as DONE
  18237. // when the action is scheduled even if the instances are still being
  18238. // deleted. You must separately verify the status of the deleting action
  18239. // with the listmanagedinstances method.
  18240. func (r *InstanceGroupManagersService) DeleteInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersdeleteinstancesrequest *InstanceGroupManagersDeleteInstancesRequest) *InstanceGroupManagersDeleteInstancesCall {
  18241. c := &InstanceGroupManagersDeleteInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18242. c.project = project
  18243. c.zone = zone
  18244. c.instanceGroupManager = instanceGroupManager
  18245. c.instancegroupmanagersdeleteinstancesrequest = instancegroupmanagersdeleteinstancesrequest
  18246. return c
  18247. }
  18248. // Fields allows partial responses to be retrieved. See
  18249. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18250. // for more information.
  18251. func (c *InstanceGroupManagersDeleteInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersDeleteInstancesCall {
  18252. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18253. return c
  18254. }
  18255. // Context sets the context to be used in this call's Do method. Any
  18256. // pending HTTP request will be aborted if the provided context is
  18257. // canceled.
  18258. func (c *InstanceGroupManagersDeleteInstancesCall) Context(ctx context.Context) *InstanceGroupManagersDeleteInstancesCall {
  18259. c.ctx_ = ctx
  18260. return c
  18261. }
  18262. func (c *InstanceGroupManagersDeleteInstancesCall) doRequest(alt string) (*http.Response, error) {
  18263. var body io.Reader = nil
  18264. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersdeleteinstancesrequest)
  18265. if err != nil {
  18266. return nil, err
  18267. }
  18268. ctype := "application/json"
  18269. c.urlParams_.Set("alt", alt)
  18270. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances")
  18271. urls += "?" + c.urlParams_.Encode()
  18272. req, _ := http.NewRequest("POST", urls, body)
  18273. googleapi.Expand(req.URL, map[string]string{
  18274. "project": c.project,
  18275. "zone": c.zone,
  18276. "instanceGroupManager": c.instanceGroupManager,
  18277. })
  18278. req.Header.Set("Content-Type", ctype)
  18279. req.Header.Set("User-Agent", c.s.userAgent())
  18280. if c.ctx_ != nil {
  18281. return ctxhttp.Do(c.ctx_, c.s.client, req)
  18282. }
  18283. return c.s.client.Do(req)
  18284. }
  18285. // Do executes the "compute.instanceGroupManagers.deleteInstances" call.
  18286. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  18287. // status code is an error. Response headers are in either
  18288. // *Operation.ServerResponse.Header or (if a response was returned at
  18289. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  18290. // to check whether the returned error was because
  18291. // http.StatusNotModified was returned.
  18292. func (c *InstanceGroupManagersDeleteInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  18293. gensupport.SetOptions(c.urlParams_, opts...)
  18294. res, err := c.doRequest("json")
  18295. if res != nil && res.StatusCode == http.StatusNotModified {
  18296. if res.Body != nil {
  18297. res.Body.Close()
  18298. }
  18299. return nil, &googleapi.Error{
  18300. Code: res.StatusCode,
  18301. Header: res.Header,
  18302. }
  18303. }
  18304. if err != nil {
  18305. return nil, err
  18306. }
  18307. defer googleapi.CloseBody(res)
  18308. if err := googleapi.CheckResponse(res); err != nil {
  18309. return nil, err
  18310. }
  18311. ret := &Operation{
  18312. ServerResponse: googleapi.ServerResponse{
  18313. Header: res.Header,
  18314. HTTPStatusCode: res.StatusCode,
  18315. },
  18316. }
  18317. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  18318. return nil, err
  18319. }
  18320. return ret, nil
  18321. // {
  18322. // "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.",
  18323. // "httpMethod": "POST",
  18324. // "id": "compute.instanceGroupManagers.deleteInstances",
  18325. // "parameterOrder": [
  18326. // "project",
  18327. // "zone",
  18328. // "instanceGroupManager"
  18329. // ],
  18330. // "parameters": {
  18331. // "instanceGroupManager": {
  18332. // "description": "The name of the managed instance group.",
  18333. // "location": "path",
  18334. // "required": true,
  18335. // "type": "string"
  18336. // },
  18337. // "project": {
  18338. // "description": "Project ID for this request.",
  18339. // "location": "path",
  18340. // "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])?))",
  18341. // "required": true,
  18342. // "type": "string"
  18343. // },
  18344. // "zone": {
  18345. // "description": "The name of the zone where the managed instance group is located.",
  18346. // "location": "path",
  18347. // "required": true,
  18348. // "type": "string"
  18349. // }
  18350. // },
  18351. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances",
  18352. // "request": {
  18353. // "$ref": "InstanceGroupManagersDeleteInstancesRequest"
  18354. // },
  18355. // "response": {
  18356. // "$ref": "Operation"
  18357. // },
  18358. // "scopes": [
  18359. // "https://www.googleapis.com/auth/cloud-platform",
  18360. // "https://www.googleapis.com/auth/compute"
  18361. // ]
  18362. // }
  18363. }
  18364. // method id "compute.instanceGroupManagers.get":
  18365. type InstanceGroupManagersGetCall struct {
  18366. s *Service
  18367. project string
  18368. zone string
  18369. instanceGroupManager string
  18370. urlParams_ gensupport.URLParams
  18371. ifNoneMatch_ string
  18372. ctx_ context.Context
  18373. }
  18374. // Get: Returns all of the details about the specified managed instance
  18375. // group.
  18376. func (r *InstanceGroupManagersService) Get(project string, zone string, instanceGroupManager string) *InstanceGroupManagersGetCall {
  18377. c := &InstanceGroupManagersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18378. c.project = project
  18379. c.zone = zone
  18380. c.instanceGroupManager = instanceGroupManager
  18381. return c
  18382. }
  18383. // Fields allows partial responses to be retrieved. See
  18384. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18385. // for more information.
  18386. func (c *InstanceGroupManagersGetCall) Fields(s ...googleapi.Field) *InstanceGroupManagersGetCall {
  18387. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18388. return c
  18389. }
  18390. // IfNoneMatch sets the optional parameter which makes the operation
  18391. // fail if the object's ETag matches the given value. This is useful for
  18392. // getting updates only after the object has changed since the last
  18393. // request. Use googleapi.IsNotModified to check whether the response
  18394. // error from Do is the result of In-None-Match.
  18395. func (c *InstanceGroupManagersGetCall) IfNoneMatch(entityTag string) *InstanceGroupManagersGetCall {
  18396. c.ifNoneMatch_ = entityTag
  18397. return c
  18398. }
  18399. // Context sets the context to be used in this call's Do method. Any
  18400. // pending HTTP request will be aborted if the provided context is
  18401. // canceled.
  18402. func (c *InstanceGroupManagersGetCall) Context(ctx context.Context) *InstanceGroupManagersGetCall {
  18403. c.ctx_ = ctx
  18404. return c
  18405. }
  18406. func (c *InstanceGroupManagersGetCall) doRequest(alt string) (*http.Response, error) {
  18407. var body io.Reader = nil
  18408. c.urlParams_.Set("alt", alt)
  18409. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
  18410. urls += "?" + c.urlParams_.Encode()
  18411. req, _ := http.NewRequest("GET", urls, body)
  18412. googleapi.Expand(req.URL, map[string]string{
  18413. "project": c.project,
  18414. "zone": c.zone,
  18415. "instanceGroupManager": c.instanceGroupManager,
  18416. })
  18417. req.Header.Set("User-Agent", c.s.userAgent())
  18418. if c.ifNoneMatch_ != "" {
  18419. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  18420. }
  18421. if c.ctx_ != nil {
  18422. return ctxhttp.Do(c.ctx_, c.s.client, req)
  18423. }
  18424. return c.s.client.Do(req)
  18425. }
  18426. // Do executes the "compute.instanceGroupManagers.get" call.
  18427. // Exactly one of *InstanceGroupManager or error will be non-nil. Any
  18428. // non-2xx status code is an error. Response headers are in either
  18429. // *InstanceGroupManager.ServerResponse.Header or (if a response was
  18430. // returned at all) in error.(*googleapi.Error).Header. Use
  18431. // googleapi.IsNotModified to check whether the returned error was
  18432. // because http.StatusNotModified was returned.
  18433. func (c *InstanceGroupManagersGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManager, error) {
  18434. gensupport.SetOptions(c.urlParams_, opts...)
  18435. res, err := c.doRequest("json")
  18436. if res != nil && res.StatusCode == http.StatusNotModified {
  18437. if res.Body != nil {
  18438. res.Body.Close()
  18439. }
  18440. return nil, &googleapi.Error{
  18441. Code: res.StatusCode,
  18442. Header: res.Header,
  18443. }
  18444. }
  18445. if err != nil {
  18446. return nil, err
  18447. }
  18448. defer googleapi.CloseBody(res)
  18449. if err := googleapi.CheckResponse(res); err != nil {
  18450. return nil, err
  18451. }
  18452. ret := &InstanceGroupManager{
  18453. ServerResponse: googleapi.ServerResponse{
  18454. Header: res.Header,
  18455. HTTPStatusCode: res.StatusCode,
  18456. },
  18457. }
  18458. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  18459. return nil, err
  18460. }
  18461. return ret, nil
  18462. // {
  18463. // "description": "Returns all of the details about the specified managed instance group.",
  18464. // "httpMethod": "GET",
  18465. // "id": "compute.instanceGroupManagers.get",
  18466. // "parameterOrder": [
  18467. // "project",
  18468. // "zone",
  18469. // "instanceGroupManager"
  18470. // ],
  18471. // "parameters": {
  18472. // "instanceGroupManager": {
  18473. // "description": "The name of the managed instance group.",
  18474. // "location": "path",
  18475. // "required": true,
  18476. // "type": "string"
  18477. // },
  18478. // "project": {
  18479. // "description": "Project ID for this request.",
  18480. // "location": "path",
  18481. // "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])?))",
  18482. // "required": true,
  18483. // "type": "string"
  18484. // },
  18485. // "zone": {
  18486. // "description": "The name of the zone where the managed instance group is located.",
  18487. // "location": "path",
  18488. // "required": true,
  18489. // "type": "string"
  18490. // }
  18491. // },
  18492. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
  18493. // "response": {
  18494. // "$ref": "InstanceGroupManager"
  18495. // },
  18496. // "scopes": [
  18497. // "https://www.googleapis.com/auth/cloud-platform",
  18498. // "https://www.googleapis.com/auth/compute",
  18499. // "https://www.googleapis.com/auth/compute.readonly"
  18500. // ]
  18501. // }
  18502. }
  18503. // method id "compute.instanceGroupManagers.insert":
  18504. type InstanceGroupManagersInsertCall struct {
  18505. s *Service
  18506. project string
  18507. zone string
  18508. instancegroupmanager *InstanceGroupManager
  18509. urlParams_ gensupport.URLParams
  18510. ctx_ context.Context
  18511. }
  18512. // Insert: Creates a managed instance group using the information that
  18513. // you specify in the request. After the group is created, it schedules
  18514. // an action to create instances in the group using the specified
  18515. // instance template. This operation is marked as DONE when the group is
  18516. // created even if the instances in the group have not yet been created.
  18517. // You must separately verify the status of the individual instances
  18518. // with the listmanagedinstances method.
  18519. func (r *InstanceGroupManagersService) Insert(project string, zone string, instancegroupmanager *InstanceGroupManager) *InstanceGroupManagersInsertCall {
  18520. c := &InstanceGroupManagersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18521. c.project = project
  18522. c.zone = zone
  18523. c.instancegroupmanager = instancegroupmanager
  18524. return c
  18525. }
  18526. // Fields allows partial responses to be retrieved. See
  18527. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18528. // for more information.
  18529. func (c *InstanceGroupManagersInsertCall) Fields(s ...googleapi.Field) *InstanceGroupManagersInsertCall {
  18530. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18531. return c
  18532. }
  18533. // Context sets the context to be used in this call's Do method. Any
  18534. // pending HTTP request will be aborted if the provided context is
  18535. // canceled.
  18536. func (c *InstanceGroupManagersInsertCall) Context(ctx context.Context) *InstanceGroupManagersInsertCall {
  18537. c.ctx_ = ctx
  18538. return c
  18539. }
  18540. func (c *InstanceGroupManagersInsertCall) doRequest(alt string) (*http.Response, error) {
  18541. var body io.Reader = nil
  18542. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  18543. if err != nil {
  18544. return nil, err
  18545. }
  18546. ctype := "application/json"
  18547. c.urlParams_.Set("alt", alt)
  18548. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers")
  18549. urls += "?" + c.urlParams_.Encode()
  18550. req, _ := http.NewRequest("POST", urls, body)
  18551. googleapi.Expand(req.URL, map[string]string{
  18552. "project": c.project,
  18553. "zone": c.zone,
  18554. })
  18555. req.Header.Set("Content-Type", ctype)
  18556. req.Header.Set("User-Agent", c.s.userAgent())
  18557. if c.ctx_ != nil {
  18558. return ctxhttp.Do(c.ctx_, c.s.client, req)
  18559. }
  18560. return c.s.client.Do(req)
  18561. }
  18562. // Do executes the "compute.instanceGroupManagers.insert" call.
  18563. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  18564. // status code is an error. Response headers are in either
  18565. // *Operation.ServerResponse.Header or (if a response was returned at
  18566. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  18567. // to check whether the returned error was because
  18568. // http.StatusNotModified was returned.
  18569. func (c *InstanceGroupManagersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  18570. gensupport.SetOptions(c.urlParams_, opts...)
  18571. res, err := c.doRequest("json")
  18572. if res != nil && res.StatusCode == http.StatusNotModified {
  18573. if res.Body != nil {
  18574. res.Body.Close()
  18575. }
  18576. return nil, &googleapi.Error{
  18577. Code: res.StatusCode,
  18578. Header: res.Header,
  18579. }
  18580. }
  18581. if err != nil {
  18582. return nil, err
  18583. }
  18584. defer googleapi.CloseBody(res)
  18585. if err := googleapi.CheckResponse(res); err != nil {
  18586. return nil, err
  18587. }
  18588. ret := &Operation{
  18589. ServerResponse: googleapi.ServerResponse{
  18590. Header: res.Header,
  18591. HTTPStatusCode: res.StatusCode,
  18592. },
  18593. }
  18594. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  18595. return nil, err
  18596. }
  18597. return ret, nil
  18598. // {
  18599. // "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.",
  18600. // "httpMethod": "POST",
  18601. // "id": "compute.instanceGroupManagers.insert",
  18602. // "parameterOrder": [
  18603. // "project",
  18604. // "zone"
  18605. // ],
  18606. // "parameters": {
  18607. // "project": {
  18608. // "description": "Project ID for this request.",
  18609. // "location": "path",
  18610. // "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])?))",
  18611. // "required": true,
  18612. // "type": "string"
  18613. // },
  18614. // "zone": {
  18615. // "description": "The name of the zone where you want to create the managed instance group.",
  18616. // "location": "path",
  18617. // "required": true,
  18618. // "type": "string"
  18619. // }
  18620. // },
  18621. // "path": "{project}/zones/{zone}/instanceGroupManagers",
  18622. // "request": {
  18623. // "$ref": "InstanceGroupManager"
  18624. // },
  18625. // "response": {
  18626. // "$ref": "Operation"
  18627. // },
  18628. // "scopes": [
  18629. // "https://www.googleapis.com/auth/cloud-platform",
  18630. // "https://www.googleapis.com/auth/compute"
  18631. // ]
  18632. // }
  18633. }
  18634. // method id "compute.instanceGroupManagers.list":
  18635. type InstanceGroupManagersListCall struct {
  18636. s *Service
  18637. project string
  18638. zone string
  18639. urlParams_ gensupport.URLParams
  18640. ifNoneMatch_ string
  18641. ctx_ context.Context
  18642. }
  18643. // List: Retrieves a list of managed instance groups that are contained
  18644. // within the specified project and zone.
  18645. func (r *InstanceGroupManagersService) List(project string, zone string) *InstanceGroupManagersListCall {
  18646. c := &InstanceGroupManagersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18647. c.project = project
  18648. c.zone = zone
  18649. return c
  18650. }
  18651. // Filter sets the optional parameter "filter": Sets a filter expression
  18652. // for filtering listed resources, in the form filter={expression}. Your
  18653. // {expression} must be in the format: field_name comparison_string
  18654. // literal_string.
  18655. //
  18656. // The field_name is the name of the field you want to compare. Only
  18657. // atomic field types are supported (string, number, boolean). The
  18658. // comparison_string must be either eq (equals) or ne (not equals). The
  18659. // literal_string is the string value to filter to. The literal value
  18660. // must be valid for the type of field you are filtering by (string,
  18661. // number, boolean). For string fields, the literal value is interpreted
  18662. // as a regular expression using RE2 syntax. The literal value must
  18663. // match the entire field.
  18664. //
  18665. // For example, filter=name ne example-instance.
  18666. //
  18667. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  18668. // you can also filter on nested fields. For example, you could filter
  18669. // on instances that have set the scheduling.automaticRestart field to
  18670. // true. In particular, use filtering on nested fields to take advantage
  18671. // of instance labels to organize and filter results based on label
  18672. // values.
  18673. //
  18674. // The Beta API also supports filtering on multiple expressions by
  18675. // providing each separate expression within parentheses. For example,
  18676. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  18677. // Multiple expressions are treated as AND expressions meaning that
  18678. // resources must match all expressions to pass the filters.
  18679. func (c *InstanceGroupManagersListCall) Filter(filter string) *InstanceGroupManagersListCall {
  18680. c.urlParams_.Set("filter", filter)
  18681. return c
  18682. }
  18683. // MaxResults sets the optional parameter "maxResults": The maximum
  18684. // number of results per page that Compute Engine should return. If the
  18685. // number of available results is larger than maxResults, Compute Engine
  18686. // returns a nextPageToken that can be used to get the next page of
  18687. // results in subsequent list requests.
  18688. func (c *InstanceGroupManagersListCall) MaxResults(maxResults int64) *InstanceGroupManagersListCall {
  18689. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  18690. return c
  18691. }
  18692. // PageToken sets the optional parameter "pageToken": Specifies a page
  18693. // token to use. Set pageToken to the nextPageToken returned by a
  18694. // previous list request to get the next page of results.
  18695. func (c *InstanceGroupManagersListCall) PageToken(pageToken string) *InstanceGroupManagersListCall {
  18696. c.urlParams_.Set("pageToken", pageToken)
  18697. return c
  18698. }
  18699. // Fields allows partial responses to be retrieved. See
  18700. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18701. // for more information.
  18702. func (c *InstanceGroupManagersListCall) Fields(s ...googleapi.Field) *InstanceGroupManagersListCall {
  18703. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18704. return c
  18705. }
  18706. // IfNoneMatch sets the optional parameter which makes the operation
  18707. // fail if the object's ETag matches the given value. This is useful for
  18708. // getting updates only after the object has changed since the last
  18709. // request. Use googleapi.IsNotModified to check whether the response
  18710. // error from Do is the result of In-None-Match.
  18711. func (c *InstanceGroupManagersListCall) IfNoneMatch(entityTag string) *InstanceGroupManagersListCall {
  18712. c.ifNoneMatch_ = entityTag
  18713. return c
  18714. }
  18715. // Context sets the context to be used in this call's Do method. Any
  18716. // pending HTTP request will be aborted if the provided context is
  18717. // canceled.
  18718. func (c *InstanceGroupManagersListCall) Context(ctx context.Context) *InstanceGroupManagersListCall {
  18719. c.ctx_ = ctx
  18720. return c
  18721. }
  18722. func (c *InstanceGroupManagersListCall) doRequest(alt string) (*http.Response, error) {
  18723. var body io.Reader = nil
  18724. c.urlParams_.Set("alt", alt)
  18725. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers")
  18726. urls += "?" + c.urlParams_.Encode()
  18727. req, _ := http.NewRequest("GET", urls, body)
  18728. googleapi.Expand(req.URL, map[string]string{
  18729. "project": c.project,
  18730. "zone": c.zone,
  18731. })
  18732. req.Header.Set("User-Agent", c.s.userAgent())
  18733. if c.ifNoneMatch_ != "" {
  18734. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  18735. }
  18736. if c.ctx_ != nil {
  18737. return ctxhttp.Do(c.ctx_, c.s.client, req)
  18738. }
  18739. return c.s.client.Do(req)
  18740. }
  18741. // Do executes the "compute.instanceGroupManagers.list" call.
  18742. // Exactly one of *InstanceGroupManagerList or error will be non-nil.
  18743. // Any non-2xx status code is an error. Response headers are in either
  18744. // *InstanceGroupManagerList.ServerResponse.Header or (if a response was
  18745. // returned at all) in error.(*googleapi.Error).Header. Use
  18746. // googleapi.IsNotModified to check whether the returned error was
  18747. // because http.StatusNotModified was returned.
  18748. func (c *InstanceGroupManagersListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagerList, error) {
  18749. gensupport.SetOptions(c.urlParams_, opts...)
  18750. res, err := c.doRequest("json")
  18751. if res != nil && res.StatusCode == http.StatusNotModified {
  18752. if res.Body != nil {
  18753. res.Body.Close()
  18754. }
  18755. return nil, &googleapi.Error{
  18756. Code: res.StatusCode,
  18757. Header: res.Header,
  18758. }
  18759. }
  18760. if err != nil {
  18761. return nil, err
  18762. }
  18763. defer googleapi.CloseBody(res)
  18764. if err := googleapi.CheckResponse(res); err != nil {
  18765. return nil, err
  18766. }
  18767. ret := &InstanceGroupManagerList{
  18768. ServerResponse: googleapi.ServerResponse{
  18769. Header: res.Header,
  18770. HTTPStatusCode: res.StatusCode,
  18771. },
  18772. }
  18773. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  18774. return nil, err
  18775. }
  18776. return ret, nil
  18777. // {
  18778. // "description": "Retrieves a list of managed instance groups that are contained within the specified project and zone.",
  18779. // "httpMethod": "GET",
  18780. // "id": "compute.instanceGroupManagers.list",
  18781. // "parameterOrder": [
  18782. // "project",
  18783. // "zone"
  18784. // ],
  18785. // "parameters": {
  18786. // "filter": {
  18787. // "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.",
  18788. // "location": "query",
  18789. // "type": "string"
  18790. // },
  18791. // "maxResults": {
  18792. // "default": "500",
  18793. // "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.",
  18794. // "format": "uint32",
  18795. // "location": "query",
  18796. // "maximum": "500",
  18797. // "minimum": "0",
  18798. // "type": "integer"
  18799. // },
  18800. // "pageToken": {
  18801. // "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.",
  18802. // "location": "query",
  18803. // "type": "string"
  18804. // },
  18805. // "project": {
  18806. // "description": "Project ID for this request.",
  18807. // "location": "path",
  18808. // "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])?))",
  18809. // "required": true,
  18810. // "type": "string"
  18811. // },
  18812. // "zone": {
  18813. // "description": "The name of the zone where the managed instance group is located.",
  18814. // "location": "path",
  18815. // "required": true,
  18816. // "type": "string"
  18817. // }
  18818. // },
  18819. // "path": "{project}/zones/{zone}/instanceGroupManagers",
  18820. // "response": {
  18821. // "$ref": "InstanceGroupManagerList"
  18822. // },
  18823. // "scopes": [
  18824. // "https://www.googleapis.com/auth/cloud-platform",
  18825. // "https://www.googleapis.com/auth/compute",
  18826. // "https://www.googleapis.com/auth/compute.readonly"
  18827. // ]
  18828. // }
  18829. }
  18830. // Pages invokes f for each page of results.
  18831. // A non-nil error returned from f will halt the iteration.
  18832. // The provided context supersedes any context provided to the Context method.
  18833. func (c *InstanceGroupManagersListCall) Pages(ctx context.Context, f func(*InstanceGroupManagerList) error) error {
  18834. c.ctx_ = ctx
  18835. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  18836. for {
  18837. x, err := c.Do()
  18838. if err != nil {
  18839. return err
  18840. }
  18841. if err := f(x); err != nil {
  18842. return err
  18843. }
  18844. if x.NextPageToken == "" {
  18845. return nil
  18846. }
  18847. c.PageToken(x.NextPageToken)
  18848. }
  18849. }
  18850. // method id "compute.instanceGroupManagers.listManagedInstances":
  18851. type InstanceGroupManagersListManagedInstancesCall struct {
  18852. s *Service
  18853. project string
  18854. zone string
  18855. instanceGroupManager string
  18856. urlParams_ gensupport.URLParams
  18857. ctx_ context.Context
  18858. }
  18859. // ListManagedInstances: Lists all of the instances in the managed
  18860. // instance group. Each instance in the list has a currentAction, which
  18861. // indicates the action that the managed instance group is performing on
  18862. // the instance. For example, if the group is still creating an
  18863. // instance, the currentAction is CREATING. If a previous action failed,
  18864. // the list displays the errors for that failed action.
  18865. func (r *InstanceGroupManagersService) ListManagedInstances(project string, zone string, instanceGroupManager string) *InstanceGroupManagersListManagedInstancesCall {
  18866. c := &InstanceGroupManagersListManagedInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18867. c.project = project
  18868. c.zone = zone
  18869. c.instanceGroupManager = instanceGroupManager
  18870. return c
  18871. }
  18872. // Fields allows partial responses to be retrieved. See
  18873. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18874. // for more information.
  18875. func (c *InstanceGroupManagersListManagedInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersListManagedInstancesCall {
  18876. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18877. return c
  18878. }
  18879. // Context sets the context to be used in this call's Do method. Any
  18880. // pending HTTP request will be aborted if the provided context is
  18881. // canceled.
  18882. func (c *InstanceGroupManagersListManagedInstancesCall) Context(ctx context.Context) *InstanceGroupManagersListManagedInstancesCall {
  18883. c.ctx_ = ctx
  18884. return c
  18885. }
  18886. func (c *InstanceGroupManagersListManagedInstancesCall) doRequest(alt string) (*http.Response, error) {
  18887. var body io.Reader = nil
  18888. c.urlParams_.Set("alt", alt)
  18889. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances")
  18890. urls += "?" + c.urlParams_.Encode()
  18891. req, _ := http.NewRequest("POST", urls, body)
  18892. googleapi.Expand(req.URL, map[string]string{
  18893. "project": c.project,
  18894. "zone": c.zone,
  18895. "instanceGroupManager": c.instanceGroupManager,
  18896. })
  18897. req.Header.Set("User-Agent", c.s.userAgent())
  18898. if c.ctx_ != nil {
  18899. return ctxhttp.Do(c.ctx_, c.s.client, req)
  18900. }
  18901. return c.s.client.Do(req)
  18902. }
  18903. // Do executes the "compute.instanceGroupManagers.listManagedInstances" call.
  18904. // Exactly one of *InstanceGroupManagersListManagedInstancesResponse or
  18905. // error will be non-nil. Any non-2xx status code is an error. Response
  18906. // headers are in either
  18907. // *InstanceGroupManagersListManagedInstancesResponse.ServerResponse.Head
  18908. // er or (if a response was returned at all) in
  18909. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  18910. // whether the returned error was because http.StatusNotModified was
  18911. // returned.
  18912. func (c *InstanceGroupManagersListManagedInstancesCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagersListManagedInstancesResponse, error) {
  18913. gensupport.SetOptions(c.urlParams_, opts...)
  18914. res, err := c.doRequest("json")
  18915. if res != nil && res.StatusCode == http.StatusNotModified {
  18916. if res.Body != nil {
  18917. res.Body.Close()
  18918. }
  18919. return nil, &googleapi.Error{
  18920. Code: res.StatusCode,
  18921. Header: res.Header,
  18922. }
  18923. }
  18924. if err != nil {
  18925. return nil, err
  18926. }
  18927. defer googleapi.CloseBody(res)
  18928. if err := googleapi.CheckResponse(res); err != nil {
  18929. return nil, err
  18930. }
  18931. ret := &InstanceGroupManagersListManagedInstancesResponse{
  18932. ServerResponse: googleapi.ServerResponse{
  18933. Header: res.Header,
  18934. HTTPStatusCode: res.StatusCode,
  18935. },
  18936. }
  18937. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  18938. return nil, err
  18939. }
  18940. return ret, nil
  18941. // {
  18942. // "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.",
  18943. // "httpMethod": "POST",
  18944. // "id": "compute.instanceGroupManagers.listManagedInstances",
  18945. // "parameterOrder": [
  18946. // "project",
  18947. // "zone",
  18948. // "instanceGroupManager"
  18949. // ],
  18950. // "parameters": {
  18951. // "instanceGroupManager": {
  18952. // "description": "The name of the managed instance group.",
  18953. // "location": "path",
  18954. // "required": true,
  18955. // "type": "string"
  18956. // },
  18957. // "project": {
  18958. // "description": "Project ID for this request.",
  18959. // "location": "path",
  18960. // "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])?))",
  18961. // "required": true,
  18962. // "type": "string"
  18963. // },
  18964. // "zone": {
  18965. // "description": "The name of the zone where the managed instance group is located.",
  18966. // "location": "path",
  18967. // "required": true,
  18968. // "type": "string"
  18969. // }
  18970. // },
  18971. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances",
  18972. // "response": {
  18973. // "$ref": "InstanceGroupManagersListManagedInstancesResponse"
  18974. // },
  18975. // "scopes": [
  18976. // "https://www.googleapis.com/auth/cloud-platform",
  18977. // "https://www.googleapis.com/auth/compute",
  18978. // "https://www.googleapis.com/auth/compute.readonly"
  18979. // ]
  18980. // }
  18981. }
  18982. // method id "compute.instanceGroupManagers.recreateInstances":
  18983. type InstanceGroupManagersRecreateInstancesCall struct {
  18984. s *Service
  18985. project string
  18986. zone string
  18987. instanceGroupManager string
  18988. instancegroupmanagersrecreateinstancesrequest *InstanceGroupManagersRecreateInstancesRequest
  18989. urlParams_ gensupport.URLParams
  18990. ctx_ context.Context
  18991. }
  18992. // RecreateInstances: Schedules a group action to recreate the specified
  18993. // instances in the managed instance group. The instances are deleted
  18994. // and recreated using the current instance template for the managed
  18995. // instance group. This operation is marked as DONE when the action is
  18996. // scheduled even if the instances have not yet been recreated. You must
  18997. // separately verify the status of the recreating action with the
  18998. // listmanagedinstances method.
  18999. func (r *InstanceGroupManagersService) RecreateInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersrecreateinstancesrequest *InstanceGroupManagersRecreateInstancesRequest) *InstanceGroupManagersRecreateInstancesCall {
  19000. c := &InstanceGroupManagersRecreateInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19001. c.project = project
  19002. c.zone = zone
  19003. c.instanceGroupManager = instanceGroupManager
  19004. c.instancegroupmanagersrecreateinstancesrequest = instancegroupmanagersrecreateinstancesrequest
  19005. return c
  19006. }
  19007. // Fields allows partial responses to be retrieved. See
  19008. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19009. // for more information.
  19010. func (c *InstanceGroupManagersRecreateInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersRecreateInstancesCall {
  19011. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19012. return c
  19013. }
  19014. // Context sets the context to be used in this call's Do method. Any
  19015. // pending HTTP request will be aborted if the provided context is
  19016. // canceled.
  19017. func (c *InstanceGroupManagersRecreateInstancesCall) Context(ctx context.Context) *InstanceGroupManagersRecreateInstancesCall {
  19018. c.ctx_ = ctx
  19019. return c
  19020. }
  19021. func (c *InstanceGroupManagersRecreateInstancesCall) doRequest(alt string) (*http.Response, error) {
  19022. var body io.Reader = nil
  19023. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersrecreateinstancesrequest)
  19024. if err != nil {
  19025. return nil, err
  19026. }
  19027. ctype := "application/json"
  19028. c.urlParams_.Set("alt", alt)
  19029. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances")
  19030. urls += "?" + c.urlParams_.Encode()
  19031. req, _ := http.NewRequest("POST", urls, body)
  19032. googleapi.Expand(req.URL, map[string]string{
  19033. "project": c.project,
  19034. "zone": c.zone,
  19035. "instanceGroupManager": c.instanceGroupManager,
  19036. })
  19037. req.Header.Set("Content-Type", ctype)
  19038. req.Header.Set("User-Agent", c.s.userAgent())
  19039. if c.ctx_ != nil {
  19040. return ctxhttp.Do(c.ctx_, c.s.client, req)
  19041. }
  19042. return c.s.client.Do(req)
  19043. }
  19044. // Do executes the "compute.instanceGroupManagers.recreateInstances" call.
  19045. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  19046. // status code is an error. Response headers are in either
  19047. // *Operation.ServerResponse.Header or (if a response was returned at
  19048. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  19049. // to check whether the returned error was because
  19050. // http.StatusNotModified was returned.
  19051. func (c *InstanceGroupManagersRecreateInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  19052. gensupport.SetOptions(c.urlParams_, opts...)
  19053. res, err := c.doRequest("json")
  19054. if res != nil && res.StatusCode == http.StatusNotModified {
  19055. if res.Body != nil {
  19056. res.Body.Close()
  19057. }
  19058. return nil, &googleapi.Error{
  19059. Code: res.StatusCode,
  19060. Header: res.Header,
  19061. }
  19062. }
  19063. if err != nil {
  19064. return nil, err
  19065. }
  19066. defer googleapi.CloseBody(res)
  19067. if err := googleapi.CheckResponse(res); err != nil {
  19068. return nil, err
  19069. }
  19070. ret := &Operation{
  19071. ServerResponse: googleapi.ServerResponse{
  19072. Header: res.Header,
  19073. HTTPStatusCode: res.StatusCode,
  19074. },
  19075. }
  19076. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  19077. return nil, err
  19078. }
  19079. return ret, nil
  19080. // {
  19081. // "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.",
  19082. // "httpMethod": "POST",
  19083. // "id": "compute.instanceGroupManagers.recreateInstances",
  19084. // "parameterOrder": [
  19085. // "project",
  19086. // "zone",
  19087. // "instanceGroupManager"
  19088. // ],
  19089. // "parameters": {
  19090. // "instanceGroupManager": {
  19091. // "description": "The name of the managed instance group.",
  19092. // "location": "path",
  19093. // "required": true,
  19094. // "type": "string"
  19095. // },
  19096. // "project": {
  19097. // "description": "Project ID for this request.",
  19098. // "location": "path",
  19099. // "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])?))",
  19100. // "required": true,
  19101. // "type": "string"
  19102. // },
  19103. // "zone": {
  19104. // "description": "The name of the zone where the managed instance group is located.",
  19105. // "location": "path",
  19106. // "required": true,
  19107. // "type": "string"
  19108. // }
  19109. // },
  19110. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances",
  19111. // "request": {
  19112. // "$ref": "InstanceGroupManagersRecreateInstancesRequest"
  19113. // },
  19114. // "response": {
  19115. // "$ref": "Operation"
  19116. // },
  19117. // "scopes": [
  19118. // "https://www.googleapis.com/auth/cloud-platform",
  19119. // "https://www.googleapis.com/auth/compute"
  19120. // ]
  19121. // }
  19122. }
  19123. // method id "compute.instanceGroupManagers.resize":
  19124. type InstanceGroupManagersResizeCall struct {
  19125. s *Service
  19126. project string
  19127. zone string
  19128. instanceGroupManager string
  19129. urlParams_ gensupport.URLParams
  19130. ctx_ context.Context
  19131. }
  19132. // Resize: Resizes the managed instance group. If you increase the size,
  19133. // the group creates new instances using the current instance template.
  19134. // If you decrease the size, the group deletes instances. The resize
  19135. // operation is marked DONE when the resize actions are scheduled even
  19136. // if the group has not yet added or deleted any instances. You must
  19137. // separately verify the status of the creating or deleting actions with
  19138. // the listmanagedinstances method.
  19139. func (r *InstanceGroupManagersService) Resize(project string, zone string, instanceGroupManager string, size int64) *InstanceGroupManagersResizeCall {
  19140. c := &InstanceGroupManagersResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19141. c.project = project
  19142. c.zone = zone
  19143. c.instanceGroupManager = instanceGroupManager
  19144. c.urlParams_.Set("size", fmt.Sprint(size))
  19145. return c
  19146. }
  19147. // Fields allows partial responses to be retrieved. See
  19148. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19149. // for more information.
  19150. func (c *InstanceGroupManagersResizeCall) Fields(s ...googleapi.Field) *InstanceGroupManagersResizeCall {
  19151. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19152. return c
  19153. }
  19154. // Context sets the context to be used in this call's Do method. Any
  19155. // pending HTTP request will be aborted if the provided context is
  19156. // canceled.
  19157. func (c *InstanceGroupManagersResizeCall) Context(ctx context.Context) *InstanceGroupManagersResizeCall {
  19158. c.ctx_ = ctx
  19159. return c
  19160. }
  19161. func (c *InstanceGroupManagersResizeCall) doRequest(alt string) (*http.Response, error) {
  19162. var body io.Reader = nil
  19163. c.urlParams_.Set("alt", alt)
  19164. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize")
  19165. urls += "?" + c.urlParams_.Encode()
  19166. req, _ := http.NewRequest("POST", urls, body)
  19167. googleapi.Expand(req.URL, map[string]string{
  19168. "project": c.project,
  19169. "zone": c.zone,
  19170. "instanceGroupManager": c.instanceGroupManager,
  19171. })
  19172. req.Header.Set("User-Agent", c.s.userAgent())
  19173. if c.ctx_ != nil {
  19174. return ctxhttp.Do(c.ctx_, c.s.client, req)
  19175. }
  19176. return c.s.client.Do(req)
  19177. }
  19178. // Do executes the "compute.instanceGroupManagers.resize" call.
  19179. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  19180. // status code is an error. Response headers are in either
  19181. // *Operation.ServerResponse.Header or (if a response was returned at
  19182. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  19183. // to check whether the returned error was because
  19184. // http.StatusNotModified was returned.
  19185. func (c *InstanceGroupManagersResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  19186. gensupport.SetOptions(c.urlParams_, opts...)
  19187. res, err := c.doRequest("json")
  19188. if res != nil && res.StatusCode == http.StatusNotModified {
  19189. if res.Body != nil {
  19190. res.Body.Close()
  19191. }
  19192. return nil, &googleapi.Error{
  19193. Code: res.StatusCode,
  19194. Header: res.Header,
  19195. }
  19196. }
  19197. if err != nil {
  19198. return nil, err
  19199. }
  19200. defer googleapi.CloseBody(res)
  19201. if err := googleapi.CheckResponse(res); err != nil {
  19202. return nil, err
  19203. }
  19204. ret := &Operation{
  19205. ServerResponse: googleapi.ServerResponse{
  19206. Header: res.Header,
  19207. HTTPStatusCode: res.StatusCode,
  19208. },
  19209. }
  19210. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  19211. return nil, err
  19212. }
  19213. return ret, nil
  19214. // {
  19215. // "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.",
  19216. // "httpMethod": "POST",
  19217. // "id": "compute.instanceGroupManagers.resize",
  19218. // "parameterOrder": [
  19219. // "project",
  19220. // "zone",
  19221. // "instanceGroupManager",
  19222. // "size"
  19223. // ],
  19224. // "parameters": {
  19225. // "instanceGroupManager": {
  19226. // "description": "The name of the managed instance group.",
  19227. // "location": "path",
  19228. // "required": true,
  19229. // "type": "string"
  19230. // },
  19231. // "project": {
  19232. // "description": "Project ID for this request.",
  19233. // "location": "path",
  19234. // "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])?))",
  19235. // "required": true,
  19236. // "type": "string"
  19237. // },
  19238. // "size": {
  19239. // "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.",
  19240. // "format": "int32",
  19241. // "location": "query",
  19242. // "required": true,
  19243. // "type": "integer"
  19244. // },
  19245. // "zone": {
  19246. // "description": "The name of the zone where the managed instance group is located.",
  19247. // "location": "path",
  19248. // "required": true,
  19249. // "type": "string"
  19250. // }
  19251. // },
  19252. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize",
  19253. // "response": {
  19254. // "$ref": "Operation"
  19255. // },
  19256. // "scopes": [
  19257. // "https://www.googleapis.com/auth/cloud-platform",
  19258. // "https://www.googleapis.com/auth/compute"
  19259. // ]
  19260. // }
  19261. }
  19262. // method id "compute.instanceGroupManagers.setInstanceTemplate":
  19263. type InstanceGroupManagersSetInstanceTemplateCall struct {
  19264. s *Service
  19265. project string
  19266. zone string
  19267. instanceGroupManager string
  19268. instancegroupmanagerssetinstancetemplaterequest *InstanceGroupManagersSetInstanceTemplateRequest
  19269. urlParams_ gensupport.URLParams
  19270. ctx_ context.Context
  19271. }
  19272. // SetInstanceTemplate: Specifies the instance template to use when
  19273. // creating new instances in this group. The templates for existing
  19274. // instances in the group do not change unless you recreate them.
  19275. func (r *InstanceGroupManagersService) SetInstanceTemplate(project string, zone string, instanceGroupManager string, instancegroupmanagerssetinstancetemplaterequest *InstanceGroupManagersSetInstanceTemplateRequest) *InstanceGroupManagersSetInstanceTemplateCall {
  19276. c := &InstanceGroupManagersSetInstanceTemplateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19277. c.project = project
  19278. c.zone = zone
  19279. c.instanceGroupManager = instanceGroupManager
  19280. c.instancegroupmanagerssetinstancetemplaterequest = instancegroupmanagerssetinstancetemplaterequest
  19281. return c
  19282. }
  19283. // Fields allows partial responses to be retrieved. See
  19284. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19285. // for more information.
  19286. func (c *InstanceGroupManagersSetInstanceTemplateCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetInstanceTemplateCall {
  19287. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19288. return c
  19289. }
  19290. // Context sets the context to be used in this call's Do method. Any
  19291. // pending HTTP request will be aborted if the provided context is
  19292. // canceled.
  19293. func (c *InstanceGroupManagersSetInstanceTemplateCall) Context(ctx context.Context) *InstanceGroupManagersSetInstanceTemplateCall {
  19294. c.ctx_ = ctx
  19295. return c
  19296. }
  19297. func (c *InstanceGroupManagersSetInstanceTemplateCall) doRequest(alt string) (*http.Response, error) {
  19298. var body io.Reader = nil
  19299. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssetinstancetemplaterequest)
  19300. if err != nil {
  19301. return nil, err
  19302. }
  19303. ctype := "application/json"
  19304. c.urlParams_.Set("alt", alt)
  19305. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate")
  19306. urls += "?" + c.urlParams_.Encode()
  19307. req, _ := http.NewRequest("POST", urls, body)
  19308. googleapi.Expand(req.URL, map[string]string{
  19309. "project": c.project,
  19310. "zone": c.zone,
  19311. "instanceGroupManager": c.instanceGroupManager,
  19312. })
  19313. req.Header.Set("Content-Type", ctype)
  19314. req.Header.Set("User-Agent", c.s.userAgent())
  19315. if c.ctx_ != nil {
  19316. return ctxhttp.Do(c.ctx_, c.s.client, req)
  19317. }
  19318. return c.s.client.Do(req)
  19319. }
  19320. // Do executes the "compute.instanceGroupManagers.setInstanceTemplate" call.
  19321. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  19322. // status code is an error. Response headers are in either
  19323. // *Operation.ServerResponse.Header or (if a response was returned at
  19324. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  19325. // to check whether the returned error was because
  19326. // http.StatusNotModified was returned.
  19327. func (c *InstanceGroupManagersSetInstanceTemplateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  19328. gensupport.SetOptions(c.urlParams_, opts...)
  19329. res, err := c.doRequest("json")
  19330. if res != nil && res.StatusCode == http.StatusNotModified {
  19331. if res.Body != nil {
  19332. res.Body.Close()
  19333. }
  19334. return nil, &googleapi.Error{
  19335. Code: res.StatusCode,
  19336. Header: res.Header,
  19337. }
  19338. }
  19339. if err != nil {
  19340. return nil, err
  19341. }
  19342. defer googleapi.CloseBody(res)
  19343. if err := googleapi.CheckResponse(res); err != nil {
  19344. return nil, err
  19345. }
  19346. ret := &Operation{
  19347. ServerResponse: googleapi.ServerResponse{
  19348. Header: res.Header,
  19349. HTTPStatusCode: res.StatusCode,
  19350. },
  19351. }
  19352. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  19353. return nil, err
  19354. }
  19355. return ret, nil
  19356. // {
  19357. // "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.",
  19358. // "httpMethod": "POST",
  19359. // "id": "compute.instanceGroupManagers.setInstanceTemplate",
  19360. // "parameterOrder": [
  19361. // "project",
  19362. // "zone",
  19363. // "instanceGroupManager"
  19364. // ],
  19365. // "parameters": {
  19366. // "instanceGroupManager": {
  19367. // "description": "The name of the managed instance group.",
  19368. // "location": "path",
  19369. // "required": true,
  19370. // "type": "string"
  19371. // },
  19372. // "project": {
  19373. // "description": "Project ID for this request.",
  19374. // "location": "path",
  19375. // "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])?))",
  19376. // "required": true,
  19377. // "type": "string"
  19378. // },
  19379. // "zone": {
  19380. // "description": "The name of the zone where the managed instance group is located.",
  19381. // "location": "path",
  19382. // "required": true,
  19383. // "type": "string"
  19384. // }
  19385. // },
  19386. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate",
  19387. // "request": {
  19388. // "$ref": "InstanceGroupManagersSetInstanceTemplateRequest"
  19389. // },
  19390. // "response": {
  19391. // "$ref": "Operation"
  19392. // },
  19393. // "scopes": [
  19394. // "https://www.googleapis.com/auth/cloud-platform",
  19395. // "https://www.googleapis.com/auth/compute"
  19396. // ]
  19397. // }
  19398. }
  19399. // method id "compute.instanceGroupManagers.setTargetPools":
  19400. type InstanceGroupManagersSetTargetPoolsCall struct {
  19401. s *Service
  19402. project string
  19403. zone string
  19404. instanceGroupManager string
  19405. instancegroupmanagerssettargetpoolsrequest *InstanceGroupManagersSetTargetPoolsRequest
  19406. urlParams_ gensupport.URLParams
  19407. ctx_ context.Context
  19408. }
  19409. // SetTargetPools: Modifies the target pools to which all instances in
  19410. // this managed instance group are assigned. The target pools
  19411. // automatically apply to all of the instances in the managed instance
  19412. // group. This operation is marked DONE when you make the request even
  19413. // if the instances have not yet been added to their target pools. The
  19414. // change might take some time to apply to all of the instances in the
  19415. // group depending on the size of the group.
  19416. func (r *InstanceGroupManagersService) SetTargetPools(project string, zone string, instanceGroupManager string, instancegroupmanagerssettargetpoolsrequest *InstanceGroupManagersSetTargetPoolsRequest) *InstanceGroupManagersSetTargetPoolsCall {
  19417. c := &InstanceGroupManagersSetTargetPoolsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19418. c.project = project
  19419. c.zone = zone
  19420. c.instanceGroupManager = instanceGroupManager
  19421. c.instancegroupmanagerssettargetpoolsrequest = instancegroupmanagerssettargetpoolsrequest
  19422. return c
  19423. }
  19424. // Fields allows partial responses to be retrieved. See
  19425. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19426. // for more information.
  19427. func (c *InstanceGroupManagersSetTargetPoolsCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetTargetPoolsCall {
  19428. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19429. return c
  19430. }
  19431. // Context sets the context to be used in this call's Do method. Any
  19432. // pending HTTP request will be aborted if the provided context is
  19433. // canceled.
  19434. func (c *InstanceGroupManagersSetTargetPoolsCall) Context(ctx context.Context) *InstanceGroupManagersSetTargetPoolsCall {
  19435. c.ctx_ = ctx
  19436. return c
  19437. }
  19438. func (c *InstanceGroupManagersSetTargetPoolsCall) doRequest(alt string) (*http.Response, error) {
  19439. var body io.Reader = nil
  19440. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssettargetpoolsrequest)
  19441. if err != nil {
  19442. return nil, err
  19443. }
  19444. ctype := "application/json"
  19445. c.urlParams_.Set("alt", alt)
  19446. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools")
  19447. urls += "?" + c.urlParams_.Encode()
  19448. req, _ := http.NewRequest("POST", urls, body)
  19449. googleapi.Expand(req.URL, map[string]string{
  19450. "project": c.project,
  19451. "zone": c.zone,
  19452. "instanceGroupManager": c.instanceGroupManager,
  19453. })
  19454. req.Header.Set("Content-Type", ctype)
  19455. req.Header.Set("User-Agent", c.s.userAgent())
  19456. if c.ctx_ != nil {
  19457. return ctxhttp.Do(c.ctx_, c.s.client, req)
  19458. }
  19459. return c.s.client.Do(req)
  19460. }
  19461. // Do executes the "compute.instanceGroupManagers.setTargetPools" call.
  19462. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  19463. // status code is an error. Response headers are in either
  19464. // *Operation.ServerResponse.Header or (if a response was returned at
  19465. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  19466. // to check whether the returned error was because
  19467. // http.StatusNotModified was returned.
  19468. func (c *InstanceGroupManagersSetTargetPoolsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  19469. gensupport.SetOptions(c.urlParams_, opts...)
  19470. res, err := c.doRequest("json")
  19471. if res != nil && res.StatusCode == http.StatusNotModified {
  19472. if res.Body != nil {
  19473. res.Body.Close()
  19474. }
  19475. return nil, &googleapi.Error{
  19476. Code: res.StatusCode,
  19477. Header: res.Header,
  19478. }
  19479. }
  19480. if err != nil {
  19481. return nil, err
  19482. }
  19483. defer googleapi.CloseBody(res)
  19484. if err := googleapi.CheckResponse(res); err != nil {
  19485. return nil, err
  19486. }
  19487. ret := &Operation{
  19488. ServerResponse: googleapi.ServerResponse{
  19489. Header: res.Header,
  19490. HTTPStatusCode: res.StatusCode,
  19491. },
  19492. }
  19493. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  19494. return nil, err
  19495. }
  19496. return ret, nil
  19497. // {
  19498. // "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.",
  19499. // "httpMethod": "POST",
  19500. // "id": "compute.instanceGroupManagers.setTargetPools",
  19501. // "parameterOrder": [
  19502. // "project",
  19503. // "zone",
  19504. // "instanceGroupManager"
  19505. // ],
  19506. // "parameters": {
  19507. // "instanceGroupManager": {
  19508. // "description": "The name of the managed instance group.",
  19509. // "location": "path",
  19510. // "required": true,
  19511. // "type": "string"
  19512. // },
  19513. // "project": {
  19514. // "description": "Project ID for this request.",
  19515. // "location": "path",
  19516. // "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])?))",
  19517. // "required": true,
  19518. // "type": "string"
  19519. // },
  19520. // "zone": {
  19521. // "description": "The name of the zone where the managed instance group is located.",
  19522. // "location": "path",
  19523. // "required": true,
  19524. // "type": "string"
  19525. // }
  19526. // },
  19527. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools",
  19528. // "request": {
  19529. // "$ref": "InstanceGroupManagersSetTargetPoolsRequest"
  19530. // },
  19531. // "response": {
  19532. // "$ref": "Operation"
  19533. // },
  19534. // "scopes": [
  19535. // "https://www.googleapis.com/auth/cloud-platform",
  19536. // "https://www.googleapis.com/auth/compute"
  19537. // ]
  19538. // }
  19539. }
  19540. // method id "compute.instanceGroups.addInstances":
  19541. type InstanceGroupsAddInstancesCall struct {
  19542. s *Service
  19543. project string
  19544. zone string
  19545. instanceGroup string
  19546. instancegroupsaddinstancesrequest *InstanceGroupsAddInstancesRequest
  19547. urlParams_ gensupport.URLParams
  19548. ctx_ context.Context
  19549. }
  19550. // AddInstances: Adds a list of instances to the specified instance
  19551. // group. Read Adding instances for more information.
  19552. func (r *InstanceGroupsService) AddInstances(project string, zone string, instanceGroup string, instancegroupsaddinstancesrequest *InstanceGroupsAddInstancesRequest) *InstanceGroupsAddInstancesCall {
  19553. c := &InstanceGroupsAddInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19554. c.project = project
  19555. c.zone = zone
  19556. c.instanceGroup = instanceGroup
  19557. c.instancegroupsaddinstancesrequest = instancegroupsaddinstancesrequest
  19558. return c
  19559. }
  19560. // Fields allows partial responses to be retrieved. See
  19561. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19562. // for more information.
  19563. func (c *InstanceGroupsAddInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsAddInstancesCall {
  19564. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19565. return c
  19566. }
  19567. // Context sets the context to be used in this call's Do method. Any
  19568. // pending HTTP request will be aborted if the provided context is
  19569. // canceled.
  19570. func (c *InstanceGroupsAddInstancesCall) Context(ctx context.Context) *InstanceGroupsAddInstancesCall {
  19571. c.ctx_ = ctx
  19572. return c
  19573. }
  19574. func (c *InstanceGroupsAddInstancesCall) doRequest(alt string) (*http.Response, error) {
  19575. var body io.Reader = nil
  19576. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupsaddinstancesrequest)
  19577. if err != nil {
  19578. return nil, err
  19579. }
  19580. ctype := "application/json"
  19581. c.urlParams_.Set("alt", alt)
  19582. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances")
  19583. urls += "?" + c.urlParams_.Encode()
  19584. req, _ := http.NewRequest("POST", urls, body)
  19585. googleapi.Expand(req.URL, map[string]string{
  19586. "project": c.project,
  19587. "zone": c.zone,
  19588. "instanceGroup": c.instanceGroup,
  19589. })
  19590. req.Header.Set("Content-Type", ctype)
  19591. req.Header.Set("User-Agent", c.s.userAgent())
  19592. if c.ctx_ != nil {
  19593. return ctxhttp.Do(c.ctx_, c.s.client, req)
  19594. }
  19595. return c.s.client.Do(req)
  19596. }
  19597. // Do executes the "compute.instanceGroups.addInstances" call.
  19598. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  19599. // status code is an error. Response headers are in either
  19600. // *Operation.ServerResponse.Header or (if a response was returned at
  19601. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  19602. // to check whether the returned error was because
  19603. // http.StatusNotModified was returned.
  19604. func (c *InstanceGroupsAddInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  19605. gensupport.SetOptions(c.urlParams_, opts...)
  19606. res, err := c.doRequest("json")
  19607. if res != nil && res.StatusCode == http.StatusNotModified {
  19608. if res.Body != nil {
  19609. res.Body.Close()
  19610. }
  19611. return nil, &googleapi.Error{
  19612. Code: res.StatusCode,
  19613. Header: res.Header,
  19614. }
  19615. }
  19616. if err != nil {
  19617. return nil, err
  19618. }
  19619. defer googleapi.CloseBody(res)
  19620. if err := googleapi.CheckResponse(res); err != nil {
  19621. return nil, err
  19622. }
  19623. ret := &Operation{
  19624. ServerResponse: googleapi.ServerResponse{
  19625. Header: res.Header,
  19626. HTTPStatusCode: res.StatusCode,
  19627. },
  19628. }
  19629. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  19630. return nil, err
  19631. }
  19632. return ret, nil
  19633. // {
  19634. // "description": "Adds a list of instances to the specified instance group. Read Adding instances for more information.",
  19635. // "httpMethod": "POST",
  19636. // "id": "compute.instanceGroups.addInstances",
  19637. // "parameterOrder": [
  19638. // "project",
  19639. // "zone",
  19640. // "instanceGroup"
  19641. // ],
  19642. // "parameters": {
  19643. // "instanceGroup": {
  19644. // "description": "The name of the instance group where you are adding instances.",
  19645. // "location": "path",
  19646. // "required": true,
  19647. // "type": "string"
  19648. // },
  19649. // "project": {
  19650. // "description": "Project ID for this request.",
  19651. // "location": "path",
  19652. // "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])?))",
  19653. // "required": true,
  19654. // "type": "string"
  19655. // },
  19656. // "zone": {
  19657. // "description": "The name of the zone where the instance group is located.",
  19658. // "location": "path",
  19659. // "required": true,
  19660. // "type": "string"
  19661. // }
  19662. // },
  19663. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances",
  19664. // "request": {
  19665. // "$ref": "InstanceGroupsAddInstancesRequest"
  19666. // },
  19667. // "response": {
  19668. // "$ref": "Operation"
  19669. // },
  19670. // "scopes": [
  19671. // "https://www.googleapis.com/auth/cloud-platform",
  19672. // "https://www.googleapis.com/auth/compute"
  19673. // ]
  19674. // }
  19675. }
  19676. // method id "compute.instanceGroups.aggregatedList":
  19677. type InstanceGroupsAggregatedListCall struct {
  19678. s *Service
  19679. project string
  19680. urlParams_ gensupport.URLParams
  19681. ifNoneMatch_ string
  19682. ctx_ context.Context
  19683. }
  19684. // AggregatedList: Retrieves the list of instance groups and sorts them
  19685. // by zone.
  19686. func (r *InstanceGroupsService) AggregatedList(project string) *InstanceGroupsAggregatedListCall {
  19687. c := &InstanceGroupsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19688. c.project = project
  19689. return c
  19690. }
  19691. // Filter sets the optional parameter "filter": Sets a filter expression
  19692. // for filtering listed resources, in the form filter={expression}. Your
  19693. // {expression} must be in the format: field_name comparison_string
  19694. // literal_string.
  19695. //
  19696. // The field_name is the name of the field you want to compare. Only
  19697. // atomic field types are supported (string, number, boolean). The
  19698. // comparison_string must be either eq (equals) or ne (not equals). The
  19699. // literal_string is the string value to filter to. The literal value
  19700. // must be valid for the type of field you are filtering by (string,
  19701. // number, boolean). For string fields, the literal value is interpreted
  19702. // as a regular expression using RE2 syntax. The literal value must
  19703. // match the entire field.
  19704. //
  19705. // For example, filter=name ne example-instance.
  19706. //
  19707. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  19708. // you can also filter on nested fields. For example, you could filter
  19709. // on instances that have set the scheduling.automaticRestart field to
  19710. // true. In particular, use filtering on nested fields to take advantage
  19711. // of instance labels to organize and filter results based on label
  19712. // values.
  19713. //
  19714. // The Beta API also supports filtering on multiple expressions by
  19715. // providing each separate expression within parentheses. For example,
  19716. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  19717. // Multiple expressions are treated as AND expressions meaning that
  19718. // resources must match all expressions to pass the filters.
  19719. func (c *InstanceGroupsAggregatedListCall) Filter(filter string) *InstanceGroupsAggregatedListCall {
  19720. c.urlParams_.Set("filter", filter)
  19721. return c
  19722. }
  19723. // MaxResults sets the optional parameter "maxResults": The maximum
  19724. // number of results per page that Compute Engine should return. If the
  19725. // number of available results is larger than maxResults, Compute Engine
  19726. // returns a nextPageToken that can be used to get the next page of
  19727. // results in subsequent list requests.
  19728. func (c *InstanceGroupsAggregatedListCall) MaxResults(maxResults int64) *InstanceGroupsAggregatedListCall {
  19729. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  19730. return c
  19731. }
  19732. // PageToken sets the optional parameter "pageToken": Specifies a page
  19733. // token to use. Set pageToken to the nextPageToken returned by a
  19734. // previous list request to get the next page of results.
  19735. func (c *InstanceGroupsAggregatedListCall) PageToken(pageToken string) *InstanceGroupsAggregatedListCall {
  19736. c.urlParams_.Set("pageToken", pageToken)
  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 *InstanceGroupsAggregatedListCall) Fields(s ...googleapi.Field) *InstanceGroupsAggregatedListCall {
  19743. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19744. return c
  19745. }
  19746. // IfNoneMatch sets the optional parameter which makes the operation
  19747. // fail if the object's ETag matches the given value. This is useful for
  19748. // getting updates only after the object has changed since the last
  19749. // request. Use googleapi.IsNotModified to check whether the response
  19750. // error from Do is the result of In-None-Match.
  19751. func (c *InstanceGroupsAggregatedListCall) IfNoneMatch(entityTag string) *InstanceGroupsAggregatedListCall {
  19752. c.ifNoneMatch_ = entityTag
  19753. return c
  19754. }
  19755. // Context sets the context to be used in this call's Do method. Any
  19756. // pending HTTP request will be aborted if the provided context is
  19757. // canceled.
  19758. func (c *InstanceGroupsAggregatedListCall) Context(ctx context.Context) *InstanceGroupsAggregatedListCall {
  19759. c.ctx_ = ctx
  19760. return c
  19761. }
  19762. func (c *InstanceGroupsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  19763. var body io.Reader = nil
  19764. c.urlParams_.Set("alt", alt)
  19765. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instanceGroups")
  19766. urls += "?" + c.urlParams_.Encode()
  19767. req, _ := http.NewRequest("GET", urls, body)
  19768. googleapi.Expand(req.URL, map[string]string{
  19769. "project": c.project,
  19770. })
  19771. req.Header.Set("User-Agent", c.s.userAgent())
  19772. if c.ifNoneMatch_ != "" {
  19773. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  19774. }
  19775. if c.ctx_ != nil {
  19776. return ctxhttp.Do(c.ctx_, c.s.client, req)
  19777. }
  19778. return c.s.client.Do(req)
  19779. }
  19780. // Do executes the "compute.instanceGroups.aggregatedList" call.
  19781. // Exactly one of *InstanceGroupAggregatedList or error will be non-nil.
  19782. // Any non-2xx status code is an error. Response headers are in either
  19783. // *InstanceGroupAggregatedList.ServerResponse.Header or (if a response
  19784. // was returned at all) in error.(*googleapi.Error).Header. Use
  19785. // googleapi.IsNotModified to check whether the returned error was
  19786. // because http.StatusNotModified was returned.
  19787. func (c *InstanceGroupsAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupAggregatedList, error) {
  19788. gensupport.SetOptions(c.urlParams_, opts...)
  19789. res, err := c.doRequest("json")
  19790. if res != nil && res.StatusCode == http.StatusNotModified {
  19791. if res.Body != nil {
  19792. res.Body.Close()
  19793. }
  19794. return nil, &googleapi.Error{
  19795. Code: res.StatusCode,
  19796. Header: res.Header,
  19797. }
  19798. }
  19799. if err != nil {
  19800. return nil, err
  19801. }
  19802. defer googleapi.CloseBody(res)
  19803. if err := googleapi.CheckResponse(res); err != nil {
  19804. return nil, err
  19805. }
  19806. ret := &InstanceGroupAggregatedList{
  19807. ServerResponse: googleapi.ServerResponse{
  19808. Header: res.Header,
  19809. HTTPStatusCode: res.StatusCode,
  19810. },
  19811. }
  19812. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  19813. return nil, err
  19814. }
  19815. return ret, nil
  19816. // {
  19817. // "description": "Retrieves the list of instance groups and sorts them by zone.",
  19818. // "httpMethod": "GET",
  19819. // "id": "compute.instanceGroups.aggregatedList",
  19820. // "parameterOrder": [
  19821. // "project"
  19822. // ],
  19823. // "parameters": {
  19824. // "filter": {
  19825. // "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.",
  19826. // "location": "query",
  19827. // "type": "string"
  19828. // },
  19829. // "maxResults": {
  19830. // "default": "500",
  19831. // "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.",
  19832. // "format": "uint32",
  19833. // "location": "query",
  19834. // "maximum": "500",
  19835. // "minimum": "0",
  19836. // "type": "integer"
  19837. // },
  19838. // "pageToken": {
  19839. // "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.",
  19840. // "location": "query",
  19841. // "type": "string"
  19842. // },
  19843. // "project": {
  19844. // "description": "Project ID for this request.",
  19845. // "location": "path",
  19846. // "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])?))",
  19847. // "required": true,
  19848. // "type": "string"
  19849. // }
  19850. // },
  19851. // "path": "{project}/aggregated/instanceGroups",
  19852. // "response": {
  19853. // "$ref": "InstanceGroupAggregatedList"
  19854. // },
  19855. // "scopes": [
  19856. // "https://www.googleapis.com/auth/cloud-platform",
  19857. // "https://www.googleapis.com/auth/compute",
  19858. // "https://www.googleapis.com/auth/compute.readonly"
  19859. // ]
  19860. // }
  19861. }
  19862. // Pages invokes f for each page of results.
  19863. // A non-nil error returned from f will halt the iteration.
  19864. // The provided context supersedes any context provided to the Context method.
  19865. func (c *InstanceGroupsAggregatedListCall) Pages(ctx context.Context, f func(*InstanceGroupAggregatedList) error) error {
  19866. c.ctx_ = ctx
  19867. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  19868. for {
  19869. x, err := c.Do()
  19870. if err != nil {
  19871. return err
  19872. }
  19873. if err := f(x); err != nil {
  19874. return err
  19875. }
  19876. if x.NextPageToken == "" {
  19877. return nil
  19878. }
  19879. c.PageToken(x.NextPageToken)
  19880. }
  19881. }
  19882. // method id "compute.instanceGroups.delete":
  19883. type InstanceGroupsDeleteCall struct {
  19884. s *Service
  19885. project string
  19886. zone string
  19887. instanceGroup string
  19888. urlParams_ gensupport.URLParams
  19889. ctx_ context.Context
  19890. }
  19891. // Delete: Deletes the specified instance group. The instances in the
  19892. // group are not deleted. Note that instance group must not belong to a
  19893. // backend service. Read Deleting an instance group for more
  19894. // information.
  19895. func (r *InstanceGroupsService) Delete(project string, zone string, instanceGroup string) *InstanceGroupsDeleteCall {
  19896. c := &InstanceGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19897. c.project = project
  19898. c.zone = zone
  19899. c.instanceGroup = instanceGroup
  19900. return c
  19901. }
  19902. // Fields allows partial responses to be retrieved. See
  19903. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19904. // for more information.
  19905. func (c *InstanceGroupsDeleteCall) Fields(s ...googleapi.Field) *InstanceGroupsDeleteCall {
  19906. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19907. return c
  19908. }
  19909. // Context sets the context to be used in this call's Do method. Any
  19910. // pending HTTP request will be aborted if the provided context is
  19911. // canceled.
  19912. func (c *InstanceGroupsDeleteCall) Context(ctx context.Context) *InstanceGroupsDeleteCall {
  19913. c.ctx_ = ctx
  19914. return c
  19915. }
  19916. func (c *InstanceGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
  19917. var body io.Reader = nil
  19918. c.urlParams_.Set("alt", alt)
  19919. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}")
  19920. urls += "?" + c.urlParams_.Encode()
  19921. req, _ := http.NewRequest("DELETE", urls, body)
  19922. googleapi.Expand(req.URL, map[string]string{
  19923. "project": c.project,
  19924. "zone": c.zone,
  19925. "instanceGroup": c.instanceGroup,
  19926. })
  19927. req.Header.Set("User-Agent", c.s.userAgent())
  19928. if c.ctx_ != nil {
  19929. return ctxhttp.Do(c.ctx_, c.s.client, req)
  19930. }
  19931. return c.s.client.Do(req)
  19932. }
  19933. // Do executes the "compute.instanceGroups.delete" call.
  19934. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  19935. // status code is an error. Response headers are in either
  19936. // *Operation.ServerResponse.Header or (if a response was returned at
  19937. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  19938. // to check whether the returned error was because
  19939. // http.StatusNotModified was returned.
  19940. func (c *InstanceGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  19941. gensupport.SetOptions(c.urlParams_, opts...)
  19942. res, err := c.doRequest("json")
  19943. if res != nil && res.StatusCode == http.StatusNotModified {
  19944. if res.Body != nil {
  19945. res.Body.Close()
  19946. }
  19947. return nil, &googleapi.Error{
  19948. Code: res.StatusCode,
  19949. Header: res.Header,
  19950. }
  19951. }
  19952. if err != nil {
  19953. return nil, err
  19954. }
  19955. defer googleapi.CloseBody(res)
  19956. if err := googleapi.CheckResponse(res); err != nil {
  19957. return nil, err
  19958. }
  19959. ret := &Operation{
  19960. ServerResponse: googleapi.ServerResponse{
  19961. Header: res.Header,
  19962. HTTPStatusCode: res.StatusCode,
  19963. },
  19964. }
  19965. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  19966. return nil, err
  19967. }
  19968. return ret, nil
  19969. // {
  19970. // "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.",
  19971. // "httpMethod": "DELETE",
  19972. // "id": "compute.instanceGroups.delete",
  19973. // "parameterOrder": [
  19974. // "project",
  19975. // "zone",
  19976. // "instanceGroup"
  19977. // ],
  19978. // "parameters": {
  19979. // "instanceGroup": {
  19980. // "description": "The name of the instance group to delete.",
  19981. // "location": "path",
  19982. // "required": true,
  19983. // "type": "string"
  19984. // },
  19985. // "project": {
  19986. // "description": "Project ID for this request.",
  19987. // "location": "path",
  19988. // "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])?))",
  19989. // "required": true,
  19990. // "type": "string"
  19991. // },
  19992. // "zone": {
  19993. // "description": "The name of the zone where the instance group is located.",
  19994. // "location": "path",
  19995. // "required": true,
  19996. // "type": "string"
  19997. // }
  19998. // },
  19999. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}",
  20000. // "response": {
  20001. // "$ref": "Operation"
  20002. // },
  20003. // "scopes": [
  20004. // "https://www.googleapis.com/auth/cloud-platform",
  20005. // "https://www.googleapis.com/auth/compute"
  20006. // ]
  20007. // }
  20008. }
  20009. // method id "compute.instanceGroups.get":
  20010. type InstanceGroupsGetCall struct {
  20011. s *Service
  20012. project string
  20013. zone string
  20014. instanceGroup string
  20015. urlParams_ gensupport.URLParams
  20016. ifNoneMatch_ string
  20017. ctx_ context.Context
  20018. }
  20019. // Get: Returns the specified instance group resource.
  20020. func (r *InstanceGroupsService) Get(project string, zone string, instanceGroup string) *InstanceGroupsGetCall {
  20021. c := &InstanceGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20022. c.project = project
  20023. c.zone = zone
  20024. c.instanceGroup = instanceGroup
  20025. return c
  20026. }
  20027. // Fields allows partial responses to be retrieved. See
  20028. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20029. // for more information.
  20030. func (c *InstanceGroupsGetCall) Fields(s ...googleapi.Field) *InstanceGroupsGetCall {
  20031. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20032. return c
  20033. }
  20034. // IfNoneMatch sets the optional parameter which makes the operation
  20035. // fail if the object's ETag matches the given value. This is useful for
  20036. // getting updates only after the object has changed since the last
  20037. // request. Use googleapi.IsNotModified to check whether the response
  20038. // error from Do is the result of In-None-Match.
  20039. func (c *InstanceGroupsGetCall) IfNoneMatch(entityTag string) *InstanceGroupsGetCall {
  20040. c.ifNoneMatch_ = entityTag
  20041. return c
  20042. }
  20043. // Context sets the context to be used in this call's Do method. Any
  20044. // pending HTTP request will be aborted if the provided context is
  20045. // canceled.
  20046. func (c *InstanceGroupsGetCall) Context(ctx context.Context) *InstanceGroupsGetCall {
  20047. c.ctx_ = ctx
  20048. return c
  20049. }
  20050. func (c *InstanceGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  20051. var body io.Reader = nil
  20052. c.urlParams_.Set("alt", alt)
  20053. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}")
  20054. urls += "?" + c.urlParams_.Encode()
  20055. req, _ := http.NewRequest("GET", urls, body)
  20056. googleapi.Expand(req.URL, map[string]string{
  20057. "project": c.project,
  20058. "zone": c.zone,
  20059. "instanceGroup": c.instanceGroup,
  20060. })
  20061. req.Header.Set("User-Agent", c.s.userAgent())
  20062. if c.ifNoneMatch_ != "" {
  20063. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  20064. }
  20065. if c.ctx_ != nil {
  20066. return ctxhttp.Do(c.ctx_, c.s.client, req)
  20067. }
  20068. return c.s.client.Do(req)
  20069. }
  20070. // Do executes the "compute.instanceGroups.get" call.
  20071. // Exactly one of *InstanceGroup or error will be non-nil. Any non-2xx
  20072. // status code is an error. Response headers are in either
  20073. // *InstanceGroup.ServerResponse.Header or (if a response was returned
  20074. // at all) in error.(*googleapi.Error).Header. Use
  20075. // googleapi.IsNotModified to check whether the returned error was
  20076. // because http.StatusNotModified was returned.
  20077. func (c *InstanceGroupsGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroup, error) {
  20078. gensupport.SetOptions(c.urlParams_, opts...)
  20079. res, err := c.doRequest("json")
  20080. if res != nil && res.StatusCode == http.StatusNotModified {
  20081. if res.Body != nil {
  20082. res.Body.Close()
  20083. }
  20084. return nil, &googleapi.Error{
  20085. Code: res.StatusCode,
  20086. Header: res.Header,
  20087. }
  20088. }
  20089. if err != nil {
  20090. return nil, err
  20091. }
  20092. defer googleapi.CloseBody(res)
  20093. if err := googleapi.CheckResponse(res); err != nil {
  20094. return nil, err
  20095. }
  20096. ret := &InstanceGroup{
  20097. ServerResponse: googleapi.ServerResponse{
  20098. Header: res.Header,
  20099. HTTPStatusCode: res.StatusCode,
  20100. },
  20101. }
  20102. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  20103. return nil, err
  20104. }
  20105. return ret, nil
  20106. // {
  20107. // "description": "Returns the specified instance group resource.",
  20108. // "httpMethod": "GET",
  20109. // "id": "compute.instanceGroups.get",
  20110. // "parameterOrder": [
  20111. // "project",
  20112. // "zone",
  20113. // "instanceGroup"
  20114. // ],
  20115. // "parameters": {
  20116. // "instanceGroup": {
  20117. // "description": "The name of the instance group.",
  20118. // "location": "path",
  20119. // "required": true,
  20120. // "type": "string"
  20121. // },
  20122. // "project": {
  20123. // "description": "Project ID for this request.",
  20124. // "location": "path",
  20125. // "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])?))",
  20126. // "required": true,
  20127. // "type": "string"
  20128. // },
  20129. // "zone": {
  20130. // "description": "The name of the zone where the instance group is located.",
  20131. // "location": "path",
  20132. // "required": true,
  20133. // "type": "string"
  20134. // }
  20135. // },
  20136. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}",
  20137. // "response": {
  20138. // "$ref": "InstanceGroup"
  20139. // },
  20140. // "scopes": [
  20141. // "https://www.googleapis.com/auth/cloud-platform",
  20142. // "https://www.googleapis.com/auth/compute",
  20143. // "https://www.googleapis.com/auth/compute.readonly"
  20144. // ]
  20145. // }
  20146. }
  20147. // method id "compute.instanceGroups.insert":
  20148. type InstanceGroupsInsertCall struct {
  20149. s *Service
  20150. project string
  20151. zone string
  20152. instancegroup *InstanceGroup
  20153. urlParams_ gensupport.URLParams
  20154. ctx_ context.Context
  20155. }
  20156. // Insert: Creates an instance group in the specified project using the
  20157. // parameters that are included in the request.
  20158. func (r *InstanceGroupsService) Insert(project string, zone string, instancegroup *InstanceGroup) *InstanceGroupsInsertCall {
  20159. c := &InstanceGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20160. c.project = project
  20161. c.zone = zone
  20162. c.instancegroup = instancegroup
  20163. return c
  20164. }
  20165. // Fields allows partial responses to be retrieved. See
  20166. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20167. // for more information.
  20168. func (c *InstanceGroupsInsertCall) Fields(s ...googleapi.Field) *InstanceGroupsInsertCall {
  20169. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20170. return c
  20171. }
  20172. // Context sets the context to be used in this call's Do method. Any
  20173. // pending HTTP request will be aborted if the provided context is
  20174. // canceled.
  20175. func (c *InstanceGroupsInsertCall) Context(ctx context.Context) *InstanceGroupsInsertCall {
  20176. c.ctx_ = ctx
  20177. return c
  20178. }
  20179. func (c *InstanceGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  20180. var body io.Reader = nil
  20181. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroup)
  20182. if err != nil {
  20183. return nil, err
  20184. }
  20185. ctype := "application/json"
  20186. c.urlParams_.Set("alt", alt)
  20187. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups")
  20188. urls += "?" + c.urlParams_.Encode()
  20189. req, _ := http.NewRequest("POST", urls, body)
  20190. googleapi.Expand(req.URL, map[string]string{
  20191. "project": c.project,
  20192. "zone": c.zone,
  20193. })
  20194. req.Header.Set("Content-Type", ctype)
  20195. req.Header.Set("User-Agent", c.s.userAgent())
  20196. if c.ctx_ != nil {
  20197. return ctxhttp.Do(c.ctx_, c.s.client, req)
  20198. }
  20199. return c.s.client.Do(req)
  20200. }
  20201. // Do executes the "compute.instanceGroups.insert" call.
  20202. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  20203. // status code is an error. Response headers are in either
  20204. // *Operation.ServerResponse.Header or (if a response was returned at
  20205. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  20206. // to check whether the returned error was because
  20207. // http.StatusNotModified was returned.
  20208. func (c *InstanceGroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  20209. gensupport.SetOptions(c.urlParams_, opts...)
  20210. res, err := c.doRequest("json")
  20211. if res != nil && res.StatusCode == http.StatusNotModified {
  20212. if res.Body != nil {
  20213. res.Body.Close()
  20214. }
  20215. return nil, &googleapi.Error{
  20216. Code: res.StatusCode,
  20217. Header: res.Header,
  20218. }
  20219. }
  20220. if err != nil {
  20221. return nil, err
  20222. }
  20223. defer googleapi.CloseBody(res)
  20224. if err := googleapi.CheckResponse(res); err != nil {
  20225. return nil, err
  20226. }
  20227. ret := &Operation{
  20228. ServerResponse: googleapi.ServerResponse{
  20229. Header: res.Header,
  20230. HTTPStatusCode: res.StatusCode,
  20231. },
  20232. }
  20233. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  20234. return nil, err
  20235. }
  20236. return ret, nil
  20237. // {
  20238. // "description": "Creates an instance group in the specified project using the parameters that are included in the request.",
  20239. // "httpMethod": "POST",
  20240. // "id": "compute.instanceGroups.insert",
  20241. // "parameterOrder": [
  20242. // "project",
  20243. // "zone"
  20244. // ],
  20245. // "parameters": {
  20246. // "project": {
  20247. // "description": "Project ID for this request.",
  20248. // "location": "path",
  20249. // "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])?))",
  20250. // "required": true,
  20251. // "type": "string"
  20252. // },
  20253. // "zone": {
  20254. // "description": "The name of the zone where you want to create the instance group.",
  20255. // "location": "path",
  20256. // "required": true,
  20257. // "type": "string"
  20258. // }
  20259. // },
  20260. // "path": "{project}/zones/{zone}/instanceGroups",
  20261. // "request": {
  20262. // "$ref": "InstanceGroup"
  20263. // },
  20264. // "response": {
  20265. // "$ref": "Operation"
  20266. // },
  20267. // "scopes": [
  20268. // "https://www.googleapis.com/auth/cloud-platform",
  20269. // "https://www.googleapis.com/auth/compute"
  20270. // ]
  20271. // }
  20272. }
  20273. // method id "compute.instanceGroups.list":
  20274. type InstanceGroupsListCall struct {
  20275. s *Service
  20276. project string
  20277. zone string
  20278. urlParams_ gensupport.URLParams
  20279. ifNoneMatch_ string
  20280. ctx_ context.Context
  20281. }
  20282. // List: Retrieves the list of instance groups that are located in the
  20283. // specified project and zone.
  20284. func (r *InstanceGroupsService) List(project string, zone string) *InstanceGroupsListCall {
  20285. c := &InstanceGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20286. c.project = project
  20287. c.zone = zone
  20288. return c
  20289. }
  20290. // Filter sets the optional parameter "filter": Sets a filter expression
  20291. // for filtering listed resources, in the form filter={expression}. Your
  20292. // {expression} must be in the format: field_name comparison_string
  20293. // literal_string.
  20294. //
  20295. // The field_name is the name of the field you want to compare. Only
  20296. // atomic field types are supported (string, number, boolean). The
  20297. // comparison_string must be either eq (equals) or ne (not equals). The
  20298. // literal_string is the string value to filter to. The literal value
  20299. // must be valid for the type of field you are filtering by (string,
  20300. // number, boolean). For string fields, the literal value is interpreted
  20301. // as a regular expression using RE2 syntax. The literal value must
  20302. // match the entire field.
  20303. //
  20304. // For example, filter=name ne example-instance.
  20305. //
  20306. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  20307. // you can also filter on nested fields. For example, you could filter
  20308. // on instances that have set the scheduling.automaticRestart field to
  20309. // true. In particular, use filtering on nested fields to take advantage
  20310. // of instance labels to organize and filter results based on label
  20311. // values.
  20312. //
  20313. // The Beta API also supports filtering on multiple expressions by
  20314. // providing each separate expression within parentheses. For example,
  20315. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  20316. // Multiple expressions are treated as AND expressions meaning that
  20317. // resources must match all expressions to pass the filters.
  20318. func (c *InstanceGroupsListCall) Filter(filter string) *InstanceGroupsListCall {
  20319. c.urlParams_.Set("filter", filter)
  20320. return c
  20321. }
  20322. // MaxResults sets the optional parameter "maxResults": The maximum
  20323. // number of results per page that Compute Engine should return. If the
  20324. // number of available results is larger than maxResults, Compute Engine
  20325. // returns a nextPageToken that can be used to get the next page of
  20326. // results in subsequent list requests.
  20327. func (c *InstanceGroupsListCall) MaxResults(maxResults int64) *InstanceGroupsListCall {
  20328. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  20329. return c
  20330. }
  20331. // PageToken sets the optional parameter "pageToken": Specifies a page
  20332. // token to use. Set pageToken to the nextPageToken returned by a
  20333. // previous list request to get the next page of results.
  20334. func (c *InstanceGroupsListCall) PageToken(pageToken string) *InstanceGroupsListCall {
  20335. c.urlParams_.Set("pageToken", pageToken)
  20336. return c
  20337. }
  20338. // Fields allows partial responses to be retrieved. See
  20339. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20340. // for more information.
  20341. func (c *InstanceGroupsListCall) Fields(s ...googleapi.Field) *InstanceGroupsListCall {
  20342. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20343. return c
  20344. }
  20345. // IfNoneMatch sets the optional parameter which makes the operation
  20346. // fail if the object's ETag matches the given value. This is useful for
  20347. // getting updates only after the object has changed since the last
  20348. // request. Use googleapi.IsNotModified to check whether the response
  20349. // error from Do is the result of In-None-Match.
  20350. func (c *InstanceGroupsListCall) IfNoneMatch(entityTag string) *InstanceGroupsListCall {
  20351. c.ifNoneMatch_ = entityTag
  20352. return c
  20353. }
  20354. // Context sets the context to be used in this call's Do method. Any
  20355. // pending HTTP request will be aborted if the provided context is
  20356. // canceled.
  20357. func (c *InstanceGroupsListCall) Context(ctx context.Context) *InstanceGroupsListCall {
  20358. c.ctx_ = ctx
  20359. return c
  20360. }
  20361. func (c *InstanceGroupsListCall) doRequest(alt string) (*http.Response, error) {
  20362. var body io.Reader = nil
  20363. c.urlParams_.Set("alt", alt)
  20364. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups")
  20365. urls += "?" + c.urlParams_.Encode()
  20366. req, _ := http.NewRequest("GET", urls, body)
  20367. googleapi.Expand(req.URL, map[string]string{
  20368. "project": c.project,
  20369. "zone": c.zone,
  20370. })
  20371. req.Header.Set("User-Agent", c.s.userAgent())
  20372. if c.ifNoneMatch_ != "" {
  20373. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  20374. }
  20375. if c.ctx_ != nil {
  20376. return ctxhttp.Do(c.ctx_, c.s.client, req)
  20377. }
  20378. return c.s.client.Do(req)
  20379. }
  20380. // Do executes the "compute.instanceGroups.list" call.
  20381. // Exactly one of *InstanceGroupList or error will be non-nil. Any
  20382. // non-2xx status code is an error. Response headers are in either
  20383. // *InstanceGroupList.ServerResponse.Header or (if a response was
  20384. // returned at all) in error.(*googleapi.Error).Header. Use
  20385. // googleapi.IsNotModified to check whether the returned error was
  20386. // because http.StatusNotModified was returned.
  20387. func (c *InstanceGroupsListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupList, error) {
  20388. gensupport.SetOptions(c.urlParams_, opts...)
  20389. res, err := c.doRequest("json")
  20390. if res != nil && res.StatusCode == http.StatusNotModified {
  20391. if res.Body != nil {
  20392. res.Body.Close()
  20393. }
  20394. return nil, &googleapi.Error{
  20395. Code: res.StatusCode,
  20396. Header: res.Header,
  20397. }
  20398. }
  20399. if err != nil {
  20400. return nil, err
  20401. }
  20402. defer googleapi.CloseBody(res)
  20403. if err := googleapi.CheckResponse(res); err != nil {
  20404. return nil, err
  20405. }
  20406. ret := &InstanceGroupList{
  20407. ServerResponse: googleapi.ServerResponse{
  20408. Header: res.Header,
  20409. HTTPStatusCode: res.StatusCode,
  20410. },
  20411. }
  20412. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  20413. return nil, err
  20414. }
  20415. return ret, nil
  20416. // {
  20417. // "description": "Retrieves the list of instance groups that are located in the specified project and zone.",
  20418. // "httpMethod": "GET",
  20419. // "id": "compute.instanceGroups.list",
  20420. // "parameterOrder": [
  20421. // "project",
  20422. // "zone"
  20423. // ],
  20424. // "parameters": {
  20425. // "filter": {
  20426. // "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.",
  20427. // "location": "query",
  20428. // "type": "string"
  20429. // },
  20430. // "maxResults": {
  20431. // "default": "500",
  20432. // "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.",
  20433. // "format": "uint32",
  20434. // "location": "query",
  20435. // "maximum": "500",
  20436. // "minimum": "0",
  20437. // "type": "integer"
  20438. // },
  20439. // "pageToken": {
  20440. // "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.",
  20441. // "location": "query",
  20442. // "type": "string"
  20443. // },
  20444. // "project": {
  20445. // "description": "Project ID for this request.",
  20446. // "location": "path",
  20447. // "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])?))",
  20448. // "required": true,
  20449. // "type": "string"
  20450. // },
  20451. // "zone": {
  20452. // "description": "The name of the zone where the instance group is located.",
  20453. // "location": "path",
  20454. // "required": true,
  20455. // "type": "string"
  20456. // }
  20457. // },
  20458. // "path": "{project}/zones/{zone}/instanceGroups",
  20459. // "response": {
  20460. // "$ref": "InstanceGroupList"
  20461. // },
  20462. // "scopes": [
  20463. // "https://www.googleapis.com/auth/cloud-platform",
  20464. // "https://www.googleapis.com/auth/compute",
  20465. // "https://www.googleapis.com/auth/compute.readonly"
  20466. // ]
  20467. // }
  20468. }
  20469. // Pages invokes f for each page of results.
  20470. // A non-nil error returned from f will halt the iteration.
  20471. // The provided context supersedes any context provided to the Context method.
  20472. func (c *InstanceGroupsListCall) Pages(ctx context.Context, f func(*InstanceGroupList) error) error {
  20473. c.ctx_ = ctx
  20474. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  20475. for {
  20476. x, err := c.Do()
  20477. if err != nil {
  20478. return err
  20479. }
  20480. if err := f(x); err != nil {
  20481. return err
  20482. }
  20483. if x.NextPageToken == "" {
  20484. return nil
  20485. }
  20486. c.PageToken(x.NextPageToken)
  20487. }
  20488. }
  20489. // method id "compute.instanceGroups.listInstances":
  20490. type InstanceGroupsListInstancesCall struct {
  20491. s *Service
  20492. project string
  20493. zone string
  20494. instanceGroup string
  20495. instancegroupslistinstancesrequest *InstanceGroupsListInstancesRequest
  20496. urlParams_ gensupport.URLParams
  20497. ctx_ context.Context
  20498. }
  20499. // ListInstances: Lists the instances in the specified instance group.
  20500. func (r *InstanceGroupsService) ListInstances(project string, zone string, instanceGroup string, instancegroupslistinstancesrequest *InstanceGroupsListInstancesRequest) *InstanceGroupsListInstancesCall {
  20501. c := &InstanceGroupsListInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20502. c.project = project
  20503. c.zone = zone
  20504. c.instanceGroup = instanceGroup
  20505. c.instancegroupslistinstancesrequest = instancegroupslistinstancesrequest
  20506. return c
  20507. }
  20508. // Filter sets the optional parameter "filter": Sets a filter expression
  20509. // for filtering listed resources, in the form filter={expression}. Your
  20510. // {expression} must be in the format: field_name comparison_string
  20511. // literal_string.
  20512. //
  20513. // The field_name is the name of the field you want to compare. Only
  20514. // atomic field types are supported (string, number, boolean). The
  20515. // comparison_string must be either eq (equals) or ne (not equals). The
  20516. // literal_string is the string value to filter to. The literal value
  20517. // must be valid for the type of field you are filtering by (string,
  20518. // number, boolean). For string fields, the literal value is interpreted
  20519. // as a regular expression using RE2 syntax. The literal value must
  20520. // match the entire field.
  20521. //
  20522. // For example, filter=name ne example-instance.
  20523. //
  20524. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  20525. // you can also filter on nested fields. For example, you could filter
  20526. // on instances that have set the scheduling.automaticRestart field to
  20527. // true. In particular, use filtering on nested fields to take advantage
  20528. // of instance labels to organize and filter results based on label
  20529. // values.
  20530. //
  20531. // The Beta API also supports filtering on multiple expressions by
  20532. // providing each separate expression within parentheses. For example,
  20533. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  20534. // Multiple expressions are treated as AND expressions meaning that
  20535. // resources must match all expressions to pass the filters.
  20536. func (c *InstanceGroupsListInstancesCall) Filter(filter string) *InstanceGroupsListInstancesCall {
  20537. c.urlParams_.Set("filter", filter)
  20538. return c
  20539. }
  20540. // MaxResults sets the optional parameter "maxResults": The maximum
  20541. // number of results per page that Compute Engine should return. If the
  20542. // number of available results is larger than maxResults, Compute Engine
  20543. // returns a nextPageToken that can be used to get the next page of
  20544. // results in subsequent list requests.
  20545. func (c *InstanceGroupsListInstancesCall) MaxResults(maxResults int64) *InstanceGroupsListInstancesCall {
  20546. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  20547. return c
  20548. }
  20549. // PageToken sets the optional parameter "pageToken": Specifies a page
  20550. // token to use. Set pageToken to the nextPageToken returned by a
  20551. // previous list request to get the next page of results.
  20552. func (c *InstanceGroupsListInstancesCall) PageToken(pageToken string) *InstanceGroupsListInstancesCall {
  20553. c.urlParams_.Set("pageToken", pageToken)
  20554. return c
  20555. }
  20556. // Fields allows partial responses to be retrieved. See
  20557. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20558. // for more information.
  20559. func (c *InstanceGroupsListInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsListInstancesCall {
  20560. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20561. return c
  20562. }
  20563. // Context sets the context to be used in this call's Do method. Any
  20564. // pending HTTP request will be aborted if the provided context is
  20565. // canceled.
  20566. func (c *InstanceGroupsListInstancesCall) Context(ctx context.Context) *InstanceGroupsListInstancesCall {
  20567. c.ctx_ = ctx
  20568. return c
  20569. }
  20570. func (c *InstanceGroupsListInstancesCall) doRequest(alt string) (*http.Response, error) {
  20571. var body io.Reader = nil
  20572. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupslistinstancesrequest)
  20573. if err != nil {
  20574. return nil, err
  20575. }
  20576. ctype := "application/json"
  20577. c.urlParams_.Set("alt", alt)
  20578. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances")
  20579. urls += "?" + c.urlParams_.Encode()
  20580. req, _ := http.NewRequest("POST", urls, body)
  20581. googleapi.Expand(req.URL, map[string]string{
  20582. "project": c.project,
  20583. "zone": c.zone,
  20584. "instanceGroup": c.instanceGroup,
  20585. })
  20586. req.Header.Set("Content-Type", ctype)
  20587. req.Header.Set("User-Agent", c.s.userAgent())
  20588. if c.ctx_ != nil {
  20589. return ctxhttp.Do(c.ctx_, c.s.client, req)
  20590. }
  20591. return c.s.client.Do(req)
  20592. }
  20593. // Do executes the "compute.instanceGroups.listInstances" call.
  20594. // Exactly one of *InstanceGroupsListInstances or error will be non-nil.
  20595. // Any non-2xx status code is an error. Response headers are in either
  20596. // *InstanceGroupsListInstances.ServerResponse.Header or (if a response
  20597. // was returned at all) in error.(*googleapi.Error).Header. Use
  20598. // googleapi.IsNotModified to check whether the returned error was
  20599. // because http.StatusNotModified was returned.
  20600. func (c *InstanceGroupsListInstancesCall) Do(opts ...googleapi.CallOption) (*InstanceGroupsListInstances, error) {
  20601. gensupport.SetOptions(c.urlParams_, opts...)
  20602. res, err := c.doRequest("json")
  20603. if res != nil && res.StatusCode == http.StatusNotModified {
  20604. if res.Body != nil {
  20605. res.Body.Close()
  20606. }
  20607. return nil, &googleapi.Error{
  20608. Code: res.StatusCode,
  20609. Header: res.Header,
  20610. }
  20611. }
  20612. if err != nil {
  20613. return nil, err
  20614. }
  20615. defer googleapi.CloseBody(res)
  20616. if err := googleapi.CheckResponse(res); err != nil {
  20617. return nil, err
  20618. }
  20619. ret := &InstanceGroupsListInstances{
  20620. ServerResponse: googleapi.ServerResponse{
  20621. Header: res.Header,
  20622. HTTPStatusCode: res.StatusCode,
  20623. },
  20624. }
  20625. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  20626. return nil, err
  20627. }
  20628. return ret, nil
  20629. // {
  20630. // "description": "Lists the instances in the specified instance group.",
  20631. // "httpMethod": "POST",
  20632. // "id": "compute.instanceGroups.listInstances",
  20633. // "parameterOrder": [
  20634. // "project",
  20635. // "zone",
  20636. // "instanceGroup"
  20637. // ],
  20638. // "parameters": {
  20639. // "filter": {
  20640. // "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.",
  20641. // "location": "query",
  20642. // "type": "string"
  20643. // },
  20644. // "instanceGroup": {
  20645. // "description": "The name of the instance group from which you want to generate a list of included instances.",
  20646. // "location": "path",
  20647. // "required": true,
  20648. // "type": "string"
  20649. // },
  20650. // "maxResults": {
  20651. // "default": "500",
  20652. // "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.",
  20653. // "format": "uint32",
  20654. // "location": "query",
  20655. // "maximum": "500",
  20656. // "minimum": "0",
  20657. // "type": "integer"
  20658. // },
  20659. // "pageToken": {
  20660. // "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.",
  20661. // "location": "query",
  20662. // "type": "string"
  20663. // },
  20664. // "project": {
  20665. // "description": "Project ID for this request.",
  20666. // "location": "path",
  20667. // "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])?))",
  20668. // "required": true,
  20669. // "type": "string"
  20670. // },
  20671. // "zone": {
  20672. // "description": "The name of the zone where the instance group is located.",
  20673. // "location": "path",
  20674. // "required": true,
  20675. // "type": "string"
  20676. // }
  20677. // },
  20678. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances",
  20679. // "request": {
  20680. // "$ref": "InstanceGroupsListInstancesRequest"
  20681. // },
  20682. // "response": {
  20683. // "$ref": "InstanceGroupsListInstances"
  20684. // },
  20685. // "scopes": [
  20686. // "https://www.googleapis.com/auth/cloud-platform",
  20687. // "https://www.googleapis.com/auth/compute",
  20688. // "https://www.googleapis.com/auth/compute.readonly"
  20689. // ]
  20690. // }
  20691. }
  20692. // method id "compute.instanceGroups.removeInstances":
  20693. type InstanceGroupsRemoveInstancesCall struct {
  20694. s *Service
  20695. project string
  20696. zone string
  20697. instanceGroup string
  20698. instancegroupsremoveinstancesrequest *InstanceGroupsRemoveInstancesRequest
  20699. urlParams_ gensupport.URLParams
  20700. ctx_ context.Context
  20701. }
  20702. // RemoveInstances: Removes one or more instances from the specified
  20703. // instance group, but does not delete those instances.
  20704. func (r *InstanceGroupsService) RemoveInstances(project string, zone string, instanceGroup string, instancegroupsremoveinstancesrequest *InstanceGroupsRemoveInstancesRequest) *InstanceGroupsRemoveInstancesCall {
  20705. c := &InstanceGroupsRemoveInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20706. c.project = project
  20707. c.zone = zone
  20708. c.instanceGroup = instanceGroup
  20709. c.instancegroupsremoveinstancesrequest = instancegroupsremoveinstancesrequest
  20710. return c
  20711. }
  20712. // Fields allows partial responses to be retrieved. See
  20713. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20714. // for more information.
  20715. func (c *InstanceGroupsRemoveInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsRemoveInstancesCall {
  20716. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20717. return c
  20718. }
  20719. // Context sets the context to be used in this call's Do method. Any
  20720. // pending HTTP request will be aborted if the provided context is
  20721. // canceled.
  20722. func (c *InstanceGroupsRemoveInstancesCall) Context(ctx context.Context) *InstanceGroupsRemoveInstancesCall {
  20723. c.ctx_ = ctx
  20724. return c
  20725. }
  20726. func (c *InstanceGroupsRemoveInstancesCall) doRequest(alt string) (*http.Response, error) {
  20727. var body io.Reader = nil
  20728. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupsremoveinstancesrequest)
  20729. if err != nil {
  20730. return nil, err
  20731. }
  20732. ctype := "application/json"
  20733. c.urlParams_.Set("alt", alt)
  20734. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances")
  20735. urls += "?" + c.urlParams_.Encode()
  20736. req, _ := http.NewRequest("POST", urls, body)
  20737. googleapi.Expand(req.URL, map[string]string{
  20738. "project": c.project,
  20739. "zone": c.zone,
  20740. "instanceGroup": c.instanceGroup,
  20741. })
  20742. req.Header.Set("Content-Type", ctype)
  20743. req.Header.Set("User-Agent", c.s.userAgent())
  20744. if c.ctx_ != nil {
  20745. return ctxhttp.Do(c.ctx_, c.s.client, req)
  20746. }
  20747. return c.s.client.Do(req)
  20748. }
  20749. // Do executes the "compute.instanceGroups.removeInstances" call.
  20750. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  20751. // status code is an error. Response headers are in either
  20752. // *Operation.ServerResponse.Header or (if a response was returned at
  20753. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  20754. // to check whether the returned error was because
  20755. // http.StatusNotModified was returned.
  20756. func (c *InstanceGroupsRemoveInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  20757. gensupport.SetOptions(c.urlParams_, opts...)
  20758. res, err := c.doRequest("json")
  20759. if res != nil && res.StatusCode == http.StatusNotModified {
  20760. if res.Body != nil {
  20761. res.Body.Close()
  20762. }
  20763. return nil, &googleapi.Error{
  20764. Code: res.StatusCode,
  20765. Header: res.Header,
  20766. }
  20767. }
  20768. if err != nil {
  20769. return nil, err
  20770. }
  20771. defer googleapi.CloseBody(res)
  20772. if err := googleapi.CheckResponse(res); err != nil {
  20773. return nil, err
  20774. }
  20775. ret := &Operation{
  20776. ServerResponse: googleapi.ServerResponse{
  20777. Header: res.Header,
  20778. HTTPStatusCode: res.StatusCode,
  20779. },
  20780. }
  20781. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  20782. return nil, err
  20783. }
  20784. return ret, nil
  20785. // {
  20786. // "description": "Removes one or more instances from the specified instance group, but does not delete those instances.",
  20787. // "httpMethod": "POST",
  20788. // "id": "compute.instanceGroups.removeInstances",
  20789. // "parameterOrder": [
  20790. // "project",
  20791. // "zone",
  20792. // "instanceGroup"
  20793. // ],
  20794. // "parameters": {
  20795. // "instanceGroup": {
  20796. // "description": "The name of the instance group where the specified instances will be removed.",
  20797. // "location": "path",
  20798. // "required": true,
  20799. // "type": "string"
  20800. // },
  20801. // "project": {
  20802. // "description": "Project ID for this request.",
  20803. // "location": "path",
  20804. // "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])?))",
  20805. // "required": true,
  20806. // "type": "string"
  20807. // },
  20808. // "zone": {
  20809. // "description": "The name of the zone where the instance group is located.",
  20810. // "location": "path",
  20811. // "required": true,
  20812. // "type": "string"
  20813. // }
  20814. // },
  20815. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances",
  20816. // "request": {
  20817. // "$ref": "InstanceGroupsRemoveInstancesRequest"
  20818. // },
  20819. // "response": {
  20820. // "$ref": "Operation"
  20821. // },
  20822. // "scopes": [
  20823. // "https://www.googleapis.com/auth/cloud-platform",
  20824. // "https://www.googleapis.com/auth/compute"
  20825. // ]
  20826. // }
  20827. }
  20828. // method id "compute.instanceGroups.setNamedPorts":
  20829. type InstanceGroupsSetNamedPortsCall struct {
  20830. s *Service
  20831. project string
  20832. zone string
  20833. instanceGroup string
  20834. instancegroupssetnamedportsrequest *InstanceGroupsSetNamedPortsRequest
  20835. urlParams_ gensupport.URLParams
  20836. ctx_ context.Context
  20837. }
  20838. // SetNamedPorts: Sets the named ports for the specified instance group.
  20839. func (r *InstanceGroupsService) SetNamedPorts(project string, zone string, instanceGroup string, instancegroupssetnamedportsrequest *InstanceGroupsSetNamedPortsRequest) *InstanceGroupsSetNamedPortsCall {
  20840. c := &InstanceGroupsSetNamedPortsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20841. c.project = project
  20842. c.zone = zone
  20843. c.instanceGroup = instanceGroup
  20844. c.instancegroupssetnamedportsrequest = instancegroupssetnamedportsrequest
  20845. return c
  20846. }
  20847. // Fields allows partial responses to be retrieved. See
  20848. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20849. // for more information.
  20850. func (c *InstanceGroupsSetNamedPortsCall) Fields(s ...googleapi.Field) *InstanceGroupsSetNamedPortsCall {
  20851. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20852. return c
  20853. }
  20854. // Context sets the context to be used in this call's Do method. Any
  20855. // pending HTTP request will be aborted if the provided context is
  20856. // canceled.
  20857. func (c *InstanceGroupsSetNamedPortsCall) Context(ctx context.Context) *InstanceGroupsSetNamedPortsCall {
  20858. c.ctx_ = ctx
  20859. return c
  20860. }
  20861. func (c *InstanceGroupsSetNamedPortsCall) doRequest(alt string) (*http.Response, error) {
  20862. var body io.Reader = nil
  20863. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupssetnamedportsrequest)
  20864. if err != nil {
  20865. return nil, err
  20866. }
  20867. ctype := "application/json"
  20868. c.urlParams_.Set("alt", alt)
  20869. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts")
  20870. urls += "?" + c.urlParams_.Encode()
  20871. req, _ := http.NewRequest("POST", urls, body)
  20872. googleapi.Expand(req.URL, map[string]string{
  20873. "project": c.project,
  20874. "zone": c.zone,
  20875. "instanceGroup": c.instanceGroup,
  20876. })
  20877. req.Header.Set("Content-Type", ctype)
  20878. req.Header.Set("User-Agent", c.s.userAgent())
  20879. if c.ctx_ != nil {
  20880. return ctxhttp.Do(c.ctx_, c.s.client, req)
  20881. }
  20882. return c.s.client.Do(req)
  20883. }
  20884. // Do executes the "compute.instanceGroups.setNamedPorts" call.
  20885. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  20886. // status code is an error. Response headers are in either
  20887. // *Operation.ServerResponse.Header or (if a response was returned at
  20888. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  20889. // to check whether the returned error was because
  20890. // http.StatusNotModified was returned.
  20891. func (c *InstanceGroupsSetNamedPortsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  20892. gensupport.SetOptions(c.urlParams_, opts...)
  20893. res, err := c.doRequest("json")
  20894. if res != nil && res.StatusCode == http.StatusNotModified {
  20895. if res.Body != nil {
  20896. res.Body.Close()
  20897. }
  20898. return nil, &googleapi.Error{
  20899. Code: res.StatusCode,
  20900. Header: res.Header,
  20901. }
  20902. }
  20903. if err != nil {
  20904. return nil, err
  20905. }
  20906. defer googleapi.CloseBody(res)
  20907. if err := googleapi.CheckResponse(res); err != nil {
  20908. return nil, err
  20909. }
  20910. ret := &Operation{
  20911. ServerResponse: googleapi.ServerResponse{
  20912. Header: res.Header,
  20913. HTTPStatusCode: res.StatusCode,
  20914. },
  20915. }
  20916. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  20917. return nil, err
  20918. }
  20919. return ret, nil
  20920. // {
  20921. // "description": "Sets the named ports for the specified instance group.",
  20922. // "httpMethod": "POST",
  20923. // "id": "compute.instanceGroups.setNamedPorts",
  20924. // "parameterOrder": [
  20925. // "project",
  20926. // "zone",
  20927. // "instanceGroup"
  20928. // ],
  20929. // "parameters": {
  20930. // "instanceGroup": {
  20931. // "description": "The name of the instance group where the named ports are updated.",
  20932. // "location": "path",
  20933. // "required": true,
  20934. // "type": "string"
  20935. // },
  20936. // "project": {
  20937. // "description": "Project ID for this request.",
  20938. // "location": "path",
  20939. // "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])?))",
  20940. // "required": true,
  20941. // "type": "string"
  20942. // },
  20943. // "zone": {
  20944. // "description": "The name of the zone where the instance group is located.",
  20945. // "location": "path",
  20946. // "required": true,
  20947. // "type": "string"
  20948. // }
  20949. // },
  20950. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts",
  20951. // "request": {
  20952. // "$ref": "InstanceGroupsSetNamedPortsRequest"
  20953. // },
  20954. // "response": {
  20955. // "$ref": "Operation"
  20956. // },
  20957. // "scopes": [
  20958. // "https://www.googleapis.com/auth/cloud-platform",
  20959. // "https://www.googleapis.com/auth/compute"
  20960. // ]
  20961. // }
  20962. }
  20963. // method id "compute.instanceTemplates.delete":
  20964. type InstanceTemplatesDeleteCall struct {
  20965. s *Service
  20966. project string
  20967. instanceTemplate string
  20968. urlParams_ gensupport.URLParams
  20969. ctx_ context.Context
  20970. }
  20971. // Delete: Deletes the specified instance template.
  20972. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/delete
  20973. func (r *InstanceTemplatesService) Delete(project string, instanceTemplate string) *InstanceTemplatesDeleteCall {
  20974. c := &InstanceTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20975. c.project = project
  20976. c.instanceTemplate = instanceTemplate
  20977. return c
  20978. }
  20979. // Fields allows partial responses to be retrieved. See
  20980. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20981. // for more information.
  20982. func (c *InstanceTemplatesDeleteCall) Fields(s ...googleapi.Field) *InstanceTemplatesDeleteCall {
  20983. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20984. return c
  20985. }
  20986. // Context sets the context to be used in this call's Do method. Any
  20987. // pending HTTP request will be aborted if the provided context is
  20988. // canceled.
  20989. func (c *InstanceTemplatesDeleteCall) Context(ctx context.Context) *InstanceTemplatesDeleteCall {
  20990. c.ctx_ = ctx
  20991. return c
  20992. }
  20993. func (c *InstanceTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  20994. var body io.Reader = nil
  20995. c.urlParams_.Set("alt", alt)
  20996. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{instanceTemplate}")
  20997. urls += "?" + c.urlParams_.Encode()
  20998. req, _ := http.NewRequest("DELETE", urls, body)
  20999. googleapi.Expand(req.URL, map[string]string{
  21000. "project": c.project,
  21001. "instanceTemplate": c.instanceTemplate,
  21002. })
  21003. req.Header.Set("User-Agent", c.s.userAgent())
  21004. if c.ctx_ != nil {
  21005. return ctxhttp.Do(c.ctx_, c.s.client, req)
  21006. }
  21007. return c.s.client.Do(req)
  21008. }
  21009. // Do executes the "compute.instanceTemplates.delete" call.
  21010. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  21011. // status code is an error. Response headers are in either
  21012. // *Operation.ServerResponse.Header or (if a response was returned at
  21013. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  21014. // to check whether the returned error was because
  21015. // http.StatusNotModified was returned.
  21016. func (c *InstanceTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  21017. gensupport.SetOptions(c.urlParams_, opts...)
  21018. res, err := c.doRequest("json")
  21019. if res != nil && res.StatusCode == http.StatusNotModified {
  21020. if res.Body != nil {
  21021. res.Body.Close()
  21022. }
  21023. return nil, &googleapi.Error{
  21024. Code: res.StatusCode,
  21025. Header: res.Header,
  21026. }
  21027. }
  21028. if err != nil {
  21029. return nil, err
  21030. }
  21031. defer googleapi.CloseBody(res)
  21032. if err := googleapi.CheckResponse(res); err != nil {
  21033. return nil, err
  21034. }
  21035. ret := &Operation{
  21036. ServerResponse: googleapi.ServerResponse{
  21037. Header: res.Header,
  21038. HTTPStatusCode: res.StatusCode,
  21039. },
  21040. }
  21041. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  21042. return nil, err
  21043. }
  21044. return ret, nil
  21045. // {
  21046. // "description": "Deletes the specified instance template.",
  21047. // "httpMethod": "DELETE",
  21048. // "id": "compute.instanceTemplates.delete",
  21049. // "parameterOrder": [
  21050. // "project",
  21051. // "instanceTemplate"
  21052. // ],
  21053. // "parameters": {
  21054. // "instanceTemplate": {
  21055. // "description": "The name of the instance template to delete.",
  21056. // "location": "path",
  21057. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  21058. // "required": true,
  21059. // "type": "string"
  21060. // },
  21061. // "project": {
  21062. // "description": "Project ID for this request.",
  21063. // "location": "path",
  21064. // "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])?))",
  21065. // "required": true,
  21066. // "type": "string"
  21067. // }
  21068. // },
  21069. // "path": "{project}/global/instanceTemplates/{instanceTemplate}",
  21070. // "response": {
  21071. // "$ref": "Operation"
  21072. // },
  21073. // "scopes": [
  21074. // "https://www.googleapis.com/auth/cloud-platform",
  21075. // "https://www.googleapis.com/auth/compute"
  21076. // ]
  21077. // }
  21078. }
  21079. // method id "compute.instanceTemplates.get":
  21080. type InstanceTemplatesGetCall struct {
  21081. s *Service
  21082. project string
  21083. instanceTemplate string
  21084. urlParams_ gensupport.URLParams
  21085. ifNoneMatch_ string
  21086. ctx_ context.Context
  21087. }
  21088. // Get: Returns the specified instance template resource.
  21089. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/get
  21090. func (r *InstanceTemplatesService) Get(project string, instanceTemplate string) *InstanceTemplatesGetCall {
  21091. c := &InstanceTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21092. c.project = project
  21093. c.instanceTemplate = instanceTemplate
  21094. return c
  21095. }
  21096. // Fields allows partial responses to be retrieved. See
  21097. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21098. // for more information.
  21099. func (c *InstanceTemplatesGetCall) Fields(s ...googleapi.Field) *InstanceTemplatesGetCall {
  21100. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21101. return c
  21102. }
  21103. // IfNoneMatch sets the optional parameter which makes the operation
  21104. // fail if the object's ETag matches the given value. This is useful for
  21105. // getting updates only after the object has changed since the last
  21106. // request. Use googleapi.IsNotModified to check whether the response
  21107. // error from Do is the result of In-None-Match.
  21108. func (c *InstanceTemplatesGetCall) IfNoneMatch(entityTag string) *InstanceTemplatesGetCall {
  21109. c.ifNoneMatch_ = entityTag
  21110. return c
  21111. }
  21112. // Context sets the context to be used in this call's Do method. Any
  21113. // pending HTTP request will be aborted if the provided context is
  21114. // canceled.
  21115. func (c *InstanceTemplatesGetCall) Context(ctx context.Context) *InstanceTemplatesGetCall {
  21116. c.ctx_ = ctx
  21117. return c
  21118. }
  21119. func (c *InstanceTemplatesGetCall) doRequest(alt string) (*http.Response, error) {
  21120. var body io.Reader = nil
  21121. c.urlParams_.Set("alt", alt)
  21122. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{instanceTemplate}")
  21123. urls += "?" + c.urlParams_.Encode()
  21124. req, _ := http.NewRequest("GET", urls, body)
  21125. googleapi.Expand(req.URL, map[string]string{
  21126. "project": c.project,
  21127. "instanceTemplate": c.instanceTemplate,
  21128. })
  21129. req.Header.Set("User-Agent", c.s.userAgent())
  21130. if c.ifNoneMatch_ != "" {
  21131. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  21132. }
  21133. if c.ctx_ != nil {
  21134. return ctxhttp.Do(c.ctx_, c.s.client, req)
  21135. }
  21136. return c.s.client.Do(req)
  21137. }
  21138. // Do executes the "compute.instanceTemplates.get" call.
  21139. // Exactly one of *InstanceTemplate or error will be non-nil. Any
  21140. // non-2xx status code is an error. Response headers are in either
  21141. // *InstanceTemplate.ServerResponse.Header or (if a response was
  21142. // returned at all) in error.(*googleapi.Error).Header. Use
  21143. // googleapi.IsNotModified to check whether the returned error was
  21144. // because http.StatusNotModified was returned.
  21145. func (c *InstanceTemplatesGetCall) Do(opts ...googleapi.CallOption) (*InstanceTemplate, error) {
  21146. gensupport.SetOptions(c.urlParams_, opts...)
  21147. res, err := c.doRequest("json")
  21148. if res != nil && res.StatusCode == http.StatusNotModified {
  21149. if res.Body != nil {
  21150. res.Body.Close()
  21151. }
  21152. return nil, &googleapi.Error{
  21153. Code: res.StatusCode,
  21154. Header: res.Header,
  21155. }
  21156. }
  21157. if err != nil {
  21158. return nil, err
  21159. }
  21160. defer googleapi.CloseBody(res)
  21161. if err := googleapi.CheckResponse(res); err != nil {
  21162. return nil, err
  21163. }
  21164. ret := &InstanceTemplate{
  21165. ServerResponse: googleapi.ServerResponse{
  21166. Header: res.Header,
  21167. HTTPStatusCode: res.StatusCode,
  21168. },
  21169. }
  21170. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  21171. return nil, err
  21172. }
  21173. return ret, nil
  21174. // {
  21175. // "description": "Returns the specified instance template resource.",
  21176. // "httpMethod": "GET",
  21177. // "id": "compute.instanceTemplates.get",
  21178. // "parameterOrder": [
  21179. // "project",
  21180. // "instanceTemplate"
  21181. // ],
  21182. // "parameters": {
  21183. // "instanceTemplate": {
  21184. // "description": "The name of the instance template.",
  21185. // "location": "path",
  21186. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  21187. // "required": true,
  21188. // "type": "string"
  21189. // },
  21190. // "project": {
  21191. // "description": "Project ID for this request.",
  21192. // "location": "path",
  21193. // "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])?))",
  21194. // "required": true,
  21195. // "type": "string"
  21196. // }
  21197. // },
  21198. // "path": "{project}/global/instanceTemplates/{instanceTemplate}",
  21199. // "response": {
  21200. // "$ref": "InstanceTemplate"
  21201. // },
  21202. // "scopes": [
  21203. // "https://www.googleapis.com/auth/cloud-platform",
  21204. // "https://www.googleapis.com/auth/compute",
  21205. // "https://www.googleapis.com/auth/compute.readonly"
  21206. // ]
  21207. // }
  21208. }
  21209. // method id "compute.instanceTemplates.insert":
  21210. type InstanceTemplatesInsertCall struct {
  21211. s *Service
  21212. project string
  21213. instancetemplate *InstanceTemplate
  21214. urlParams_ gensupport.URLParams
  21215. ctx_ context.Context
  21216. }
  21217. // Insert: Creates an instance template in the specified project using
  21218. // the data that is included in the request. If you are creating a new
  21219. // template to update an existing instance group, your new instance
  21220. // template must use the same network or, if applicable, the same
  21221. // subnetwork as the original template.
  21222. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/insert
  21223. func (r *InstanceTemplatesService) Insert(project string, instancetemplate *InstanceTemplate) *InstanceTemplatesInsertCall {
  21224. c := &InstanceTemplatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21225. c.project = project
  21226. c.instancetemplate = instancetemplate
  21227. return c
  21228. }
  21229. // Fields allows partial responses to be retrieved. See
  21230. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21231. // for more information.
  21232. func (c *InstanceTemplatesInsertCall) Fields(s ...googleapi.Field) *InstanceTemplatesInsertCall {
  21233. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21234. return c
  21235. }
  21236. // Context sets the context to be used in this call's Do method. Any
  21237. // pending HTTP request will be aborted if the provided context is
  21238. // canceled.
  21239. func (c *InstanceTemplatesInsertCall) Context(ctx context.Context) *InstanceTemplatesInsertCall {
  21240. c.ctx_ = ctx
  21241. return c
  21242. }
  21243. func (c *InstanceTemplatesInsertCall) doRequest(alt string) (*http.Response, error) {
  21244. var body io.Reader = nil
  21245. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancetemplate)
  21246. if err != nil {
  21247. return nil, err
  21248. }
  21249. ctype := "application/json"
  21250. c.urlParams_.Set("alt", alt)
  21251. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates")
  21252. urls += "?" + c.urlParams_.Encode()
  21253. req, _ := http.NewRequest("POST", urls, body)
  21254. googleapi.Expand(req.URL, map[string]string{
  21255. "project": c.project,
  21256. })
  21257. req.Header.Set("Content-Type", ctype)
  21258. req.Header.Set("User-Agent", c.s.userAgent())
  21259. if c.ctx_ != nil {
  21260. return ctxhttp.Do(c.ctx_, c.s.client, req)
  21261. }
  21262. return c.s.client.Do(req)
  21263. }
  21264. // Do executes the "compute.instanceTemplates.insert" call.
  21265. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  21266. // status code is an error. Response headers are in either
  21267. // *Operation.ServerResponse.Header or (if a response was returned at
  21268. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  21269. // to check whether the returned error was because
  21270. // http.StatusNotModified was returned.
  21271. func (c *InstanceTemplatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  21272. gensupport.SetOptions(c.urlParams_, opts...)
  21273. res, err := c.doRequest("json")
  21274. if res != nil && res.StatusCode == http.StatusNotModified {
  21275. if res.Body != nil {
  21276. res.Body.Close()
  21277. }
  21278. return nil, &googleapi.Error{
  21279. Code: res.StatusCode,
  21280. Header: res.Header,
  21281. }
  21282. }
  21283. if err != nil {
  21284. return nil, err
  21285. }
  21286. defer googleapi.CloseBody(res)
  21287. if err := googleapi.CheckResponse(res); err != nil {
  21288. return nil, err
  21289. }
  21290. ret := &Operation{
  21291. ServerResponse: googleapi.ServerResponse{
  21292. Header: res.Header,
  21293. HTTPStatusCode: res.StatusCode,
  21294. },
  21295. }
  21296. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  21297. return nil, err
  21298. }
  21299. return ret, nil
  21300. // {
  21301. // "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.",
  21302. // "httpMethod": "POST",
  21303. // "id": "compute.instanceTemplates.insert",
  21304. // "parameterOrder": [
  21305. // "project"
  21306. // ],
  21307. // "parameters": {
  21308. // "project": {
  21309. // "description": "Project ID for this request.",
  21310. // "location": "path",
  21311. // "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])?))",
  21312. // "required": true,
  21313. // "type": "string"
  21314. // }
  21315. // },
  21316. // "path": "{project}/global/instanceTemplates",
  21317. // "request": {
  21318. // "$ref": "InstanceTemplate"
  21319. // },
  21320. // "response": {
  21321. // "$ref": "Operation"
  21322. // },
  21323. // "scopes": [
  21324. // "https://www.googleapis.com/auth/cloud-platform",
  21325. // "https://www.googleapis.com/auth/compute"
  21326. // ]
  21327. // }
  21328. }
  21329. // method id "compute.instanceTemplates.list":
  21330. type InstanceTemplatesListCall struct {
  21331. s *Service
  21332. project string
  21333. urlParams_ gensupport.URLParams
  21334. ifNoneMatch_ string
  21335. ctx_ context.Context
  21336. }
  21337. // List: Retrieves a list of instance templates that are contained
  21338. // within the specified project and zone.
  21339. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/list
  21340. func (r *InstanceTemplatesService) List(project string) *InstanceTemplatesListCall {
  21341. c := &InstanceTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21342. c.project = project
  21343. return c
  21344. }
  21345. // Filter sets the optional parameter "filter": Sets a filter expression
  21346. // for filtering listed resources, in the form filter={expression}. Your
  21347. // {expression} must be in the format: field_name comparison_string
  21348. // literal_string.
  21349. //
  21350. // The field_name is the name of the field you want to compare. Only
  21351. // atomic field types are supported (string, number, boolean). The
  21352. // comparison_string must be either eq (equals) or ne (not equals). The
  21353. // literal_string is the string value to filter to. The literal value
  21354. // must be valid for the type of field you are filtering by (string,
  21355. // number, boolean). For string fields, the literal value is interpreted
  21356. // as a regular expression using RE2 syntax. The literal value must
  21357. // match the entire field.
  21358. //
  21359. // For example, filter=name ne example-instance.
  21360. //
  21361. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  21362. // you can also filter on nested fields. For example, you could filter
  21363. // on instances that have set the scheduling.automaticRestart field to
  21364. // true. In particular, use filtering on nested fields to take advantage
  21365. // of instance labels to organize and filter results based on label
  21366. // values.
  21367. //
  21368. // The Beta API also supports filtering on multiple expressions by
  21369. // providing each separate expression within parentheses. For example,
  21370. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  21371. // Multiple expressions are treated as AND expressions meaning that
  21372. // resources must match all expressions to pass the filters.
  21373. func (c *InstanceTemplatesListCall) Filter(filter string) *InstanceTemplatesListCall {
  21374. c.urlParams_.Set("filter", filter)
  21375. return c
  21376. }
  21377. // MaxResults sets the optional parameter "maxResults": The maximum
  21378. // number of results per page that Compute Engine should return. If the
  21379. // number of available results is larger than maxResults, Compute Engine
  21380. // returns a nextPageToken that can be used to get the next page of
  21381. // results in subsequent list requests.
  21382. func (c *InstanceTemplatesListCall) MaxResults(maxResults int64) *InstanceTemplatesListCall {
  21383. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  21384. return c
  21385. }
  21386. // PageToken sets the optional parameter "pageToken": Specifies a page
  21387. // token to use. Set pageToken to the nextPageToken returned by a
  21388. // previous list request to get the next page of results.
  21389. func (c *InstanceTemplatesListCall) PageToken(pageToken string) *InstanceTemplatesListCall {
  21390. c.urlParams_.Set("pageToken", pageToken)
  21391. return c
  21392. }
  21393. // Fields allows partial responses to be retrieved. See
  21394. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21395. // for more information.
  21396. func (c *InstanceTemplatesListCall) Fields(s ...googleapi.Field) *InstanceTemplatesListCall {
  21397. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21398. return c
  21399. }
  21400. // IfNoneMatch sets the optional parameter which makes the operation
  21401. // fail if the object's ETag matches the given value. This is useful for
  21402. // getting updates only after the object has changed since the last
  21403. // request. Use googleapi.IsNotModified to check whether the response
  21404. // error from Do is the result of In-None-Match.
  21405. func (c *InstanceTemplatesListCall) IfNoneMatch(entityTag string) *InstanceTemplatesListCall {
  21406. c.ifNoneMatch_ = entityTag
  21407. return c
  21408. }
  21409. // Context sets the context to be used in this call's Do method. Any
  21410. // pending HTTP request will be aborted if the provided context is
  21411. // canceled.
  21412. func (c *InstanceTemplatesListCall) Context(ctx context.Context) *InstanceTemplatesListCall {
  21413. c.ctx_ = ctx
  21414. return c
  21415. }
  21416. func (c *InstanceTemplatesListCall) doRequest(alt string) (*http.Response, error) {
  21417. var body io.Reader = nil
  21418. c.urlParams_.Set("alt", alt)
  21419. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates")
  21420. urls += "?" + c.urlParams_.Encode()
  21421. req, _ := http.NewRequest("GET", urls, body)
  21422. googleapi.Expand(req.URL, map[string]string{
  21423. "project": c.project,
  21424. })
  21425. req.Header.Set("User-Agent", c.s.userAgent())
  21426. if c.ifNoneMatch_ != "" {
  21427. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  21428. }
  21429. if c.ctx_ != nil {
  21430. return ctxhttp.Do(c.ctx_, c.s.client, req)
  21431. }
  21432. return c.s.client.Do(req)
  21433. }
  21434. // Do executes the "compute.instanceTemplates.list" call.
  21435. // Exactly one of *InstanceTemplateList or error will be non-nil. Any
  21436. // non-2xx status code is an error. Response headers are in either
  21437. // *InstanceTemplateList.ServerResponse.Header or (if a response was
  21438. // returned at all) in error.(*googleapi.Error).Header. Use
  21439. // googleapi.IsNotModified to check whether the returned error was
  21440. // because http.StatusNotModified was returned.
  21441. func (c *InstanceTemplatesListCall) Do(opts ...googleapi.CallOption) (*InstanceTemplateList, error) {
  21442. gensupport.SetOptions(c.urlParams_, opts...)
  21443. res, err := c.doRequest("json")
  21444. if res != nil && res.StatusCode == http.StatusNotModified {
  21445. if res.Body != nil {
  21446. res.Body.Close()
  21447. }
  21448. return nil, &googleapi.Error{
  21449. Code: res.StatusCode,
  21450. Header: res.Header,
  21451. }
  21452. }
  21453. if err != nil {
  21454. return nil, err
  21455. }
  21456. defer googleapi.CloseBody(res)
  21457. if err := googleapi.CheckResponse(res); err != nil {
  21458. return nil, err
  21459. }
  21460. ret := &InstanceTemplateList{
  21461. ServerResponse: googleapi.ServerResponse{
  21462. Header: res.Header,
  21463. HTTPStatusCode: res.StatusCode,
  21464. },
  21465. }
  21466. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  21467. return nil, err
  21468. }
  21469. return ret, nil
  21470. // {
  21471. // "description": "Retrieves a list of instance templates that are contained within the specified project and zone.",
  21472. // "httpMethod": "GET",
  21473. // "id": "compute.instanceTemplates.list",
  21474. // "parameterOrder": [
  21475. // "project"
  21476. // ],
  21477. // "parameters": {
  21478. // "filter": {
  21479. // "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.",
  21480. // "location": "query",
  21481. // "type": "string"
  21482. // },
  21483. // "maxResults": {
  21484. // "default": "500",
  21485. // "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.",
  21486. // "format": "uint32",
  21487. // "location": "query",
  21488. // "maximum": "500",
  21489. // "minimum": "0",
  21490. // "type": "integer"
  21491. // },
  21492. // "pageToken": {
  21493. // "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.",
  21494. // "location": "query",
  21495. // "type": "string"
  21496. // },
  21497. // "project": {
  21498. // "description": "Project ID for this request.",
  21499. // "location": "path",
  21500. // "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])?))",
  21501. // "required": true,
  21502. // "type": "string"
  21503. // }
  21504. // },
  21505. // "path": "{project}/global/instanceTemplates",
  21506. // "response": {
  21507. // "$ref": "InstanceTemplateList"
  21508. // },
  21509. // "scopes": [
  21510. // "https://www.googleapis.com/auth/cloud-platform",
  21511. // "https://www.googleapis.com/auth/compute",
  21512. // "https://www.googleapis.com/auth/compute.readonly"
  21513. // ]
  21514. // }
  21515. }
  21516. // Pages invokes f for each page of results.
  21517. // A non-nil error returned from f will halt the iteration.
  21518. // The provided context supersedes any context provided to the Context method.
  21519. func (c *InstanceTemplatesListCall) Pages(ctx context.Context, f func(*InstanceTemplateList) error) error {
  21520. c.ctx_ = ctx
  21521. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  21522. for {
  21523. x, err := c.Do()
  21524. if err != nil {
  21525. return err
  21526. }
  21527. if err := f(x); err != nil {
  21528. return err
  21529. }
  21530. if x.NextPageToken == "" {
  21531. return nil
  21532. }
  21533. c.PageToken(x.NextPageToken)
  21534. }
  21535. }
  21536. // method id "compute.instances.addAccessConfig":
  21537. type InstancesAddAccessConfigCall struct {
  21538. s *Service
  21539. project string
  21540. zone string
  21541. instance string
  21542. accessconfig *AccessConfig
  21543. urlParams_ gensupport.URLParams
  21544. ctx_ context.Context
  21545. }
  21546. // AddAccessConfig: Adds an access config to an instance's network
  21547. // interface.
  21548. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/addAccessConfig
  21549. func (r *InstancesService) AddAccessConfig(project string, zone string, instance string, networkInterface string, accessconfig *AccessConfig) *InstancesAddAccessConfigCall {
  21550. c := &InstancesAddAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21551. c.project = project
  21552. c.zone = zone
  21553. c.instance = instance
  21554. c.urlParams_.Set("networkInterface", networkInterface)
  21555. c.accessconfig = accessconfig
  21556. return c
  21557. }
  21558. // Fields allows partial responses to be retrieved. See
  21559. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21560. // for more information.
  21561. func (c *InstancesAddAccessConfigCall) Fields(s ...googleapi.Field) *InstancesAddAccessConfigCall {
  21562. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21563. return c
  21564. }
  21565. // Context sets the context to be used in this call's Do method. Any
  21566. // pending HTTP request will be aborted if the provided context is
  21567. // canceled.
  21568. func (c *InstancesAddAccessConfigCall) Context(ctx context.Context) *InstancesAddAccessConfigCall {
  21569. c.ctx_ = ctx
  21570. return c
  21571. }
  21572. func (c *InstancesAddAccessConfigCall) doRequest(alt string) (*http.Response, error) {
  21573. var body io.Reader = nil
  21574. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessconfig)
  21575. if err != nil {
  21576. return nil, err
  21577. }
  21578. ctype := "application/json"
  21579. c.urlParams_.Set("alt", alt)
  21580. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/addAccessConfig")
  21581. urls += "?" + c.urlParams_.Encode()
  21582. req, _ := http.NewRequest("POST", urls, body)
  21583. googleapi.Expand(req.URL, map[string]string{
  21584. "project": c.project,
  21585. "zone": c.zone,
  21586. "instance": c.instance,
  21587. })
  21588. req.Header.Set("Content-Type", ctype)
  21589. req.Header.Set("User-Agent", c.s.userAgent())
  21590. if c.ctx_ != nil {
  21591. return ctxhttp.Do(c.ctx_, c.s.client, req)
  21592. }
  21593. return c.s.client.Do(req)
  21594. }
  21595. // Do executes the "compute.instances.addAccessConfig" call.
  21596. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  21597. // status code is an error. Response headers are in either
  21598. // *Operation.ServerResponse.Header or (if a response was returned at
  21599. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  21600. // to check whether the returned error was because
  21601. // http.StatusNotModified was returned.
  21602. func (c *InstancesAddAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  21603. gensupport.SetOptions(c.urlParams_, opts...)
  21604. res, err := c.doRequest("json")
  21605. if res != nil && res.StatusCode == http.StatusNotModified {
  21606. if res.Body != nil {
  21607. res.Body.Close()
  21608. }
  21609. return nil, &googleapi.Error{
  21610. Code: res.StatusCode,
  21611. Header: res.Header,
  21612. }
  21613. }
  21614. if err != nil {
  21615. return nil, err
  21616. }
  21617. defer googleapi.CloseBody(res)
  21618. if err := googleapi.CheckResponse(res); err != nil {
  21619. return nil, err
  21620. }
  21621. ret := &Operation{
  21622. ServerResponse: googleapi.ServerResponse{
  21623. Header: res.Header,
  21624. HTTPStatusCode: res.StatusCode,
  21625. },
  21626. }
  21627. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  21628. return nil, err
  21629. }
  21630. return ret, nil
  21631. // {
  21632. // "description": "Adds an access config to an instance's network interface.",
  21633. // "httpMethod": "POST",
  21634. // "id": "compute.instances.addAccessConfig",
  21635. // "parameterOrder": [
  21636. // "project",
  21637. // "zone",
  21638. // "instance",
  21639. // "networkInterface"
  21640. // ],
  21641. // "parameters": {
  21642. // "instance": {
  21643. // "description": "The instance name for this request.",
  21644. // "location": "path",
  21645. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  21646. // "required": true,
  21647. // "type": "string"
  21648. // },
  21649. // "networkInterface": {
  21650. // "description": "The name of the network interface to add to this instance.",
  21651. // "location": "query",
  21652. // "required": true,
  21653. // "type": "string"
  21654. // },
  21655. // "project": {
  21656. // "description": "Project ID for this request.",
  21657. // "location": "path",
  21658. // "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])?))",
  21659. // "required": true,
  21660. // "type": "string"
  21661. // },
  21662. // "zone": {
  21663. // "description": "The name of the zone for this request.",
  21664. // "location": "path",
  21665. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  21666. // "required": true,
  21667. // "type": "string"
  21668. // }
  21669. // },
  21670. // "path": "{project}/zones/{zone}/instances/{instance}/addAccessConfig",
  21671. // "request": {
  21672. // "$ref": "AccessConfig"
  21673. // },
  21674. // "response": {
  21675. // "$ref": "Operation"
  21676. // },
  21677. // "scopes": [
  21678. // "https://www.googleapis.com/auth/cloud-platform",
  21679. // "https://www.googleapis.com/auth/compute"
  21680. // ]
  21681. // }
  21682. }
  21683. // method id "compute.instances.aggregatedList":
  21684. type InstancesAggregatedListCall struct {
  21685. s *Service
  21686. project string
  21687. urlParams_ gensupport.URLParams
  21688. ifNoneMatch_ string
  21689. ctx_ context.Context
  21690. }
  21691. // AggregatedList: Retrieves aggregated list of instance resources.
  21692. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/aggregatedList
  21693. func (r *InstancesService) AggregatedList(project string) *InstancesAggregatedListCall {
  21694. c := &InstancesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21695. c.project = project
  21696. return c
  21697. }
  21698. // Filter sets the optional parameter "filter": Sets a filter expression
  21699. // for filtering listed resources, in the form filter={expression}. Your
  21700. // {expression} must be in the format: field_name comparison_string
  21701. // literal_string.
  21702. //
  21703. // The field_name is the name of the field you want to compare. Only
  21704. // atomic field types are supported (string, number, boolean). The
  21705. // comparison_string must be either eq (equals) or ne (not equals). The
  21706. // literal_string is the string value to filter to. The literal value
  21707. // must be valid for the type of field you are filtering by (string,
  21708. // number, boolean). For string fields, the literal value is interpreted
  21709. // as a regular expression using RE2 syntax. The literal value must
  21710. // match the entire field.
  21711. //
  21712. // For example, filter=name ne example-instance.
  21713. //
  21714. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  21715. // you can also filter on nested fields. For example, you could filter
  21716. // on instances that have set the scheduling.automaticRestart field to
  21717. // true. In particular, use filtering on nested fields to take advantage
  21718. // of instance labels to organize and filter results based on label
  21719. // values.
  21720. //
  21721. // The Beta API also supports filtering on multiple expressions by
  21722. // providing each separate expression within parentheses. For example,
  21723. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  21724. // Multiple expressions are treated as AND expressions meaning that
  21725. // resources must match all expressions to pass the filters.
  21726. func (c *InstancesAggregatedListCall) Filter(filter string) *InstancesAggregatedListCall {
  21727. c.urlParams_.Set("filter", filter)
  21728. return c
  21729. }
  21730. // MaxResults sets the optional parameter "maxResults": The maximum
  21731. // number of results per page that Compute Engine should return. If the
  21732. // number of available results is larger than maxResults, Compute Engine
  21733. // returns a nextPageToken that can be used to get the next page of
  21734. // results in subsequent list requests.
  21735. func (c *InstancesAggregatedListCall) MaxResults(maxResults int64) *InstancesAggregatedListCall {
  21736. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  21737. return c
  21738. }
  21739. // PageToken sets the optional parameter "pageToken": Specifies a page
  21740. // token to use. Set pageToken to the nextPageToken returned by a
  21741. // previous list request to get the next page of results.
  21742. func (c *InstancesAggregatedListCall) PageToken(pageToken string) *InstancesAggregatedListCall {
  21743. c.urlParams_.Set("pageToken", pageToken)
  21744. return c
  21745. }
  21746. // Fields allows partial responses to be retrieved. See
  21747. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21748. // for more information.
  21749. func (c *InstancesAggregatedListCall) Fields(s ...googleapi.Field) *InstancesAggregatedListCall {
  21750. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21751. return c
  21752. }
  21753. // IfNoneMatch sets the optional parameter which makes the operation
  21754. // fail if the object's ETag matches the given value. This is useful for
  21755. // getting updates only after the object has changed since the last
  21756. // request. Use googleapi.IsNotModified to check whether the response
  21757. // error from Do is the result of In-None-Match.
  21758. func (c *InstancesAggregatedListCall) IfNoneMatch(entityTag string) *InstancesAggregatedListCall {
  21759. c.ifNoneMatch_ = entityTag
  21760. return c
  21761. }
  21762. // Context sets the context to be used in this call's Do method. Any
  21763. // pending HTTP request will be aborted if the provided context is
  21764. // canceled.
  21765. func (c *InstancesAggregatedListCall) Context(ctx context.Context) *InstancesAggregatedListCall {
  21766. c.ctx_ = ctx
  21767. return c
  21768. }
  21769. func (c *InstancesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  21770. var body io.Reader = nil
  21771. c.urlParams_.Set("alt", alt)
  21772. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instances")
  21773. urls += "?" + c.urlParams_.Encode()
  21774. req, _ := http.NewRequest("GET", urls, body)
  21775. googleapi.Expand(req.URL, map[string]string{
  21776. "project": c.project,
  21777. })
  21778. req.Header.Set("User-Agent", c.s.userAgent())
  21779. if c.ifNoneMatch_ != "" {
  21780. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  21781. }
  21782. if c.ctx_ != nil {
  21783. return ctxhttp.Do(c.ctx_, c.s.client, req)
  21784. }
  21785. return c.s.client.Do(req)
  21786. }
  21787. // Do executes the "compute.instances.aggregatedList" call.
  21788. // Exactly one of *InstanceAggregatedList or error will be non-nil. Any
  21789. // non-2xx status code is an error. Response headers are in either
  21790. // *InstanceAggregatedList.ServerResponse.Header or (if a response was
  21791. // returned at all) in error.(*googleapi.Error).Header. Use
  21792. // googleapi.IsNotModified to check whether the returned error was
  21793. // because http.StatusNotModified was returned.
  21794. func (c *InstancesAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceAggregatedList, error) {
  21795. gensupport.SetOptions(c.urlParams_, opts...)
  21796. res, err := c.doRequest("json")
  21797. if res != nil && res.StatusCode == http.StatusNotModified {
  21798. if res.Body != nil {
  21799. res.Body.Close()
  21800. }
  21801. return nil, &googleapi.Error{
  21802. Code: res.StatusCode,
  21803. Header: res.Header,
  21804. }
  21805. }
  21806. if err != nil {
  21807. return nil, err
  21808. }
  21809. defer googleapi.CloseBody(res)
  21810. if err := googleapi.CheckResponse(res); err != nil {
  21811. return nil, err
  21812. }
  21813. ret := &InstanceAggregatedList{
  21814. ServerResponse: googleapi.ServerResponse{
  21815. Header: res.Header,
  21816. HTTPStatusCode: res.StatusCode,
  21817. },
  21818. }
  21819. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  21820. return nil, err
  21821. }
  21822. return ret, nil
  21823. // {
  21824. // "description": "Retrieves aggregated list of instance resources.",
  21825. // "httpMethod": "GET",
  21826. // "id": "compute.instances.aggregatedList",
  21827. // "parameterOrder": [
  21828. // "project"
  21829. // ],
  21830. // "parameters": {
  21831. // "filter": {
  21832. // "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.",
  21833. // "location": "query",
  21834. // "type": "string"
  21835. // },
  21836. // "maxResults": {
  21837. // "default": "500",
  21838. // "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.",
  21839. // "format": "uint32",
  21840. // "location": "query",
  21841. // "maximum": "500",
  21842. // "minimum": "0",
  21843. // "type": "integer"
  21844. // },
  21845. // "pageToken": {
  21846. // "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.",
  21847. // "location": "query",
  21848. // "type": "string"
  21849. // },
  21850. // "project": {
  21851. // "description": "Project ID for this request.",
  21852. // "location": "path",
  21853. // "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])?))",
  21854. // "required": true,
  21855. // "type": "string"
  21856. // }
  21857. // },
  21858. // "path": "{project}/aggregated/instances",
  21859. // "response": {
  21860. // "$ref": "InstanceAggregatedList"
  21861. // },
  21862. // "scopes": [
  21863. // "https://www.googleapis.com/auth/cloud-platform",
  21864. // "https://www.googleapis.com/auth/compute",
  21865. // "https://www.googleapis.com/auth/compute.readonly"
  21866. // ]
  21867. // }
  21868. }
  21869. // Pages invokes f for each page of results.
  21870. // A non-nil error returned from f will halt the iteration.
  21871. // The provided context supersedes any context provided to the Context method.
  21872. func (c *InstancesAggregatedListCall) Pages(ctx context.Context, f func(*InstanceAggregatedList) error) error {
  21873. c.ctx_ = ctx
  21874. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  21875. for {
  21876. x, err := c.Do()
  21877. if err != nil {
  21878. return err
  21879. }
  21880. if err := f(x); err != nil {
  21881. return err
  21882. }
  21883. if x.NextPageToken == "" {
  21884. return nil
  21885. }
  21886. c.PageToken(x.NextPageToken)
  21887. }
  21888. }
  21889. // method id "compute.instances.attachDisk":
  21890. type InstancesAttachDiskCall struct {
  21891. s *Service
  21892. project string
  21893. zone string
  21894. instance string
  21895. attacheddisk *AttachedDisk
  21896. urlParams_ gensupport.URLParams
  21897. ctx_ context.Context
  21898. }
  21899. // AttachDisk: Attaches a Disk resource to an instance.
  21900. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/attachDisk
  21901. func (r *InstancesService) AttachDisk(project string, zone string, instance string, attacheddisk *AttachedDisk) *InstancesAttachDiskCall {
  21902. c := &InstancesAttachDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21903. c.project = project
  21904. c.zone = zone
  21905. c.instance = instance
  21906. c.attacheddisk = attacheddisk
  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 *InstancesAttachDiskCall) Fields(s ...googleapi.Field) *InstancesAttachDiskCall {
  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 *InstancesAttachDiskCall) Context(ctx context.Context) *InstancesAttachDiskCall {
  21920. c.ctx_ = ctx
  21921. return c
  21922. }
  21923. func (c *InstancesAttachDiskCall) doRequest(alt string) (*http.Response, error) {
  21924. var body io.Reader = nil
  21925. body, err := googleapi.WithoutDataWrapper.JSONReader(c.attacheddisk)
  21926. if err != nil {
  21927. return nil, err
  21928. }
  21929. ctype := "application/json"
  21930. c.urlParams_.Set("alt", alt)
  21931. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/attachDisk")
  21932. urls += "?" + c.urlParams_.Encode()
  21933. req, _ := http.NewRequest("POST", urls, body)
  21934. googleapi.Expand(req.URL, map[string]string{
  21935. "project": c.project,
  21936. "zone": c.zone,
  21937. "instance": c.instance,
  21938. })
  21939. req.Header.Set("Content-Type", ctype)
  21940. req.Header.Set("User-Agent", c.s.userAgent())
  21941. if c.ctx_ != nil {
  21942. return ctxhttp.Do(c.ctx_, c.s.client, req)
  21943. }
  21944. return c.s.client.Do(req)
  21945. }
  21946. // Do executes the "compute.instances.attachDisk" call.
  21947. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  21948. // status code is an error. Response headers are in either
  21949. // *Operation.ServerResponse.Header or (if a response was returned at
  21950. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  21951. // to check whether the returned error was because
  21952. // http.StatusNotModified was returned.
  21953. func (c *InstancesAttachDiskCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  21954. gensupport.SetOptions(c.urlParams_, opts...)
  21955. res, err := c.doRequest("json")
  21956. if res != nil && res.StatusCode == http.StatusNotModified {
  21957. if res.Body != nil {
  21958. res.Body.Close()
  21959. }
  21960. return nil, &googleapi.Error{
  21961. Code: res.StatusCode,
  21962. Header: res.Header,
  21963. }
  21964. }
  21965. if err != nil {
  21966. return nil, err
  21967. }
  21968. defer googleapi.CloseBody(res)
  21969. if err := googleapi.CheckResponse(res); err != nil {
  21970. return nil, err
  21971. }
  21972. ret := &Operation{
  21973. ServerResponse: googleapi.ServerResponse{
  21974. Header: res.Header,
  21975. HTTPStatusCode: res.StatusCode,
  21976. },
  21977. }
  21978. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  21979. return nil, err
  21980. }
  21981. return ret, nil
  21982. // {
  21983. // "description": "Attaches a Disk resource to an instance.",
  21984. // "httpMethod": "POST",
  21985. // "id": "compute.instances.attachDisk",
  21986. // "parameterOrder": [
  21987. // "project",
  21988. // "zone",
  21989. // "instance"
  21990. // ],
  21991. // "parameters": {
  21992. // "instance": {
  21993. // "description": "Instance name.",
  21994. // "location": "path",
  21995. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  21996. // "required": true,
  21997. // "type": "string"
  21998. // },
  21999. // "project": {
  22000. // "description": "Project ID for this request.",
  22001. // "location": "path",
  22002. // "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])?))",
  22003. // "required": true,
  22004. // "type": "string"
  22005. // },
  22006. // "zone": {
  22007. // "description": "The name of the zone for this request.",
  22008. // "location": "path",
  22009. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  22010. // "required": true,
  22011. // "type": "string"
  22012. // }
  22013. // },
  22014. // "path": "{project}/zones/{zone}/instances/{instance}/attachDisk",
  22015. // "request": {
  22016. // "$ref": "AttachedDisk"
  22017. // },
  22018. // "response": {
  22019. // "$ref": "Operation"
  22020. // },
  22021. // "scopes": [
  22022. // "https://www.googleapis.com/auth/cloud-platform",
  22023. // "https://www.googleapis.com/auth/compute"
  22024. // ]
  22025. // }
  22026. }
  22027. // method id "compute.instances.delete":
  22028. type InstancesDeleteCall struct {
  22029. s *Service
  22030. project string
  22031. zone string
  22032. instance string
  22033. urlParams_ gensupport.URLParams
  22034. ctx_ context.Context
  22035. }
  22036. // Delete: Deletes the specified Instance resource. For more
  22037. // information, see Stopping or Deleting an Instance.
  22038. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/delete
  22039. func (r *InstancesService) Delete(project string, zone string, instance string) *InstancesDeleteCall {
  22040. c := &InstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22041. c.project = project
  22042. c.zone = zone
  22043. c.instance = instance
  22044. return c
  22045. }
  22046. // Fields allows partial responses to be retrieved. See
  22047. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22048. // for more information.
  22049. func (c *InstancesDeleteCall) Fields(s ...googleapi.Field) *InstancesDeleteCall {
  22050. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22051. return c
  22052. }
  22053. // Context sets the context to be used in this call's Do method. Any
  22054. // pending HTTP request will be aborted if the provided context is
  22055. // canceled.
  22056. func (c *InstancesDeleteCall) Context(ctx context.Context) *InstancesDeleteCall {
  22057. c.ctx_ = ctx
  22058. return c
  22059. }
  22060. func (c *InstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
  22061. var body io.Reader = nil
  22062. c.urlParams_.Set("alt", alt)
  22063. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}")
  22064. urls += "?" + c.urlParams_.Encode()
  22065. req, _ := http.NewRequest("DELETE", urls, body)
  22066. googleapi.Expand(req.URL, map[string]string{
  22067. "project": c.project,
  22068. "zone": c.zone,
  22069. "instance": c.instance,
  22070. })
  22071. req.Header.Set("User-Agent", c.s.userAgent())
  22072. if c.ctx_ != nil {
  22073. return ctxhttp.Do(c.ctx_, c.s.client, req)
  22074. }
  22075. return c.s.client.Do(req)
  22076. }
  22077. // Do executes the "compute.instances.delete" call.
  22078. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  22079. // status code is an error. Response headers are in either
  22080. // *Operation.ServerResponse.Header or (if a response was returned at
  22081. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  22082. // to check whether the returned error was because
  22083. // http.StatusNotModified was returned.
  22084. func (c *InstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  22085. gensupport.SetOptions(c.urlParams_, opts...)
  22086. res, err := c.doRequest("json")
  22087. if res != nil && res.StatusCode == http.StatusNotModified {
  22088. if res.Body != nil {
  22089. res.Body.Close()
  22090. }
  22091. return nil, &googleapi.Error{
  22092. Code: res.StatusCode,
  22093. Header: res.Header,
  22094. }
  22095. }
  22096. if err != nil {
  22097. return nil, err
  22098. }
  22099. defer googleapi.CloseBody(res)
  22100. if err := googleapi.CheckResponse(res); err != nil {
  22101. return nil, err
  22102. }
  22103. ret := &Operation{
  22104. ServerResponse: googleapi.ServerResponse{
  22105. Header: res.Header,
  22106. HTTPStatusCode: res.StatusCode,
  22107. },
  22108. }
  22109. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  22110. return nil, err
  22111. }
  22112. return ret, nil
  22113. // {
  22114. // "description": "Deletes the specified Instance resource. For more information, see Stopping or Deleting an Instance.",
  22115. // "httpMethod": "DELETE",
  22116. // "id": "compute.instances.delete",
  22117. // "parameterOrder": [
  22118. // "project",
  22119. // "zone",
  22120. // "instance"
  22121. // ],
  22122. // "parameters": {
  22123. // "instance": {
  22124. // "description": "Name of the instance resource to delete.",
  22125. // "location": "path",
  22126. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  22127. // "required": true,
  22128. // "type": "string"
  22129. // },
  22130. // "project": {
  22131. // "description": "Project ID for this request.",
  22132. // "location": "path",
  22133. // "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])?))",
  22134. // "required": true,
  22135. // "type": "string"
  22136. // },
  22137. // "zone": {
  22138. // "description": "The name of the zone for this request.",
  22139. // "location": "path",
  22140. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  22141. // "required": true,
  22142. // "type": "string"
  22143. // }
  22144. // },
  22145. // "path": "{project}/zones/{zone}/instances/{instance}",
  22146. // "response": {
  22147. // "$ref": "Operation"
  22148. // },
  22149. // "scopes": [
  22150. // "https://www.googleapis.com/auth/cloud-platform",
  22151. // "https://www.googleapis.com/auth/compute"
  22152. // ]
  22153. // }
  22154. }
  22155. // method id "compute.instances.deleteAccessConfig":
  22156. type InstancesDeleteAccessConfigCall struct {
  22157. s *Service
  22158. project string
  22159. zone string
  22160. instance string
  22161. urlParams_ gensupport.URLParams
  22162. ctx_ context.Context
  22163. }
  22164. // DeleteAccessConfig: Deletes an access config from an instance's
  22165. // network interface.
  22166. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/deleteAccessConfig
  22167. func (r *InstancesService) DeleteAccessConfig(project string, zone string, instance string, accessConfig string, networkInterface string) *InstancesDeleteAccessConfigCall {
  22168. c := &InstancesDeleteAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22169. c.project = project
  22170. c.zone = zone
  22171. c.instance = instance
  22172. c.urlParams_.Set("accessConfig", accessConfig)
  22173. c.urlParams_.Set("networkInterface", networkInterface)
  22174. return c
  22175. }
  22176. // Fields allows partial responses to be retrieved. See
  22177. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22178. // for more information.
  22179. func (c *InstancesDeleteAccessConfigCall) Fields(s ...googleapi.Field) *InstancesDeleteAccessConfigCall {
  22180. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22181. return c
  22182. }
  22183. // Context sets the context to be used in this call's Do method. Any
  22184. // pending HTTP request will be aborted if the provided context is
  22185. // canceled.
  22186. func (c *InstancesDeleteAccessConfigCall) Context(ctx context.Context) *InstancesDeleteAccessConfigCall {
  22187. c.ctx_ = ctx
  22188. return c
  22189. }
  22190. func (c *InstancesDeleteAccessConfigCall) doRequest(alt string) (*http.Response, error) {
  22191. var body io.Reader = nil
  22192. c.urlParams_.Set("alt", alt)
  22193. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/deleteAccessConfig")
  22194. urls += "?" + c.urlParams_.Encode()
  22195. req, _ := http.NewRequest("POST", urls, body)
  22196. googleapi.Expand(req.URL, map[string]string{
  22197. "project": c.project,
  22198. "zone": c.zone,
  22199. "instance": c.instance,
  22200. })
  22201. req.Header.Set("User-Agent", c.s.userAgent())
  22202. if c.ctx_ != nil {
  22203. return ctxhttp.Do(c.ctx_, c.s.client, req)
  22204. }
  22205. return c.s.client.Do(req)
  22206. }
  22207. // Do executes the "compute.instances.deleteAccessConfig" call.
  22208. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  22209. // status code is an error. Response headers are in either
  22210. // *Operation.ServerResponse.Header or (if a response was returned at
  22211. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  22212. // to check whether the returned error was because
  22213. // http.StatusNotModified was returned.
  22214. func (c *InstancesDeleteAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  22215. gensupport.SetOptions(c.urlParams_, opts...)
  22216. res, err := c.doRequest("json")
  22217. if res != nil && res.StatusCode == http.StatusNotModified {
  22218. if res.Body != nil {
  22219. res.Body.Close()
  22220. }
  22221. return nil, &googleapi.Error{
  22222. Code: res.StatusCode,
  22223. Header: res.Header,
  22224. }
  22225. }
  22226. if err != nil {
  22227. return nil, err
  22228. }
  22229. defer googleapi.CloseBody(res)
  22230. if err := googleapi.CheckResponse(res); err != nil {
  22231. return nil, err
  22232. }
  22233. ret := &Operation{
  22234. ServerResponse: googleapi.ServerResponse{
  22235. Header: res.Header,
  22236. HTTPStatusCode: res.StatusCode,
  22237. },
  22238. }
  22239. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  22240. return nil, err
  22241. }
  22242. return ret, nil
  22243. // {
  22244. // "description": "Deletes an access config from an instance's network interface.",
  22245. // "httpMethod": "POST",
  22246. // "id": "compute.instances.deleteAccessConfig",
  22247. // "parameterOrder": [
  22248. // "project",
  22249. // "zone",
  22250. // "instance",
  22251. // "accessConfig",
  22252. // "networkInterface"
  22253. // ],
  22254. // "parameters": {
  22255. // "accessConfig": {
  22256. // "description": "The name of the access config to delete.",
  22257. // "location": "query",
  22258. // "required": true,
  22259. // "type": "string"
  22260. // },
  22261. // "instance": {
  22262. // "description": "The instance name for this request.",
  22263. // "location": "path",
  22264. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  22265. // "required": true,
  22266. // "type": "string"
  22267. // },
  22268. // "networkInterface": {
  22269. // "description": "The name of the network interface.",
  22270. // "location": "query",
  22271. // "required": true,
  22272. // "type": "string"
  22273. // },
  22274. // "project": {
  22275. // "description": "Project ID for this request.",
  22276. // "location": "path",
  22277. // "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])?))",
  22278. // "required": true,
  22279. // "type": "string"
  22280. // },
  22281. // "zone": {
  22282. // "description": "The name of the zone for this request.",
  22283. // "location": "path",
  22284. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  22285. // "required": true,
  22286. // "type": "string"
  22287. // }
  22288. // },
  22289. // "path": "{project}/zones/{zone}/instances/{instance}/deleteAccessConfig",
  22290. // "response": {
  22291. // "$ref": "Operation"
  22292. // },
  22293. // "scopes": [
  22294. // "https://www.googleapis.com/auth/cloud-platform",
  22295. // "https://www.googleapis.com/auth/compute"
  22296. // ]
  22297. // }
  22298. }
  22299. // method id "compute.instances.detachDisk":
  22300. type InstancesDetachDiskCall struct {
  22301. s *Service
  22302. project string
  22303. zone string
  22304. instance string
  22305. urlParams_ gensupport.URLParams
  22306. ctx_ context.Context
  22307. }
  22308. // DetachDisk: Detaches a disk from an instance.
  22309. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/detachDisk
  22310. func (r *InstancesService) DetachDisk(project string, zone string, instance string, deviceName string) *InstancesDetachDiskCall {
  22311. c := &InstancesDetachDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22312. c.project = project
  22313. c.zone = zone
  22314. c.instance = instance
  22315. c.urlParams_.Set("deviceName", deviceName)
  22316. return c
  22317. }
  22318. // Fields allows partial responses to be retrieved. See
  22319. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22320. // for more information.
  22321. func (c *InstancesDetachDiskCall) Fields(s ...googleapi.Field) *InstancesDetachDiskCall {
  22322. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22323. return c
  22324. }
  22325. // Context sets the context to be used in this call's Do method. Any
  22326. // pending HTTP request will be aborted if the provided context is
  22327. // canceled.
  22328. func (c *InstancesDetachDiskCall) Context(ctx context.Context) *InstancesDetachDiskCall {
  22329. c.ctx_ = ctx
  22330. return c
  22331. }
  22332. func (c *InstancesDetachDiskCall) doRequest(alt string) (*http.Response, error) {
  22333. var body io.Reader = nil
  22334. c.urlParams_.Set("alt", alt)
  22335. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/detachDisk")
  22336. urls += "?" + c.urlParams_.Encode()
  22337. req, _ := http.NewRequest("POST", urls, body)
  22338. googleapi.Expand(req.URL, map[string]string{
  22339. "project": c.project,
  22340. "zone": c.zone,
  22341. "instance": c.instance,
  22342. })
  22343. req.Header.Set("User-Agent", c.s.userAgent())
  22344. if c.ctx_ != nil {
  22345. return ctxhttp.Do(c.ctx_, c.s.client, req)
  22346. }
  22347. return c.s.client.Do(req)
  22348. }
  22349. // Do executes the "compute.instances.detachDisk" call.
  22350. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  22351. // status code is an error. Response headers are in either
  22352. // *Operation.ServerResponse.Header or (if a response was returned at
  22353. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  22354. // to check whether the returned error was because
  22355. // http.StatusNotModified was returned.
  22356. func (c *InstancesDetachDiskCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  22357. gensupport.SetOptions(c.urlParams_, opts...)
  22358. res, err := c.doRequest("json")
  22359. if res != nil && res.StatusCode == http.StatusNotModified {
  22360. if res.Body != nil {
  22361. res.Body.Close()
  22362. }
  22363. return nil, &googleapi.Error{
  22364. Code: res.StatusCode,
  22365. Header: res.Header,
  22366. }
  22367. }
  22368. if err != nil {
  22369. return nil, err
  22370. }
  22371. defer googleapi.CloseBody(res)
  22372. if err := googleapi.CheckResponse(res); err != nil {
  22373. return nil, err
  22374. }
  22375. ret := &Operation{
  22376. ServerResponse: googleapi.ServerResponse{
  22377. Header: res.Header,
  22378. HTTPStatusCode: res.StatusCode,
  22379. },
  22380. }
  22381. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  22382. return nil, err
  22383. }
  22384. return ret, nil
  22385. // {
  22386. // "description": "Detaches a disk from an instance.",
  22387. // "httpMethod": "POST",
  22388. // "id": "compute.instances.detachDisk",
  22389. // "parameterOrder": [
  22390. // "project",
  22391. // "zone",
  22392. // "instance",
  22393. // "deviceName"
  22394. // ],
  22395. // "parameters": {
  22396. // "deviceName": {
  22397. // "description": "Disk device name to detach.",
  22398. // "location": "query",
  22399. // "pattern": "\\w[\\w.-]{0,254}",
  22400. // "required": true,
  22401. // "type": "string"
  22402. // },
  22403. // "instance": {
  22404. // "description": "Instance name.",
  22405. // "location": "path",
  22406. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  22407. // "required": true,
  22408. // "type": "string"
  22409. // },
  22410. // "project": {
  22411. // "description": "Project ID for this request.",
  22412. // "location": "path",
  22413. // "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])?))",
  22414. // "required": true,
  22415. // "type": "string"
  22416. // },
  22417. // "zone": {
  22418. // "description": "The name of the zone for this request.",
  22419. // "location": "path",
  22420. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  22421. // "required": true,
  22422. // "type": "string"
  22423. // }
  22424. // },
  22425. // "path": "{project}/zones/{zone}/instances/{instance}/detachDisk",
  22426. // "response": {
  22427. // "$ref": "Operation"
  22428. // },
  22429. // "scopes": [
  22430. // "https://www.googleapis.com/auth/cloud-platform",
  22431. // "https://www.googleapis.com/auth/compute"
  22432. // ]
  22433. // }
  22434. }
  22435. // method id "compute.instances.get":
  22436. type InstancesGetCall struct {
  22437. s *Service
  22438. project string
  22439. zone string
  22440. instance string
  22441. urlParams_ gensupport.URLParams
  22442. ifNoneMatch_ string
  22443. ctx_ context.Context
  22444. }
  22445. // Get: Returns the specified instance resource.
  22446. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/get
  22447. func (r *InstancesService) Get(project string, zone string, instance string) *InstancesGetCall {
  22448. c := &InstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22449. c.project = project
  22450. c.zone = zone
  22451. c.instance = instance
  22452. return c
  22453. }
  22454. // Fields allows partial responses to be retrieved. See
  22455. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22456. // for more information.
  22457. func (c *InstancesGetCall) Fields(s ...googleapi.Field) *InstancesGetCall {
  22458. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22459. return c
  22460. }
  22461. // IfNoneMatch sets the optional parameter which makes the operation
  22462. // fail if the object's ETag matches the given value. This is useful for
  22463. // getting updates only after the object has changed since the last
  22464. // request. Use googleapi.IsNotModified to check whether the response
  22465. // error from Do is the result of In-None-Match.
  22466. func (c *InstancesGetCall) IfNoneMatch(entityTag string) *InstancesGetCall {
  22467. c.ifNoneMatch_ = entityTag
  22468. return c
  22469. }
  22470. // Context sets the context to be used in this call's Do method. Any
  22471. // pending HTTP request will be aborted if the provided context is
  22472. // canceled.
  22473. func (c *InstancesGetCall) Context(ctx context.Context) *InstancesGetCall {
  22474. c.ctx_ = ctx
  22475. return c
  22476. }
  22477. func (c *InstancesGetCall) doRequest(alt string) (*http.Response, error) {
  22478. var body io.Reader = nil
  22479. c.urlParams_.Set("alt", alt)
  22480. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}")
  22481. urls += "?" + c.urlParams_.Encode()
  22482. req, _ := http.NewRequest("GET", urls, body)
  22483. googleapi.Expand(req.URL, map[string]string{
  22484. "project": c.project,
  22485. "zone": c.zone,
  22486. "instance": c.instance,
  22487. })
  22488. req.Header.Set("User-Agent", c.s.userAgent())
  22489. if c.ifNoneMatch_ != "" {
  22490. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  22491. }
  22492. if c.ctx_ != nil {
  22493. return ctxhttp.Do(c.ctx_, c.s.client, req)
  22494. }
  22495. return c.s.client.Do(req)
  22496. }
  22497. // Do executes the "compute.instances.get" call.
  22498. // Exactly one of *Instance or error will be non-nil. Any non-2xx status
  22499. // code is an error. Response headers are in either
  22500. // *Instance.ServerResponse.Header or (if a response was returned at
  22501. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  22502. // to check whether the returned error was because
  22503. // http.StatusNotModified was returned.
  22504. func (c *InstancesGetCall) Do(opts ...googleapi.CallOption) (*Instance, error) {
  22505. gensupport.SetOptions(c.urlParams_, opts...)
  22506. res, err := c.doRequest("json")
  22507. if res != nil && res.StatusCode == http.StatusNotModified {
  22508. if res.Body != nil {
  22509. res.Body.Close()
  22510. }
  22511. return nil, &googleapi.Error{
  22512. Code: res.StatusCode,
  22513. Header: res.Header,
  22514. }
  22515. }
  22516. if err != nil {
  22517. return nil, err
  22518. }
  22519. defer googleapi.CloseBody(res)
  22520. if err := googleapi.CheckResponse(res); err != nil {
  22521. return nil, err
  22522. }
  22523. ret := &Instance{
  22524. ServerResponse: googleapi.ServerResponse{
  22525. Header: res.Header,
  22526. HTTPStatusCode: res.StatusCode,
  22527. },
  22528. }
  22529. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  22530. return nil, err
  22531. }
  22532. return ret, nil
  22533. // {
  22534. // "description": "Returns the specified instance resource.",
  22535. // "httpMethod": "GET",
  22536. // "id": "compute.instances.get",
  22537. // "parameterOrder": [
  22538. // "project",
  22539. // "zone",
  22540. // "instance"
  22541. // ],
  22542. // "parameters": {
  22543. // "instance": {
  22544. // "description": "Name of the instance resource to return.",
  22545. // "location": "path",
  22546. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  22547. // "required": true,
  22548. // "type": "string"
  22549. // },
  22550. // "project": {
  22551. // "description": "Project ID for this request.",
  22552. // "location": "path",
  22553. // "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])?))",
  22554. // "required": true,
  22555. // "type": "string"
  22556. // },
  22557. // "zone": {
  22558. // "description": "The name of the zone for this request.",
  22559. // "location": "path",
  22560. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  22561. // "required": true,
  22562. // "type": "string"
  22563. // }
  22564. // },
  22565. // "path": "{project}/zones/{zone}/instances/{instance}",
  22566. // "response": {
  22567. // "$ref": "Instance"
  22568. // },
  22569. // "scopes": [
  22570. // "https://www.googleapis.com/auth/cloud-platform",
  22571. // "https://www.googleapis.com/auth/compute",
  22572. // "https://www.googleapis.com/auth/compute.readonly"
  22573. // ]
  22574. // }
  22575. }
  22576. // method id "compute.instances.getSerialPortOutput":
  22577. type InstancesGetSerialPortOutputCall struct {
  22578. s *Service
  22579. project string
  22580. zone string
  22581. instance string
  22582. urlParams_ gensupport.URLParams
  22583. ifNoneMatch_ string
  22584. ctx_ context.Context
  22585. }
  22586. // GetSerialPortOutput: Returns the specified instance's serial port
  22587. // output.
  22588. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/getSerialPortOutput
  22589. func (r *InstancesService) GetSerialPortOutput(project string, zone string, instance string) *InstancesGetSerialPortOutputCall {
  22590. c := &InstancesGetSerialPortOutputCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22591. c.project = project
  22592. c.zone = zone
  22593. c.instance = instance
  22594. return c
  22595. }
  22596. // Port sets the optional parameter "port": Specifies which COM or
  22597. // serial port to retrieve data from.
  22598. func (c *InstancesGetSerialPortOutputCall) Port(port int64) *InstancesGetSerialPortOutputCall {
  22599. c.urlParams_.Set("port", fmt.Sprint(port))
  22600. return c
  22601. }
  22602. // Fields allows partial responses to be retrieved. See
  22603. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22604. // for more information.
  22605. func (c *InstancesGetSerialPortOutputCall) Fields(s ...googleapi.Field) *InstancesGetSerialPortOutputCall {
  22606. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22607. return c
  22608. }
  22609. // IfNoneMatch sets the optional parameter which makes the operation
  22610. // fail if the object's ETag matches the given value. This is useful for
  22611. // getting updates only after the object has changed since the last
  22612. // request. Use googleapi.IsNotModified to check whether the response
  22613. // error from Do is the result of In-None-Match.
  22614. func (c *InstancesGetSerialPortOutputCall) IfNoneMatch(entityTag string) *InstancesGetSerialPortOutputCall {
  22615. c.ifNoneMatch_ = entityTag
  22616. return c
  22617. }
  22618. // Context sets the context to be used in this call's Do method. Any
  22619. // pending HTTP request will be aborted if the provided context is
  22620. // canceled.
  22621. func (c *InstancesGetSerialPortOutputCall) Context(ctx context.Context) *InstancesGetSerialPortOutputCall {
  22622. c.ctx_ = ctx
  22623. return c
  22624. }
  22625. func (c *InstancesGetSerialPortOutputCall) doRequest(alt string) (*http.Response, error) {
  22626. var body io.Reader = nil
  22627. c.urlParams_.Set("alt", alt)
  22628. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/serialPort")
  22629. urls += "?" + c.urlParams_.Encode()
  22630. req, _ := http.NewRequest("GET", urls, body)
  22631. googleapi.Expand(req.URL, map[string]string{
  22632. "project": c.project,
  22633. "zone": c.zone,
  22634. "instance": c.instance,
  22635. })
  22636. req.Header.Set("User-Agent", c.s.userAgent())
  22637. if c.ifNoneMatch_ != "" {
  22638. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  22639. }
  22640. if c.ctx_ != nil {
  22641. return ctxhttp.Do(c.ctx_, c.s.client, req)
  22642. }
  22643. return c.s.client.Do(req)
  22644. }
  22645. // Do executes the "compute.instances.getSerialPortOutput" call.
  22646. // Exactly one of *SerialPortOutput or error will be non-nil. Any
  22647. // non-2xx status code is an error. Response headers are in either
  22648. // *SerialPortOutput.ServerResponse.Header or (if a response was
  22649. // returned at all) in error.(*googleapi.Error).Header. Use
  22650. // googleapi.IsNotModified to check whether the returned error was
  22651. // because http.StatusNotModified was returned.
  22652. func (c *InstancesGetSerialPortOutputCall) Do(opts ...googleapi.CallOption) (*SerialPortOutput, error) {
  22653. gensupport.SetOptions(c.urlParams_, opts...)
  22654. res, err := c.doRequest("json")
  22655. if res != nil && res.StatusCode == http.StatusNotModified {
  22656. if res.Body != nil {
  22657. res.Body.Close()
  22658. }
  22659. return nil, &googleapi.Error{
  22660. Code: res.StatusCode,
  22661. Header: res.Header,
  22662. }
  22663. }
  22664. if err != nil {
  22665. return nil, err
  22666. }
  22667. defer googleapi.CloseBody(res)
  22668. if err := googleapi.CheckResponse(res); err != nil {
  22669. return nil, err
  22670. }
  22671. ret := &SerialPortOutput{
  22672. ServerResponse: googleapi.ServerResponse{
  22673. Header: res.Header,
  22674. HTTPStatusCode: res.StatusCode,
  22675. },
  22676. }
  22677. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  22678. return nil, err
  22679. }
  22680. return ret, nil
  22681. // {
  22682. // "description": "Returns the specified instance's serial port output.",
  22683. // "httpMethod": "GET",
  22684. // "id": "compute.instances.getSerialPortOutput",
  22685. // "parameterOrder": [
  22686. // "project",
  22687. // "zone",
  22688. // "instance"
  22689. // ],
  22690. // "parameters": {
  22691. // "instance": {
  22692. // "description": "Name of the instance scoping this request.",
  22693. // "location": "path",
  22694. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  22695. // "required": true,
  22696. // "type": "string"
  22697. // },
  22698. // "port": {
  22699. // "default": "1",
  22700. // "description": "Specifies which COM or serial port to retrieve data from.",
  22701. // "format": "int32",
  22702. // "location": "query",
  22703. // "maximum": "4",
  22704. // "minimum": "1",
  22705. // "type": "integer"
  22706. // },
  22707. // "project": {
  22708. // "description": "Project ID for this request.",
  22709. // "location": "path",
  22710. // "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])?))",
  22711. // "required": true,
  22712. // "type": "string"
  22713. // },
  22714. // "zone": {
  22715. // "description": "The name of the zone for this request.",
  22716. // "location": "path",
  22717. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  22718. // "required": true,
  22719. // "type": "string"
  22720. // }
  22721. // },
  22722. // "path": "{project}/zones/{zone}/instances/{instance}/serialPort",
  22723. // "response": {
  22724. // "$ref": "SerialPortOutput"
  22725. // },
  22726. // "scopes": [
  22727. // "https://www.googleapis.com/auth/cloud-platform",
  22728. // "https://www.googleapis.com/auth/compute",
  22729. // "https://www.googleapis.com/auth/compute.readonly"
  22730. // ]
  22731. // }
  22732. }
  22733. // method id "compute.instances.insert":
  22734. type InstancesInsertCall struct {
  22735. s *Service
  22736. project string
  22737. zone string
  22738. instance *Instance
  22739. urlParams_ gensupport.URLParams
  22740. ctx_ context.Context
  22741. }
  22742. // Insert: Creates an instance resource in the specified project using
  22743. // the data included in the request.
  22744. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/insert
  22745. func (r *InstancesService) Insert(project string, zone string, instance *Instance) *InstancesInsertCall {
  22746. c := &InstancesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22747. c.project = project
  22748. c.zone = zone
  22749. c.instance = instance
  22750. return c
  22751. }
  22752. // Fields allows partial responses to be retrieved. See
  22753. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22754. // for more information.
  22755. func (c *InstancesInsertCall) Fields(s ...googleapi.Field) *InstancesInsertCall {
  22756. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22757. return c
  22758. }
  22759. // Context sets the context to be used in this call's Do method. Any
  22760. // pending HTTP request will be aborted if the provided context is
  22761. // canceled.
  22762. func (c *InstancesInsertCall) Context(ctx context.Context) *InstancesInsertCall {
  22763. c.ctx_ = ctx
  22764. return c
  22765. }
  22766. func (c *InstancesInsertCall) doRequest(alt string) (*http.Response, error) {
  22767. var body io.Reader = nil
  22768. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance)
  22769. if err != nil {
  22770. return nil, err
  22771. }
  22772. ctype := "application/json"
  22773. c.urlParams_.Set("alt", alt)
  22774. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances")
  22775. urls += "?" + c.urlParams_.Encode()
  22776. req, _ := http.NewRequest("POST", urls, body)
  22777. googleapi.Expand(req.URL, map[string]string{
  22778. "project": c.project,
  22779. "zone": c.zone,
  22780. })
  22781. req.Header.Set("Content-Type", ctype)
  22782. req.Header.Set("User-Agent", c.s.userAgent())
  22783. if c.ctx_ != nil {
  22784. return ctxhttp.Do(c.ctx_, c.s.client, req)
  22785. }
  22786. return c.s.client.Do(req)
  22787. }
  22788. // Do executes the "compute.instances.insert" call.
  22789. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  22790. // status code is an error. Response headers are in either
  22791. // *Operation.ServerResponse.Header or (if a response was returned at
  22792. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  22793. // to check whether the returned error was because
  22794. // http.StatusNotModified was returned.
  22795. func (c *InstancesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  22796. gensupport.SetOptions(c.urlParams_, opts...)
  22797. res, err := c.doRequest("json")
  22798. if res != nil && res.StatusCode == http.StatusNotModified {
  22799. if res.Body != nil {
  22800. res.Body.Close()
  22801. }
  22802. return nil, &googleapi.Error{
  22803. Code: res.StatusCode,
  22804. Header: res.Header,
  22805. }
  22806. }
  22807. if err != nil {
  22808. return nil, err
  22809. }
  22810. defer googleapi.CloseBody(res)
  22811. if err := googleapi.CheckResponse(res); err != nil {
  22812. return nil, err
  22813. }
  22814. ret := &Operation{
  22815. ServerResponse: googleapi.ServerResponse{
  22816. Header: res.Header,
  22817. HTTPStatusCode: res.StatusCode,
  22818. },
  22819. }
  22820. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  22821. return nil, err
  22822. }
  22823. return ret, nil
  22824. // {
  22825. // "description": "Creates an instance resource in the specified project using the data included in the request.",
  22826. // "httpMethod": "POST",
  22827. // "id": "compute.instances.insert",
  22828. // "parameterOrder": [
  22829. // "project",
  22830. // "zone"
  22831. // ],
  22832. // "parameters": {
  22833. // "project": {
  22834. // "description": "Project ID for this request.",
  22835. // "location": "path",
  22836. // "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])?))",
  22837. // "required": true,
  22838. // "type": "string"
  22839. // },
  22840. // "zone": {
  22841. // "description": "The name of the zone for this request.",
  22842. // "location": "path",
  22843. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  22844. // "required": true,
  22845. // "type": "string"
  22846. // }
  22847. // },
  22848. // "path": "{project}/zones/{zone}/instances",
  22849. // "request": {
  22850. // "$ref": "Instance"
  22851. // },
  22852. // "response": {
  22853. // "$ref": "Operation"
  22854. // },
  22855. // "scopes": [
  22856. // "https://www.googleapis.com/auth/cloud-platform",
  22857. // "https://www.googleapis.com/auth/compute"
  22858. // ]
  22859. // }
  22860. }
  22861. // method id "compute.instances.list":
  22862. type InstancesListCall struct {
  22863. s *Service
  22864. project string
  22865. zone string
  22866. urlParams_ gensupport.URLParams
  22867. ifNoneMatch_ string
  22868. ctx_ context.Context
  22869. }
  22870. // List: Retrieves the list of instance resources contained within the
  22871. // specified zone.
  22872. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/list
  22873. func (r *InstancesService) List(project string, zone string) *InstancesListCall {
  22874. c := &InstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22875. c.project = project
  22876. c.zone = zone
  22877. return c
  22878. }
  22879. // Filter sets the optional parameter "filter": Sets a filter expression
  22880. // for filtering listed resources, in the form filter={expression}. Your
  22881. // {expression} must be in the format: field_name comparison_string
  22882. // literal_string.
  22883. //
  22884. // The field_name is the name of the field you want to compare. Only
  22885. // atomic field types are supported (string, number, boolean). The
  22886. // comparison_string must be either eq (equals) or ne (not equals). The
  22887. // literal_string is the string value to filter to. The literal value
  22888. // must be valid for the type of field you are filtering by (string,
  22889. // number, boolean). For string fields, the literal value is interpreted
  22890. // as a regular expression using RE2 syntax. The literal value must
  22891. // match the entire field.
  22892. //
  22893. // For example, filter=name ne example-instance.
  22894. //
  22895. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  22896. // you can also filter on nested fields. For example, you could filter
  22897. // on instances that have set the scheduling.automaticRestart field to
  22898. // true. In particular, use filtering on nested fields to take advantage
  22899. // of instance labels to organize and filter results based on label
  22900. // values.
  22901. //
  22902. // The Beta API also supports filtering on multiple expressions by
  22903. // providing each separate expression within parentheses. For example,
  22904. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  22905. // Multiple expressions are treated as AND expressions meaning that
  22906. // resources must match all expressions to pass the filters.
  22907. func (c *InstancesListCall) Filter(filter string) *InstancesListCall {
  22908. c.urlParams_.Set("filter", filter)
  22909. return c
  22910. }
  22911. // MaxResults sets the optional parameter "maxResults": The maximum
  22912. // number of results per page that Compute Engine should return. If the
  22913. // number of available results is larger than maxResults, Compute Engine
  22914. // returns a nextPageToken that can be used to get the next page of
  22915. // results in subsequent list requests.
  22916. func (c *InstancesListCall) MaxResults(maxResults int64) *InstancesListCall {
  22917. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  22918. return c
  22919. }
  22920. // PageToken sets the optional parameter "pageToken": Specifies a page
  22921. // token to use. Set pageToken to the nextPageToken returned by a
  22922. // previous list request to get the next page of results.
  22923. func (c *InstancesListCall) PageToken(pageToken string) *InstancesListCall {
  22924. c.urlParams_.Set("pageToken", pageToken)
  22925. return c
  22926. }
  22927. // Fields allows partial responses to be retrieved. See
  22928. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22929. // for more information.
  22930. func (c *InstancesListCall) Fields(s ...googleapi.Field) *InstancesListCall {
  22931. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22932. return c
  22933. }
  22934. // IfNoneMatch sets the optional parameter which makes the operation
  22935. // fail if the object's ETag matches the given value. This is useful for
  22936. // getting updates only after the object has changed since the last
  22937. // request. Use googleapi.IsNotModified to check whether the response
  22938. // error from Do is the result of In-None-Match.
  22939. func (c *InstancesListCall) IfNoneMatch(entityTag string) *InstancesListCall {
  22940. c.ifNoneMatch_ = entityTag
  22941. return c
  22942. }
  22943. // Context sets the context to be used in this call's Do method. Any
  22944. // pending HTTP request will be aborted if the provided context is
  22945. // canceled.
  22946. func (c *InstancesListCall) Context(ctx context.Context) *InstancesListCall {
  22947. c.ctx_ = ctx
  22948. return c
  22949. }
  22950. func (c *InstancesListCall) doRequest(alt string) (*http.Response, error) {
  22951. var body io.Reader = nil
  22952. c.urlParams_.Set("alt", alt)
  22953. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances")
  22954. urls += "?" + c.urlParams_.Encode()
  22955. req, _ := http.NewRequest("GET", urls, body)
  22956. googleapi.Expand(req.URL, map[string]string{
  22957. "project": c.project,
  22958. "zone": c.zone,
  22959. })
  22960. req.Header.Set("User-Agent", c.s.userAgent())
  22961. if c.ifNoneMatch_ != "" {
  22962. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  22963. }
  22964. if c.ctx_ != nil {
  22965. return ctxhttp.Do(c.ctx_, c.s.client, req)
  22966. }
  22967. return c.s.client.Do(req)
  22968. }
  22969. // Do executes the "compute.instances.list" call.
  22970. // Exactly one of *InstanceList or error will be non-nil. Any non-2xx
  22971. // status code is an error. Response headers are in either
  22972. // *InstanceList.ServerResponse.Header or (if a response was returned at
  22973. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  22974. // to check whether the returned error was because
  22975. // http.StatusNotModified was returned.
  22976. func (c *InstancesListCall) Do(opts ...googleapi.CallOption) (*InstanceList, error) {
  22977. gensupport.SetOptions(c.urlParams_, opts...)
  22978. res, err := c.doRequest("json")
  22979. if res != nil && res.StatusCode == http.StatusNotModified {
  22980. if res.Body != nil {
  22981. res.Body.Close()
  22982. }
  22983. return nil, &googleapi.Error{
  22984. Code: res.StatusCode,
  22985. Header: res.Header,
  22986. }
  22987. }
  22988. if err != nil {
  22989. return nil, err
  22990. }
  22991. defer googleapi.CloseBody(res)
  22992. if err := googleapi.CheckResponse(res); err != nil {
  22993. return nil, err
  22994. }
  22995. ret := &InstanceList{
  22996. ServerResponse: googleapi.ServerResponse{
  22997. Header: res.Header,
  22998. HTTPStatusCode: res.StatusCode,
  22999. },
  23000. }
  23001. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  23002. return nil, err
  23003. }
  23004. return ret, nil
  23005. // {
  23006. // "description": "Retrieves the list of instance resources contained within the specified zone.",
  23007. // "httpMethod": "GET",
  23008. // "id": "compute.instances.list",
  23009. // "parameterOrder": [
  23010. // "project",
  23011. // "zone"
  23012. // ],
  23013. // "parameters": {
  23014. // "filter": {
  23015. // "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.",
  23016. // "location": "query",
  23017. // "type": "string"
  23018. // },
  23019. // "maxResults": {
  23020. // "default": "500",
  23021. // "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.",
  23022. // "format": "uint32",
  23023. // "location": "query",
  23024. // "maximum": "500",
  23025. // "minimum": "0",
  23026. // "type": "integer"
  23027. // },
  23028. // "pageToken": {
  23029. // "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.",
  23030. // "location": "query",
  23031. // "type": "string"
  23032. // },
  23033. // "project": {
  23034. // "description": "Project ID for this request.",
  23035. // "location": "path",
  23036. // "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])?))",
  23037. // "required": true,
  23038. // "type": "string"
  23039. // },
  23040. // "zone": {
  23041. // "description": "The name of the zone for this request.",
  23042. // "location": "path",
  23043. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  23044. // "required": true,
  23045. // "type": "string"
  23046. // }
  23047. // },
  23048. // "path": "{project}/zones/{zone}/instances",
  23049. // "response": {
  23050. // "$ref": "InstanceList"
  23051. // },
  23052. // "scopes": [
  23053. // "https://www.googleapis.com/auth/cloud-platform",
  23054. // "https://www.googleapis.com/auth/compute",
  23055. // "https://www.googleapis.com/auth/compute.readonly"
  23056. // ]
  23057. // }
  23058. }
  23059. // Pages invokes f for each page of results.
  23060. // A non-nil error returned from f will halt the iteration.
  23061. // The provided context supersedes any context provided to the Context method.
  23062. func (c *InstancesListCall) Pages(ctx context.Context, f func(*InstanceList) error) error {
  23063. c.ctx_ = ctx
  23064. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  23065. for {
  23066. x, err := c.Do()
  23067. if err != nil {
  23068. return err
  23069. }
  23070. if err := f(x); err != nil {
  23071. return err
  23072. }
  23073. if x.NextPageToken == "" {
  23074. return nil
  23075. }
  23076. c.PageToken(x.NextPageToken)
  23077. }
  23078. }
  23079. // method id "compute.instances.reset":
  23080. type InstancesResetCall struct {
  23081. s *Service
  23082. project string
  23083. zone string
  23084. instance string
  23085. urlParams_ gensupport.URLParams
  23086. ctx_ context.Context
  23087. }
  23088. // Reset: Performs a hard reset on the instance.
  23089. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/reset
  23090. func (r *InstancesService) Reset(project string, zone string, instance string) *InstancesResetCall {
  23091. c := &InstancesResetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23092. c.project = project
  23093. c.zone = zone
  23094. c.instance = instance
  23095. return c
  23096. }
  23097. // Fields allows partial responses to be retrieved. See
  23098. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23099. // for more information.
  23100. func (c *InstancesResetCall) Fields(s ...googleapi.Field) *InstancesResetCall {
  23101. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23102. return c
  23103. }
  23104. // Context sets the context to be used in this call's Do method. Any
  23105. // pending HTTP request will be aborted if the provided context is
  23106. // canceled.
  23107. func (c *InstancesResetCall) Context(ctx context.Context) *InstancesResetCall {
  23108. c.ctx_ = ctx
  23109. return c
  23110. }
  23111. func (c *InstancesResetCall) doRequest(alt string) (*http.Response, error) {
  23112. var body io.Reader = nil
  23113. c.urlParams_.Set("alt", alt)
  23114. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/reset")
  23115. urls += "?" + c.urlParams_.Encode()
  23116. req, _ := http.NewRequest("POST", urls, body)
  23117. googleapi.Expand(req.URL, map[string]string{
  23118. "project": c.project,
  23119. "zone": c.zone,
  23120. "instance": c.instance,
  23121. })
  23122. req.Header.Set("User-Agent", c.s.userAgent())
  23123. if c.ctx_ != nil {
  23124. return ctxhttp.Do(c.ctx_, c.s.client, req)
  23125. }
  23126. return c.s.client.Do(req)
  23127. }
  23128. // Do executes the "compute.instances.reset" call.
  23129. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  23130. // status code is an error. Response headers are in either
  23131. // *Operation.ServerResponse.Header or (if a response was returned at
  23132. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  23133. // to check whether the returned error was because
  23134. // http.StatusNotModified was returned.
  23135. func (c *InstancesResetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  23136. gensupport.SetOptions(c.urlParams_, opts...)
  23137. res, err := c.doRequest("json")
  23138. if res != nil && res.StatusCode == http.StatusNotModified {
  23139. if res.Body != nil {
  23140. res.Body.Close()
  23141. }
  23142. return nil, &googleapi.Error{
  23143. Code: res.StatusCode,
  23144. Header: res.Header,
  23145. }
  23146. }
  23147. if err != nil {
  23148. return nil, err
  23149. }
  23150. defer googleapi.CloseBody(res)
  23151. if err := googleapi.CheckResponse(res); err != nil {
  23152. return nil, err
  23153. }
  23154. ret := &Operation{
  23155. ServerResponse: googleapi.ServerResponse{
  23156. Header: res.Header,
  23157. HTTPStatusCode: res.StatusCode,
  23158. },
  23159. }
  23160. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  23161. return nil, err
  23162. }
  23163. return ret, nil
  23164. // {
  23165. // "description": "Performs a hard reset on the instance.",
  23166. // "httpMethod": "POST",
  23167. // "id": "compute.instances.reset",
  23168. // "parameterOrder": [
  23169. // "project",
  23170. // "zone",
  23171. // "instance"
  23172. // ],
  23173. // "parameters": {
  23174. // "instance": {
  23175. // "description": "Name of the instance scoping this request.",
  23176. // "location": "path",
  23177. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  23178. // "required": true,
  23179. // "type": "string"
  23180. // },
  23181. // "project": {
  23182. // "description": "Project ID for this request.",
  23183. // "location": "path",
  23184. // "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])?))",
  23185. // "required": true,
  23186. // "type": "string"
  23187. // },
  23188. // "zone": {
  23189. // "description": "The name of the zone for this request.",
  23190. // "location": "path",
  23191. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  23192. // "required": true,
  23193. // "type": "string"
  23194. // }
  23195. // },
  23196. // "path": "{project}/zones/{zone}/instances/{instance}/reset",
  23197. // "response": {
  23198. // "$ref": "Operation"
  23199. // },
  23200. // "scopes": [
  23201. // "https://www.googleapis.com/auth/cloud-platform",
  23202. // "https://www.googleapis.com/auth/compute"
  23203. // ]
  23204. // }
  23205. }
  23206. // method id "compute.instances.setDiskAutoDelete":
  23207. type InstancesSetDiskAutoDeleteCall struct {
  23208. s *Service
  23209. project string
  23210. zone string
  23211. instance string
  23212. urlParams_ gensupport.URLParams
  23213. ctx_ context.Context
  23214. }
  23215. // SetDiskAutoDelete: Sets the auto-delete flag for a disk attached to
  23216. // an instance.
  23217. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setDiskAutoDelete
  23218. func (r *InstancesService) SetDiskAutoDelete(project string, zone string, instance string, autoDelete bool, deviceName string) *InstancesSetDiskAutoDeleteCall {
  23219. c := &InstancesSetDiskAutoDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23220. c.project = project
  23221. c.zone = zone
  23222. c.instance = instance
  23223. c.urlParams_.Set("autoDelete", fmt.Sprint(autoDelete))
  23224. c.urlParams_.Set("deviceName", deviceName)
  23225. return c
  23226. }
  23227. // Fields allows partial responses to be retrieved. See
  23228. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23229. // for more information.
  23230. func (c *InstancesSetDiskAutoDeleteCall) Fields(s ...googleapi.Field) *InstancesSetDiskAutoDeleteCall {
  23231. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23232. return c
  23233. }
  23234. // Context sets the context to be used in this call's Do method. Any
  23235. // pending HTTP request will be aborted if the provided context is
  23236. // canceled.
  23237. func (c *InstancesSetDiskAutoDeleteCall) Context(ctx context.Context) *InstancesSetDiskAutoDeleteCall {
  23238. c.ctx_ = ctx
  23239. return c
  23240. }
  23241. func (c *InstancesSetDiskAutoDeleteCall) doRequest(alt string) (*http.Response, error) {
  23242. var body io.Reader = nil
  23243. c.urlParams_.Set("alt", alt)
  23244. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete")
  23245. urls += "?" + c.urlParams_.Encode()
  23246. req, _ := http.NewRequest("POST", urls, body)
  23247. googleapi.Expand(req.URL, map[string]string{
  23248. "project": c.project,
  23249. "zone": c.zone,
  23250. "instance": c.instance,
  23251. })
  23252. req.Header.Set("User-Agent", c.s.userAgent())
  23253. if c.ctx_ != nil {
  23254. return ctxhttp.Do(c.ctx_, c.s.client, req)
  23255. }
  23256. return c.s.client.Do(req)
  23257. }
  23258. // Do executes the "compute.instances.setDiskAutoDelete" call.
  23259. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  23260. // status code is an error. Response headers are in either
  23261. // *Operation.ServerResponse.Header or (if a response was returned at
  23262. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  23263. // to check whether the returned error was because
  23264. // http.StatusNotModified was returned.
  23265. func (c *InstancesSetDiskAutoDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  23266. gensupport.SetOptions(c.urlParams_, opts...)
  23267. res, err := c.doRequest("json")
  23268. if res != nil && res.StatusCode == http.StatusNotModified {
  23269. if res.Body != nil {
  23270. res.Body.Close()
  23271. }
  23272. return nil, &googleapi.Error{
  23273. Code: res.StatusCode,
  23274. Header: res.Header,
  23275. }
  23276. }
  23277. if err != nil {
  23278. return nil, err
  23279. }
  23280. defer googleapi.CloseBody(res)
  23281. if err := googleapi.CheckResponse(res); err != nil {
  23282. return nil, err
  23283. }
  23284. ret := &Operation{
  23285. ServerResponse: googleapi.ServerResponse{
  23286. Header: res.Header,
  23287. HTTPStatusCode: res.StatusCode,
  23288. },
  23289. }
  23290. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  23291. return nil, err
  23292. }
  23293. return ret, nil
  23294. // {
  23295. // "description": "Sets the auto-delete flag for a disk attached to an instance.",
  23296. // "httpMethod": "POST",
  23297. // "id": "compute.instances.setDiskAutoDelete",
  23298. // "parameterOrder": [
  23299. // "project",
  23300. // "zone",
  23301. // "instance",
  23302. // "autoDelete",
  23303. // "deviceName"
  23304. // ],
  23305. // "parameters": {
  23306. // "autoDelete": {
  23307. // "description": "Whether to auto-delete the disk when the instance is deleted.",
  23308. // "location": "query",
  23309. // "required": true,
  23310. // "type": "boolean"
  23311. // },
  23312. // "deviceName": {
  23313. // "description": "The device name of the disk to modify.",
  23314. // "location": "query",
  23315. // "pattern": "\\w[\\w.-]{0,254}",
  23316. // "required": true,
  23317. // "type": "string"
  23318. // },
  23319. // "instance": {
  23320. // "description": "The instance name.",
  23321. // "location": "path",
  23322. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  23323. // "required": true,
  23324. // "type": "string"
  23325. // },
  23326. // "project": {
  23327. // "description": "Project ID for this request.",
  23328. // "location": "path",
  23329. // "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])?))",
  23330. // "required": true,
  23331. // "type": "string"
  23332. // },
  23333. // "zone": {
  23334. // "description": "The name of the zone for this request.",
  23335. // "location": "path",
  23336. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  23337. // "required": true,
  23338. // "type": "string"
  23339. // }
  23340. // },
  23341. // "path": "{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete",
  23342. // "response": {
  23343. // "$ref": "Operation"
  23344. // },
  23345. // "scopes": [
  23346. // "https://www.googleapis.com/auth/cloud-platform",
  23347. // "https://www.googleapis.com/auth/compute"
  23348. // ]
  23349. // }
  23350. }
  23351. // method id "compute.instances.setMachineType":
  23352. type InstancesSetMachineTypeCall struct {
  23353. s *Service
  23354. project string
  23355. zone string
  23356. instance string
  23357. instancessetmachinetyperequest *InstancesSetMachineTypeRequest
  23358. urlParams_ gensupport.URLParams
  23359. ctx_ context.Context
  23360. }
  23361. // SetMachineType: Changes the machine type for a stopped instance to
  23362. // the machine type specified in the request.
  23363. func (r *InstancesService) SetMachineType(project string, zone string, instance string, instancessetmachinetyperequest *InstancesSetMachineTypeRequest) *InstancesSetMachineTypeCall {
  23364. c := &InstancesSetMachineTypeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23365. c.project = project
  23366. c.zone = zone
  23367. c.instance = instance
  23368. c.instancessetmachinetyperequest = instancessetmachinetyperequest
  23369. return c
  23370. }
  23371. // Fields allows partial responses to be retrieved. See
  23372. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23373. // for more information.
  23374. func (c *InstancesSetMachineTypeCall) Fields(s ...googleapi.Field) *InstancesSetMachineTypeCall {
  23375. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23376. return c
  23377. }
  23378. // Context sets the context to be used in this call's Do method. Any
  23379. // pending HTTP request will be aborted if the provided context is
  23380. // canceled.
  23381. func (c *InstancesSetMachineTypeCall) Context(ctx context.Context) *InstancesSetMachineTypeCall {
  23382. c.ctx_ = ctx
  23383. return c
  23384. }
  23385. func (c *InstancesSetMachineTypeCall) doRequest(alt string) (*http.Response, error) {
  23386. var body io.Reader = nil
  23387. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmachinetyperequest)
  23388. if err != nil {
  23389. return nil, err
  23390. }
  23391. ctype := "application/json"
  23392. c.urlParams_.Set("alt", alt)
  23393. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMachineType")
  23394. urls += "?" + c.urlParams_.Encode()
  23395. req, _ := http.NewRequest("POST", urls, body)
  23396. googleapi.Expand(req.URL, map[string]string{
  23397. "project": c.project,
  23398. "zone": c.zone,
  23399. "instance": c.instance,
  23400. })
  23401. req.Header.Set("Content-Type", ctype)
  23402. req.Header.Set("User-Agent", c.s.userAgent())
  23403. if c.ctx_ != nil {
  23404. return ctxhttp.Do(c.ctx_, c.s.client, req)
  23405. }
  23406. return c.s.client.Do(req)
  23407. }
  23408. // Do executes the "compute.instances.setMachineType" call.
  23409. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  23410. // status code is an error. Response headers are in either
  23411. // *Operation.ServerResponse.Header or (if a response was returned at
  23412. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  23413. // to check whether the returned error was because
  23414. // http.StatusNotModified was returned.
  23415. func (c *InstancesSetMachineTypeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  23416. gensupport.SetOptions(c.urlParams_, opts...)
  23417. res, err := c.doRequest("json")
  23418. if res != nil && res.StatusCode == http.StatusNotModified {
  23419. if res.Body != nil {
  23420. res.Body.Close()
  23421. }
  23422. return nil, &googleapi.Error{
  23423. Code: res.StatusCode,
  23424. Header: res.Header,
  23425. }
  23426. }
  23427. if err != nil {
  23428. return nil, err
  23429. }
  23430. defer googleapi.CloseBody(res)
  23431. if err := googleapi.CheckResponse(res); err != nil {
  23432. return nil, err
  23433. }
  23434. ret := &Operation{
  23435. ServerResponse: googleapi.ServerResponse{
  23436. Header: res.Header,
  23437. HTTPStatusCode: res.StatusCode,
  23438. },
  23439. }
  23440. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  23441. return nil, err
  23442. }
  23443. return ret, nil
  23444. // {
  23445. // "description": "Changes the machine type for a stopped instance to the machine type specified in the request.",
  23446. // "httpMethod": "POST",
  23447. // "id": "compute.instances.setMachineType",
  23448. // "parameterOrder": [
  23449. // "project",
  23450. // "zone",
  23451. // "instance"
  23452. // ],
  23453. // "parameters": {
  23454. // "instance": {
  23455. // "description": "Name of the instance scoping this request.",
  23456. // "location": "path",
  23457. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  23458. // "required": true,
  23459. // "type": "string"
  23460. // },
  23461. // "project": {
  23462. // "description": "Project ID for this request.",
  23463. // "location": "path",
  23464. // "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])?))",
  23465. // "required": true,
  23466. // "type": "string"
  23467. // },
  23468. // "zone": {
  23469. // "description": "The name of the zone for this request.",
  23470. // "location": "path",
  23471. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  23472. // "required": true,
  23473. // "type": "string"
  23474. // }
  23475. // },
  23476. // "path": "{project}/zones/{zone}/instances/{instance}/setMachineType",
  23477. // "request": {
  23478. // "$ref": "InstancesSetMachineTypeRequest"
  23479. // },
  23480. // "response": {
  23481. // "$ref": "Operation"
  23482. // },
  23483. // "scopes": [
  23484. // "https://www.googleapis.com/auth/cloud-platform",
  23485. // "https://www.googleapis.com/auth/compute"
  23486. // ]
  23487. // }
  23488. }
  23489. // method id "compute.instances.setMetadata":
  23490. type InstancesSetMetadataCall struct {
  23491. s *Service
  23492. project string
  23493. zone string
  23494. instance string
  23495. metadata *Metadata
  23496. urlParams_ gensupport.URLParams
  23497. ctx_ context.Context
  23498. }
  23499. // SetMetadata: Sets metadata for the specified instance to the data
  23500. // included in the request.
  23501. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setMetadata
  23502. func (r *InstancesService) SetMetadata(project string, zone string, instance string, metadata *Metadata) *InstancesSetMetadataCall {
  23503. c := &InstancesSetMetadataCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23504. c.project = project
  23505. c.zone = zone
  23506. c.instance = instance
  23507. c.metadata = metadata
  23508. return c
  23509. }
  23510. // Fields allows partial responses to be retrieved. See
  23511. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23512. // for more information.
  23513. func (c *InstancesSetMetadataCall) Fields(s ...googleapi.Field) *InstancesSetMetadataCall {
  23514. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23515. return c
  23516. }
  23517. // Context sets the context to be used in this call's Do method. Any
  23518. // pending HTTP request will be aborted if the provided context is
  23519. // canceled.
  23520. func (c *InstancesSetMetadataCall) Context(ctx context.Context) *InstancesSetMetadataCall {
  23521. c.ctx_ = ctx
  23522. return c
  23523. }
  23524. func (c *InstancesSetMetadataCall) doRequest(alt string) (*http.Response, error) {
  23525. var body io.Reader = nil
  23526. body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata)
  23527. if err != nil {
  23528. return nil, err
  23529. }
  23530. ctype := "application/json"
  23531. c.urlParams_.Set("alt", alt)
  23532. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMetadata")
  23533. urls += "?" + c.urlParams_.Encode()
  23534. req, _ := http.NewRequest("POST", urls, body)
  23535. googleapi.Expand(req.URL, map[string]string{
  23536. "project": c.project,
  23537. "zone": c.zone,
  23538. "instance": c.instance,
  23539. })
  23540. req.Header.Set("Content-Type", ctype)
  23541. req.Header.Set("User-Agent", c.s.userAgent())
  23542. if c.ctx_ != nil {
  23543. return ctxhttp.Do(c.ctx_, c.s.client, req)
  23544. }
  23545. return c.s.client.Do(req)
  23546. }
  23547. // Do executes the "compute.instances.setMetadata" call.
  23548. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  23549. // status code is an error. Response headers are in either
  23550. // *Operation.ServerResponse.Header or (if a response was returned at
  23551. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  23552. // to check whether the returned error was because
  23553. // http.StatusNotModified was returned.
  23554. func (c *InstancesSetMetadataCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  23555. gensupport.SetOptions(c.urlParams_, opts...)
  23556. res, err := c.doRequest("json")
  23557. if res != nil && res.StatusCode == http.StatusNotModified {
  23558. if res.Body != nil {
  23559. res.Body.Close()
  23560. }
  23561. return nil, &googleapi.Error{
  23562. Code: res.StatusCode,
  23563. Header: res.Header,
  23564. }
  23565. }
  23566. if err != nil {
  23567. return nil, err
  23568. }
  23569. defer googleapi.CloseBody(res)
  23570. if err := googleapi.CheckResponse(res); err != nil {
  23571. return nil, err
  23572. }
  23573. ret := &Operation{
  23574. ServerResponse: googleapi.ServerResponse{
  23575. Header: res.Header,
  23576. HTTPStatusCode: res.StatusCode,
  23577. },
  23578. }
  23579. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  23580. return nil, err
  23581. }
  23582. return ret, nil
  23583. // {
  23584. // "description": "Sets metadata for the specified instance to the data included in the request.",
  23585. // "httpMethod": "POST",
  23586. // "id": "compute.instances.setMetadata",
  23587. // "parameterOrder": [
  23588. // "project",
  23589. // "zone",
  23590. // "instance"
  23591. // ],
  23592. // "parameters": {
  23593. // "instance": {
  23594. // "description": "Name of the instance scoping this request.",
  23595. // "location": "path",
  23596. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  23597. // "required": true,
  23598. // "type": "string"
  23599. // },
  23600. // "project": {
  23601. // "description": "Project ID for this request.",
  23602. // "location": "path",
  23603. // "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])?))",
  23604. // "required": true,
  23605. // "type": "string"
  23606. // },
  23607. // "zone": {
  23608. // "description": "The name of the zone for this request.",
  23609. // "location": "path",
  23610. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  23611. // "required": true,
  23612. // "type": "string"
  23613. // }
  23614. // },
  23615. // "path": "{project}/zones/{zone}/instances/{instance}/setMetadata",
  23616. // "request": {
  23617. // "$ref": "Metadata"
  23618. // },
  23619. // "response": {
  23620. // "$ref": "Operation"
  23621. // },
  23622. // "scopes": [
  23623. // "https://www.googleapis.com/auth/cloud-platform",
  23624. // "https://www.googleapis.com/auth/compute"
  23625. // ]
  23626. // }
  23627. }
  23628. // method id "compute.instances.setScheduling":
  23629. type InstancesSetSchedulingCall struct {
  23630. s *Service
  23631. project string
  23632. zone string
  23633. instance string
  23634. scheduling *Scheduling
  23635. urlParams_ gensupport.URLParams
  23636. ctx_ context.Context
  23637. }
  23638. // SetScheduling: Sets an instance's scheduling options.
  23639. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setScheduling
  23640. func (r *InstancesService) SetScheduling(project string, zone string, instance string, scheduling *Scheduling) *InstancesSetSchedulingCall {
  23641. c := &InstancesSetSchedulingCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23642. c.project = project
  23643. c.zone = zone
  23644. c.instance = instance
  23645. c.scheduling = scheduling
  23646. return c
  23647. }
  23648. // Fields allows partial responses to be retrieved. See
  23649. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23650. // for more information.
  23651. func (c *InstancesSetSchedulingCall) Fields(s ...googleapi.Field) *InstancesSetSchedulingCall {
  23652. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23653. return c
  23654. }
  23655. // Context sets the context to be used in this call's Do method. Any
  23656. // pending HTTP request will be aborted if the provided context is
  23657. // canceled.
  23658. func (c *InstancesSetSchedulingCall) Context(ctx context.Context) *InstancesSetSchedulingCall {
  23659. c.ctx_ = ctx
  23660. return c
  23661. }
  23662. func (c *InstancesSetSchedulingCall) doRequest(alt string) (*http.Response, error) {
  23663. var body io.Reader = nil
  23664. body, err := googleapi.WithoutDataWrapper.JSONReader(c.scheduling)
  23665. if err != nil {
  23666. return nil, err
  23667. }
  23668. ctype := "application/json"
  23669. c.urlParams_.Set("alt", alt)
  23670. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setScheduling")
  23671. urls += "?" + c.urlParams_.Encode()
  23672. req, _ := http.NewRequest("POST", urls, body)
  23673. googleapi.Expand(req.URL, map[string]string{
  23674. "project": c.project,
  23675. "zone": c.zone,
  23676. "instance": c.instance,
  23677. })
  23678. req.Header.Set("Content-Type", ctype)
  23679. req.Header.Set("User-Agent", c.s.userAgent())
  23680. if c.ctx_ != nil {
  23681. return ctxhttp.Do(c.ctx_, c.s.client, req)
  23682. }
  23683. return c.s.client.Do(req)
  23684. }
  23685. // Do executes the "compute.instances.setScheduling" call.
  23686. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  23687. // status code is an error. Response headers are in either
  23688. // *Operation.ServerResponse.Header or (if a response was returned at
  23689. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  23690. // to check whether the returned error was because
  23691. // http.StatusNotModified was returned.
  23692. func (c *InstancesSetSchedulingCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  23693. gensupport.SetOptions(c.urlParams_, opts...)
  23694. res, err := c.doRequest("json")
  23695. if res != nil && res.StatusCode == http.StatusNotModified {
  23696. if res.Body != nil {
  23697. res.Body.Close()
  23698. }
  23699. return nil, &googleapi.Error{
  23700. Code: res.StatusCode,
  23701. Header: res.Header,
  23702. }
  23703. }
  23704. if err != nil {
  23705. return nil, err
  23706. }
  23707. defer googleapi.CloseBody(res)
  23708. if err := googleapi.CheckResponse(res); err != nil {
  23709. return nil, err
  23710. }
  23711. ret := &Operation{
  23712. ServerResponse: googleapi.ServerResponse{
  23713. Header: res.Header,
  23714. HTTPStatusCode: res.StatusCode,
  23715. },
  23716. }
  23717. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  23718. return nil, err
  23719. }
  23720. return ret, nil
  23721. // {
  23722. // "description": "Sets an instance's scheduling options.",
  23723. // "httpMethod": "POST",
  23724. // "id": "compute.instances.setScheduling",
  23725. // "parameterOrder": [
  23726. // "project",
  23727. // "zone",
  23728. // "instance"
  23729. // ],
  23730. // "parameters": {
  23731. // "instance": {
  23732. // "description": "Instance name.",
  23733. // "location": "path",
  23734. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  23735. // "required": true,
  23736. // "type": "string"
  23737. // },
  23738. // "project": {
  23739. // "description": "Project ID for this request.",
  23740. // "location": "path",
  23741. // "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])?))",
  23742. // "required": true,
  23743. // "type": "string"
  23744. // },
  23745. // "zone": {
  23746. // "description": "The name of the zone for this request.",
  23747. // "location": "path",
  23748. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  23749. // "required": true,
  23750. // "type": "string"
  23751. // }
  23752. // },
  23753. // "path": "{project}/zones/{zone}/instances/{instance}/setScheduling",
  23754. // "request": {
  23755. // "$ref": "Scheduling"
  23756. // },
  23757. // "response": {
  23758. // "$ref": "Operation"
  23759. // },
  23760. // "scopes": [
  23761. // "https://www.googleapis.com/auth/cloud-platform",
  23762. // "https://www.googleapis.com/auth/compute"
  23763. // ]
  23764. // }
  23765. }
  23766. // method id "compute.instances.setTags":
  23767. type InstancesSetTagsCall struct {
  23768. s *Service
  23769. project string
  23770. zone string
  23771. instance string
  23772. tags *Tags
  23773. urlParams_ gensupport.URLParams
  23774. ctx_ context.Context
  23775. }
  23776. // SetTags: Sets tags for the specified instance to the data included in
  23777. // the request.
  23778. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setTags
  23779. func (r *InstancesService) SetTags(project string, zone string, instance string, tags *Tags) *InstancesSetTagsCall {
  23780. c := &InstancesSetTagsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23781. c.project = project
  23782. c.zone = zone
  23783. c.instance = instance
  23784. c.tags = tags
  23785. return c
  23786. }
  23787. // Fields allows partial responses to be retrieved. See
  23788. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23789. // for more information.
  23790. func (c *InstancesSetTagsCall) Fields(s ...googleapi.Field) *InstancesSetTagsCall {
  23791. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23792. return c
  23793. }
  23794. // Context sets the context to be used in this call's Do method. Any
  23795. // pending HTTP request will be aborted if the provided context is
  23796. // canceled.
  23797. func (c *InstancesSetTagsCall) Context(ctx context.Context) *InstancesSetTagsCall {
  23798. c.ctx_ = ctx
  23799. return c
  23800. }
  23801. func (c *InstancesSetTagsCall) doRequest(alt string) (*http.Response, error) {
  23802. var body io.Reader = nil
  23803. body, err := googleapi.WithoutDataWrapper.JSONReader(c.tags)
  23804. if err != nil {
  23805. return nil, err
  23806. }
  23807. ctype := "application/json"
  23808. c.urlParams_.Set("alt", alt)
  23809. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setTags")
  23810. urls += "?" + c.urlParams_.Encode()
  23811. req, _ := http.NewRequest("POST", urls, body)
  23812. googleapi.Expand(req.URL, map[string]string{
  23813. "project": c.project,
  23814. "zone": c.zone,
  23815. "instance": c.instance,
  23816. })
  23817. req.Header.Set("Content-Type", ctype)
  23818. req.Header.Set("User-Agent", c.s.userAgent())
  23819. if c.ctx_ != nil {
  23820. return ctxhttp.Do(c.ctx_, c.s.client, req)
  23821. }
  23822. return c.s.client.Do(req)
  23823. }
  23824. // Do executes the "compute.instances.setTags" call.
  23825. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  23826. // status code is an error. Response headers are in either
  23827. // *Operation.ServerResponse.Header or (if a response was returned at
  23828. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  23829. // to check whether the returned error was because
  23830. // http.StatusNotModified was returned.
  23831. func (c *InstancesSetTagsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  23832. gensupport.SetOptions(c.urlParams_, opts...)
  23833. res, err := c.doRequest("json")
  23834. if res != nil && res.StatusCode == http.StatusNotModified {
  23835. if res.Body != nil {
  23836. res.Body.Close()
  23837. }
  23838. return nil, &googleapi.Error{
  23839. Code: res.StatusCode,
  23840. Header: res.Header,
  23841. }
  23842. }
  23843. if err != nil {
  23844. return nil, err
  23845. }
  23846. defer googleapi.CloseBody(res)
  23847. if err := googleapi.CheckResponse(res); err != nil {
  23848. return nil, err
  23849. }
  23850. ret := &Operation{
  23851. ServerResponse: googleapi.ServerResponse{
  23852. Header: res.Header,
  23853. HTTPStatusCode: res.StatusCode,
  23854. },
  23855. }
  23856. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  23857. return nil, err
  23858. }
  23859. return ret, nil
  23860. // {
  23861. // "description": "Sets tags for the specified instance to the data included in the request.",
  23862. // "httpMethod": "POST",
  23863. // "id": "compute.instances.setTags",
  23864. // "parameterOrder": [
  23865. // "project",
  23866. // "zone",
  23867. // "instance"
  23868. // ],
  23869. // "parameters": {
  23870. // "instance": {
  23871. // "description": "Name of the instance scoping this request.",
  23872. // "location": "path",
  23873. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  23874. // "required": true,
  23875. // "type": "string"
  23876. // },
  23877. // "project": {
  23878. // "description": "Project ID for this request.",
  23879. // "location": "path",
  23880. // "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])?))",
  23881. // "required": true,
  23882. // "type": "string"
  23883. // },
  23884. // "zone": {
  23885. // "description": "The name of the zone for this request.",
  23886. // "location": "path",
  23887. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  23888. // "required": true,
  23889. // "type": "string"
  23890. // }
  23891. // },
  23892. // "path": "{project}/zones/{zone}/instances/{instance}/setTags",
  23893. // "request": {
  23894. // "$ref": "Tags"
  23895. // },
  23896. // "response": {
  23897. // "$ref": "Operation"
  23898. // },
  23899. // "scopes": [
  23900. // "https://www.googleapis.com/auth/cloud-platform",
  23901. // "https://www.googleapis.com/auth/compute"
  23902. // ]
  23903. // }
  23904. }
  23905. // method id "compute.instances.start":
  23906. type InstancesStartCall struct {
  23907. s *Service
  23908. project string
  23909. zone string
  23910. instance string
  23911. urlParams_ gensupport.URLParams
  23912. ctx_ context.Context
  23913. }
  23914. // Start: Starts an instance that was stopped using the using the
  23915. // instances().stop method. For more information, see Restart an
  23916. // instance.
  23917. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/start
  23918. func (r *InstancesService) Start(project string, zone string, instance string) *InstancesStartCall {
  23919. c := &InstancesStartCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23920. c.project = project
  23921. c.zone = zone
  23922. c.instance = instance
  23923. return c
  23924. }
  23925. // Fields allows partial responses to be retrieved. See
  23926. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23927. // for more information.
  23928. func (c *InstancesStartCall) Fields(s ...googleapi.Field) *InstancesStartCall {
  23929. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23930. return c
  23931. }
  23932. // Context sets the context to be used in this call's Do method. Any
  23933. // pending HTTP request will be aborted if the provided context is
  23934. // canceled.
  23935. func (c *InstancesStartCall) Context(ctx context.Context) *InstancesStartCall {
  23936. c.ctx_ = ctx
  23937. return c
  23938. }
  23939. func (c *InstancesStartCall) doRequest(alt string) (*http.Response, error) {
  23940. var body io.Reader = nil
  23941. c.urlParams_.Set("alt", alt)
  23942. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/start")
  23943. urls += "?" + c.urlParams_.Encode()
  23944. req, _ := http.NewRequest("POST", urls, body)
  23945. googleapi.Expand(req.URL, map[string]string{
  23946. "project": c.project,
  23947. "zone": c.zone,
  23948. "instance": c.instance,
  23949. })
  23950. req.Header.Set("User-Agent", c.s.userAgent())
  23951. if c.ctx_ != nil {
  23952. return ctxhttp.Do(c.ctx_, c.s.client, req)
  23953. }
  23954. return c.s.client.Do(req)
  23955. }
  23956. // Do executes the "compute.instances.start" call.
  23957. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  23958. // status code is an error. Response headers are in either
  23959. // *Operation.ServerResponse.Header or (if a response was returned at
  23960. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  23961. // to check whether the returned error was because
  23962. // http.StatusNotModified was returned.
  23963. func (c *InstancesStartCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  23964. gensupport.SetOptions(c.urlParams_, opts...)
  23965. res, err := c.doRequest("json")
  23966. if res != nil && res.StatusCode == http.StatusNotModified {
  23967. if res.Body != nil {
  23968. res.Body.Close()
  23969. }
  23970. return nil, &googleapi.Error{
  23971. Code: res.StatusCode,
  23972. Header: res.Header,
  23973. }
  23974. }
  23975. if err != nil {
  23976. return nil, err
  23977. }
  23978. defer googleapi.CloseBody(res)
  23979. if err := googleapi.CheckResponse(res); err != nil {
  23980. return nil, err
  23981. }
  23982. ret := &Operation{
  23983. ServerResponse: googleapi.ServerResponse{
  23984. Header: res.Header,
  23985. HTTPStatusCode: res.StatusCode,
  23986. },
  23987. }
  23988. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  23989. return nil, err
  23990. }
  23991. return ret, nil
  23992. // {
  23993. // "description": "Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance.",
  23994. // "httpMethod": "POST",
  23995. // "id": "compute.instances.start",
  23996. // "parameterOrder": [
  23997. // "project",
  23998. // "zone",
  23999. // "instance"
  24000. // ],
  24001. // "parameters": {
  24002. // "instance": {
  24003. // "description": "Name of the instance resource to start.",
  24004. // "location": "path",
  24005. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  24006. // "required": true,
  24007. // "type": "string"
  24008. // },
  24009. // "project": {
  24010. // "description": "Project ID for this request.",
  24011. // "location": "path",
  24012. // "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])?))",
  24013. // "required": true,
  24014. // "type": "string"
  24015. // },
  24016. // "zone": {
  24017. // "description": "The name of the zone for this request.",
  24018. // "location": "path",
  24019. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  24020. // "required": true,
  24021. // "type": "string"
  24022. // }
  24023. // },
  24024. // "path": "{project}/zones/{zone}/instances/{instance}/start",
  24025. // "response": {
  24026. // "$ref": "Operation"
  24027. // },
  24028. // "scopes": [
  24029. // "https://www.googleapis.com/auth/cloud-platform",
  24030. // "https://www.googleapis.com/auth/compute"
  24031. // ]
  24032. // }
  24033. }
  24034. // method id "compute.instances.stop":
  24035. type InstancesStopCall struct {
  24036. s *Service
  24037. project string
  24038. zone string
  24039. instance string
  24040. urlParams_ gensupport.URLParams
  24041. ctx_ context.Context
  24042. }
  24043. // Stop: Stops a running instance, shutting it down cleanly, and allows
  24044. // you to restart the instance at a later time. Stopped instances do not
  24045. // incur per-minute, virtual machine usage charges while they are
  24046. // stopped, but any resources that the virtual machine is using, such as
  24047. // persistent disks and static IP addresses, will continue to be charged
  24048. // until they are deleted. For more information, see Stopping an
  24049. // instance.
  24050. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/stop
  24051. func (r *InstancesService) Stop(project string, zone string, instance string) *InstancesStopCall {
  24052. c := &InstancesStopCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24053. c.project = project
  24054. c.zone = zone
  24055. c.instance = instance
  24056. return c
  24057. }
  24058. // Fields allows partial responses to be retrieved. See
  24059. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24060. // for more information.
  24061. func (c *InstancesStopCall) Fields(s ...googleapi.Field) *InstancesStopCall {
  24062. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24063. return c
  24064. }
  24065. // Context sets the context to be used in this call's Do method. Any
  24066. // pending HTTP request will be aborted if the provided context is
  24067. // canceled.
  24068. func (c *InstancesStopCall) Context(ctx context.Context) *InstancesStopCall {
  24069. c.ctx_ = ctx
  24070. return c
  24071. }
  24072. func (c *InstancesStopCall) doRequest(alt string) (*http.Response, error) {
  24073. var body io.Reader = nil
  24074. c.urlParams_.Set("alt", alt)
  24075. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/stop")
  24076. urls += "?" + c.urlParams_.Encode()
  24077. req, _ := http.NewRequest("POST", urls, body)
  24078. googleapi.Expand(req.URL, map[string]string{
  24079. "project": c.project,
  24080. "zone": c.zone,
  24081. "instance": c.instance,
  24082. })
  24083. req.Header.Set("User-Agent", c.s.userAgent())
  24084. if c.ctx_ != nil {
  24085. return ctxhttp.Do(c.ctx_, c.s.client, req)
  24086. }
  24087. return c.s.client.Do(req)
  24088. }
  24089. // Do executes the "compute.instances.stop" call.
  24090. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  24091. // status code is an error. Response headers are in either
  24092. // *Operation.ServerResponse.Header or (if a response was returned at
  24093. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  24094. // to check whether the returned error was because
  24095. // http.StatusNotModified was returned.
  24096. func (c *InstancesStopCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  24097. gensupport.SetOptions(c.urlParams_, opts...)
  24098. res, err := c.doRequest("json")
  24099. if res != nil && res.StatusCode == http.StatusNotModified {
  24100. if res.Body != nil {
  24101. res.Body.Close()
  24102. }
  24103. return nil, &googleapi.Error{
  24104. Code: res.StatusCode,
  24105. Header: res.Header,
  24106. }
  24107. }
  24108. if err != nil {
  24109. return nil, err
  24110. }
  24111. defer googleapi.CloseBody(res)
  24112. if err := googleapi.CheckResponse(res); err != nil {
  24113. return nil, err
  24114. }
  24115. ret := &Operation{
  24116. ServerResponse: googleapi.ServerResponse{
  24117. Header: res.Header,
  24118. HTTPStatusCode: res.StatusCode,
  24119. },
  24120. }
  24121. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  24122. return nil, err
  24123. }
  24124. return ret, nil
  24125. // {
  24126. // "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.",
  24127. // "httpMethod": "POST",
  24128. // "id": "compute.instances.stop",
  24129. // "parameterOrder": [
  24130. // "project",
  24131. // "zone",
  24132. // "instance"
  24133. // ],
  24134. // "parameters": {
  24135. // "instance": {
  24136. // "description": "Name of the instance resource to stop.",
  24137. // "location": "path",
  24138. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  24139. // "required": true,
  24140. // "type": "string"
  24141. // },
  24142. // "project": {
  24143. // "description": "Project ID for this request.",
  24144. // "location": "path",
  24145. // "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])?))",
  24146. // "required": true,
  24147. // "type": "string"
  24148. // },
  24149. // "zone": {
  24150. // "description": "The name of the zone for this request.",
  24151. // "location": "path",
  24152. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  24153. // "required": true,
  24154. // "type": "string"
  24155. // }
  24156. // },
  24157. // "path": "{project}/zones/{zone}/instances/{instance}/stop",
  24158. // "response": {
  24159. // "$ref": "Operation"
  24160. // },
  24161. // "scopes": [
  24162. // "https://www.googleapis.com/auth/cloud-platform",
  24163. // "https://www.googleapis.com/auth/compute"
  24164. // ]
  24165. // }
  24166. }
  24167. // method id "compute.licenses.get":
  24168. type LicensesGetCall struct {
  24169. s *Service
  24170. project string
  24171. license string
  24172. urlParams_ gensupport.URLParams
  24173. ifNoneMatch_ string
  24174. ctx_ context.Context
  24175. }
  24176. // Get: Returns the specified license resource.
  24177. // For details, see https://cloud.google.com/compute/docs/reference/latest/licenses/get
  24178. func (r *LicensesService) Get(project string, license string) *LicensesGetCall {
  24179. c := &LicensesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24180. c.project = project
  24181. c.license = license
  24182. return c
  24183. }
  24184. // Fields allows partial responses to be retrieved. See
  24185. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24186. // for more information.
  24187. func (c *LicensesGetCall) Fields(s ...googleapi.Field) *LicensesGetCall {
  24188. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24189. return c
  24190. }
  24191. // IfNoneMatch sets the optional parameter which makes the operation
  24192. // fail if the object's ETag matches the given value. This is useful for
  24193. // getting updates only after the object has changed since the last
  24194. // request. Use googleapi.IsNotModified to check whether the response
  24195. // error from Do is the result of In-None-Match.
  24196. func (c *LicensesGetCall) IfNoneMatch(entityTag string) *LicensesGetCall {
  24197. c.ifNoneMatch_ = entityTag
  24198. return c
  24199. }
  24200. // Context sets the context to be used in this call's Do method. Any
  24201. // pending HTTP request will be aborted if the provided context is
  24202. // canceled.
  24203. func (c *LicensesGetCall) Context(ctx context.Context) *LicensesGetCall {
  24204. c.ctx_ = ctx
  24205. return c
  24206. }
  24207. func (c *LicensesGetCall) doRequest(alt string) (*http.Response, error) {
  24208. var body io.Reader = nil
  24209. c.urlParams_.Set("alt", alt)
  24210. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{license}")
  24211. urls += "?" + c.urlParams_.Encode()
  24212. req, _ := http.NewRequest("GET", urls, body)
  24213. googleapi.Expand(req.URL, map[string]string{
  24214. "project": c.project,
  24215. "license": c.license,
  24216. })
  24217. req.Header.Set("User-Agent", c.s.userAgent())
  24218. if c.ifNoneMatch_ != "" {
  24219. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  24220. }
  24221. if c.ctx_ != nil {
  24222. return ctxhttp.Do(c.ctx_, c.s.client, req)
  24223. }
  24224. return c.s.client.Do(req)
  24225. }
  24226. // Do executes the "compute.licenses.get" call.
  24227. // Exactly one of *License or error will be non-nil. Any non-2xx status
  24228. // code is an error. Response headers are in either
  24229. // *License.ServerResponse.Header or (if a response was returned at all)
  24230. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  24231. // check whether the returned error was because http.StatusNotModified
  24232. // was returned.
  24233. func (c *LicensesGetCall) Do(opts ...googleapi.CallOption) (*License, error) {
  24234. gensupport.SetOptions(c.urlParams_, opts...)
  24235. res, err := c.doRequest("json")
  24236. if res != nil && res.StatusCode == http.StatusNotModified {
  24237. if res.Body != nil {
  24238. res.Body.Close()
  24239. }
  24240. return nil, &googleapi.Error{
  24241. Code: res.StatusCode,
  24242. Header: res.Header,
  24243. }
  24244. }
  24245. if err != nil {
  24246. return nil, err
  24247. }
  24248. defer googleapi.CloseBody(res)
  24249. if err := googleapi.CheckResponse(res); err != nil {
  24250. return nil, err
  24251. }
  24252. ret := &License{
  24253. ServerResponse: googleapi.ServerResponse{
  24254. Header: res.Header,
  24255. HTTPStatusCode: res.StatusCode,
  24256. },
  24257. }
  24258. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  24259. return nil, err
  24260. }
  24261. return ret, nil
  24262. // {
  24263. // "description": "Returns the specified license resource.",
  24264. // "httpMethod": "GET",
  24265. // "id": "compute.licenses.get",
  24266. // "parameterOrder": [
  24267. // "project",
  24268. // "license"
  24269. // ],
  24270. // "parameters": {
  24271. // "license": {
  24272. // "description": "Name of the license resource to return.",
  24273. // "location": "path",
  24274. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  24275. // "required": true,
  24276. // "type": "string"
  24277. // },
  24278. // "project": {
  24279. // "description": "Project ID for this request.",
  24280. // "location": "path",
  24281. // "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])?))",
  24282. // "required": true,
  24283. // "type": "string"
  24284. // }
  24285. // },
  24286. // "path": "{project}/global/licenses/{license}",
  24287. // "response": {
  24288. // "$ref": "License"
  24289. // },
  24290. // "scopes": [
  24291. // "https://www.googleapis.com/auth/cloud-platform",
  24292. // "https://www.googleapis.com/auth/compute",
  24293. // "https://www.googleapis.com/auth/compute.readonly"
  24294. // ]
  24295. // }
  24296. }
  24297. // method id "compute.machineTypes.aggregatedList":
  24298. type MachineTypesAggregatedListCall struct {
  24299. s *Service
  24300. project string
  24301. urlParams_ gensupport.URLParams
  24302. ifNoneMatch_ string
  24303. ctx_ context.Context
  24304. }
  24305. // AggregatedList: Retrieves an aggregated list of machine type
  24306. // resources.
  24307. // For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/aggregatedList
  24308. func (r *MachineTypesService) AggregatedList(project string) *MachineTypesAggregatedListCall {
  24309. c := &MachineTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24310. c.project = project
  24311. return c
  24312. }
  24313. // Filter sets the optional parameter "filter": Sets a filter expression
  24314. // for filtering listed resources, in the form filter={expression}. Your
  24315. // {expression} must be in the format: field_name comparison_string
  24316. // literal_string.
  24317. //
  24318. // The field_name is the name of the field you want to compare. Only
  24319. // atomic field types are supported (string, number, boolean). The
  24320. // comparison_string must be either eq (equals) or ne (not equals). The
  24321. // literal_string is the string value to filter to. The literal value
  24322. // must be valid for the type of field you are filtering by (string,
  24323. // number, boolean). For string fields, the literal value is interpreted
  24324. // as a regular expression using RE2 syntax. The literal value must
  24325. // match the entire field.
  24326. //
  24327. // For example, filter=name ne example-instance.
  24328. //
  24329. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  24330. // you can also filter on nested fields. For example, you could filter
  24331. // on instances that have set the scheduling.automaticRestart field to
  24332. // true. In particular, use filtering on nested fields to take advantage
  24333. // of instance labels to organize and filter results based on label
  24334. // values.
  24335. //
  24336. // The Beta API also supports filtering on multiple expressions by
  24337. // providing each separate expression within parentheses. For example,
  24338. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  24339. // Multiple expressions are treated as AND expressions meaning that
  24340. // resources must match all expressions to pass the filters.
  24341. func (c *MachineTypesAggregatedListCall) Filter(filter string) *MachineTypesAggregatedListCall {
  24342. c.urlParams_.Set("filter", filter)
  24343. return c
  24344. }
  24345. // MaxResults sets the optional parameter "maxResults": The maximum
  24346. // number of results per page that Compute Engine should return. If the
  24347. // number of available results is larger than maxResults, Compute Engine
  24348. // returns a nextPageToken that can be used to get the next page of
  24349. // results in subsequent list requests.
  24350. func (c *MachineTypesAggregatedListCall) MaxResults(maxResults int64) *MachineTypesAggregatedListCall {
  24351. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  24352. return c
  24353. }
  24354. // PageToken sets the optional parameter "pageToken": Specifies a page
  24355. // token to use. Set pageToken to the nextPageToken returned by a
  24356. // previous list request to get the next page of results.
  24357. func (c *MachineTypesAggregatedListCall) PageToken(pageToken string) *MachineTypesAggregatedListCall {
  24358. c.urlParams_.Set("pageToken", pageToken)
  24359. return c
  24360. }
  24361. // Fields allows partial responses to be retrieved. See
  24362. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24363. // for more information.
  24364. func (c *MachineTypesAggregatedListCall) Fields(s ...googleapi.Field) *MachineTypesAggregatedListCall {
  24365. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24366. return c
  24367. }
  24368. // IfNoneMatch sets the optional parameter which makes the operation
  24369. // fail if the object's ETag matches the given value. This is useful for
  24370. // getting updates only after the object has changed since the last
  24371. // request. Use googleapi.IsNotModified to check whether the response
  24372. // error from Do is the result of In-None-Match.
  24373. func (c *MachineTypesAggregatedListCall) IfNoneMatch(entityTag string) *MachineTypesAggregatedListCall {
  24374. c.ifNoneMatch_ = entityTag
  24375. return c
  24376. }
  24377. // Context sets the context to be used in this call's Do method. Any
  24378. // pending HTTP request will be aborted if the provided context is
  24379. // canceled.
  24380. func (c *MachineTypesAggregatedListCall) Context(ctx context.Context) *MachineTypesAggregatedListCall {
  24381. c.ctx_ = ctx
  24382. return c
  24383. }
  24384. func (c *MachineTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  24385. var body io.Reader = nil
  24386. c.urlParams_.Set("alt", alt)
  24387. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/machineTypes")
  24388. urls += "?" + c.urlParams_.Encode()
  24389. req, _ := http.NewRequest("GET", urls, body)
  24390. googleapi.Expand(req.URL, map[string]string{
  24391. "project": c.project,
  24392. })
  24393. req.Header.Set("User-Agent", c.s.userAgent())
  24394. if c.ifNoneMatch_ != "" {
  24395. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  24396. }
  24397. if c.ctx_ != nil {
  24398. return ctxhttp.Do(c.ctx_, c.s.client, req)
  24399. }
  24400. return c.s.client.Do(req)
  24401. }
  24402. // Do executes the "compute.machineTypes.aggregatedList" call.
  24403. // Exactly one of *MachineTypeAggregatedList or error will be non-nil.
  24404. // Any non-2xx status code is an error. Response headers are in either
  24405. // *MachineTypeAggregatedList.ServerResponse.Header or (if a response
  24406. // was returned at all) in error.(*googleapi.Error).Header. Use
  24407. // googleapi.IsNotModified to check whether the returned error was
  24408. // because http.StatusNotModified was returned.
  24409. func (c *MachineTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*MachineTypeAggregatedList, error) {
  24410. gensupport.SetOptions(c.urlParams_, opts...)
  24411. res, err := c.doRequest("json")
  24412. if res != nil && res.StatusCode == http.StatusNotModified {
  24413. if res.Body != nil {
  24414. res.Body.Close()
  24415. }
  24416. return nil, &googleapi.Error{
  24417. Code: res.StatusCode,
  24418. Header: res.Header,
  24419. }
  24420. }
  24421. if err != nil {
  24422. return nil, err
  24423. }
  24424. defer googleapi.CloseBody(res)
  24425. if err := googleapi.CheckResponse(res); err != nil {
  24426. return nil, err
  24427. }
  24428. ret := &MachineTypeAggregatedList{
  24429. ServerResponse: googleapi.ServerResponse{
  24430. Header: res.Header,
  24431. HTTPStatusCode: res.StatusCode,
  24432. },
  24433. }
  24434. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  24435. return nil, err
  24436. }
  24437. return ret, nil
  24438. // {
  24439. // "description": "Retrieves an aggregated list of machine type resources.",
  24440. // "httpMethod": "GET",
  24441. // "id": "compute.machineTypes.aggregatedList",
  24442. // "parameterOrder": [
  24443. // "project"
  24444. // ],
  24445. // "parameters": {
  24446. // "filter": {
  24447. // "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.",
  24448. // "location": "query",
  24449. // "type": "string"
  24450. // },
  24451. // "maxResults": {
  24452. // "default": "500",
  24453. // "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.",
  24454. // "format": "uint32",
  24455. // "location": "query",
  24456. // "maximum": "500",
  24457. // "minimum": "0",
  24458. // "type": "integer"
  24459. // },
  24460. // "pageToken": {
  24461. // "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.",
  24462. // "location": "query",
  24463. // "type": "string"
  24464. // },
  24465. // "project": {
  24466. // "description": "Project ID for this request.",
  24467. // "location": "path",
  24468. // "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])?))",
  24469. // "required": true,
  24470. // "type": "string"
  24471. // }
  24472. // },
  24473. // "path": "{project}/aggregated/machineTypes",
  24474. // "response": {
  24475. // "$ref": "MachineTypeAggregatedList"
  24476. // },
  24477. // "scopes": [
  24478. // "https://www.googleapis.com/auth/cloud-platform",
  24479. // "https://www.googleapis.com/auth/compute",
  24480. // "https://www.googleapis.com/auth/compute.readonly"
  24481. // ]
  24482. // }
  24483. }
  24484. // Pages invokes f for each page of results.
  24485. // A non-nil error returned from f will halt the iteration.
  24486. // The provided context supersedes any context provided to the Context method.
  24487. func (c *MachineTypesAggregatedListCall) Pages(ctx context.Context, f func(*MachineTypeAggregatedList) error) error {
  24488. c.ctx_ = ctx
  24489. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  24490. for {
  24491. x, err := c.Do()
  24492. if err != nil {
  24493. return err
  24494. }
  24495. if err := f(x); err != nil {
  24496. return err
  24497. }
  24498. if x.NextPageToken == "" {
  24499. return nil
  24500. }
  24501. c.PageToken(x.NextPageToken)
  24502. }
  24503. }
  24504. // method id "compute.machineTypes.get":
  24505. type MachineTypesGetCall struct {
  24506. s *Service
  24507. project string
  24508. zone string
  24509. machineType string
  24510. urlParams_ gensupport.URLParams
  24511. ifNoneMatch_ string
  24512. ctx_ context.Context
  24513. }
  24514. // Get: Returns the specified machine type resource.
  24515. // For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/get
  24516. func (r *MachineTypesService) Get(project string, zone string, machineType string) *MachineTypesGetCall {
  24517. c := &MachineTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24518. c.project = project
  24519. c.zone = zone
  24520. c.machineType = machineType
  24521. return c
  24522. }
  24523. // Fields allows partial responses to be retrieved. See
  24524. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24525. // for more information.
  24526. func (c *MachineTypesGetCall) Fields(s ...googleapi.Field) *MachineTypesGetCall {
  24527. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24528. return c
  24529. }
  24530. // IfNoneMatch sets the optional parameter which makes the operation
  24531. // fail if the object's ETag matches the given value. This is useful for
  24532. // getting updates only after the object has changed since the last
  24533. // request. Use googleapi.IsNotModified to check whether the response
  24534. // error from Do is the result of In-None-Match.
  24535. func (c *MachineTypesGetCall) IfNoneMatch(entityTag string) *MachineTypesGetCall {
  24536. c.ifNoneMatch_ = entityTag
  24537. return c
  24538. }
  24539. // Context sets the context to be used in this call's Do method. Any
  24540. // pending HTTP request will be aborted if the provided context is
  24541. // canceled.
  24542. func (c *MachineTypesGetCall) Context(ctx context.Context) *MachineTypesGetCall {
  24543. c.ctx_ = ctx
  24544. return c
  24545. }
  24546. func (c *MachineTypesGetCall) doRequest(alt string) (*http.Response, error) {
  24547. var body io.Reader = nil
  24548. c.urlParams_.Set("alt", alt)
  24549. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/machineTypes/{machineType}")
  24550. urls += "?" + c.urlParams_.Encode()
  24551. req, _ := http.NewRequest("GET", urls, body)
  24552. googleapi.Expand(req.URL, map[string]string{
  24553. "project": c.project,
  24554. "zone": c.zone,
  24555. "machineType": c.machineType,
  24556. })
  24557. req.Header.Set("User-Agent", c.s.userAgent())
  24558. if c.ifNoneMatch_ != "" {
  24559. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  24560. }
  24561. if c.ctx_ != nil {
  24562. return ctxhttp.Do(c.ctx_, c.s.client, req)
  24563. }
  24564. return c.s.client.Do(req)
  24565. }
  24566. // Do executes the "compute.machineTypes.get" call.
  24567. // Exactly one of *MachineType or error will be non-nil. Any non-2xx
  24568. // status code is an error. Response headers are in either
  24569. // *MachineType.ServerResponse.Header or (if a response was returned at
  24570. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  24571. // to check whether the returned error was because
  24572. // http.StatusNotModified was returned.
  24573. func (c *MachineTypesGetCall) Do(opts ...googleapi.CallOption) (*MachineType, error) {
  24574. gensupport.SetOptions(c.urlParams_, opts...)
  24575. res, err := c.doRequest("json")
  24576. if res != nil && res.StatusCode == http.StatusNotModified {
  24577. if res.Body != nil {
  24578. res.Body.Close()
  24579. }
  24580. return nil, &googleapi.Error{
  24581. Code: res.StatusCode,
  24582. Header: res.Header,
  24583. }
  24584. }
  24585. if err != nil {
  24586. return nil, err
  24587. }
  24588. defer googleapi.CloseBody(res)
  24589. if err := googleapi.CheckResponse(res); err != nil {
  24590. return nil, err
  24591. }
  24592. ret := &MachineType{
  24593. ServerResponse: googleapi.ServerResponse{
  24594. Header: res.Header,
  24595. HTTPStatusCode: res.StatusCode,
  24596. },
  24597. }
  24598. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  24599. return nil, err
  24600. }
  24601. return ret, nil
  24602. // {
  24603. // "description": "Returns the specified machine type resource.",
  24604. // "httpMethod": "GET",
  24605. // "id": "compute.machineTypes.get",
  24606. // "parameterOrder": [
  24607. // "project",
  24608. // "zone",
  24609. // "machineType"
  24610. // ],
  24611. // "parameters": {
  24612. // "machineType": {
  24613. // "description": "Name of the machine type resource to return.",
  24614. // "location": "path",
  24615. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  24616. // "required": true,
  24617. // "type": "string"
  24618. // },
  24619. // "project": {
  24620. // "description": "Project ID for this request.",
  24621. // "location": "path",
  24622. // "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])?))",
  24623. // "required": true,
  24624. // "type": "string"
  24625. // },
  24626. // "zone": {
  24627. // "description": "The name of the zone for this request.",
  24628. // "location": "path",
  24629. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  24630. // "required": true,
  24631. // "type": "string"
  24632. // }
  24633. // },
  24634. // "path": "{project}/zones/{zone}/machineTypes/{machineType}",
  24635. // "response": {
  24636. // "$ref": "MachineType"
  24637. // },
  24638. // "scopes": [
  24639. // "https://www.googleapis.com/auth/cloud-platform",
  24640. // "https://www.googleapis.com/auth/compute",
  24641. // "https://www.googleapis.com/auth/compute.readonly"
  24642. // ]
  24643. // }
  24644. }
  24645. // method id "compute.machineTypes.list":
  24646. type MachineTypesListCall struct {
  24647. s *Service
  24648. project string
  24649. zone string
  24650. urlParams_ gensupport.URLParams
  24651. ifNoneMatch_ string
  24652. ctx_ context.Context
  24653. }
  24654. // List: Retrieves a list of machine type resources available to the
  24655. // specified project.
  24656. // For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/list
  24657. func (r *MachineTypesService) List(project string, zone string) *MachineTypesListCall {
  24658. c := &MachineTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24659. c.project = project
  24660. c.zone = zone
  24661. return c
  24662. }
  24663. // Filter sets the optional parameter "filter": Sets a filter expression
  24664. // for filtering listed resources, in the form filter={expression}. Your
  24665. // {expression} must be in the format: field_name comparison_string
  24666. // literal_string.
  24667. //
  24668. // The field_name is the name of the field you want to compare. Only
  24669. // atomic field types are supported (string, number, boolean). The
  24670. // comparison_string must be either eq (equals) or ne (not equals). The
  24671. // literal_string is the string value to filter to. The literal value
  24672. // must be valid for the type of field you are filtering by (string,
  24673. // number, boolean). For string fields, the literal value is interpreted
  24674. // as a regular expression using RE2 syntax. The literal value must
  24675. // match the entire field.
  24676. //
  24677. // For example, filter=name ne example-instance.
  24678. //
  24679. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  24680. // you can also filter on nested fields. For example, you could filter
  24681. // on instances that have set the scheduling.automaticRestart field to
  24682. // true. In particular, use filtering on nested fields to take advantage
  24683. // of instance labels to organize and filter results based on label
  24684. // values.
  24685. //
  24686. // The Beta API also supports filtering on multiple expressions by
  24687. // providing each separate expression within parentheses. For example,
  24688. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  24689. // Multiple expressions are treated as AND expressions meaning that
  24690. // resources must match all expressions to pass the filters.
  24691. func (c *MachineTypesListCall) Filter(filter string) *MachineTypesListCall {
  24692. c.urlParams_.Set("filter", filter)
  24693. return c
  24694. }
  24695. // MaxResults sets the optional parameter "maxResults": The maximum
  24696. // number of results per page that Compute Engine should return. If the
  24697. // number of available results is larger than maxResults, Compute Engine
  24698. // returns a nextPageToken that can be used to get the next page of
  24699. // results in subsequent list requests.
  24700. func (c *MachineTypesListCall) MaxResults(maxResults int64) *MachineTypesListCall {
  24701. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  24702. return c
  24703. }
  24704. // PageToken sets the optional parameter "pageToken": Specifies a page
  24705. // token to use. Set pageToken to the nextPageToken returned by a
  24706. // previous list request to get the next page of results.
  24707. func (c *MachineTypesListCall) PageToken(pageToken string) *MachineTypesListCall {
  24708. c.urlParams_.Set("pageToken", pageToken)
  24709. return c
  24710. }
  24711. // Fields allows partial responses to be retrieved. See
  24712. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24713. // for more information.
  24714. func (c *MachineTypesListCall) Fields(s ...googleapi.Field) *MachineTypesListCall {
  24715. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24716. return c
  24717. }
  24718. // IfNoneMatch sets the optional parameter which makes the operation
  24719. // fail if the object's ETag matches the given value. This is useful for
  24720. // getting updates only after the object has changed since the last
  24721. // request. Use googleapi.IsNotModified to check whether the response
  24722. // error from Do is the result of In-None-Match.
  24723. func (c *MachineTypesListCall) IfNoneMatch(entityTag string) *MachineTypesListCall {
  24724. c.ifNoneMatch_ = entityTag
  24725. return c
  24726. }
  24727. // Context sets the context to be used in this call's Do method. Any
  24728. // pending HTTP request will be aborted if the provided context is
  24729. // canceled.
  24730. func (c *MachineTypesListCall) Context(ctx context.Context) *MachineTypesListCall {
  24731. c.ctx_ = ctx
  24732. return c
  24733. }
  24734. func (c *MachineTypesListCall) doRequest(alt string) (*http.Response, error) {
  24735. var body io.Reader = nil
  24736. c.urlParams_.Set("alt", alt)
  24737. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/machineTypes")
  24738. urls += "?" + c.urlParams_.Encode()
  24739. req, _ := http.NewRequest("GET", urls, body)
  24740. googleapi.Expand(req.URL, map[string]string{
  24741. "project": c.project,
  24742. "zone": c.zone,
  24743. })
  24744. req.Header.Set("User-Agent", c.s.userAgent())
  24745. if c.ifNoneMatch_ != "" {
  24746. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  24747. }
  24748. if c.ctx_ != nil {
  24749. return ctxhttp.Do(c.ctx_, c.s.client, req)
  24750. }
  24751. return c.s.client.Do(req)
  24752. }
  24753. // Do executes the "compute.machineTypes.list" call.
  24754. // Exactly one of *MachineTypeList or error will be non-nil. Any non-2xx
  24755. // status code is an error. Response headers are in either
  24756. // *MachineTypeList.ServerResponse.Header or (if a response was returned
  24757. // at all) in error.(*googleapi.Error).Header. Use
  24758. // googleapi.IsNotModified to check whether the returned error was
  24759. // because http.StatusNotModified was returned.
  24760. func (c *MachineTypesListCall) Do(opts ...googleapi.CallOption) (*MachineTypeList, error) {
  24761. gensupport.SetOptions(c.urlParams_, opts...)
  24762. res, err := c.doRequest("json")
  24763. if res != nil && res.StatusCode == http.StatusNotModified {
  24764. if res.Body != nil {
  24765. res.Body.Close()
  24766. }
  24767. return nil, &googleapi.Error{
  24768. Code: res.StatusCode,
  24769. Header: res.Header,
  24770. }
  24771. }
  24772. if err != nil {
  24773. return nil, err
  24774. }
  24775. defer googleapi.CloseBody(res)
  24776. if err := googleapi.CheckResponse(res); err != nil {
  24777. return nil, err
  24778. }
  24779. ret := &MachineTypeList{
  24780. ServerResponse: googleapi.ServerResponse{
  24781. Header: res.Header,
  24782. HTTPStatusCode: res.StatusCode,
  24783. },
  24784. }
  24785. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  24786. return nil, err
  24787. }
  24788. return ret, nil
  24789. // {
  24790. // "description": "Retrieves a list of machine type resources available to the specified project.",
  24791. // "httpMethod": "GET",
  24792. // "id": "compute.machineTypes.list",
  24793. // "parameterOrder": [
  24794. // "project",
  24795. // "zone"
  24796. // ],
  24797. // "parameters": {
  24798. // "filter": {
  24799. // "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.",
  24800. // "location": "query",
  24801. // "type": "string"
  24802. // },
  24803. // "maxResults": {
  24804. // "default": "500",
  24805. // "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.",
  24806. // "format": "uint32",
  24807. // "location": "query",
  24808. // "maximum": "500",
  24809. // "minimum": "0",
  24810. // "type": "integer"
  24811. // },
  24812. // "pageToken": {
  24813. // "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.",
  24814. // "location": "query",
  24815. // "type": "string"
  24816. // },
  24817. // "project": {
  24818. // "description": "Project ID for this request.",
  24819. // "location": "path",
  24820. // "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])?))",
  24821. // "required": true,
  24822. // "type": "string"
  24823. // },
  24824. // "zone": {
  24825. // "description": "The name of the zone for this request.",
  24826. // "location": "path",
  24827. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  24828. // "required": true,
  24829. // "type": "string"
  24830. // }
  24831. // },
  24832. // "path": "{project}/zones/{zone}/machineTypes",
  24833. // "response": {
  24834. // "$ref": "MachineTypeList"
  24835. // },
  24836. // "scopes": [
  24837. // "https://www.googleapis.com/auth/cloud-platform",
  24838. // "https://www.googleapis.com/auth/compute",
  24839. // "https://www.googleapis.com/auth/compute.readonly"
  24840. // ]
  24841. // }
  24842. }
  24843. // Pages invokes f for each page of results.
  24844. // A non-nil error returned from f will halt the iteration.
  24845. // The provided context supersedes any context provided to the Context method.
  24846. func (c *MachineTypesListCall) Pages(ctx context.Context, f func(*MachineTypeList) error) error {
  24847. c.ctx_ = ctx
  24848. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  24849. for {
  24850. x, err := c.Do()
  24851. if err != nil {
  24852. return err
  24853. }
  24854. if err := f(x); err != nil {
  24855. return err
  24856. }
  24857. if x.NextPageToken == "" {
  24858. return nil
  24859. }
  24860. c.PageToken(x.NextPageToken)
  24861. }
  24862. }
  24863. // method id "compute.networks.delete":
  24864. type NetworksDeleteCall struct {
  24865. s *Service
  24866. project string
  24867. network string
  24868. urlParams_ gensupport.URLParams
  24869. ctx_ context.Context
  24870. }
  24871. // Delete: Deletes the specified network resource.
  24872. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/delete
  24873. func (r *NetworksService) Delete(project string, network string) *NetworksDeleteCall {
  24874. c := &NetworksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24875. c.project = project
  24876. c.network = network
  24877. return c
  24878. }
  24879. // Fields allows partial responses to be retrieved. See
  24880. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24881. // for more information.
  24882. func (c *NetworksDeleteCall) Fields(s ...googleapi.Field) *NetworksDeleteCall {
  24883. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24884. return c
  24885. }
  24886. // Context sets the context to be used in this call's Do method. Any
  24887. // pending HTTP request will be aborted if the provided context is
  24888. // canceled.
  24889. func (c *NetworksDeleteCall) Context(ctx context.Context) *NetworksDeleteCall {
  24890. c.ctx_ = ctx
  24891. return c
  24892. }
  24893. func (c *NetworksDeleteCall) doRequest(alt string) (*http.Response, error) {
  24894. var body io.Reader = nil
  24895. c.urlParams_.Set("alt", alt)
  24896. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}")
  24897. urls += "?" + c.urlParams_.Encode()
  24898. req, _ := http.NewRequest("DELETE", urls, body)
  24899. googleapi.Expand(req.URL, map[string]string{
  24900. "project": c.project,
  24901. "network": c.network,
  24902. })
  24903. req.Header.Set("User-Agent", c.s.userAgent())
  24904. if c.ctx_ != nil {
  24905. return ctxhttp.Do(c.ctx_, c.s.client, req)
  24906. }
  24907. return c.s.client.Do(req)
  24908. }
  24909. // Do executes the "compute.networks.delete" call.
  24910. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  24911. // status code is an error. Response headers are in either
  24912. // *Operation.ServerResponse.Header or (if a response was returned at
  24913. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  24914. // to check whether the returned error was because
  24915. // http.StatusNotModified was returned.
  24916. func (c *NetworksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  24917. gensupport.SetOptions(c.urlParams_, opts...)
  24918. res, err := c.doRequest("json")
  24919. if res != nil && res.StatusCode == http.StatusNotModified {
  24920. if res.Body != nil {
  24921. res.Body.Close()
  24922. }
  24923. return nil, &googleapi.Error{
  24924. Code: res.StatusCode,
  24925. Header: res.Header,
  24926. }
  24927. }
  24928. if err != nil {
  24929. return nil, err
  24930. }
  24931. defer googleapi.CloseBody(res)
  24932. if err := googleapi.CheckResponse(res); err != nil {
  24933. return nil, err
  24934. }
  24935. ret := &Operation{
  24936. ServerResponse: googleapi.ServerResponse{
  24937. Header: res.Header,
  24938. HTTPStatusCode: res.StatusCode,
  24939. },
  24940. }
  24941. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  24942. return nil, err
  24943. }
  24944. return ret, nil
  24945. // {
  24946. // "description": "Deletes the specified network resource.",
  24947. // "httpMethod": "DELETE",
  24948. // "id": "compute.networks.delete",
  24949. // "parameterOrder": [
  24950. // "project",
  24951. // "network"
  24952. // ],
  24953. // "parameters": {
  24954. // "network": {
  24955. // "description": "Name of the network resource to delete.",
  24956. // "location": "path",
  24957. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  24958. // "required": true,
  24959. // "type": "string"
  24960. // },
  24961. // "project": {
  24962. // "description": "Project ID for this request.",
  24963. // "location": "path",
  24964. // "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])?))",
  24965. // "required": true,
  24966. // "type": "string"
  24967. // }
  24968. // },
  24969. // "path": "{project}/global/networks/{network}",
  24970. // "response": {
  24971. // "$ref": "Operation"
  24972. // },
  24973. // "scopes": [
  24974. // "https://www.googleapis.com/auth/cloud-platform",
  24975. // "https://www.googleapis.com/auth/compute"
  24976. // ]
  24977. // }
  24978. }
  24979. // method id "compute.networks.get":
  24980. type NetworksGetCall struct {
  24981. s *Service
  24982. project string
  24983. network string
  24984. urlParams_ gensupport.URLParams
  24985. ifNoneMatch_ string
  24986. ctx_ context.Context
  24987. }
  24988. // Get: Returns the specified network resource.
  24989. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/get
  24990. func (r *NetworksService) Get(project string, network string) *NetworksGetCall {
  24991. c := &NetworksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24992. c.project = project
  24993. c.network = network
  24994. return c
  24995. }
  24996. // Fields allows partial responses to be retrieved. See
  24997. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24998. // for more information.
  24999. func (c *NetworksGetCall) Fields(s ...googleapi.Field) *NetworksGetCall {
  25000. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25001. return c
  25002. }
  25003. // IfNoneMatch sets the optional parameter which makes the operation
  25004. // fail if the object's ETag matches the given value. This is useful for
  25005. // getting updates only after the object has changed since the last
  25006. // request. Use googleapi.IsNotModified to check whether the response
  25007. // error from Do is the result of In-None-Match.
  25008. func (c *NetworksGetCall) IfNoneMatch(entityTag string) *NetworksGetCall {
  25009. c.ifNoneMatch_ = entityTag
  25010. return c
  25011. }
  25012. // Context sets the context to be used in this call's Do method. Any
  25013. // pending HTTP request will be aborted if the provided context is
  25014. // canceled.
  25015. func (c *NetworksGetCall) Context(ctx context.Context) *NetworksGetCall {
  25016. c.ctx_ = ctx
  25017. return c
  25018. }
  25019. func (c *NetworksGetCall) doRequest(alt string) (*http.Response, error) {
  25020. var body io.Reader = nil
  25021. c.urlParams_.Set("alt", alt)
  25022. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}")
  25023. urls += "?" + c.urlParams_.Encode()
  25024. req, _ := http.NewRequest("GET", urls, body)
  25025. googleapi.Expand(req.URL, map[string]string{
  25026. "project": c.project,
  25027. "network": c.network,
  25028. })
  25029. req.Header.Set("User-Agent", c.s.userAgent())
  25030. if c.ifNoneMatch_ != "" {
  25031. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  25032. }
  25033. if c.ctx_ != nil {
  25034. return ctxhttp.Do(c.ctx_, c.s.client, req)
  25035. }
  25036. return c.s.client.Do(req)
  25037. }
  25038. // Do executes the "compute.networks.get" call.
  25039. // Exactly one of *Network or error will be non-nil. Any non-2xx status
  25040. // code is an error. Response headers are in either
  25041. // *Network.ServerResponse.Header or (if a response was returned at all)
  25042. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  25043. // check whether the returned error was because http.StatusNotModified
  25044. // was returned.
  25045. func (c *NetworksGetCall) Do(opts ...googleapi.CallOption) (*Network, error) {
  25046. gensupport.SetOptions(c.urlParams_, opts...)
  25047. res, err := c.doRequest("json")
  25048. if res != nil && res.StatusCode == http.StatusNotModified {
  25049. if res.Body != nil {
  25050. res.Body.Close()
  25051. }
  25052. return nil, &googleapi.Error{
  25053. Code: res.StatusCode,
  25054. Header: res.Header,
  25055. }
  25056. }
  25057. if err != nil {
  25058. return nil, err
  25059. }
  25060. defer googleapi.CloseBody(res)
  25061. if err := googleapi.CheckResponse(res); err != nil {
  25062. return nil, err
  25063. }
  25064. ret := &Network{
  25065. ServerResponse: googleapi.ServerResponse{
  25066. Header: res.Header,
  25067. HTTPStatusCode: res.StatusCode,
  25068. },
  25069. }
  25070. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  25071. return nil, err
  25072. }
  25073. return ret, nil
  25074. // {
  25075. // "description": "Returns the specified network resource.",
  25076. // "httpMethod": "GET",
  25077. // "id": "compute.networks.get",
  25078. // "parameterOrder": [
  25079. // "project",
  25080. // "network"
  25081. // ],
  25082. // "parameters": {
  25083. // "network": {
  25084. // "description": "Name of the network resource to return.",
  25085. // "location": "path",
  25086. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  25087. // "required": true,
  25088. // "type": "string"
  25089. // },
  25090. // "project": {
  25091. // "description": "Project ID for this request.",
  25092. // "location": "path",
  25093. // "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])?))",
  25094. // "required": true,
  25095. // "type": "string"
  25096. // }
  25097. // },
  25098. // "path": "{project}/global/networks/{network}",
  25099. // "response": {
  25100. // "$ref": "Network"
  25101. // },
  25102. // "scopes": [
  25103. // "https://www.googleapis.com/auth/cloud-platform",
  25104. // "https://www.googleapis.com/auth/compute",
  25105. // "https://www.googleapis.com/auth/compute.readonly"
  25106. // ]
  25107. // }
  25108. }
  25109. // method id "compute.networks.insert":
  25110. type NetworksInsertCall struct {
  25111. s *Service
  25112. project string
  25113. network *Network
  25114. urlParams_ gensupport.URLParams
  25115. ctx_ context.Context
  25116. }
  25117. // Insert: Creates a network resource in the specified project using the
  25118. // data included in the request.
  25119. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/insert
  25120. func (r *NetworksService) Insert(project string, network *Network) *NetworksInsertCall {
  25121. c := &NetworksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25122. c.project = project
  25123. c.network = network
  25124. return c
  25125. }
  25126. // Fields allows partial responses to be retrieved. See
  25127. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25128. // for more information.
  25129. func (c *NetworksInsertCall) Fields(s ...googleapi.Field) *NetworksInsertCall {
  25130. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25131. return c
  25132. }
  25133. // Context sets the context to be used in this call's Do method. Any
  25134. // pending HTTP request will be aborted if the provided context is
  25135. // canceled.
  25136. func (c *NetworksInsertCall) Context(ctx context.Context) *NetworksInsertCall {
  25137. c.ctx_ = ctx
  25138. return c
  25139. }
  25140. func (c *NetworksInsertCall) doRequest(alt string) (*http.Response, error) {
  25141. var body io.Reader = nil
  25142. body, err := googleapi.WithoutDataWrapper.JSONReader(c.network)
  25143. if err != nil {
  25144. return nil, err
  25145. }
  25146. ctype := "application/json"
  25147. c.urlParams_.Set("alt", alt)
  25148. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks")
  25149. urls += "?" + c.urlParams_.Encode()
  25150. req, _ := http.NewRequest("POST", urls, body)
  25151. googleapi.Expand(req.URL, map[string]string{
  25152. "project": c.project,
  25153. })
  25154. req.Header.Set("Content-Type", ctype)
  25155. req.Header.Set("User-Agent", c.s.userAgent())
  25156. if c.ctx_ != nil {
  25157. return ctxhttp.Do(c.ctx_, c.s.client, req)
  25158. }
  25159. return c.s.client.Do(req)
  25160. }
  25161. // Do executes the "compute.networks.insert" call.
  25162. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  25163. // status code is an error. Response headers are in either
  25164. // *Operation.ServerResponse.Header or (if a response was returned at
  25165. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  25166. // to check whether the returned error was because
  25167. // http.StatusNotModified was returned.
  25168. func (c *NetworksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  25169. gensupport.SetOptions(c.urlParams_, opts...)
  25170. res, err := c.doRequest("json")
  25171. if res != nil && res.StatusCode == http.StatusNotModified {
  25172. if res.Body != nil {
  25173. res.Body.Close()
  25174. }
  25175. return nil, &googleapi.Error{
  25176. Code: res.StatusCode,
  25177. Header: res.Header,
  25178. }
  25179. }
  25180. if err != nil {
  25181. return nil, err
  25182. }
  25183. defer googleapi.CloseBody(res)
  25184. if err := googleapi.CheckResponse(res); err != nil {
  25185. return nil, err
  25186. }
  25187. ret := &Operation{
  25188. ServerResponse: googleapi.ServerResponse{
  25189. Header: res.Header,
  25190. HTTPStatusCode: res.StatusCode,
  25191. },
  25192. }
  25193. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  25194. return nil, err
  25195. }
  25196. return ret, nil
  25197. // {
  25198. // "description": "Creates a network resource in the specified project using the data included in the request.",
  25199. // "httpMethod": "POST",
  25200. // "id": "compute.networks.insert",
  25201. // "parameterOrder": [
  25202. // "project"
  25203. // ],
  25204. // "parameters": {
  25205. // "project": {
  25206. // "description": "Project ID for this request.",
  25207. // "location": "path",
  25208. // "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])?))",
  25209. // "required": true,
  25210. // "type": "string"
  25211. // }
  25212. // },
  25213. // "path": "{project}/global/networks",
  25214. // "request": {
  25215. // "$ref": "Network"
  25216. // },
  25217. // "response": {
  25218. // "$ref": "Operation"
  25219. // },
  25220. // "scopes": [
  25221. // "https://www.googleapis.com/auth/cloud-platform",
  25222. // "https://www.googleapis.com/auth/compute"
  25223. // ]
  25224. // }
  25225. }
  25226. // method id "compute.networks.list":
  25227. type NetworksListCall struct {
  25228. s *Service
  25229. project string
  25230. urlParams_ gensupport.URLParams
  25231. ifNoneMatch_ string
  25232. ctx_ context.Context
  25233. }
  25234. // List: Retrieves the list of network resources available to the
  25235. // specified project.
  25236. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/list
  25237. func (r *NetworksService) List(project string) *NetworksListCall {
  25238. c := &NetworksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25239. c.project = project
  25240. return c
  25241. }
  25242. // Filter sets the optional parameter "filter": Sets a filter expression
  25243. // for filtering listed resources, in the form filter={expression}. Your
  25244. // {expression} must be in the format: field_name comparison_string
  25245. // literal_string.
  25246. //
  25247. // The field_name is the name of the field you want to compare. Only
  25248. // atomic field types are supported (string, number, boolean). The
  25249. // comparison_string must be either eq (equals) or ne (not equals). The
  25250. // literal_string is the string value to filter to. The literal value
  25251. // must be valid for the type of field you are filtering by (string,
  25252. // number, boolean). For string fields, the literal value is interpreted
  25253. // as a regular expression using RE2 syntax. The literal value must
  25254. // match the entire field.
  25255. //
  25256. // For example, filter=name ne example-instance.
  25257. //
  25258. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  25259. // you can also filter on nested fields. For example, you could filter
  25260. // on instances that have set the scheduling.automaticRestart field to
  25261. // true. In particular, use filtering on nested fields to take advantage
  25262. // of instance labels to organize and filter results based on label
  25263. // values.
  25264. //
  25265. // The Beta API also supports filtering on multiple expressions by
  25266. // providing each separate expression within parentheses. For example,
  25267. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  25268. // Multiple expressions are treated as AND expressions meaning that
  25269. // resources must match all expressions to pass the filters.
  25270. func (c *NetworksListCall) Filter(filter string) *NetworksListCall {
  25271. c.urlParams_.Set("filter", filter)
  25272. return c
  25273. }
  25274. // MaxResults sets the optional parameter "maxResults": The maximum
  25275. // number of results per page that Compute Engine should return. If the
  25276. // number of available results is larger than maxResults, Compute Engine
  25277. // returns a nextPageToken that can be used to get the next page of
  25278. // results in subsequent list requests.
  25279. func (c *NetworksListCall) MaxResults(maxResults int64) *NetworksListCall {
  25280. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  25281. return c
  25282. }
  25283. // PageToken sets the optional parameter "pageToken": Specifies a page
  25284. // token to use. Set pageToken to the nextPageToken returned by a
  25285. // previous list request to get the next page of results.
  25286. func (c *NetworksListCall) PageToken(pageToken string) *NetworksListCall {
  25287. c.urlParams_.Set("pageToken", pageToken)
  25288. return c
  25289. }
  25290. // Fields allows partial responses to be retrieved. See
  25291. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25292. // for more information.
  25293. func (c *NetworksListCall) Fields(s ...googleapi.Field) *NetworksListCall {
  25294. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25295. return c
  25296. }
  25297. // IfNoneMatch sets the optional parameter which makes the operation
  25298. // fail if the object's ETag matches the given value. This is useful for
  25299. // getting updates only after the object has changed since the last
  25300. // request. Use googleapi.IsNotModified to check whether the response
  25301. // error from Do is the result of In-None-Match.
  25302. func (c *NetworksListCall) IfNoneMatch(entityTag string) *NetworksListCall {
  25303. c.ifNoneMatch_ = entityTag
  25304. return c
  25305. }
  25306. // Context sets the context to be used in this call's Do method. Any
  25307. // pending HTTP request will be aborted if the provided context is
  25308. // canceled.
  25309. func (c *NetworksListCall) Context(ctx context.Context) *NetworksListCall {
  25310. c.ctx_ = ctx
  25311. return c
  25312. }
  25313. func (c *NetworksListCall) doRequest(alt string) (*http.Response, error) {
  25314. var body io.Reader = nil
  25315. c.urlParams_.Set("alt", alt)
  25316. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks")
  25317. urls += "?" + c.urlParams_.Encode()
  25318. req, _ := http.NewRequest("GET", urls, body)
  25319. googleapi.Expand(req.URL, map[string]string{
  25320. "project": c.project,
  25321. })
  25322. req.Header.Set("User-Agent", c.s.userAgent())
  25323. if c.ifNoneMatch_ != "" {
  25324. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  25325. }
  25326. if c.ctx_ != nil {
  25327. return ctxhttp.Do(c.ctx_, c.s.client, req)
  25328. }
  25329. return c.s.client.Do(req)
  25330. }
  25331. // Do executes the "compute.networks.list" call.
  25332. // Exactly one of *NetworkList or error will be non-nil. Any non-2xx
  25333. // status code is an error. Response headers are in either
  25334. // *NetworkList.ServerResponse.Header or (if a response was returned at
  25335. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  25336. // to check whether the returned error was because
  25337. // http.StatusNotModified was returned.
  25338. func (c *NetworksListCall) Do(opts ...googleapi.CallOption) (*NetworkList, error) {
  25339. gensupport.SetOptions(c.urlParams_, opts...)
  25340. res, err := c.doRequest("json")
  25341. if res != nil && res.StatusCode == http.StatusNotModified {
  25342. if res.Body != nil {
  25343. res.Body.Close()
  25344. }
  25345. return nil, &googleapi.Error{
  25346. Code: res.StatusCode,
  25347. Header: res.Header,
  25348. }
  25349. }
  25350. if err != nil {
  25351. return nil, err
  25352. }
  25353. defer googleapi.CloseBody(res)
  25354. if err := googleapi.CheckResponse(res); err != nil {
  25355. return nil, err
  25356. }
  25357. ret := &NetworkList{
  25358. ServerResponse: googleapi.ServerResponse{
  25359. Header: res.Header,
  25360. HTTPStatusCode: res.StatusCode,
  25361. },
  25362. }
  25363. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  25364. return nil, err
  25365. }
  25366. return ret, nil
  25367. // {
  25368. // "description": "Retrieves the list of network resources available to the specified project.",
  25369. // "httpMethod": "GET",
  25370. // "id": "compute.networks.list",
  25371. // "parameterOrder": [
  25372. // "project"
  25373. // ],
  25374. // "parameters": {
  25375. // "filter": {
  25376. // "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.",
  25377. // "location": "query",
  25378. // "type": "string"
  25379. // },
  25380. // "maxResults": {
  25381. // "default": "500",
  25382. // "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.",
  25383. // "format": "uint32",
  25384. // "location": "query",
  25385. // "maximum": "500",
  25386. // "minimum": "0",
  25387. // "type": "integer"
  25388. // },
  25389. // "pageToken": {
  25390. // "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.",
  25391. // "location": "query",
  25392. // "type": "string"
  25393. // },
  25394. // "project": {
  25395. // "description": "Project ID for this request.",
  25396. // "location": "path",
  25397. // "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])?))",
  25398. // "required": true,
  25399. // "type": "string"
  25400. // }
  25401. // },
  25402. // "path": "{project}/global/networks",
  25403. // "response": {
  25404. // "$ref": "NetworkList"
  25405. // },
  25406. // "scopes": [
  25407. // "https://www.googleapis.com/auth/cloud-platform",
  25408. // "https://www.googleapis.com/auth/compute",
  25409. // "https://www.googleapis.com/auth/compute.readonly"
  25410. // ]
  25411. // }
  25412. }
  25413. // Pages invokes f for each page of results.
  25414. // A non-nil error returned from f will halt the iteration.
  25415. // The provided context supersedes any context provided to the Context method.
  25416. func (c *NetworksListCall) Pages(ctx context.Context, f func(*NetworkList) error) error {
  25417. c.ctx_ = ctx
  25418. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  25419. for {
  25420. x, err := c.Do()
  25421. if err != nil {
  25422. return err
  25423. }
  25424. if err := f(x); err != nil {
  25425. return err
  25426. }
  25427. if x.NextPageToken == "" {
  25428. return nil
  25429. }
  25430. c.PageToken(x.NextPageToken)
  25431. }
  25432. }
  25433. // method id "compute.projects.get":
  25434. type ProjectsGetCall struct {
  25435. s *Service
  25436. project string
  25437. urlParams_ gensupport.URLParams
  25438. ifNoneMatch_ string
  25439. ctx_ context.Context
  25440. }
  25441. // Get: Returns the specified project resource.
  25442. // For details, see https://cloud.google.com/compute/docs/reference/latest/projects/get
  25443. func (r *ProjectsService) Get(project string) *ProjectsGetCall {
  25444. c := &ProjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25445. c.project = project
  25446. return c
  25447. }
  25448. // Fields allows partial responses to be retrieved. See
  25449. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25450. // for more information.
  25451. func (c *ProjectsGetCall) Fields(s ...googleapi.Field) *ProjectsGetCall {
  25452. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25453. return c
  25454. }
  25455. // IfNoneMatch sets the optional parameter which makes the operation
  25456. // fail if the object's ETag matches the given value. This is useful for
  25457. // getting updates only after the object has changed since the last
  25458. // request. Use googleapi.IsNotModified to check whether the response
  25459. // error from Do is the result of In-None-Match.
  25460. func (c *ProjectsGetCall) IfNoneMatch(entityTag string) *ProjectsGetCall {
  25461. c.ifNoneMatch_ = entityTag
  25462. return c
  25463. }
  25464. // Context sets the context to be used in this call's Do method. Any
  25465. // pending HTTP request will be aborted if the provided context is
  25466. // canceled.
  25467. func (c *ProjectsGetCall) Context(ctx context.Context) *ProjectsGetCall {
  25468. c.ctx_ = ctx
  25469. return c
  25470. }
  25471. func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) {
  25472. var body io.Reader = nil
  25473. c.urlParams_.Set("alt", alt)
  25474. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}")
  25475. urls += "?" + c.urlParams_.Encode()
  25476. req, _ := http.NewRequest("GET", urls, body)
  25477. googleapi.Expand(req.URL, map[string]string{
  25478. "project": c.project,
  25479. })
  25480. req.Header.Set("User-Agent", c.s.userAgent())
  25481. if c.ifNoneMatch_ != "" {
  25482. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  25483. }
  25484. if c.ctx_ != nil {
  25485. return ctxhttp.Do(c.ctx_, c.s.client, req)
  25486. }
  25487. return c.s.client.Do(req)
  25488. }
  25489. // Do executes the "compute.projects.get" call.
  25490. // Exactly one of *Project or error will be non-nil. Any non-2xx status
  25491. // code is an error. Response headers are in either
  25492. // *Project.ServerResponse.Header or (if a response was returned at all)
  25493. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  25494. // check whether the returned error was because http.StatusNotModified
  25495. // was returned.
  25496. func (c *ProjectsGetCall) Do(opts ...googleapi.CallOption) (*Project, error) {
  25497. gensupport.SetOptions(c.urlParams_, opts...)
  25498. res, err := c.doRequest("json")
  25499. if res != nil && res.StatusCode == http.StatusNotModified {
  25500. if res.Body != nil {
  25501. res.Body.Close()
  25502. }
  25503. return nil, &googleapi.Error{
  25504. Code: res.StatusCode,
  25505. Header: res.Header,
  25506. }
  25507. }
  25508. if err != nil {
  25509. return nil, err
  25510. }
  25511. defer googleapi.CloseBody(res)
  25512. if err := googleapi.CheckResponse(res); err != nil {
  25513. return nil, err
  25514. }
  25515. ret := &Project{
  25516. ServerResponse: googleapi.ServerResponse{
  25517. Header: res.Header,
  25518. HTTPStatusCode: res.StatusCode,
  25519. },
  25520. }
  25521. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  25522. return nil, err
  25523. }
  25524. return ret, nil
  25525. // {
  25526. // "description": "Returns the specified project resource.",
  25527. // "httpMethod": "GET",
  25528. // "id": "compute.projects.get",
  25529. // "parameterOrder": [
  25530. // "project"
  25531. // ],
  25532. // "parameters": {
  25533. // "project": {
  25534. // "description": "Project ID for this request.",
  25535. // "location": "path",
  25536. // "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])?))",
  25537. // "required": true,
  25538. // "type": "string"
  25539. // }
  25540. // },
  25541. // "path": "{project}",
  25542. // "response": {
  25543. // "$ref": "Project"
  25544. // },
  25545. // "scopes": [
  25546. // "https://www.googleapis.com/auth/cloud-platform",
  25547. // "https://www.googleapis.com/auth/compute",
  25548. // "https://www.googleapis.com/auth/compute.readonly"
  25549. // ]
  25550. // }
  25551. }
  25552. // method id "compute.projects.moveDisk":
  25553. type ProjectsMoveDiskCall struct {
  25554. s *Service
  25555. project string
  25556. diskmoverequest *DiskMoveRequest
  25557. urlParams_ gensupport.URLParams
  25558. ctx_ context.Context
  25559. }
  25560. // MoveDisk: Moves a persistent disk from one zone to another.
  25561. func (r *ProjectsService) MoveDisk(project string, diskmoverequest *DiskMoveRequest) *ProjectsMoveDiskCall {
  25562. c := &ProjectsMoveDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25563. c.project = project
  25564. c.diskmoverequest = diskmoverequest
  25565. return c
  25566. }
  25567. // Fields allows partial responses to be retrieved. See
  25568. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25569. // for more information.
  25570. func (c *ProjectsMoveDiskCall) Fields(s ...googleapi.Field) *ProjectsMoveDiskCall {
  25571. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25572. return c
  25573. }
  25574. // Context sets the context to be used in this call's Do method. Any
  25575. // pending HTTP request will be aborted if the provided context is
  25576. // canceled.
  25577. func (c *ProjectsMoveDiskCall) Context(ctx context.Context) *ProjectsMoveDiskCall {
  25578. c.ctx_ = ctx
  25579. return c
  25580. }
  25581. func (c *ProjectsMoveDiskCall) doRequest(alt string) (*http.Response, error) {
  25582. var body io.Reader = nil
  25583. body, err := googleapi.WithoutDataWrapper.JSONReader(c.diskmoverequest)
  25584. if err != nil {
  25585. return nil, err
  25586. }
  25587. ctype := "application/json"
  25588. c.urlParams_.Set("alt", alt)
  25589. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/moveDisk")
  25590. urls += "?" + c.urlParams_.Encode()
  25591. req, _ := http.NewRequest("POST", urls, body)
  25592. googleapi.Expand(req.URL, map[string]string{
  25593. "project": c.project,
  25594. })
  25595. req.Header.Set("Content-Type", ctype)
  25596. req.Header.Set("User-Agent", c.s.userAgent())
  25597. if c.ctx_ != nil {
  25598. return ctxhttp.Do(c.ctx_, c.s.client, req)
  25599. }
  25600. return c.s.client.Do(req)
  25601. }
  25602. // Do executes the "compute.projects.moveDisk" call.
  25603. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  25604. // status code is an error. Response headers are in either
  25605. // *Operation.ServerResponse.Header or (if a response was returned at
  25606. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  25607. // to check whether the returned error was because
  25608. // http.StatusNotModified was returned.
  25609. func (c *ProjectsMoveDiskCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  25610. gensupport.SetOptions(c.urlParams_, opts...)
  25611. res, err := c.doRequest("json")
  25612. if res != nil && res.StatusCode == http.StatusNotModified {
  25613. if res.Body != nil {
  25614. res.Body.Close()
  25615. }
  25616. return nil, &googleapi.Error{
  25617. Code: res.StatusCode,
  25618. Header: res.Header,
  25619. }
  25620. }
  25621. if err != nil {
  25622. return nil, err
  25623. }
  25624. defer googleapi.CloseBody(res)
  25625. if err := googleapi.CheckResponse(res); err != nil {
  25626. return nil, err
  25627. }
  25628. ret := &Operation{
  25629. ServerResponse: googleapi.ServerResponse{
  25630. Header: res.Header,
  25631. HTTPStatusCode: res.StatusCode,
  25632. },
  25633. }
  25634. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  25635. return nil, err
  25636. }
  25637. return ret, nil
  25638. // {
  25639. // "description": "Moves a persistent disk from one zone to another.",
  25640. // "httpMethod": "POST",
  25641. // "id": "compute.projects.moveDisk",
  25642. // "parameterOrder": [
  25643. // "project"
  25644. // ],
  25645. // "parameters": {
  25646. // "project": {
  25647. // "description": "Project ID for this request.",
  25648. // "location": "path",
  25649. // "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])?))",
  25650. // "required": true,
  25651. // "type": "string"
  25652. // }
  25653. // },
  25654. // "path": "{project}/moveDisk",
  25655. // "request": {
  25656. // "$ref": "DiskMoveRequest"
  25657. // },
  25658. // "response": {
  25659. // "$ref": "Operation"
  25660. // },
  25661. // "scopes": [
  25662. // "https://www.googleapis.com/auth/cloud-platform",
  25663. // "https://www.googleapis.com/auth/compute"
  25664. // ]
  25665. // }
  25666. }
  25667. // method id "compute.projects.moveInstance":
  25668. type ProjectsMoveInstanceCall struct {
  25669. s *Service
  25670. project string
  25671. instancemoverequest *InstanceMoveRequest
  25672. urlParams_ gensupport.URLParams
  25673. ctx_ context.Context
  25674. }
  25675. // MoveInstance: Moves an instance and its attached persistent disks
  25676. // from one zone to another.
  25677. func (r *ProjectsService) MoveInstance(project string, instancemoverequest *InstanceMoveRequest) *ProjectsMoveInstanceCall {
  25678. c := &ProjectsMoveInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25679. c.project = project
  25680. c.instancemoverequest = instancemoverequest
  25681. return c
  25682. }
  25683. // Fields allows partial responses to be retrieved. See
  25684. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25685. // for more information.
  25686. func (c *ProjectsMoveInstanceCall) Fields(s ...googleapi.Field) *ProjectsMoveInstanceCall {
  25687. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25688. return c
  25689. }
  25690. // Context sets the context to be used in this call's Do method. Any
  25691. // pending HTTP request will be aborted if the provided context is
  25692. // canceled.
  25693. func (c *ProjectsMoveInstanceCall) Context(ctx context.Context) *ProjectsMoveInstanceCall {
  25694. c.ctx_ = ctx
  25695. return c
  25696. }
  25697. func (c *ProjectsMoveInstanceCall) doRequest(alt string) (*http.Response, error) {
  25698. var body io.Reader = nil
  25699. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancemoverequest)
  25700. if err != nil {
  25701. return nil, err
  25702. }
  25703. ctype := "application/json"
  25704. c.urlParams_.Set("alt", alt)
  25705. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/moveInstance")
  25706. urls += "?" + c.urlParams_.Encode()
  25707. req, _ := http.NewRequest("POST", urls, body)
  25708. googleapi.Expand(req.URL, map[string]string{
  25709. "project": c.project,
  25710. })
  25711. req.Header.Set("Content-Type", ctype)
  25712. req.Header.Set("User-Agent", c.s.userAgent())
  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.projects.moveInstance" call.
  25719. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  25720. // status code is an error. Response headers are in either
  25721. // *Operation.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 *ProjectsMoveInstanceCall) Do(opts ...googleapi.CallOption) (*Operation, 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 := &Operation{
  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": "Moves an instance and its attached persistent disks from one zone to another.",
  25756. // "httpMethod": "POST",
  25757. // "id": "compute.projects.moveInstance",
  25758. // "parameterOrder": [
  25759. // "project"
  25760. // ],
  25761. // "parameters": {
  25762. // "project": {
  25763. // "description": "Project ID for this request.",
  25764. // "location": "path",
  25765. // "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])?))",
  25766. // "required": true,
  25767. // "type": "string"
  25768. // }
  25769. // },
  25770. // "path": "{project}/moveInstance",
  25771. // "request": {
  25772. // "$ref": "InstanceMoveRequest"
  25773. // },
  25774. // "response": {
  25775. // "$ref": "Operation"
  25776. // },
  25777. // "scopes": [
  25778. // "https://www.googleapis.com/auth/cloud-platform",
  25779. // "https://www.googleapis.com/auth/compute"
  25780. // ]
  25781. // }
  25782. }
  25783. // method id "compute.projects.setCommonInstanceMetadata":
  25784. type ProjectsSetCommonInstanceMetadataCall struct {
  25785. s *Service
  25786. project string
  25787. metadata *Metadata
  25788. urlParams_ gensupport.URLParams
  25789. ctx_ context.Context
  25790. }
  25791. // SetCommonInstanceMetadata: Sets metadata common to all instances
  25792. // within the specified project using the data included in the request.
  25793. // For details, see https://cloud.google.com/compute/docs/reference/latest/projects/setCommonInstanceMetadata
  25794. func (r *ProjectsService) SetCommonInstanceMetadata(project string, metadata *Metadata) *ProjectsSetCommonInstanceMetadataCall {
  25795. c := &ProjectsSetCommonInstanceMetadataCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25796. c.project = project
  25797. c.metadata = metadata
  25798. return c
  25799. }
  25800. // Fields allows partial responses to be retrieved. See
  25801. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25802. // for more information.
  25803. func (c *ProjectsSetCommonInstanceMetadataCall) Fields(s ...googleapi.Field) *ProjectsSetCommonInstanceMetadataCall {
  25804. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25805. return c
  25806. }
  25807. // Context sets the context to be used in this call's Do method. Any
  25808. // pending HTTP request will be aborted if the provided context is
  25809. // canceled.
  25810. func (c *ProjectsSetCommonInstanceMetadataCall) Context(ctx context.Context) *ProjectsSetCommonInstanceMetadataCall {
  25811. c.ctx_ = ctx
  25812. return c
  25813. }
  25814. func (c *ProjectsSetCommonInstanceMetadataCall) doRequest(alt string) (*http.Response, error) {
  25815. var body io.Reader = nil
  25816. body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata)
  25817. if err != nil {
  25818. return nil, err
  25819. }
  25820. ctype := "application/json"
  25821. c.urlParams_.Set("alt", alt)
  25822. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setCommonInstanceMetadata")
  25823. urls += "?" + c.urlParams_.Encode()
  25824. req, _ := http.NewRequest("POST", urls, body)
  25825. googleapi.Expand(req.URL, map[string]string{
  25826. "project": c.project,
  25827. })
  25828. req.Header.Set("Content-Type", ctype)
  25829. req.Header.Set("User-Agent", c.s.userAgent())
  25830. if c.ctx_ != nil {
  25831. return ctxhttp.Do(c.ctx_, c.s.client, req)
  25832. }
  25833. return c.s.client.Do(req)
  25834. }
  25835. // Do executes the "compute.projects.setCommonInstanceMetadata" call.
  25836. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  25837. // status code is an error. Response headers are in either
  25838. // *Operation.ServerResponse.Header or (if a response was returned at
  25839. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  25840. // to check whether the returned error was because
  25841. // http.StatusNotModified was returned.
  25842. func (c *ProjectsSetCommonInstanceMetadataCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  25843. gensupport.SetOptions(c.urlParams_, opts...)
  25844. res, err := c.doRequest("json")
  25845. if res != nil && res.StatusCode == http.StatusNotModified {
  25846. if res.Body != nil {
  25847. res.Body.Close()
  25848. }
  25849. return nil, &googleapi.Error{
  25850. Code: res.StatusCode,
  25851. Header: res.Header,
  25852. }
  25853. }
  25854. if err != nil {
  25855. return nil, err
  25856. }
  25857. defer googleapi.CloseBody(res)
  25858. if err := googleapi.CheckResponse(res); err != nil {
  25859. return nil, err
  25860. }
  25861. ret := &Operation{
  25862. ServerResponse: googleapi.ServerResponse{
  25863. Header: res.Header,
  25864. HTTPStatusCode: res.StatusCode,
  25865. },
  25866. }
  25867. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  25868. return nil, err
  25869. }
  25870. return ret, nil
  25871. // {
  25872. // "description": "Sets metadata common to all instances within the specified project using the data included in the request.",
  25873. // "httpMethod": "POST",
  25874. // "id": "compute.projects.setCommonInstanceMetadata",
  25875. // "parameterOrder": [
  25876. // "project"
  25877. // ],
  25878. // "parameters": {
  25879. // "project": {
  25880. // "description": "Project ID for this request.",
  25881. // "location": "path",
  25882. // "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])?))",
  25883. // "required": true,
  25884. // "type": "string"
  25885. // }
  25886. // },
  25887. // "path": "{project}/setCommonInstanceMetadata",
  25888. // "request": {
  25889. // "$ref": "Metadata"
  25890. // },
  25891. // "response": {
  25892. // "$ref": "Operation"
  25893. // },
  25894. // "scopes": [
  25895. // "https://www.googleapis.com/auth/cloud-platform",
  25896. // "https://www.googleapis.com/auth/compute"
  25897. // ]
  25898. // }
  25899. }
  25900. // method id "compute.projects.setUsageExportBucket":
  25901. type ProjectsSetUsageExportBucketCall struct {
  25902. s *Service
  25903. project string
  25904. usageexportlocation *UsageExportLocation
  25905. urlParams_ gensupport.URLParams
  25906. ctx_ context.Context
  25907. }
  25908. // SetUsageExportBucket: Enables the usage export feature and sets the
  25909. // usage export bucket where reports are stored. If you provide an empty
  25910. // request body using this method, the usage export feature will be
  25911. // disabled.
  25912. // For details, see https://cloud.google.com/compute/docs/reference/latest/projects/setUsageExportBucket
  25913. func (r *ProjectsService) SetUsageExportBucket(project string, usageexportlocation *UsageExportLocation) *ProjectsSetUsageExportBucketCall {
  25914. c := &ProjectsSetUsageExportBucketCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25915. c.project = project
  25916. c.usageexportlocation = usageexportlocation
  25917. return c
  25918. }
  25919. // Fields allows partial responses to be retrieved. See
  25920. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25921. // for more information.
  25922. func (c *ProjectsSetUsageExportBucketCall) Fields(s ...googleapi.Field) *ProjectsSetUsageExportBucketCall {
  25923. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25924. return c
  25925. }
  25926. // Context sets the context to be used in this call's Do method. Any
  25927. // pending HTTP request will be aborted if the provided context is
  25928. // canceled.
  25929. func (c *ProjectsSetUsageExportBucketCall) Context(ctx context.Context) *ProjectsSetUsageExportBucketCall {
  25930. c.ctx_ = ctx
  25931. return c
  25932. }
  25933. func (c *ProjectsSetUsageExportBucketCall) doRequest(alt string) (*http.Response, error) {
  25934. var body io.Reader = nil
  25935. body, err := googleapi.WithoutDataWrapper.JSONReader(c.usageexportlocation)
  25936. if err != nil {
  25937. return nil, err
  25938. }
  25939. ctype := "application/json"
  25940. c.urlParams_.Set("alt", alt)
  25941. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setUsageExportBucket")
  25942. urls += "?" + c.urlParams_.Encode()
  25943. req, _ := http.NewRequest("POST", urls, body)
  25944. googleapi.Expand(req.URL, map[string]string{
  25945. "project": c.project,
  25946. })
  25947. req.Header.Set("Content-Type", ctype)
  25948. req.Header.Set("User-Agent", c.s.userAgent())
  25949. if c.ctx_ != nil {
  25950. return ctxhttp.Do(c.ctx_, c.s.client, req)
  25951. }
  25952. return c.s.client.Do(req)
  25953. }
  25954. // Do executes the "compute.projects.setUsageExportBucket" call.
  25955. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  25956. // status code is an error. Response headers are in either
  25957. // *Operation.ServerResponse.Header or (if a response was returned at
  25958. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  25959. // to check whether the returned error was because
  25960. // http.StatusNotModified was returned.
  25961. func (c *ProjectsSetUsageExportBucketCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  25962. gensupport.SetOptions(c.urlParams_, opts...)
  25963. res, err := c.doRequest("json")
  25964. if res != nil && res.StatusCode == http.StatusNotModified {
  25965. if res.Body != nil {
  25966. res.Body.Close()
  25967. }
  25968. return nil, &googleapi.Error{
  25969. Code: res.StatusCode,
  25970. Header: res.Header,
  25971. }
  25972. }
  25973. if err != nil {
  25974. return nil, err
  25975. }
  25976. defer googleapi.CloseBody(res)
  25977. if err := googleapi.CheckResponse(res); err != nil {
  25978. return nil, err
  25979. }
  25980. ret := &Operation{
  25981. ServerResponse: googleapi.ServerResponse{
  25982. Header: res.Header,
  25983. HTTPStatusCode: res.StatusCode,
  25984. },
  25985. }
  25986. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  25987. return nil, err
  25988. }
  25989. return ret, nil
  25990. // {
  25991. // "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.",
  25992. // "httpMethod": "POST",
  25993. // "id": "compute.projects.setUsageExportBucket",
  25994. // "parameterOrder": [
  25995. // "project"
  25996. // ],
  25997. // "parameters": {
  25998. // "project": {
  25999. // "description": "Project ID for this request.",
  26000. // "location": "path",
  26001. // "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])?))",
  26002. // "required": true,
  26003. // "type": "string"
  26004. // }
  26005. // },
  26006. // "path": "{project}/setUsageExportBucket",
  26007. // "request": {
  26008. // "$ref": "UsageExportLocation"
  26009. // },
  26010. // "response": {
  26011. // "$ref": "Operation"
  26012. // },
  26013. // "scopes": [
  26014. // "https://www.googleapis.com/auth/cloud-platform",
  26015. // "https://www.googleapis.com/auth/compute",
  26016. // "https://www.googleapis.com/auth/devstorage.full_control",
  26017. // "https://www.googleapis.com/auth/devstorage.read_only",
  26018. // "https://www.googleapis.com/auth/devstorage.read_write"
  26019. // ]
  26020. // }
  26021. }
  26022. // method id "compute.regionOperations.delete":
  26023. type RegionOperationsDeleteCall struct {
  26024. s *Service
  26025. project string
  26026. region string
  26027. operation string
  26028. urlParams_ gensupport.URLParams
  26029. ctx_ context.Context
  26030. }
  26031. // Delete: Deletes the specified region-specific Operations resource.
  26032. // For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/delete
  26033. func (r *RegionOperationsService) Delete(project string, region string, operation string) *RegionOperationsDeleteCall {
  26034. c := &RegionOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26035. c.project = project
  26036. c.region = region
  26037. c.operation = operation
  26038. return c
  26039. }
  26040. // Fields allows partial responses to be retrieved. See
  26041. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26042. // for more information.
  26043. func (c *RegionOperationsDeleteCall) Fields(s ...googleapi.Field) *RegionOperationsDeleteCall {
  26044. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26045. return c
  26046. }
  26047. // Context sets the context to be used in this call's Do method. Any
  26048. // pending HTTP request will be aborted if the provided context is
  26049. // canceled.
  26050. func (c *RegionOperationsDeleteCall) Context(ctx context.Context) *RegionOperationsDeleteCall {
  26051. c.ctx_ = ctx
  26052. return c
  26053. }
  26054. func (c *RegionOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  26055. var body io.Reader = nil
  26056. c.urlParams_.Set("alt", alt)
  26057. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations/{operation}")
  26058. urls += "?" + c.urlParams_.Encode()
  26059. req, _ := http.NewRequest("DELETE", urls, body)
  26060. googleapi.Expand(req.URL, map[string]string{
  26061. "project": c.project,
  26062. "region": c.region,
  26063. "operation": c.operation,
  26064. })
  26065. req.Header.Set("User-Agent", c.s.userAgent())
  26066. if c.ctx_ != nil {
  26067. return ctxhttp.Do(c.ctx_, c.s.client, req)
  26068. }
  26069. return c.s.client.Do(req)
  26070. }
  26071. // Do executes the "compute.regionOperations.delete" call.
  26072. func (c *RegionOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  26073. gensupport.SetOptions(c.urlParams_, opts...)
  26074. res, err := c.doRequest("json")
  26075. if err != nil {
  26076. return err
  26077. }
  26078. defer googleapi.CloseBody(res)
  26079. if err := googleapi.CheckResponse(res); err != nil {
  26080. return err
  26081. }
  26082. return nil
  26083. // {
  26084. // "description": "Deletes the specified region-specific Operations resource.",
  26085. // "httpMethod": "DELETE",
  26086. // "id": "compute.regionOperations.delete",
  26087. // "parameterOrder": [
  26088. // "project",
  26089. // "region",
  26090. // "operation"
  26091. // ],
  26092. // "parameters": {
  26093. // "operation": {
  26094. // "description": "Name of the Operations resource to delete.",
  26095. // "location": "path",
  26096. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  26097. // "required": true,
  26098. // "type": "string"
  26099. // },
  26100. // "project": {
  26101. // "description": "Project ID for this request.",
  26102. // "location": "path",
  26103. // "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])?))",
  26104. // "required": true,
  26105. // "type": "string"
  26106. // },
  26107. // "region": {
  26108. // "description": "Name of the region scoping this request.",
  26109. // "location": "path",
  26110. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  26111. // "required": true,
  26112. // "type": "string"
  26113. // }
  26114. // },
  26115. // "path": "{project}/regions/{region}/operations/{operation}",
  26116. // "scopes": [
  26117. // "https://www.googleapis.com/auth/cloud-platform",
  26118. // "https://www.googleapis.com/auth/compute"
  26119. // ]
  26120. // }
  26121. }
  26122. // method id "compute.regionOperations.get":
  26123. type RegionOperationsGetCall struct {
  26124. s *Service
  26125. project string
  26126. region string
  26127. operation string
  26128. urlParams_ gensupport.URLParams
  26129. ifNoneMatch_ string
  26130. ctx_ context.Context
  26131. }
  26132. // Get: Retrieves the specified region-specific Operations resource.
  26133. // For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/get
  26134. func (r *RegionOperationsService) Get(project string, region string, operation string) *RegionOperationsGetCall {
  26135. c := &RegionOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26136. c.project = project
  26137. c.region = region
  26138. c.operation = operation
  26139. return c
  26140. }
  26141. // Fields allows partial responses to be retrieved. See
  26142. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26143. // for more information.
  26144. func (c *RegionOperationsGetCall) Fields(s ...googleapi.Field) *RegionOperationsGetCall {
  26145. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26146. return c
  26147. }
  26148. // IfNoneMatch sets the optional parameter which makes the operation
  26149. // fail if the object's ETag matches the given value. This is useful for
  26150. // getting updates only after the object has changed since the last
  26151. // request. Use googleapi.IsNotModified to check whether the response
  26152. // error from Do is the result of In-None-Match.
  26153. func (c *RegionOperationsGetCall) IfNoneMatch(entityTag string) *RegionOperationsGetCall {
  26154. c.ifNoneMatch_ = entityTag
  26155. return c
  26156. }
  26157. // Context sets the context to be used in this call's Do method. Any
  26158. // pending HTTP request will be aborted if the provided context is
  26159. // canceled.
  26160. func (c *RegionOperationsGetCall) Context(ctx context.Context) *RegionOperationsGetCall {
  26161. c.ctx_ = ctx
  26162. return c
  26163. }
  26164. func (c *RegionOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  26165. var body io.Reader = nil
  26166. c.urlParams_.Set("alt", alt)
  26167. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations/{operation}")
  26168. urls += "?" + c.urlParams_.Encode()
  26169. req, _ := http.NewRequest("GET", urls, body)
  26170. googleapi.Expand(req.URL, map[string]string{
  26171. "project": c.project,
  26172. "region": c.region,
  26173. "operation": c.operation,
  26174. })
  26175. req.Header.Set("User-Agent", c.s.userAgent())
  26176. if c.ifNoneMatch_ != "" {
  26177. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  26178. }
  26179. if c.ctx_ != nil {
  26180. return ctxhttp.Do(c.ctx_, c.s.client, req)
  26181. }
  26182. return c.s.client.Do(req)
  26183. }
  26184. // Do executes the "compute.regionOperations.get" call.
  26185. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  26186. // status code is an error. Response headers are in either
  26187. // *Operation.ServerResponse.Header or (if a response was returned at
  26188. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  26189. // to check whether the returned error was because
  26190. // http.StatusNotModified was returned.
  26191. func (c *RegionOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  26192. gensupport.SetOptions(c.urlParams_, opts...)
  26193. res, err := c.doRequest("json")
  26194. if res != nil && res.StatusCode == http.StatusNotModified {
  26195. if res.Body != nil {
  26196. res.Body.Close()
  26197. }
  26198. return nil, &googleapi.Error{
  26199. Code: res.StatusCode,
  26200. Header: res.Header,
  26201. }
  26202. }
  26203. if err != nil {
  26204. return nil, err
  26205. }
  26206. defer googleapi.CloseBody(res)
  26207. if err := googleapi.CheckResponse(res); err != nil {
  26208. return nil, err
  26209. }
  26210. ret := &Operation{
  26211. ServerResponse: googleapi.ServerResponse{
  26212. Header: res.Header,
  26213. HTTPStatusCode: res.StatusCode,
  26214. },
  26215. }
  26216. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  26217. return nil, err
  26218. }
  26219. return ret, nil
  26220. // {
  26221. // "description": "Retrieves the specified region-specific Operations resource.",
  26222. // "httpMethod": "GET",
  26223. // "id": "compute.regionOperations.get",
  26224. // "parameterOrder": [
  26225. // "project",
  26226. // "region",
  26227. // "operation"
  26228. // ],
  26229. // "parameters": {
  26230. // "operation": {
  26231. // "description": "Name of the Operations resource to return.",
  26232. // "location": "path",
  26233. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  26234. // "required": true,
  26235. // "type": "string"
  26236. // },
  26237. // "project": {
  26238. // "description": "Project ID for this request.",
  26239. // "location": "path",
  26240. // "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])?))",
  26241. // "required": true,
  26242. // "type": "string"
  26243. // },
  26244. // "region": {
  26245. // "description": "Name of the region scoping this request.",
  26246. // "location": "path",
  26247. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  26248. // "required": true,
  26249. // "type": "string"
  26250. // }
  26251. // },
  26252. // "path": "{project}/regions/{region}/operations/{operation}",
  26253. // "response": {
  26254. // "$ref": "Operation"
  26255. // },
  26256. // "scopes": [
  26257. // "https://www.googleapis.com/auth/cloud-platform",
  26258. // "https://www.googleapis.com/auth/compute",
  26259. // "https://www.googleapis.com/auth/compute.readonly"
  26260. // ]
  26261. // }
  26262. }
  26263. // method id "compute.regionOperations.list":
  26264. type RegionOperationsListCall struct {
  26265. s *Service
  26266. project string
  26267. region string
  26268. urlParams_ gensupport.URLParams
  26269. ifNoneMatch_ string
  26270. ctx_ context.Context
  26271. }
  26272. // List: Retrieves a list of Operation resources contained within the
  26273. // specified region.
  26274. // For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/list
  26275. func (r *RegionOperationsService) List(project string, region string) *RegionOperationsListCall {
  26276. c := &RegionOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26277. c.project = project
  26278. c.region = region
  26279. return c
  26280. }
  26281. // Filter sets the optional parameter "filter": Sets a filter expression
  26282. // for filtering listed resources, in the form filter={expression}. Your
  26283. // {expression} must be in the format: field_name comparison_string
  26284. // literal_string.
  26285. //
  26286. // The field_name is the name of the field you want to compare. Only
  26287. // atomic field types are supported (string, number, boolean). The
  26288. // comparison_string must be either eq (equals) or ne (not equals). The
  26289. // literal_string is the string value to filter to. The literal value
  26290. // must be valid for the type of field you are filtering by (string,
  26291. // number, boolean). For string fields, the literal value is interpreted
  26292. // as a regular expression using RE2 syntax. The literal value must
  26293. // match the entire field.
  26294. //
  26295. // For example, filter=name ne example-instance.
  26296. //
  26297. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  26298. // you can also filter on nested fields. For example, you could filter
  26299. // on instances that have set the scheduling.automaticRestart field to
  26300. // true. In particular, use filtering on nested fields to take advantage
  26301. // of instance labels to organize and filter results based on label
  26302. // values.
  26303. //
  26304. // The Beta API also supports filtering on multiple expressions by
  26305. // providing each separate expression within parentheses. For example,
  26306. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  26307. // Multiple expressions are treated as AND expressions meaning that
  26308. // resources must match all expressions to pass the filters.
  26309. func (c *RegionOperationsListCall) Filter(filter string) *RegionOperationsListCall {
  26310. c.urlParams_.Set("filter", filter)
  26311. return c
  26312. }
  26313. // MaxResults sets the optional parameter "maxResults": The maximum
  26314. // number of results per page that Compute Engine should return. If the
  26315. // number of available results is larger than maxResults, Compute Engine
  26316. // returns a nextPageToken that can be used to get the next page of
  26317. // results in subsequent list requests.
  26318. func (c *RegionOperationsListCall) MaxResults(maxResults int64) *RegionOperationsListCall {
  26319. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  26320. return c
  26321. }
  26322. // PageToken sets the optional parameter "pageToken": Specifies a page
  26323. // token to use. Set pageToken to the nextPageToken returned by a
  26324. // previous list request to get the next page of results.
  26325. func (c *RegionOperationsListCall) PageToken(pageToken string) *RegionOperationsListCall {
  26326. c.urlParams_.Set("pageToken", pageToken)
  26327. return c
  26328. }
  26329. // Fields allows partial responses to be retrieved. See
  26330. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26331. // for more information.
  26332. func (c *RegionOperationsListCall) Fields(s ...googleapi.Field) *RegionOperationsListCall {
  26333. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26334. return c
  26335. }
  26336. // IfNoneMatch sets the optional parameter which makes the operation
  26337. // fail if the object's ETag matches the given value. This is useful for
  26338. // getting updates only after the object has changed since the last
  26339. // request. Use googleapi.IsNotModified to check whether the response
  26340. // error from Do is the result of In-None-Match.
  26341. func (c *RegionOperationsListCall) IfNoneMatch(entityTag string) *RegionOperationsListCall {
  26342. c.ifNoneMatch_ = entityTag
  26343. return c
  26344. }
  26345. // Context sets the context to be used in this call's Do method. Any
  26346. // pending HTTP request will be aborted if the provided context is
  26347. // canceled.
  26348. func (c *RegionOperationsListCall) Context(ctx context.Context) *RegionOperationsListCall {
  26349. c.ctx_ = ctx
  26350. return c
  26351. }
  26352. func (c *RegionOperationsListCall) doRequest(alt string) (*http.Response, error) {
  26353. var body io.Reader = nil
  26354. c.urlParams_.Set("alt", alt)
  26355. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations")
  26356. urls += "?" + c.urlParams_.Encode()
  26357. req, _ := http.NewRequest("GET", urls, body)
  26358. googleapi.Expand(req.URL, map[string]string{
  26359. "project": c.project,
  26360. "region": c.region,
  26361. })
  26362. req.Header.Set("User-Agent", c.s.userAgent())
  26363. if c.ifNoneMatch_ != "" {
  26364. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  26365. }
  26366. if c.ctx_ != nil {
  26367. return ctxhttp.Do(c.ctx_, c.s.client, req)
  26368. }
  26369. return c.s.client.Do(req)
  26370. }
  26371. // Do executes the "compute.regionOperations.list" call.
  26372. // Exactly one of *OperationList or error will be non-nil. Any non-2xx
  26373. // status code is an error. Response headers are in either
  26374. // *OperationList.ServerResponse.Header or (if a response was returned
  26375. // at all) in error.(*googleapi.Error).Header. Use
  26376. // googleapi.IsNotModified to check whether the returned error was
  26377. // because http.StatusNotModified was returned.
  26378. func (c *RegionOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, error) {
  26379. gensupport.SetOptions(c.urlParams_, opts...)
  26380. res, err := c.doRequest("json")
  26381. if res != nil && res.StatusCode == http.StatusNotModified {
  26382. if res.Body != nil {
  26383. res.Body.Close()
  26384. }
  26385. return nil, &googleapi.Error{
  26386. Code: res.StatusCode,
  26387. Header: res.Header,
  26388. }
  26389. }
  26390. if err != nil {
  26391. return nil, err
  26392. }
  26393. defer googleapi.CloseBody(res)
  26394. if err := googleapi.CheckResponse(res); err != nil {
  26395. return nil, err
  26396. }
  26397. ret := &OperationList{
  26398. ServerResponse: googleapi.ServerResponse{
  26399. Header: res.Header,
  26400. HTTPStatusCode: res.StatusCode,
  26401. },
  26402. }
  26403. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  26404. return nil, err
  26405. }
  26406. return ret, nil
  26407. // {
  26408. // "description": "Retrieves a list of Operation resources contained within the specified region.",
  26409. // "httpMethod": "GET",
  26410. // "id": "compute.regionOperations.list",
  26411. // "parameterOrder": [
  26412. // "project",
  26413. // "region"
  26414. // ],
  26415. // "parameters": {
  26416. // "filter": {
  26417. // "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.",
  26418. // "location": "query",
  26419. // "type": "string"
  26420. // },
  26421. // "maxResults": {
  26422. // "default": "500",
  26423. // "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.",
  26424. // "format": "uint32",
  26425. // "location": "query",
  26426. // "maximum": "500",
  26427. // "minimum": "0",
  26428. // "type": "integer"
  26429. // },
  26430. // "pageToken": {
  26431. // "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.",
  26432. // "location": "query",
  26433. // "type": "string"
  26434. // },
  26435. // "project": {
  26436. // "description": "Project ID for this request.",
  26437. // "location": "path",
  26438. // "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])?))",
  26439. // "required": true,
  26440. // "type": "string"
  26441. // },
  26442. // "region": {
  26443. // "description": "Name of the region scoping this request.",
  26444. // "location": "path",
  26445. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  26446. // "required": true,
  26447. // "type": "string"
  26448. // }
  26449. // },
  26450. // "path": "{project}/regions/{region}/operations",
  26451. // "response": {
  26452. // "$ref": "OperationList"
  26453. // },
  26454. // "scopes": [
  26455. // "https://www.googleapis.com/auth/cloud-platform",
  26456. // "https://www.googleapis.com/auth/compute",
  26457. // "https://www.googleapis.com/auth/compute.readonly"
  26458. // ]
  26459. // }
  26460. }
  26461. // Pages invokes f for each page of results.
  26462. // A non-nil error returned from f will halt the iteration.
  26463. // The provided context supersedes any context provided to the Context method.
  26464. func (c *RegionOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
  26465. c.ctx_ = ctx
  26466. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  26467. for {
  26468. x, err := c.Do()
  26469. if err != nil {
  26470. return err
  26471. }
  26472. if err := f(x); err != nil {
  26473. return err
  26474. }
  26475. if x.NextPageToken == "" {
  26476. return nil
  26477. }
  26478. c.PageToken(x.NextPageToken)
  26479. }
  26480. }
  26481. // method id "compute.regions.get":
  26482. type RegionsGetCall struct {
  26483. s *Service
  26484. project string
  26485. region string
  26486. urlParams_ gensupport.URLParams
  26487. ifNoneMatch_ string
  26488. ctx_ context.Context
  26489. }
  26490. // Get: Returns the specified region resource.
  26491. // For details, see https://cloud.google.com/compute/docs/reference/latest/regions/get
  26492. func (r *RegionsService) Get(project string, region string) *RegionsGetCall {
  26493. c := &RegionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26494. c.project = project
  26495. c.region = region
  26496. return c
  26497. }
  26498. // Fields allows partial responses to be retrieved. See
  26499. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26500. // for more information.
  26501. func (c *RegionsGetCall) Fields(s ...googleapi.Field) *RegionsGetCall {
  26502. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26503. return c
  26504. }
  26505. // IfNoneMatch sets the optional parameter which makes the operation
  26506. // fail if the object's ETag matches the given value. This is useful for
  26507. // getting updates only after the object has changed since the last
  26508. // request. Use googleapi.IsNotModified to check whether the response
  26509. // error from Do is the result of In-None-Match.
  26510. func (c *RegionsGetCall) IfNoneMatch(entityTag string) *RegionsGetCall {
  26511. c.ifNoneMatch_ = entityTag
  26512. return c
  26513. }
  26514. // Context sets the context to be used in this call's Do method. Any
  26515. // pending HTTP request will be aborted if the provided context is
  26516. // canceled.
  26517. func (c *RegionsGetCall) Context(ctx context.Context) *RegionsGetCall {
  26518. c.ctx_ = ctx
  26519. return c
  26520. }
  26521. func (c *RegionsGetCall) doRequest(alt string) (*http.Response, error) {
  26522. var body io.Reader = nil
  26523. c.urlParams_.Set("alt", alt)
  26524. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}")
  26525. urls += "?" + c.urlParams_.Encode()
  26526. req, _ := http.NewRequest("GET", urls, body)
  26527. googleapi.Expand(req.URL, map[string]string{
  26528. "project": c.project,
  26529. "region": c.region,
  26530. })
  26531. req.Header.Set("User-Agent", c.s.userAgent())
  26532. if c.ifNoneMatch_ != "" {
  26533. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  26534. }
  26535. if c.ctx_ != nil {
  26536. return ctxhttp.Do(c.ctx_, c.s.client, req)
  26537. }
  26538. return c.s.client.Do(req)
  26539. }
  26540. // Do executes the "compute.regions.get" call.
  26541. // Exactly one of *Region or error will be non-nil. Any non-2xx status
  26542. // code is an error. Response headers are in either
  26543. // *Region.ServerResponse.Header or (if a response was returned at all)
  26544. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  26545. // check whether the returned error was because http.StatusNotModified
  26546. // was returned.
  26547. func (c *RegionsGetCall) Do(opts ...googleapi.CallOption) (*Region, error) {
  26548. gensupport.SetOptions(c.urlParams_, opts...)
  26549. res, err := c.doRequest("json")
  26550. if res != nil && res.StatusCode == http.StatusNotModified {
  26551. if res.Body != nil {
  26552. res.Body.Close()
  26553. }
  26554. return nil, &googleapi.Error{
  26555. Code: res.StatusCode,
  26556. Header: res.Header,
  26557. }
  26558. }
  26559. if err != nil {
  26560. return nil, err
  26561. }
  26562. defer googleapi.CloseBody(res)
  26563. if err := googleapi.CheckResponse(res); err != nil {
  26564. return nil, err
  26565. }
  26566. ret := &Region{
  26567. ServerResponse: googleapi.ServerResponse{
  26568. Header: res.Header,
  26569. HTTPStatusCode: res.StatusCode,
  26570. },
  26571. }
  26572. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  26573. return nil, err
  26574. }
  26575. return ret, nil
  26576. // {
  26577. // "description": "Returns the specified region resource.",
  26578. // "httpMethod": "GET",
  26579. // "id": "compute.regions.get",
  26580. // "parameterOrder": [
  26581. // "project",
  26582. // "region"
  26583. // ],
  26584. // "parameters": {
  26585. // "project": {
  26586. // "description": "Project ID for this request.",
  26587. // "location": "path",
  26588. // "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])?))",
  26589. // "required": true,
  26590. // "type": "string"
  26591. // },
  26592. // "region": {
  26593. // "description": "Name of the region resource to return.",
  26594. // "location": "path",
  26595. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  26596. // "required": true,
  26597. // "type": "string"
  26598. // }
  26599. // },
  26600. // "path": "{project}/regions/{region}",
  26601. // "response": {
  26602. // "$ref": "Region"
  26603. // },
  26604. // "scopes": [
  26605. // "https://www.googleapis.com/auth/cloud-platform",
  26606. // "https://www.googleapis.com/auth/compute",
  26607. // "https://www.googleapis.com/auth/compute.readonly"
  26608. // ]
  26609. // }
  26610. }
  26611. // method id "compute.regions.list":
  26612. type RegionsListCall struct {
  26613. s *Service
  26614. project string
  26615. urlParams_ gensupport.URLParams
  26616. ifNoneMatch_ string
  26617. ctx_ context.Context
  26618. }
  26619. // List: Retrieves the list of region resources available to the
  26620. // specified project.
  26621. // For details, see https://cloud.google.com/compute/docs/reference/latest/regions/list
  26622. func (r *RegionsService) List(project string) *RegionsListCall {
  26623. c := &RegionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26624. c.project = project
  26625. return c
  26626. }
  26627. // Filter sets the optional parameter "filter": Sets a filter expression
  26628. // for filtering listed resources, in the form filter={expression}. Your
  26629. // {expression} must be in the format: field_name comparison_string
  26630. // literal_string.
  26631. //
  26632. // The field_name is the name of the field you want to compare. Only
  26633. // atomic field types are supported (string, number, boolean). The
  26634. // comparison_string must be either eq (equals) or ne (not equals). The
  26635. // literal_string is the string value to filter to. The literal value
  26636. // must be valid for the type of field you are filtering by (string,
  26637. // number, boolean). For string fields, the literal value is interpreted
  26638. // as a regular expression using RE2 syntax. The literal value must
  26639. // match the entire field.
  26640. //
  26641. // For example, filter=name ne example-instance.
  26642. //
  26643. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  26644. // you can also filter on nested fields. For example, you could filter
  26645. // on instances that have set the scheduling.automaticRestart field to
  26646. // true. In particular, use filtering on nested fields to take advantage
  26647. // of instance labels to organize and filter results based on label
  26648. // values.
  26649. //
  26650. // The Beta API also supports filtering on multiple expressions by
  26651. // providing each separate expression within parentheses. For example,
  26652. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  26653. // Multiple expressions are treated as AND expressions meaning that
  26654. // resources must match all expressions to pass the filters.
  26655. func (c *RegionsListCall) Filter(filter string) *RegionsListCall {
  26656. c.urlParams_.Set("filter", filter)
  26657. return c
  26658. }
  26659. // MaxResults sets the optional parameter "maxResults": The maximum
  26660. // number of results per page that Compute Engine should return. If the
  26661. // number of available results is larger than maxResults, Compute Engine
  26662. // returns a nextPageToken that can be used to get the next page of
  26663. // results in subsequent list requests.
  26664. func (c *RegionsListCall) MaxResults(maxResults int64) *RegionsListCall {
  26665. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  26666. return c
  26667. }
  26668. // PageToken sets the optional parameter "pageToken": Specifies a page
  26669. // token to use. Set pageToken to the nextPageToken returned by a
  26670. // previous list request to get the next page of results.
  26671. func (c *RegionsListCall) PageToken(pageToken string) *RegionsListCall {
  26672. c.urlParams_.Set("pageToken", pageToken)
  26673. return c
  26674. }
  26675. // Fields allows partial responses to be retrieved. See
  26676. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26677. // for more information.
  26678. func (c *RegionsListCall) Fields(s ...googleapi.Field) *RegionsListCall {
  26679. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26680. return c
  26681. }
  26682. // IfNoneMatch sets the optional parameter which makes the operation
  26683. // fail if the object's ETag matches the given value. This is useful for
  26684. // getting updates only after the object has changed since the last
  26685. // request. Use googleapi.IsNotModified to check whether the response
  26686. // error from Do is the result of In-None-Match.
  26687. func (c *RegionsListCall) IfNoneMatch(entityTag string) *RegionsListCall {
  26688. c.ifNoneMatch_ = entityTag
  26689. return c
  26690. }
  26691. // Context sets the context to be used in this call's Do method. Any
  26692. // pending HTTP request will be aborted if the provided context is
  26693. // canceled.
  26694. func (c *RegionsListCall) Context(ctx context.Context) *RegionsListCall {
  26695. c.ctx_ = ctx
  26696. return c
  26697. }
  26698. func (c *RegionsListCall) doRequest(alt string) (*http.Response, error) {
  26699. var body io.Reader = nil
  26700. c.urlParams_.Set("alt", alt)
  26701. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions")
  26702. urls += "?" + c.urlParams_.Encode()
  26703. req, _ := http.NewRequest("GET", urls, body)
  26704. googleapi.Expand(req.URL, map[string]string{
  26705. "project": c.project,
  26706. })
  26707. req.Header.Set("User-Agent", c.s.userAgent())
  26708. if c.ifNoneMatch_ != "" {
  26709. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  26710. }
  26711. if c.ctx_ != nil {
  26712. return ctxhttp.Do(c.ctx_, c.s.client, req)
  26713. }
  26714. return c.s.client.Do(req)
  26715. }
  26716. // Do executes the "compute.regions.list" call.
  26717. // Exactly one of *RegionList or error will be non-nil. Any non-2xx
  26718. // status code is an error. Response headers are in either
  26719. // *RegionList.ServerResponse.Header or (if a response was returned at
  26720. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  26721. // to check whether the returned error was because
  26722. // http.StatusNotModified was returned.
  26723. func (c *RegionsListCall) Do(opts ...googleapi.CallOption) (*RegionList, error) {
  26724. gensupport.SetOptions(c.urlParams_, opts...)
  26725. res, err := c.doRequest("json")
  26726. if res != nil && res.StatusCode == http.StatusNotModified {
  26727. if res.Body != nil {
  26728. res.Body.Close()
  26729. }
  26730. return nil, &googleapi.Error{
  26731. Code: res.StatusCode,
  26732. Header: res.Header,
  26733. }
  26734. }
  26735. if err != nil {
  26736. return nil, err
  26737. }
  26738. defer googleapi.CloseBody(res)
  26739. if err := googleapi.CheckResponse(res); err != nil {
  26740. return nil, err
  26741. }
  26742. ret := &RegionList{
  26743. ServerResponse: googleapi.ServerResponse{
  26744. Header: res.Header,
  26745. HTTPStatusCode: res.StatusCode,
  26746. },
  26747. }
  26748. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  26749. return nil, err
  26750. }
  26751. return ret, nil
  26752. // {
  26753. // "description": "Retrieves the list of region resources available to the specified project.",
  26754. // "httpMethod": "GET",
  26755. // "id": "compute.regions.list",
  26756. // "parameterOrder": [
  26757. // "project"
  26758. // ],
  26759. // "parameters": {
  26760. // "filter": {
  26761. // "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.",
  26762. // "location": "query",
  26763. // "type": "string"
  26764. // },
  26765. // "maxResults": {
  26766. // "default": "500",
  26767. // "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.",
  26768. // "format": "uint32",
  26769. // "location": "query",
  26770. // "maximum": "500",
  26771. // "minimum": "0",
  26772. // "type": "integer"
  26773. // },
  26774. // "pageToken": {
  26775. // "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.",
  26776. // "location": "query",
  26777. // "type": "string"
  26778. // },
  26779. // "project": {
  26780. // "description": "Project ID for this request.",
  26781. // "location": "path",
  26782. // "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])?))",
  26783. // "required": true,
  26784. // "type": "string"
  26785. // }
  26786. // },
  26787. // "path": "{project}/regions",
  26788. // "response": {
  26789. // "$ref": "RegionList"
  26790. // },
  26791. // "scopes": [
  26792. // "https://www.googleapis.com/auth/cloud-platform",
  26793. // "https://www.googleapis.com/auth/compute",
  26794. // "https://www.googleapis.com/auth/compute.readonly"
  26795. // ]
  26796. // }
  26797. }
  26798. // Pages invokes f for each page of results.
  26799. // A non-nil error returned from f will halt the iteration.
  26800. // The provided context supersedes any context provided to the Context method.
  26801. func (c *RegionsListCall) Pages(ctx context.Context, f func(*RegionList) error) error {
  26802. c.ctx_ = ctx
  26803. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  26804. for {
  26805. x, err := c.Do()
  26806. if err != nil {
  26807. return err
  26808. }
  26809. if err := f(x); err != nil {
  26810. return err
  26811. }
  26812. if x.NextPageToken == "" {
  26813. return nil
  26814. }
  26815. c.PageToken(x.NextPageToken)
  26816. }
  26817. }
  26818. // method id "compute.routes.delete":
  26819. type RoutesDeleteCall struct {
  26820. s *Service
  26821. project string
  26822. route string
  26823. urlParams_ gensupport.URLParams
  26824. ctx_ context.Context
  26825. }
  26826. // Delete: Deletes the specified route resource.
  26827. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/delete
  26828. func (r *RoutesService) Delete(project string, route string) *RoutesDeleteCall {
  26829. c := &RoutesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26830. c.project = project
  26831. c.route = route
  26832. return c
  26833. }
  26834. // Fields allows partial responses to be retrieved. See
  26835. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26836. // for more information.
  26837. func (c *RoutesDeleteCall) Fields(s ...googleapi.Field) *RoutesDeleteCall {
  26838. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26839. return c
  26840. }
  26841. // Context sets the context to be used in this call's Do method. Any
  26842. // pending HTTP request will be aborted if the provided context is
  26843. // canceled.
  26844. func (c *RoutesDeleteCall) Context(ctx context.Context) *RoutesDeleteCall {
  26845. c.ctx_ = ctx
  26846. return c
  26847. }
  26848. func (c *RoutesDeleteCall) doRequest(alt string) (*http.Response, error) {
  26849. var body io.Reader = nil
  26850. c.urlParams_.Set("alt", alt)
  26851. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes/{route}")
  26852. urls += "?" + c.urlParams_.Encode()
  26853. req, _ := http.NewRequest("DELETE", urls, body)
  26854. googleapi.Expand(req.URL, map[string]string{
  26855. "project": c.project,
  26856. "route": c.route,
  26857. })
  26858. req.Header.Set("User-Agent", c.s.userAgent())
  26859. if c.ctx_ != nil {
  26860. return ctxhttp.Do(c.ctx_, c.s.client, req)
  26861. }
  26862. return c.s.client.Do(req)
  26863. }
  26864. // Do executes the "compute.routes.delete" call.
  26865. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  26866. // status code is an error. Response headers are in either
  26867. // *Operation.ServerResponse.Header or (if a response was returned at
  26868. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  26869. // to check whether the returned error was because
  26870. // http.StatusNotModified was returned.
  26871. func (c *RoutesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  26872. gensupport.SetOptions(c.urlParams_, opts...)
  26873. res, err := c.doRequest("json")
  26874. if res != nil && res.StatusCode == http.StatusNotModified {
  26875. if res.Body != nil {
  26876. res.Body.Close()
  26877. }
  26878. return nil, &googleapi.Error{
  26879. Code: res.StatusCode,
  26880. Header: res.Header,
  26881. }
  26882. }
  26883. if err != nil {
  26884. return nil, err
  26885. }
  26886. defer googleapi.CloseBody(res)
  26887. if err := googleapi.CheckResponse(res); err != nil {
  26888. return nil, err
  26889. }
  26890. ret := &Operation{
  26891. ServerResponse: googleapi.ServerResponse{
  26892. Header: res.Header,
  26893. HTTPStatusCode: res.StatusCode,
  26894. },
  26895. }
  26896. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  26897. return nil, err
  26898. }
  26899. return ret, nil
  26900. // {
  26901. // "description": "Deletes the specified route resource.",
  26902. // "httpMethod": "DELETE",
  26903. // "id": "compute.routes.delete",
  26904. // "parameterOrder": [
  26905. // "project",
  26906. // "route"
  26907. // ],
  26908. // "parameters": {
  26909. // "project": {
  26910. // "description": "Project ID for this request.",
  26911. // "location": "path",
  26912. // "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])?))",
  26913. // "required": true,
  26914. // "type": "string"
  26915. // },
  26916. // "route": {
  26917. // "description": "Name of the route resource to delete.",
  26918. // "location": "path",
  26919. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  26920. // "required": true,
  26921. // "type": "string"
  26922. // }
  26923. // },
  26924. // "path": "{project}/global/routes/{route}",
  26925. // "response": {
  26926. // "$ref": "Operation"
  26927. // },
  26928. // "scopes": [
  26929. // "https://www.googleapis.com/auth/cloud-platform",
  26930. // "https://www.googleapis.com/auth/compute"
  26931. // ]
  26932. // }
  26933. }
  26934. // method id "compute.routes.get":
  26935. type RoutesGetCall struct {
  26936. s *Service
  26937. project string
  26938. route string
  26939. urlParams_ gensupport.URLParams
  26940. ifNoneMatch_ string
  26941. ctx_ context.Context
  26942. }
  26943. // Get: Returns the specified route resource.
  26944. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/get
  26945. func (r *RoutesService) Get(project string, route string) *RoutesGetCall {
  26946. c := &RoutesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26947. c.project = project
  26948. c.route = route
  26949. return c
  26950. }
  26951. // Fields allows partial responses to be retrieved. See
  26952. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26953. // for more information.
  26954. func (c *RoutesGetCall) Fields(s ...googleapi.Field) *RoutesGetCall {
  26955. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26956. return c
  26957. }
  26958. // IfNoneMatch sets the optional parameter which makes the operation
  26959. // fail if the object's ETag matches the given value. This is useful for
  26960. // getting updates only after the object has changed since the last
  26961. // request. Use googleapi.IsNotModified to check whether the response
  26962. // error from Do is the result of In-None-Match.
  26963. func (c *RoutesGetCall) IfNoneMatch(entityTag string) *RoutesGetCall {
  26964. c.ifNoneMatch_ = entityTag
  26965. return c
  26966. }
  26967. // Context sets the context to be used in this call's Do method. Any
  26968. // pending HTTP request will be aborted if the provided context is
  26969. // canceled.
  26970. func (c *RoutesGetCall) Context(ctx context.Context) *RoutesGetCall {
  26971. c.ctx_ = ctx
  26972. return c
  26973. }
  26974. func (c *RoutesGetCall) doRequest(alt string) (*http.Response, error) {
  26975. var body io.Reader = nil
  26976. c.urlParams_.Set("alt", alt)
  26977. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes/{route}")
  26978. urls += "?" + c.urlParams_.Encode()
  26979. req, _ := http.NewRequest("GET", urls, body)
  26980. googleapi.Expand(req.URL, map[string]string{
  26981. "project": c.project,
  26982. "route": c.route,
  26983. })
  26984. req.Header.Set("User-Agent", c.s.userAgent())
  26985. if c.ifNoneMatch_ != "" {
  26986. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  26987. }
  26988. if c.ctx_ != nil {
  26989. return ctxhttp.Do(c.ctx_, c.s.client, req)
  26990. }
  26991. return c.s.client.Do(req)
  26992. }
  26993. // Do executes the "compute.routes.get" call.
  26994. // Exactly one of *Route or error will be non-nil. Any non-2xx status
  26995. // code is an error. Response headers are in either
  26996. // *Route.ServerResponse.Header or (if a response was returned at all)
  26997. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  26998. // check whether the returned error was because http.StatusNotModified
  26999. // was returned.
  27000. func (c *RoutesGetCall) Do(opts ...googleapi.CallOption) (*Route, error) {
  27001. gensupport.SetOptions(c.urlParams_, opts...)
  27002. res, err := c.doRequest("json")
  27003. if res != nil && res.StatusCode == http.StatusNotModified {
  27004. if res.Body != nil {
  27005. res.Body.Close()
  27006. }
  27007. return nil, &googleapi.Error{
  27008. Code: res.StatusCode,
  27009. Header: res.Header,
  27010. }
  27011. }
  27012. if err != nil {
  27013. return nil, err
  27014. }
  27015. defer googleapi.CloseBody(res)
  27016. if err := googleapi.CheckResponse(res); err != nil {
  27017. return nil, err
  27018. }
  27019. ret := &Route{
  27020. ServerResponse: googleapi.ServerResponse{
  27021. Header: res.Header,
  27022. HTTPStatusCode: res.StatusCode,
  27023. },
  27024. }
  27025. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  27026. return nil, err
  27027. }
  27028. return ret, nil
  27029. // {
  27030. // "description": "Returns the specified route resource.",
  27031. // "httpMethod": "GET",
  27032. // "id": "compute.routes.get",
  27033. // "parameterOrder": [
  27034. // "project",
  27035. // "route"
  27036. // ],
  27037. // "parameters": {
  27038. // "project": {
  27039. // "description": "Project ID for this request.",
  27040. // "location": "path",
  27041. // "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])?))",
  27042. // "required": true,
  27043. // "type": "string"
  27044. // },
  27045. // "route": {
  27046. // "description": "Name of the route resource to return.",
  27047. // "location": "path",
  27048. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  27049. // "required": true,
  27050. // "type": "string"
  27051. // }
  27052. // },
  27053. // "path": "{project}/global/routes/{route}",
  27054. // "response": {
  27055. // "$ref": "Route"
  27056. // },
  27057. // "scopes": [
  27058. // "https://www.googleapis.com/auth/cloud-platform",
  27059. // "https://www.googleapis.com/auth/compute",
  27060. // "https://www.googleapis.com/auth/compute.readonly"
  27061. // ]
  27062. // }
  27063. }
  27064. // method id "compute.routes.insert":
  27065. type RoutesInsertCall struct {
  27066. s *Service
  27067. project string
  27068. route *Route
  27069. urlParams_ gensupport.URLParams
  27070. ctx_ context.Context
  27071. }
  27072. // Insert: Creates a route resource in the specified project using the
  27073. // data included in the request.
  27074. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/insert
  27075. func (r *RoutesService) Insert(project string, route *Route) *RoutesInsertCall {
  27076. c := &RoutesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27077. c.project = project
  27078. c.route = route
  27079. return c
  27080. }
  27081. // Fields allows partial responses to be retrieved. See
  27082. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27083. // for more information.
  27084. func (c *RoutesInsertCall) Fields(s ...googleapi.Field) *RoutesInsertCall {
  27085. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27086. return c
  27087. }
  27088. // Context sets the context to be used in this call's Do method. Any
  27089. // pending HTTP request will be aborted if the provided context is
  27090. // canceled.
  27091. func (c *RoutesInsertCall) Context(ctx context.Context) *RoutesInsertCall {
  27092. c.ctx_ = ctx
  27093. return c
  27094. }
  27095. func (c *RoutesInsertCall) doRequest(alt string) (*http.Response, error) {
  27096. var body io.Reader = nil
  27097. body, err := googleapi.WithoutDataWrapper.JSONReader(c.route)
  27098. if err != nil {
  27099. return nil, err
  27100. }
  27101. ctype := "application/json"
  27102. c.urlParams_.Set("alt", alt)
  27103. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes")
  27104. urls += "?" + c.urlParams_.Encode()
  27105. req, _ := http.NewRequest("POST", urls, body)
  27106. googleapi.Expand(req.URL, map[string]string{
  27107. "project": c.project,
  27108. })
  27109. req.Header.Set("Content-Type", ctype)
  27110. req.Header.Set("User-Agent", c.s.userAgent())
  27111. if c.ctx_ != nil {
  27112. return ctxhttp.Do(c.ctx_, c.s.client, req)
  27113. }
  27114. return c.s.client.Do(req)
  27115. }
  27116. // Do executes the "compute.routes.insert" call.
  27117. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  27118. // status code is an error. Response headers are in either
  27119. // *Operation.ServerResponse.Header or (if a response was returned at
  27120. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  27121. // to check whether the returned error was because
  27122. // http.StatusNotModified was returned.
  27123. func (c *RoutesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  27124. gensupport.SetOptions(c.urlParams_, opts...)
  27125. res, err := c.doRequest("json")
  27126. if res != nil && res.StatusCode == http.StatusNotModified {
  27127. if res.Body != nil {
  27128. res.Body.Close()
  27129. }
  27130. return nil, &googleapi.Error{
  27131. Code: res.StatusCode,
  27132. Header: res.Header,
  27133. }
  27134. }
  27135. if err != nil {
  27136. return nil, err
  27137. }
  27138. defer googleapi.CloseBody(res)
  27139. if err := googleapi.CheckResponse(res); err != nil {
  27140. return nil, err
  27141. }
  27142. ret := &Operation{
  27143. ServerResponse: googleapi.ServerResponse{
  27144. Header: res.Header,
  27145. HTTPStatusCode: res.StatusCode,
  27146. },
  27147. }
  27148. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  27149. return nil, err
  27150. }
  27151. return ret, nil
  27152. // {
  27153. // "description": "Creates a route resource in the specified project using the data included in the request.",
  27154. // "httpMethod": "POST",
  27155. // "id": "compute.routes.insert",
  27156. // "parameterOrder": [
  27157. // "project"
  27158. // ],
  27159. // "parameters": {
  27160. // "project": {
  27161. // "description": "Project ID for this request.",
  27162. // "location": "path",
  27163. // "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])?))",
  27164. // "required": true,
  27165. // "type": "string"
  27166. // }
  27167. // },
  27168. // "path": "{project}/global/routes",
  27169. // "request": {
  27170. // "$ref": "Route"
  27171. // },
  27172. // "response": {
  27173. // "$ref": "Operation"
  27174. // },
  27175. // "scopes": [
  27176. // "https://www.googleapis.com/auth/cloud-platform",
  27177. // "https://www.googleapis.com/auth/compute"
  27178. // ]
  27179. // }
  27180. }
  27181. // method id "compute.routes.list":
  27182. type RoutesListCall struct {
  27183. s *Service
  27184. project string
  27185. urlParams_ gensupport.URLParams
  27186. ifNoneMatch_ string
  27187. ctx_ context.Context
  27188. }
  27189. // List: Retrieves the list of route resources available to the
  27190. // specified project.
  27191. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/list
  27192. func (r *RoutesService) List(project string) *RoutesListCall {
  27193. c := &RoutesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27194. c.project = project
  27195. return c
  27196. }
  27197. // Filter sets the optional parameter "filter": Sets a filter expression
  27198. // for filtering listed resources, in the form filter={expression}. Your
  27199. // {expression} must be in the format: field_name comparison_string
  27200. // literal_string.
  27201. //
  27202. // The field_name is the name of the field you want to compare. Only
  27203. // atomic field types are supported (string, number, boolean). The
  27204. // comparison_string must be either eq (equals) or ne (not equals). The
  27205. // literal_string is the string value to filter to. The literal value
  27206. // must be valid for the type of field you are filtering by (string,
  27207. // number, boolean). For string fields, the literal value is interpreted
  27208. // as a regular expression using RE2 syntax. The literal value must
  27209. // match the entire field.
  27210. //
  27211. // For example, filter=name ne example-instance.
  27212. //
  27213. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  27214. // you can also filter on nested fields. For example, you could filter
  27215. // on instances that have set the scheduling.automaticRestart field to
  27216. // true. In particular, use filtering on nested fields to take advantage
  27217. // of instance labels to organize and filter results based on label
  27218. // values.
  27219. //
  27220. // The Beta API also supports filtering on multiple expressions by
  27221. // providing each separate expression within parentheses. For example,
  27222. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  27223. // Multiple expressions are treated as AND expressions meaning that
  27224. // resources must match all expressions to pass the filters.
  27225. func (c *RoutesListCall) Filter(filter string) *RoutesListCall {
  27226. c.urlParams_.Set("filter", filter)
  27227. return c
  27228. }
  27229. // MaxResults sets the optional parameter "maxResults": The maximum
  27230. // number of results per page that Compute Engine should return. If the
  27231. // number of available results is larger than maxResults, Compute Engine
  27232. // returns a nextPageToken that can be used to get the next page of
  27233. // results in subsequent list requests.
  27234. func (c *RoutesListCall) MaxResults(maxResults int64) *RoutesListCall {
  27235. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  27236. return c
  27237. }
  27238. // PageToken sets the optional parameter "pageToken": Specifies a page
  27239. // token to use. Set pageToken to the nextPageToken returned by a
  27240. // previous list request to get the next page of results.
  27241. func (c *RoutesListCall) PageToken(pageToken string) *RoutesListCall {
  27242. c.urlParams_.Set("pageToken", pageToken)
  27243. return c
  27244. }
  27245. // Fields allows partial responses to be retrieved. See
  27246. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27247. // for more information.
  27248. func (c *RoutesListCall) Fields(s ...googleapi.Field) *RoutesListCall {
  27249. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27250. return c
  27251. }
  27252. // IfNoneMatch sets the optional parameter which makes the operation
  27253. // fail if the object's ETag matches the given value. This is useful for
  27254. // getting updates only after the object has changed since the last
  27255. // request. Use googleapi.IsNotModified to check whether the response
  27256. // error from Do is the result of In-None-Match.
  27257. func (c *RoutesListCall) IfNoneMatch(entityTag string) *RoutesListCall {
  27258. c.ifNoneMatch_ = entityTag
  27259. return c
  27260. }
  27261. // Context sets the context to be used in this call's Do method. Any
  27262. // pending HTTP request will be aborted if the provided context is
  27263. // canceled.
  27264. func (c *RoutesListCall) Context(ctx context.Context) *RoutesListCall {
  27265. c.ctx_ = ctx
  27266. return c
  27267. }
  27268. func (c *RoutesListCall) doRequest(alt string) (*http.Response, error) {
  27269. var body io.Reader = nil
  27270. c.urlParams_.Set("alt", alt)
  27271. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes")
  27272. urls += "?" + c.urlParams_.Encode()
  27273. req, _ := http.NewRequest("GET", urls, body)
  27274. googleapi.Expand(req.URL, map[string]string{
  27275. "project": c.project,
  27276. })
  27277. req.Header.Set("User-Agent", c.s.userAgent())
  27278. if c.ifNoneMatch_ != "" {
  27279. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  27280. }
  27281. if c.ctx_ != nil {
  27282. return ctxhttp.Do(c.ctx_, c.s.client, req)
  27283. }
  27284. return c.s.client.Do(req)
  27285. }
  27286. // Do executes the "compute.routes.list" call.
  27287. // Exactly one of *RouteList or error will be non-nil. Any non-2xx
  27288. // status code is an error. Response headers are in either
  27289. // *RouteList.ServerResponse.Header or (if a response was returned at
  27290. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  27291. // to check whether the returned error was because
  27292. // http.StatusNotModified was returned.
  27293. func (c *RoutesListCall) Do(opts ...googleapi.CallOption) (*RouteList, error) {
  27294. gensupport.SetOptions(c.urlParams_, opts...)
  27295. res, err := c.doRequest("json")
  27296. if res != nil && res.StatusCode == http.StatusNotModified {
  27297. if res.Body != nil {
  27298. res.Body.Close()
  27299. }
  27300. return nil, &googleapi.Error{
  27301. Code: res.StatusCode,
  27302. Header: res.Header,
  27303. }
  27304. }
  27305. if err != nil {
  27306. return nil, err
  27307. }
  27308. defer googleapi.CloseBody(res)
  27309. if err := googleapi.CheckResponse(res); err != nil {
  27310. return nil, err
  27311. }
  27312. ret := &RouteList{
  27313. ServerResponse: googleapi.ServerResponse{
  27314. Header: res.Header,
  27315. HTTPStatusCode: res.StatusCode,
  27316. },
  27317. }
  27318. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  27319. return nil, err
  27320. }
  27321. return ret, nil
  27322. // {
  27323. // "description": "Retrieves the list of route resources available to the specified project.",
  27324. // "httpMethod": "GET",
  27325. // "id": "compute.routes.list",
  27326. // "parameterOrder": [
  27327. // "project"
  27328. // ],
  27329. // "parameters": {
  27330. // "filter": {
  27331. // "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.",
  27332. // "location": "query",
  27333. // "type": "string"
  27334. // },
  27335. // "maxResults": {
  27336. // "default": "500",
  27337. // "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.",
  27338. // "format": "uint32",
  27339. // "location": "query",
  27340. // "maximum": "500",
  27341. // "minimum": "0",
  27342. // "type": "integer"
  27343. // },
  27344. // "pageToken": {
  27345. // "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.",
  27346. // "location": "query",
  27347. // "type": "string"
  27348. // },
  27349. // "project": {
  27350. // "description": "Project ID for this request.",
  27351. // "location": "path",
  27352. // "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])?))",
  27353. // "required": true,
  27354. // "type": "string"
  27355. // }
  27356. // },
  27357. // "path": "{project}/global/routes",
  27358. // "response": {
  27359. // "$ref": "RouteList"
  27360. // },
  27361. // "scopes": [
  27362. // "https://www.googleapis.com/auth/cloud-platform",
  27363. // "https://www.googleapis.com/auth/compute",
  27364. // "https://www.googleapis.com/auth/compute.readonly"
  27365. // ]
  27366. // }
  27367. }
  27368. // Pages invokes f for each page of results.
  27369. // A non-nil error returned from f will halt the iteration.
  27370. // The provided context supersedes any context provided to the Context method.
  27371. func (c *RoutesListCall) Pages(ctx context.Context, f func(*RouteList) error) error {
  27372. c.ctx_ = ctx
  27373. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  27374. for {
  27375. x, err := c.Do()
  27376. if err != nil {
  27377. return err
  27378. }
  27379. if err := f(x); err != nil {
  27380. return err
  27381. }
  27382. if x.NextPageToken == "" {
  27383. return nil
  27384. }
  27385. c.PageToken(x.NextPageToken)
  27386. }
  27387. }
  27388. // method id "compute.snapshots.delete":
  27389. type SnapshotsDeleteCall struct {
  27390. s *Service
  27391. project string
  27392. snapshot string
  27393. urlParams_ gensupport.URLParams
  27394. ctx_ context.Context
  27395. }
  27396. // Delete: Deletes the specified Snapshot resource. Keep in mind that
  27397. // deleting a single snapshot might not necessarily delete all the data
  27398. // on that snapshot. If any data on the snapshot that is marked for
  27399. // deletion is needed for subsequent snapshots, the data will be moved
  27400. // to the next corresponding snapshot.
  27401. //
  27402. // For more information, see Deleting snaphots.
  27403. // For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/delete
  27404. func (r *SnapshotsService) Delete(project string, snapshot string) *SnapshotsDeleteCall {
  27405. c := &SnapshotsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27406. c.project = project
  27407. c.snapshot = snapshot
  27408. return c
  27409. }
  27410. // Fields allows partial responses to be retrieved. See
  27411. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27412. // for more information.
  27413. func (c *SnapshotsDeleteCall) Fields(s ...googleapi.Field) *SnapshotsDeleteCall {
  27414. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27415. return c
  27416. }
  27417. // Context sets the context to be used in this call's Do method. Any
  27418. // pending HTTP request will be aborted if the provided context is
  27419. // canceled.
  27420. func (c *SnapshotsDeleteCall) Context(ctx context.Context) *SnapshotsDeleteCall {
  27421. c.ctx_ = ctx
  27422. return c
  27423. }
  27424. func (c *SnapshotsDeleteCall) doRequest(alt string) (*http.Response, error) {
  27425. var body io.Reader = nil
  27426. c.urlParams_.Set("alt", alt)
  27427. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{snapshot}")
  27428. urls += "?" + c.urlParams_.Encode()
  27429. req, _ := http.NewRequest("DELETE", urls, body)
  27430. googleapi.Expand(req.URL, map[string]string{
  27431. "project": c.project,
  27432. "snapshot": c.snapshot,
  27433. })
  27434. req.Header.Set("User-Agent", c.s.userAgent())
  27435. if c.ctx_ != nil {
  27436. return ctxhttp.Do(c.ctx_, c.s.client, req)
  27437. }
  27438. return c.s.client.Do(req)
  27439. }
  27440. // Do executes the "compute.snapshots.delete" call.
  27441. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  27442. // status code is an error. Response headers are in either
  27443. // *Operation.ServerResponse.Header or (if a response was returned at
  27444. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  27445. // to check whether the returned error was because
  27446. // http.StatusNotModified was returned.
  27447. func (c *SnapshotsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  27448. gensupport.SetOptions(c.urlParams_, opts...)
  27449. res, err := c.doRequest("json")
  27450. if res != nil && res.StatusCode == http.StatusNotModified {
  27451. if res.Body != nil {
  27452. res.Body.Close()
  27453. }
  27454. return nil, &googleapi.Error{
  27455. Code: res.StatusCode,
  27456. Header: res.Header,
  27457. }
  27458. }
  27459. if err != nil {
  27460. return nil, err
  27461. }
  27462. defer googleapi.CloseBody(res)
  27463. if err := googleapi.CheckResponse(res); err != nil {
  27464. return nil, err
  27465. }
  27466. ret := &Operation{
  27467. ServerResponse: googleapi.ServerResponse{
  27468. Header: res.Header,
  27469. HTTPStatusCode: res.StatusCode,
  27470. },
  27471. }
  27472. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  27473. return nil, err
  27474. }
  27475. return ret, nil
  27476. // {
  27477. // "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.",
  27478. // "httpMethod": "DELETE",
  27479. // "id": "compute.snapshots.delete",
  27480. // "parameterOrder": [
  27481. // "project",
  27482. // "snapshot"
  27483. // ],
  27484. // "parameters": {
  27485. // "project": {
  27486. // "description": "Project ID for this request.",
  27487. // "location": "path",
  27488. // "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])?))",
  27489. // "required": true,
  27490. // "type": "string"
  27491. // },
  27492. // "snapshot": {
  27493. // "description": "Name of the Snapshot resource to delete.",
  27494. // "location": "path",
  27495. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  27496. // "required": true,
  27497. // "type": "string"
  27498. // }
  27499. // },
  27500. // "path": "{project}/global/snapshots/{snapshot}",
  27501. // "response": {
  27502. // "$ref": "Operation"
  27503. // },
  27504. // "scopes": [
  27505. // "https://www.googleapis.com/auth/cloud-platform",
  27506. // "https://www.googleapis.com/auth/compute"
  27507. // ]
  27508. // }
  27509. }
  27510. // method id "compute.snapshots.get":
  27511. type SnapshotsGetCall struct {
  27512. s *Service
  27513. project string
  27514. snapshot string
  27515. urlParams_ gensupport.URLParams
  27516. ifNoneMatch_ string
  27517. ctx_ context.Context
  27518. }
  27519. // Get: Returns the specified Snapshot resource.
  27520. // For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/get
  27521. func (r *SnapshotsService) Get(project string, snapshot string) *SnapshotsGetCall {
  27522. c := &SnapshotsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27523. c.project = project
  27524. c.snapshot = snapshot
  27525. return c
  27526. }
  27527. // Fields allows partial responses to be retrieved. See
  27528. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27529. // for more information.
  27530. func (c *SnapshotsGetCall) Fields(s ...googleapi.Field) *SnapshotsGetCall {
  27531. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27532. return c
  27533. }
  27534. // IfNoneMatch sets the optional parameter which makes the operation
  27535. // fail if the object's ETag matches the given value. This is useful for
  27536. // getting updates only after the object has changed since the last
  27537. // request. Use googleapi.IsNotModified to check whether the response
  27538. // error from Do is the result of In-None-Match.
  27539. func (c *SnapshotsGetCall) IfNoneMatch(entityTag string) *SnapshotsGetCall {
  27540. c.ifNoneMatch_ = entityTag
  27541. return c
  27542. }
  27543. // Context sets the context to be used in this call's Do method. Any
  27544. // pending HTTP request will be aborted if the provided context is
  27545. // canceled.
  27546. func (c *SnapshotsGetCall) Context(ctx context.Context) *SnapshotsGetCall {
  27547. c.ctx_ = ctx
  27548. return c
  27549. }
  27550. func (c *SnapshotsGetCall) doRequest(alt string) (*http.Response, error) {
  27551. var body io.Reader = nil
  27552. c.urlParams_.Set("alt", alt)
  27553. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{snapshot}")
  27554. urls += "?" + c.urlParams_.Encode()
  27555. req, _ := http.NewRequest("GET", urls, body)
  27556. googleapi.Expand(req.URL, map[string]string{
  27557. "project": c.project,
  27558. "snapshot": c.snapshot,
  27559. })
  27560. req.Header.Set("User-Agent", c.s.userAgent())
  27561. if c.ifNoneMatch_ != "" {
  27562. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  27563. }
  27564. if c.ctx_ != nil {
  27565. return ctxhttp.Do(c.ctx_, c.s.client, req)
  27566. }
  27567. return c.s.client.Do(req)
  27568. }
  27569. // Do executes the "compute.snapshots.get" call.
  27570. // Exactly one of *Snapshot or error will be non-nil. Any non-2xx status
  27571. // code is an error. Response headers are in either
  27572. // *Snapshot.ServerResponse.Header or (if a response was returned at
  27573. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  27574. // to check whether the returned error was because
  27575. // http.StatusNotModified was returned.
  27576. func (c *SnapshotsGetCall) Do(opts ...googleapi.CallOption) (*Snapshot, error) {
  27577. gensupport.SetOptions(c.urlParams_, opts...)
  27578. res, err := c.doRequest("json")
  27579. if res != nil && res.StatusCode == http.StatusNotModified {
  27580. if res.Body != nil {
  27581. res.Body.Close()
  27582. }
  27583. return nil, &googleapi.Error{
  27584. Code: res.StatusCode,
  27585. Header: res.Header,
  27586. }
  27587. }
  27588. if err != nil {
  27589. return nil, err
  27590. }
  27591. defer googleapi.CloseBody(res)
  27592. if err := googleapi.CheckResponse(res); err != nil {
  27593. return nil, err
  27594. }
  27595. ret := &Snapshot{
  27596. ServerResponse: googleapi.ServerResponse{
  27597. Header: res.Header,
  27598. HTTPStatusCode: res.StatusCode,
  27599. },
  27600. }
  27601. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  27602. return nil, err
  27603. }
  27604. return ret, nil
  27605. // {
  27606. // "description": "Returns the specified Snapshot resource.",
  27607. // "httpMethod": "GET",
  27608. // "id": "compute.snapshots.get",
  27609. // "parameterOrder": [
  27610. // "project",
  27611. // "snapshot"
  27612. // ],
  27613. // "parameters": {
  27614. // "project": {
  27615. // "description": "Project ID for this request.",
  27616. // "location": "path",
  27617. // "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])?))",
  27618. // "required": true,
  27619. // "type": "string"
  27620. // },
  27621. // "snapshot": {
  27622. // "description": "Name of the Snapshot resource to return.",
  27623. // "location": "path",
  27624. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  27625. // "required": true,
  27626. // "type": "string"
  27627. // }
  27628. // },
  27629. // "path": "{project}/global/snapshots/{snapshot}",
  27630. // "response": {
  27631. // "$ref": "Snapshot"
  27632. // },
  27633. // "scopes": [
  27634. // "https://www.googleapis.com/auth/cloud-platform",
  27635. // "https://www.googleapis.com/auth/compute",
  27636. // "https://www.googleapis.com/auth/compute.readonly"
  27637. // ]
  27638. // }
  27639. }
  27640. // method id "compute.snapshots.list":
  27641. type SnapshotsListCall struct {
  27642. s *Service
  27643. project string
  27644. urlParams_ gensupport.URLParams
  27645. ifNoneMatch_ string
  27646. ctx_ context.Context
  27647. }
  27648. // List: Retrieves the list of Snapshot resources contained within the
  27649. // specified project.
  27650. // For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/list
  27651. func (r *SnapshotsService) List(project string) *SnapshotsListCall {
  27652. c := &SnapshotsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27653. c.project = project
  27654. return c
  27655. }
  27656. // Filter sets the optional parameter "filter": Sets a filter expression
  27657. // for filtering listed resources, in the form filter={expression}. Your
  27658. // {expression} must be in the format: field_name comparison_string
  27659. // literal_string.
  27660. //
  27661. // The field_name is the name of the field you want to compare. Only
  27662. // atomic field types are supported (string, number, boolean). The
  27663. // comparison_string must be either eq (equals) or ne (not equals). The
  27664. // literal_string is the string value to filter to. The literal value
  27665. // must be valid for the type of field you are filtering by (string,
  27666. // number, boolean). For string fields, the literal value is interpreted
  27667. // as a regular expression using RE2 syntax. The literal value must
  27668. // match the entire field.
  27669. //
  27670. // For example, filter=name ne example-instance.
  27671. //
  27672. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  27673. // you can also filter on nested fields. For example, you could filter
  27674. // on instances that have set the scheduling.automaticRestart field to
  27675. // true. In particular, use filtering on nested fields to take advantage
  27676. // of instance labels to organize and filter results based on label
  27677. // values.
  27678. //
  27679. // The Beta API also supports filtering on multiple expressions by
  27680. // providing each separate expression within parentheses. For example,
  27681. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  27682. // Multiple expressions are treated as AND expressions meaning that
  27683. // resources must match all expressions to pass the filters.
  27684. func (c *SnapshotsListCall) Filter(filter string) *SnapshotsListCall {
  27685. c.urlParams_.Set("filter", filter)
  27686. return c
  27687. }
  27688. // MaxResults sets the optional parameter "maxResults": The maximum
  27689. // number of results per page that Compute Engine should return. If the
  27690. // number of available results is larger than maxResults, Compute Engine
  27691. // returns a nextPageToken that can be used to get the next page of
  27692. // results in subsequent list requests.
  27693. func (c *SnapshotsListCall) MaxResults(maxResults int64) *SnapshotsListCall {
  27694. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  27695. return c
  27696. }
  27697. // PageToken sets the optional parameter "pageToken": Specifies a page
  27698. // token to use. Set pageToken to the nextPageToken returned by a
  27699. // previous list request to get the next page of results.
  27700. func (c *SnapshotsListCall) PageToken(pageToken string) *SnapshotsListCall {
  27701. c.urlParams_.Set("pageToken", pageToken)
  27702. return c
  27703. }
  27704. // Fields allows partial responses to be retrieved. See
  27705. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27706. // for more information.
  27707. func (c *SnapshotsListCall) Fields(s ...googleapi.Field) *SnapshotsListCall {
  27708. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27709. return c
  27710. }
  27711. // IfNoneMatch sets the optional parameter which makes the operation
  27712. // fail if the object's ETag matches the given value. This is useful for
  27713. // getting updates only after the object has changed since the last
  27714. // request. Use googleapi.IsNotModified to check whether the response
  27715. // error from Do is the result of In-None-Match.
  27716. func (c *SnapshotsListCall) IfNoneMatch(entityTag string) *SnapshotsListCall {
  27717. c.ifNoneMatch_ = entityTag
  27718. return c
  27719. }
  27720. // Context sets the context to be used in this call's Do method. Any
  27721. // pending HTTP request will be aborted if the provided context is
  27722. // canceled.
  27723. func (c *SnapshotsListCall) Context(ctx context.Context) *SnapshotsListCall {
  27724. c.ctx_ = ctx
  27725. return c
  27726. }
  27727. func (c *SnapshotsListCall) doRequest(alt string) (*http.Response, error) {
  27728. var body io.Reader = nil
  27729. c.urlParams_.Set("alt", alt)
  27730. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots")
  27731. urls += "?" + c.urlParams_.Encode()
  27732. req, _ := http.NewRequest("GET", urls, body)
  27733. googleapi.Expand(req.URL, map[string]string{
  27734. "project": c.project,
  27735. })
  27736. req.Header.Set("User-Agent", c.s.userAgent())
  27737. if c.ifNoneMatch_ != "" {
  27738. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  27739. }
  27740. if c.ctx_ != nil {
  27741. return ctxhttp.Do(c.ctx_, c.s.client, req)
  27742. }
  27743. return c.s.client.Do(req)
  27744. }
  27745. // Do executes the "compute.snapshots.list" call.
  27746. // Exactly one of *SnapshotList or error will be non-nil. Any non-2xx
  27747. // status code is an error. Response headers are in either
  27748. // *SnapshotList.ServerResponse.Header or (if a response was returned at
  27749. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  27750. // to check whether the returned error was because
  27751. // http.StatusNotModified was returned.
  27752. func (c *SnapshotsListCall) Do(opts ...googleapi.CallOption) (*SnapshotList, error) {
  27753. gensupport.SetOptions(c.urlParams_, opts...)
  27754. res, err := c.doRequest("json")
  27755. if res != nil && res.StatusCode == http.StatusNotModified {
  27756. if res.Body != nil {
  27757. res.Body.Close()
  27758. }
  27759. return nil, &googleapi.Error{
  27760. Code: res.StatusCode,
  27761. Header: res.Header,
  27762. }
  27763. }
  27764. if err != nil {
  27765. return nil, err
  27766. }
  27767. defer googleapi.CloseBody(res)
  27768. if err := googleapi.CheckResponse(res); err != nil {
  27769. return nil, err
  27770. }
  27771. ret := &SnapshotList{
  27772. ServerResponse: googleapi.ServerResponse{
  27773. Header: res.Header,
  27774. HTTPStatusCode: res.StatusCode,
  27775. },
  27776. }
  27777. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  27778. return nil, err
  27779. }
  27780. return ret, nil
  27781. // {
  27782. // "description": "Retrieves the list of Snapshot resources contained within the specified project.",
  27783. // "httpMethod": "GET",
  27784. // "id": "compute.snapshots.list",
  27785. // "parameterOrder": [
  27786. // "project"
  27787. // ],
  27788. // "parameters": {
  27789. // "filter": {
  27790. // "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.",
  27791. // "location": "query",
  27792. // "type": "string"
  27793. // },
  27794. // "maxResults": {
  27795. // "default": "500",
  27796. // "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.",
  27797. // "format": "uint32",
  27798. // "location": "query",
  27799. // "maximum": "500",
  27800. // "minimum": "0",
  27801. // "type": "integer"
  27802. // },
  27803. // "pageToken": {
  27804. // "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.",
  27805. // "location": "query",
  27806. // "type": "string"
  27807. // },
  27808. // "project": {
  27809. // "description": "Project ID for this request.",
  27810. // "location": "path",
  27811. // "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])?))",
  27812. // "required": true,
  27813. // "type": "string"
  27814. // }
  27815. // },
  27816. // "path": "{project}/global/snapshots",
  27817. // "response": {
  27818. // "$ref": "SnapshotList"
  27819. // },
  27820. // "scopes": [
  27821. // "https://www.googleapis.com/auth/cloud-platform",
  27822. // "https://www.googleapis.com/auth/compute",
  27823. // "https://www.googleapis.com/auth/compute.readonly"
  27824. // ]
  27825. // }
  27826. }
  27827. // Pages invokes f for each page of results.
  27828. // A non-nil error returned from f will halt the iteration.
  27829. // The provided context supersedes any context provided to the Context method.
  27830. func (c *SnapshotsListCall) Pages(ctx context.Context, f func(*SnapshotList) error) error {
  27831. c.ctx_ = ctx
  27832. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  27833. for {
  27834. x, err := c.Do()
  27835. if err != nil {
  27836. return err
  27837. }
  27838. if err := f(x); err != nil {
  27839. return err
  27840. }
  27841. if x.NextPageToken == "" {
  27842. return nil
  27843. }
  27844. c.PageToken(x.NextPageToken)
  27845. }
  27846. }
  27847. // method id "compute.sslCertificates.delete":
  27848. type SslCertificatesDeleteCall struct {
  27849. s *Service
  27850. project string
  27851. sslCertificate string
  27852. urlParams_ gensupport.URLParams
  27853. ctx_ context.Context
  27854. }
  27855. // Delete: Deletes the specified SslCertificate resource.
  27856. func (r *SslCertificatesService) Delete(project string, sslCertificate string) *SslCertificatesDeleteCall {
  27857. c := &SslCertificatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27858. c.project = project
  27859. c.sslCertificate = sslCertificate
  27860. return c
  27861. }
  27862. // Fields allows partial responses to be retrieved. See
  27863. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27864. // for more information.
  27865. func (c *SslCertificatesDeleteCall) Fields(s ...googleapi.Field) *SslCertificatesDeleteCall {
  27866. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27867. return c
  27868. }
  27869. // Context sets the context to be used in this call's Do method. Any
  27870. // pending HTTP request will be aborted if the provided context is
  27871. // canceled.
  27872. func (c *SslCertificatesDeleteCall) Context(ctx context.Context) *SslCertificatesDeleteCall {
  27873. c.ctx_ = ctx
  27874. return c
  27875. }
  27876. func (c *SslCertificatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  27877. var body io.Reader = nil
  27878. c.urlParams_.Set("alt", alt)
  27879. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates/{sslCertificate}")
  27880. urls += "?" + c.urlParams_.Encode()
  27881. req, _ := http.NewRequest("DELETE", urls, body)
  27882. googleapi.Expand(req.URL, map[string]string{
  27883. "project": c.project,
  27884. "sslCertificate": c.sslCertificate,
  27885. })
  27886. req.Header.Set("User-Agent", c.s.userAgent())
  27887. if c.ctx_ != nil {
  27888. return ctxhttp.Do(c.ctx_, c.s.client, req)
  27889. }
  27890. return c.s.client.Do(req)
  27891. }
  27892. // Do executes the "compute.sslCertificates.delete" call.
  27893. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  27894. // status code is an error. Response headers are in either
  27895. // *Operation.ServerResponse.Header or (if a response was returned at
  27896. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  27897. // to check whether the returned error was because
  27898. // http.StatusNotModified was returned.
  27899. func (c *SslCertificatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  27900. gensupport.SetOptions(c.urlParams_, opts...)
  27901. res, err := c.doRequest("json")
  27902. if res != nil && res.StatusCode == http.StatusNotModified {
  27903. if res.Body != nil {
  27904. res.Body.Close()
  27905. }
  27906. return nil, &googleapi.Error{
  27907. Code: res.StatusCode,
  27908. Header: res.Header,
  27909. }
  27910. }
  27911. if err != nil {
  27912. return nil, err
  27913. }
  27914. defer googleapi.CloseBody(res)
  27915. if err := googleapi.CheckResponse(res); err != nil {
  27916. return nil, err
  27917. }
  27918. ret := &Operation{
  27919. ServerResponse: googleapi.ServerResponse{
  27920. Header: res.Header,
  27921. HTTPStatusCode: res.StatusCode,
  27922. },
  27923. }
  27924. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  27925. return nil, err
  27926. }
  27927. return ret, nil
  27928. // {
  27929. // "description": "Deletes the specified SslCertificate resource.",
  27930. // "httpMethod": "DELETE",
  27931. // "id": "compute.sslCertificates.delete",
  27932. // "parameterOrder": [
  27933. // "project",
  27934. // "sslCertificate"
  27935. // ],
  27936. // "parameters": {
  27937. // "project": {
  27938. // "description": "Project ID for this request.",
  27939. // "location": "path",
  27940. // "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])?))",
  27941. // "required": true,
  27942. // "type": "string"
  27943. // },
  27944. // "sslCertificate": {
  27945. // "description": "Name of the SslCertificate resource to delete.",
  27946. // "location": "path",
  27947. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  27948. // "required": true,
  27949. // "type": "string"
  27950. // }
  27951. // },
  27952. // "path": "{project}/global/sslCertificates/{sslCertificate}",
  27953. // "response": {
  27954. // "$ref": "Operation"
  27955. // },
  27956. // "scopes": [
  27957. // "https://www.googleapis.com/auth/cloud-platform",
  27958. // "https://www.googleapis.com/auth/compute"
  27959. // ]
  27960. // }
  27961. }
  27962. // method id "compute.sslCertificates.get":
  27963. type SslCertificatesGetCall struct {
  27964. s *Service
  27965. project string
  27966. sslCertificate string
  27967. urlParams_ gensupport.URLParams
  27968. ifNoneMatch_ string
  27969. ctx_ context.Context
  27970. }
  27971. // Get: Returns the specified SslCertificate resource.
  27972. func (r *SslCertificatesService) Get(project string, sslCertificate string) *SslCertificatesGetCall {
  27973. c := &SslCertificatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27974. c.project = project
  27975. c.sslCertificate = sslCertificate
  27976. return c
  27977. }
  27978. // Fields allows partial responses to be retrieved. See
  27979. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27980. // for more information.
  27981. func (c *SslCertificatesGetCall) Fields(s ...googleapi.Field) *SslCertificatesGetCall {
  27982. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27983. return c
  27984. }
  27985. // IfNoneMatch sets the optional parameter which makes the operation
  27986. // fail if the object's ETag matches the given value. This is useful for
  27987. // getting updates only after the object has changed since the last
  27988. // request. Use googleapi.IsNotModified to check whether the response
  27989. // error from Do is the result of In-None-Match.
  27990. func (c *SslCertificatesGetCall) IfNoneMatch(entityTag string) *SslCertificatesGetCall {
  27991. c.ifNoneMatch_ = entityTag
  27992. return c
  27993. }
  27994. // Context sets the context to be used in this call's Do method. Any
  27995. // pending HTTP request will be aborted if the provided context is
  27996. // canceled.
  27997. func (c *SslCertificatesGetCall) Context(ctx context.Context) *SslCertificatesGetCall {
  27998. c.ctx_ = ctx
  27999. return c
  28000. }
  28001. func (c *SslCertificatesGetCall) doRequest(alt string) (*http.Response, error) {
  28002. var body io.Reader = nil
  28003. c.urlParams_.Set("alt", alt)
  28004. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates/{sslCertificate}")
  28005. urls += "?" + c.urlParams_.Encode()
  28006. req, _ := http.NewRequest("GET", urls, body)
  28007. googleapi.Expand(req.URL, map[string]string{
  28008. "project": c.project,
  28009. "sslCertificate": c.sslCertificate,
  28010. })
  28011. req.Header.Set("User-Agent", c.s.userAgent())
  28012. if c.ifNoneMatch_ != "" {
  28013. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  28014. }
  28015. if c.ctx_ != nil {
  28016. return ctxhttp.Do(c.ctx_, c.s.client, req)
  28017. }
  28018. return c.s.client.Do(req)
  28019. }
  28020. // Do executes the "compute.sslCertificates.get" call.
  28021. // Exactly one of *SslCertificate or error will be non-nil. Any non-2xx
  28022. // status code is an error. Response headers are in either
  28023. // *SslCertificate.ServerResponse.Header or (if a response was returned
  28024. // at all) in error.(*googleapi.Error).Header. Use
  28025. // googleapi.IsNotModified to check whether the returned error was
  28026. // because http.StatusNotModified was returned.
  28027. func (c *SslCertificatesGetCall) Do(opts ...googleapi.CallOption) (*SslCertificate, error) {
  28028. gensupport.SetOptions(c.urlParams_, opts...)
  28029. res, err := c.doRequest("json")
  28030. if res != nil && res.StatusCode == http.StatusNotModified {
  28031. if res.Body != nil {
  28032. res.Body.Close()
  28033. }
  28034. return nil, &googleapi.Error{
  28035. Code: res.StatusCode,
  28036. Header: res.Header,
  28037. }
  28038. }
  28039. if err != nil {
  28040. return nil, err
  28041. }
  28042. defer googleapi.CloseBody(res)
  28043. if err := googleapi.CheckResponse(res); err != nil {
  28044. return nil, err
  28045. }
  28046. ret := &SslCertificate{
  28047. ServerResponse: googleapi.ServerResponse{
  28048. Header: res.Header,
  28049. HTTPStatusCode: res.StatusCode,
  28050. },
  28051. }
  28052. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  28053. return nil, err
  28054. }
  28055. return ret, nil
  28056. // {
  28057. // "description": "Returns the specified SslCertificate resource.",
  28058. // "httpMethod": "GET",
  28059. // "id": "compute.sslCertificates.get",
  28060. // "parameterOrder": [
  28061. // "project",
  28062. // "sslCertificate"
  28063. // ],
  28064. // "parameters": {
  28065. // "project": {
  28066. // "description": "Project ID for this request.",
  28067. // "location": "path",
  28068. // "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])?))",
  28069. // "required": true,
  28070. // "type": "string"
  28071. // },
  28072. // "sslCertificate": {
  28073. // "description": "Name of the SslCertificate resource to return.",
  28074. // "location": "path",
  28075. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  28076. // "required": true,
  28077. // "type": "string"
  28078. // }
  28079. // },
  28080. // "path": "{project}/global/sslCertificates/{sslCertificate}",
  28081. // "response": {
  28082. // "$ref": "SslCertificate"
  28083. // },
  28084. // "scopes": [
  28085. // "https://www.googleapis.com/auth/cloud-platform",
  28086. // "https://www.googleapis.com/auth/compute",
  28087. // "https://www.googleapis.com/auth/compute.readonly"
  28088. // ]
  28089. // }
  28090. }
  28091. // method id "compute.sslCertificates.insert":
  28092. type SslCertificatesInsertCall struct {
  28093. s *Service
  28094. project string
  28095. sslcertificate *SslCertificate
  28096. urlParams_ gensupport.URLParams
  28097. ctx_ context.Context
  28098. }
  28099. // Insert: Creates a SslCertificate resource in the specified project
  28100. // using the data included in the request.
  28101. func (r *SslCertificatesService) Insert(project string, sslcertificate *SslCertificate) *SslCertificatesInsertCall {
  28102. c := &SslCertificatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28103. c.project = project
  28104. c.sslcertificate = sslcertificate
  28105. return c
  28106. }
  28107. // Fields allows partial responses to be retrieved. See
  28108. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28109. // for more information.
  28110. func (c *SslCertificatesInsertCall) Fields(s ...googleapi.Field) *SslCertificatesInsertCall {
  28111. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28112. return c
  28113. }
  28114. // Context sets the context to be used in this call's Do method. Any
  28115. // pending HTTP request will be aborted if the provided context is
  28116. // canceled.
  28117. func (c *SslCertificatesInsertCall) Context(ctx context.Context) *SslCertificatesInsertCall {
  28118. c.ctx_ = ctx
  28119. return c
  28120. }
  28121. func (c *SslCertificatesInsertCall) doRequest(alt string) (*http.Response, error) {
  28122. var body io.Reader = nil
  28123. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertificate)
  28124. if err != nil {
  28125. return nil, err
  28126. }
  28127. ctype := "application/json"
  28128. c.urlParams_.Set("alt", alt)
  28129. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates")
  28130. urls += "?" + c.urlParams_.Encode()
  28131. req, _ := http.NewRequest("POST", urls, body)
  28132. googleapi.Expand(req.URL, map[string]string{
  28133. "project": c.project,
  28134. })
  28135. req.Header.Set("Content-Type", ctype)
  28136. req.Header.Set("User-Agent", c.s.userAgent())
  28137. if c.ctx_ != nil {
  28138. return ctxhttp.Do(c.ctx_, c.s.client, req)
  28139. }
  28140. return c.s.client.Do(req)
  28141. }
  28142. // Do executes the "compute.sslCertificates.insert" call.
  28143. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  28144. // status code is an error. Response headers are in either
  28145. // *Operation.ServerResponse.Header or (if a response was returned at
  28146. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  28147. // to check whether the returned error was because
  28148. // http.StatusNotModified was returned.
  28149. func (c *SslCertificatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  28150. gensupport.SetOptions(c.urlParams_, opts...)
  28151. res, err := c.doRequest("json")
  28152. if res != nil && res.StatusCode == http.StatusNotModified {
  28153. if res.Body != nil {
  28154. res.Body.Close()
  28155. }
  28156. return nil, &googleapi.Error{
  28157. Code: res.StatusCode,
  28158. Header: res.Header,
  28159. }
  28160. }
  28161. if err != nil {
  28162. return nil, err
  28163. }
  28164. defer googleapi.CloseBody(res)
  28165. if err := googleapi.CheckResponse(res); err != nil {
  28166. return nil, err
  28167. }
  28168. ret := &Operation{
  28169. ServerResponse: googleapi.ServerResponse{
  28170. Header: res.Header,
  28171. HTTPStatusCode: res.StatusCode,
  28172. },
  28173. }
  28174. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  28175. return nil, err
  28176. }
  28177. return ret, nil
  28178. // {
  28179. // "description": "Creates a SslCertificate resource in the specified project using the data included in the request.",
  28180. // "httpMethod": "POST",
  28181. // "id": "compute.sslCertificates.insert",
  28182. // "parameterOrder": [
  28183. // "project"
  28184. // ],
  28185. // "parameters": {
  28186. // "project": {
  28187. // "description": "Project ID for this request.",
  28188. // "location": "path",
  28189. // "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])?))",
  28190. // "required": true,
  28191. // "type": "string"
  28192. // }
  28193. // },
  28194. // "path": "{project}/global/sslCertificates",
  28195. // "request": {
  28196. // "$ref": "SslCertificate"
  28197. // },
  28198. // "response": {
  28199. // "$ref": "Operation"
  28200. // },
  28201. // "scopes": [
  28202. // "https://www.googleapis.com/auth/cloud-platform",
  28203. // "https://www.googleapis.com/auth/compute"
  28204. // ]
  28205. // }
  28206. }
  28207. // method id "compute.sslCertificates.list":
  28208. type SslCertificatesListCall struct {
  28209. s *Service
  28210. project string
  28211. urlParams_ gensupport.URLParams
  28212. ifNoneMatch_ string
  28213. ctx_ context.Context
  28214. }
  28215. // List: Retrieves the list of SslCertificate resources available to the
  28216. // specified project.
  28217. func (r *SslCertificatesService) List(project string) *SslCertificatesListCall {
  28218. c := &SslCertificatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28219. c.project = project
  28220. return c
  28221. }
  28222. // Filter sets the optional parameter "filter": Sets a filter expression
  28223. // for filtering listed resources, in the form filter={expression}. Your
  28224. // {expression} must be in the format: field_name comparison_string
  28225. // literal_string.
  28226. //
  28227. // The field_name is the name of the field you want to compare. Only
  28228. // atomic field types are supported (string, number, boolean). The
  28229. // comparison_string must be either eq (equals) or ne (not equals). The
  28230. // literal_string is the string value to filter to. The literal value
  28231. // must be valid for the type of field you are filtering by (string,
  28232. // number, boolean). For string fields, the literal value is interpreted
  28233. // as a regular expression using RE2 syntax. The literal value must
  28234. // match the entire field.
  28235. //
  28236. // For example, filter=name ne example-instance.
  28237. //
  28238. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  28239. // you can also filter on nested fields. For example, you could filter
  28240. // on instances that have set the scheduling.automaticRestart field to
  28241. // true. In particular, use filtering on nested fields to take advantage
  28242. // of instance labels to organize and filter results based on label
  28243. // values.
  28244. //
  28245. // The Beta API also supports filtering on multiple expressions by
  28246. // providing each separate expression within parentheses. For example,
  28247. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  28248. // Multiple expressions are treated as AND expressions meaning that
  28249. // resources must match all expressions to pass the filters.
  28250. func (c *SslCertificatesListCall) Filter(filter string) *SslCertificatesListCall {
  28251. c.urlParams_.Set("filter", filter)
  28252. return c
  28253. }
  28254. // MaxResults sets the optional parameter "maxResults": The maximum
  28255. // number of results per page that Compute Engine should return. If the
  28256. // number of available results is larger than maxResults, Compute Engine
  28257. // returns a nextPageToken that can be used to get the next page of
  28258. // results in subsequent list requests.
  28259. func (c *SslCertificatesListCall) MaxResults(maxResults int64) *SslCertificatesListCall {
  28260. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  28261. return c
  28262. }
  28263. // PageToken sets the optional parameter "pageToken": Specifies a page
  28264. // token to use. Set pageToken to the nextPageToken returned by a
  28265. // previous list request to get the next page of results.
  28266. func (c *SslCertificatesListCall) PageToken(pageToken string) *SslCertificatesListCall {
  28267. c.urlParams_.Set("pageToken", pageToken)
  28268. return c
  28269. }
  28270. // Fields allows partial responses to be retrieved. See
  28271. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28272. // for more information.
  28273. func (c *SslCertificatesListCall) Fields(s ...googleapi.Field) *SslCertificatesListCall {
  28274. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28275. return c
  28276. }
  28277. // IfNoneMatch sets the optional parameter which makes the operation
  28278. // fail if the object's ETag matches the given value. This is useful for
  28279. // getting updates only after the object has changed since the last
  28280. // request. Use googleapi.IsNotModified to check whether the response
  28281. // error from Do is the result of In-None-Match.
  28282. func (c *SslCertificatesListCall) IfNoneMatch(entityTag string) *SslCertificatesListCall {
  28283. c.ifNoneMatch_ = entityTag
  28284. return c
  28285. }
  28286. // Context sets the context to be used in this call's Do method. Any
  28287. // pending HTTP request will be aborted if the provided context is
  28288. // canceled.
  28289. func (c *SslCertificatesListCall) Context(ctx context.Context) *SslCertificatesListCall {
  28290. c.ctx_ = ctx
  28291. return c
  28292. }
  28293. func (c *SslCertificatesListCall) doRequest(alt string) (*http.Response, error) {
  28294. var body io.Reader = nil
  28295. c.urlParams_.Set("alt", alt)
  28296. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates")
  28297. urls += "?" + c.urlParams_.Encode()
  28298. req, _ := http.NewRequest("GET", urls, body)
  28299. googleapi.Expand(req.URL, map[string]string{
  28300. "project": c.project,
  28301. })
  28302. req.Header.Set("User-Agent", c.s.userAgent())
  28303. if c.ifNoneMatch_ != "" {
  28304. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  28305. }
  28306. if c.ctx_ != nil {
  28307. return ctxhttp.Do(c.ctx_, c.s.client, req)
  28308. }
  28309. return c.s.client.Do(req)
  28310. }
  28311. // Do executes the "compute.sslCertificates.list" call.
  28312. // Exactly one of *SslCertificateList or error will be non-nil. Any
  28313. // non-2xx status code is an error. Response headers are in either
  28314. // *SslCertificateList.ServerResponse.Header or (if a response was
  28315. // returned at all) in error.(*googleapi.Error).Header. Use
  28316. // googleapi.IsNotModified to check whether the returned error was
  28317. // because http.StatusNotModified was returned.
  28318. func (c *SslCertificatesListCall) Do(opts ...googleapi.CallOption) (*SslCertificateList, error) {
  28319. gensupport.SetOptions(c.urlParams_, opts...)
  28320. res, err := c.doRequest("json")
  28321. if res != nil && res.StatusCode == http.StatusNotModified {
  28322. if res.Body != nil {
  28323. res.Body.Close()
  28324. }
  28325. return nil, &googleapi.Error{
  28326. Code: res.StatusCode,
  28327. Header: res.Header,
  28328. }
  28329. }
  28330. if err != nil {
  28331. return nil, err
  28332. }
  28333. defer googleapi.CloseBody(res)
  28334. if err := googleapi.CheckResponse(res); err != nil {
  28335. return nil, err
  28336. }
  28337. ret := &SslCertificateList{
  28338. ServerResponse: googleapi.ServerResponse{
  28339. Header: res.Header,
  28340. HTTPStatusCode: res.StatusCode,
  28341. },
  28342. }
  28343. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  28344. return nil, err
  28345. }
  28346. return ret, nil
  28347. // {
  28348. // "description": "Retrieves the list of SslCertificate resources available to the specified project.",
  28349. // "httpMethod": "GET",
  28350. // "id": "compute.sslCertificates.list",
  28351. // "parameterOrder": [
  28352. // "project"
  28353. // ],
  28354. // "parameters": {
  28355. // "filter": {
  28356. // "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.",
  28357. // "location": "query",
  28358. // "type": "string"
  28359. // },
  28360. // "maxResults": {
  28361. // "default": "500",
  28362. // "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.",
  28363. // "format": "uint32",
  28364. // "location": "query",
  28365. // "maximum": "500",
  28366. // "minimum": "0",
  28367. // "type": "integer"
  28368. // },
  28369. // "pageToken": {
  28370. // "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.",
  28371. // "location": "query",
  28372. // "type": "string"
  28373. // },
  28374. // "project": {
  28375. // "description": "Project ID for this request.",
  28376. // "location": "path",
  28377. // "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])?))",
  28378. // "required": true,
  28379. // "type": "string"
  28380. // }
  28381. // },
  28382. // "path": "{project}/global/sslCertificates",
  28383. // "response": {
  28384. // "$ref": "SslCertificateList"
  28385. // },
  28386. // "scopes": [
  28387. // "https://www.googleapis.com/auth/cloud-platform",
  28388. // "https://www.googleapis.com/auth/compute",
  28389. // "https://www.googleapis.com/auth/compute.readonly"
  28390. // ]
  28391. // }
  28392. }
  28393. // Pages invokes f for each page of results.
  28394. // A non-nil error returned from f will halt the iteration.
  28395. // The provided context supersedes any context provided to the Context method.
  28396. func (c *SslCertificatesListCall) Pages(ctx context.Context, f func(*SslCertificateList) error) error {
  28397. c.ctx_ = ctx
  28398. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  28399. for {
  28400. x, err := c.Do()
  28401. if err != nil {
  28402. return err
  28403. }
  28404. if err := f(x); err != nil {
  28405. return err
  28406. }
  28407. if x.NextPageToken == "" {
  28408. return nil
  28409. }
  28410. c.PageToken(x.NextPageToken)
  28411. }
  28412. }
  28413. // method id "compute.subnetworks.aggregatedList":
  28414. type SubnetworksAggregatedListCall struct {
  28415. s *Service
  28416. project string
  28417. urlParams_ gensupport.URLParams
  28418. ifNoneMatch_ string
  28419. ctx_ context.Context
  28420. }
  28421. // AggregatedList: Retrieves an aggregated list of subnetworks.
  28422. func (r *SubnetworksService) AggregatedList(project string) *SubnetworksAggregatedListCall {
  28423. c := &SubnetworksAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28424. c.project = project
  28425. return c
  28426. }
  28427. // Filter sets the optional parameter "filter": Sets a filter expression
  28428. // for filtering listed resources, in the form filter={expression}. Your
  28429. // {expression} must be in the format: field_name comparison_string
  28430. // literal_string.
  28431. //
  28432. // The field_name is the name of the field you want to compare. Only
  28433. // atomic field types are supported (string, number, boolean). The
  28434. // comparison_string must be either eq (equals) or ne (not equals). The
  28435. // literal_string is the string value to filter to. The literal value
  28436. // must be valid for the type of field you are filtering by (string,
  28437. // number, boolean). For string fields, the literal value is interpreted
  28438. // as a regular expression using RE2 syntax. The literal value must
  28439. // match the entire field.
  28440. //
  28441. // For example, filter=name ne example-instance.
  28442. //
  28443. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  28444. // you can also filter on nested fields. For example, you could filter
  28445. // on instances that have set the scheduling.automaticRestart field to
  28446. // true. In particular, use filtering on nested fields to take advantage
  28447. // of instance labels to organize and filter results based on label
  28448. // values.
  28449. //
  28450. // The Beta API also supports filtering on multiple expressions by
  28451. // providing each separate expression within parentheses. For example,
  28452. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  28453. // Multiple expressions are treated as AND expressions meaning that
  28454. // resources must match all expressions to pass the filters.
  28455. func (c *SubnetworksAggregatedListCall) Filter(filter string) *SubnetworksAggregatedListCall {
  28456. c.urlParams_.Set("filter", filter)
  28457. return c
  28458. }
  28459. // MaxResults sets the optional parameter "maxResults": The maximum
  28460. // number of results per page that Compute Engine should return. If the
  28461. // number of available results is larger than maxResults, Compute Engine
  28462. // returns a nextPageToken that can be used to get the next page of
  28463. // results in subsequent list requests.
  28464. func (c *SubnetworksAggregatedListCall) MaxResults(maxResults int64) *SubnetworksAggregatedListCall {
  28465. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  28466. return c
  28467. }
  28468. // PageToken sets the optional parameter "pageToken": Specifies a page
  28469. // token to use. Set pageToken to the nextPageToken returned by a
  28470. // previous list request to get the next page of results.
  28471. func (c *SubnetworksAggregatedListCall) PageToken(pageToken string) *SubnetworksAggregatedListCall {
  28472. c.urlParams_.Set("pageToken", pageToken)
  28473. return c
  28474. }
  28475. // Fields allows partial responses to be retrieved. See
  28476. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28477. // for more information.
  28478. func (c *SubnetworksAggregatedListCall) Fields(s ...googleapi.Field) *SubnetworksAggregatedListCall {
  28479. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28480. return c
  28481. }
  28482. // IfNoneMatch sets the optional parameter which makes the operation
  28483. // fail if the object's ETag matches the given value. This is useful for
  28484. // getting updates only after the object has changed since the last
  28485. // request. Use googleapi.IsNotModified to check whether the response
  28486. // error from Do is the result of In-None-Match.
  28487. func (c *SubnetworksAggregatedListCall) IfNoneMatch(entityTag string) *SubnetworksAggregatedListCall {
  28488. c.ifNoneMatch_ = entityTag
  28489. return c
  28490. }
  28491. // Context sets the context to be used in this call's Do method. Any
  28492. // pending HTTP request will be aborted if the provided context is
  28493. // canceled.
  28494. func (c *SubnetworksAggregatedListCall) Context(ctx context.Context) *SubnetworksAggregatedListCall {
  28495. c.ctx_ = ctx
  28496. return c
  28497. }
  28498. func (c *SubnetworksAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  28499. var body io.Reader = nil
  28500. c.urlParams_.Set("alt", alt)
  28501. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/subnetworks")
  28502. urls += "?" + c.urlParams_.Encode()
  28503. req, _ := http.NewRequest("GET", urls, body)
  28504. googleapi.Expand(req.URL, map[string]string{
  28505. "project": c.project,
  28506. })
  28507. req.Header.Set("User-Agent", c.s.userAgent())
  28508. if c.ifNoneMatch_ != "" {
  28509. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  28510. }
  28511. if c.ctx_ != nil {
  28512. return ctxhttp.Do(c.ctx_, c.s.client, req)
  28513. }
  28514. return c.s.client.Do(req)
  28515. }
  28516. // Do executes the "compute.subnetworks.aggregatedList" call.
  28517. // Exactly one of *SubnetworkAggregatedList or error will be non-nil.
  28518. // Any non-2xx status code is an error. Response headers are in either
  28519. // *SubnetworkAggregatedList.ServerResponse.Header or (if a response was
  28520. // returned at all) in error.(*googleapi.Error).Header. Use
  28521. // googleapi.IsNotModified to check whether the returned error was
  28522. // because http.StatusNotModified was returned.
  28523. func (c *SubnetworksAggregatedListCall) Do(opts ...googleapi.CallOption) (*SubnetworkAggregatedList, error) {
  28524. gensupport.SetOptions(c.urlParams_, opts...)
  28525. res, err := c.doRequest("json")
  28526. if res != nil && res.StatusCode == http.StatusNotModified {
  28527. if res.Body != nil {
  28528. res.Body.Close()
  28529. }
  28530. return nil, &googleapi.Error{
  28531. Code: res.StatusCode,
  28532. Header: res.Header,
  28533. }
  28534. }
  28535. if err != nil {
  28536. return nil, err
  28537. }
  28538. defer googleapi.CloseBody(res)
  28539. if err := googleapi.CheckResponse(res); err != nil {
  28540. return nil, err
  28541. }
  28542. ret := &SubnetworkAggregatedList{
  28543. ServerResponse: googleapi.ServerResponse{
  28544. Header: res.Header,
  28545. HTTPStatusCode: res.StatusCode,
  28546. },
  28547. }
  28548. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  28549. return nil, err
  28550. }
  28551. return ret, nil
  28552. // {
  28553. // "description": "Retrieves an aggregated list of subnetworks.",
  28554. // "httpMethod": "GET",
  28555. // "id": "compute.subnetworks.aggregatedList",
  28556. // "parameterOrder": [
  28557. // "project"
  28558. // ],
  28559. // "parameters": {
  28560. // "filter": {
  28561. // "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.",
  28562. // "location": "query",
  28563. // "type": "string"
  28564. // },
  28565. // "maxResults": {
  28566. // "default": "500",
  28567. // "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.",
  28568. // "format": "uint32",
  28569. // "location": "query",
  28570. // "maximum": "500",
  28571. // "minimum": "0",
  28572. // "type": "integer"
  28573. // },
  28574. // "pageToken": {
  28575. // "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.",
  28576. // "location": "query",
  28577. // "type": "string"
  28578. // },
  28579. // "project": {
  28580. // "description": "Project ID for this request.",
  28581. // "location": "path",
  28582. // "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])?))",
  28583. // "required": true,
  28584. // "type": "string"
  28585. // }
  28586. // },
  28587. // "path": "{project}/aggregated/subnetworks",
  28588. // "response": {
  28589. // "$ref": "SubnetworkAggregatedList"
  28590. // },
  28591. // "scopes": [
  28592. // "https://www.googleapis.com/auth/cloud-platform",
  28593. // "https://www.googleapis.com/auth/compute",
  28594. // "https://www.googleapis.com/auth/compute.readonly"
  28595. // ]
  28596. // }
  28597. }
  28598. // Pages invokes f for each page of results.
  28599. // A non-nil error returned from f will halt the iteration.
  28600. // The provided context supersedes any context provided to the Context method.
  28601. func (c *SubnetworksAggregatedListCall) Pages(ctx context.Context, f func(*SubnetworkAggregatedList) error) error {
  28602. c.ctx_ = ctx
  28603. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  28604. for {
  28605. x, err := c.Do()
  28606. if err != nil {
  28607. return err
  28608. }
  28609. if err := f(x); err != nil {
  28610. return err
  28611. }
  28612. if x.NextPageToken == "" {
  28613. return nil
  28614. }
  28615. c.PageToken(x.NextPageToken)
  28616. }
  28617. }
  28618. // method id "compute.subnetworks.delete":
  28619. type SubnetworksDeleteCall struct {
  28620. s *Service
  28621. project string
  28622. region string
  28623. subnetwork string
  28624. urlParams_ gensupport.URLParams
  28625. ctx_ context.Context
  28626. }
  28627. // Delete: Deletes the specified subnetwork.
  28628. func (r *SubnetworksService) Delete(project string, region string, subnetwork string) *SubnetworksDeleteCall {
  28629. c := &SubnetworksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28630. c.project = project
  28631. c.region = region
  28632. c.subnetwork = subnetwork
  28633. return c
  28634. }
  28635. // Fields allows partial responses to be retrieved. See
  28636. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28637. // for more information.
  28638. func (c *SubnetworksDeleteCall) Fields(s ...googleapi.Field) *SubnetworksDeleteCall {
  28639. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28640. return c
  28641. }
  28642. // Context sets the context to be used in this call's Do method. Any
  28643. // pending HTTP request will be aborted if the provided context is
  28644. // canceled.
  28645. func (c *SubnetworksDeleteCall) Context(ctx context.Context) *SubnetworksDeleteCall {
  28646. c.ctx_ = ctx
  28647. return c
  28648. }
  28649. func (c *SubnetworksDeleteCall) doRequest(alt string) (*http.Response, error) {
  28650. var body io.Reader = nil
  28651. c.urlParams_.Set("alt", alt)
  28652. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}")
  28653. urls += "?" + c.urlParams_.Encode()
  28654. req, _ := http.NewRequest("DELETE", urls, body)
  28655. googleapi.Expand(req.URL, map[string]string{
  28656. "project": c.project,
  28657. "region": c.region,
  28658. "subnetwork": c.subnetwork,
  28659. })
  28660. req.Header.Set("User-Agent", c.s.userAgent())
  28661. if c.ctx_ != nil {
  28662. return ctxhttp.Do(c.ctx_, c.s.client, req)
  28663. }
  28664. return c.s.client.Do(req)
  28665. }
  28666. // Do executes the "compute.subnetworks.delete" call.
  28667. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  28668. // status code is an error. Response headers are in either
  28669. // *Operation.ServerResponse.Header or (if a response was returned at
  28670. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  28671. // to check whether the returned error was because
  28672. // http.StatusNotModified was returned.
  28673. func (c *SubnetworksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  28674. gensupport.SetOptions(c.urlParams_, opts...)
  28675. res, err := c.doRequest("json")
  28676. if res != nil && res.StatusCode == http.StatusNotModified {
  28677. if res.Body != nil {
  28678. res.Body.Close()
  28679. }
  28680. return nil, &googleapi.Error{
  28681. Code: res.StatusCode,
  28682. Header: res.Header,
  28683. }
  28684. }
  28685. if err != nil {
  28686. return nil, err
  28687. }
  28688. defer googleapi.CloseBody(res)
  28689. if err := googleapi.CheckResponse(res); err != nil {
  28690. return nil, err
  28691. }
  28692. ret := &Operation{
  28693. ServerResponse: googleapi.ServerResponse{
  28694. Header: res.Header,
  28695. HTTPStatusCode: res.StatusCode,
  28696. },
  28697. }
  28698. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  28699. return nil, err
  28700. }
  28701. return ret, nil
  28702. // {
  28703. // "description": "Deletes the specified subnetwork.",
  28704. // "httpMethod": "DELETE",
  28705. // "id": "compute.subnetworks.delete",
  28706. // "parameterOrder": [
  28707. // "project",
  28708. // "region",
  28709. // "subnetwork"
  28710. // ],
  28711. // "parameters": {
  28712. // "project": {
  28713. // "description": "Project ID for this request.",
  28714. // "location": "path",
  28715. // "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])?))",
  28716. // "required": true,
  28717. // "type": "string"
  28718. // },
  28719. // "region": {
  28720. // "description": "Name of the region scoping this request.",
  28721. // "location": "path",
  28722. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  28723. // "required": true,
  28724. // "type": "string"
  28725. // },
  28726. // "subnetwork": {
  28727. // "description": "Name of the Subnetwork resource to delete.",
  28728. // "location": "path",
  28729. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  28730. // "required": true,
  28731. // "type": "string"
  28732. // }
  28733. // },
  28734. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}",
  28735. // "response": {
  28736. // "$ref": "Operation"
  28737. // },
  28738. // "scopes": [
  28739. // "https://www.googleapis.com/auth/cloud-platform",
  28740. // "https://www.googleapis.com/auth/compute"
  28741. // ]
  28742. // }
  28743. }
  28744. // method id "compute.subnetworks.get":
  28745. type SubnetworksGetCall struct {
  28746. s *Service
  28747. project string
  28748. region string
  28749. subnetwork string
  28750. urlParams_ gensupport.URLParams
  28751. ifNoneMatch_ string
  28752. ctx_ context.Context
  28753. }
  28754. // Get: Returns the specified subnetwork.
  28755. func (r *SubnetworksService) Get(project string, region string, subnetwork string) *SubnetworksGetCall {
  28756. c := &SubnetworksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28757. c.project = project
  28758. c.region = region
  28759. c.subnetwork = subnetwork
  28760. return c
  28761. }
  28762. // Fields allows partial responses to be retrieved. See
  28763. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28764. // for more information.
  28765. func (c *SubnetworksGetCall) Fields(s ...googleapi.Field) *SubnetworksGetCall {
  28766. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28767. return c
  28768. }
  28769. // IfNoneMatch sets the optional parameter which makes the operation
  28770. // fail if the object's ETag matches the given value. This is useful for
  28771. // getting updates only after the object has changed since the last
  28772. // request. Use googleapi.IsNotModified to check whether the response
  28773. // error from Do is the result of In-None-Match.
  28774. func (c *SubnetworksGetCall) IfNoneMatch(entityTag string) *SubnetworksGetCall {
  28775. c.ifNoneMatch_ = entityTag
  28776. return c
  28777. }
  28778. // Context sets the context to be used in this call's Do method. Any
  28779. // pending HTTP request will be aborted if the provided context is
  28780. // canceled.
  28781. func (c *SubnetworksGetCall) Context(ctx context.Context) *SubnetworksGetCall {
  28782. c.ctx_ = ctx
  28783. return c
  28784. }
  28785. func (c *SubnetworksGetCall) doRequest(alt string) (*http.Response, error) {
  28786. var body io.Reader = nil
  28787. c.urlParams_.Set("alt", alt)
  28788. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}")
  28789. urls += "?" + c.urlParams_.Encode()
  28790. req, _ := http.NewRequest("GET", urls, body)
  28791. googleapi.Expand(req.URL, map[string]string{
  28792. "project": c.project,
  28793. "region": c.region,
  28794. "subnetwork": c.subnetwork,
  28795. })
  28796. req.Header.Set("User-Agent", c.s.userAgent())
  28797. if c.ifNoneMatch_ != "" {
  28798. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  28799. }
  28800. if c.ctx_ != nil {
  28801. return ctxhttp.Do(c.ctx_, c.s.client, req)
  28802. }
  28803. return c.s.client.Do(req)
  28804. }
  28805. // Do executes the "compute.subnetworks.get" call.
  28806. // Exactly one of *Subnetwork or error will be non-nil. Any non-2xx
  28807. // status code is an error. Response headers are in either
  28808. // *Subnetwork.ServerResponse.Header or (if a response was returned at
  28809. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  28810. // to check whether the returned error was because
  28811. // http.StatusNotModified was returned.
  28812. func (c *SubnetworksGetCall) Do(opts ...googleapi.CallOption) (*Subnetwork, error) {
  28813. gensupport.SetOptions(c.urlParams_, opts...)
  28814. res, err := c.doRequest("json")
  28815. if res != nil && res.StatusCode == http.StatusNotModified {
  28816. if res.Body != nil {
  28817. res.Body.Close()
  28818. }
  28819. return nil, &googleapi.Error{
  28820. Code: res.StatusCode,
  28821. Header: res.Header,
  28822. }
  28823. }
  28824. if err != nil {
  28825. return nil, err
  28826. }
  28827. defer googleapi.CloseBody(res)
  28828. if err := googleapi.CheckResponse(res); err != nil {
  28829. return nil, err
  28830. }
  28831. ret := &Subnetwork{
  28832. ServerResponse: googleapi.ServerResponse{
  28833. Header: res.Header,
  28834. HTTPStatusCode: res.StatusCode,
  28835. },
  28836. }
  28837. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  28838. return nil, err
  28839. }
  28840. return ret, nil
  28841. // {
  28842. // "description": "Returns the specified subnetwork.",
  28843. // "httpMethod": "GET",
  28844. // "id": "compute.subnetworks.get",
  28845. // "parameterOrder": [
  28846. // "project",
  28847. // "region",
  28848. // "subnetwork"
  28849. // ],
  28850. // "parameters": {
  28851. // "project": {
  28852. // "description": "Project ID for this request.",
  28853. // "location": "path",
  28854. // "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])?))",
  28855. // "required": true,
  28856. // "type": "string"
  28857. // },
  28858. // "region": {
  28859. // "description": "Name of the region scoping this request.",
  28860. // "location": "path",
  28861. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  28862. // "required": true,
  28863. // "type": "string"
  28864. // },
  28865. // "subnetwork": {
  28866. // "description": "Name of the Subnetwork resource to return.",
  28867. // "location": "path",
  28868. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  28869. // "required": true,
  28870. // "type": "string"
  28871. // }
  28872. // },
  28873. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}",
  28874. // "response": {
  28875. // "$ref": "Subnetwork"
  28876. // },
  28877. // "scopes": [
  28878. // "https://www.googleapis.com/auth/cloud-platform",
  28879. // "https://www.googleapis.com/auth/compute",
  28880. // "https://www.googleapis.com/auth/compute.readonly"
  28881. // ]
  28882. // }
  28883. }
  28884. // method id "compute.subnetworks.insert":
  28885. type SubnetworksInsertCall struct {
  28886. s *Service
  28887. project string
  28888. region string
  28889. subnetwork *Subnetwork
  28890. urlParams_ gensupport.URLParams
  28891. ctx_ context.Context
  28892. }
  28893. // Insert: Creates a subnetwork in the specified project using the data
  28894. // included in the request.
  28895. func (r *SubnetworksService) Insert(project string, region string, subnetwork *Subnetwork) *SubnetworksInsertCall {
  28896. c := &SubnetworksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28897. c.project = project
  28898. c.region = region
  28899. c.subnetwork = subnetwork
  28900. return c
  28901. }
  28902. // Fields allows partial responses to be retrieved. See
  28903. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28904. // for more information.
  28905. func (c *SubnetworksInsertCall) Fields(s ...googleapi.Field) *SubnetworksInsertCall {
  28906. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28907. return c
  28908. }
  28909. // Context sets the context to be used in this call's Do method. Any
  28910. // pending HTTP request will be aborted if the provided context is
  28911. // canceled.
  28912. func (c *SubnetworksInsertCall) Context(ctx context.Context) *SubnetworksInsertCall {
  28913. c.ctx_ = ctx
  28914. return c
  28915. }
  28916. func (c *SubnetworksInsertCall) doRequest(alt string) (*http.Response, error) {
  28917. var body io.Reader = nil
  28918. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetwork)
  28919. if err != nil {
  28920. return nil, err
  28921. }
  28922. ctype := "application/json"
  28923. c.urlParams_.Set("alt", alt)
  28924. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks")
  28925. urls += "?" + c.urlParams_.Encode()
  28926. req, _ := http.NewRequest("POST", urls, body)
  28927. googleapi.Expand(req.URL, map[string]string{
  28928. "project": c.project,
  28929. "region": c.region,
  28930. })
  28931. req.Header.Set("Content-Type", ctype)
  28932. req.Header.Set("User-Agent", c.s.userAgent())
  28933. if c.ctx_ != nil {
  28934. return ctxhttp.Do(c.ctx_, c.s.client, req)
  28935. }
  28936. return c.s.client.Do(req)
  28937. }
  28938. // Do executes the "compute.subnetworks.insert" call.
  28939. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  28940. // status code is an error. Response headers are in either
  28941. // *Operation.ServerResponse.Header or (if a response was returned at
  28942. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  28943. // to check whether the returned error was because
  28944. // http.StatusNotModified was returned.
  28945. func (c *SubnetworksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  28946. gensupport.SetOptions(c.urlParams_, opts...)
  28947. res, err := c.doRequest("json")
  28948. if res != nil && res.StatusCode == http.StatusNotModified {
  28949. if res.Body != nil {
  28950. res.Body.Close()
  28951. }
  28952. return nil, &googleapi.Error{
  28953. Code: res.StatusCode,
  28954. Header: res.Header,
  28955. }
  28956. }
  28957. if err != nil {
  28958. return nil, err
  28959. }
  28960. defer googleapi.CloseBody(res)
  28961. if err := googleapi.CheckResponse(res); err != nil {
  28962. return nil, err
  28963. }
  28964. ret := &Operation{
  28965. ServerResponse: googleapi.ServerResponse{
  28966. Header: res.Header,
  28967. HTTPStatusCode: res.StatusCode,
  28968. },
  28969. }
  28970. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  28971. return nil, err
  28972. }
  28973. return ret, nil
  28974. // {
  28975. // "description": "Creates a subnetwork in the specified project using the data included in the request.",
  28976. // "httpMethod": "POST",
  28977. // "id": "compute.subnetworks.insert",
  28978. // "parameterOrder": [
  28979. // "project",
  28980. // "region"
  28981. // ],
  28982. // "parameters": {
  28983. // "project": {
  28984. // "description": "Project ID for this request.",
  28985. // "location": "path",
  28986. // "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])?))",
  28987. // "required": true,
  28988. // "type": "string"
  28989. // },
  28990. // "region": {
  28991. // "description": "Name of the region scoping this request.",
  28992. // "location": "path",
  28993. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  28994. // "required": true,
  28995. // "type": "string"
  28996. // }
  28997. // },
  28998. // "path": "{project}/regions/{region}/subnetworks",
  28999. // "request": {
  29000. // "$ref": "Subnetwork"
  29001. // },
  29002. // "response": {
  29003. // "$ref": "Operation"
  29004. // },
  29005. // "scopes": [
  29006. // "https://www.googleapis.com/auth/cloud-platform",
  29007. // "https://www.googleapis.com/auth/compute"
  29008. // ]
  29009. // }
  29010. }
  29011. // method id "compute.subnetworks.list":
  29012. type SubnetworksListCall struct {
  29013. s *Service
  29014. project string
  29015. region string
  29016. urlParams_ gensupport.URLParams
  29017. ifNoneMatch_ string
  29018. ctx_ context.Context
  29019. }
  29020. // List: Retrieves a list of subnetworks available to the specified
  29021. // project.
  29022. func (r *SubnetworksService) List(project string, region string) *SubnetworksListCall {
  29023. c := &SubnetworksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29024. c.project = project
  29025. c.region = region
  29026. return c
  29027. }
  29028. // Filter sets the optional parameter "filter": Sets a filter expression
  29029. // for filtering listed resources, in the form filter={expression}. Your
  29030. // {expression} must be in the format: field_name comparison_string
  29031. // literal_string.
  29032. //
  29033. // The field_name is the name of the field you want to compare. Only
  29034. // atomic field types are supported (string, number, boolean). The
  29035. // comparison_string must be either eq (equals) or ne (not equals). The
  29036. // literal_string is the string value to filter to. The literal value
  29037. // must be valid for the type of field you are filtering by (string,
  29038. // number, boolean). For string fields, the literal value is interpreted
  29039. // as a regular expression using RE2 syntax. The literal value must
  29040. // match the entire field.
  29041. //
  29042. // For example, filter=name ne example-instance.
  29043. //
  29044. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  29045. // you can also filter on nested fields. For example, you could filter
  29046. // on instances that have set the scheduling.automaticRestart field to
  29047. // true. In particular, use filtering on nested fields to take advantage
  29048. // of instance labels to organize and filter results based on label
  29049. // values.
  29050. //
  29051. // The Beta API also supports filtering on multiple expressions by
  29052. // providing each separate expression within parentheses. For example,
  29053. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  29054. // Multiple expressions are treated as AND expressions meaning that
  29055. // resources must match all expressions to pass the filters.
  29056. func (c *SubnetworksListCall) Filter(filter string) *SubnetworksListCall {
  29057. c.urlParams_.Set("filter", filter)
  29058. return c
  29059. }
  29060. // MaxResults sets the optional parameter "maxResults": The maximum
  29061. // number of results per page that Compute Engine should return. If the
  29062. // number of available results is larger than maxResults, Compute Engine
  29063. // returns a nextPageToken that can be used to get the next page of
  29064. // results in subsequent list requests.
  29065. func (c *SubnetworksListCall) MaxResults(maxResults int64) *SubnetworksListCall {
  29066. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  29067. return c
  29068. }
  29069. // PageToken sets the optional parameter "pageToken": Specifies a page
  29070. // token to use. Set pageToken to the nextPageToken returned by a
  29071. // previous list request to get the next page of results.
  29072. func (c *SubnetworksListCall) PageToken(pageToken string) *SubnetworksListCall {
  29073. c.urlParams_.Set("pageToken", pageToken)
  29074. return c
  29075. }
  29076. // Fields allows partial responses to be retrieved. See
  29077. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29078. // for more information.
  29079. func (c *SubnetworksListCall) Fields(s ...googleapi.Field) *SubnetworksListCall {
  29080. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29081. return c
  29082. }
  29083. // IfNoneMatch sets the optional parameter which makes the operation
  29084. // fail if the object's ETag matches the given value. This is useful for
  29085. // getting updates only after the object has changed since the last
  29086. // request. Use googleapi.IsNotModified to check whether the response
  29087. // error from Do is the result of In-None-Match.
  29088. func (c *SubnetworksListCall) IfNoneMatch(entityTag string) *SubnetworksListCall {
  29089. c.ifNoneMatch_ = entityTag
  29090. return c
  29091. }
  29092. // Context sets the context to be used in this call's Do method. Any
  29093. // pending HTTP request will be aborted if the provided context is
  29094. // canceled.
  29095. func (c *SubnetworksListCall) Context(ctx context.Context) *SubnetworksListCall {
  29096. c.ctx_ = ctx
  29097. return c
  29098. }
  29099. func (c *SubnetworksListCall) doRequest(alt string) (*http.Response, error) {
  29100. var body io.Reader = nil
  29101. c.urlParams_.Set("alt", alt)
  29102. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks")
  29103. urls += "?" + c.urlParams_.Encode()
  29104. req, _ := http.NewRequest("GET", urls, body)
  29105. googleapi.Expand(req.URL, map[string]string{
  29106. "project": c.project,
  29107. "region": c.region,
  29108. })
  29109. req.Header.Set("User-Agent", c.s.userAgent())
  29110. if c.ifNoneMatch_ != "" {
  29111. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  29112. }
  29113. if c.ctx_ != nil {
  29114. return ctxhttp.Do(c.ctx_, c.s.client, req)
  29115. }
  29116. return c.s.client.Do(req)
  29117. }
  29118. // Do executes the "compute.subnetworks.list" call.
  29119. // Exactly one of *SubnetworkList or error will be non-nil. Any non-2xx
  29120. // status code is an error. Response headers are in either
  29121. // *SubnetworkList.ServerResponse.Header or (if a response was returned
  29122. // at all) in error.(*googleapi.Error).Header. Use
  29123. // googleapi.IsNotModified to check whether the returned error was
  29124. // because http.StatusNotModified was returned.
  29125. func (c *SubnetworksListCall) Do(opts ...googleapi.CallOption) (*SubnetworkList, error) {
  29126. gensupport.SetOptions(c.urlParams_, opts...)
  29127. res, err := c.doRequest("json")
  29128. if res != nil && res.StatusCode == http.StatusNotModified {
  29129. if res.Body != nil {
  29130. res.Body.Close()
  29131. }
  29132. return nil, &googleapi.Error{
  29133. Code: res.StatusCode,
  29134. Header: res.Header,
  29135. }
  29136. }
  29137. if err != nil {
  29138. return nil, err
  29139. }
  29140. defer googleapi.CloseBody(res)
  29141. if err := googleapi.CheckResponse(res); err != nil {
  29142. return nil, err
  29143. }
  29144. ret := &SubnetworkList{
  29145. ServerResponse: googleapi.ServerResponse{
  29146. Header: res.Header,
  29147. HTTPStatusCode: res.StatusCode,
  29148. },
  29149. }
  29150. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  29151. return nil, err
  29152. }
  29153. return ret, nil
  29154. // {
  29155. // "description": "Retrieves a list of subnetworks available to the specified project.",
  29156. // "httpMethod": "GET",
  29157. // "id": "compute.subnetworks.list",
  29158. // "parameterOrder": [
  29159. // "project",
  29160. // "region"
  29161. // ],
  29162. // "parameters": {
  29163. // "filter": {
  29164. // "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.",
  29165. // "location": "query",
  29166. // "type": "string"
  29167. // },
  29168. // "maxResults": {
  29169. // "default": "500",
  29170. // "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.",
  29171. // "format": "uint32",
  29172. // "location": "query",
  29173. // "maximum": "500",
  29174. // "minimum": "0",
  29175. // "type": "integer"
  29176. // },
  29177. // "pageToken": {
  29178. // "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.",
  29179. // "location": "query",
  29180. // "type": "string"
  29181. // },
  29182. // "project": {
  29183. // "description": "Project ID for this request.",
  29184. // "location": "path",
  29185. // "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])?))",
  29186. // "required": true,
  29187. // "type": "string"
  29188. // },
  29189. // "region": {
  29190. // "description": "Name of the region scoping this request.",
  29191. // "location": "path",
  29192. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  29193. // "required": true,
  29194. // "type": "string"
  29195. // }
  29196. // },
  29197. // "path": "{project}/regions/{region}/subnetworks",
  29198. // "response": {
  29199. // "$ref": "SubnetworkList"
  29200. // },
  29201. // "scopes": [
  29202. // "https://www.googleapis.com/auth/cloud-platform",
  29203. // "https://www.googleapis.com/auth/compute",
  29204. // "https://www.googleapis.com/auth/compute.readonly"
  29205. // ]
  29206. // }
  29207. }
  29208. // Pages invokes f for each page of results.
  29209. // A non-nil error returned from f will halt the iteration.
  29210. // The provided context supersedes any context provided to the Context method.
  29211. func (c *SubnetworksListCall) Pages(ctx context.Context, f func(*SubnetworkList) error) error {
  29212. c.ctx_ = ctx
  29213. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  29214. for {
  29215. x, err := c.Do()
  29216. if err != nil {
  29217. return err
  29218. }
  29219. if err := f(x); err != nil {
  29220. return err
  29221. }
  29222. if x.NextPageToken == "" {
  29223. return nil
  29224. }
  29225. c.PageToken(x.NextPageToken)
  29226. }
  29227. }
  29228. // method id "compute.targetHttpProxies.delete":
  29229. type TargetHttpProxiesDeleteCall struct {
  29230. s *Service
  29231. project string
  29232. targetHttpProxy string
  29233. urlParams_ gensupport.URLParams
  29234. ctx_ context.Context
  29235. }
  29236. // Delete: Deletes the specified TargetHttpProxy resource.
  29237. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/delete
  29238. func (r *TargetHttpProxiesService) Delete(project string, targetHttpProxy string) *TargetHttpProxiesDeleteCall {
  29239. c := &TargetHttpProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29240. c.project = project
  29241. c.targetHttpProxy = targetHttpProxy
  29242. return c
  29243. }
  29244. // Fields allows partial responses to be retrieved. See
  29245. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29246. // for more information.
  29247. func (c *TargetHttpProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetHttpProxiesDeleteCall {
  29248. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29249. return c
  29250. }
  29251. // Context sets the context to be used in this call's Do method. Any
  29252. // pending HTTP request will be aborted if the provided context is
  29253. // canceled.
  29254. func (c *TargetHttpProxiesDeleteCall) Context(ctx context.Context) *TargetHttpProxiesDeleteCall {
  29255. c.ctx_ = ctx
  29256. return c
  29257. }
  29258. func (c *TargetHttpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  29259. var body io.Reader = nil
  29260. c.urlParams_.Set("alt", alt)
  29261. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies/{targetHttpProxy}")
  29262. urls += "?" + c.urlParams_.Encode()
  29263. req, _ := http.NewRequest("DELETE", urls, body)
  29264. googleapi.Expand(req.URL, map[string]string{
  29265. "project": c.project,
  29266. "targetHttpProxy": c.targetHttpProxy,
  29267. })
  29268. req.Header.Set("User-Agent", c.s.userAgent())
  29269. if c.ctx_ != nil {
  29270. return ctxhttp.Do(c.ctx_, c.s.client, req)
  29271. }
  29272. return c.s.client.Do(req)
  29273. }
  29274. // Do executes the "compute.targetHttpProxies.delete" call.
  29275. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  29276. // status code is an error. Response headers are in either
  29277. // *Operation.ServerResponse.Header or (if a response was returned at
  29278. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  29279. // to check whether the returned error was because
  29280. // http.StatusNotModified was returned.
  29281. func (c *TargetHttpProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  29282. gensupport.SetOptions(c.urlParams_, opts...)
  29283. res, err := c.doRequest("json")
  29284. if res != nil && res.StatusCode == http.StatusNotModified {
  29285. if res.Body != nil {
  29286. res.Body.Close()
  29287. }
  29288. return nil, &googleapi.Error{
  29289. Code: res.StatusCode,
  29290. Header: res.Header,
  29291. }
  29292. }
  29293. if err != nil {
  29294. return nil, err
  29295. }
  29296. defer googleapi.CloseBody(res)
  29297. if err := googleapi.CheckResponse(res); err != nil {
  29298. return nil, err
  29299. }
  29300. ret := &Operation{
  29301. ServerResponse: googleapi.ServerResponse{
  29302. Header: res.Header,
  29303. HTTPStatusCode: res.StatusCode,
  29304. },
  29305. }
  29306. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  29307. return nil, err
  29308. }
  29309. return ret, nil
  29310. // {
  29311. // "description": "Deletes the specified TargetHttpProxy resource.",
  29312. // "httpMethod": "DELETE",
  29313. // "id": "compute.targetHttpProxies.delete",
  29314. // "parameterOrder": [
  29315. // "project",
  29316. // "targetHttpProxy"
  29317. // ],
  29318. // "parameters": {
  29319. // "project": {
  29320. // "description": "Project ID for this request.",
  29321. // "location": "path",
  29322. // "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])?))",
  29323. // "required": true,
  29324. // "type": "string"
  29325. // },
  29326. // "targetHttpProxy": {
  29327. // "description": "Name of the TargetHttpProxy resource to delete.",
  29328. // "location": "path",
  29329. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  29330. // "required": true,
  29331. // "type": "string"
  29332. // }
  29333. // },
  29334. // "path": "{project}/global/targetHttpProxies/{targetHttpProxy}",
  29335. // "response": {
  29336. // "$ref": "Operation"
  29337. // },
  29338. // "scopes": [
  29339. // "https://www.googleapis.com/auth/cloud-platform",
  29340. // "https://www.googleapis.com/auth/compute"
  29341. // ]
  29342. // }
  29343. }
  29344. // method id "compute.targetHttpProxies.get":
  29345. type TargetHttpProxiesGetCall struct {
  29346. s *Service
  29347. project string
  29348. targetHttpProxy string
  29349. urlParams_ gensupport.URLParams
  29350. ifNoneMatch_ string
  29351. ctx_ context.Context
  29352. }
  29353. // Get: Returns the specified TargetHttpProxy resource.
  29354. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/get
  29355. func (r *TargetHttpProxiesService) Get(project string, targetHttpProxy string) *TargetHttpProxiesGetCall {
  29356. c := &TargetHttpProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29357. c.project = project
  29358. c.targetHttpProxy = targetHttpProxy
  29359. return c
  29360. }
  29361. // Fields allows partial responses to be retrieved. See
  29362. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29363. // for more information.
  29364. func (c *TargetHttpProxiesGetCall) Fields(s ...googleapi.Field) *TargetHttpProxiesGetCall {
  29365. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29366. return c
  29367. }
  29368. // IfNoneMatch sets the optional parameter which makes the operation
  29369. // fail if the object's ETag matches the given value. This is useful for
  29370. // getting updates only after the object has changed since the last
  29371. // request. Use googleapi.IsNotModified to check whether the response
  29372. // error from Do is the result of In-None-Match.
  29373. func (c *TargetHttpProxiesGetCall) IfNoneMatch(entityTag string) *TargetHttpProxiesGetCall {
  29374. c.ifNoneMatch_ = entityTag
  29375. return c
  29376. }
  29377. // Context sets the context to be used in this call's Do method. Any
  29378. // pending HTTP request will be aborted if the provided context is
  29379. // canceled.
  29380. func (c *TargetHttpProxiesGetCall) Context(ctx context.Context) *TargetHttpProxiesGetCall {
  29381. c.ctx_ = ctx
  29382. return c
  29383. }
  29384. func (c *TargetHttpProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  29385. var body io.Reader = nil
  29386. c.urlParams_.Set("alt", alt)
  29387. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies/{targetHttpProxy}")
  29388. urls += "?" + c.urlParams_.Encode()
  29389. req, _ := http.NewRequest("GET", urls, body)
  29390. googleapi.Expand(req.URL, map[string]string{
  29391. "project": c.project,
  29392. "targetHttpProxy": c.targetHttpProxy,
  29393. })
  29394. req.Header.Set("User-Agent", c.s.userAgent())
  29395. if c.ifNoneMatch_ != "" {
  29396. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  29397. }
  29398. if c.ctx_ != nil {
  29399. return ctxhttp.Do(c.ctx_, c.s.client, req)
  29400. }
  29401. return c.s.client.Do(req)
  29402. }
  29403. // Do executes the "compute.targetHttpProxies.get" call.
  29404. // Exactly one of *TargetHttpProxy or error will be non-nil. Any non-2xx
  29405. // status code is an error. Response headers are in either
  29406. // *TargetHttpProxy.ServerResponse.Header or (if a response was returned
  29407. // at all) in error.(*googleapi.Error).Header. Use
  29408. // googleapi.IsNotModified to check whether the returned error was
  29409. // because http.StatusNotModified was returned.
  29410. func (c *TargetHttpProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetHttpProxy, error) {
  29411. gensupport.SetOptions(c.urlParams_, opts...)
  29412. res, err := c.doRequest("json")
  29413. if res != nil && res.StatusCode == http.StatusNotModified {
  29414. if res.Body != nil {
  29415. res.Body.Close()
  29416. }
  29417. return nil, &googleapi.Error{
  29418. Code: res.StatusCode,
  29419. Header: res.Header,
  29420. }
  29421. }
  29422. if err != nil {
  29423. return nil, err
  29424. }
  29425. defer googleapi.CloseBody(res)
  29426. if err := googleapi.CheckResponse(res); err != nil {
  29427. return nil, err
  29428. }
  29429. ret := &TargetHttpProxy{
  29430. ServerResponse: googleapi.ServerResponse{
  29431. Header: res.Header,
  29432. HTTPStatusCode: res.StatusCode,
  29433. },
  29434. }
  29435. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  29436. return nil, err
  29437. }
  29438. return ret, nil
  29439. // {
  29440. // "description": "Returns the specified TargetHttpProxy resource.",
  29441. // "httpMethod": "GET",
  29442. // "id": "compute.targetHttpProxies.get",
  29443. // "parameterOrder": [
  29444. // "project",
  29445. // "targetHttpProxy"
  29446. // ],
  29447. // "parameters": {
  29448. // "project": {
  29449. // "description": "Project ID for this request.",
  29450. // "location": "path",
  29451. // "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])?))",
  29452. // "required": true,
  29453. // "type": "string"
  29454. // },
  29455. // "targetHttpProxy": {
  29456. // "description": "Name of the TargetHttpProxy resource to return.",
  29457. // "location": "path",
  29458. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  29459. // "required": true,
  29460. // "type": "string"
  29461. // }
  29462. // },
  29463. // "path": "{project}/global/targetHttpProxies/{targetHttpProxy}",
  29464. // "response": {
  29465. // "$ref": "TargetHttpProxy"
  29466. // },
  29467. // "scopes": [
  29468. // "https://www.googleapis.com/auth/cloud-platform",
  29469. // "https://www.googleapis.com/auth/compute",
  29470. // "https://www.googleapis.com/auth/compute.readonly"
  29471. // ]
  29472. // }
  29473. }
  29474. // method id "compute.targetHttpProxies.insert":
  29475. type TargetHttpProxiesInsertCall struct {
  29476. s *Service
  29477. project string
  29478. targethttpproxy *TargetHttpProxy
  29479. urlParams_ gensupport.URLParams
  29480. ctx_ context.Context
  29481. }
  29482. // Insert: Creates a TargetHttpProxy resource in the specified project
  29483. // using the data included in the request.
  29484. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/insert
  29485. func (r *TargetHttpProxiesService) Insert(project string, targethttpproxy *TargetHttpProxy) *TargetHttpProxiesInsertCall {
  29486. c := &TargetHttpProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29487. c.project = project
  29488. c.targethttpproxy = targethttpproxy
  29489. return c
  29490. }
  29491. // Fields allows partial responses to be retrieved. See
  29492. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29493. // for more information.
  29494. func (c *TargetHttpProxiesInsertCall) Fields(s ...googleapi.Field) *TargetHttpProxiesInsertCall {
  29495. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29496. return c
  29497. }
  29498. // Context sets the context to be used in this call's Do method. Any
  29499. // pending HTTP request will be aborted if the provided context is
  29500. // canceled.
  29501. func (c *TargetHttpProxiesInsertCall) Context(ctx context.Context) *TargetHttpProxiesInsertCall {
  29502. c.ctx_ = ctx
  29503. return c
  29504. }
  29505. func (c *TargetHttpProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  29506. var body io.Reader = nil
  29507. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpproxy)
  29508. if err != nil {
  29509. return nil, err
  29510. }
  29511. ctype := "application/json"
  29512. c.urlParams_.Set("alt", alt)
  29513. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies")
  29514. urls += "?" + c.urlParams_.Encode()
  29515. req, _ := http.NewRequest("POST", urls, body)
  29516. googleapi.Expand(req.URL, map[string]string{
  29517. "project": c.project,
  29518. })
  29519. req.Header.Set("Content-Type", ctype)
  29520. req.Header.Set("User-Agent", c.s.userAgent())
  29521. if c.ctx_ != nil {
  29522. return ctxhttp.Do(c.ctx_, c.s.client, req)
  29523. }
  29524. return c.s.client.Do(req)
  29525. }
  29526. // Do executes the "compute.targetHttpProxies.insert" call.
  29527. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  29528. // status code is an error. Response headers are in either
  29529. // *Operation.ServerResponse.Header or (if a response was returned at
  29530. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  29531. // to check whether the returned error was because
  29532. // http.StatusNotModified was returned.
  29533. func (c *TargetHttpProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  29534. gensupport.SetOptions(c.urlParams_, opts...)
  29535. res, err := c.doRequest("json")
  29536. if res != nil && res.StatusCode == http.StatusNotModified {
  29537. if res.Body != nil {
  29538. res.Body.Close()
  29539. }
  29540. return nil, &googleapi.Error{
  29541. Code: res.StatusCode,
  29542. Header: res.Header,
  29543. }
  29544. }
  29545. if err != nil {
  29546. return nil, err
  29547. }
  29548. defer googleapi.CloseBody(res)
  29549. if err := googleapi.CheckResponse(res); err != nil {
  29550. return nil, err
  29551. }
  29552. ret := &Operation{
  29553. ServerResponse: googleapi.ServerResponse{
  29554. Header: res.Header,
  29555. HTTPStatusCode: res.StatusCode,
  29556. },
  29557. }
  29558. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  29559. return nil, err
  29560. }
  29561. return ret, nil
  29562. // {
  29563. // "description": "Creates a TargetHttpProxy resource in the specified project using the data included in the request.",
  29564. // "httpMethod": "POST",
  29565. // "id": "compute.targetHttpProxies.insert",
  29566. // "parameterOrder": [
  29567. // "project"
  29568. // ],
  29569. // "parameters": {
  29570. // "project": {
  29571. // "description": "Project ID for this request.",
  29572. // "location": "path",
  29573. // "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])?))",
  29574. // "required": true,
  29575. // "type": "string"
  29576. // }
  29577. // },
  29578. // "path": "{project}/global/targetHttpProxies",
  29579. // "request": {
  29580. // "$ref": "TargetHttpProxy"
  29581. // },
  29582. // "response": {
  29583. // "$ref": "Operation"
  29584. // },
  29585. // "scopes": [
  29586. // "https://www.googleapis.com/auth/cloud-platform",
  29587. // "https://www.googleapis.com/auth/compute"
  29588. // ]
  29589. // }
  29590. }
  29591. // method id "compute.targetHttpProxies.list":
  29592. type TargetHttpProxiesListCall struct {
  29593. s *Service
  29594. project string
  29595. urlParams_ gensupport.URLParams
  29596. ifNoneMatch_ string
  29597. ctx_ context.Context
  29598. }
  29599. // List: Retrieves the list of TargetHttpProxy resources available to
  29600. // the specified project.
  29601. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/list
  29602. func (r *TargetHttpProxiesService) List(project string) *TargetHttpProxiesListCall {
  29603. c := &TargetHttpProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29604. c.project = project
  29605. return c
  29606. }
  29607. // Filter sets the optional parameter "filter": Sets a filter expression
  29608. // for filtering listed resources, in the form filter={expression}. Your
  29609. // {expression} must be in the format: field_name comparison_string
  29610. // literal_string.
  29611. //
  29612. // The field_name is the name of the field you want to compare. Only
  29613. // atomic field types are supported (string, number, boolean). The
  29614. // comparison_string must be either eq (equals) or ne (not equals). The
  29615. // literal_string is the string value to filter to. The literal value
  29616. // must be valid for the type of field you are filtering by (string,
  29617. // number, boolean). For string fields, the literal value is interpreted
  29618. // as a regular expression using RE2 syntax. The literal value must
  29619. // match the entire field.
  29620. //
  29621. // For example, filter=name ne example-instance.
  29622. //
  29623. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  29624. // you can also filter on nested fields. For example, you could filter
  29625. // on instances that have set the scheduling.automaticRestart field to
  29626. // true. In particular, use filtering on nested fields to take advantage
  29627. // of instance labels to organize and filter results based on label
  29628. // values.
  29629. //
  29630. // The Beta API also supports filtering on multiple expressions by
  29631. // providing each separate expression within parentheses. For example,
  29632. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  29633. // Multiple expressions are treated as AND expressions meaning that
  29634. // resources must match all expressions to pass the filters.
  29635. func (c *TargetHttpProxiesListCall) Filter(filter string) *TargetHttpProxiesListCall {
  29636. c.urlParams_.Set("filter", filter)
  29637. return c
  29638. }
  29639. // MaxResults sets the optional parameter "maxResults": The maximum
  29640. // number of results per page that Compute Engine should return. If the
  29641. // number of available results is larger than maxResults, Compute Engine
  29642. // returns a nextPageToken that can be used to get the next page of
  29643. // results in subsequent list requests.
  29644. func (c *TargetHttpProxiesListCall) MaxResults(maxResults int64) *TargetHttpProxiesListCall {
  29645. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  29646. return c
  29647. }
  29648. // PageToken sets the optional parameter "pageToken": Specifies a page
  29649. // token to use. Set pageToken to the nextPageToken returned by a
  29650. // previous list request to get the next page of results.
  29651. func (c *TargetHttpProxiesListCall) PageToken(pageToken string) *TargetHttpProxiesListCall {
  29652. c.urlParams_.Set("pageToken", pageToken)
  29653. return c
  29654. }
  29655. // Fields allows partial responses to be retrieved. See
  29656. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29657. // for more information.
  29658. func (c *TargetHttpProxiesListCall) Fields(s ...googleapi.Field) *TargetHttpProxiesListCall {
  29659. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29660. return c
  29661. }
  29662. // IfNoneMatch sets the optional parameter which makes the operation
  29663. // fail if the object's ETag matches the given value. This is useful for
  29664. // getting updates only after the object has changed since the last
  29665. // request. Use googleapi.IsNotModified to check whether the response
  29666. // error from Do is the result of In-None-Match.
  29667. func (c *TargetHttpProxiesListCall) IfNoneMatch(entityTag string) *TargetHttpProxiesListCall {
  29668. c.ifNoneMatch_ = entityTag
  29669. return c
  29670. }
  29671. // Context sets the context to be used in this call's Do method. Any
  29672. // pending HTTP request will be aborted if the provided context is
  29673. // canceled.
  29674. func (c *TargetHttpProxiesListCall) Context(ctx context.Context) *TargetHttpProxiesListCall {
  29675. c.ctx_ = ctx
  29676. return c
  29677. }
  29678. func (c *TargetHttpProxiesListCall) doRequest(alt string) (*http.Response, error) {
  29679. var body io.Reader = nil
  29680. c.urlParams_.Set("alt", alt)
  29681. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies")
  29682. urls += "?" + c.urlParams_.Encode()
  29683. req, _ := http.NewRequest("GET", urls, body)
  29684. googleapi.Expand(req.URL, map[string]string{
  29685. "project": c.project,
  29686. })
  29687. req.Header.Set("User-Agent", c.s.userAgent())
  29688. if c.ifNoneMatch_ != "" {
  29689. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  29690. }
  29691. if c.ctx_ != nil {
  29692. return ctxhttp.Do(c.ctx_, c.s.client, req)
  29693. }
  29694. return c.s.client.Do(req)
  29695. }
  29696. // Do executes the "compute.targetHttpProxies.list" call.
  29697. // Exactly one of *TargetHttpProxyList or error will be non-nil. Any
  29698. // non-2xx status code is an error. Response headers are in either
  29699. // *TargetHttpProxyList.ServerResponse.Header or (if a response was
  29700. // returned at all) in error.(*googleapi.Error).Header. Use
  29701. // googleapi.IsNotModified to check whether the returned error was
  29702. // because http.StatusNotModified was returned.
  29703. func (c *TargetHttpProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetHttpProxyList, error) {
  29704. gensupport.SetOptions(c.urlParams_, opts...)
  29705. res, err := c.doRequest("json")
  29706. if res != nil && res.StatusCode == http.StatusNotModified {
  29707. if res.Body != nil {
  29708. res.Body.Close()
  29709. }
  29710. return nil, &googleapi.Error{
  29711. Code: res.StatusCode,
  29712. Header: res.Header,
  29713. }
  29714. }
  29715. if err != nil {
  29716. return nil, err
  29717. }
  29718. defer googleapi.CloseBody(res)
  29719. if err := googleapi.CheckResponse(res); err != nil {
  29720. return nil, err
  29721. }
  29722. ret := &TargetHttpProxyList{
  29723. ServerResponse: googleapi.ServerResponse{
  29724. Header: res.Header,
  29725. HTTPStatusCode: res.StatusCode,
  29726. },
  29727. }
  29728. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  29729. return nil, err
  29730. }
  29731. return ret, nil
  29732. // {
  29733. // "description": "Retrieves the list of TargetHttpProxy resources available to the specified project.",
  29734. // "httpMethod": "GET",
  29735. // "id": "compute.targetHttpProxies.list",
  29736. // "parameterOrder": [
  29737. // "project"
  29738. // ],
  29739. // "parameters": {
  29740. // "filter": {
  29741. // "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.",
  29742. // "location": "query",
  29743. // "type": "string"
  29744. // },
  29745. // "maxResults": {
  29746. // "default": "500",
  29747. // "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.",
  29748. // "format": "uint32",
  29749. // "location": "query",
  29750. // "maximum": "500",
  29751. // "minimum": "0",
  29752. // "type": "integer"
  29753. // },
  29754. // "pageToken": {
  29755. // "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.",
  29756. // "location": "query",
  29757. // "type": "string"
  29758. // },
  29759. // "project": {
  29760. // "description": "Project ID for this request.",
  29761. // "location": "path",
  29762. // "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])?))",
  29763. // "required": true,
  29764. // "type": "string"
  29765. // }
  29766. // },
  29767. // "path": "{project}/global/targetHttpProxies",
  29768. // "response": {
  29769. // "$ref": "TargetHttpProxyList"
  29770. // },
  29771. // "scopes": [
  29772. // "https://www.googleapis.com/auth/cloud-platform",
  29773. // "https://www.googleapis.com/auth/compute",
  29774. // "https://www.googleapis.com/auth/compute.readonly"
  29775. // ]
  29776. // }
  29777. }
  29778. // Pages invokes f for each page of results.
  29779. // A non-nil error returned from f will halt the iteration.
  29780. // The provided context supersedes any context provided to the Context method.
  29781. func (c *TargetHttpProxiesListCall) Pages(ctx context.Context, f func(*TargetHttpProxyList) error) error {
  29782. c.ctx_ = ctx
  29783. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  29784. for {
  29785. x, err := c.Do()
  29786. if err != nil {
  29787. return err
  29788. }
  29789. if err := f(x); err != nil {
  29790. return err
  29791. }
  29792. if x.NextPageToken == "" {
  29793. return nil
  29794. }
  29795. c.PageToken(x.NextPageToken)
  29796. }
  29797. }
  29798. // method id "compute.targetHttpProxies.setUrlMap":
  29799. type TargetHttpProxiesSetUrlMapCall struct {
  29800. s *Service
  29801. project string
  29802. targetHttpProxy string
  29803. urlmapreference *UrlMapReference
  29804. urlParams_ gensupport.URLParams
  29805. ctx_ context.Context
  29806. }
  29807. // SetUrlMap: Changes the URL map for TargetHttpProxy.
  29808. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/setUrlMap
  29809. func (r *TargetHttpProxiesService) SetUrlMap(project string, targetHttpProxy string, urlmapreference *UrlMapReference) *TargetHttpProxiesSetUrlMapCall {
  29810. c := &TargetHttpProxiesSetUrlMapCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29811. c.project = project
  29812. c.targetHttpProxy = targetHttpProxy
  29813. c.urlmapreference = urlmapreference
  29814. return c
  29815. }
  29816. // Fields allows partial responses to be retrieved. See
  29817. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29818. // for more information.
  29819. func (c *TargetHttpProxiesSetUrlMapCall) Fields(s ...googleapi.Field) *TargetHttpProxiesSetUrlMapCall {
  29820. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29821. return c
  29822. }
  29823. // Context sets the context to be used in this call's Do method. Any
  29824. // pending HTTP request will be aborted if the provided context is
  29825. // canceled.
  29826. func (c *TargetHttpProxiesSetUrlMapCall) Context(ctx context.Context) *TargetHttpProxiesSetUrlMapCall {
  29827. c.ctx_ = ctx
  29828. return c
  29829. }
  29830. func (c *TargetHttpProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) {
  29831. var body io.Reader = nil
  29832. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference)
  29833. if err != nil {
  29834. return nil, err
  29835. }
  29836. ctype := "application/json"
  29837. c.urlParams_.Set("alt", alt)
  29838. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap")
  29839. urls += "?" + c.urlParams_.Encode()
  29840. req, _ := http.NewRequest("POST", urls, body)
  29841. googleapi.Expand(req.URL, map[string]string{
  29842. "project": c.project,
  29843. "targetHttpProxy": c.targetHttpProxy,
  29844. })
  29845. req.Header.Set("Content-Type", ctype)
  29846. req.Header.Set("User-Agent", c.s.userAgent())
  29847. if c.ctx_ != nil {
  29848. return ctxhttp.Do(c.ctx_, c.s.client, req)
  29849. }
  29850. return c.s.client.Do(req)
  29851. }
  29852. // Do executes the "compute.targetHttpProxies.setUrlMap" call.
  29853. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  29854. // status code is an error. Response headers are in either
  29855. // *Operation.ServerResponse.Header or (if a response was returned at
  29856. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  29857. // to check whether the returned error was because
  29858. // http.StatusNotModified was returned.
  29859. func (c *TargetHttpProxiesSetUrlMapCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  29860. gensupport.SetOptions(c.urlParams_, opts...)
  29861. res, err := c.doRequest("json")
  29862. if res != nil && res.StatusCode == http.StatusNotModified {
  29863. if res.Body != nil {
  29864. res.Body.Close()
  29865. }
  29866. return nil, &googleapi.Error{
  29867. Code: res.StatusCode,
  29868. Header: res.Header,
  29869. }
  29870. }
  29871. if err != nil {
  29872. return nil, err
  29873. }
  29874. defer googleapi.CloseBody(res)
  29875. if err := googleapi.CheckResponse(res); err != nil {
  29876. return nil, err
  29877. }
  29878. ret := &Operation{
  29879. ServerResponse: googleapi.ServerResponse{
  29880. Header: res.Header,
  29881. HTTPStatusCode: res.StatusCode,
  29882. },
  29883. }
  29884. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  29885. return nil, err
  29886. }
  29887. return ret, nil
  29888. // {
  29889. // "description": "Changes the URL map for TargetHttpProxy.",
  29890. // "httpMethod": "POST",
  29891. // "id": "compute.targetHttpProxies.setUrlMap",
  29892. // "parameterOrder": [
  29893. // "project",
  29894. // "targetHttpProxy"
  29895. // ],
  29896. // "parameters": {
  29897. // "project": {
  29898. // "description": "Project ID for this request.",
  29899. // "location": "path",
  29900. // "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])?))",
  29901. // "required": true,
  29902. // "type": "string"
  29903. // },
  29904. // "targetHttpProxy": {
  29905. // "description": "Name of the TargetHttpProxy resource whose URL map is to be set.",
  29906. // "location": "path",
  29907. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  29908. // "required": true,
  29909. // "type": "string"
  29910. // }
  29911. // },
  29912. // "path": "{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap",
  29913. // "request": {
  29914. // "$ref": "UrlMapReference"
  29915. // },
  29916. // "response": {
  29917. // "$ref": "Operation"
  29918. // },
  29919. // "scopes": [
  29920. // "https://www.googleapis.com/auth/cloud-platform",
  29921. // "https://www.googleapis.com/auth/compute"
  29922. // ]
  29923. // }
  29924. }
  29925. // method id "compute.targetHttpsProxies.delete":
  29926. type TargetHttpsProxiesDeleteCall struct {
  29927. s *Service
  29928. project string
  29929. targetHttpsProxy string
  29930. urlParams_ gensupport.URLParams
  29931. ctx_ context.Context
  29932. }
  29933. // Delete: Deletes the specified TargetHttpsProxy resource.
  29934. func (r *TargetHttpsProxiesService) Delete(project string, targetHttpsProxy string) *TargetHttpsProxiesDeleteCall {
  29935. c := &TargetHttpsProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29936. c.project = project
  29937. c.targetHttpsProxy = targetHttpsProxy
  29938. return c
  29939. }
  29940. // Fields allows partial responses to be retrieved. See
  29941. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29942. // for more information.
  29943. func (c *TargetHttpsProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesDeleteCall {
  29944. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29945. return c
  29946. }
  29947. // Context sets the context to be used in this call's Do method. Any
  29948. // pending HTTP request will be aborted if the provided context is
  29949. // canceled.
  29950. func (c *TargetHttpsProxiesDeleteCall) Context(ctx context.Context) *TargetHttpsProxiesDeleteCall {
  29951. c.ctx_ = ctx
  29952. return c
  29953. }
  29954. func (c *TargetHttpsProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  29955. var body io.Reader = nil
  29956. c.urlParams_.Set("alt", alt)
  29957. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}")
  29958. urls += "?" + c.urlParams_.Encode()
  29959. req, _ := http.NewRequest("DELETE", urls, body)
  29960. googleapi.Expand(req.URL, map[string]string{
  29961. "project": c.project,
  29962. "targetHttpsProxy": c.targetHttpsProxy,
  29963. })
  29964. req.Header.Set("User-Agent", c.s.userAgent())
  29965. if c.ctx_ != nil {
  29966. return ctxhttp.Do(c.ctx_, c.s.client, req)
  29967. }
  29968. return c.s.client.Do(req)
  29969. }
  29970. // Do executes the "compute.targetHttpsProxies.delete" call.
  29971. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  29972. // status code is an error. Response headers are in either
  29973. // *Operation.ServerResponse.Header or (if a response was returned at
  29974. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  29975. // to check whether the returned error was because
  29976. // http.StatusNotModified was returned.
  29977. func (c *TargetHttpsProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  29978. gensupport.SetOptions(c.urlParams_, opts...)
  29979. res, err := c.doRequest("json")
  29980. if res != nil && res.StatusCode == http.StatusNotModified {
  29981. if res.Body != nil {
  29982. res.Body.Close()
  29983. }
  29984. return nil, &googleapi.Error{
  29985. Code: res.StatusCode,
  29986. Header: res.Header,
  29987. }
  29988. }
  29989. if err != nil {
  29990. return nil, err
  29991. }
  29992. defer googleapi.CloseBody(res)
  29993. if err := googleapi.CheckResponse(res); err != nil {
  29994. return nil, err
  29995. }
  29996. ret := &Operation{
  29997. ServerResponse: googleapi.ServerResponse{
  29998. Header: res.Header,
  29999. HTTPStatusCode: res.StatusCode,
  30000. },
  30001. }
  30002. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  30003. return nil, err
  30004. }
  30005. return ret, nil
  30006. // {
  30007. // "description": "Deletes the specified TargetHttpsProxy resource.",
  30008. // "httpMethod": "DELETE",
  30009. // "id": "compute.targetHttpsProxies.delete",
  30010. // "parameterOrder": [
  30011. // "project",
  30012. // "targetHttpsProxy"
  30013. // ],
  30014. // "parameters": {
  30015. // "project": {
  30016. // "description": "Project ID for this request.",
  30017. // "location": "path",
  30018. // "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])?))",
  30019. // "required": true,
  30020. // "type": "string"
  30021. // },
  30022. // "targetHttpsProxy": {
  30023. // "description": "Name of the TargetHttpsProxy resource to delete.",
  30024. // "location": "path",
  30025. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  30026. // "required": true,
  30027. // "type": "string"
  30028. // }
  30029. // },
  30030. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}",
  30031. // "response": {
  30032. // "$ref": "Operation"
  30033. // },
  30034. // "scopes": [
  30035. // "https://www.googleapis.com/auth/cloud-platform",
  30036. // "https://www.googleapis.com/auth/compute"
  30037. // ]
  30038. // }
  30039. }
  30040. // method id "compute.targetHttpsProxies.get":
  30041. type TargetHttpsProxiesGetCall struct {
  30042. s *Service
  30043. project string
  30044. targetHttpsProxy string
  30045. urlParams_ gensupport.URLParams
  30046. ifNoneMatch_ string
  30047. ctx_ context.Context
  30048. }
  30049. // Get: Returns the specified TargetHttpsProxy resource.
  30050. func (r *TargetHttpsProxiesService) Get(project string, targetHttpsProxy string) *TargetHttpsProxiesGetCall {
  30051. c := &TargetHttpsProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30052. c.project = project
  30053. c.targetHttpsProxy = targetHttpsProxy
  30054. return c
  30055. }
  30056. // Fields allows partial responses to be retrieved. See
  30057. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30058. // for more information.
  30059. func (c *TargetHttpsProxiesGetCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesGetCall {
  30060. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30061. return c
  30062. }
  30063. // IfNoneMatch sets the optional parameter which makes the operation
  30064. // fail if the object's ETag matches the given value. This is useful for
  30065. // getting updates only after the object has changed since the last
  30066. // request. Use googleapi.IsNotModified to check whether the response
  30067. // error from Do is the result of In-None-Match.
  30068. func (c *TargetHttpsProxiesGetCall) IfNoneMatch(entityTag string) *TargetHttpsProxiesGetCall {
  30069. c.ifNoneMatch_ = entityTag
  30070. return c
  30071. }
  30072. // Context sets the context to be used in this call's Do method. Any
  30073. // pending HTTP request will be aborted if the provided context is
  30074. // canceled.
  30075. func (c *TargetHttpsProxiesGetCall) Context(ctx context.Context) *TargetHttpsProxiesGetCall {
  30076. c.ctx_ = ctx
  30077. return c
  30078. }
  30079. func (c *TargetHttpsProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  30080. var body io.Reader = nil
  30081. c.urlParams_.Set("alt", alt)
  30082. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}")
  30083. urls += "?" + c.urlParams_.Encode()
  30084. req, _ := http.NewRequest("GET", urls, body)
  30085. googleapi.Expand(req.URL, map[string]string{
  30086. "project": c.project,
  30087. "targetHttpsProxy": c.targetHttpsProxy,
  30088. })
  30089. req.Header.Set("User-Agent", c.s.userAgent())
  30090. if c.ifNoneMatch_ != "" {
  30091. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  30092. }
  30093. if c.ctx_ != nil {
  30094. return ctxhttp.Do(c.ctx_, c.s.client, req)
  30095. }
  30096. return c.s.client.Do(req)
  30097. }
  30098. // Do executes the "compute.targetHttpsProxies.get" call.
  30099. // Exactly one of *TargetHttpsProxy or error will be non-nil. Any
  30100. // non-2xx status code is an error. Response headers are in either
  30101. // *TargetHttpsProxy.ServerResponse.Header or (if a response was
  30102. // returned at all) in error.(*googleapi.Error).Header. Use
  30103. // googleapi.IsNotModified to check whether the returned error was
  30104. // because http.StatusNotModified was returned.
  30105. func (c *TargetHttpsProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetHttpsProxy, error) {
  30106. gensupport.SetOptions(c.urlParams_, opts...)
  30107. res, err := c.doRequest("json")
  30108. if res != nil && res.StatusCode == http.StatusNotModified {
  30109. if res.Body != nil {
  30110. res.Body.Close()
  30111. }
  30112. return nil, &googleapi.Error{
  30113. Code: res.StatusCode,
  30114. Header: res.Header,
  30115. }
  30116. }
  30117. if err != nil {
  30118. return nil, err
  30119. }
  30120. defer googleapi.CloseBody(res)
  30121. if err := googleapi.CheckResponse(res); err != nil {
  30122. return nil, err
  30123. }
  30124. ret := &TargetHttpsProxy{
  30125. ServerResponse: googleapi.ServerResponse{
  30126. Header: res.Header,
  30127. HTTPStatusCode: res.StatusCode,
  30128. },
  30129. }
  30130. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  30131. return nil, err
  30132. }
  30133. return ret, nil
  30134. // {
  30135. // "description": "Returns the specified TargetHttpsProxy resource.",
  30136. // "httpMethod": "GET",
  30137. // "id": "compute.targetHttpsProxies.get",
  30138. // "parameterOrder": [
  30139. // "project",
  30140. // "targetHttpsProxy"
  30141. // ],
  30142. // "parameters": {
  30143. // "project": {
  30144. // "description": "Project ID for this request.",
  30145. // "location": "path",
  30146. // "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])?))",
  30147. // "required": true,
  30148. // "type": "string"
  30149. // },
  30150. // "targetHttpsProxy": {
  30151. // "description": "Name of the TargetHttpsProxy resource to return.",
  30152. // "location": "path",
  30153. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  30154. // "required": true,
  30155. // "type": "string"
  30156. // }
  30157. // },
  30158. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}",
  30159. // "response": {
  30160. // "$ref": "TargetHttpsProxy"
  30161. // },
  30162. // "scopes": [
  30163. // "https://www.googleapis.com/auth/cloud-platform",
  30164. // "https://www.googleapis.com/auth/compute",
  30165. // "https://www.googleapis.com/auth/compute.readonly"
  30166. // ]
  30167. // }
  30168. }
  30169. // method id "compute.targetHttpsProxies.insert":
  30170. type TargetHttpsProxiesInsertCall struct {
  30171. s *Service
  30172. project string
  30173. targethttpsproxy *TargetHttpsProxy
  30174. urlParams_ gensupport.URLParams
  30175. ctx_ context.Context
  30176. }
  30177. // Insert: Creates a TargetHttpsProxy resource in the specified project
  30178. // using the data included in the request.
  30179. func (r *TargetHttpsProxiesService) Insert(project string, targethttpsproxy *TargetHttpsProxy) *TargetHttpsProxiesInsertCall {
  30180. c := &TargetHttpsProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30181. c.project = project
  30182. c.targethttpsproxy = targethttpsproxy
  30183. return c
  30184. }
  30185. // Fields allows partial responses to be retrieved. See
  30186. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30187. // for more information.
  30188. func (c *TargetHttpsProxiesInsertCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesInsertCall {
  30189. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30190. return c
  30191. }
  30192. // Context sets the context to be used in this call's Do method. Any
  30193. // pending HTTP request will be aborted if the provided context is
  30194. // canceled.
  30195. func (c *TargetHttpsProxiesInsertCall) Context(ctx context.Context) *TargetHttpsProxiesInsertCall {
  30196. c.ctx_ = ctx
  30197. return c
  30198. }
  30199. func (c *TargetHttpsProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  30200. var body io.Reader = nil
  30201. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxy)
  30202. if err != nil {
  30203. return nil, err
  30204. }
  30205. ctype := "application/json"
  30206. c.urlParams_.Set("alt", alt)
  30207. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies")
  30208. urls += "?" + c.urlParams_.Encode()
  30209. req, _ := http.NewRequest("POST", urls, body)
  30210. googleapi.Expand(req.URL, map[string]string{
  30211. "project": c.project,
  30212. })
  30213. req.Header.Set("Content-Type", ctype)
  30214. req.Header.Set("User-Agent", c.s.userAgent())
  30215. if c.ctx_ != nil {
  30216. return ctxhttp.Do(c.ctx_, c.s.client, req)
  30217. }
  30218. return c.s.client.Do(req)
  30219. }
  30220. // Do executes the "compute.targetHttpsProxies.insert" call.
  30221. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  30222. // status code is an error. Response headers are in either
  30223. // *Operation.ServerResponse.Header or (if a response was returned at
  30224. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  30225. // to check whether the returned error was because
  30226. // http.StatusNotModified was returned.
  30227. func (c *TargetHttpsProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  30228. gensupport.SetOptions(c.urlParams_, opts...)
  30229. res, err := c.doRequest("json")
  30230. if res != nil && res.StatusCode == http.StatusNotModified {
  30231. if res.Body != nil {
  30232. res.Body.Close()
  30233. }
  30234. return nil, &googleapi.Error{
  30235. Code: res.StatusCode,
  30236. Header: res.Header,
  30237. }
  30238. }
  30239. if err != nil {
  30240. return nil, err
  30241. }
  30242. defer googleapi.CloseBody(res)
  30243. if err := googleapi.CheckResponse(res); err != nil {
  30244. return nil, err
  30245. }
  30246. ret := &Operation{
  30247. ServerResponse: googleapi.ServerResponse{
  30248. Header: res.Header,
  30249. HTTPStatusCode: res.StatusCode,
  30250. },
  30251. }
  30252. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  30253. return nil, err
  30254. }
  30255. return ret, nil
  30256. // {
  30257. // "description": "Creates a TargetHttpsProxy resource in the specified project using the data included in the request.",
  30258. // "httpMethod": "POST",
  30259. // "id": "compute.targetHttpsProxies.insert",
  30260. // "parameterOrder": [
  30261. // "project"
  30262. // ],
  30263. // "parameters": {
  30264. // "project": {
  30265. // "description": "Project ID for this request.",
  30266. // "location": "path",
  30267. // "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])?))",
  30268. // "required": true,
  30269. // "type": "string"
  30270. // }
  30271. // },
  30272. // "path": "{project}/global/targetHttpsProxies",
  30273. // "request": {
  30274. // "$ref": "TargetHttpsProxy"
  30275. // },
  30276. // "response": {
  30277. // "$ref": "Operation"
  30278. // },
  30279. // "scopes": [
  30280. // "https://www.googleapis.com/auth/cloud-platform",
  30281. // "https://www.googleapis.com/auth/compute"
  30282. // ]
  30283. // }
  30284. }
  30285. // method id "compute.targetHttpsProxies.list":
  30286. type TargetHttpsProxiesListCall struct {
  30287. s *Service
  30288. project string
  30289. urlParams_ gensupport.URLParams
  30290. ifNoneMatch_ string
  30291. ctx_ context.Context
  30292. }
  30293. // List: Retrieves the list of TargetHttpsProxy resources available to
  30294. // the specified project.
  30295. func (r *TargetHttpsProxiesService) List(project string) *TargetHttpsProxiesListCall {
  30296. c := &TargetHttpsProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30297. c.project = project
  30298. return c
  30299. }
  30300. // Filter sets the optional parameter "filter": Sets a filter expression
  30301. // for filtering listed resources, in the form filter={expression}. Your
  30302. // {expression} must be in the format: field_name comparison_string
  30303. // literal_string.
  30304. //
  30305. // The field_name is the name of the field you want to compare. Only
  30306. // atomic field types are supported (string, number, boolean). The
  30307. // comparison_string must be either eq (equals) or ne (not equals). The
  30308. // literal_string is the string value to filter to. The literal value
  30309. // must be valid for the type of field you are filtering by (string,
  30310. // number, boolean). For string fields, the literal value is interpreted
  30311. // as a regular expression using RE2 syntax. The literal value must
  30312. // match the entire field.
  30313. //
  30314. // For example, filter=name ne example-instance.
  30315. //
  30316. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  30317. // you can also filter on nested fields. For example, you could filter
  30318. // on instances that have set the scheduling.automaticRestart field to
  30319. // true. In particular, use filtering on nested fields to take advantage
  30320. // of instance labels to organize and filter results based on label
  30321. // values.
  30322. //
  30323. // The Beta API also supports filtering on multiple expressions by
  30324. // providing each separate expression within parentheses. For example,
  30325. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  30326. // Multiple expressions are treated as AND expressions meaning that
  30327. // resources must match all expressions to pass the filters.
  30328. func (c *TargetHttpsProxiesListCall) Filter(filter string) *TargetHttpsProxiesListCall {
  30329. c.urlParams_.Set("filter", filter)
  30330. return c
  30331. }
  30332. // MaxResults sets the optional parameter "maxResults": The maximum
  30333. // number of results per page that Compute Engine should return. If the
  30334. // number of available results is larger than maxResults, Compute Engine
  30335. // returns a nextPageToken that can be used to get the next page of
  30336. // results in subsequent list requests.
  30337. func (c *TargetHttpsProxiesListCall) MaxResults(maxResults int64) *TargetHttpsProxiesListCall {
  30338. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  30339. return c
  30340. }
  30341. // PageToken sets the optional parameter "pageToken": Specifies a page
  30342. // token to use. Set pageToken to the nextPageToken returned by a
  30343. // previous list request to get the next page of results.
  30344. func (c *TargetHttpsProxiesListCall) PageToken(pageToken string) *TargetHttpsProxiesListCall {
  30345. c.urlParams_.Set("pageToken", pageToken)
  30346. return c
  30347. }
  30348. // Fields allows partial responses to be retrieved. See
  30349. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30350. // for more information.
  30351. func (c *TargetHttpsProxiesListCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesListCall {
  30352. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30353. return c
  30354. }
  30355. // IfNoneMatch sets the optional parameter which makes the operation
  30356. // fail if the object's ETag matches the given value. This is useful for
  30357. // getting updates only after the object has changed since the last
  30358. // request. Use googleapi.IsNotModified to check whether the response
  30359. // error from Do is the result of In-None-Match.
  30360. func (c *TargetHttpsProxiesListCall) IfNoneMatch(entityTag string) *TargetHttpsProxiesListCall {
  30361. c.ifNoneMatch_ = entityTag
  30362. return c
  30363. }
  30364. // Context sets the context to be used in this call's Do method. Any
  30365. // pending HTTP request will be aborted if the provided context is
  30366. // canceled.
  30367. func (c *TargetHttpsProxiesListCall) Context(ctx context.Context) *TargetHttpsProxiesListCall {
  30368. c.ctx_ = ctx
  30369. return c
  30370. }
  30371. func (c *TargetHttpsProxiesListCall) doRequest(alt string) (*http.Response, error) {
  30372. var body io.Reader = nil
  30373. c.urlParams_.Set("alt", alt)
  30374. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies")
  30375. urls += "?" + c.urlParams_.Encode()
  30376. req, _ := http.NewRequest("GET", urls, body)
  30377. googleapi.Expand(req.URL, map[string]string{
  30378. "project": c.project,
  30379. })
  30380. req.Header.Set("User-Agent", c.s.userAgent())
  30381. if c.ifNoneMatch_ != "" {
  30382. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  30383. }
  30384. if c.ctx_ != nil {
  30385. return ctxhttp.Do(c.ctx_, c.s.client, req)
  30386. }
  30387. return c.s.client.Do(req)
  30388. }
  30389. // Do executes the "compute.targetHttpsProxies.list" call.
  30390. // Exactly one of *TargetHttpsProxyList or error will be non-nil. Any
  30391. // non-2xx status code is an error. Response headers are in either
  30392. // *TargetHttpsProxyList.ServerResponse.Header or (if a response was
  30393. // returned at all) in error.(*googleapi.Error).Header. Use
  30394. // googleapi.IsNotModified to check whether the returned error was
  30395. // because http.StatusNotModified was returned.
  30396. func (c *TargetHttpsProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetHttpsProxyList, error) {
  30397. gensupport.SetOptions(c.urlParams_, opts...)
  30398. res, err := c.doRequest("json")
  30399. if res != nil && res.StatusCode == http.StatusNotModified {
  30400. if res.Body != nil {
  30401. res.Body.Close()
  30402. }
  30403. return nil, &googleapi.Error{
  30404. Code: res.StatusCode,
  30405. Header: res.Header,
  30406. }
  30407. }
  30408. if err != nil {
  30409. return nil, err
  30410. }
  30411. defer googleapi.CloseBody(res)
  30412. if err := googleapi.CheckResponse(res); err != nil {
  30413. return nil, err
  30414. }
  30415. ret := &TargetHttpsProxyList{
  30416. ServerResponse: googleapi.ServerResponse{
  30417. Header: res.Header,
  30418. HTTPStatusCode: res.StatusCode,
  30419. },
  30420. }
  30421. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  30422. return nil, err
  30423. }
  30424. return ret, nil
  30425. // {
  30426. // "description": "Retrieves the list of TargetHttpsProxy resources available to the specified project.",
  30427. // "httpMethod": "GET",
  30428. // "id": "compute.targetHttpsProxies.list",
  30429. // "parameterOrder": [
  30430. // "project"
  30431. // ],
  30432. // "parameters": {
  30433. // "filter": {
  30434. // "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.",
  30435. // "location": "query",
  30436. // "type": "string"
  30437. // },
  30438. // "maxResults": {
  30439. // "default": "500",
  30440. // "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.",
  30441. // "format": "uint32",
  30442. // "location": "query",
  30443. // "maximum": "500",
  30444. // "minimum": "0",
  30445. // "type": "integer"
  30446. // },
  30447. // "pageToken": {
  30448. // "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.",
  30449. // "location": "query",
  30450. // "type": "string"
  30451. // },
  30452. // "project": {
  30453. // "description": "Project ID for this request.",
  30454. // "location": "path",
  30455. // "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])?))",
  30456. // "required": true,
  30457. // "type": "string"
  30458. // }
  30459. // },
  30460. // "path": "{project}/global/targetHttpsProxies",
  30461. // "response": {
  30462. // "$ref": "TargetHttpsProxyList"
  30463. // },
  30464. // "scopes": [
  30465. // "https://www.googleapis.com/auth/cloud-platform",
  30466. // "https://www.googleapis.com/auth/compute",
  30467. // "https://www.googleapis.com/auth/compute.readonly"
  30468. // ]
  30469. // }
  30470. }
  30471. // Pages invokes f for each page of results.
  30472. // A non-nil error returned from f will halt the iteration.
  30473. // The provided context supersedes any context provided to the Context method.
  30474. func (c *TargetHttpsProxiesListCall) Pages(ctx context.Context, f func(*TargetHttpsProxyList) error) error {
  30475. c.ctx_ = ctx
  30476. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  30477. for {
  30478. x, err := c.Do()
  30479. if err != nil {
  30480. return err
  30481. }
  30482. if err := f(x); err != nil {
  30483. return err
  30484. }
  30485. if x.NextPageToken == "" {
  30486. return nil
  30487. }
  30488. c.PageToken(x.NextPageToken)
  30489. }
  30490. }
  30491. // method id "compute.targetHttpsProxies.setSslCertificates":
  30492. type TargetHttpsProxiesSetSslCertificatesCall struct {
  30493. s *Service
  30494. project string
  30495. targetHttpsProxy string
  30496. targethttpsproxiessetsslcertificatesrequest *TargetHttpsProxiesSetSslCertificatesRequest
  30497. urlParams_ gensupport.URLParams
  30498. ctx_ context.Context
  30499. }
  30500. // SetSslCertificates: Replaces SslCertificates for TargetHttpsProxy.
  30501. func (r *TargetHttpsProxiesService) SetSslCertificates(project string, targetHttpsProxy string, targethttpsproxiessetsslcertificatesrequest *TargetHttpsProxiesSetSslCertificatesRequest) *TargetHttpsProxiesSetSslCertificatesCall {
  30502. c := &TargetHttpsProxiesSetSslCertificatesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30503. c.project = project
  30504. c.targetHttpsProxy = targetHttpsProxy
  30505. c.targethttpsproxiessetsslcertificatesrequest = targethttpsproxiessetsslcertificatesrequest
  30506. return c
  30507. }
  30508. // Fields allows partial responses to be retrieved. See
  30509. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30510. // for more information.
  30511. func (c *TargetHttpsProxiesSetSslCertificatesCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetSslCertificatesCall {
  30512. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30513. return c
  30514. }
  30515. // Context sets the context to be used in this call's Do method. Any
  30516. // pending HTTP request will be aborted if the provided context is
  30517. // canceled.
  30518. func (c *TargetHttpsProxiesSetSslCertificatesCall) Context(ctx context.Context) *TargetHttpsProxiesSetSslCertificatesCall {
  30519. c.ctx_ = ctx
  30520. return c
  30521. }
  30522. func (c *TargetHttpsProxiesSetSslCertificatesCall) doRequest(alt string) (*http.Response, error) {
  30523. var body io.Reader = nil
  30524. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxiessetsslcertificatesrequest)
  30525. if err != nil {
  30526. return nil, err
  30527. }
  30528. ctype := "application/json"
  30529. c.urlParams_.Set("alt", alt)
  30530. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates")
  30531. urls += "?" + c.urlParams_.Encode()
  30532. req, _ := http.NewRequest("POST", urls, body)
  30533. googleapi.Expand(req.URL, map[string]string{
  30534. "project": c.project,
  30535. "targetHttpsProxy": c.targetHttpsProxy,
  30536. })
  30537. req.Header.Set("Content-Type", ctype)
  30538. req.Header.Set("User-Agent", c.s.userAgent())
  30539. if c.ctx_ != nil {
  30540. return ctxhttp.Do(c.ctx_, c.s.client, req)
  30541. }
  30542. return c.s.client.Do(req)
  30543. }
  30544. // Do executes the "compute.targetHttpsProxies.setSslCertificates" call.
  30545. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  30546. // status code is an error. Response headers are in either
  30547. // *Operation.ServerResponse.Header or (if a response was returned at
  30548. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  30549. // to check whether the returned error was because
  30550. // http.StatusNotModified was returned.
  30551. func (c *TargetHttpsProxiesSetSslCertificatesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  30552. gensupport.SetOptions(c.urlParams_, opts...)
  30553. res, err := c.doRequest("json")
  30554. if res != nil && res.StatusCode == http.StatusNotModified {
  30555. if res.Body != nil {
  30556. res.Body.Close()
  30557. }
  30558. return nil, &googleapi.Error{
  30559. Code: res.StatusCode,
  30560. Header: res.Header,
  30561. }
  30562. }
  30563. if err != nil {
  30564. return nil, err
  30565. }
  30566. defer googleapi.CloseBody(res)
  30567. if err := googleapi.CheckResponse(res); err != nil {
  30568. return nil, err
  30569. }
  30570. ret := &Operation{
  30571. ServerResponse: googleapi.ServerResponse{
  30572. Header: res.Header,
  30573. HTTPStatusCode: res.StatusCode,
  30574. },
  30575. }
  30576. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  30577. return nil, err
  30578. }
  30579. return ret, nil
  30580. // {
  30581. // "description": "Replaces SslCertificates for TargetHttpsProxy.",
  30582. // "httpMethod": "POST",
  30583. // "id": "compute.targetHttpsProxies.setSslCertificates",
  30584. // "parameterOrder": [
  30585. // "project",
  30586. // "targetHttpsProxy"
  30587. // ],
  30588. // "parameters": {
  30589. // "project": {
  30590. // "description": "Project ID for this request.",
  30591. // "location": "path",
  30592. // "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])?))",
  30593. // "required": true,
  30594. // "type": "string"
  30595. // },
  30596. // "targetHttpsProxy": {
  30597. // "description": "Name of the TargetHttpsProxy resource whose SSLCertificate is to be set.",
  30598. // "location": "path",
  30599. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  30600. // "required": true,
  30601. // "type": "string"
  30602. // }
  30603. // },
  30604. // "path": "{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates",
  30605. // "request": {
  30606. // "$ref": "TargetHttpsProxiesSetSslCertificatesRequest"
  30607. // },
  30608. // "response": {
  30609. // "$ref": "Operation"
  30610. // },
  30611. // "scopes": [
  30612. // "https://www.googleapis.com/auth/cloud-platform",
  30613. // "https://www.googleapis.com/auth/compute"
  30614. // ]
  30615. // }
  30616. }
  30617. // method id "compute.targetHttpsProxies.setUrlMap":
  30618. type TargetHttpsProxiesSetUrlMapCall struct {
  30619. s *Service
  30620. project string
  30621. targetHttpsProxy string
  30622. urlmapreference *UrlMapReference
  30623. urlParams_ gensupport.URLParams
  30624. ctx_ context.Context
  30625. }
  30626. // SetUrlMap: Changes the URL map for TargetHttpsProxy.
  30627. func (r *TargetHttpsProxiesService) SetUrlMap(project string, targetHttpsProxy string, urlmapreference *UrlMapReference) *TargetHttpsProxiesSetUrlMapCall {
  30628. c := &TargetHttpsProxiesSetUrlMapCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30629. c.project = project
  30630. c.targetHttpsProxy = targetHttpsProxy
  30631. c.urlmapreference = urlmapreference
  30632. return c
  30633. }
  30634. // Fields allows partial responses to be retrieved. See
  30635. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30636. // for more information.
  30637. func (c *TargetHttpsProxiesSetUrlMapCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetUrlMapCall {
  30638. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30639. return c
  30640. }
  30641. // Context sets the context to be used in this call's Do method. Any
  30642. // pending HTTP request will be aborted if the provided context is
  30643. // canceled.
  30644. func (c *TargetHttpsProxiesSetUrlMapCall) Context(ctx context.Context) *TargetHttpsProxiesSetUrlMapCall {
  30645. c.ctx_ = ctx
  30646. return c
  30647. }
  30648. func (c *TargetHttpsProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) {
  30649. var body io.Reader = nil
  30650. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference)
  30651. if err != nil {
  30652. return nil, err
  30653. }
  30654. ctype := "application/json"
  30655. c.urlParams_.Set("alt", alt)
  30656. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap")
  30657. urls += "?" + c.urlParams_.Encode()
  30658. req, _ := http.NewRequest("POST", urls, body)
  30659. googleapi.Expand(req.URL, map[string]string{
  30660. "project": c.project,
  30661. "targetHttpsProxy": c.targetHttpsProxy,
  30662. })
  30663. req.Header.Set("Content-Type", ctype)
  30664. req.Header.Set("User-Agent", c.s.userAgent())
  30665. if c.ctx_ != nil {
  30666. return ctxhttp.Do(c.ctx_, c.s.client, req)
  30667. }
  30668. return c.s.client.Do(req)
  30669. }
  30670. // Do executes the "compute.targetHttpsProxies.setUrlMap" call.
  30671. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  30672. // status code is an error. Response headers are in either
  30673. // *Operation.ServerResponse.Header or (if a response was returned at
  30674. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  30675. // to check whether the returned error was because
  30676. // http.StatusNotModified was returned.
  30677. func (c *TargetHttpsProxiesSetUrlMapCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  30678. gensupport.SetOptions(c.urlParams_, opts...)
  30679. res, err := c.doRequest("json")
  30680. if res != nil && res.StatusCode == http.StatusNotModified {
  30681. if res.Body != nil {
  30682. res.Body.Close()
  30683. }
  30684. return nil, &googleapi.Error{
  30685. Code: res.StatusCode,
  30686. Header: res.Header,
  30687. }
  30688. }
  30689. if err != nil {
  30690. return nil, err
  30691. }
  30692. defer googleapi.CloseBody(res)
  30693. if err := googleapi.CheckResponse(res); err != nil {
  30694. return nil, err
  30695. }
  30696. ret := &Operation{
  30697. ServerResponse: googleapi.ServerResponse{
  30698. Header: res.Header,
  30699. HTTPStatusCode: res.StatusCode,
  30700. },
  30701. }
  30702. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  30703. return nil, err
  30704. }
  30705. return ret, nil
  30706. // {
  30707. // "description": "Changes the URL map for TargetHttpsProxy.",
  30708. // "httpMethod": "POST",
  30709. // "id": "compute.targetHttpsProxies.setUrlMap",
  30710. // "parameterOrder": [
  30711. // "project",
  30712. // "targetHttpsProxy"
  30713. // ],
  30714. // "parameters": {
  30715. // "project": {
  30716. // "description": "Project ID for this request.",
  30717. // "location": "path",
  30718. // "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])?))",
  30719. // "required": true,
  30720. // "type": "string"
  30721. // },
  30722. // "targetHttpsProxy": {
  30723. // "description": "Name of the TargetHttpsProxy resource whose URL map is to be set.",
  30724. // "location": "path",
  30725. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  30726. // "required": true,
  30727. // "type": "string"
  30728. // }
  30729. // },
  30730. // "path": "{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap",
  30731. // "request": {
  30732. // "$ref": "UrlMapReference"
  30733. // },
  30734. // "response": {
  30735. // "$ref": "Operation"
  30736. // },
  30737. // "scopes": [
  30738. // "https://www.googleapis.com/auth/cloud-platform",
  30739. // "https://www.googleapis.com/auth/compute"
  30740. // ]
  30741. // }
  30742. }
  30743. // method id "compute.targetInstances.aggregatedList":
  30744. type TargetInstancesAggregatedListCall struct {
  30745. s *Service
  30746. project string
  30747. urlParams_ gensupport.URLParams
  30748. ifNoneMatch_ string
  30749. ctx_ context.Context
  30750. }
  30751. // AggregatedList: Retrieves an aggregated list of target instances.
  30752. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/aggregatedList
  30753. func (r *TargetInstancesService) AggregatedList(project string) *TargetInstancesAggregatedListCall {
  30754. c := &TargetInstancesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30755. c.project = project
  30756. return c
  30757. }
  30758. // Filter sets the optional parameter "filter": Sets a filter expression
  30759. // for filtering listed resources, in the form filter={expression}. Your
  30760. // {expression} must be in the format: field_name comparison_string
  30761. // literal_string.
  30762. //
  30763. // The field_name is the name of the field you want to compare. Only
  30764. // atomic field types are supported (string, number, boolean). The
  30765. // comparison_string must be either eq (equals) or ne (not equals). The
  30766. // literal_string is the string value to filter to. The literal value
  30767. // must be valid for the type of field you are filtering by (string,
  30768. // number, boolean). For string fields, the literal value is interpreted
  30769. // as a regular expression using RE2 syntax. The literal value must
  30770. // match the entire field.
  30771. //
  30772. // For example, filter=name ne example-instance.
  30773. //
  30774. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  30775. // you can also filter on nested fields. For example, you could filter
  30776. // on instances that have set the scheduling.automaticRestart field to
  30777. // true. In particular, use filtering on nested fields to take advantage
  30778. // of instance labels to organize and filter results based on label
  30779. // values.
  30780. //
  30781. // The Beta API also supports filtering on multiple expressions by
  30782. // providing each separate expression within parentheses. For example,
  30783. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  30784. // Multiple expressions are treated as AND expressions meaning that
  30785. // resources must match all expressions to pass the filters.
  30786. func (c *TargetInstancesAggregatedListCall) Filter(filter string) *TargetInstancesAggregatedListCall {
  30787. c.urlParams_.Set("filter", filter)
  30788. return c
  30789. }
  30790. // MaxResults sets the optional parameter "maxResults": The maximum
  30791. // number of results per page that Compute Engine should return. If the
  30792. // number of available results is larger than maxResults, Compute Engine
  30793. // returns a nextPageToken that can be used to get the next page of
  30794. // results in subsequent list requests.
  30795. func (c *TargetInstancesAggregatedListCall) MaxResults(maxResults int64) *TargetInstancesAggregatedListCall {
  30796. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  30797. return c
  30798. }
  30799. // PageToken sets the optional parameter "pageToken": Specifies a page
  30800. // token to use. Set pageToken to the nextPageToken returned by a
  30801. // previous list request to get the next page of results.
  30802. func (c *TargetInstancesAggregatedListCall) PageToken(pageToken string) *TargetInstancesAggregatedListCall {
  30803. c.urlParams_.Set("pageToken", pageToken)
  30804. return c
  30805. }
  30806. // Fields allows partial responses to be retrieved. See
  30807. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30808. // for more information.
  30809. func (c *TargetInstancesAggregatedListCall) Fields(s ...googleapi.Field) *TargetInstancesAggregatedListCall {
  30810. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30811. return c
  30812. }
  30813. // IfNoneMatch sets the optional parameter which makes the operation
  30814. // fail if the object's ETag matches the given value. This is useful for
  30815. // getting updates only after the object has changed since the last
  30816. // request. Use googleapi.IsNotModified to check whether the response
  30817. // error from Do is the result of In-None-Match.
  30818. func (c *TargetInstancesAggregatedListCall) IfNoneMatch(entityTag string) *TargetInstancesAggregatedListCall {
  30819. c.ifNoneMatch_ = entityTag
  30820. return c
  30821. }
  30822. // Context sets the context to be used in this call's Do method. Any
  30823. // pending HTTP request will be aborted if the provided context is
  30824. // canceled.
  30825. func (c *TargetInstancesAggregatedListCall) Context(ctx context.Context) *TargetInstancesAggregatedListCall {
  30826. c.ctx_ = ctx
  30827. return c
  30828. }
  30829. func (c *TargetInstancesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  30830. var body io.Reader = nil
  30831. c.urlParams_.Set("alt", alt)
  30832. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetInstances")
  30833. urls += "?" + c.urlParams_.Encode()
  30834. req, _ := http.NewRequest("GET", urls, body)
  30835. googleapi.Expand(req.URL, map[string]string{
  30836. "project": c.project,
  30837. })
  30838. req.Header.Set("User-Agent", c.s.userAgent())
  30839. if c.ifNoneMatch_ != "" {
  30840. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  30841. }
  30842. if c.ctx_ != nil {
  30843. return ctxhttp.Do(c.ctx_, c.s.client, req)
  30844. }
  30845. return c.s.client.Do(req)
  30846. }
  30847. // Do executes the "compute.targetInstances.aggregatedList" call.
  30848. // Exactly one of *TargetInstanceAggregatedList or error will be
  30849. // non-nil. Any non-2xx status code is an error. Response headers are in
  30850. // either *TargetInstanceAggregatedList.ServerResponse.Header or (if a
  30851. // response was returned at all) in error.(*googleapi.Error).Header. Use
  30852. // googleapi.IsNotModified to check whether the returned error was
  30853. // because http.StatusNotModified was returned.
  30854. func (c *TargetInstancesAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetInstanceAggregatedList, error) {
  30855. gensupport.SetOptions(c.urlParams_, opts...)
  30856. res, err := c.doRequest("json")
  30857. if res != nil && res.StatusCode == http.StatusNotModified {
  30858. if res.Body != nil {
  30859. res.Body.Close()
  30860. }
  30861. return nil, &googleapi.Error{
  30862. Code: res.StatusCode,
  30863. Header: res.Header,
  30864. }
  30865. }
  30866. if err != nil {
  30867. return nil, err
  30868. }
  30869. defer googleapi.CloseBody(res)
  30870. if err := googleapi.CheckResponse(res); err != nil {
  30871. return nil, err
  30872. }
  30873. ret := &TargetInstanceAggregatedList{
  30874. ServerResponse: googleapi.ServerResponse{
  30875. Header: res.Header,
  30876. HTTPStatusCode: res.StatusCode,
  30877. },
  30878. }
  30879. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  30880. return nil, err
  30881. }
  30882. return ret, nil
  30883. // {
  30884. // "description": "Retrieves an aggregated list of target instances.",
  30885. // "httpMethod": "GET",
  30886. // "id": "compute.targetInstances.aggregatedList",
  30887. // "parameterOrder": [
  30888. // "project"
  30889. // ],
  30890. // "parameters": {
  30891. // "filter": {
  30892. // "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.",
  30893. // "location": "query",
  30894. // "type": "string"
  30895. // },
  30896. // "maxResults": {
  30897. // "default": "500",
  30898. // "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.",
  30899. // "format": "uint32",
  30900. // "location": "query",
  30901. // "maximum": "500",
  30902. // "minimum": "0",
  30903. // "type": "integer"
  30904. // },
  30905. // "pageToken": {
  30906. // "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.",
  30907. // "location": "query",
  30908. // "type": "string"
  30909. // },
  30910. // "project": {
  30911. // "description": "Project ID for this request.",
  30912. // "location": "path",
  30913. // "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])?))",
  30914. // "required": true,
  30915. // "type": "string"
  30916. // }
  30917. // },
  30918. // "path": "{project}/aggregated/targetInstances",
  30919. // "response": {
  30920. // "$ref": "TargetInstanceAggregatedList"
  30921. // },
  30922. // "scopes": [
  30923. // "https://www.googleapis.com/auth/cloud-platform",
  30924. // "https://www.googleapis.com/auth/compute",
  30925. // "https://www.googleapis.com/auth/compute.readonly"
  30926. // ]
  30927. // }
  30928. }
  30929. // Pages invokes f for each page of results.
  30930. // A non-nil error returned from f will halt the iteration.
  30931. // The provided context supersedes any context provided to the Context method.
  30932. func (c *TargetInstancesAggregatedListCall) Pages(ctx context.Context, f func(*TargetInstanceAggregatedList) error) error {
  30933. c.ctx_ = ctx
  30934. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  30935. for {
  30936. x, err := c.Do()
  30937. if err != nil {
  30938. return err
  30939. }
  30940. if err := f(x); err != nil {
  30941. return err
  30942. }
  30943. if x.NextPageToken == "" {
  30944. return nil
  30945. }
  30946. c.PageToken(x.NextPageToken)
  30947. }
  30948. }
  30949. // method id "compute.targetInstances.delete":
  30950. type TargetInstancesDeleteCall struct {
  30951. s *Service
  30952. project string
  30953. zone string
  30954. targetInstance string
  30955. urlParams_ gensupport.URLParams
  30956. ctx_ context.Context
  30957. }
  30958. // Delete: Deletes the specified TargetInstance resource.
  30959. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/delete
  30960. func (r *TargetInstancesService) Delete(project string, zone string, targetInstance string) *TargetInstancesDeleteCall {
  30961. c := &TargetInstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30962. c.project = project
  30963. c.zone = zone
  30964. c.targetInstance = targetInstance
  30965. return c
  30966. }
  30967. // Fields allows partial responses to be retrieved. See
  30968. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30969. // for more information.
  30970. func (c *TargetInstancesDeleteCall) Fields(s ...googleapi.Field) *TargetInstancesDeleteCall {
  30971. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30972. return c
  30973. }
  30974. // Context sets the context to be used in this call's Do method. Any
  30975. // pending HTTP request will be aborted if the provided context is
  30976. // canceled.
  30977. func (c *TargetInstancesDeleteCall) Context(ctx context.Context) *TargetInstancesDeleteCall {
  30978. c.ctx_ = ctx
  30979. return c
  30980. }
  30981. func (c *TargetInstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
  30982. var body io.Reader = nil
  30983. c.urlParams_.Set("alt", alt)
  30984. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances/{targetInstance}")
  30985. urls += "?" + c.urlParams_.Encode()
  30986. req, _ := http.NewRequest("DELETE", urls, body)
  30987. googleapi.Expand(req.URL, map[string]string{
  30988. "project": c.project,
  30989. "zone": c.zone,
  30990. "targetInstance": c.targetInstance,
  30991. })
  30992. req.Header.Set("User-Agent", c.s.userAgent())
  30993. if c.ctx_ != nil {
  30994. return ctxhttp.Do(c.ctx_, c.s.client, req)
  30995. }
  30996. return c.s.client.Do(req)
  30997. }
  30998. // Do executes the "compute.targetInstances.delete" call.
  30999. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  31000. // status code is an error. Response headers are in either
  31001. // *Operation.ServerResponse.Header or (if a response was returned at
  31002. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  31003. // to check whether the returned error was because
  31004. // http.StatusNotModified was returned.
  31005. func (c *TargetInstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  31006. gensupport.SetOptions(c.urlParams_, opts...)
  31007. res, err := c.doRequest("json")
  31008. if res != nil && res.StatusCode == http.StatusNotModified {
  31009. if res.Body != nil {
  31010. res.Body.Close()
  31011. }
  31012. return nil, &googleapi.Error{
  31013. Code: res.StatusCode,
  31014. Header: res.Header,
  31015. }
  31016. }
  31017. if err != nil {
  31018. return nil, err
  31019. }
  31020. defer googleapi.CloseBody(res)
  31021. if err := googleapi.CheckResponse(res); err != nil {
  31022. return nil, err
  31023. }
  31024. ret := &Operation{
  31025. ServerResponse: googleapi.ServerResponse{
  31026. Header: res.Header,
  31027. HTTPStatusCode: res.StatusCode,
  31028. },
  31029. }
  31030. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  31031. return nil, err
  31032. }
  31033. return ret, nil
  31034. // {
  31035. // "description": "Deletes the specified TargetInstance resource.",
  31036. // "httpMethod": "DELETE",
  31037. // "id": "compute.targetInstances.delete",
  31038. // "parameterOrder": [
  31039. // "project",
  31040. // "zone",
  31041. // "targetInstance"
  31042. // ],
  31043. // "parameters": {
  31044. // "project": {
  31045. // "description": "Project ID for this request.",
  31046. // "location": "path",
  31047. // "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])?))",
  31048. // "required": true,
  31049. // "type": "string"
  31050. // },
  31051. // "targetInstance": {
  31052. // "description": "Name of the TargetInstance resource to delete.",
  31053. // "location": "path",
  31054. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31055. // "required": true,
  31056. // "type": "string"
  31057. // },
  31058. // "zone": {
  31059. // "description": "Name of the zone scoping this request.",
  31060. // "location": "path",
  31061. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31062. // "required": true,
  31063. // "type": "string"
  31064. // }
  31065. // },
  31066. // "path": "{project}/zones/{zone}/targetInstances/{targetInstance}",
  31067. // "response": {
  31068. // "$ref": "Operation"
  31069. // },
  31070. // "scopes": [
  31071. // "https://www.googleapis.com/auth/cloud-platform",
  31072. // "https://www.googleapis.com/auth/compute"
  31073. // ]
  31074. // }
  31075. }
  31076. // method id "compute.targetInstances.get":
  31077. type TargetInstancesGetCall struct {
  31078. s *Service
  31079. project string
  31080. zone string
  31081. targetInstance string
  31082. urlParams_ gensupport.URLParams
  31083. ifNoneMatch_ string
  31084. ctx_ context.Context
  31085. }
  31086. // Get: Returns the specified TargetInstance resource.
  31087. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/get
  31088. func (r *TargetInstancesService) Get(project string, zone string, targetInstance string) *TargetInstancesGetCall {
  31089. c := &TargetInstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31090. c.project = project
  31091. c.zone = zone
  31092. c.targetInstance = targetInstance
  31093. return c
  31094. }
  31095. // Fields allows partial responses to be retrieved. See
  31096. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31097. // for more information.
  31098. func (c *TargetInstancesGetCall) Fields(s ...googleapi.Field) *TargetInstancesGetCall {
  31099. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31100. return c
  31101. }
  31102. // IfNoneMatch sets the optional parameter which makes the operation
  31103. // fail if the object's ETag matches the given value. This is useful for
  31104. // getting updates only after the object has changed since the last
  31105. // request. Use googleapi.IsNotModified to check whether the response
  31106. // error from Do is the result of In-None-Match.
  31107. func (c *TargetInstancesGetCall) IfNoneMatch(entityTag string) *TargetInstancesGetCall {
  31108. c.ifNoneMatch_ = entityTag
  31109. return c
  31110. }
  31111. // Context sets the context to be used in this call's Do method. Any
  31112. // pending HTTP request will be aborted if the provided context is
  31113. // canceled.
  31114. func (c *TargetInstancesGetCall) Context(ctx context.Context) *TargetInstancesGetCall {
  31115. c.ctx_ = ctx
  31116. return c
  31117. }
  31118. func (c *TargetInstancesGetCall) doRequest(alt string) (*http.Response, error) {
  31119. var body io.Reader = nil
  31120. c.urlParams_.Set("alt", alt)
  31121. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances/{targetInstance}")
  31122. urls += "?" + c.urlParams_.Encode()
  31123. req, _ := http.NewRequest("GET", urls, body)
  31124. googleapi.Expand(req.URL, map[string]string{
  31125. "project": c.project,
  31126. "zone": c.zone,
  31127. "targetInstance": c.targetInstance,
  31128. })
  31129. req.Header.Set("User-Agent", c.s.userAgent())
  31130. if c.ifNoneMatch_ != "" {
  31131. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  31132. }
  31133. if c.ctx_ != nil {
  31134. return ctxhttp.Do(c.ctx_, c.s.client, req)
  31135. }
  31136. return c.s.client.Do(req)
  31137. }
  31138. // Do executes the "compute.targetInstances.get" call.
  31139. // Exactly one of *TargetInstance or error will be non-nil. Any non-2xx
  31140. // status code is an error. Response headers are in either
  31141. // *TargetInstance.ServerResponse.Header or (if a response was returned
  31142. // at all) in error.(*googleapi.Error).Header. Use
  31143. // googleapi.IsNotModified to check whether the returned error was
  31144. // because http.StatusNotModified was returned.
  31145. func (c *TargetInstancesGetCall) Do(opts ...googleapi.CallOption) (*TargetInstance, error) {
  31146. gensupport.SetOptions(c.urlParams_, opts...)
  31147. res, err := c.doRequest("json")
  31148. if res != nil && res.StatusCode == http.StatusNotModified {
  31149. if res.Body != nil {
  31150. res.Body.Close()
  31151. }
  31152. return nil, &googleapi.Error{
  31153. Code: res.StatusCode,
  31154. Header: res.Header,
  31155. }
  31156. }
  31157. if err != nil {
  31158. return nil, err
  31159. }
  31160. defer googleapi.CloseBody(res)
  31161. if err := googleapi.CheckResponse(res); err != nil {
  31162. return nil, err
  31163. }
  31164. ret := &TargetInstance{
  31165. ServerResponse: googleapi.ServerResponse{
  31166. Header: res.Header,
  31167. HTTPStatusCode: res.StatusCode,
  31168. },
  31169. }
  31170. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  31171. return nil, err
  31172. }
  31173. return ret, nil
  31174. // {
  31175. // "description": "Returns the specified TargetInstance resource.",
  31176. // "httpMethod": "GET",
  31177. // "id": "compute.targetInstances.get",
  31178. // "parameterOrder": [
  31179. // "project",
  31180. // "zone",
  31181. // "targetInstance"
  31182. // ],
  31183. // "parameters": {
  31184. // "project": {
  31185. // "description": "Project ID for this request.",
  31186. // "location": "path",
  31187. // "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])?))",
  31188. // "required": true,
  31189. // "type": "string"
  31190. // },
  31191. // "targetInstance": {
  31192. // "description": "Name of the TargetInstance resource to return.",
  31193. // "location": "path",
  31194. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31195. // "required": true,
  31196. // "type": "string"
  31197. // },
  31198. // "zone": {
  31199. // "description": "Name of the zone scoping this request.",
  31200. // "location": "path",
  31201. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31202. // "required": true,
  31203. // "type": "string"
  31204. // }
  31205. // },
  31206. // "path": "{project}/zones/{zone}/targetInstances/{targetInstance}",
  31207. // "response": {
  31208. // "$ref": "TargetInstance"
  31209. // },
  31210. // "scopes": [
  31211. // "https://www.googleapis.com/auth/cloud-platform",
  31212. // "https://www.googleapis.com/auth/compute",
  31213. // "https://www.googleapis.com/auth/compute.readonly"
  31214. // ]
  31215. // }
  31216. }
  31217. // method id "compute.targetInstances.insert":
  31218. type TargetInstancesInsertCall struct {
  31219. s *Service
  31220. project string
  31221. zone string
  31222. targetinstance *TargetInstance
  31223. urlParams_ gensupport.URLParams
  31224. ctx_ context.Context
  31225. }
  31226. // Insert: Creates a TargetInstance resource in the specified project
  31227. // and zone using the data included in the request.
  31228. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/insert
  31229. func (r *TargetInstancesService) Insert(project string, zone string, targetinstance *TargetInstance) *TargetInstancesInsertCall {
  31230. c := &TargetInstancesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31231. c.project = project
  31232. c.zone = zone
  31233. c.targetinstance = targetinstance
  31234. return c
  31235. }
  31236. // Fields allows partial responses to be retrieved. See
  31237. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31238. // for more information.
  31239. func (c *TargetInstancesInsertCall) Fields(s ...googleapi.Field) *TargetInstancesInsertCall {
  31240. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31241. return c
  31242. }
  31243. // Context sets the context to be used in this call's Do method. Any
  31244. // pending HTTP request will be aborted if the provided context is
  31245. // canceled.
  31246. func (c *TargetInstancesInsertCall) Context(ctx context.Context) *TargetInstancesInsertCall {
  31247. c.ctx_ = ctx
  31248. return c
  31249. }
  31250. func (c *TargetInstancesInsertCall) doRequest(alt string) (*http.Response, error) {
  31251. var body io.Reader = nil
  31252. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetinstance)
  31253. if err != nil {
  31254. return nil, err
  31255. }
  31256. ctype := "application/json"
  31257. c.urlParams_.Set("alt", alt)
  31258. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances")
  31259. urls += "?" + c.urlParams_.Encode()
  31260. req, _ := http.NewRequest("POST", urls, body)
  31261. googleapi.Expand(req.URL, map[string]string{
  31262. "project": c.project,
  31263. "zone": c.zone,
  31264. })
  31265. req.Header.Set("Content-Type", ctype)
  31266. req.Header.Set("User-Agent", c.s.userAgent())
  31267. if c.ctx_ != nil {
  31268. return ctxhttp.Do(c.ctx_, c.s.client, req)
  31269. }
  31270. return c.s.client.Do(req)
  31271. }
  31272. // Do executes the "compute.targetInstances.insert" call.
  31273. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  31274. // status code is an error. Response headers are in either
  31275. // *Operation.ServerResponse.Header or (if a response was returned at
  31276. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  31277. // to check whether the returned error was because
  31278. // http.StatusNotModified was returned.
  31279. func (c *TargetInstancesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  31280. gensupport.SetOptions(c.urlParams_, opts...)
  31281. res, err := c.doRequest("json")
  31282. if res != nil && res.StatusCode == http.StatusNotModified {
  31283. if res.Body != nil {
  31284. res.Body.Close()
  31285. }
  31286. return nil, &googleapi.Error{
  31287. Code: res.StatusCode,
  31288. Header: res.Header,
  31289. }
  31290. }
  31291. if err != nil {
  31292. return nil, err
  31293. }
  31294. defer googleapi.CloseBody(res)
  31295. if err := googleapi.CheckResponse(res); err != nil {
  31296. return nil, err
  31297. }
  31298. ret := &Operation{
  31299. ServerResponse: googleapi.ServerResponse{
  31300. Header: res.Header,
  31301. HTTPStatusCode: res.StatusCode,
  31302. },
  31303. }
  31304. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  31305. return nil, err
  31306. }
  31307. return ret, nil
  31308. // {
  31309. // "description": "Creates a TargetInstance resource in the specified project and zone using the data included in the request.",
  31310. // "httpMethod": "POST",
  31311. // "id": "compute.targetInstances.insert",
  31312. // "parameterOrder": [
  31313. // "project",
  31314. // "zone"
  31315. // ],
  31316. // "parameters": {
  31317. // "project": {
  31318. // "description": "Project ID for this request.",
  31319. // "location": "path",
  31320. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31321. // "required": true,
  31322. // "type": "string"
  31323. // },
  31324. // "zone": {
  31325. // "description": "Name of the zone scoping this request.",
  31326. // "location": "path",
  31327. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31328. // "required": true,
  31329. // "type": "string"
  31330. // }
  31331. // },
  31332. // "path": "{project}/zones/{zone}/targetInstances",
  31333. // "request": {
  31334. // "$ref": "TargetInstance"
  31335. // },
  31336. // "response": {
  31337. // "$ref": "Operation"
  31338. // },
  31339. // "scopes": [
  31340. // "https://www.googleapis.com/auth/cloud-platform",
  31341. // "https://www.googleapis.com/auth/compute"
  31342. // ]
  31343. // }
  31344. }
  31345. // method id "compute.targetInstances.list":
  31346. type TargetInstancesListCall struct {
  31347. s *Service
  31348. project string
  31349. zone string
  31350. urlParams_ gensupport.URLParams
  31351. ifNoneMatch_ string
  31352. ctx_ context.Context
  31353. }
  31354. // List: Retrieves a list of TargetInstance resources available to the
  31355. // specified project and zone.
  31356. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/list
  31357. func (r *TargetInstancesService) List(project string, zone string) *TargetInstancesListCall {
  31358. c := &TargetInstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31359. c.project = project
  31360. c.zone = zone
  31361. return c
  31362. }
  31363. // Filter sets the optional parameter "filter": Sets a filter expression
  31364. // for filtering listed resources, in the form filter={expression}. Your
  31365. // {expression} must be in the format: field_name comparison_string
  31366. // literal_string.
  31367. //
  31368. // The field_name is the name of the field you want to compare. Only
  31369. // atomic field types are supported (string, number, boolean). The
  31370. // comparison_string must be either eq (equals) or ne (not equals). The
  31371. // literal_string is the string value to filter to. The literal value
  31372. // must be valid for the type of field you are filtering by (string,
  31373. // number, boolean). For string fields, the literal value is interpreted
  31374. // as a regular expression using RE2 syntax. The literal value must
  31375. // match the entire field.
  31376. //
  31377. // For example, filter=name ne example-instance.
  31378. //
  31379. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  31380. // you can also filter on nested fields. For example, you could filter
  31381. // on instances that have set the scheduling.automaticRestart field to
  31382. // true. In particular, use filtering on nested fields to take advantage
  31383. // of instance labels to organize and filter results based on label
  31384. // values.
  31385. //
  31386. // The Beta API also supports filtering on multiple expressions by
  31387. // providing each separate expression within parentheses. For example,
  31388. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  31389. // Multiple expressions are treated as AND expressions meaning that
  31390. // resources must match all expressions to pass the filters.
  31391. func (c *TargetInstancesListCall) Filter(filter string) *TargetInstancesListCall {
  31392. c.urlParams_.Set("filter", filter)
  31393. return c
  31394. }
  31395. // MaxResults sets the optional parameter "maxResults": The maximum
  31396. // number of results per page that Compute Engine should return. If the
  31397. // number of available results is larger than maxResults, Compute Engine
  31398. // returns a nextPageToken that can be used to get the next page of
  31399. // results in subsequent list requests.
  31400. func (c *TargetInstancesListCall) MaxResults(maxResults int64) *TargetInstancesListCall {
  31401. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  31402. return c
  31403. }
  31404. // PageToken sets the optional parameter "pageToken": Specifies a page
  31405. // token to use. Set pageToken to the nextPageToken returned by a
  31406. // previous list request to get the next page of results.
  31407. func (c *TargetInstancesListCall) PageToken(pageToken string) *TargetInstancesListCall {
  31408. c.urlParams_.Set("pageToken", pageToken)
  31409. return c
  31410. }
  31411. // Fields allows partial responses to be retrieved. See
  31412. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31413. // for more information.
  31414. func (c *TargetInstancesListCall) Fields(s ...googleapi.Field) *TargetInstancesListCall {
  31415. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31416. return c
  31417. }
  31418. // IfNoneMatch sets the optional parameter which makes the operation
  31419. // fail if the object's ETag matches the given value. This is useful for
  31420. // getting updates only after the object has changed since the last
  31421. // request. Use googleapi.IsNotModified to check whether the response
  31422. // error from Do is the result of In-None-Match.
  31423. func (c *TargetInstancesListCall) IfNoneMatch(entityTag string) *TargetInstancesListCall {
  31424. c.ifNoneMatch_ = entityTag
  31425. return c
  31426. }
  31427. // Context sets the context to be used in this call's Do method. Any
  31428. // pending HTTP request will be aborted if the provided context is
  31429. // canceled.
  31430. func (c *TargetInstancesListCall) Context(ctx context.Context) *TargetInstancesListCall {
  31431. c.ctx_ = ctx
  31432. return c
  31433. }
  31434. func (c *TargetInstancesListCall) doRequest(alt string) (*http.Response, error) {
  31435. var body io.Reader = nil
  31436. c.urlParams_.Set("alt", alt)
  31437. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances")
  31438. urls += "?" + c.urlParams_.Encode()
  31439. req, _ := http.NewRequest("GET", urls, body)
  31440. googleapi.Expand(req.URL, map[string]string{
  31441. "project": c.project,
  31442. "zone": c.zone,
  31443. })
  31444. req.Header.Set("User-Agent", c.s.userAgent())
  31445. if c.ifNoneMatch_ != "" {
  31446. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  31447. }
  31448. if c.ctx_ != nil {
  31449. return ctxhttp.Do(c.ctx_, c.s.client, req)
  31450. }
  31451. return c.s.client.Do(req)
  31452. }
  31453. // Do executes the "compute.targetInstances.list" call.
  31454. // Exactly one of *TargetInstanceList or error will be non-nil. Any
  31455. // non-2xx status code is an error. Response headers are in either
  31456. // *TargetInstanceList.ServerResponse.Header or (if a response was
  31457. // returned at all) in error.(*googleapi.Error).Header. Use
  31458. // googleapi.IsNotModified to check whether the returned error was
  31459. // because http.StatusNotModified was returned.
  31460. func (c *TargetInstancesListCall) Do(opts ...googleapi.CallOption) (*TargetInstanceList, error) {
  31461. gensupport.SetOptions(c.urlParams_, opts...)
  31462. res, err := c.doRequest("json")
  31463. if res != nil && res.StatusCode == http.StatusNotModified {
  31464. if res.Body != nil {
  31465. res.Body.Close()
  31466. }
  31467. return nil, &googleapi.Error{
  31468. Code: res.StatusCode,
  31469. Header: res.Header,
  31470. }
  31471. }
  31472. if err != nil {
  31473. return nil, err
  31474. }
  31475. defer googleapi.CloseBody(res)
  31476. if err := googleapi.CheckResponse(res); err != nil {
  31477. return nil, err
  31478. }
  31479. ret := &TargetInstanceList{
  31480. ServerResponse: googleapi.ServerResponse{
  31481. Header: res.Header,
  31482. HTTPStatusCode: res.StatusCode,
  31483. },
  31484. }
  31485. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  31486. return nil, err
  31487. }
  31488. return ret, nil
  31489. // {
  31490. // "description": "Retrieves a list of TargetInstance resources available to the specified project and zone.",
  31491. // "httpMethod": "GET",
  31492. // "id": "compute.targetInstances.list",
  31493. // "parameterOrder": [
  31494. // "project",
  31495. // "zone"
  31496. // ],
  31497. // "parameters": {
  31498. // "filter": {
  31499. // "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.",
  31500. // "location": "query",
  31501. // "type": "string"
  31502. // },
  31503. // "maxResults": {
  31504. // "default": "500",
  31505. // "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.",
  31506. // "format": "uint32",
  31507. // "location": "query",
  31508. // "maximum": "500",
  31509. // "minimum": "0",
  31510. // "type": "integer"
  31511. // },
  31512. // "pageToken": {
  31513. // "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.",
  31514. // "location": "query",
  31515. // "type": "string"
  31516. // },
  31517. // "project": {
  31518. // "description": "Project ID for this request.",
  31519. // "location": "path",
  31520. // "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])?))",
  31521. // "required": true,
  31522. // "type": "string"
  31523. // },
  31524. // "zone": {
  31525. // "description": "Name of the zone scoping this request.",
  31526. // "location": "path",
  31527. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31528. // "required": true,
  31529. // "type": "string"
  31530. // }
  31531. // },
  31532. // "path": "{project}/zones/{zone}/targetInstances",
  31533. // "response": {
  31534. // "$ref": "TargetInstanceList"
  31535. // },
  31536. // "scopes": [
  31537. // "https://www.googleapis.com/auth/cloud-platform",
  31538. // "https://www.googleapis.com/auth/compute",
  31539. // "https://www.googleapis.com/auth/compute.readonly"
  31540. // ]
  31541. // }
  31542. }
  31543. // Pages invokes f for each page of results.
  31544. // A non-nil error returned from f will halt the iteration.
  31545. // The provided context supersedes any context provided to the Context method.
  31546. func (c *TargetInstancesListCall) Pages(ctx context.Context, f func(*TargetInstanceList) error) error {
  31547. c.ctx_ = ctx
  31548. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  31549. for {
  31550. x, err := c.Do()
  31551. if err != nil {
  31552. return err
  31553. }
  31554. if err := f(x); err != nil {
  31555. return err
  31556. }
  31557. if x.NextPageToken == "" {
  31558. return nil
  31559. }
  31560. c.PageToken(x.NextPageToken)
  31561. }
  31562. }
  31563. // method id "compute.targetPools.addHealthCheck":
  31564. type TargetPoolsAddHealthCheckCall struct {
  31565. s *Service
  31566. project string
  31567. region string
  31568. targetPool string
  31569. targetpoolsaddhealthcheckrequest *TargetPoolsAddHealthCheckRequest
  31570. urlParams_ gensupport.URLParams
  31571. ctx_ context.Context
  31572. }
  31573. // AddHealthCheck: Adds health check URL to targetPool.
  31574. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/addHealthCheck
  31575. func (r *TargetPoolsService) AddHealthCheck(project string, region string, targetPool string, targetpoolsaddhealthcheckrequest *TargetPoolsAddHealthCheckRequest) *TargetPoolsAddHealthCheckCall {
  31576. c := &TargetPoolsAddHealthCheckCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31577. c.project = project
  31578. c.region = region
  31579. c.targetPool = targetPool
  31580. c.targetpoolsaddhealthcheckrequest = targetpoolsaddhealthcheckrequest
  31581. return c
  31582. }
  31583. // Fields allows partial responses to be retrieved. See
  31584. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31585. // for more information.
  31586. func (c *TargetPoolsAddHealthCheckCall) Fields(s ...googleapi.Field) *TargetPoolsAddHealthCheckCall {
  31587. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31588. return c
  31589. }
  31590. // Context sets the context to be used in this call's Do method. Any
  31591. // pending HTTP request will be aborted if the provided context is
  31592. // canceled.
  31593. func (c *TargetPoolsAddHealthCheckCall) Context(ctx context.Context) *TargetPoolsAddHealthCheckCall {
  31594. c.ctx_ = ctx
  31595. return c
  31596. }
  31597. func (c *TargetPoolsAddHealthCheckCall) doRequest(alt string) (*http.Response, error) {
  31598. var body io.Reader = nil
  31599. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsaddhealthcheckrequest)
  31600. if err != nil {
  31601. return nil, err
  31602. }
  31603. ctype := "application/json"
  31604. c.urlParams_.Set("alt", alt)
  31605. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck")
  31606. urls += "?" + c.urlParams_.Encode()
  31607. req, _ := http.NewRequest("POST", urls, body)
  31608. googleapi.Expand(req.URL, map[string]string{
  31609. "project": c.project,
  31610. "region": c.region,
  31611. "targetPool": c.targetPool,
  31612. })
  31613. req.Header.Set("Content-Type", ctype)
  31614. req.Header.Set("User-Agent", c.s.userAgent())
  31615. if c.ctx_ != nil {
  31616. return ctxhttp.Do(c.ctx_, c.s.client, req)
  31617. }
  31618. return c.s.client.Do(req)
  31619. }
  31620. // Do executes the "compute.targetPools.addHealthCheck" call.
  31621. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  31622. // status code is an error. Response headers are in either
  31623. // *Operation.ServerResponse.Header or (if a response was returned at
  31624. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  31625. // to check whether the returned error was because
  31626. // http.StatusNotModified was returned.
  31627. func (c *TargetPoolsAddHealthCheckCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  31628. gensupport.SetOptions(c.urlParams_, opts...)
  31629. res, err := c.doRequest("json")
  31630. if res != nil && res.StatusCode == http.StatusNotModified {
  31631. if res.Body != nil {
  31632. res.Body.Close()
  31633. }
  31634. return nil, &googleapi.Error{
  31635. Code: res.StatusCode,
  31636. Header: res.Header,
  31637. }
  31638. }
  31639. if err != nil {
  31640. return nil, err
  31641. }
  31642. defer googleapi.CloseBody(res)
  31643. if err := googleapi.CheckResponse(res); err != nil {
  31644. return nil, err
  31645. }
  31646. ret := &Operation{
  31647. ServerResponse: googleapi.ServerResponse{
  31648. Header: res.Header,
  31649. HTTPStatusCode: res.StatusCode,
  31650. },
  31651. }
  31652. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  31653. return nil, err
  31654. }
  31655. return ret, nil
  31656. // {
  31657. // "description": "Adds health check URL to targetPool.",
  31658. // "httpMethod": "POST",
  31659. // "id": "compute.targetPools.addHealthCheck",
  31660. // "parameterOrder": [
  31661. // "project",
  31662. // "region",
  31663. // "targetPool"
  31664. // ],
  31665. // "parameters": {
  31666. // "project": {
  31667. // "location": "path",
  31668. // "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])?))",
  31669. // "required": true,
  31670. // "type": "string"
  31671. // },
  31672. // "region": {
  31673. // "description": "Name of the region scoping this request.",
  31674. // "location": "path",
  31675. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31676. // "required": true,
  31677. // "type": "string"
  31678. // },
  31679. // "targetPool": {
  31680. // "description": "Name of the TargetPool resource to which health_check_url is to be added.",
  31681. // "location": "path",
  31682. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31683. // "required": true,
  31684. // "type": "string"
  31685. // }
  31686. // },
  31687. // "path": "{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck",
  31688. // "request": {
  31689. // "$ref": "TargetPoolsAddHealthCheckRequest"
  31690. // },
  31691. // "response": {
  31692. // "$ref": "Operation"
  31693. // },
  31694. // "scopes": [
  31695. // "https://www.googleapis.com/auth/cloud-platform",
  31696. // "https://www.googleapis.com/auth/compute"
  31697. // ]
  31698. // }
  31699. }
  31700. // method id "compute.targetPools.addInstance":
  31701. type TargetPoolsAddInstanceCall struct {
  31702. s *Service
  31703. project string
  31704. region string
  31705. targetPool string
  31706. targetpoolsaddinstancerequest *TargetPoolsAddInstanceRequest
  31707. urlParams_ gensupport.URLParams
  31708. ctx_ context.Context
  31709. }
  31710. // AddInstance: Adds instance URL to targetPool.
  31711. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/addInstance
  31712. func (r *TargetPoolsService) AddInstance(project string, region string, targetPool string, targetpoolsaddinstancerequest *TargetPoolsAddInstanceRequest) *TargetPoolsAddInstanceCall {
  31713. c := &TargetPoolsAddInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31714. c.project = project
  31715. c.region = region
  31716. c.targetPool = targetPool
  31717. c.targetpoolsaddinstancerequest = targetpoolsaddinstancerequest
  31718. return c
  31719. }
  31720. // Fields allows partial responses to be retrieved. See
  31721. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31722. // for more information.
  31723. func (c *TargetPoolsAddInstanceCall) Fields(s ...googleapi.Field) *TargetPoolsAddInstanceCall {
  31724. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31725. return c
  31726. }
  31727. // Context sets the context to be used in this call's Do method. Any
  31728. // pending HTTP request will be aborted if the provided context is
  31729. // canceled.
  31730. func (c *TargetPoolsAddInstanceCall) Context(ctx context.Context) *TargetPoolsAddInstanceCall {
  31731. c.ctx_ = ctx
  31732. return c
  31733. }
  31734. func (c *TargetPoolsAddInstanceCall) doRequest(alt string) (*http.Response, error) {
  31735. var body io.Reader = nil
  31736. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsaddinstancerequest)
  31737. if err != nil {
  31738. return nil, err
  31739. }
  31740. ctype := "application/json"
  31741. c.urlParams_.Set("alt", alt)
  31742. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/addInstance")
  31743. urls += "?" + c.urlParams_.Encode()
  31744. req, _ := http.NewRequest("POST", urls, body)
  31745. googleapi.Expand(req.URL, map[string]string{
  31746. "project": c.project,
  31747. "region": c.region,
  31748. "targetPool": c.targetPool,
  31749. })
  31750. req.Header.Set("Content-Type", ctype)
  31751. req.Header.Set("User-Agent", c.s.userAgent())
  31752. if c.ctx_ != nil {
  31753. return ctxhttp.Do(c.ctx_, c.s.client, req)
  31754. }
  31755. return c.s.client.Do(req)
  31756. }
  31757. // Do executes the "compute.targetPools.addInstance" call.
  31758. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  31759. // status code is an error. Response headers are in either
  31760. // *Operation.ServerResponse.Header or (if a response was returned at
  31761. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  31762. // to check whether the returned error was because
  31763. // http.StatusNotModified was returned.
  31764. func (c *TargetPoolsAddInstanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  31765. gensupport.SetOptions(c.urlParams_, opts...)
  31766. res, err := c.doRequest("json")
  31767. if res != nil && res.StatusCode == http.StatusNotModified {
  31768. if res.Body != nil {
  31769. res.Body.Close()
  31770. }
  31771. return nil, &googleapi.Error{
  31772. Code: res.StatusCode,
  31773. Header: res.Header,
  31774. }
  31775. }
  31776. if err != nil {
  31777. return nil, err
  31778. }
  31779. defer googleapi.CloseBody(res)
  31780. if err := googleapi.CheckResponse(res); err != nil {
  31781. return nil, err
  31782. }
  31783. ret := &Operation{
  31784. ServerResponse: googleapi.ServerResponse{
  31785. Header: res.Header,
  31786. HTTPStatusCode: res.StatusCode,
  31787. },
  31788. }
  31789. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  31790. return nil, err
  31791. }
  31792. return ret, nil
  31793. // {
  31794. // "description": "Adds instance URL to targetPool.",
  31795. // "httpMethod": "POST",
  31796. // "id": "compute.targetPools.addInstance",
  31797. // "parameterOrder": [
  31798. // "project",
  31799. // "region",
  31800. // "targetPool"
  31801. // ],
  31802. // "parameters": {
  31803. // "project": {
  31804. // "location": "path",
  31805. // "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])?))",
  31806. // "required": true,
  31807. // "type": "string"
  31808. // },
  31809. // "region": {
  31810. // "description": "Name of the region scoping this request.",
  31811. // "location": "path",
  31812. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31813. // "required": true,
  31814. // "type": "string"
  31815. // },
  31816. // "targetPool": {
  31817. // "description": "Name of the TargetPool resource to which instance_url is to be added.",
  31818. // "location": "path",
  31819. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31820. // "required": true,
  31821. // "type": "string"
  31822. // }
  31823. // },
  31824. // "path": "{project}/regions/{region}/targetPools/{targetPool}/addInstance",
  31825. // "request": {
  31826. // "$ref": "TargetPoolsAddInstanceRequest"
  31827. // },
  31828. // "response": {
  31829. // "$ref": "Operation"
  31830. // },
  31831. // "scopes": [
  31832. // "https://www.googleapis.com/auth/cloud-platform",
  31833. // "https://www.googleapis.com/auth/compute"
  31834. // ]
  31835. // }
  31836. }
  31837. // method id "compute.targetPools.aggregatedList":
  31838. type TargetPoolsAggregatedListCall struct {
  31839. s *Service
  31840. project string
  31841. urlParams_ gensupport.URLParams
  31842. ifNoneMatch_ string
  31843. ctx_ context.Context
  31844. }
  31845. // AggregatedList: Retrieves an aggregated list of target pools.
  31846. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/aggregatedList
  31847. func (r *TargetPoolsService) AggregatedList(project string) *TargetPoolsAggregatedListCall {
  31848. c := &TargetPoolsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31849. c.project = project
  31850. return c
  31851. }
  31852. // Filter sets the optional parameter "filter": Sets a filter expression
  31853. // for filtering listed resources, in the form filter={expression}. Your
  31854. // {expression} must be in the format: field_name comparison_string
  31855. // literal_string.
  31856. //
  31857. // The field_name is the name of the field you want to compare. Only
  31858. // atomic field types are supported (string, number, boolean). The
  31859. // comparison_string must be either eq (equals) or ne (not equals). The
  31860. // literal_string is the string value to filter to. The literal value
  31861. // must be valid for the type of field you are filtering by (string,
  31862. // number, boolean). For string fields, the literal value is interpreted
  31863. // as a regular expression using RE2 syntax. The literal value must
  31864. // match the entire field.
  31865. //
  31866. // For example, filter=name ne example-instance.
  31867. //
  31868. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  31869. // you can also filter on nested fields. For example, you could filter
  31870. // on instances that have set the scheduling.automaticRestart field to
  31871. // true. In particular, use filtering on nested fields to take advantage
  31872. // of instance labels to organize and filter results based on label
  31873. // values.
  31874. //
  31875. // The Beta API also supports filtering on multiple expressions by
  31876. // providing each separate expression within parentheses. For example,
  31877. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  31878. // Multiple expressions are treated as AND expressions meaning that
  31879. // resources must match all expressions to pass the filters.
  31880. func (c *TargetPoolsAggregatedListCall) Filter(filter string) *TargetPoolsAggregatedListCall {
  31881. c.urlParams_.Set("filter", filter)
  31882. return c
  31883. }
  31884. // MaxResults sets the optional parameter "maxResults": The maximum
  31885. // number of results per page that Compute Engine should return. If the
  31886. // number of available results is larger than maxResults, Compute Engine
  31887. // returns a nextPageToken that can be used to get the next page of
  31888. // results in subsequent list requests.
  31889. func (c *TargetPoolsAggregatedListCall) MaxResults(maxResults int64) *TargetPoolsAggregatedListCall {
  31890. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  31891. return c
  31892. }
  31893. // PageToken sets the optional parameter "pageToken": Specifies a page
  31894. // token to use. Set pageToken to the nextPageToken returned by a
  31895. // previous list request to get the next page of results.
  31896. func (c *TargetPoolsAggregatedListCall) PageToken(pageToken string) *TargetPoolsAggregatedListCall {
  31897. c.urlParams_.Set("pageToken", pageToken)
  31898. return c
  31899. }
  31900. // Fields allows partial responses to be retrieved. See
  31901. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31902. // for more information.
  31903. func (c *TargetPoolsAggregatedListCall) Fields(s ...googleapi.Field) *TargetPoolsAggregatedListCall {
  31904. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31905. return c
  31906. }
  31907. // IfNoneMatch sets the optional parameter which makes the operation
  31908. // fail if the object's ETag matches the given value. This is useful for
  31909. // getting updates only after the object has changed since the last
  31910. // request. Use googleapi.IsNotModified to check whether the response
  31911. // error from Do is the result of In-None-Match.
  31912. func (c *TargetPoolsAggregatedListCall) IfNoneMatch(entityTag string) *TargetPoolsAggregatedListCall {
  31913. c.ifNoneMatch_ = entityTag
  31914. return c
  31915. }
  31916. // Context sets the context to be used in this call's Do method. Any
  31917. // pending HTTP request will be aborted if the provided context is
  31918. // canceled.
  31919. func (c *TargetPoolsAggregatedListCall) Context(ctx context.Context) *TargetPoolsAggregatedListCall {
  31920. c.ctx_ = ctx
  31921. return c
  31922. }
  31923. func (c *TargetPoolsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  31924. var body io.Reader = nil
  31925. c.urlParams_.Set("alt", alt)
  31926. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetPools")
  31927. urls += "?" + c.urlParams_.Encode()
  31928. req, _ := http.NewRequest("GET", urls, body)
  31929. googleapi.Expand(req.URL, map[string]string{
  31930. "project": c.project,
  31931. })
  31932. req.Header.Set("User-Agent", c.s.userAgent())
  31933. if c.ifNoneMatch_ != "" {
  31934. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  31935. }
  31936. if c.ctx_ != nil {
  31937. return ctxhttp.Do(c.ctx_, c.s.client, req)
  31938. }
  31939. return c.s.client.Do(req)
  31940. }
  31941. // Do executes the "compute.targetPools.aggregatedList" call.
  31942. // Exactly one of *TargetPoolAggregatedList or error will be non-nil.
  31943. // Any non-2xx status code is an error. Response headers are in either
  31944. // *TargetPoolAggregatedList.ServerResponse.Header or (if a response was
  31945. // returned at all) in error.(*googleapi.Error).Header. Use
  31946. // googleapi.IsNotModified to check whether the returned error was
  31947. // because http.StatusNotModified was returned.
  31948. func (c *TargetPoolsAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetPoolAggregatedList, error) {
  31949. gensupport.SetOptions(c.urlParams_, opts...)
  31950. res, err := c.doRequest("json")
  31951. if res != nil && res.StatusCode == http.StatusNotModified {
  31952. if res.Body != nil {
  31953. res.Body.Close()
  31954. }
  31955. return nil, &googleapi.Error{
  31956. Code: res.StatusCode,
  31957. Header: res.Header,
  31958. }
  31959. }
  31960. if err != nil {
  31961. return nil, err
  31962. }
  31963. defer googleapi.CloseBody(res)
  31964. if err := googleapi.CheckResponse(res); err != nil {
  31965. return nil, err
  31966. }
  31967. ret := &TargetPoolAggregatedList{
  31968. ServerResponse: googleapi.ServerResponse{
  31969. Header: res.Header,
  31970. HTTPStatusCode: res.StatusCode,
  31971. },
  31972. }
  31973. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  31974. return nil, err
  31975. }
  31976. return ret, nil
  31977. // {
  31978. // "description": "Retrieves an aggregated list of target pools.",
  31979. // "httpMethod": "GET",
  31980. // "id": "compute.targetPools.aggregatedList",
  31981. // "parameterOrder": [
  31982. // "project"
  31983. // ],
  31984. // "parameters": {
  31985. // "filter": {
  31986. // "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.",
  31987. // "location": "query",
  31988. // "type": "string"
  31989. // },
  31990. // "maxResults": {
  31991. // "default": "500",
  31992. // "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.",
  31993. // "format": "uint32",
  31994. // "location": "query",
  31995. // "maximum": "500",
  31996. // "minimum": "0",
  31997. // "type": "integer"
  31998. // },
  31999. // "pageToken": {
  32000. // "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.",
  32001. // "location": "query",
  32002. // "type": "string"
  32003. // },
  32004. // "project": {
  32005. // "description": "Project ID for this request.",
  32006. // "location": "path",
  32007. // "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])?))",
  32008. // "required": true,
  32009. // "type": "string"
  32010. // }
  32011. // },
  32012. // "path": "{project}/aggregated/targetPools",
  32013. // "response": {
  32014. // "$ref": "TargetPoolAggregatedList"
  32015. // },
  32016. // "scopes": [
  32017. // "https://www.googleapis.com/auth/cloud-platform",
  32018. // "https://www.googleapis.com/auth/compute",
  32019. // "https://www.googleapis.com/auth/compute.readonly"
  32020. // ]
  32021. // }
  32022. }
  32023. // Pages invokes f for each page of results.
  32024. // A non-nil error returned from f will halt the iteration.
  32025. // The provided context supersedes any context provided to the Context method.
  32026. func (c *TargetPoolsAggregatedListCall) Pages(ctx context.Context, f func(*TargetPoolAggregatedList) error) error {
  32027. c.ctx_ = ctx
  32028. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  32029. for {
  32030. x, err := c.Do()
  32031. if err != nil {
  32032. return err
  32033. }
  32034. if err := f(x); err != nil {
  32035. return err
  32036. }
  32037. if x.NextPageToken == "" {
  32038. return nil
  32039. }
  32040. c.PageToken(x.NextPageToken)
  32041. }
  32042. }
  32043. // method id "compute.targetPools.delete":
  32044. type TargetPoolsDeleteCall struct {
  32045. s *Service
  32046. project string
  32047. region string
  32048. targetPool string
  32049. urlParams_ gensupport.URLParams
  32050. ctx_ context.Context
  32051. }
  32052. // Delete: Deletes the specified TargetPool resource.
  32053. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/delete
  32054. func (r *TargetPoolsService) Delete(project string, region string, targetPool string) *TargetPoolsDeleteCall {
  32055. c := &TargetPoolsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32056. c.project = project
  32057. c.region = region
  32058. c.targetPool = targetPool
  32059. return c
  32060. }
  32061. // Fields allows partial responses to be retrieved. See
  32062. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32063. // for more information.
  32064. func (c *TargetPoolsDeleteCall) Fields(s ...googleapi.Field) *TargetPoolsDeleteCall {
  32065. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32066. return c
  32067. }
  32068. // Context sets the context to be used in this call's Do method. Any
  32069. // pending HTTP request will be aborted if the provided context is
  32070. // canceled.
  32071. func (c *TargetPoolsDeleteCall) Context(ctx context.Context) *TargetPoolsDeleteCall {
  32072. c.ctx_ = ctx
  32073. return c
  32074. }
  32075. func (c *TargetPoolsDeleteCall) doRequest(alt string) (*http.Response, error) {
  32076. var body io.Reader = nil
  32077. c.urlParams_.Set("alt", alt)
  32078. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}")
  32079. urls += "?" + c.urlParams_.Encode()
  32080. req, _ := http.NewRequest("DELETE", urls, body)
  32081. googleapi.Expand(req.URL, map[string]string{
  32082. "project": c.project,
  32083. "region": c.region,
  32084. "targetPool": c.targetPool,
  32085. })
  32086. req.Header.Set("User-Agent", c.s.userAgent())
  32087. if c.ctx_ != nil {
  32088. return ctxhttp.Do(c.ctx_, c.s.client, req)
  32089. }
  32090. return c.s.client.Do(req)
  32091. }
  32092. // Do executes the "compute.targetPools.delete" call.
  32093. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  32094. // status code is an error. Response headers are in either
  32095. // *Operation.ServerResponse.Header or (if a response was returned at
  32096. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  32097. // to check whether the returned error was because
  32098. // http.StatusNotModified was returned.
  32099. func (c *TargetPoolsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  32100. gensupport.SetOptions(c.urlParams_, opts...)
  32101. res, err := c.doRequest("json")
  32102. if res != nil && res.StatusCode == http.StatusNotModified {
  32103. if res.Body != nil {
  32104. res.Body.Close()
  32105. }
  32106. return nil, &googleapi.Error{
  32107. Code: res.StatusCode,
  32108. Header: res.Header,
  32109. }
  32110. }
  32111. if err != nil {
  32112. return nil, err
  32113. }
  32114. defer googleapi.CloseBody(res)
  32115. if err := googleapi.CheckResponse(res); err != nil {
  32116. return nil, err
  32117. }
  32118. ret := &Operation{
  32119. ServerResponse: googleapi.ServerResponse{
  32120. Header: res.Header,
  32121. HTTPStatusCode: res.StatusCode,
  32122. },
  32123. }
  32124. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  32125. return nil, err
  32126. }
  32127. return ret, nil
  32128. // {
  32129. // "description": "Deletes the specified TargetPool resource.",
  32130. // "httpMethod": "DELETE",
  32131. // "id": "compute.targetPools.delete",
  32132. // "parameterOrder": [
  32133. // "project",
  32134. // "region",
  32135. // "targetPool"
  32136. // ],
  32137. // "parameters": {
  32138. // "project": {
  32139. // "description": "Project ID for this request.",
  32140. // "location": "path",
  32141. // "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])?))",
  32142. // "required": true,
  32143. // "type": "string"
  32144. // },
  32145. // "region": {
  32146. // "description": "Name of the region scoping this request.",
  32147. // "location": "path",
  32148. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32149. // "required": true,
  32150. // "type": "string"
  32151. // },
  32152. // "targetPool": {
  32153. // "description": "Name of the TargetPool resource to delete.",
  32154. // "location": "path",
  32155. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32156. // "required": true,
  32157. // "type": "string"
  32158. // }
  32159. // },
  32160. // "path": "{project}/regions/{region}/targetPools/{targetPool}",
  32161. // "response": {
  32162. // "$ref": "Operation"
  32163. // },
  32164. // "scopes": [
  32165. // "https://www.googleapis.com/auth/cloud-platform",
  32166. // "https://www.googleapis.com/auth/compute"
  32167. // ]
  32168. // }
  32169. }
  32170. // method id "compute.targetPools.get":
  32171. type TargetPoolsGetCall struct {
  32172. s *Service
  32173. project string
  32174. region string
  32175. targetPool string
  32176. urlParams_ gensupport.URLParams
  32177. ifNoneMatch_ string
  32178. ctx_ context.Context
  32179. }
  32180. // Get: Returns the specified TargetPool resource.
  32181. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/get
  32182. func (r *TargetPoolsService) Get(project string, region string, targetPool string) *TargetPoolsGetCall {
  32183. c := &TargetPoolsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32184. c.project = project
  32185. c.region = region
  32186. c.targetPool = targetPool
  32187. return c
  32188. }
  32189. // Fields allows partial responses to be retrieved. See
  32190. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32191. // for more information.
  32192. func (c *TargetPoolsGetCall) Fields(s ...googleapi.Field) *TargetPoolsGetCall {
  32193. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32194. return c
  32195. }
  32196. // IfNoneMatch sets the optional parameter which makes the operation
  32197. // fail if the object's ETag matches the given value. This is useful for
  32198. // getting updates only after the object has changed since the last
  32199. // request. Use googleapi.IsNotModified to check whether the response
  32200. // error from Do is the result of In-None-Match.
  32201. func (c *TargetPoolsGetCall) IfNoneMatch(entityTag string) *TargetPoolsGetCall {
  32202. c.ifNoneMatch_ = entityTag
  32203. return c
  32204. }
  32205. // Context sets the context to be used in this call's Do method. Any
  32206. // pending HTTP request will be aborted if the provided context is
  32207. // canceled.
  32208. func (c *TargetPoolsGetCall) Context(ctx context.Context) *TargetPoolsGetCall {
  32209. c.ctx_ = ctx
  32210. return c
  32211. }
  32212. func (c *TargetPoolsGetCall) doRequest(alt string) (*http.Response, error) {
  32213. var body io.Reader = nil
  32214. c.urlParams_.Set("alt", alt)
  32215. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}")
  32216. urls += "?" + c.urlParams_.Encode()
  32217. req, _ := http.NewRequest("GET", urls, body)
  32218. googleapi.Expand(req.URL, map[string]string{
  32219. "project": c.project,
  32220. "region": c.region,
  32221. "targetPool": c.targetPool,
  32222. })
  32223. req.Header.Set("User-Agent", c.s.userAgent())
  32224. if c.ifNoneMatch_ != "" {
  32225. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  32226. }
  32227. if c.ctx_ != nil {
  32228. return ctxhttp.Do(c.ctx_, c.s.client, req)
  32229. }
  32230. return c.s.client.Do(req)
  32231. }
  32232. // Do executes the "compute.targetPools.get" call.
  32233. // Exactly one of *TargetPool or error will be non-nil. Any non-2xx
  32234. // status code is an error. Response headers are in either
  32235. // *TargetPool.ServerResponse.Header or (if a response was returned at
  32236. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  32237. // to check whether the returned error was because
  32238. // http.StatusNotModified was returned.
  32239. func (c *TargetPoolsGetCall) Do(opts ...googleapi.CallOption) (*TargetPool, error) {
  32240. gensupport.SetOptions(c.urlParams_, opts...)
  32241. res, err := c.doRequest("json")
  32242. if res != nil && res.StatusCode == http.StatusNotModified {
  32243. if res.Body != nil {
  32244. res.Body.Close()
  32245. }
  32246. return nil, &googleapi.Error{
  32247. Code: res.StatusCode,
  32248. Header: res.Header,
  32249. }
  32250. }
  32251. if err != nil {
  32252. return nil, err
  32253. }
  32254. defer googleapi.CloseBody(res)
  32255. if err := googleapi.CheckResponse(res); err != nil {
  32256. return nil, err
  32257. }
  32258. ret := &TargetPool{
  32259. ServerResponse: googleapi.ServerResponse{
  32260. Header: res.Header,
  32261. HTTPStatusCode: res.StatusCode,
  32262. },
  32263. }
  32264. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  32265. return nil, err
  32266. }
  32267. return ret, nil
  32268. // {
  32269. // "description": "Returns the specified TargetPool resource.",
  32270. // "httpMethod": "GET",
  32271. // "id": "compute.targetPools.get",
  32272. // "parameterOrder": [
  32273. // "project",
  32274. // "region",
  32275. // "targetPool"
  32276. // ],
  32277. // "parameters": {
  32278. // "project": {
  32279. // "description": "Project ID for this request.",
  32280. // "location": "path",
  32281. // "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])?))",
  32282. // "required": true,
  32283. // "type": "string"
  32284. // },
  32285. // "region": {
  32286. // "description": "Name of the region scoping this request.",
  32287. // "location": "path",
  32288. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32289. // "required": true,
  32290. // "type": "string"
  32291. // },
  32292. // "targetPool": {
  32293. // "description": "Name of the TargetPool resource to return.",
  32294. // "location": "path",
  32295. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32296. // "required": true,
  32297. // "type": "string"
  32298. // }
  32299. // },
  32300. // "path": "{project}/regions/{region}/targetPools/{targetPool}",
  32301. // "response": {
  32302. // "$ref": "TargetPool"
  32303. // },
  32304. // "scopes": [
  32305. // "https://www.googleapis.com/auth/cloud-platform",
  32306. // "https://www.googleapis.com/auth/compute",
  32307. // "https://www.googleapis.com/auth/compute.readonly"
  32308. // ]
  32309. // }
  32310. }
  32311. // method id "compute.targetPools.getHealth":
  32312. type TargetPoolsGetHealthCall struct {
  32313. s *Service
  32314. project string
  32315. region string
  32316. targetPool string
  32317. instancereference *InstanceReference
  32318. urlParams_ gensupport.URLParams
  32319. ctx_ context.Context
  32320. }
  32321. // GetHealth: Gets the most recent health check results for each IP for
  32322. // the given instance that is referenced by the given TargetPool.
  32323. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/getHealth
  32324. func (r *TargetPoolsService) GetHealth(project string, region string, targetPool string, instancereference *InstanceReference) *TargetPoolsGetHealthCall {
  32325. c := &TargetPoolsGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32326. c.project = project
  32327. c.region = region
  32328. c.targetPool = targetPool
  32329. c.instancereference = instancereference
  32330. return c
  32331. }
  32332. // Fields allows partial responses to be retrieved. See
  32333. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32334. // for more information.
  32335. func (c *TargetPoolsGetHealthCall) Fields(s ...googleapi.Field) *TargetPoolsGetHealthCall {
  32336. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32337. return c
  32338. }
  32339. // Context sets the context to be used in this call's Do method. Any
  32340. // pending HTTP request will be aborted if the provided context is
  32341. // canceled.
  32342. func (c *TargetPoolsGetHealthCall) Context(ctx context.Context) *TargetPoolsGetHealthCall {
  32343. c.ctx_ = ctx
  32344. return c
  32345. }
  32346. func (c *TargetPoolsGetHealthCall) doRequest(alt string) (*http.Response, error) {
  32347. var body io.Reader = nil
  32348. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancereference)
  32349. if err != nil {
  32350. return nil, err
  32351. }
  32352. ctype := "application/json"
  32353. c.urlParams_.Set("alt", alt)
  32354. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/getHealth")
  32355. urls += "?" + c.urlParams_.Encode()
  32356. req, _ := http.NewRequest("POST", urls, body)
  32357. googleapi.Expand(req.URL, map[string]string{
  32358. "project": c.project,
  32359. "region": c.region,
  32360. "targetPool": c.targetPool,
  32361. })
  32362. req.Header.Set("Content-Type", ctype)
  32363. req.Header.Set("User-Agent", c.s.userAgent())
  32364. if c.ctx_ != nil {
  32365. return ctxhttp.Do(c.ctx_, c.s.client, req)
  32366. }
  32367. return c.s.client.Do(req)
  32368. }
  32369. // Do executes the "compute.targetPools.getHealth" call.
  32370. // Exactly one of *TargetPoolInstanceHealth or error will be non-nil.
  32371. // Any non-2xx status code is an error. Response headers are in either
  32372. // *TargetPoolInstanceHealth.ServerResponse.Header or (if a response was
  32373. // returned at all) in error.(*googleapi.Error).Header. Use
  32374. // googleapi.IsNotModified to check whether the returned error was
  32375. // because http.StatusNotModified was returned.
  32376. func (c *TargetPoolsGetHealthCall) Do(opts ...googleapi.CallOption) (*TargetPoolInstanceHealth, error) {
  32377. gensupport.SetOptions(c.urlParams_, opts...)
  32378. res, err := c.doRequest("json")
  32379. if res != nil && res.StatusCode == http.StatusNotModified {
  32380. if res.Body != nil {
  32381. res.Body.Close()
  32382. }
  32383. return nil, &googleapi.Error{
  32384. Code: res.StatusCode,
  32385. Header: res.Header,
  32386. }
  32387. }
  32388. if err != nil {
  32389. return nil, err
  32390. }
  32391. defer googleapi.CloseBody(res)
  32392. if err := googleapi.CheckResponse(res); err != nil {
  32393. return nil, err
  32394. }
  32395. ret := &TargetPoolInstanceHealth{
  32396. ServerResponse: googleapi.ServerResponse{
  32397. Header: res.Header,
  32398. HTTPStatusCode: res.StatusCode,
  32399. },
  32400. }
  32401. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  32402. return nil, err
  32403. }
  32404. return ret, nil
  32405. // {
  32406. // "description": "Gets the most recent health check results for each IP for the given instance that is referenced by the given TargetPool.",
  32407. // "httpMethod": "POST",
  32408. // "id": "compute.targetPools.getHealth",
  32409. // "parameterOrder": [
  32410. // "project",
  32411. // "region",
  32412. // "targetPool"
  32413. // ],
  32414. // "parameters": {
  32415. // "project": {
  32416. // "location": "path",
  32417. // "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])?))",
  32418. // "required": true,
  32419. // "type": "string"
  32420. // },
  32421. // "region": {
  32422. // "description": "Name of the region scoping this request.",
  32423. // "location": "path",
  32424. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32425. // "required": true,
  32426. // "type": "string"
  32427. // },
  32428. // "targetPool": {
  32429. // "description": "Name of the TargetPool resource to which the queried instance belongs.",
  32430. // "location": "path",
  32431. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32432. // "required": true,
  32433. // "type": "string"
  32434. // }
  32435. // },
  32436. // "path": "{project}/regions/{region}/targetPools/{targetPool}/getHealth",
  32437. // "request": {
  32438. // "$ref": "InstanceReference"
  32439. // },
  32440. // "response": {
  32441. // "$ref": "TargetPoolInstanceHealth"
  32442. // },
  32443. // "scopes": [
  32444. // "https://www.googleapis.com/auth/cloud-platform",
  32445. // "https://www.googleapis.com/auth/compute",
  32446. // "https://www.googleapis.com/auth/compute.readonly"
  32447. // ]
  32448. // }
  32449. }
  32450. // method id "compute.targetPools.insert":
  32451. type TargetPoolsInsertCall struct {
  32452. s *Service
  32453. project string
  32454. region string
  32455. targetpool *TargetPool
  32456. urlParams_ gensupport.URLParams
  32457. ctx_ context.Context
  32458. }
  32459. // Insert: Creates a TargetPool resource in the specified project and
  32460. // region using the data included in the request.
  32461. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/insert
  32462. func (r *TargetPoolsService) Insert(project string, region string, targetpool *TargetPool) *TargetPoolsInsertCall {
  32463. c := &TargetPoolsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32464. c.project = project
  32465. c.region = region
  32466. c.targetpool = targetpool
  32467. return c
  32468. }
  32469. // Fields allows partial responses to be retrieved. See
  32470. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32471. // for more information.
  32472. func (c *TargetPoolsInsertCall) Fields(s ...googleapi.Field) *TargetPoolsInsertCall {
  32473. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32474. return c
  32475. }
  32476. // Context sets the context to be used in this call's Do method. Any
  32477. // pending HTTP request will be aborted if the provided context is
  32478. // canceled.
  32479. func (c *TargetPoolsInsertCall) Context(ctx context.Context) *TargetPoolsInsertCall {
  32480. c.ctx_ = ctx
  32481. return c
  32482. }
  32483. func (c *TargetPoolsInsertCall) doRequest(alt string) (*http.Response, error) {
  32484. var body io.Reader = nil
  32485. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpool)
  32486. if err != nil {
  32487. return nil, err
  32488. }
  32489. ctype := "application/json"
  32490. c.urlParams_.Set("alt", alt)
  32491. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools")
  32492. urls += "?" + c.urlParams_.Encode()
  32493. req, _ := http.NewRequest("POST", urls, body)
  32494. googleapi.Expand(req.URL, map[string]string{
  32495. "project": c.project,
  32496. "region": c.region,
  32497. })
  32498. req.Header.Set("Content-Type", ctype)
  32499. req.Header.Set("User-Agent", c.s.userAgent())
  32500. if c.ctx_ != nil {
  32501. return ctxhttp.Do(c.ctx_, c.s.client, req)
  32502. }
  32503. return c.s.client.Do(req)
  32504. }
  32505. // Do executes the "compute.targetPools.insert" call.
  32506. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  32507. // status code is an error. Response headers are in either
  32508. // *Operation.ServerResponse.Header or (if a response was returned at
  32509. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  32510. // to check whether the returned error was because
  32511. // http.StatusNotModified was returned.
  32512. func (c *TargetPoolsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  32513. gensupport.SetOptions(c.urlParams_, opts...)
  32514. res, err := c.doRequest("json")
  32515. if res != nil && res.StatusCode == http.StatusNotModified {
  32516. if res.Body != nil {
  32517. res.Body.Close()
  32518. }
  32519. return nil, &googleapi.Error{
  32520. Code: res.StatusCode,
  32521. Header: res.Header,
  32522. }
  32523. }
  32524. if err != nil {
  32525. return nil, err
  32526. }
  32527. defer googleapi.CloseBody(res)
  32528. if err := googleapi.CheckResponse(res); err != nil {
  32529. return nil, err
  32530. }
  32531. ret := &Operation{
  32532. ServerResponse: googleapi.ServerResponse{
  32533. Header: res.Header,
  32534. HTTPStatusCode: res.StatusCode,
  32535. },
  32536. }
  32537. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  32538. return nil, err
  32539. }
  32540. return ret, nil
  32541. // {
  32542. // "description": "Creates a TargetPool resource in the specified project and region using the data included in the request.",
  32543. // "httpMethod": "POST",
  32544. // "id": "compute.targetPools.insert",
  32545. // "parameterOrder": [
  32546. // "project",
  32547. // "region"
  32548. // ],
  32549. // "parameters": {
  32550. // "project": {
  32551. // "description": "Project ID for this request.",
  32552. // "location": "path",
  32553. // "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])?))",
  32554. // "required": true,
  32555. // "type": "string"
  32556. // },
  32557. // "region": {
  32558. // "description": "Name of the region scoping this request.",
  32559. // "location": "path",
  32560. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32561. // "required": true,
  32562. // "type": "string"
  32563. // }
  32564. // },
  32565. // "path": "{project}/regions/{region}/targetPools",
  32566. // "request": {
  32567. // "$ref": "TargetPool"
  32568. // },
  32569. // "response": {
  32570. // "$ref": "Operation"
  32571. // },
  32572. // "scopes": [
  32573. // "https://www.googleapis.com/auth/cloud-platform",
  32574. // "https://www.googleapis.com/auth/compute"
  32575. // ]
  32576. // }
  32577. }
  32578. // method id "compute.targetPools.list":
  32579. type TargetPoolsListCall struct {
  32580. s *Service
  32581. project string
  32582. region string
  32583. urlParams_ gensupport.URLParams
  32584. ifNoneMatch_ string
  32585. ctx_ context.Context
  32586. }
  32587. // List: Retrieves a list of TargetPool resources available to the
  32588. // specified project and region.
  32589. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/list
  32590. func (r *TargetPoolsService) List(project string, region string) *TargetPoolsListCall {
  32591. c := &TargetPoolsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32592. c.project = project
  32593. c.region = region
  32594. return c
  32595. }
  32596. // Filter sets the optional parameter "filter": Sets a filter expression
  32597. // for filtering listed resources, in the form filter={expression}. Your
  32598. // {expression} must be in the format: field_name comparison_string
  32599. // literal_string.
  32600. //
  32601. // The field_name is the name of the field you want to compare. Only
  32602. // atomic field types are supported (string, number, boolean). The
  32603. // comparison_string must be either eq (equals) or ne (not equals). The
  32604. // literal_string is the string value to filter to. The literal value
  32605. // must be valid for the type of field you are filtering by (string,
  32606. // number, boolean). For string fields, the literal value is interpreted
  32607. // as a regular expression using RE2 syntax. The literal value must
  32608. // match the entire field.
  32609. //
  32610. // For example, filter=name ne example-instance.
  32611. //
  32612. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  32613. // you can also filter on nested fields. For example, you could filter
  32614. // on instances that have set the scheduling.automaticRestart field to
  32615. // true. In particular, use filtering on nested fields to take advantage
  32616. // of instance labels to organize and filter results based on label
  32617. // values.
  32618. //
  32619. // The Beta API also supports filtering on multiple expressions by
  32620. // providing each separate expression within parentheses. For example,
  32621. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  32622. // Multiple expressions are treated as AND expressions meaning that
  32623. // resources must match all expressions to pass the filters.
  32624. func (c *TargetPoolsListCall) Filter(filter string) *TargetPoolsListCall {
  32625. c.urlParams_.Set("filter", filter)
  32626. return c
  32627. }
  32628. // MaxResults sets the optional parameter "maxResults": The maximum
  32629. // number of results per page that Compute Engine should return. If the
  32630. // number of available results is larger than maxResults, Compute Engine
  32631. // returns a nextPageToken that can be used to get the next page of
  32632. // results in subsequent list requests.
  32633. func (c *TargetPoolsListCall) MaxResults(maxResults int64) *TargetPoolsListCall {
  32634. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  32635. return c
  32636. }
  32637. // PageToken sets the optional parameter "pageToken": Specifies a page
  32638. // token to use. Set pageToken to the nextPageToken returned by a
  32639. // previous list request to get the next page of results.
  32640. func (c *TargetPoolsListCall) PageToken(pageToken string) *TargetPoolsListCall {
  32641. c.urlParams_.Set("pageToken", pageToken)
  32642. return c
  32643. }
  32644. // Fields allows partial responses to be retrieved. See
  32645. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32646. // for more information.
  32647. func (c *TargetPoolsListCall) Fields(s ...googleapi.Field) *TargetPoolsListCall {
  32648. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32649. return c
  32650. }
  32651. // IfNoneMatch sets the optional parameter which makes the operation
  32652. // fail if the object's ETag matches the given value. This is useful for
  32653. // getting updates only after the object has changed since the last
  32654. // request. Use googleapi.IsNotModified to check whether the response
  32655. // error from Do is the result of In-None-Match.
  32656. func (c *TargetPoolsListCall) IfNoneMatch(entityTag string) *TargetPoolsListCall {
  32657. c.ifNoneMatch_ = entityTag
  32658. return c
  32659. }
  32660. // Context sets the context to be used in this call's Do method. Any
  32661. // pending HTTP request will be aborted if the provided context is
  32662. // canceled.
  32663. func (c *TargetPoolsListCall) Context(ctx context.Context) *TargetPoolsListCall {
  32664. c.ctx_ = ctx
  32665. return c
  32666. }
  32667. func (c *TargetPoolsListCall) doRequest(alt string) (*http.Response, error) {
  32668. var body io.Reader = nil
  32669. c.urlParams_.Set("alt", alt)
  32670. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools")
  32671. urls += "?" + c.urlParams_.Encode()
  32672. req, _ := http.NewRequest("GET", urls, body)
  32673. googleapi.Expand(req.URL, map[string]string{
  32674. "project": c.project,
  32675. "region": c.region,
  32676. })
  32677. req.Header.Set("User-Agent", c.s.userAgent())
  32678. if c.ifNoneMatch_ != "" {
  32679. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  32680. }
  32681. if c.ctx_ != nil {
  32682. return ctxhttp.Do(c.ctx_, c.s.client, req)
  32683. }
  32684. return c.s.client.Do(req)
  32685. }
  32686. // Do executes the "compute.targetPools.list" call.
  32687. // Exactly one of *TargetPoolList or error will be non-nil. Any non-2xx
  32688. // status code is an error. Response headers are in either
  32689. // *TargetPoolList.ServerResponse.Header or (if a response was returned
  32690. // at all) in error.(*googleapi.Error).Header. Use
  32691. // googleapi.IsNotModified to check whether the returned error was
  32692. // because http.StatusNotModified was returned.
  32693. func (c *TargetPoolsListCall) Do(opts ...googleapi.CallOption) (*TargetPoolList, error) {
  32694. gensupport.SetOptions(c.urlParams_, opts...)
  32695. res, err := c.doRequest("json")
  32696. if res != nil && res.StatusCode == http.StatusNotModified {
  32697. if res.Body != nil {
  32698. res.Body.Close()
  32699. }
  32700. return nil, &googleapi.Error{
  32701. Code: res.StatusCode,
  32702. Header: res.Header,
  32703. }
  32704. }
  32705. if err != nil {
  32706. return nil, err
  32707. }
  32708. defer googleapi.CloseBody(res)
  32709. if err := googleapi.CheckResponse(res); err != nil {
  32710. return nil, err
  32711. }
  32712. ret := &TargetPoolList{
  32713. ServerResponse: googleapi.ServerResponse{
  32714. Header: res.Header,
  32715. HTTPStatusCode: res.StatusCode,
  32716. },
  32717. }
  32718. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  32719. return nil, err
  32720. }
  32721. return ret, nil
  32722. // {
  32723. // "description": "Retrieves a list of TargetPool resources available to the specified project and region.",
  32724. // "httpMethod": "GET",
  32725. // "id": "compute.targetPools.list",
  32726. // "parameterOrder": [
  32727. // "project",
  32728. // "region"
  32729. // ],
  32730. // "parameters": {
  32731. // "filter": {
  32732. // "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.",
  32733. // "location": "query",
  32734. // "type": "string"
  32735. // },
  32736. // "maxResults": {
  32737. // "default": "500",
  32738. // "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.",
  32739. // "format": "uint32",
  32740. // "location": "query",
  32741. // "maximum": "500",
  32742. // "minimum": "0",
  32743. // "type": "integer"
  32744. // },
  32745. // "pageToken": {
  32746. // "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.",
  32747. // "location": "query",
  32748. // "type": "string"
  32749. // },
  32750. // "project": {
  32751. // "description": "Project ID for this request.",
  32752. // "location": "path",
  32753. // "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])?))",
  32754. // "required": true,
  32755. // "type": "string"
  32756. // },
  32757. // "region": {
  32758. // "description": "Name of the region scoping this request.",
  32759. // "location": "path",
  32760. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32761. // "required": true,
  32762. // "type": "string"
  32763. // }
  32764. // },
  32765. // "path": "{project}/regions/{region}/targetPools",
  32766. // "response": {
  32767. // "$ref": "TargetPoolList"
  32768. // },
  32769. // "scopes": [
  32770. // "https://www.googleapis.com/auth/cloud-platform",
  32771. // "https://www.googleapis.com/auth/compute",
  32772. // "https://www.googleapis.com/auth/compute.readonly"
  32773. // ]
  32774. // }
  32775. }
  32776. // Pages invokes f for each page of results.
  32777. // A non-nil error returned from f will halt the iteration.
  32778. // The provided context supersedes any context provided to the Context method.
  32779. func (c *TargetPoolsListCall) Pages(ctx context.Context, f func(*TargetPoolList) error) error {
  32780. c.ctx_ = ctx
  32781. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  32782. for {
  32783. x, err := c.Do()
  32784. if err != nil {
  32785. return err
  32786. }
  32787. if err := f(x); err != nil {
  32788. return err
  32789. }
  32790. if x.NextPageToken == "" {
  32791. return nil
  32792. }
  32793. c.PageToken(x.NextPageToken)
  32794. }
  32795. }
  32796. // method id "compute.targetPools.removeHealthCheck":
  32797. type TargetPoolsRemoveHealthCheckCall struct {
  32798. s *Service
  32799. project string
  32800. region string
  32801. targetPool string
  32802. targetpoolsremovehealthcheckrequest *TargetPoolsRemoveHealthCheckRequest
  32803. urlParams_ gensupport.URLParams
  32804. ctx_ context.Context
  32805. }
  32806. // RemoveHealthCheck: Removes health check URL from targetPool.
  32807. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/removeHealthCheck
  32808. func (r *TargetPoolsService) RemoveHealthCheck(project string, region string, targetPool string, targetpoolsremovehealthcheckrequest *TargetPoolsRemoveHealthCheckRequest) *TargetPoolsRemoveHealthCheckCall {
  32809. c := &TargetPoolsRemoveHealthCheckCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32810. c.project = project
  32811. c.region = region
  32812. c.targetPool = targetPool
  32813. c.targetpoolsremovehealthcheckrequest = targetpoolsremovehealthcheckrequest
  32814. return c
  32815. }
  32816. // Fields allows partial responses to be retrieved. See
  32817. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32818. // for more information.
  32819. func (c *TargetPoolsRemoveHealthCheckCall) Fields(s ...googleapi.Field) *TargetPoolsRemoveHealthCheckCall {
  32820. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32821. return c
  32822. }
  32823. // Context sets the context to be used in this call's Do method. Any
  32824. // pending HTTP request will be aborted if the provided context is
  32825. // canceled.
  32826. func (c *TargetPoolsRemoveHealthCheckCall) Context(ctx context.Context) *TargetPoolsRemoveHealthCheckCall {
  32827. c.ctx_ = ctx
  32828. return c
  32829. }
  32830. func (c *TargetPoolsRemoveHealthCheckCall) doRequest(alt string) (*http.Response, error) {
  32831. var body io.Reader = nil
  32832. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsremovehealthcheckrequest)
  32833. if err != nil {
  32834. return nil, err
  32835. }
  32836. ctype := "application/json"
  32837. c.urlParams_.Set("alt", alt)
  32838. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck")
  32839. urls += "?" + c.urlParams_.Encode()
  32840. req, _ := http.NewRequest("POST", urls, body)
  32841. googleapi.Expand(req.URL, map[string]string{
  32842. "project": c.project,
  32843. "region": c.region,
  32844. "targetPool": c.targetPool,
  32845. })
  32846. req.Header.Set("Content-Type", ctype)
  32847. req.Header.Set("User-Agent", c.s.userAgent())
  32848. if c.ctx_ != nil {
  32849. return ctxhttp.Do(c.ctx_, c.s.client, req)
  32850. }
  32851. return c.s.client.Do(req)
  32852. }
  32853. // Do executes the "compute.targetPools.removeHealthCheck" call.
  32854. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  32855. // status code is an error. Response headers are in either
  32856. // *Operation.ServerResponse.Header or (if a response was returned at
  32857. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  32858. // to check whether the returned error was because
  32859. // http.StatusNotModified was returned.
  32860. func (c *TargetPoolsRemoveHealthCheckCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  32861. gensupport.SetOptions(c.urlParams_, opts...)
  32862. res, err := c.doRequest("json")
  32863. if res != nil && res.StatusCode == http.StatusNotModified {
  32864. if res.Body != nil {
  32865. res.Body.Close()
  32866. }
  32867. return nil, &googleapi.Error{
  32868. Code: res.StatusCode,
  32869. Header: res.Header,
  32870. }
  32871. }
  32872. if err != nil {
  32873. return nil, err
  32874. }
  32875. defer googleapi.CloseBody(res)
  32876. if err := googleapi.CheckResponse(res); err != nil {
  32877. return nil, err
  32878. }
  32879. ret := &Operation{
  32880. ServerResponse: googleapi.ServerResponse{
  32881. Header: res.Header,
  32882. HTTPStatusCode: res.StatusCode,
  32883. },
  32884. }
  32885. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  32886. return nil, err
  32887. }
  32888. return ret, nil
  32889. // {
  32890. // "description": "Removes health check URL from targetPool.",
  32891. // "httpMethod": "POST",
  32892. // "id": "compute.targetPools.removeHealthCheck",
  32893. // "parameterOrder": [
  32894. // "project",
  32895. // "region",
  32896. // "targetPool"
  32897. // ],
  32898. // "parameters": {
  32899. // "project": {
  32900. // "location": "path",
  32901. // "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])?))",
  32902. // "required": true,
  32903. // "type": "string"
  32904. // },
  32905. // "region": {
  32906. // "description": "Name of the region scoping this request.",
  32907. // "location": "path",
  32908. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32909. // "required": true,
  32910. // "type": "string"
  32911. // },
  32912. // "targetPool": {
  32913. // "description": "Name of the TargetPool resource to which health_check_url is to be removed.",
  32914. // "location": "path",
  32915. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32916. // "required": true,
  32917. // "type": "string"
  32918. // }
  32919. // },
  32920. // "path": "{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck",
  32921. // "request": {
  32922. // "$ref": "TargetPoolsRemoveHealthCheckRequest"
  32923. // },
  32924. // "response": {
  32925. // "$ref": "Operation"
  32926. // },
  32927. // "scopes": [
  32928. // "https://www.googleapis.com/auth/cloud-platform",
  32929. // "https://www.googleapis.com/auth/compute"
  32930. // ]
  32931. // }
  32932. }
  32933. // method id "compute.targetPools.removeInstance":
  32934. type TargetPoolsRemoveInstanceCall struct {
  32935. s *Service
  32936. project string
  32937. region string
  32938. targetPool string
  32939. targetpoolsremoveinstancerequest *TargetPoolsRemoveInstanceRequest
  32940. urlParams_ gensupport.URLParams
  32941. ctx_ context.Context
  32942. }
  32943. // RemoveInstance: Removes instance URL from targetPool.
  32944. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/removeInstance
  32945. func (r *TargetPoolsService) RemoveInstance(project string, region string, targetPool string, targetpoolsremoveinstancerequest *TargetPoolsRemoveInstanceRequest) *TargetPoolsRemoveInstanceCall {
  32946. c := &TargetPoolsRemoveInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32947. c.project = project
  32948. c.region = region
  32949. c.targetPool = targetPool
  32950. c.targetpoolsremoveinstancerequest = targetpoolsremoveinstancerequest
  32951. return c
  32952. }
  32953. // Fields allows partial responses to be retrieved. See
  32954. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32955. // for more information.
  32956. func (c *TargetPoolsRemoveInstanceCall) Fields(s ...googleapi.Field) *TargetPoolsRemoveInstanceCall {
  32957. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32958. return c
  32959. }
  32960. // Context sets the context to be used in this call's Do method. Any
  32961. // pending HTTP request will be aborted if the provided context is
  32962. // canceled.
  32963. func (c *TargetPoolsRemoveInstanceCall) Context(ctx context.Context) *TargetPoolsRemoveInstanceCall {
  32964. c.ctx_ = ctx
  32965. return c
  32966. }
  32967. func (c *TargetPoolsRemoveInstanceCall) doRequest(alt string) (*http.Response, error) {
  32968. var body io.Reader = nil
  32969. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsremoveinstancerequest)
  32970. if err != nil {
  32971. return nil, err
  32972. }
  32973. ctype := "application/json"
  32974. c.urlParams_.Set("alt", alt)
  32975. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/removeInstance")
  32976. urls += "?" + c.urlParams_.Encode()
  32977. req, _ := http.NewRequest("POST", urls, body)
  32978. googleapi.Expand(req.URL, map[string]string{
  32979. "project": c.project,
  32980. "region": c.region,
  32981. "targetPool": c.targetPool,
  32982. })
  32983. req.Header.Set("Content-Type", ctype)
  32984. req.Header.Set("User-Agent", c.s.userAgent())
  32985. if c.ctx_ != nil {
  32986. return ctxhttp.Do(c.ctx_, c.s.client, req)
  32987. }
  32988. return c.s.client.Do(req)
  32989. }
  32990. // Do executes the "compute.targetPools.removeInstance" call.
  32991. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  32992. // status code is an error. Response headers are in either
  32993. // *Operation.ServerResponse.Header or (if a response was returned at
  32994. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  32995. // to check whether the returned error was because
  32996. // http.StatusNotModified was returned.
  32997. func (c *TargetPoolsRemoveInstanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  32998. gensupport.SetOptions(c.urlParams_, opts...)
  32999. res, err := c.doRequest("json")
  33000. if res != nil && res.StatusCode == http.StatusNotModified {
  33001. if res.Body != nil {
  33002. res.Body.Close()
  33003. }
  33004. return nil, &googleapi.Error{
  33005. Code: res.StatusCode,
  33006. Header: res.Header,
  33007. }
  33008. }
  33009. if err != nil {
  33010. return nil, err
  33011. }
  33012. defer googleapi.CloseBody(res)
  33013. if err := googleapi.CheckResponse(res); err != nil {
  33014. return nil, err
  33015. }
  33016. ret := &Operation{
  33017. ServerResponse: googleapi.ServerResponse{
  33018. Header: res.Header,
  33019. HTTPStatusCode: res.StatusCode,
  33020. },
  33021. }
  33022. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  33023. return nil, err
  33024. }
  33025. return ret, nil
  33026. // {
  33027. // "description": "Removes instance URL from targetPool.",
  33028. // "httpMethod": "POST",
  33029. // "id": "compute.targetPools.removeInstance",
  33030. // "parameterOrder": [
  33031. // "project",
  33032. // "region",
  33033. // "targetPool"
  33034. // ],
  33035. // "parameters": {
  33036. // "project": {
  33037. // "location": "path",
  33038. // "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])?))",
  33039. // "required": true,
  33040. // "type": "string"
  33041. // },
  33042. // "region": {
  33043. // "description": "Name of the region scoping this request.",
  33044. // "location": "path",
  33045. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33046. // "required": true,
  33047. // "type": "string"
  33048. // },
  33049. // "targetPool": {
  33050. // "description": "Name of the TargetPool resource to which instance_url is to be removed.",
  33051. // "location": "path",
  33052. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33053. // "required": true,
  33054. // "type": "string"
  33055. // }
  33056. // },
  33057. // "path": "{project}/regions/{region}/targetPools/{targetPool}/removeInstance",
  33058. // "request": {
  33059. // "$ref": "TargetPoolsRemoveInstanceRequest"
  33060. // },
  33061. // "response": {
  33062. // "$ref": "Operation"
  33063. // },
  33064. // "scopes": [
  33065. // "https://www.googleapis.com/auth/cloud-platform",
  33066. // "https://www.googleapis.com/auth/compute"
  33067. // ]
  33068. // }
  33069. }
  33070. // method id "compute.targetPools.setBackup":
  33071. type TargetPoolsSetBackupCall struct {
  33072. s *Service
  33073. project string
  33074. region string
  33075. targetPool string
  33076. targetreference *TargetReference
  33077. urlParams_ gensupport.URLParams
  33078. ctx_ context.Context
  33079. }
  33080. // SetBackup: Changes backup pool configurations.
  33081. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/setBackup
  33082. func (r *TargetPoolsService) SetBackup(project string, region string, targetPool string, targetreference *TargetReference) *TargetPoolsSetBackupCall {
  33083. c := &TargetPoolsSetBackupCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33084. c.project = project
  33085. c.region = region
  33086. c.targetPool = targetPool
  33087. c.targetreference = targetreference
  33088. return c
  33089. }
  33090. // FailoverRatio sets the optional parameter "failoverRatio": New
  33091. // failoverRatio value for the containing target pool.
  33092. func (c *TargetPoolsSetBackupCall) FailoverRatio(failoverRatio float64) *TargetPoolsSetBackupCall {
  33093. c.urlParams_.Set("failoverRatio", fmt.Sprint(failoverRatio))
  33094. return c
  33095. }
  33096. // Fields allows partial responses to be retrieved. See
  33097. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33098. // for more information.
  33099. func (c *TargetPoolsSetBackupCall) Fields(s ...googleapi.Field) *TargetPoolsSetBackupCall {
  33100. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33101. return c
  33102. }
  33103. // Context sets the context to be used in this call's Do method. Any
  33104. // pending HTTP request will be aborted if the provided context is
  33105. // canceled.
  33106. func (c *TargetPoolsSetBackupCall) Context(ctx context.Context) *TargetPoolsSetBackupCall {
  33107. c.ctx_ = ctx
  33108. return c
  33109. }
  33110. func (c *TargetPoolsSetBackupCall) doRequest(alt string) (*http.Response, error) {
  33111. var body io.Reader = nil
  33112. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference)
  33113. if err != nil {
  33114. return nil, err
  33115. }
  33116. ctype := "application/json"
  33117. c.urlParams_.Set("alt", alt)
  33118. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/setBackup")
  33119. urls += "?" + c.urlParams_.Encode()
  33120. req, _ := http.NewRequest("POST", urls, body)
  33121. googleapi.Expand(req.URL, map[string]string{
  33122. "project": c.project,
  33123. "region": c.region,
  33124. "targetPool": c.targetPool,
  33125. })
  33126. req.Header.Set("Content-Type", ctype)
  33127. req.Header.Set("User-Agent", c.s.userAgent())
  33128. if c.ctx_ != nil {
  33129. return ctxhttp.Do(c.ctx_, c.s.client, req)
  33130. }
  33131. return c.s.client.Do(req)
  33132. }
  33133. // Do executes the "compute.targetPools.setBackup" call.
  33134. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  33135. // status code is an error. Response headers are in either
  33136. // *Operation.ServerResponse.Header or (if a response was returned at
  33137. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  33138. // to check whether the returned error was because
  33139. // http.StatusNotModified was returned.
  33140. func (c *TargetPoolsSetBackupCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  33141. gensupport.SetOptions(c.urlParams_, opts...)
  33142. res, err := c.doRequest("json")
  33143. if res != nil && res.StatusCode == http.StatusNotModified {
  33144. if res.Body != nil {
  33145. res.Body.Close()
  33146. }
  33147. return nil, &googleapi.Error{
  33148. Code: res.StatusCode,
  33149. Header: res.Header,
  33150. }
  33151. }
  33152. if err != nil {
  33153. return nil, err
  33154. }
  33155. defer googleapi.CloseBody(res)
  33156. if err := googleapi.CheckResponse(res); err != nil {
  33157. return nil, err
  33158. }
  33159. ret := &Operation{
  33160. ServerResponse: googleapi.ServerResponse{
  33161. Header: res.Header,
  33162. HTTPStatusCode: res.StatusCode,
  33163. },
  33164. }
  33165. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  33166. return nil, err
  33167. }
  33168. return ret, nil
  33169. // {
  33170. // "description": "Changes backup pool configurations.",
  33171. // "httpMethod": "POST",
  33172. // "id": "compute.targetPools.setBackup",
  33173. // "parameterOrder": [
  33174. // "project",
  33175. // "region",
  33176. // "targetPool"
  33177. // ],
  33178. // "parameters": {
  33179. // "failoverRatio": {
  33180. // "description": "New failoverRatio value for the containing target pool.",
  33181. // "format": "float",
  33182. // "location": "query",
  33183. // "type": "number"
  33184. // },
  33185. // "project": {
  33186. // "description": "Project ID for this request.",
  33187. // "location": "path",
  33188. // "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])?))",
  33189. // "required": true,
  33190. // "type": "string"
  33191. // },
  33192. // "region": {
  33193. // "description": "Name of the region scoping this request.",
  33194. // "location": "path",
  33195. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33196. // "required": true,
  33197. // "type": "string"
  33198. // },
  33199. // "targetPool": {
  33200. // "description": "Name of the TargetPool resource for which the backup is to be set.",
  33201. // "location": "path",
  33202. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33203. // "required": true,
  33204. // "type": "string"
  33205. // }
  33206. // },
  33207. // "path": "{project}/regions/{region}/targetPools/{targetPool}/setBackup",
  33208. // "request": {
  33209. // "$ref": "TargetReference"
  33210. // },
  33211. // "response": {
  33212. // "$ref": "Operation"
  33213. // },
  33214. // "scopes": [
  33215. // "https://www.googleapis.com/auth/cloud-platform",
  33216. // "https://www.googleapis.com/auth/compute"
  33217. // ]
  33218. // }
  33219. }
  33220. // method id "compute.targetVpnGateways.aggregatedList":
  33221. type TargetVpnGatewaysAggregatedListCall struct {
  33222. s *Service
  33223. project string
  33224. urlParams_ gensupport.URLParams
  33225. ifNoneMatch_ string
  33226. ctx_ context.Context
  33227. }
  33228. // AggregatedList: Retrieves an aggregated list of target VPN gateways .
  33229. func (r *TargetVpnGatewaysService) AggregatedList(project string) *TargetVpnGatewaysAggregatedListCall {
  33230. c := &TargetVpnGatewaysAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33231. c.project = project
  33232. return c
  33233. }
  33234. // Filter sets the optional parameter "filter": Sets a filter expression
  33235. // for filtering listed resources, in the form filter={expression}. Your
  33236. // {expression} must be in the format: field_name comparison_string
  33237. // literal_string.
  33238. //
  33239. // The field_name is the name of the field you want to compare. Only
  33240. // atomic field types are supported (string, number, boolean). The
  33241. // comparison_string must be either eq (equals) or ne (not equals). The
  33242. // literal_string is the string value to filter to. The literal value
  33243. // must be valid for the type of field you are filtering by (string,
  33244. // number, boolean). For string fields, the literal value is interpreted
  33245. // as a regular expression using RE2 syntax. The literal value must
  33246. // match the entire field.
  33247. //
  33248. // For example, filter=name ne example-instance.
  33249. //
  33250. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  33251. // you can also filter on nested fields. For example, you could filter
  33252. // on instances that have set the scheduling.automaticRestart field to
  33253. // true. In particular, use filtering on nested fields to take advantage
  33254. // of instance labels to organize and filter results based on label
  33255. // values.
  33256. //
  33257. // The Beta API also supports filtering on multiple expressions by
  33258. // providing each separate expression within parentheses. For example,
  33259. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  33260. // Multiple expressions are treated as AND expressions meaning that
  33261. // resources must match all expressions to pass the filters.
  33262. func (c *TargetVpnGatewaysAggregatedListCall) Filter(filter string) *TargetVpnGatewaysAggregatedListCall {
  33263. c.urlParams_.Set("filter", filter)
  33264. return c
  33265. }
  33266. // MaxResults sets the optional parameter "maxResults": The maximum
  33267. // number of results per page that Compute Engine should return. If the
  33268. // number of available results is larger than maxResults, Compute Engine
  33269. // returns a nextPageToken that can be used to get the next page of
  33270. // results in subsequent list requests.
  33271. func (c *TargetVpnGatewaysAggregatedListCall) MaxResults(maxResults int64) *TargetVpnGatewaysAggregatedListCall {
  33272. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  33273. return c
  33274. }
  33275. // PageToken sets the optional parameter "pageToken": Specifies a page
  33276. // token to use. Set pageToken to the nextPageToken returned by a
  33277. // previous list request to get the next page of results.
  33278. func (c *TargetVpnGatewaysAggregatedListCall) PageToken(pageToken string) *TargetVpnGatewaysAggregatedListCall {
  33279. c.urlParams_.Set("pageToken", pageToken)
  33280. return c
  33281. }
  33282. // Fields allows partial responses to be retrieved. See
  33283. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33284. // for more information.
  33285. func (c *TargetVpnGatewaysAggregatedListCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysAggregatedListCall {
  33286. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33287. return c
  33288. }
  33289. // IfNoneMatch sets the optional parameter which makes the operation
  33290. // fail if the object's ETag matches the given value. This is useful for
  33291. // getting updates only after the object has changed since the last
  33292. // request. Use googleapi.IsNotModified to check whether the response
  33293. // error from Do is the result of In-None-Match.
  33294. func (c *TargetVpnGatewaysAggregatedListCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysAggregatedListCall {
  33295. c.ifNoneMatch_ = entityTag
  33296. return c
  33297. }
  33298. // Context sets the context to be used in this call's Do method. Any
  33299. // pending HTTP request will be aborted if the provided context is
  33300. // canceled.
  33301. func (c *TargetVpnGatewaysAggregatedListCall) Context(ctx context.Context) *TargetVpnGatewaysAggregatedListCall {
  33302. c.ctx_ = ctx
  33303. return c
  33304. }
  33305. func (c *TargetVpnGatewaysAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  33306. var body io.Reader = nil
  33307. c.urlParams_.Set("alt", alt)
  33308. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetVpnGateways")
  33309. urls += "?" + c.urlParams_.Encode()
  33310. req, _ := http.NewRequest("GET", urls, body)
  33311. googleapi.Expand(req.URL, map[string]string{
  33312. "project": c.project,
  33313. })
  33314. req.Header.Set("User-Agent", c.s.userAgent())
  33315. if c.ifNoneMatch_ != "" {
  33316. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  33317. }
  33318. if c.ctx_ != nil {
  33319. return ctxhttp.Do(c.ctx_, c.s.client, req)
  33320. }
  33321. return c.s.client.Do(req)
  33322. }
  33323. // Do executes the "compute.targetVpnGateways.aggregatedList" call.
  33324. // Exactly one of *TargetVpnGatewayAggregatedList or error will be
  33325. // non-nil. Any non-2xx status code is an error. Response headers are in
  33326. // either *TargetVpnGatewayAggregatedList.ServerResponse.Header or (if a
  33327. // response was returned at all) in error.(*googleapi.Error).Header. Use
  33328. // googleapi.IsNotModified to check whether the returned error was
  33329. // because http.StatusNotModified was returned.
  33330. func (c *TargetVpnGatewaysAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetVpnGatewayAggregatedList, error) {
  33331. gensupport.SetOptions(c.urlParams_, opts...)
  33332. res, err := c.doRequest("json")
  33333. if res != nil && res.StatusCode == http.StatusNotModified {
  33334. if res.Body != nil {
  33335. res.Body.Close()
  33336. }
  33337. return nil, &googleapi.Error{
  33338. Code: res.StatusCode,
  33339. Header: res.Header,
  33340. }
  33341. }
  33342. if err != nil {
  33343. return nil, err
  33344. }
  33345. defer googleapi.CloseBody(res)
  33346. if err := googleapi.CheckResponse(res); err != nil {
  33347. return nil, err
  33348. }
  33349. ret := &TargetVpnGatewayAggregatedList{
  33350. ServerResponse: googleapi.ServerResponse{
  33351. Header: res.Header,
  33352. HTTPStatusCode: res.StatusCode,
  33353. },
  33354. }
  33355. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  33356. return nil, err
  33357. }
  33358. return ret, nil
  33359. // {
  33360. // "description": "Retrieves an aggregated list of target VPN gateways .",
  33361. // "httpMethod": "GET",
  33362. // "id": "compute.targetVpnGateways.aggregatedList",
  33363. // "parameterOrder": [
  33364. // "project"
  33365. // ],
  33366. // "parameters": {
  33367. // "filter": {
  33368. // "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.",
  33369. // "location": "query",
  33370. // "type": "string"
  33371. // },
  33372. // "maxResults": {
  33373. // "default": "500",
  33374. // "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.",
  33375. // "format": "uint32",
  33376. // "location": "query",
  33377. // "maximum": "500",
  33378. // "minimum": "0",
  33379. // "type": "integer"
  33380. // },
  33381. // "pageToken": {
  33382. // "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.",
  33383. // "location": "query",
  33384. // "type": "string"
  33385. // },
  33386. // "project": {
  33387. // "description": "Project ID for this request.",
  33388. // "location": "path",
  33389. // "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])?))",
  33390. // "required": true,
  33391. // "type": "string"
  33392. // }
  33393. // },
  33394. // "path": "{project}/aggregated/targetVpnGateways",
  33395. // "response": {
  33396. // "$ref": "TargetVpnGatewayAggregatedList"
  33397. // },
  33398. // "scopes": [
  33399. // "https://www.googleapis.com/auth/cloud-platform",
  33400. // "https://www.googleapis.com/auth/compute",
  33401. // "https://www.googleapis.com/auth/compute.readonly"
  33402. // ]
  33403. // }
  33404. }
  33405. // Pages invokes f for each page of results.
  33406. // A non-nil error returned from f will halt the iteration.
  33407. // The provided context supersedes any context provided to the Context method.
  33408. func (c *TargetVpnGatewaysAggregatedListCall) Pages(ctx context.Context, f func(*TargetVpnGatewayAggregatedList) error) error {
  33409. c.ctx_ = ctx
  33410. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  33411. for {
  33412. x, err := c.Do()
  33413. if err != nil {
  33414. return err
  33415. }
  33416. if err := f(x); err != nil {
  33417. return err
  33418. }
  33419. if x.NextPageToken == "" {
  33420. return nil
  33421. }
  33422. c.PageToken(x.NextPageToken)
  33423. }
  33424. }
  33425. // method id "compute.targetVpnGateways.delete":
  33426. type TargetVpnGatewaysDeleteCall struct {
  33427. s *Service
  33428. project string
  33429. region string
  33430. targetVpnGateway string
  33431. urlParams_ gensupport.URLParams
  33432. ctx_ context.Context
  33433. }
  33434. // Delete: Deletes the specified TargetVpnGateway resource.
  33435. func (r *TargetVpnGatewaysService) Delete(project string, region string, targetVpnGateway string) *TargetVpnGatewaysDeleteCall {
  33436. c := &TargetVpnGatewaysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33437. c.project = project
  33438. c.region = region
  33439. c.targetVpnGateway = targetVpnGateway
  33440. return c
  33441. }
  33442. // Fields allows partial responses to be retrieved. See
  33443. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33444. // for more information.
  33445. func (c *TargetVpnGatewaysDeleteCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysDeleteCall {
  33446. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33447. return c
  33448. }
  33449. // Context sets the context to be used in this call's Do method. Any
  33450. // pending HTTP request will be aborted if the provided context is
  33451. // canceled.
  33452. func (c *TargetVpnGatewaysDeleteCall) Context(ctx context.Context) *TargetVpnGatewaysDeleteCall {
  33453. c.ctx_ = ctx
  33454. return c
  33455. }
  33456. func (c *TargetVpnGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) {
  33457. var body io.Reader = nil
  33458. c.urlParams_.Set("alt", alt)
  33459. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}")
  33460. urls += "?" + c.urlParams_.Encode()
  33461. req, _ := http.NewRequest("DELETE", urls, body)
  33462. googleapi.Expand(req.URL, map[string]string{
  33463. "project": c.project,
  33464. "region": c.region,
  33465. "targetVpnGateway": c.targetVpnGateway,
  33466. })
  33467. req.Header.Set("User-Agent", c.s.userAgent())
  33468. if c.ctx_ != nil {
  33469. return ctxhttp.Do(c.ctx_, c.s.client, req)
  33470. }
  33471. return c.s.client.Do(req)
  33472. }
  33473. // Do executes the "compute.targetVpnGateways.delete" call.
  33474. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  33475. // status code is an error. Response headers are in either
  33476. // *Operation.ServerResponse.Header or (if a response was returned at
  33477. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  33478. // to check whether the returned error was because
  33479. // http.StatusNotModified was returned.
  33480. func (c *TargetVpnGatewaysDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  33481. gensupport.SetOptions(c.urlParams_, opts...)
  33482. res, err := c.doRequest("json")
  33483. if res != nil && res.StatusCode == http.StatusNotModified {
  33484. if res.Body != nil {
  33485. res.Body.Close()
  33486. }
  33487. return nil, &googleapi.Error{
  33488. Code: res.StatusCode,
  33489. Header: res.Header,
  33490. }
  33491. }
  33492. if err != nil {
  33493. return nil, err
  33494. }
  33495. defer googleapi.CloseBody(res)
  33496. if err := googleapi.CheckResponse(res); err != nil {
  33497. return nil, err
  33498. }
  33499. ret := &Operation{
  33500. ServerResponse: googleapi.ServerResponse{
  33501. Header: res.Header,
  33502. HTTPStatusCode: res.StatusCode,
  33503. },
  33504. }
  33505. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  33506. return nil, err
  33507. }
  33508. return ret, nil
  33509. // {
  33510. // "description": "Deletes the specified TargetVpnGateway resource.",
  33511. // "httpMethod": "DELETE",
  33512. // "id": "compute.targetVpnGateways.delete",
  33513. // "parameterOrder": [
  33514. // "project",
  33515. // "region",
  33516. // "targetVpnGateway"
  33517. // ],
  33518. // "parameters": {
  33519. // "project": {
  33520. // "description": "Project ID for this request.",
  33521. // "location": "path",
  33522. // "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])?))",
  33523. // "required": true,
  33524. // "type": "string"
  33525. // },
  33526. // "region": {
  33527. // "description": "The name of the region for this request.",
  33528. // "location": "path",
  33529. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33530. // "required": true,
  33531. // "type": "string"
  33532. // },
  33533. // "targetVpnGateway": {
  33534. // "description": "Name of the TargetVpnGateway resource to delete.",
  33535. // "location": "path",
  33536. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33537. // "required": true,
  33538. // "type": "string"
  33539. // }
  33540. // },
  33541. // "path": "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}",
  33542. // "response": {
  33543. // "$ref": "Operation"
  33544. // },
  33545. // "scopes": [
  33546. // "https://www.googleapis.com/auth/cloud-platform",
  33547. // "https://www.googleapis.com/auth/compute"
  33548. // ]
  33549. // }
  33550. }
  33551. // method id "compute.targetVpnGateways.get":
  33552. type TargetVpnGatewaysGetCall struct {
  33553. s *Service
  33554. project string
  33555. region string
  33556. targetVpnGateway string
  33557. urlParams_ gensupport.URLParams
  33558. ifNoneMatch_ string
  33559. ctx_ context.Context
  33560. }
  33561. // Get: Returns the specified TargetVpnGateway resource.
  33562. func (r *TargetVpnGatewaysService) Get(project string, region string, targetVpnGateway string) *TargetVpnGatewaysGetCall {
  33563. c := &TargetVpnGatewaysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33564. c.project = project
  33565. c.region = region
  33566. c.targetVpnGateway = targetVpnGateway
  33567. return c
  33568. }
  33569. // Fields allows partial responses to be retrieved. See
  33570. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33571. // for more information.
  33572. func (c *TargetVpnGatewaysGetCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysGetCall {
  33573. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33574. return c
  33575. }
  33576. // IfNoneMatch sets the optional parameter which makes the operation
  33577. // fail if the object's ETag matches the given value. This is useful for
  33578. // getting updates only after the object has changed since the last
  33579. // request. Use googleapi.IsNotModified to check whether the response
  33580. // error from Do is the result of In-None-Match.
  33581. func (c *TargetVpnGatewaysGetCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysGetCall {
  33582. c.ifNoneMatch_ = entityTag
  33583. return c
  33584. }
  33585. // Context sets the context to be used in this call's Do method. Any
  33586. // pending HTTP request will be aborted if the provided context is
  33587. // canceled.
  33588. func (c *TargetVpnGatewaysGetCall) Context(ctx context.Context) *TargetVpnGatewaysGetCall {
  33589. c.ctx_ = ctx
  33590. return c
  33591. }
  33592. func (c *TargetVpnGatewaysGetCall) doRequest(alt string) (*http.Response, error) {
  33593. var body io.Reader = nil
  33594. c.urlParams_.Set("alt", alt)
  33595. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}")
  33596. urls += "?" + c.urlParams_.Encode()
  33597. req, _ := http.NewRequest("GET", urls, body)
  33598. googleapi.Expand(req.URL, map[string]string{
  33599. "project": c.project,
  33600. "region": c.region,
  33601. "targetVpnGateway": c.targetVpnGateway,
  33602. })
  33603. req.Header.Set("User-Agent", c.s.userAgent())
  33604. if c.ifNoneMatch_ != "" {
  33605. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  33606. }
  33607. if c.ctx_ != nil {
  33608. return ctxhttp.Do(c.ctx_, c.s.client, req)
  33609. }
  33610. return c.s.client.Do(req)
  33611. }
  33612. // Do executes the "compute.targetVpnGateways.get" call.
  33613. // Exactly one of *TargetVpnGateway or error will be non-nil. Any
  33614. // non-2xx status code is an error. Response headers are in either
  33615. // *TargetVpnGateway.ServerResponse.Header or (if a response was
  33616. // returned at all) in error.(*googleapi.Error).Header. Use
  33617. // googleapi.IsNotModified to check whether the returned error was
  33618. // because http.StatusNotModified was returned.
  33619. func (c *TargetVpnGatewaysGetCall) Do(opts ...googleapi.CallOption) (*TargetVpnGateway, error) {
  33620. gensupport.SetOptions(c.urlParams_, opts...)
  33621. res, err := c.doRequest("json")
  33622. if res != nil && res.StatusCode == http.StatusNotModified {
  33623. if res.Body != nil {
  33624. res.Body.Close()
  33625. }
  33626. return nil, &googleapi.Error{
  33627. Code: res.StatusCode,
  33628. Header: res.Header,
  33629. }
  33630. }
  33631. if err != nil {
  33632. return nil, err
  33633. }
  33634. defer googleapi.CloseBody(res)
  33635. if err := googleapi.CheckResponse(res); err != nil {
  33636. return nil, err
  33637. }
  33638. ret := &TargetVpnGateway{
  33639. ServerResponse: googleapi.ServerResponse{
  33640. Header: res.Header,
  33641. HTTPStatusCode: res.StatusCode,
  33642. },
  33643. }
  33644. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  33645. return nil, err
  33646. }
  33647. return ret, nil
  33648. // {
  33649. // "description": "Returns the specified TargetVpnGateway resource.",
  33650. // "httpMethod": "GET",
  33651. // "id": "compute.targetVpnGateways.get",
  33652. // "parameterOrder": [
  33653. // "project",
  33654. // "region",
  33655. // "targetVpnGateway"
  33656. // ],
  33657. // "parameters": {
  33658. // "project": {
  33659. // "description": "Project ID for this request.",
  33660. // "location": "path",
  33661. // "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])?))",
  33662. // "required": true,
  33663. // "type": "string"
  33664. // },
  33665. // "region": {
  33666. // "description": "The name of the region for this request.",
  33667. // "location": "path",
  33668. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33669. // "required": true,
  33670. // "type": "string"
  33671. // },
  33672. // "targetVpnGateway": {
  33673. // "description": "Name of the TargetVpnGateway resource to return.",
  33674. // "location": "path",
  33675. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33676. // "required": true,
  33677. // "type": "string"
  33678. // }
  33679. // },
  33680. // "path": "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}",
  33681. // "response": {
  33682. // "$ref": "TargetVpnGateway"
  33683. // },
  33684. // "scopes": [
  33685. // "https://www.googleapis.com/auth/cloud-platform",
  33686. // "https://www.googleapis.com/auth/compute",
  33687. // "https://www.googleapis.com/auth/compute.readonly"
  33688. // ]
  33689. // }
  33690. }
  33691. // method id "compute.targetVpnGateways.insert":
  33692. type TargetVpnGatewaysInsertCall struct {
  33693. s *Service
  33694. project string
  33695. region string
  33696. targetvpngateway *TargetVpnGateway
  33697. urlParams_ gensupport.URLParams
  33698. ctx_ context.Context
  33699. }
  33700. // Insert: Creates a TargetVpnGateway resource in the specified project
  33701. // and region using the data included in the request.
  33702. func (r *TargetVpnGatewaysService) Insert(project string, region string, targetvpngateway *TargetVpnGateway) *TargetVpnGatewaysInsertCall {
  33703. c := &TargetVpnGatewaysInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33704. c.project = project
  33705. c.region = region
  33706. c.targetvpngateway = targetvpngateway
  33707. return c
  33708. }
  33709. // Fields allows partial responses to be retrieved. See
  33710. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33711. // for more information.
  33712. func (c *TargetVpnGatewaysInsertCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysInsertCall {
  33713. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33714. return c
  33715. }
  33716. // Context sets the context to be used in this call's Do method. Any
  33717. // pending HTTP request will be aborted if the provided context is
  33718. // canceled.
  33719. func (c *TargetVpnGatewaysInsertCall) Context(ctx context.Context) *TargetVpnGatewaysInsertCall {
  33720. c.ctx_ = ctx
  33721. return c
  33722. }
  33723. func (c *TargetVpnGatewaysInsertCall) doRequest(alt string) (*http.Response, error) {
  33724. var body io.Reader = nil
  33725. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetvpngateway)
  33726. if err != nil {
  33727. return nil, err
  33728. }
  33729. ctype := "application/json"
  33730. c.urlParams_.Set("alt", alt)
  33731. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways")
  33732. urls += "?" + c.urlParams_.Encode()
  33733. req, _ := http.NewRequest("POST", urls, body)
  33734. googleapi.Expand(req.URL, map[string]string{
  33735. "project": c.project,
  33736. "region": c.region,
  33737. })
  33738. req.Header.Set("Content-Type", ctype)
  33739. req.Header.Set("User-Agent", c.s.userAgent())
  33740. if c.ctx_ != nil {
  33741. return ctxhttp.Do(c.ctx_, c.s.client, req)
  33742. }
  33743. return c.s.client.Do(req)
  33744. }
  33745. // Do executes the "compute.targetVpnGateways.insert" call.
  33746. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  33747. // status code is an error. Response headers are in either
  33748. // *Operation.ServerResponse.Header or (if a response was returned at
  33749. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  33750. // to check whether the returned error was because
  33751. // http.StatusNotModified was returned.
  33752. func (c *TargetVpnGatewaysInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  33753. gensupport.SetOptions(c.urlParams_, opts...)
  33754. res, err := c.doRequest("json")
  33755. if res != nil && res.StatusCode == http.StatusNotModified {
  33756. if res.Body != nil {
  33757. res.Body.Close()
  33758. }
  33759. return nil, &googleapi.Error{
  33760. Code: res.StatusCode,
  33761. Header: res.Header,
  33762. }
  33763. }
  33764. if err != nil {
  33765. return nil, err
  33766. }
  33767. defer googleapi.CloseBody(res)
  33768. if err := googleapi.CheckResponse(res); err != nil {
  33769. return nil, err
  33770. }
  33771. ret := &Operation{
  33772. ServerResponse: googleapi.ServerResponse{
  33773. Header: res.Header,
  33774. HTTPStatusCode: res.StatusCode,
  33775. },
  33776. }
  33777. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  33778. return nil, err
  33779. }
  33780. return ret, nil
  33781. // {
  33782. // "description": "Creates a TargetVpnGateway resource in the specified project and region using the data included in the request.",
  33783. // "httpMethod": "POST",
  33784. // "id": "compute.targetVpnGateways.insert",
  33785. // "parameterOrder": [
  33786. // "project",
  33787. // "region"
  33788. // ],
  33789. // "parameters": {
  33790. // "project": {
  33791. // "description": "Project ID for this request.",
  33792. // "location": "path",
  33793. // "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])?))",
  33794. // "required": true,
  33795. // "type": "string"
  33796. // },
  33797. // "region": {
  33798. // "description": "The name of the region for this request.",
  33799. // "location": "path",
  33800. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33801. // "required": true,
  33802. // "type": "string"
  33803. // }
  33804. // },
  33805. // "path": "{project}/regions/{region}/targetVpnGateways",
  33806. // "request": {
  33807. // "$ref": "TargetVpnGateway"
  33808. // },
  33809. // "response": {
  33810. // "$ref": "Operation"
  33811. // },
  33812. // "scopes": [
  33813. // "https://www.googleapis.com/auth/cloud-platform",
  33814. // "https://www.googleapis.com/auth/compute"
  33815. // ]
  33816. // }
  33817. }
  33818. // method id "compute.targetVpnGateways.list":
  33819. type TargetVpnGatewaysListCall struct {
  33820. s *Service
  33821. project string
  33822. region string
  33823. urlParams_ gensupport.URLParams
  33824. ifNoneMatch_ string
  33825. ctx_ context.Context
  33826. }
  33827. // List: Retrieves a list of TargetVpnGateway resources available to the
  33828. // specified project and region.
  33829. func (r *TargetVpnGatewaysService) List(project string, region string) *TargetVpnGatewaysListCall {
  33830. c := &TargetVpnGatewaysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33831. c.project = project
  33832. c.region = region
  33833. return c
  33834. }
  33835. // Filter sets the optional parameter "filter": Sets a filter expression
  33836. // for filtering listed resources, in the form filter={expression}. Your
  33837. // {expression} must be in the format: field_name comparison_string
  33838. // literal_string.
  33839. //
  33840. // The field_name is the name of the field you want to compare. Only
  33841. // atomic field types are supported (string, number, boolean). The
  33842. // comparison_string must be either eq (equals) or ne (not equals). The
  33843. // literal_string is the string value to filter to. The literal value
  33844. // must be valid for the type of field you are filtering by (string,
  33845. // number, boolean). For string fields, the literal value is interpreted
  33846. // as a regular expression using RE2 syntax. The literal value must
  33847. // match the entire field.
  33848. //
  33849. // For example, filter=name ne example-instance.
  33850. //
  33851. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  33852. // you can also filter on nested fields. For example, you could filter
  33853. // on instances that have set the scheduling.automaticRestart field to
  33854. // true. In particular, use filtering on nested fields to take advantage
  33855. // of instance labels to organize and filter results based on label
  33856. // values.
  33857. //
  33858. // The Beta API also supports filtering on multiple expressions by
  33859. // providing each separate expression within parentheses. For example,
  33860. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  33861. // Multiple expressions are treated as AND expressions meaning that
  33862. // resources must match all expressions to pass the filters.
  33863. func (c *TargetVpnGatewaysListCall) Filter(filter string) *TargetVpnGatewaysListCall {
  33864. c.urlParams_.Set("filter", filter)
  33865. return c
  33866. }
  33867. // MaxResults sets the optional parameter "maxResults": The maximum
  33868. // number of results per page that Compute Engine should return. If the
  33869. // number of available results is larger than maxResults, Compute Engine
  33870. // returns a nextPageToken that can be used to get the next page of
  33871. // results in subsequent list requests.
  33872. func (c *TargetVpnGatewaysListCall) MaxResults(maxResults int64) *TargetVpnGatewaysListCall {
  33873. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  33874. return c
  33875. }
  33876. // PageToken sets the optional parameter "pageToken": Specifies a page
  33877. // token to use. Set pageToken to the nextPageToken returned by a
  33878. // previous list request to get the next page of results.
  33879. func (c *TargetVpnGatewaysListCall) PageToken(pageToken string) *TargetVpnGatewaysListCall {
  33880. c.urlParams_.Set("pageToken", pageToken)
  33881. return c
  33882. }
  33883. // Fields allows partial responses to be retrieved. See
  33884. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33885. // for more information.
  33886. func (c *TargetVpnGatewaysListCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysListCall {
  33887. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33888. return c
  33889. }
  33890. // IfNoneMatch sets the optional parameter which makes the operation
  33891. // fail if the object's ETag matches the given value. This is useful for
  33892. // getting updates only after the object has changed since the last
  33893. // request. Use googleapi.IsNotModified to check whether the response
  33894. // error from Do is the result of In-None-Match.
  33895. func (c *TargetVpnGatewaysListCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysListCall {
  33896. c.ifNoneMatch_ = entityTag
  33897. return c
  33898. }
  33899. // Context sets the context to be used in this call's Do method. Any
  33900. // pending HTTP request will be aborted if the provided context is
  33901. // canceled.
  33902. func (c *TargetVpnGatewaysListCall) Context(ctx context.Context) *TargetVpnGatewaysListCall {
  33903. c.ctx_ = ctx
  33904. return c
  33905. }
  33906. func (c *TargetVpnGatewaysListCall) doRequest(alt string) (*http.Response, error) {
  33907. var body io.Reader = nil
  33908. c.urlParams_.Set("alt", alt)
  33909. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways")
  33910. urls += "?" + c.urlParams_.Encode()
  33911. req, _ := http.NewRequest("GET", urls, body)
  33912. googleapi.Expand(req.URL, map[string]string{
  33913. "project": c.project,
  33914. "region": c.region,
  33915. })
  33916. req.Header.Set("User-Agent", c.s.userAgent())
  33917. if c.ifNoneMatch_ != "" {
  33918. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  33919. }
  33920. if c.ctx_ != nil {
  33921. return ctxhttp.Do(c.ctx_, c.s.client, req)
  33922. }
  33923. return c.s.client.Do(req)
  33924. }
  33925. // Do executes the "compute.targetVpnGateways.list" call.
  33926. // Exactly one of *TargetVpnGatewayList or error will be non-nil. Any
  33927. // non-2xx status code is an error. Response headers are in either
  33928. // *TargetVpnGatewayList.ServerResponse.Header or (if a response was
  33929. // returned at all) in error.(*googleapi.Error).Header. Use
  33930. // googleapi.IsNotModified to check whether the returned error was
  33931. // because http.StatusNotModified was returned.
  33932. func (c *TargetVpnGatewaysListCall) Do(opts ...googleapi.CallOption) (*TargetVpnGatewayList, error) {
  33933. gensupport.SetOptions(c.urlParams_, opts...)
  33934. res, err := c.doRequest("json")
  33935. if res != nil && res.StatusCode == http.StatusNotModified {
  33936. if res.Body != nil {
  33937. res.Body.Close()
  33938. }
  33939. return nil, &googleapi.Error{
  33940. Code: res.StatusCode,
  33941. Header: res.Header,
  33942. }
  33943. }
  33944. if err != nil {
  33945. return nil, err
  33946. }
  33947. defer googleapi.CloseBody(res)
  33948. if err := googleapi.CheckResponse(res); err != nil {
  33949. return nil, err
  33950. }
  33951. ret := &TargetVpnGatewayList{
  33952. ServerResponse: googleapi.ServerResponse{
  33953. Header: res.Header,
  33954. HTTPStatusCode: res.StatusCode,
  33955. },
  33956. }
  33957. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  33958. return nil, err
  33959. }
  33960. return ret, nil
  33961. // {
  33962. // "description": "Retrieves a list of TargetVpnGateway resources available to the specified project and region.",
  33963. // "httpMethod": "GET",
  33964. // "id": "compute.targetVpnGateways.list",
  33965. // "parameterOrder": [
  33966. // "project",
  33967. // "region"
  33968. // ],
  33969. // "parameters": {
  33970. // "filter": {
  33971. // "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.",
  33972. // "location": "query",
  33973. // "type": "string"
  33974. // },
  33975. // "maxResults": {
  33976. // "default": "500",
  33977. // "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.",
  33978. // "format": "uint32",
  33979. // "location": "query",
  33980. // "maximum": "500",
  33981. // "minimum": "0",
  33982. // "type": "integer"
  33983. // },
  33984. // "pageToken": {
  33985. // "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.",
  33986. // "location": "query",
  33987. // "type": "string"
  33988. // },
  33989. // "project": {
  33990. // "description": "Project ID for this request.",
  33991. // "location": "path",
  33992. // "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])?))",
  33993. // "required": true,
  33994. // "type": "string"
  33995. // },
  33996. // "region": {
  33997. // "description": "The name of the region for this request.",
  33998. // "location": "path",
  33999. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34000. // "required": true,
  34001. // "type": "string"
  34002. // }
  34003. // },
  34004. // "path": "{project}/regions/{region}/targetVpnGateways",
  34005. // "response": {
  34006. // "$ref": "TargetVpnGatewayList"
  34007. // },
  34008. // "scopes": [
  34009. // "https://www.googleapis.com/auth/cloud-platform",
  34010. // "https://www.googleapis.com/auth/compute",
  34011. // "https://www.googleapis.com/auth/compute.readonly"
  34012. // ]
  34013. // }
  34014. }
  34015. // Pages invokes f for each page of results.
  34016. // A non-nil error returned from f will halt the iteration.
  34017. // The provided context supersedes any context provided to the Context method.
  34018. func (c *TargetVpnGatewaysListCall) Pages(ctx context.Context, f func(*TargetVpnGatewayList) error) error {
  34019. c.ctx_ = ctx
  34020. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  34021. for {
  34022. x, err := c.Do()
  34023. if err != nil {
  34024. return err
  34025. }
  34026. if err := f(x); err != nil {
  34027. return err
  34028. }
  34029. if x.NextPageToken == "" {
  34030. return nil
  34031. }
  34032. c.PageToken(x.NextPageToken)
  34033. }
  34034. }
  34035. // method id "compute.urlMaps.delete":
  34036. type UrlMapsDeleteCall struct {
  34037. s *Service
  34038. project string
  34039. urlMap string
  34040. urlParams_ gensupport.URLParams
  34041. ctx_ context.Context
  34042. }
  34043. // Delete: Deletes the specified UrlMap resource.
  34044. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/delete
  34045. func (r *UrlMapsService) Delete(project string, urlMap string) *UrlMapsDeleteCall {
  34046. c := &UrlMapsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34047. c.project = project
  34048. c.urlMap = urlMap
  34049. return c
  34050. }
  34051. // Fields allows partial responses to be retrieved. See
  34052. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34053. // for more information.
  34054. func (c *UrlMapsDeleteCall) Fields(s ...googleapi.Field) *UrlMapsDeleteCall {
  34055. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34056. return c
  34057. }
  34058. // Context sets the context to be used in this call's Do method. Any
  34059. // pending HTTP request will be aborted if the provided context is
  34060. // canceled.
  34061. func (c *UrlMapsDeleteCall) Context(ctx context.Context) *UrlMapsDeleteCall {
  34062. c.ctx_ = ctx
  34063. return c
  34064. }
  34065. func (c *UrlMapsDeleteCall) doRequest(alt string) (*http.Response, error) {
  34066. var body io.Reader = nil
  34067. c.urlParams_.Set("alt", alt)
  34068. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  34069. urls += "?" + c.urlParams_.Encode()
  34070. req, _ := http.NewRequest("DELETE", urls, body)
  34071. googleapi.Expand(req.URL, map[string]string{
  34072. "project": c.project,
  34073. "urlMap": c.urlMap,
  34074. })
  34075. req.Header.Set("User-Agent", c.s.userAgent())
  34076. if c.ctx_ != nil {
  34077. return ctxhttp.Do(c.ctx_, c.s.client, req)
  34078. }
  34079. return c.s.client.Do(req)
  34080. }
  34081. // Do executes the "compute.urlMaps.delete" call.
  34082. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  34083. // status code is an error. Response headers are in either
  34084. // *Operation.ServerResponse.Header or (if a response was returned at
  34085. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  34086. // to check whether the returned error was because
  34087. // http.StatusNotModified was returned.
  34088. func (c *UrlMapsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  34089. gensupport.SetOptions(c.urlParams_, opts...)
  34090. res, err := c.doRequest("json")
  34091. if res != nil && res.StatusCode == http.StatusNotModified {
  34092. if res.Body != nil {
  34093. res.Body.Close()
  34094. }
  34095. return nil, &googleapi.Error{
  34096. Code: res.StatusCode,
  34097. Header: res.Header,
  34098. }
  34099. }
  34100. if err != nil {
  34101. return nil, err
  34102. }
  34103. defer googleapi.CloseBody(res)
  34104. if err := googleapi.CheckResponse(res); err != nil {
  34105. return nil, err
  34106. }
  34107. ret := &Operation{
  34108. ServerResponse: googleapi.ServerResponse{
  34109. Header: res.Header,
  34110. HTTPStatusCode: res.StatusCode,
  34111. },
  34112. }
  34113. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  34114. return nil, err
  34115. }
  34116. return ret, nil
  34117. // {
  34118. // "description": "Deletes the specified UrlMap resource.",
  34119. // "httpMethod": "DELETE",
  34120. // "id": "compute.urlMaps.delete",
  34121. // "parameterOrder": [
  34122. // "project",
  34123. // "urlMap"
  34124. // ],
  34125. // "parameters": {
  34126. // "project": {
  34127. // "description": "Project ID for this request.",
  34128. // "location": "path",
  34129. // "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])?))",
  34130. // "required": true,
  34131. // "type": "string"
  34132. // },
  34133. // "urlMap": {
  34134. // "description": "Name of the UrlMap resource to delete.",
  34135. // "location": "path",
  34136. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34137. // "required": true,
  34138. // "type": "string"
  34139. // }
  34140. // },
  34141. // "path": "{project}/global/urlMaps/{urlMap}",
  34142. // "response": {
  34143. // "$ref": "Operation"
  34144. // },
  34145. // "scopes": [
  34146. // "https://www.googleapis.com/auth/cloud-platform",
  34147. // "https://www.googleapis.com/auth/compute"
  34148. // ]
  34149. // }
  34150. }
  34151. // method id "compute.urlMaps.get":
  34152. type UrlMapsGetCall struct {
  34153. s *Service
  34154. project string
  34155. urlMap string
  34156. urlParams_ gensupport.URLParams
  34157. ifNoneMatch_ string
  34158. ctx_ context.Context
  34159. }
  34160. // Get: Returns the specified UrlMap resource.
  34161. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/get
  34162. func (r *UrlMapsService) Get(project string, urlMap string) *UrlMapsGetCall {
  34163. c := &UrlMapsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34164. c.project = project
  34165. c.urlMap = urlMap
  34166. return c
  34167. }
  34168. // Fields allows partial responses to be retrieved. See
  34169. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34170. // for more information.
  34171. func (c *UrlMapsGetCall) Fields(s ...googleapi.Field) *UrlMapsGetCall {
  34172. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34173. return c
  34174. }
  34175. // IfNoneMatch sets the optional parameter which makes the operation
  34176. // fail if the object's ETag matches the given value. This is useful for
  34177. // getting updates only after the object has changed since the last
  34178. // request. Use googleapi.IsNotModified to check whether the response
  34179. // error from Do is the result of In-None-Match.
  34180. func (c *UrlMapsGetCall) IfNoneMatch(entityTag string) *UrlMapsGetCall {
  34181. c.ifNoneMatch_ = entityTag
  34182. return c
  34183. }
  34184. // Context sets the context to be used in this call's Do method. Any
  34185. // pending HTTP request will be aborted if the provided context is
  34186. // canceled.
  34187. func (c *UrlMapsGetCall) Context(ctx context.Context) *UrlMapsGetCall {
  34188. c.ctx_ = ctx
  34189. return c
  34190. }
  34191. func (c *UrlMapsGetCall) doRequest(alt string) (*http.Response, error) {
  34192. var body io.Reader = nil
  34193. c.urlParams_.Set("alt", alt)
  34194. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  34195. urls += "?" + c.urlParams_.Encode()
  34196. req, _ := http.NewRequest("GET", urls, body)
  34197. googleapi.Expand(req.URL, map[string]string{
  34198. "project": c.project,
  34199. "urlMap": c.urlMap,
  34200. })
  34201. req.Header.Set("User-Agent", c.s.userAgent())
  34202. if c.ifNoneMatch_ != "" {
  34203. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  34204. }
  34205. if c.ctx_ != nil {
  34206. return ctxhttp.Do(c.ctx_, c.s.client, req)
  34207. }
  34208. return c.s.client.Do(req)
  34209. }
  34210. // Do executes the "compute.urlMaps.get" call.
  34211. // Exactly one of *UrlMap or error will be non-nil. Any non-2xx status
  34212. // code is an error. Response headers are in either
  34213. // *UrlMap.ServerResponse.Header or (if a response was returned at all)
  34214. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  34215. // check whether the returned error was because http.StatusNotModified
  34216. // was returned.
  34217. func (c *UrlMapsGetCall) Do(opts ...googleapi.CallOption) (*UrlMap, error) {
  34218. gensupport.SetOptions(c.urlParams_, opts...)
  34219. res, err := c.doRequest("json")
  34220. if res != nil && res.StatusCode == http.StatusNotModified {
  34221. if res.Body != nil {
  34222. res.Body.Close()
  34223. }
  34224. return nil, &googleapi.Error{
  34225. Code: res.StatusCode,
  34226. Header: res.Header,
  34227. }
  34228. }
  34229. if err != nil {
  34230. return nil, err
  34231. }
  34232. defer googleapi.CloseBody(res)
  34233. if err := googleapi.CheckResponse(res); err != nil {
  34234. return nil, err
  34235. }
  34236. ret := &UrlMap{
  34237. ServerResponse: googleapi.ServerResponse{
  34238. Header: res.Header,
  34239. HTTPStatusCode: res.StatusCode,
  34240. },
  34241. }
  34242. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  34243. return nil, err
  34244. }
  34245. return ret, nil
  34246. // {
  34247. // "description": "Returns the specified UrlMap resource.",
  34248. // "httpMethod": "GET",
  34249. // "id": "compute.urlMaps.get",
  34250. // "parameterOrder": [
  34251. // "project",
  34252. // "urlMap"
  34253. // ],
  34254. // "parameters": {
  34255. // "project": {
  34256. // "description": "Project ID for this request.",
  34257. // "location": "path",
  34258. // "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])?))",
  34259. // "required": true,
  34260. // "type": "string"
  34261. // },
  34262. // "urlMap": {
  34263. // "description": "Name of the UrlMap resource to return.",
  34264. // "location": "path",
  34265. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34266. // "required": true,
  34267. // "type": "string"
  34268. // }
  34269. // },
  34270. // "path": "{project}/global/urlMaps/{urlMap}",
  34271. // "response": {
  34272. // "$ref": "UrlMap"
  34273. // },
  34274. // "scopes": [
  34275. // "https://www.googleapis.com/auth/cloud-platform",
  34276. // "https://www.googleapis.com/auth/compute",
  34277. // "https://www.googleapis.com/auth/compute.readonly"
  34278. // ]
  34279. // }
  34280. }
  34281. // method id "compute.urlMaps.insert":
  34282. type UrlMapsInsertCall struct {
  34283. s *Service
  34284. project string
  34285. urlmap *UrlMap
  34286. urlParams_ gensupport.URLParams
  34287. ctx_ context.Context
  34288. }
  34289. // Insert: Creates a UrlMap resource in the specified project using the
  34290. // data included in the request.
  34291. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/insert
  34292. func (r *UrlMapsService) Insert(project string, urlmap *UrlMap) *UrlMapsInsertCall {
  34293. c := &UrlMapsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34294. c.project = project
  34295. c.urlmap = urlmap
  34296. return c
  34297. }
  34298. // Fields allows partial responses to be retrieved. See
  34299. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34300. // for more information.
  34301. func (c *UrlMapsInsertCall) Fields(s ...googleapi.Field) *UrlMapsInsertCall {
  34302. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34303. return c
  34304. }
  34305. // Context sets the context to be used in this call's Do method. Any
  34306. // pending HTTP request will be aborted if the provided context is
  34307. // canceled.
  34308. func (c *UrlMapsInsertCall) Context(ctx context.Context) *UrlMapsInsertCall {
  34309. c.ctx_ = ctx
  34310. return c
  34311. }
  34312. func (c *UrlMapsInsertCall) doRequest(alt string) (*http.Response, error) {
  34313. var body io.Reader = nil
  34314. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  34315. if err != nil {
  34316. return nil, err
  34317. }
  34318. ctype := "application/json"
  34319. c.urlParams_.Set("alt", alt)
  34320. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps")
  34321. urls += "?" + c.urlParams_.Encode()
  34322. req, _ := http.NewRequest("POST", urls, body)
  34323. googleapi.Expand(req.URL, map[string]string{
  34324. "project": c.project,
  34325. })
  34326. req.Header.Set("Content-Type", ctype)
  34327. req.Header.Set("User-Agent", c.s.userAgent())
  34328. if c.ctx_ != nil {
  34329. return ctxhttp.Do(c.ctx_, c.s.client, req)
  34330. }
  34331. return c.s.client.Do(req)
  34332. }
  34333. // Do executes the "compute.urlMaps.insert" call.
  34334. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  34335. // status code is an error. Response headers are in either
  34336. // *Operation.ServerResponse.Header or (if a response was returned at
  34337. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  34338. // to check whether the returned error was because
  34339. // http.StatusNotModified was returned.
  34340. func (c *UrlMapsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  34341. gensupport.SetOptions(c.urlParams_, opts...)
  34342. res, err := c.doRequest("json")
  34343. if res != nil && res.StatusCode == http.StatusNotModified {
  34344. if res.Body != nil {
  34345. res.Body.Close()
  34346. }
  34347. return nil, &googleapi.Error{
  34348. Code: res.StatusCode,
  34349. Header: res.Header,
  34350. }
  34351. }
  34352. if err != nil {
  34353. return nil, err
  34354. }
  34355. defer googleapi.CloseBody(res)
  34356. if err := googleapi.CheckResponse(res); err != nil {
  34357. return nil, err
  34358. }
  34359. ret := &Operation{
  34360. ServerResponse: googleapi.ServerResponse{
  34361. Header: res.Header,
  34362. HTTPStatusCode: res.StatusCode,
  34363. },
  34364. }
  34365. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  34366. return nil, err
  34367. }
  34368. return ret, nil
  34369. // {
  34370. // "description": "Creates a UrlMap resource in the specified project using the data included in the request.",
  34371. // "httpMethod": "POST",
  34372. // "id": "compute.urlMaps.insert",
  34373. // "parameterOrder": [
  34374. // "project"
  34375. // ],
  34376. // "parameters": {
  34377. // "project": {
  34378. // "description": "Project ID for this request.",
  34379. // "location": "path",
  34380. // "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])?))",
  34381. // "required": true,
  34382. // "type": "string"
  34383. // }
  34384. // },
  34385. // "path": "{project}/global/urlMaps",
  34386. // "request": {
  34387. // "$ref": "UrlMap"
  34388. // },
  34389. // "response": {
  34390. // "$ref": "Operation"
  34391. // },
  34392. // "scopes": [
  34393. // "https://www.googleapis.com/auth/cloud-platform",
  34394. // "https://www.googleapis.com/auth/compute"
  34395. // ]
  34396. // }
  34397. }
  34398. // method id "compute.urlMaps.list":
  34399. type UrlMapsListCall struct {
  34400. s *Service
  34401. project string
  34402. urlParams_ gensupport.URLParams
  34403. ifNoneMatch_ string
  34404. ctx_ context.Context
  34405. }
  34406. // List: Retrieves the list of UrlMap resources available to the
  34407. // specified project.
  34408. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/list
  34409. func (r *UrlMapsService) List(project string) *UrlMapsListCall {
  34410. c := &UrlMapsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34411. c.project = project
  34412. return c
  34413. }
  34414. // Filter sets the optional parameter "filter": Sets a filter expression
  34415. // for filtering listed resources, in the form filter={expression}. Your
  34416. // {expression} must be in the format: field_name comparison_string
  34417. // literal_string.
  34418. //
  34419. // The field_name is the name of the field you want to compare. Only
  34420. // atomic field types are supported (string, number, boolean). The
  34421. // comparison_string must be either eq (equals) or ne (not equals). The
  34422. // literal_string is the string value to filter to. The literal value
  34423. // must be valid for the type of field you are filtering by (string,
  34424. // number, boolean). For string fields, the literal value is interpreted
  34425. // as a regular expression using RE2 syntax. The literal value must
  34426. // match the entire field.
  34427. //
  34428. // For example, filter=name ne example-instance.
  34429. //
  34430. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  34431. // you can also filter on nested fields. For example, you could filter
  34432. // on instances that have set the scheduling.automaticRestart field to
  34433. // true. In particular, use filtering on nested fields to take advantage
  34434. // of instance labels to organize and filter results based on label
  34435. // values.
  34436. //
  34437. // The Beta API also supports filtering on multiple expressions by
  34438. // providing each separate expression within parentheses. For example,
  34439. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  34440. // Multiple expressions are treated as AND expressions meaning that
  34441. // resources must match all expressions to pass the filters.
  34442. func (c *UrlMapsListCall) Filter(filter string) *UrlMapsListCall {
  34443. c.urlParams_.Set("filter", filter)
  34444. return c
  34445. }
  34446. // MaxResults sets the optional parameter "maxResults": The maximum
  34447. // number of results per page that Compute Engine should return. If the
  34448. // number of available results is larger than maxResults, Compute Engine
  34449. // returns a nextPageToken that can be used to get the next page of
  34450. // results in subsequent list requests.
  34451. func (c *UrlMapsListCall) MaxResults(maxResults int64) *UrlMapsListCall {
  34452. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  34453. return c
  34454. }
  34455. // PageToken sets the optional parameter "pageToken": Specifies a page
  34456. // token to use. Set pageToken to the nextPageToken returned by a
  34457. // previous list request to get the next page of results.
  34458. func (c *UrlMapsListCall) PageToken(pageToken string) *UrlMapsListCall {
  34459. c.urlParams_.Set("pageToken", pageToken)
  34460. return c
  34461. }
  34462. // Fields allows partial responses to be retrieved. See
  34463. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34464. // for more information.
  34465. func (c *UrlMapsListCall) Fields(s ...googleapi.Field) *UrlMapsListCall {
  34466. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34467. return c
  34468. }
  34469. // IfNoneMatch sets the optional parameter which makes the operation
  34470. // fail if the object's ETag matches the given value. This is useful for
  34471. // getting updates only after the object has changed since the last
  34472. // request. Use googleapi.IsNotModified to check whether the response
  34473. // error from Do is the result of In-None-Match.
  34474. func (c *UrlMapsListCall) IfNoneMatch(entityTag string) *UrlMapsListCall {
  34475. c.ifNoneMatch_ = entityTag
  34476. return c
  34477. }
  34478. // Context sets the context to be used in this call's Do method. Any
  34479. // pending HTTP request will be aborted if the provided context is
  34480. // canceled.
  34481. func (c *UrlMapsListCall) Context(ctx context.Context) *UrlMapsListCall {
  34482. c.ctx_ = ctx
  34483. return c
  34484. }
  34485. func (c *UrlMapsListCall) doRequest(alt string) (*http.Response, error) {
  34486. var body io.Reader = nil
  34487. c.urlParams_.Set("alt", alt)
  34488. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps")
  34489. urls += "?" + c.urlParams_.Encode()
  34490. req, _ := http.NewRequest("GET", urls, body)
  34491. googleapi.Expand(req.URL, map[string]string{
  34492. "project": c.project,
  34493. })
  34494. req.Header.Set("User-Agent", c.s.userAgent())
  34495. if c.ifNoneMatch_ != "" {
  34496. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  34497. }
  34498. if c.ctx_ != nil {
  34499. return ctxhttp.Do(c.ctx_, c.s.client, req)
  34500. }
  34501. return c.s.client.Do(req)
  34502. }
  34503. // Do executes the "compute.urlMaps.list" call.
  34504. // Exactly one of *UrlMapList or error will be non-nil. Any non-2xx
  34505. // status code is an error. Response headers are in either
  34506. // *UrlMapList.ServerResponse.Header or (if a response was returned at
  34507. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  34508. // to check whether the returned error was because
  34509. // http.StatusNotModified was returned.
  34510. func (c *UrlMapsListCall) Do(opts ...googleapi.CallOption) (*UrlMapList, error) {
  34511. gensupport.SetOptions(c.urlParams_, opts...)
  34512. res, err := c.doRequest("json")
  34513. if res != nil && res.StatusCode == http.StatusNotModified {
  34514. if res.Body != nil {
  34515. res.Body.Close()
  34516. }
  34517. return nil, &googleapi.Error{
  34518. Code: res.StatusCode,
  34519. Header: res.Header,
  34520. }
  34521. }
  34522. if err != nil {
  34523. return nil, err
  34524. }
  34525. defer googleapi.CloseBody(res)
  34526. if err := googleapi.CheckResponse(res); err != nil {
  34527. return nil, err
  34528. }
  34529. ret := &UrlMapList{
  34530. ServerResponse: googleapi.ServerResponse{
  34531. Header: res.Header,
  34532. HTTPStatusCode: res.StatusCode,
  34533. },
  34534. }
  34535. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  34536. return nil, err
  34537. }
  34538. return ret, nil
  34539. // {
  34540. // "description": "Retrieves the list of UrlMap resources available to the specified project.",
  34541. // "httpMethod": "GET",
  34542. // "id": "compute.urlMaps.list",
  34543. // "parameterOrder": [
  34544. // "project"
  34545. // ],
  34546. // "parameters": {
  34547. // "filter": {
  34548. // "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.",
  34549. // "location": "query",
  34550. // "type": "string"
  34551. // },
  34552. // "maxResults": {
  34553. // "default": "500",
  34554. // "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.",
  34555. // "format": "uint32",
  34556. // "location": "query",
  34557. // "maximum": "500",
  34558. // "minimum": "0",
  34559. // "type": "integer"
  34560. // },
  34561. // "pageToken": {
  34562. // "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.",
  34563. // "location": "query",
  34564. // "type": "string"
  34565. // },
  34566. // "project": {
  34567. // "description": "Project ID for this request.",
  34568. // "location": "path",
  34569. // "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])?))",
  34570. // "required": true,
  34571. // "type": "string"
  34572. // }
  34573. // },
  34574. // "path": "{project}/global/urlMaps",
  34575. // "response": {
  34576. // "$ref": "UrlMapList"
  34577. // },
  34578. // "scopes": [
  34579. // "https://www.googleapis.com/auth/cloud-platform",
  34580. // "https://www.googleapis.com/auth/compute",
  34581. // "https://www.googleapis.com/auth/compute.readonly"
  34582. // ]
  34583. // }
  34584. }
  34585. // Pages invokes f for each page of results.
  34586. // A non-nil error returned from f will halt the iteration.
  34587. // The provided context supersedes any context provided to the Context method.
  34588. func (c *UrlMapsListCall) Pages(ctx context.Context, f func(*UrlMapList) error) error {
  34589. c.ctx_ = ctx
  34590. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  34591. for {
  34592. x, err := c.Do()
  34593. if err != nil {
  34594. return err
  34595. }
  34596. if err := f(x); err != nil {
  34597. return err
  34598. }
  34599. if x.NextPageToken == "" {
  34600. return nil
  34601. }
  34602. c.PageToken(x.NextPageToken)
  34603. }
  34604. }
  34605. // method id "compute.urlMaps.patch":
  34606. type UrlMapsPatchCall struct {
  34607. s *Service
  34608. project string
  34609. urlMap string
  34610. urlmap *UrlMap
  34611. urlParams_ gensupport.URLParams
  34612. ctx_ context.Context
  34613. }
  34614. // Patch: Updates the entire content of the UrlMap resource. This method
  34615. // supports patch semantics.
  34616. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/patch
  34617. func (r *UrlMapsService) Patch(project string, urlMap string, urlmap *UrlMap) *UrlMapsPatchCall {
  34618. c := &UrlMapsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34619. c.project = project
  34620. c.urlMap = urlMap
  34621. c.urlmap = urlmap
  34622. return c
  34623. }
  34624. // Fields allows partial responses to be retrieved. See
  34625. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34626. // for more information.
  34627. func (c *UrlMapsPatchCall) Fields(s ...googleapi.Field) *UrlMapsPatchCall {
  34628. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34629. return c
  34630. }
  34631. // Context sets the context to be used in this call's Do method. Any
  34632. // pending HTTP request will be aborted if the provided context is
  34633. // canceled.
  34634. func (c *UrlMapsPatchCall) Context(ctx context.Context) *UrlMapsPatchCall {
  34635. c.ctx_ = ctx
  34636. return c
  34637. }
  34638. func (c *UrlMapsPatchCall) doRequest(alt string) (*http.Response, error) {
  34639. var body io.Reader = nil
  34640. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  34641. if err != nil {
  34642. return nil, err
  34643. }
  34644. ctype := "application/json"
  34645. c.urlParams_.Set("alt", alt)
  34646. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  34647. urls += "?" + c.urlParams_.Encode()
  34648. req, _ := http.NewRequest("PATCH", urls, body)
  34649. googleapi.Expand(req.URL, map[string]string{
  34650. "project": c.project,
  34651. "urlMap": c.urlMap,
  34652. })
  34653. req.Header.Set("Content-Type", ctype)
  34654. req.Header.Set("User-Agent", c.s.userAgent())
  34655. if c.ctx_ != nil {
  34656. return ctxhttp.Do(c.ctx_, c.s.client, req)
  34657. }
  34658. return c.s.client.Do(req)
  34659. }
  34660. // Do executes the "compute.urlMaps.patch" call.
  34661. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  34662. // status code is an error. Response headers are in either
  34663. // *Operation.ServerResponse.Header or (if a response was returned at
  34664. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  34665. // to check whether the returned error was because
  34666. // http.StatusNotModified was returned.
  34667. func (c *UrlMapsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  34668. gensupport.SetOptions(c.urlParams_, opts...)
  34669. res, err := c.doRequest("json")
  34670. if res != nil && res.StatusCode == http.StatusNotModified {
  34671. if res.Body != nil {
  34672. res.Body.Close()
  34673. }
  34674. return nil, &googleapi.Error{
  34675. Code: res.StatusCode,
  34676. Header: res.Header,
  34677. }
  34678. }
  34679. if err != nil {
  34680. return nil, err
  34681. }
  34682. defer googleapi.CloseBody(res)
  34683. if err := googleapi.CheckResponse(res); err != nil {
  34684. return nil, err
  34685. }
  34686. ret := &Operation{
  34687. ServerResponse: googleapi.ServerResponse{
  34688. Header: res.Header,
  34689. HTTPStatusCode: res.StatusCode,
  34690. },
  34691. }
  34692. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  34693. return nil, err
  34694. }
  34695. return ret, nil
  34696. // {
  34697. // "description": "Updates the entire content of the UrlMap resource. This method supports patch semantics.",
  34698. // "httpMethod": "PATCH",
  34699. // "id": "compute.urlMaps.patch",
  34700. // "parameterOrder": [
  34701. // "project",
  34702. // "urlMap"
  34703. // ],
  34704. // "parameters": {
  34705. // "project": {
  34706. // "description": "Project ID for this request.",
  34707. // "location": "path",
  34708. // "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])?))",
  34709. // "required": true,
  34710. // "type": "string"
  34711. // },
  34712. // "urlMap": {
  34713. // "description": "Name of the UrlMap resource to update.",
  34714. // "location": "path",
  34715. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34716. // "required": true,
  34717. // "type": "string"
  34718. // }
  34719. // },
  34720. // "path": "{project}/global/urlMaps/{urlMap}",
  34721. // "request": {
  34722. // "$ref": "UrlMap"
  34723. // },
  34724. // "response": {
  34725. // "$ref": "Operation"
  34726. // },
  34727. // "scopes": [
  34728. // "https://www.googleapis.com/auth/cloud-platform",
  34729. // "https://www.googleapis.com/auth/compute"
  34730. // ]
  34731. // }
  34732. }
  34733. // method id "compute.urlMaps.update":
  34734. type UrlMapsUpdateCall struct {
  34735. s *Service
  34736. project string
  34737. urlMap string
  34738. urlmap *UrlMap
  34739. urlParams_ gensupport.URLParams
  34740. ctx_ context.Context
  34741. }
  34742. // Update: Updates the entire content of the UrlMap resource.
  34743. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/update
  34744. func (r *UrlMapsService) Update(project string, urlMap string, urlmap *UrlMap) *UrlMapsUpdateCall {
  34745. c := &UrlMapsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34746. c.project = project
  34747. c.urlMap = urlMap
  34748. c.urlmap = urlmap
  34749. return c
  34750. }
  34751. // Fields allows partial responses to be retrieved. See
  34752. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34753. // for more information.
  34754. func (c *UrlMapsUpdateCall) Fields(s ...googleapi.Field) *UrlMapsUpdateCall {
  34755. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34756. return c
  34757. }
  34758. // Context sets the context to be used in this call's Do method. Any
  34759. // pending HTTP request will be aborted if the provided context is
  34760. // canceled.
  34761. func (c *UrlMapsUpdateCall) Context(ctx context.Context) *UrlMapsUpdateCall {
  34762. c.ctx_ = ctx
  34763. return c
  34764. }
  34765. func (c *UrlMapsUpdateCall) doRequest(alt string) (*http.Response, error) {
  34766. var body io.Reader = nil
  34767. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  34768. if err != nil {
  34769. return nil, err
  34770. }
  34771. ctype := "application/json"
  34772. c.urlParams_.Set("alt", alt)
  34773. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  34774. urls += "?" + c.urlParams_.Encode()
  34775. req, _ := http.NewRequest("PUT", urls, body)
  34776. googleapi.Expand(req.URL, map[string]string{
  34777. "project": c.project,
  34778. "urlMap": c.urlMap,
  34779. })
  34780. req.Header.Set("Content-Type", ctype)
  34781. req.Header.Set("User-Agent", c.s.userAgent())
  34782. if c.ctx_ != nil {
  34783. return ctxhttp.Do(c.ctx_, c.s.client, req)
  34784. }
  34785. return c.s.client.Do(req)
  34786. }
  34787. // Do executes the "compute.urlMaps.update" call.
  34788. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  34789. // status code is an error. Response headers are in either
  34790. // *Operation.ServerResponse.Header or (if a response was returned at
  34791. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  34792. // to check whether the returned error was because
  34793. // http.StatusNotModified was returned.
  34794. func (c *UrlMapsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  34795. gensupport.SetOptions(c.urlParams_, opts...)
  34796. res, err := c.doRequest("json")
  34797. if res != nil && res.StatusCode == http.StatusNotModified {
  34798. if res.Body != nil {
  34799. res.Body.Close()
  34800. }
  34801. return nil, &googleapi.Error{
  34802. Code: res.StatusCode,
  34803. Header: res.Header,
  34804. }
  34805. }
  34806. if err != nil {
  34807. return nil, err
  34808. }
  34809. defer googleapi.CloseBody(res)
  34810. if err := googleapi.CheckResponse(res); err != nil {
  34811. return nil, err
  34812. }
  34813. ret := &Operation{
  34814. ServerResponse: googleapi.ServerResponse{
  34815. Header: res.Header,
  34816. HTTPStatusCode: res.StatusCode,
  34817. },
  34818. }
  34819. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  34820. return nil, err
  34821. }
  34822. return ret, nil
  34823. // {
  34824. // "description": "Updates the entire content of the UrlMap resource.",
  34825. // "httpMethod": "PUT",
  34826. // "id": "compute.urlMaps.update",
  34827. // "parameterOrder": [
  34828. // "project",
  34829. // "urlMap"
  34830. // ],
  34831. // "parameters": {
  34832. // "project": {
  34833. // "description": "Project ID for this request.",
  34834. // "location": "path",
  34835. // "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])?))",
  34836. // "required": true,
  34837. // "type": "string"
  34838. // },
  34839. // "urlMap": {
  34840. // "description": "Name of the UrlMap resource to update.",
  34841. // "location": "path",
  34842. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34843. // "required": true,
  34844. // "type": "string"
  34845. // }
  34846. // },
  34847. // "path": "{project}/global/urlMaps/{urlMap}",
  34848. // "request": {
  34849. // "$ref": "UrlMap"
  34850. // },
  34851. // "response": {
  34852. // "$ref": "Operation"
  34853. // },
  34854. // "scopes": [
  34855. // "https://www.googleapis.com/auth/cloud-platform",
  34856. // "https://www.googleapis.com/auth/compute"
  34857. // ]
  34858. // }
  34859. }
  34860. // method id "compute.urlMaps.validate":
  34861. type UrlMapsValidateCall struct {
  34862. s *Service
  34863. project string
  34864. urlMap string
  34865. urlmapsvalidaterequest *UrlMapsValidateRequest
  34866. urlParams_ gensupport.URLParams
  34867. ctx_ context.Context
  34868. }
  34869. // Validate: Runs static validation for the UrlMap. In particular, the
  34870. // tests of the provided UrlMap will be run. Calling this method does
  34871. // NOT create the UrlMap.
  34872. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/validate
  34873. func (r *UrlMapsService) Validate(project string, urlMap string, urlmapsvalidaterequest *UrlMapsValidateRequest) *UrlMapsValidateCall {
  34874. c := &UrlMapsValidateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34875. c.project = project
  34876. c.urlMap = urlMap
  34877. c.urlmapsvalidaterequest = urlmapsvalidaterequest
  34878. return c
  34879. }
  34880. // Fields allows partial responses to be retrieved. See
  34881. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34882. // for more information.
  34883. func (c *UrlMapsValidateCall) Fields(s ...googleapi.Field) *UrlMapsValidateCall {
  34884. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34885. return c
  34886. }
  34887. // Context sets the context to be used in this call's Do method. Any
  34888. // pending HTTP request will be aborted if the provided context is
  34889. // canceled.
  34890. func (c *UrlMapsValidateCall) Context(ctx context.Context) *UrlMapsValidateCall {
  34891. c.ctx_ = ctx
  34892. return c
  34893. }
  34894. func (c *UrlMapsValidateCall) doRequest(alt string) (*http.Response, error) {
  34895. var body io.Reader = nil
  34896. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapsvalidaterequest)
  34897. if err != nil {
  34898. return nil, err
  34899. }
  34900. ctype := "application/json"
  34901. c.urlParams_.Set("alt", alt)
  34902. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}/validate")
  34903. urls += "?" + c.urlParams_.Encode()
  34904. req, _ := http.NewRequest("POST", urls, body)
  34905. googleapi.Expand(req.URL, map[string]string{
  34906. "project": c.project,
  34907. "urlMap": c.urlMap,
  34908. })
  34909. req.Header.Set("Content-Type", ctype)
  34910. req.Header.Set("User-Agent", c.s.userAgent())
  34911. if c.ctx_ != nil {
  34912. return ctxhttp.Do(c.ctx_, c.s.client, req)
  34913. }
  34914. return c.s.client.Do(req)
  34915. }
  34916. // Do executes the "compute.urlMaps.validate" call.
  34917. // Exactly one of *UrlMapsValidateResponse or error will be non-nil. Any
  34918. // non-2xx status code is an error. Response headers are in either
  34919. // *UrlMapsValidateResponse.ServerResponse.Header or (if a response was
  34920. // returned at all) in error.(*googleapi.Error).Header. Use
  34921. // googleapi.IsNotModified to check whether the returned error was
  34922. // because http.StatusNotModified was returned.
  34923. func (c *UrlMapsValidateCall) Do(opts ...googleapi.CallOption) (*UrlMapsValidateResponse, error) {
  34924. gensupport.SetOptions(c.urlParams_, opts...)
  34925. res, err := c.doRequest("json")
  34926. if res != nil && res.StatusCode == http.StatusNotModified {
  34927. if res.Body != nil {
  34928. res.Body.Close()
  34929. }
  34930. return nil, &googleapi.Error{
  34931. Code: res.StatusCode,
  34932. Header: res.Header,
  34933. }
  34934. }
  34935. if err != nil {
  34936. return nil, err
  34937. }
  34938. defer googleapi.CloseBody(res)
  34939. if err := googleapi.CheckResponse(res); err != nil {
  34940. return nil, err
  34941. }
  34942. ret := &UrlMapsValidateResponse{
  34943. ServerResponse: googleapi.ServerResponse{
  34944. Header: res.Header,
  34945. HTTPStatusCode: res.StatusCode,
  34946. },
  34947. }
  34948. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  34949. return nil, err
  34950. }
  34951. return ret, nil
  34952. // {
  34953. // "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.",
  34954. // "httpMethod": "POST",
  34955. // "id": "compute.urlMaps.validate",
  34956. // "parameterOrder": [
  34957. // "project",
  34958. // "urlMap"
  34959. // ],
  34960. // "parameters": {
  34961. // "project": {
  34962. // "description": "Project ID for this request.",
  34963. // "location": "path",
  34964. // "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])?))",
  34965. // "required": true,
  34966. // "type": "string"
  34967. // },
  34968. // "urlMap": {
  34969. // "description": "Name of the UrlMap resource to be validated as.",
  34970. // "location": "path",
  34971. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34972. // "required": true,
  34973. // "type": "string"
  34974. // }
  34975. // },
  34976. // "path": "{project}/global/urlMaps/{urlMap}/validate",
  34977. // "request": {
  34978. // "$ref": "UrlMapsValidateRequest"
  34979. // },
  34980. // "response": {
  34981. // "$ref": "UrlMapsValidateResponse"
  34982. // },
  34983. // "scopes": [
  34984. // "https://www.googleapis.com/auth/cloud-platform",
  34985. // "https://www.googleapis.com/auth/compute"
  34986. // ]
  34987. // }
  34988. }
  34989. // method id "compute.vpnTunnels.aggregatedList":
  34990. type VpnTunnelsAggregatedListCall struct {
  34991. s *Service
  34992. project string
  34993. urlParams_ gensupport.URLParams
  34994. ifNoneMatch_ string
  34995. ctx_ context.Context
  34996. }
  34997. // AggregatedList: Retrieves an aggregated list of VPN tunnels.
  34998. func (r *VpnTunnelsService) AggregatedList(project string) *VpnTunnelsAggregatedListCall {
  34999. c := &VpnTunnelsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35000. c.project = project
  35001. return c
  35002. }
  35003. // Filter sets the optional parameter "filter": Sets a filter expression
  35004. // for filtering listed resources, in the form filter={expression}. Your
  35005. // {expression} must be in the format: field_name comparison_string
  35006. // literal_string.
  35007. //
  35008. // The field_name is the name of the field you want to compare. Only
  35009. // atomic field types are supported (string, number, boolean). The
  35010. // comparison_string must be either eq (equals) or ne (not equals). The
  35011. // literal_string is the string value to filter to. The literal value
  35012. // must be valid for the type of field you are filtering by (string,
  35013. // number, boolean). For string fields, the literal value is interpreted
  35014. // as a regular expression using RE2 syntax. The literal value must
  35015. // match the entire field.
  35016. //
  35017. // For example, filter=name ne example-instance.
  35018. //
  35019. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  35020. // you can also filter on nested fields. For example, you could filter
  35021. // on instances that have set the scheduling.automaticRestart field to
  35022. // true. In particular, use filtering on nested fields to take advantage
  35023. // of instance labels to organize and filter results based on label
  35024. // values.
  35025. //
  35026. // The Beta API also supports filtering on multiple expressions by
  35027. // providing each separate expression within parentheses. For example,
  35028. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  35029. // Multiple expressions are treated as AND expressions meaning that
  35030. // resources must match all expressions to pass the filters.
  35031. func (c *VpnTunnelsAggregatedListCall) Filter(filter string) *VpnTunnelsAggregatedListCall {
  35032. c.urlParams_.Set("filter", filter)
  35033. return c
  35034. }
  35035. // MaxResults sets the optional parameter "maxResults": The maximum
  35036. // number of results per page that Compute Engine should return. If the
  35037. // number of available results is larger than maxResults, Compute Engine
  35038. // returns a nextPageToken that can be used to get the next page of
  35039. // results in subsequent list requests.
  35040. func (c *VpnTunnelsAggregatedListCall) MaxResults(maxResults int64) *VpnTunnelsAggregatedListCall {
  35041. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  35042. return c
  35043. }
  35044. // PageToken sets the optional parameter "pageToken": Specifies a page
  35045. // token to use. Set pageToken to the nextPageToken returned by a
  35046. // previous list request to get the next page of results.
  35047. func (c *VpnTunnelsAggregatedListCall) PageToken(pageToken string) *VpnTunnelsAggregatedListCall {
  35048. c.urlParams_.Set("pageToken", pageToken)
  35049. return c
  35050. }
  35051. // Fields allows partial responses to be retrieved. See
  35052. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35053. // for more information.
  35054. func (c *VpnTunnelsAggregatedListCall) Fields(s ...googleapi.Field) *VpnTunnelsAggregatedListCall {
  35055. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35056. return c
  35057. }
  35058. // IfNoneMatch sets the optional parameter which makes the operation
  35059. // fail if the object's ETag matches the given value. This is useful for
  35060. // getting updates only after the object has changed since the last
  35061. // request. Use googleapi.IsNotModified to check whether the response
  35062. // error from Do is the result of In-None-Match.
  35063. func (c *VpnTunnelsAggregatedListCall) IfNoneMatch(entityTag string) *VpnTunnelsAggregatedListCall {
  35064. c.ifNoneMatch_ = entityTag
  35065. return c
  35066. }
  35067. // Context sets the context to be used in this call's Do method. Any
  35068. // pending HTTP request will be aborted if the provided context is
  35069. // canceled.
  35070. func (c *VpnTunnelsAggregatedListCall) Context(ctx context.Context) *VpnTunnelsAggregatedListCall {
  35071. c.ctx_ = ctx
  35072. return c
  35073. }
  35074. func (c *VpnTunnelsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  35075. var body io.Reader = nil
  35076. c.urlParams_.Set("alt", alt)
  35077. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/vpnTunnels")
  35078. urls += "?" + c.urlParams_.Encode()
  35079. req, _ := http.NewRequest("GET", urls, body)
  35080. googleapi.Expand(req.URL, map[string]string{
  35081. "project": c.project,
  35082. })
  35083. req.Header.Set("User-Agent", c.s.userAgent())
  35084. if c.ifNoneMatch_ != "" {
  35085. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  35086. }
  35087. if c.ctx_ != nil {
  35088. return ctxhttp.Do(c.ctx_, c.s.client, req)
  35089. }
  35090. return c.s.client.Do(req)
  35091. }
  35092. // Do executes the "compute.vpnTunnels.aggregatedList" call.
  35093. // Exactly one of *VpnTunnelAggregatedList or error will be non-nil. Any
  35094. // non-2xx status code is an error. Response headers are in either
  35095. // *VpnTunnelAggregatedList.ServerResponse.Header or (if a response was
  35096. // returned at all) in error.(*googleapi.Error).Header. Use
  35097. // googleapi.IsNotModified to check whether the returned error was
  35098. // because http.StatusNotModified was returned.
  35099. func (c *VpnTunnelsAggregatedListCall) Do(opts ...googleapi.CallOption) (*VpnTunnelAggregatedList, error) {
  35100. gensupport.SetOptions(c.urlParams_, opts...)
  35101. res, err := c.doRequest("json")
  35102. if res != nil && res.StatusCode == http.StatusNotModified {
  35103. if res.Body != nil {
  35104. res.Body.Close()
  35105. }
  35106. return nil, &googleapi.Error{
  35107. Code: res.StatusCode,
  35108. Header: res.Header,
  35109. }
  35110. }
  35111. if err != nil {
  35112. return nil, err
  35113. }
  35114. defer googleapi.CloseBody(res)
  35115. if err := googleapi.CheckResponse(res); err != nil {
  35116. return nil, err
  35117. }
  35118. ret := &VpnTunnelAggregatedList{
  35119. ServerResponse: googleapi.ServerResponse{
  35120. Header: res.Header,
  35121. HTTPStatusCode: res.StatusCode,
  35122. },
  35123. }
  35124. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  35125. return nil, err
  35126. }
  35127. return ret, nil
  35128. // {
  35129. // "description": "Retrieves an aggregated list of VPN tunnels.",
  35130. // "httpMethod": "GET",
  35131. // "id": "compute.vpnTunnels.aggregatedList",
  35132. // "parameterOrder": [
  35133. // "project"
  35134. // ],
  35135. // "parameters": {
  35136. // "filter": {
  35137. // "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.",
  35138. // "location": "query",
  35139. // "type": "string"
  35140. // },
  35141. // "maxResults": {
  35142. // "default": "500",
  35143. // "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.",
  35144. // "format": "uint32",
  35145. // "location": "query",
  35146. // "maximum": "500",
  35147. // "minimum": "0",
  35148. // "type": "integer"
  35149. // },
  35150. // "pageToken": {
  35151. // "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.",
  35152. // "location": "query",
  35153. // "type": "string"
  35154. // },
  35155. // "project": {
  35156. // "description": "Project ID for this request.",
  35157. // "location": "path",
  35158. // "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])?))",
  35159. // "required": true,
  35160. // "type": "string"
  35161. // }
  35162. // },
  35163. // "path": "{project}/aggregated/vpnTunnels",
  35164. // "response": {
  35165. // "$ref": "VpnTunnelAggregatedList"
  35166. // },
  35167. // "scopes": [
  35168. // "https://www.googleapis.com/auth/cloud-platform",
  35169. // "https://www.googleapis.com/auth/compute",
  35170. // "https://www.googleapis.com/auth/compute.readonly"
  35171. // ]
  35172. // }
  35173. }
  35174. // Pages invokes f for each page of results.
  35175. // A non-nil error returned from f will halt the iteration.
  35176. // The provided context supersedes any context provided to the Context method.
  35177. func (c *VpnTunnelsAggregatedListCall) Pages(ctx context.Context, f func(*VpnTunnelAggregatedList) error) error {
  35178. c.ctx_ = ctx
  35179. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  35180. for {
  35181. x, err := c.Do()
  35182. if err != nil {
  35183. return err
  35184. }
  35185. if err := f(x); err != nil {
  35186. return err
  35187. }
  35188. if x.NextPageToken == "" {
  35189. return nil
  35190. }
  35191. c.PageToken(x.NextPageToken)
  35192. }
  35193. }
  35194. // method id "compute.vpnTunnels.delete":
  35195. type VpnTunnelsDeleteCall struct {
  35196. s *Service
  35197. project string
  35198. region string
  35199. vpnTunnel string
  35200. urlParams_ gensupport.URLParams
  35201. ctx_ context.Context
  35202. }
  35203. // Delete: Deletes the specified VpnTunnel resource.
  35204. func (r *VpnTunnelsService) Delete(project string, region string, vpnTunnel string) *VpnTunnelsDeleteCall {
  35205. c := &VpnTunnelsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35206. c.project = project
  35207. c.region = region
  35208. c.vpnTunnel = vpnTunnel
  35209. return c
  35210. }
  35211. // Fields allows partial responses to be retrieved. See
  35212. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35213. // for more information.
  35214. func (c *VpnTunnelsDeleteCall) Fields(s ...googleapi.Field) *VpnTunnelsDeleteCall {
  35215. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35216. return c
  35217. }
  35218. // Context sets the context to be used in this call's Do method. Any
  35219. // pending HTTP request will be aborted if the provided context is
  35220. // canceled.
  35221. func (c *VpnTunnelsDeleteCall) Context(ctx context.Context) *VpnTunnelsDeleteCall {
  35222. c.ctx_ = ctx
  35223. return c
  35224. }
  35225. func (c *VpnTunnelsDeleteCall) doRequest(alt string) (*http.Response, error) {
  35226. var body io.Reader = nil
  35227. c.urlParams_.Set("alt", alt)
  35228. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels/{vpnTunnel}")
  35229. urls += "?" + c.urlParams_.Encode()
  35230. req, _ := http.NewRequest("DELETE", urls, body)
  35231. googleapi.Expand(req.URL, map[string]string{
  35232. "project": c.project,
  35233. "region": c.region,
  35234. "vpnTunnel": c.vpnTunnel,
  35235. })
  35236. req.Header.Set("User-Agent", c.s.userAgent())
  35237. if c.ctx_ != nil {
  35238. return ctxhttp.Do(c.ctx_, c.s.client, req)
  35239. }
  35240. return c.s.client.Do(req)
  35241. }
  35242. // Do executes the "compute.vpnTunnels.delete" call.
  35243. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  35244. // status code is an error. Response headers are in either
  35245. // *Operation.ServerResponse.Header or (if a response was returned at
  35246. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35247. // to check whether the returned error was because
  35248. // http.StatusNotModified was returned.
  35249. func (c *VpnTunnelsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  35250. gensupport.SetOptions(c.urlParams_, opts...)
  35251. res, err := c.doRequest("json")
  35252. if res != nil && res.StatusCode == http.StatusNotModified {
  35253. if res.Body != nil {
  35254. res.Body.Close()
  35255. }
  35256. return nil, &googleapi.Error{
  35257. Code: res.StatusCode,
  35258. Header: res.Header,
  35259. }
  35260. }
  35261. if err != nil {
  35262. return nil, err
  35263. }
  35264. defer googleapi.CloseBody(res)
  35265. if err := googleapi.CheckResponse(res); err != nil {
  35266. return nil, err
  35267. }
  35268. ret := &Operation{
  35269. ServerResponse: googleapi.ServerResponse{
  35270. Header: res.Header,
  35271. HTTPStatusCode: res.StatusCode,
  35272. },
  35273. }
  35274. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  35275. return nil, err
  35276. }
  35277. return ret, nil
  35278. // {
  35279. // "description": "Deletes the specified VpnTunnel resource.",
  35280. // "httpMethod": "DELETE",
  35281. // "id": "compute.vpnTunnels.delete",
  35282. // "parameterOrder": [
  35283. // "project",
  35284. // "region",
  35285. // "vpnTunnel"
  35286. // ],
  35287. // "parameters": {
  35288. // "project": {
  35289. // "description": "Project ID for this request.",
  35290. // "location": "path",
  35291. // "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])?))",
  35292. // "required": true,
  35293. // "type": "string"
  35294. // },
  35295. // "region": {
  35296. // "description": "The name of the region for this request.",
  35297. // "location": "path",
  35298. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  35299. // "required": true,
  35300. // "type": "string"
  35301. // },
  35302. // "vpnTunnel": {
  35303. // "description": "Name of the VpnTunnel resource to delete.",
  35304. // "location": "path",
  35305. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  35306. // "required": true,
  35307. // "type": "string"
  35308. // }
  35309. // },
  35310. // "path": "{project}/regions/{region}/vpnTunnels/{vpnTunnel}",
  35311. // "response": {
  35312. // "$ref": "Operation"
  35313. // },
  35314. // "scopes": [
  35315. // "https://www.googleapis.com/auth/cloud-platform",
  35316. // "https://www.googleapis.com/auth/compute"
  35317. // ]
  35318. // }
  35319. }
  35320. // method id "compute.vpnTunnels.get":
  35321. type VpnTunnelsGetCall struct {
  35322. s *Service
  35323. project string
  35324. region string
  35325. vpnTunnel string
  35326. urlParams_ gensupport.URLParams
  35327. ifNoneMatch_ string
  35328. ctx_ context.Context
  35329. }
  35330. // Get: Returns the specified VpnTunnel resource.
  35331. func (r *VpnTunnelsService) Get(project string, region string, vpnTunnel string) *VpnTunnelsGetCall {
  35332. c := &VpnTunnelsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35333. c.project = project
  35334. c.region = region
  35335. c.vpnTunnel = vpnTunnel
  35336. return c
  35337. }
  35338. // Fields allows partial responses to be retrieved. See
  35339. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35340. // for more information.
  35341. func (c *VpnTunnelsGetCall) Fields(s ...googleapi.Field) *VpnTunnelsGetCall {
  35342. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35343. return c
  35344. }
  35345. // IfNoneMatch sets the optional parameter which makes the operation
  35346. // fail if the object's ETag matches the given value. This is useful for
  35347. // getting updates only after the object has changed since the last
  35348. // request. Use googleapi.IsNotModified to check whether the response
  35349. // error from Do is the result of In-None-Match.
  35350. func (c *VpnTunnelsGetCall) IfNoneMatch(entityTag string) *VpnTunnelsGetCall {
  35351. c.ifNoneMatch_ = entityTag
  35352. return c
  35353. }
  35354. // Context sets the context to be used in this call's Do method. Any
  35355. // pending HTTP request will be aborted if the provided context is
  35356. // canceled.
  35357. func (c *VpnTunnelsGetCall) Context(ctx context.Context) *VpnTunnelsGetCall {
  35358. c.ctx_ = ctx
  35359. return c
  35360. }
  35361. func (c *VpnTunnelsGetCall) doRequest(alt string) (*http.Response, error) {
  35362. var body io.Reader = nil
  35363. c.urlParams_.Set("alt", alt)
  35364. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels/{vpnTunnel}")
  35365. urls += "?" + c.urlParams_.Encode()
  35366. req, _ := http.NewRequest("GET", urls, body)
  35367. googleapi.Expand(req.URL, map[string]string{
  35368. "project": c.project,
  35369. "region": c.region,
  35370. "vpnTunnel": c.vpnTunnel,
  35371. })
  35372. req.Header.Set("User-Agent", c.s.userAgent())
  35373. if c.ifNoneMatch_ != "" {
  35374. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  35375. }
  35376. if c.ctx_ != nil {
  35377. return ctxhttp.Do(c.ctx_, c.s.client, req)
  35378. }
  35379. return c.s.client.Do(req)
  35380. }
  35381. // Do executes the "compute.vpnTunnels.get" call.
  35382. // Exactly one of *VpnTunnel or error will be non-nil. Any non-2xx
  35383. // status code is an error. Response headers are in either
  35384. // *VpnTunnel.ServerResponse.Header or (if a response was returned at
  35385. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35386. // to check whether the returned error was because
  35387. // http.StatusNotModified was returned.
  35388. func (c *VpnTunnelsGetCall) Do(opts ...googleapi.CallOption) (*VpnTunnel, error) {
  35389. gensupport.SetOptions(c.urlParams_, opts...)
  35390. res, err := c.doRequest("json")
  35391. if res != nil && res.StatusCode == http.StatusNotModified {
  35392. if res.Body != nil {
  35393. res.Body.Close()
  35394. }
  35395. return nil, &googleapi.Error{
  35396. Code: res.StatusCode,
  35397. Header: res.Header,
  35398. }
  35399. }
  35400. if err != nil {
  35401. return nil, err
  35402. }
  35403. defer googleapi.CloseBody(res)
  35404. if err := googleapi.CheckResponse(res); err != nil {
  35405. return nil, err
  35406. }
  35407. ret := &VpnTunnel{
  35408. ServerResponse: googleapi.ServerResponse{
  35409. Header: res.Header,
  35410. HTTPStatusCode: res.StatusCode,
  35411. },
  35412. }
  35413. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  35414. return nil, err
  35415. }
  35416. return ret, nil
  35417. // {
  35418. // "description": "Returns the specified VpnTunnel resource.",
  35419. // "httpMethod": "GET",
  35420. // "id": "compute.vpnTunnels.get",
  35421. // "parameterOrder": [
  35422. // "project",
  35423. // "region",
  35424. // "vpnTunnel"
  35425. // ],
  35426. // "parameters": {
  35427. // "project": {
  35428. // "description": "Project ID for this request.",
  35429. // "location": "path",
  35430. // "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])?))",
  35431. // "required": true,
  35432. // "type": "string"
  35433. // },
  35434. // "region": {
  35435. // "description": "The name of the region for this request.",
  35436. // "location": "path",
  35437. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  35438. // "required": true,
  35439. // "type": "string"
  35440. // },
  35441. // "vpnTunnel": {
  35442. // "description": "Name of the VpnTunnel resource to return.",
  35443. // "location": "path",
  35444. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  35445. // "required": true,
  35446. // "type": "string"
  35447. // }
  35448. // },
  35449. // "path": "{project}/regions/{region}/vpnTunnels/{vpnTunnel}",
  35450. // "response": {
  35451. // "$ref": "VpnTunnel"
  35452. // },
  35453. // "scopes": [
  35454. // "https://www.googleapis.com/auth/cloud-platform",
  35455. // "https://www.googleapis.com/auth/compute",
  35456. // "https://www.googleapis.com/auth/compute.readonly"
  35457. // ]
  35458. // }
  35459. }
  35460. // method id "compute.vpnTunnels.insert":
  35461. type VpnTunnelsInsertCall struct {
  35462. s *Service
  35463. project string
  35464. region string
  35465. vpntunnel *VpnTunnel
  35466. urlParams_ gensupport.URLParams
  35467. ctx_ context.Context
  35468. }
  35469. // Insert: Creates a VpnTunnel resource in the specified project and
  35470. // region using the data included in the request.
  35471. func (r *VpnTunnelsService) Insert(project string, region string, vpntunnel *VpnTunnel) *VpnTunnelsInsertCall {
  35472. c := &VpnTunnelsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35473. c.project = project
  35474. c.region = region
  35475. c.vpntunnel = vpntunnel
  35476. return c
  35477. }
  35478. // Fields allows partial responses to be retrieved. See
  35479. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35480. // for more information.
  35481. func (c *VpnTunnelsInsertCall) Fields(s ...googleapi.Field) *VpnTunnelsInsertCall {
  35482. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35483. return c
  35484. }
  35485. // Context sets the context to be used in this call's Do method. Any
  35486. // pending HTTP request will be aborted if the provided context is
  35487. // canceled.
  35488. func (c *VpnTunnelsInsertCall) Context(ctx context.Context) *VpnTunnelsInsertCall {
  35489. c.ctx_ = ctx
  35490. return c
  35491. }
  35492. func (c *VpnTunnelsInsertCall) doRequest(alt string) (*http.Response, error) {
  35493. var body io.Reader = nil
  35494. body, err := googleapi.WithoutDataWrapper.JSONReader(c.vpntunnel)
  35495. if err != nil {
  35496. return nil, err
  35497. }
  35498. ctype := "application/json"
  35499. c.urlParams_.Set("alt", alt)
  35500. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels")
  35501. urls += "?" + c.urlParams_.Encode()
  35502. req, _ := http.NewRequest("POST", urls, body)
  35503. googleapi.Expand(req.URL, map[string]string{
  35504. "project": c.project,
  35505. "region": c.region,
  35506. })
  35507. req.Header.Set("Content-Type", ctype)
  35508. req.Header.Set("User-Agent", c.s.userAgent())
  35509. if c.ctx_ != nil {
  35510. return ctxhttp.Do(c.ctx_, c.s.client, req)
  35511. }
  35512. return c.s.client.Do(req)
  35513. }
  35514. // Do executes the "compute.vpnTunnels.insert" call.
  35515. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  35516. // status code is an error. Response headers are in either
  35517. // *Operation.ServerResponse.Header or (if a response was returned at
  35518. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35519. // to check whether the returned error was because
  35520. // http.StatusNotModified was returned.
  35521. func (c *VpnTunnelsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  35522. gensupport.SetOptions(c.urlParams_, opts...)
  35523. res, err := c.doRequest("json")
  35524. if res != nil && res.StatusCode == http.StatusNotModified {
  35525. if res.Body != nil {
  35526. res.Body.Close()
  35527. }
  35528. return nil, &googleapi.Error{
  35529. Code: res.StatusCode,
  35530. Header: res.Header,
  35531. }
  35532. }
  35533. if err != nil {
  35534. return nil, err
  35535. }
  35536. defer googleapi.CloseBody(res)
  35537. if err := googleapi.CheckResponse(res); err != nil {
  35538. return nil, err
  35539. }
  35540. ret := &Operation{
  35541. ServerResponse: googleapi.ServerResponse{
  35542. Header: res.Header,
  35543. HTTPStatusCode: res.StatusCode,
  35544. },
  35545. }
  35546. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  35547. return nil, err
  35548. }
  35549. return ret, nil
  35550. // {
  35551. // "description": "Creates a VpnTunnel resource in the specified project and region using the data included in the request.",
  35552. // "httpMethod": "POST",
  35553. // "id": "compute.vpnTunnels.insert",
  35554. // "parameterOrder": [
  35555. // "project",
  35556. // "region"
  35557. // ],
  35558. // "parameters": {
  35559. // "project": {
  35560. // "description": "Project ID for this request.",
  35561. // "location": "path",
  35562. // "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])?))",
  35563. // "required": true,
  35564. // "type": "string"
  35565. // },
  35566. // "region": {
  35567. // "description": "The name of the region for this request.",
  35568. // "location": "path",
  35569. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  35570. // "required": true,
  35571. // "type": "string"
  35572. // }
  35573. // },
  35574. // "path": "{project}/regions/{region}/vpnTunnels",
  35575. // "request": {
  35576. // "$ref": "VpnTunnel"
  35577. // },
  35578. // "response": {
  35579. // "$ref": "Operation"
  35580. // },
  35581. // "scopes": [
  35582. // "https://www.googleapis.com/auth/cloud-platform",
  35583. // "https://www.googleapis.com/auth/compute"
  35584. // ]
  35585. // }
  35586. }
  35587. // method id "compute.vpnTunnels.list":
  35588. type VpnTunnelsListCall struct {
  35589. s *Service
  35590. project string
  35591. region string
  35592. urlParams_ gensupport.URLParams
  35593. ifNoneMatch_ string
  35594. ctx_ context.Context
  35595. }
  35596. // List: Retrieves a list of VpnTunnel resources contained in the
  35597. // specified project and region.
  35598. func (r *VpnTunnelsService) List(project string, region string) *VpnTunnelsListCall {
  35599. c := &VpnTunnelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35600. c.project = project
  35601. c.region = region
  35602. return c
  35603. }
  35604. // Filter sets the optional parameter "filter": Sets a filter expression
  35605. // for filtering listed resources, in the form filter={expression}. Your
  35606. // {expression} must be in the format: field_name comparison_string
  35607. // literal_string.
  35608. //
  35609. // The field_name is the name of the field you want to compare. Only
  35610. // atomic field types are supported (string, number, boolean). The
  35611. // comparison_string must be either eq (equals) or ne (not equals). The
  35612. // literal_string is the string value to filter to. The literal value
  35613. // must be valid for the type of field you are filtering by (string,
  35614. // number, boolean). For string fields, the literal value is interpreted
  35615. // as a regular expression using RE2 syntax. The literal value must
  35616. // match the entire field.
  35617. //
  35618. // For example, filter=name ne example-instance.
  35619. //
  35620. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  35621. // you can also filter on nested fields. For example, you could filter
  35622. // on instances that have set the scheduling.automaticRestart field to
  35623. // true. In particular, use filtering on nested fields to take advantage
  35624. // of instance labels to organize and filter results based on label
  35625. // values.
  35626. //
  35627. // The Beta API also supports filtering on multiple expressions by
  35628. // providing each separate expression within parentheses. For example,
  35629. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  35630. // Multiple expressions are treated as AND expressions meaning that
  35631. // resources must match all expressions to pass the filters.
  35632. func (c *VpnTunnelsListCall) Filter(filter string) *VpnTunnelsListCall {
  35633. c.urlParams_.Set("filter", filter)
  35634. return c
  35635. }
  35636. // MaxResults sets the optional parameter "maxResults": The maximum
  35637. // number of results per page that Compute Engine should return. If the
  35638. // number of available results is larger than maxResults, Compute Engine
  35639. // returns a nextPageToken that can be used to get the next page of
  35640. // results in subsequent list requests.
  35641. func (c *VpnTunnelsListCall) MaxResults(maxResults int64) *VpnTunnelsListCall {
  35642. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  35643. return c
  35644. }
  35645. // PageToken sets the optional parameter "pageToken": Specifies a page
  35646. // token to use. Set pageToken to the nextPageToken returned by a
  35647. // previous list request to get the next page of results.
  35648. func (c *VpnTunnelsListCall) PageToken(pageToken string) *VpnTunnelsListCall {
  35649. c.urlParams_.Set("pageToken", pageToken)
  35650. return c
  35651. }
  35652. // Fields allows partial responses to be retrieved. See
  35653. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35654. // for more information.
  35655. func (c *VpnTunnelsListCall) Fields(s ...googleapi.Field) *VpnTunnelsListCall {
  35656. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35657. return c
  35658. }
  35659. // IfNoneMatch sets the optional parameter which makes the operation
  35660. // fail if the object's ETag matches the given value. This is useful for
  35661. // getting updates only after the object has changed since the last
  35662. // request. Use googleapi.IsNotModified to check whether the response
  35663. // error from Do is the result of In-None-Match.
  35664. func (c *VpnTunnelsListCall) IfNoneMatch(entityTag string) *VpnTunnelsListCall {
  35665. c.ifNoneMatch_ = entityTag
  35666. return c
  35667. }
  35668. // Context sets the context to be used in this call's Do method. Any
  35669. // pending HTTP request will be aborted if the provided context is
  35670. // canceled.
  35671. func (c *VpnTunnelsListCall) Context(ctx context.Context) *VpnTunnelsListCall {
  35672. c.ctx_ = ctx
  35673. return c
  35674. }
  35675. func (c *VpnTunnelsListCall) doRequest(alt string) (*http.Response, error) {
  35676. var body io.Reader = nil
  35677. c.urlParams_.Set("alt", alt)
  35678. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels")
  35679. urls += "?" + c.urlParams_.Encode()
  35680. req, _ := http.NewRequest("GET", urls, body)
  35681. googleapi.Expand(req.URL, map[string]string{
  35682. "project": c.project,
  35683. "region": c.region,
  35684. })
  35685. req.Header.Set("User-Agent", c.s.userAgent())
  35686. if c.ifNoneMatch_ != "" {
  35687. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  35688. }
  35689. if c.ctx_ != nil {
  35690. return ctxhttp.Do(c.ctx_, c.s.client, req)
  35691. }
  35692. return c.s.client.Do(req)
  35693. }
  35694. // Do executes the "compute.vpnTunnels.list" call.
  35695. // Exactly one of *VpnTunnelList or error will be non-nil. Any non-2xx
  35696. // status code is an error. Response headers are in either
  35697. // *VpnTunnelList.ServerResponse.Header or (if a response was returned
  35698. // at all) in error.(*googleapi.Error).Header. Use
  35699. // googleapi.IsNotModified to check whether the returned error was
  35700. // because http.StatusNotModified was returned.
  35701. func (c *VpnTunnelsListCall) Do(opts ...googleapi.CallOption) (*VpnTunnelList, error) {
  35702. gensupport.SetOptions(c.urlParams_, opts...)
  35703. res, err := c.doRequest("json")
  35704. if res != nil && res.StatusCode == http.StatusNotModified {
  35705. if res.Body != nil {
  35706. res.Body.Close()
  35707. }
  35708. return nil, &googleapi.Error{
  35709. Code: res.StatusCode,
  35710. Header: res.Header,
  35711. }
  35712. }
  35713. if err != nil {
  35714. return nil, err
  35715. }
  35716. defer googleapi.CloseBody(res)
  35717. if err := googleapi.CheckResponse(res); err != nil {
  35718. return nil, err
  35719. }
  35720. ret := &VpnTunnelList{
  35721. ServerResponse: googleapi.ServerResponse{
  35722. Header: res.Header,
  35723. HTTPStatusCode: res.StatusCode,
  35724. },
  35725. }
  35726. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  35727. return nil, err
  35728. }
  35729. return ret, nil
  35730. // {
  35731. // "description": "Retrieves a list of VpnTunnel resources contained in the specified project and region.",
  35732. // "httpMethod": "GET",
  35733. // "id": "compute.vpnTunnels.list",
  35734. // "parameterOrder": [
  35735. // "project",
  35736. // "region"
  35737. // ],
  35738. // "parameters": {
  35739. // "filter": {
  35740. // "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.",
  35741. // "location": "query",
  35742. // "type": "string"
  35743. // },
  35744. // "maxResults": {
  35745. // "default": "500",
  35746. // "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.",
  35747. // "format": "uint32",
  35748. // "location": "query",
  35749. // "maximum": "500",
  35750. // "minimum": "0",
  35751. // "type": "integer"
  35752. // },
  35753. // "pageToken": {
  35754. // "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.",
  35755. // "location": "query",
  35756. // "type": "string"
  35757. // },
  35758. // "project": {
  35759. // "description": "Project ID for this request.",
  35760. // "location": "path",
  35761. // "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])?))",
  35762. // "required": true,
  35763. // "type": "string"
  35764. // },
  35765. // "region": {
  35766. // "description": "The name of the region for this request.",
  35767. // "location": "path",
  35768. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  35769. // "required": true,
  35770. // "type": "string"
  35771. // }
  35772. // },
  35773. // "path": "{project}/regions/{region}/vpnTunnels",
  35774. // "response": {
  35775. // "$ref": "VpnTunnelList"
  35776. // },
  35777. // "scopes": [
  35778. // "https://www.googleapis.com/auth/cloud-platform",
  35779. // "https://www.googleapis.com/auth/compute",
  35780. // "https://www.googleapis.com/auth/compute.readonly"
  35781. // ]
  35782. // }
  35783. }
  35784. // Pages invokes f for each page of results.
  35785. // A non-nil error returned from f will halt the iteration.
  35786. // The provided context supersedes any context provided to the Context method.
  35787. func (c *VpnTunnelsListCall) Pages(ctx context.Context, f func(*VpnTunnelList) error) error {
  35788. c.ctx_ = ctx
  35789. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  35790. for {
  35791. x, err := c.Do()
  35792. if err != nil {
  35793. return err
  35794. }
  35795. if err := f(x); err != nil {
  35796. return err
  35797. }
  35798. if x.NextPageToken == "" {
  35799. return nil
  35800. }
  35801. c.PageToken(x.NextPageToken)
  35802. }
  35803. }
  35804. // method id "compute.zoneOperations.delete":
  35805. type ZoneOperationsDeleteCall struct {
  35806. s *Service
  35807. project string
  35808. zone string
  35809. operation string
  35810. urlParams_ gensupport.URLParams
  35811. ctx_ context.Context
  35812. }
  35813. // Delete: Deletes the specified zone-specific Operations resource.
  35814. // For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/delete
  35815. func (r *ZoneOperationsService) Delete(project string, zone string, operation string) *ZoneOperationsDeleteCall {
  35816. c := &ZoneOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35817. c.project = project
  35818. c.zone = zone
  35819. c.operation = operation
  35820. return c
  35821. }
  35822. // Fields allows partial responses to be retrieved. See
  35823. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35824. // for more information.
  35825. func (c *ZoneOperationsDeleteCall) Fields(s ...googleapi.Field) *ZoneOperationsDeleteCall {
  35826. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35827. return c
  35828. }
  35829. // Context sets the context to be used in this call's Do method. Any
  35830. // pending HTTP request will be aborted if the provided context is
  35831. // canceled.
  35832. func (c *ZoneOperationsDeleteCall) Context(ctx context.Context) *ZoneOperationsDeleteCall {
  35833. c.ctx_ = ctx
  35834. return c
  35835. }
  35836. func (c *ZoneOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  35837. var body io.Reader = nil
  35838. c.urlParams_.Set("alt", alt)
  35839. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations/{operation}")
  35840. urls += "?" + c.urlParams_.Encode()
  35841. req, _ := http.NewRequest("DELETE", urls, body)
  35842. googleapi.Expand(req.URL, map[string]string{
  35843. "project": c.project,
  35844. "zone": c.zone,
  35845. "operation": c.operation,
  35846. })
  35847. req.Header.Set("User-Agent", c.s.userAgent())
  35848. if c.ctx_ != nil {
  35849. return ctxhttp.Do(c.ctx_, c.s.client, req)
  35850. }
  35851. return c.s.client.Do(req)
  35852. }
  35853. // Do executes the "compute.zoneOperations.delete" call.
  35854. func (c *ZoneOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  35855. gensupport.SetOptions(c.urlParams_, opts...)
  35856. res, err := c.doRequest("json")
  35857. if err != nil {
  35858. return err
  35859. }
  35860. defer googleapi.CloseBody(res)
  35861. if err := googleapi.CheckResponse(res); err != nil {
  35862. return err
  35863. }
  35864. return nil
  35865. // {
  35866. // "description": "Deletes the specified zone-specific Operations resource.",
  35867. // "httpMethod": "DELETE",
  35868. // "id": "compute.zoneOperations.delete",
  35869. // "parameterOrder": [
  35870. // "project",
  35871. // "zone",
  35872. // "operation"
  35873. // ],
  35874. // "parameters": {
  35875. // "operation": {
  35876. // "description": "Name of the Operations resource to delete.",
  35877. // "location": "path",
  35878. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  35879. // "required": true,
  35880. // "type": "string"
  35881. // },
  35882. // "project": {
  35883. // "description": "Project ID for this request.",
  35884. // "location": "path",
  35885. // "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])?))",
  35886. // "required": true,
  35887. // "type": "string"
  35888. // },
  35889. // "zone": {
  35890. // "description": "Name of the zone scoping this request.",
  35891. // "location": "path",
  35892. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  35893. // "required": true,
  35894. // "type": "string"
  35895. // }
  35896. // },
  35897. // "path": "{project}/zones/{zone}/operations/{operation}",
  35898. // "scopes": [
  35899. // "https://www.googleapis.com/auth/cloud-platform",
  35900. // "https://www.googleapis.com/auth/compute"
  35901. // ]
  35902. // }
  35903. }
  35904. // method id "compute.zoneOperations.get":
  35905. type ZoneOperationsGetCall struct {
  35906. s *Service
  35907. project string
  35908. zone string
  35909. operation string
  35910. urlParams_ gensupport.URLParams
  35911. ifNoneMatch_ string
  35912. ctx_ context.Context
  35913. }
  35914. // Get: Retrieves the specified zone-specific Operations resource.
  35915. // For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/get
  35916. func (r *ZoneOperationsService) Get(project string, zone string, operation string) *ZoneOperationsGetCall {
  35917. c := &ZoneOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35918. c.project = project
  35919. c.zone = zone
  35920. c.operation = operation
  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 *ZoneOperationsGetCall) Fields(s ...googleapi.Field) *ZoneOperationsGetCall {
  35927. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35928. return c
  35929. }
  35930. // IfNoneMatch sets the optional parameter which makes the operation
  35931. // fail if the object's ETag matches the given value. This is useful for
  35932. // getting updates only after the object has changed since the last
  35933. // request. Use googleapi.IsNotModified to check whether the response
  35934. // error from Do is the result of In-None-Match.
  35935. func (c *ZoneOperationsGetCall) IfNoneMatch(entityTag string) *ZoneOperationsGetCall {
  35936. c.ifNoneMatch_ = entityTag
  35937. return c
  35938. }
  35939. // Context sets the context to be used in this call's Do method. Any
  35940. // pending HTTP request will be aborted if the provided context is
  35941. // canceled.
  35942. func (c *ZoneOperationsGetCall) Context(ctx context.Context) *ZoneOperationsGetCall {
  35943. c.ctx_ = ctx
  35944. return c
  35945. }
  35946. func (c *ZoneOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  35947. var body io.Reader = nil
  35948. c.urlParams_.Set("alt", alt)
  35949. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations/{operation}")
  35950. urls += "?" + c.urlParams_.Encode()
  35951. req, _ := http.NewRequest("GET", urls, body)
  35952. googleapi.Expand(req.URL, map[string]string{
  35953. "project": c.project,
  35954. "zone": c.zone,
  35955. "operation": c.operation,
  35956. })
  35957. req.Header.Set("User-Agent", c.s.userAgent())
  35958. if c.ifNoneMatch_ != "" {
  35959. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  35960. }
  35961. if c.ctx_ != nil {
  35962. return ctxhttp.Do(c.ctx_, c.s.client, req)
  35963. }
  35964. return c.s.client.Do(req)
  35965. }
  35966. // Do executes the "compute.zoneOperations.get" call.
  35967. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  35968. // status code is an error. Response headers are in either
  35969. // *Operation.ServerResponse.Header or (if a response was returned at
  35970. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35971. // to check whether the returned error was because
  35972. // http.StatusNotModified was returned.
  35973. func (c *ZoneOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  35974. gensupport.SetOptions(c.urlParams_, opts...)
  35975. res, err := c.doRequest("json")
  35976. if res != nil && res.StatusCode == http.StatusNotModified {
  35977. if res.Body != nil {
  35978. res.Body.Close()
  35979. }
  35980. return nil, &googleapi.Error{
  35981. Code: res.StatusCode,
  35982. Header: res.Header,
  35983. }
  35984. }
  35985. if err != nil {
  35986. return nil, err
  35987. }
  35988. defer googleapi.CloseBody(res)
  35989. if err := googleapi.CheckResponse(res); err != nil {
  35990. return nil, err
  35991. }
  35992. ret := &Operation{
  35993. ServerResponse: googleapi.ServerResponse{
  35994. Header: res.Header,
  35995. HTTPStatusCode: res.StatusCode,
  35996. },
  35997. }
  35998. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  35999. return nil, err
  36000. }
  36001. return ret, nil
  36002. // {
  36003. // "description": "Retrieves the specified zone-specific Operations resource.",
  36004. // "httpMethod": "GET",
  36005. // "id": "compute.zoneOperations.get",
  36006. // "parameterOrder": [
  36007. // "project",
  36008. // "zone",
  36009. // "operation"
  36010. // ],
  36011. // "parameters": {
  36012. // "operation": {
  36013. // "description": "Name of the Operations resource to return.",
  36014. // "location": "path",
  36015. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  36016. // "required": true,
  36017. // "type": "string"
  36018. // },
  36019. // "project": {
  36020. // "description": "Project ID for this request.",
  36021. // "location": "path",
  36022. // "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])?))",
  36023. // "required": true,
  36024. // "type": "string"
  36025. // },
  36026. // "zone": {
  36027. // "description": "Name of the zone scoping this request.",
  36028. // "location": "path",
  36029. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  36030. // "required": true,
  36031. // "type": "string"
  36032. // }
  36033. // },
  36034. // "path": "{project}/zones/{zone}/operations/{operation}",
  36035. // "response": {
  36036. // "$ref": "Operation"
  36037. // },
  36038. // "scopes": [
  36039. // "https://www.googleapis.com/auth/cloud-platform",
  36040. // "https://www.googleapis.com/auth/compute",
  36041. // "https://www.googleapis.com/auth/compute.readonly"
  36042. // ]
  36043. // }
  36044. }
  36045. // method id "compute.zoneOperations.list":
  36046. type ZoneOperationsListCall struct {
  36047. s *Service
  36048. project string
  36049. zone string
  36050. urlParams_ gensupport.URLParams
  36051. ifNoneMatch_ string
  36052. ctx_ context.Context
  36053. }
  36054. // List: Retrieves a list of Operation resources contained within the
  36055. // specified zone.
  36056. // For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/list
  36057. func (r *ZoneOperationsService) List(project string, zone string) *ZoneOperationsListCall {
  36058. c := &ZoneOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36059. c.project = project
  36060. c.zone = zone
  36061. return c
  36062. }
  36063. // Filter sets the optional parameter "filter": Sets a filter expression
  36064. // for filtering listed resources, in the form filter={expression}. Your
  36065. // {expression} must be in the format: field_name comparison_string
  36066. // literal_string.
  36067. //
  36068. // The field_name is the name of the field you want to compare. Only
  36069. // atomic field types are supported (string, number, boolean). The
  36070. // comparison_string must be either eq (equals) or ne (not equals). The
  36071. // literal_string is the string value to filter to. The literal value
  36072. // must be valid for the type of field you are filtering by (string,
  36073. // number, boolean). For string fields, the literal value is interpreted
  36074. // as a regular expression using RE2 syntax. The literal value must
  36075. // match the entire field.
  36076. //
  36077. // For example, filter=name ne example-instance.
  36078. //
  36079. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  36080. // you can also filter on nested fields. For example, you could filter
  36081. // on instances that have set the scheduling.automaticRestart field to
  36082. // true. In particular, use filtering on nested fields to take advantage
  36083. // of instance labels to organize and filter results based on label
  36084. // values.
  36085. //
  36086. // The Beta API also supports filtering on multiple expressions by
  36087. // providing each separate expression within parentheses. For example,
  36088. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  36089. // Multiple expressions are treated as AND expressions meaning that
  36090. // resources must match all expressions to pass the filters.
  36091. func (c *ZoneOperationsListCall) Filter(filter string) *ZoneOperationsListCall {
  36092. c.urlParams_.Set("filter", filter)
  36093. return c
  36094. }
  36095. // MaxResults sets the optional parameter "maxResults": The maximum
  36096. // number of results per page that Compute Engine should return. If the
  36097. // number of available results is larger than maxResults, Compute Engine
  36098. // returns a nextPageToken that can be used to get the next page of
  36099. // results in subsequent list requests.
  36100. func (c *ZoneOperationsListCall) MaxResults(maxResults int64) *ZoneOperationsListCall {
  36101. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  36102. return c
  36103. }
  36104. // PageToken sets the optional parameter "pageToken": Specifies a page
  36105. // token to use. Set pageToken to the nextPageToken returned by a
  36106. // previous list request to get the next page of results.
  36107. func (c *ZoneOperationsListCall) PageToken(pageToken string) *ZoneOperationsListCall {
  36108. c.urlParams_.Set("pageToken", pageToken)
  36109. return c
  36110. }
  36111. // Fields allows partial responses to be retrieved. See
  36112. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36113. // for more information.
  36114. func (c *ZoneOperationsListCall) Fields(s ...googleapi.Field) *ZoneOperationsListCall {
  36115. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36116. return c
  36117. }
  36118. // IfNoneMatch sets the optional parameter which makes the operation
  36119. // fail if the object's ETag matches the given value. This is useful for
  36120. // getting updates only after the object has changed since the last
  36121. // request. Use googleapi.IsNotModified to check whether the response
  36122. // error from Do is the result of In-None-Match.
  36123. func (c *ZoneOperationsListCall) IfNoneMatch(entityTag string) *ZoneOperationsListCall {
  36124. c.ifNoneMatch_ = entityTag
  36125. return c
  36126. }
  36127. // Context sets the context to be used in this call's Do method. Any
  36128. // pending HTTP request will be aborted if the provided context is
  36129. // canceled.
  36130. func (c *ZoneOperationsListCall) Context(ctx context.Context) *ZoneOperationsListCall {
  36131. c.ctx_ = ctx
  36132. return c
  36133. }
  36134. func (c *ZoneOperationsListCall) doRequest(alt string) (*http.Response, error) {
  36135. var body io.Reader = nil
  36136. c.urlParams_.Set("alt", alt)
  36137. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations")
  36138. urls += "?" + c.urlParams_.Encode()
  36139. req, _ := http.NewRequest("GET", urls, body)
  36140. googleapi.Expand(req.URL, map[string]string{
  36141. "project": c.project,
  36142. "zone": c.zone,
  36143. })
  36144. req.Header.Set("User-Agent", c.s.userAgent())
  36145. if c.ifNoneMatch_ != "" {
  36146. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  36147. }
  36148. if c.ctx_ != nil {
  36149. return ctxhttp.Do(c.ctx_, c.s.client, req)
  36150. }
  36151. return c.s.client.Do(req)
  36152. }
  36153. // Do executes the "compute.zoneOperations.list" call.
  36154. // Exactly one of *OperationList or error will be non-nil. Any non-2xx
  36155. // status code is an error. Response headers are in either
  36156. // *OperationList.ServerResponse.Header or (if a response was returned
  36157. // at all) in error.(*googleapi.Error).Header. Use
  36158. // googleapi.IsNotModified to check whether the returned error was
  36159. // because http.StatusNotModified was returned.
  36160. func (c *ZoneOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, error) {
  36161. gensupport.SetOptions(c.urlParams_, opts...)
  36162. res, err := c.doRequest("json")
  36163. if res != nil && res.StatusCode == http.StatusNotModified {
  36164. if res.Body != nil {
  36165. res.Body.Close()
  36166. }
  36167. return nil, &googleapi.Error{
  36168. Code: res.StatusCode,
  36169. Header: res.Header,
  36170. }
  36171. }
  36172. if err != nil {
  36173. return nil, err
  36174. }
  36175. defer googleapi.CloseBody(res)
  36176. if err := googleapi.CheckResponse(res); err != nil {
  36177. return nil, err
  36178. }
  36179. ret := &OperationList{
  36180. ServerResponse: googleapi.ServerResponse{
  36181. Header: res.Header,
  36182. HTTPStatusCode: res.StatusCode,
  36183. },
  36184. }
  36185. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  36186. return nil, err
  36187. }
  36188. return ret, nil
  36189. // {
  36190. // "description": "Retrieves a list of Operation resources contained within the specified zone.",
  36191. // "httpMethod": "GET",
  36192. // "id": "compute.zoneOperations.list",
  36193. // "parameterOrder": [
  36194. // "project",
  36195. // "zone"
  36196. // ],
  36197. // "parameters": {
  36198. // "filter": {
  36199. // "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.",
  36200. // "location": "query",
  36201. // "type": "string"
  36202. // },
  36203. // "maxResults": {
  36204. // "default": "500",
  36205. // "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.",
  36206. // "format": "uint32",
  36207. // "location": "query",
  36208. // "maximum": "500",
  36209. // "minimum": "0",
  36210. // "type": "integer"
  36211. // },
  36212. // "pageToken": {
  36213. // "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.",
  36214. // "location": "query",
  36215. // "type": "string"
  36216. // },
  36217. // "project": {
  36218. // "description": "Project ID for this request.",
  36219. // "location": "path",
  36220. // "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])?))",
  36221. // "required": true,
  36222. // "type": "string"
  36223. // },
  36224. // "zone": {
  36225. // "description": "Name of the zone scoping this request.",
  36226. // "location": "path",
  36227. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  36228. // "required": true,
  36229. // "type": "string"
  36230. // }
  36231. // },
  36232. // "path": "{project}/zones/{zone}/operations",
  36233. // "response": {
  36234. // "$ref": "OperationList"
  36235. // },
  36236. // "scopes": [
  36237. // "https://www.googleapis.com/auth/cloud-platform",
  36238. // "https://www.googleapis.com/auth/compute",
  36239. // "https://www.googleapis.com/auth/compute.readonly"
  36240. // ]
  36241. // }
  36242. }
  36243. // Pages invokes f for each page of results.
  36244. // A non-nil error returned from f will halt the iteration.
  36245. // The provided context supersedes any context provided to the Context method.
  36246. func (c *ZoneOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
  36247. c.ctx_ = ctx
  36248. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  36249. for {
  36250. x, err := c.Do()
  36251. if err != nil {
  36252. return err
  36253. }
  36254. if err := f(x); err != nil {
  36255. return err
  36256. }
  36257. if x.NextPageToken == "" {
  36258. return nil
  36259. }
  36260. c.PageToken(x.NextPageToken)
  36261. }
  36262. }
  36263. // method id "compute.zones.get":
  36264. type ZonesGetCall struct {
  36265. s *Service
  36266. project string
  36267. zone string
  36268. urlParams_ gensupport.URLParams
  36269. ifNoneMatch_ string
  36270. ctx_ context.Context
  36271. }
  36272. // Get: Returns the specified zone resource.
  36273. // For details, see https://cloud.google.com/compute/docs/reference/latest/zones/get
  36274. func (r *ZonesService) Get(project string, zone string) *ZonesGetCall {
  36275. c := &ZonesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36276. c.project = project
  36277. c.zone = zone
  36278. return c
  36279. }
  36280. // Fields allows partial responses to be retrieved. See
  36281. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36282. // for more information.
  36283. func (c *ZonesGetCall) Fields(s ...googleapi.Field) *ZonesGetCall {
  36284. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36285. return c
  36286. }
  36287. // IfNoneMatch sets the optional parameter which makes the operation
  36288. // fail if the object's ETag matches the given value. This is useful for
  36289. // getting updates only after the object has changed since the last
  36290. // request. Use googleapi.IsNotModified to check whether the response
  36291. // error from Do is the result of In-None-Match.
  36292. func (c *ZonesGetCall) IfNoneMatch(entityTag string) *ZonesGetCall {
  36293. c.ifNoneMatch_ = entityTag
  36294. return c
  36295. }
  36296. // Context sets the context to be used in this call's Do method. Any
  36297. // pending HTTP request will be aborted if the provided context is
  36298. // canceled.
  36299. func (c *ZonesGetCall) Context(ctx context.Context) *ZonesGetCall {
  36300. c.ctx_ = ctx
  36301. return c
  36302. }
  36303. func (c *ZonesGetCall) doRequest(alt string) (*http.Response, error) {
  36304. var body io.Reader = nil
  36305. c.urlParams_.Set("alt", alt)
  36306. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}")
  36307. urls += "?" + c.urlParams_.Encode()
  36308. req, _ := http.NewRequest("GET", urls, body)
  36309. googleapi.Expand(req.URL, map[string]string{
  36310. "project": c.project,
  36311. "zone": c.zone,
  36312. })
  36313. req.Header.Set("User-Agent", c.s.userAgent())
  36314. if c.ifNoneMatch_ != "" {
  36315. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  36316. }
  36317. if c.ctx_ != nil {
  36318. return ctxhttp.Do(c.ctx_, c.s.client, req)
  36319. }
  36320. return c.s.client.Do(req)
  36321. }
  36322. // Do executes the "compute.zones.get" call.
  36323. // Exactly one of *Zone or error will be non-nil. Any non-2xx status
  36324. // code is an error. Response headers are in either
  36325. // *Zone.ServerResponse.Header or (if a response was returned at all) in
  36326. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  36327. // whether the returned error was because http.StatusNotModified was
  36328. // returned.
  36329. func (c *ZonesGetCall) Do(opts ...googleapi.CallOption) (*Zone, error) {
  36330. gensupport.SetOptions(c.urlParams_, opts...)
  36331. res, err := c.doRequest("json")
  36332. if res != nil && res.StatusCode == http.StatusNotModified {
  36333. if res.Body != nil {
  36334. res.Body.Close()
  36335. }
  36336. return nil, &googleapi.Error{
  36337. Code: res.StatusCode,
  36338. Header: res.Header,
  36339. }
  36340. }
  36341. if err != nil {
  36342. return nil, err
  36343. }
  36344. defer googleapi.CloseBody(res)
  36345. if err := googleapi.CheckResponse(res); err != nil {
  36346. return nil, err
  36347. }
  36348. ret := &Zone{
  36349. ServerResponse: googleapi.ServerResponse{
  36350. Header: res.Header,
  36351. HTTPStatusCode: res.StatusCode,
  36352. },
  36353. }
  36354. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  36355. return nil, err
  36356. }
  36357. return ret, nil
  36358. // {
  36359. // "description": "Returns the specified zone resource.",
  36360. // "httpMethod": "GET",
  36361. // "id": "compute.zones.get",
  36362. // "parameterOrder": [
  36363. // "project",
  36364. // "zone"
  36365. // ],
  36366. // "parameters": {
  36367. // "project": {
  36368. // "description": "Project ID for this request.",
  36369. // "location": "path",
  36370. // "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])?))",
  36371. // "required": true,
  36372. // "type": "string"
  36373. // },
  36374. // "zone": {
  36375. // "description": "Name of the zone resource to return.",
  36376. // "location": "path",
  36377. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  36378. // "required": true,
  36379. // "type": "string"
  36380. // }
  36381. // },
  36382. // "path": "{project}/zones/{zone}",
  36383. // "response": {
  36384. // "$ref": "Zone"
  36385. // },
  36386. // "scopes": [
  36387. // "https://www.googleapis.com/auth/cloud-platform",
  36388. // "https://www.googleapis.com/auth/compute",
  36389. // "https://www.googleapis.com/auth/compute.readonly"
  36390. // ]
  36391. // }
  36392. }
  36393. // method id "compute.zones.list":
  36394. type ZonesListCall struct {
  36395. s *Service
  36396. project string
  36397. urlParams_ gensupport.URLParams
  36398. ifNoneMatch_ string
  36399. ctx_ context.Context
  36400. }
  36401. // List: Retrieves the list of zone resources available to the specified
  36402. // project.
  36403. // For details, see https://cloud.google.com/compute/docs/reference/latest/zones/list
  36404. func (r *ZonesService) List(project string) *ZonesListCall {
  36405. c := &ZonesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36406. c.project = project
  36407. return c
  36408. }
  36409. // Filter sets the optional parameter "filter": Sets a filter expression
  36410. // for filtering listed resources, in the form filter={expression}. Your
  36411. // {expression} must be in the format: field_name comparison_string
  36412. // literal_string.
  36413. //
  36414. // The field_name is the name of the field you want to compare. Only
  36415. // atomic field types are supported (string, number, boolean). The
  36416. // comparison_string must be either eq (equals) or ne (not equals). The
  36417. // literal_string is the string value to filter to. The literal value
  36418. // must be valid for the type of field you are filtering by (string,
  36419. // number, boolean). For string fields, the literal value is interpreted
  36420. // as a regular expression using RE2 syntax. The literal value must
  36421. // match the entire field.
  36422. //
  36423. // For example, filter=name ne example-instance.
  36424. //
  36425. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  36426. // you can also filter on nested fields. For example, you could filter
  36427. // on instances that have set the scheduling.automaticRestart field to
  36428. // true. In particular, use filtering on nested fields to take advantage
  36429. // of instance labels to organize and filter results based on label
  36430. // values.
  36431. //
  36432. // The Beta API also supports filtering on multiple expressions by
  36433. // providing each separate expression within parentheses. For example,
  36434. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  36435. // Multiple expressions are treated as AND expressions meaning that
  36436. // resources must match all expressions to pass the filters.
  36437. func (c *ZonesListCall) Filter(filter string) *ZonesListCall {
  36438. c.urlParams_.Set("filter", filter)
  36439. return c
  36440. }
  36441. // MaxResults sets the optional parameter "maxResults": The maximum
  36442. // number of results per page that Compute Engine should return. If the
  36443. // number of available results is larger than maxResults, Compute Engine
  36444. // returns a nextPageToken that can be used to get the next page of
  36445. // results in subsequent list requests.
  36446. func (c *ZonesListCall) MaxResults(maxResults int64) *ZonesListCall {
  36447. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  36448. return c
  36449. }
  36450. // PageToken sets the optional parameter "pageToken": Specifies a page
  36451. // token to use. Set pageToken to the nextPageToken returned by a
  36452. // previous list request to get the next page of results.
  36453. func (c *ZonesListCall) PageToken(pageToken string) *ZonesListCall {
  36454. c.urlParams_.Set("pageToken", pageToken)
  36455. return c
  36456. }
  36457. // Fields allows partial responses to be retrieved. See
  36458. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36459. // for more information.
  36460. func (c *ZonesListCall) Fields(s ...googleapi.Field) *ZonesListCall {
  36461. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36462. return c
  36463. }
  36464. // IfNoneMatch sets the optional parameter which makes the operation
  36465. // fail if the object's ETag matches the given value. This is useful for
  36466. // getting updates only after the object has changed since the last
  36467. // request. Use googleapi.IsNotModified to check whether the response
  36468. // error from Do is the result of In-None-Match.
  36469. func (c *ZonesListCall) IfNoneMatch(entityTag string) *ZonesListCall {
  36470. c.ifNoneMatch_ = entityTag
  36471. return c
  36472. }
  36473. // Context sets the context to be used in this call's Do method. Any
  36474. // pending HTTP request will be aborted if the provided context is
  36475. // canceled.
  36476. func (c *ZonesListCall) Context(ctx context.Context) *ZonesListCall {
  36477. c.ctx_ = ctx
  36478. return c
  36479. }
  36480. func (c *ZonesListCall) doRequest(alt string) (*http.Response, error) {
  36481. var body io.Reader = nil
  36482. c.urlParams_.Set("alt", alt)
  36483. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones")
  36484. urls += "?" + c.urlParams_.Encode()
  36485. req, _ := http.NewRequest("GET", urls, body)
  36486. googleapi.Expand(req.URL, map[string]string{
  36487. "project": c.project,
  36488. })
  36489. req.Header.Set("User-Agent", c.s.userAgent())
  36490. if c.ifNoneMatch_ != "" {
  36491. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  36492. }
  36493. if c.ctx_ != nil {
  36494. return ctxhttp.Do(c.ctx_, c.s.client, req)
  36495. }
  36496. return c.s.client.Do(req)
  36497. }
  36498. // Do executes the "compute.zones.list" call.
  36499. // Exactly one of *ZoneList or error will be non-nil. Any non-2xx status
  36500. // code is an error. Response headers are in either
  36501. // *ZoneList.ServerResponse.Header or (if a response was returned at
  36502. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36503. // to check whether the returned error was because
  36504. // http.StatusNotModified was returned.
  36505. func (c *ZonesListCall) Do(opts ...googleapi.CallOption) (*ZoneList, error) {
  36506. gensupport.SetOptions(c.urlParams_, opts...)
  36507. res, err := c.doRequest("json")
  36508. if res != nil && res.StatusCode == http.StatusNotModified {
  36509. if res.Body != nil {
  36510. res.Body.Close()
  36511. }
  36512. return nil, &googleapi.Error{
  36513. Code: res.StatusCode,
  36514. Header: res.Header,
  36515. }
  36516. }
  36517. if err != nil {
  36518. return nil, err
  36519. }
  36520. defer googleapi.CloseBody(res)
  36521. if err := googleapi.CheckResponse(res); err != nil {
  36522. return nil, err
  36523. }
  36524. ret := &ZoneList{
  36525. ServerResponse: googleapi.ServerResponse{
  36526. Header: res.Header,
  36527. HTTPStatusCode: res.StatusCode,
  36528. },
  36529. }
  36530. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  36531. return nil, err
  36532. }
  36533. return ret, nil
  36534. // {
  36535. // "description": "Retrieves the list of zone resources available to the specified project.",
  36536. // "httpMethod": "GET",
  36537. // "id": "compute.zones.list",
  36538. // "parameterOrder": [
  36539. // "project"
  36540. // ],
  36541. // "parameters": {
  36542. // "filter": {
  36543. // "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.",
  36544. // "location": "query",
  36545. // "type": "string"
  36546. // },
  36547. // "maxResults": {
  36548. // "default": "500",
  36549. // "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.",
  36550. // "format": "uint32",
  36551. // "location": "query",
  36552. // "maximum": "500",
  36553. // "minimum": "0",
  36554. // "type": "integer"
  36555. // },
  36556. // "pageToken": {
  36557. // "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.",
  36558. // "location": "query",
  36559. // "type": "string"
  36560. // },
  36561. // "project": {
  36562. // "description": "Project ID for this request.",
  36563. // "location": "path",
  36564. // "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])?))",
  36565. // "required": true,
  36566. // "type": "string"
  36567. // }
  36568. // },
  36569. // "path": "{project}/zones",
  36570. // "response": {
  36571. // "$ref": "ZoneList"
  36572. // },
  36573. // "scopes": [
  36574. // "https://www.googleapis.com/auth/cloud-platform",
  36575. // "https://www.googleapis.com/auth/compute",
  36576. // "https://www.googleapis.com/auth/compute.readonly"
  36577. // ]
  36578. // }
  36579. }
  36580. // Pages invokes f for each page of results.
  36581. // A non-nil error returned from f will halt the iteration.
  36582. // The provided context supersedes any context provided to the Context method.
  36583. func (c *ZonesListCall) Pages(ctx context.Context, f func(*ZoneList) error) error {
  36584. c.ctx_ = ctx
  36585. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  36586. for {
  36587. x, err := c.Do()
  36588. if err != nil {
  36589. return err
  36590. }
  36591. if err := f(x); err != nil {
  36592. return err
  36593. }
  36594. if x.NextPageToken == "" {
  36595. return nil
  36596. }
  36597. c.PageToken(x.NextPageToken)
  36598. }
  36599. }